diff --git a/examples/authz/.eslintrc.json b/examples/authz/.eslintrc.json
new file mode 100644
index 00000000..bffb357a
--- /dev/null
+++ b/examples/authz/.eslintrc.json
@@ -0,0 +1,3 @@
+{
+ "extends": "next/core-web-vitals"
+}
diff --git a/examples/authz/.gitignore b/examples/authz/.gitignore
new file mode 100644
index 00000000..15e93ee8
--- /dev/null
+++ b/examples/authz/.gitignore
@@ -0,0 +1,37 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+/main
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+.pnpm-debug.log*
+
+# local env files
+.env*.local
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
diff --git a/examples/authz/.yarnrc.yml b/examples/authz/.yarnrc.yml
new file mode 100644
index 00000000..3186f3f0
--- /dev/null
+++ b/examples/authz/.yarnrc.yml
@@ -0,0 +1 @@
+nodeLinker: node-modules
diff --git a/examples/authz/CHANGELOG.md b/examples/authz/CHANGELOG.md
new file mode 100644
index 00000000..197e0668
--- /dev/null
+++ b/examples/authz/CHANGELOG.md
@@ -0,0 +1,50 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+# 1.1.0 (2024-10-08)
+
+
+### Bug Fixes
+
+* deps ([b2aa70b](https://github.com/hyperweb-io/create-cosmos-app/commit/b2aa70ba9ef34fd96954c033220ff160d2c8ece7))
+* old ci job yarn4 issues ([#182](https://github.com/hyperweb-io/create-cosmos-app/issues/182)) ([2bb19f7](https://github.com/hyperweb-io/create-cosmos-app/commit/2bb19f75fcc6ffaa4bcb63ecf071009d2f9d7e76))
+* rename telescope-authz to authz ([9ba95fd](https://github.com/hyperweb-io/create-cosmos-app/commit/9ba95fd9d2e23620b1997e87f780460602507d60))
+* try locks update script ([000aa5f](https://github.com/hyperweb-io/create-cosmos-app/commit/000aa5fc73faa0182a23f50a6402e8b2351a587c))
+* upgrade deps and fix multi chain dropdown ([eecbcaa](https://github.com/hyperweb-io/create-cosmos-app/commit/eecbcaad5e7729f00f9121250c04eb40d201ed80))
+
+
+
+
+
+# 1.0.0 (2024-04-06)
+
+
+### Bug Fixes
+
+* rename telescope-authz to authz ([e30689d](https://github.com/hyperweb-io/create-cosmos-app/commit/e30689d1ff5f5c42a1c962aecc8b568511e0d0c2))
+
+
+
+
+
+## [0.0.4](https://github.com/hyperweb-io/create-cosmos-app/compare/@cosmology/telescope-authz-example@0.0.3...@cosmology/telescope-authz-example@0.0.4) (2024-01-20)
+
+**Note:** Version bump only for package @cosmology/telescope-authz-example
+
+
+
+
+
+## [0.0.3](https://github.com/hyperweb-io/create-cosmos-app/compare/@cosmology/telescope-authz-example@0.0.2...@cosmology/telescope-authz-example@0.0.3) (2024-01-20)
+
+**Note:** Version bump only for package @cosmology/telescope-authz-example
+
+
+
+
+
+## 0.0.2 (2024-01-19)
+
+**Note:** Version bump only for package @cosmology/telescope-authz-example
diff --git a/examples/authz/README.md b/examples/authz/README.md
new file mode 100644
index 00000000..2ea966b1
--- /dev/null
+++ b/examples/authz/README.md
@@ -0,0 +1,88 @@
+This is a Cosmos App project bootstrapped with [`create-cosmos-app`](https://github.com/hyperweb-io/create-cosmos-app).
+
+## Getting Started
+
+First, install the packages and run the development server:
+
+```bash
+yarn && yarn dev
+```
+
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+
+You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
+
+## Learn More
+
+### Chain Registry
+
+The npm package for the Official Cosmos chain registry. Get chain and token data for you application.
+
+* https://github.com/hyperweb-io/chain-registry
+
+### Cosmology Videos
+
+Checkout more videos for how to use various frontend tooling in the Cosmos!
+
+* https://cosmology.zone/learn
+
+### Interchain Kit
+
+A wallet connector for the Cosmos ⚛️
+
+* https://github.com/hyperweb-io/interchain-kit
+
+### Telescope
+
+A "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. Telescope is used to generate libraries for Cosmos blockchains. Simply point to your protobuffer files and create developer-friendly Typescript libraries for teams to build on your blockchain.
+
+* https://github.com/hyperweb-io/telescope
+
+🎥 [Checkout the Telescope video playlist](https://www.youtube.com/watch?v=n82MsLe82mk&list=PL-lMkVv7GZwyQaK6bp6kMdOS5mzosxytC) to learn how to use `telescope`!
+
+### CosmWasm TS Codegen
+
+The quickest and easiest way to interact with CosmWasm Contracts. @cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.
+
+* https://github.com/CosmWasm/ts-codegen
+
+🎥 [Checkout the CosmWasm/ts-codegen video playlist](https://www.youtube.com/watch?v=D_A5V2PfNLA&list=PL-lMkVv7GZwz1KO3jANwr5W4MoziruXwK) to learn how to use `ts-codegen`!
+
+
+## Learn More about Next.js
+
+To learn more about Next.js, take a look at the following resources:
+
+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
+
+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
+
+## Deploy on Vercel
+
+The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
+
+Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
+
+## Related
+
+Checkout these related projects:
+
+* [@cosmology/telescope](https://github.com/hyperweb-io/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
+* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes.
+* [chain-registry](https://github.com/hyperweb-io/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
+* [interchain-kit](https://github.com/hyperweb-io/interchain-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface.
+* [create-cosmos-app](https://github.com/hyperweb-io/create-cosmos-app) Set up a modern Cosmos app by running one command.
+* [interchain-ui](https://github.com/hyperweb-io/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
+* [starship](https://github.com/hyperweb-io/starship) Unified Testing and Development for the Interchain.
+
+## Credits
+
+🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator)
+
+
+## Disclaimer
+
+AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
+
+No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
diff --git a/examples/authz/components/authz/AuthzSection.tsx b/examples/authz/components/authz/AuthzSection.tsx
new file mode 100644
index 00000000..3413c780
--- /dev/null
+++ b/examples/authz/components/authz/AuthzSection.tsx
@@ -0,0 +1,70 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import { useChain } from '@interchain-kit/react';
+import { Box, Button, Tabs, Text } from '@interchain-ui/react';
+
+import { Grants } from './Grants';
+import { GrantModal } from './GrantModal';
+
+export const AuthzSection = ({ chainName }: { chainName: string }) => {
+ const [isOpen, setIsOpen] = useState(false);
+ const [activeTab, setActiveTab] = useState(0);
+ const { address } = useChain(chainName);
+
+ if (!address) {
+ return (
+
+ Please connect your wallet to view and create grants
+
+ );
+ }
+
+ return (
+
+
+ setActiveTab(tabId)}
+ attributes={{ width: '$min' }}
+ />
+
+
+
+
+
+ setIsOpen(false)}
+ chainName={chainName}
+ />
+
+ );
+};
diff --git a/examples/authz/components/authz/CustomizationField.tsx b/examples/authz/components/authz/CustomizationField.tsx
new file mode 100644
index 00000000..de233e7d
--- /dev/null
+++ b/examples/authz/components/authz/CustomizationField.tsx
@@ -0,0 +1,135 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { Dispatch, SetStateAction, useState } from 'react';
+import { Box, NumberField, SelectButton, Text } from '@interchain-ui/react';
+
+import { useValidators } from '@/hooks';
+import { Permission, PermissionId } from '@/configs';
+import { SelectValidatorsModal } from './SelectValidatorsModal';
+import { AccessList } from './GrantModal';
+
+// ==============================================
+
+type SendCustomizationProps = {
+ value: number | undefined;
+ onChange: (value: string) => void;
+};
+
+const SendCustomization = ({ value, onChange }: SendCustomizationProps) => {
+ return (
+ {
+ // @ts-ignore
+ onChange(e.target.value);
+ }}
+ formatOptions={{
+ maximumFractionDigits: 6,
+ }}
+ />
+ );
+};
+
+// ==============================================
+
+type DelegateCustomizationProps = {
+ value: number | undefined;
+ onChange: (value: string) => void;
+ chainName: string;
+ accessList: AccessList;
+ setAccessList: Dispatch>;
+};
+
+const DelegateCustomization = ({
+ value,
+ onChange,
+ chainName,
+ accessList,
+ setAccessList,
+}: DelegateCustomizationProps) => {
+ const [isOpen, setIsOpen] = useState(false);
+
+ const { data } = useValidators(chainName);
+
+ const validatorNames = data
+ ? accessList.addresses.map(
+ (address) => data.find((v) => v.address === address)!.name
+ )
+ : [];
+
+ return (
+ <>
+ {
+ // @ts-ignore
+ onChange(e.target.value);
+ }}
+ formatOptions={{
+ maximumFractionDigits: 6,
+ }}
+ />
+ setIsOpen(true)}
+ />
+ 0 ? 'block' : 'none'}
+ mt="$2"
+ px="$2"
+ >
+
+
+ {accessList.type === 'allowList' ? 'Allow List' : 'Deny List'}
+ :
+
+ {validatorNames.join(', ')}
+
+
+ setIsOpen(false)}
+ />
+ >
+ );
+};
+
+// ==============================================
+
+type CustomizationFieldProps =
+ | ({
+ permissionType: typeof Permission['Send'];
+ } & SendCustomizationProps)
+ | ({
+ permissionType: typeof Permission['Delegate'];
+ } & DelegateCustomizationProps);
+
+export const CustomizationField = ({
+ permissionType,
+ ...rest
+}: CustomizationFieldProps): JSX.Element | null => {
+ const fields: Partial> = {
+ send:
+ permissionType === 'send' ? (
+
+ ) : null,
+ delegate:
+ permissionType === 'delegate' ? (
+
+ ) : null,
+ };
+
+ return fields[permissionType] ?? null;
+};
diff --git a/examples/authz/components/authz/GrantCard.tsx b/examples/authz/components/authz/GrantCard.tsx
new file mode 100644
index 00000000..ab631477
--- /dev/null
+++ b/examples/authz/components/authz/GrantCard.tsx
@@ -0,0 +1,219 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import Link from 'next/link';
+import Image from 'next/image';
+import { useState } from 'react';
+import {
+ Box,
+ Button,
+ IconButton,
+ Stack,
+ Text,
+ TextField,
+} from '@interchain-ui/react';
+import { useChain } from '@interchain-kit/react';
+
+import {
+ getChainLogoByChainName,
+ PrettyGrant,
+ PrettyPermission,
+} from '@/utils';
+import { useAuthzContext } from '@/context';
+import { useAuthzTx, useGrants, useSigningClient } from '@/hooks';
+import { getCoin, permissionNameToRouteMap } from '@/configs';
+
+import styles from '@/styles/custom.module.css';
+import { useRevoke } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
+import { defaultContext } from '@tanstack/react-query';
+
+type GrantCardProps = {
+ role: 'granter' | 'grantee';
+ grant: PrettyGrant;
+ chainName: string;
+ onViewDetails: () => void;
+};
+
+export const GrantCard = ({
+ role,
+ grant,
+ chainName,
+ onViewDetails,
+}: GrantCardProps) => {
+ const [isCopied, setIsCopied] = useState(false);
+ const [isRevoking, setIsRevoking] = useState(false);
+ const [revokingPermission, setRevokingPermission] =
+ useState();
+
+ const {
+ address: signerAddress,
+ chain,
+ getSigningClient,
+ } = useChain(chainName);
+ const { refetch } = useGrants(chainName);
+ const { setPermission } = useAuthzContext();
+ const { createRevokeMsg } = useAuthzTx(chainName);
+ const { data: client } = useSigningClient(chainName);
+
+ const { mutate: revoke } = useRevoke({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const { address, permissions } = grant;
+
+ const isGranter = role === 'granter';
+ const token = getCoin(chainName);
+
+ const copy = (text: string) => {
+ if (isCopied) return;
+
+ navigator.clipboard
+ .writeText(text)
+ .then(() => {
+ setIsCopied(true);
+ setTimeout(() => setIsCopied(false), 800);
+ })
+ .catch((error) => {
+ console.error('Failed to copy:', error);
+ });
+ };
+
+ const handleRevoke = (permission: PrettyPermission) => {
+ setIsRevoking(true);
+
+ const fee = {
+ amount: [
+ {
+ denom: token.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ revoke(
+ {
+ signerAddress,
+ message: createRevokeMsg(permission),
+ fee: fee,
+ memo: 'revoking permission',
+ },
+ {
+ onSuccess: () => {
+ refetch();
+ },
+ onComplete: () => {
+ setIsRevoking(false);
+ },
+ }
+ );
+ };
+
+ return (
+
+
+
+
+ {chain.pretty_name}
+
+
+
+
+
+
+ copy(address)}
+ />
+
+
+
+
+ Permissions
+
+
+
+ {permissions.map((permission) =>
+ isGranter ? (
+
+ ) : permissionNameToRouteMap[permission.name] ? (
+
+
+
+ ) : (
+
+ )
+ )}
+
+
+
+
+ );
+};
diff --git a/examples/authz/components/authz/GrantDetailsModal.tsx b/examples/authz/components/authz/GrantDetailsModal.tsx
new file mode 100644
index 00000000..db1bd5f0
--- /dev/null
+++ b/examples/authz/components/authz/GrantDetailsModal.tsx
@@ -0,0 +1,127 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import { BasicModal, Box, Button } from '@interchain-ui/react';
+
+import { useAuthzTx, useGrants, useSigningClient } from '@/hooks';
+import { PrettyGrant, PrettyPermission } from '@/utils';
+import { PermissionDetailCard } from './PermissionDetailCard';
+import { useRevoke } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
+import { defaultContext } from '@tanstack/react-query';
+import { useChain } from '@interchain-kit/react';
+
+type GrantDetailsModalProps = {
+ grant: PrettyGrant;
+ chainName: string;
+ role: 'granter' | 'grantee';
+ isOpen: boolean;
+ onClose: () => void;
+};
+
+export const GrantDetailsModal = ({
+ role,
+ grant,
+ isOpen,
+ onClose,
+ chainName,
+}: GrantDetailsModalProps) => {
+ const { permissions } = grant;
+ const isGranter = role === 'granter';
+
+ const [isRevoking, setIsRevoking] = useState(false);
+ const [revokingPermission, setRevokingPermission] =
+ useState();
+
+ const { address: signerAddress } = useChain(chainName);
+ const { refetch } = useGrants(chainName);
+ const { createRevokeMsg } = useAuthzTx(chainName);
+
+ const { data: client } = useSigningClient(chainName);
+
+ const { mutate: revoke } = useRevoke({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const handleRevoke = (permissions: PrettyPermission[]) => {
+ setIsRevoking(true);
+
+ const fee = {
+ amount: [
+ {
+ denom: token.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ revoke(
+ {
+ signerAddress,
+ message: permissions.map(createRevokeMsg),
+ fee: fee,
+ memo: 'revoking permission',
+ },
+ {
+ onSuccess: () => {
+ refetch();
+ onClose();
+ },
+ onError: () => {
+ setIsRevoking(false);
+ setRevokingPermission(undefined);
+ },
+ }
+ );
+ };
+
+ return (
+
+
+
+ {permissions.map((permission) => (
+ {
+ handleRevoke([permission]);
+ setRevokingPermission(permission);
+ }}
+ isRevoking={
+ isRevoking && permission.name === revokingPermission?.name
+ }
+ chainName={chainName}
+ permission={permission}
+ />
+ ))}
+
+
+ {isGranter && (
+
+ )}
+
+
+ );
+};
diff --git a/examples/authz/components/authz/GrantModal.tsx b/examples/authz/components/authz/GrantModal.tsx
new file mode 100644
index 00000000..80e3db2b
--- /dev/null
+++ b/examples/authz/components/authz/GrantModal.tsx
@@ -0,0 +1,322 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import {
+ BasicModal,
+ Box,
+ TextField,
+ Button,
+ Popover,
+ PopoverTrigger,
+ PopoverContent,
+ SelectButton,
+ ListItem,
+ Stack,
+ FieldLabel,
+} from '@interchain-ui/react';
+import { coin } from '@cosmjs/amino';
+import { useChain } from '@interchain-kit/react';
+import { IoMdCalendar } from 'react-icons/io';
+import Calendar from 'react-calendar';
+import dayjs from 'dayjs';
+
+import {
+ getExponent,
+ PermissionId,
+ PermissionItem,
+ permissions,
+} from '@/configs';
+import { AuthorizationType } from '@interchainjs/react/cosmos/staking/v1beta1/authz';
+import { GrantMsg, useAuthzTx, useGrants, useSigningClient } from '@/hooks';
+import { getTokenByChainName, shiftDigits } from '@/utils';
+import { CustomizationField } from './CustomizationField';
+import { AddressInput } from '@/components';
+
+import styles from '@/styles/custom.module.css';
+import { useGrant } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
+import { defaultContext } from '@tanstack/react-query';
+import { SendAuthorization } from '@interchainjs/react/cosmos/bank/v1beta1/authz';
+
+export type AccessList = {
+ type: 'allowList' | 'denyList';
+ addresses: string[];
+};
+
+type GrantModalProps = {
+ isOpen: boolean;
+ onClose: () => void;
+ chainName: string;
+};
+
+export const GrantModal = ({ isOpen, onClose, chainName }: GrantModalProps) => {
+ const [isDropdownOpen, setIsDropdownOpen] = useState(false);
+ const [isCalendarOpen, setIsCalendarOpen] = useState(false);
+
+ const [granteeAddress, setGranteeAddress] = useState('');
+ const [addressErrorMsg, setAddressErrorMsg] = useState('');
+ const [expiryDate, setExpiryDate] = useState(null);
+ const [selectedPermission, setSelectedPermission] =
+ useState(null);
+
+ const [sendLimit, setSendLimit] = useState(undefined);
+ const [delegateLimit, setDelegateLimit] = useState(
+ undefined
+ );
+ const [accessList, setAccessList] = useState({
+ type: 'allowList',
+ addresses: [],
+ });
+
+ const [isGranting, setIsGranting] = useState(false);
+
+ const { refetch } = useGrants(chainName);
+ const { address } = useChain(chainName);
+ const { createGrantMsg } = useAuthzTx(chainName);
+ const { data: client } = useSigningClient(chainName);
+
+ const { mutate: grant } = useGrant({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const token = getTokenByChainName(chainName);
+ const exponent = getExponent(chainName);
+ const denom = token.base;
+
+ const onModalClose = () => {
+ setGranteeAddress('');
+ setExpiryDate(null);
+ setSelectedPermission(null);
+ setSendLimit(undefined);
+ setDelegateLimit(undefined);
+ setIsGranting(false);
+ setAccessList({ type: 'allowList', addresses: [] });
+ onClose();
+ };
+
+ const onGrantClick = () => {
+ if (!address || !granteeAddress || !expiryDate || !selectedPermission)
+ return;
+
+ setIsGranting(true);
+
+ const sendMsg: GrantMsg = {
+ grantType: 'send',
+ customize: sendLimit
+ ? SendAuthorization.fromPartial({
+ spendLimit: [coin(shiftDigits(sendLimit, exponent), denom)],
+ })
+ : undefined,
+ };
+
+ const delegateMsg: GrantMsg = {
+ grantType: 'delegate',
+ customize:
+ delegateLimit || accessList.addresses.length > 0
+ ? {
+ authorizationType: AuthorizationType.AUTHORIZATION_TYPE_DELEGATE,
+ maxTokens: coin(shiftDigits(delegateLimit, exponent), denom),
+ [accessList.type]: { address: accessList.addresses },
+ }
+ : undefined,
+ };
+
+ const grantMsg: Record = {
+ send: sendMsg,
+ delegate: delegateMsg,
+ vote: { grantType: 'vote' },
+ 'claim-rewards': { grantType: 'claim-rewards' },
+ };
+
+ const msg = createGrantMsg({
+ grantee: granteeAddress,
+ granter: address,
+ expiration: expiryDate,
+ ...grantMsg[selectedPermission.id],
+ });
+
+ const fee = {
+ amount: [
+ {
+ denom: token.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ grant(
+ {
+ signerAddress: address,
+ message: msg,
+ fee,
+ memo: 'granting permission',
+ },
+ {
+ onSuccess: () => {
+ refetch();
+ onModalClose();
+ },
+ onComplete: () => {
+ setIsGranting(false);
+ },
+ }
+ );
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ {}}
+ />
+
+
+
+ {permissions.map((p) => (
+ {
+ setSelectedPermission(p);
+ setIsDropdownOpen(false);
+ },
+ }}
+ >
+ {p.name}
+
+ ))}
+
+
+
+
+ {selectedPermission?.id === 'send' && (
+ {
+ if (!val) {
+ setSendLimit(undefined);
+ return;
+ }
+ setSendLimit(Number(val));
+ }}
+ />
+ )}
+
+ {selectedPermission?.id === 'delegate' && (
+ {
+ if (!val) {
+ setDelegateLimit(undefined);
+ return;
+ }
+ setDelegateLimit(Number(val));
+ }}
+ />
+ )}
+
+
+
+
+
+
+
+
+
+
+
+ {
+ if (Array.isArray(val)) {
+ setExpiryDate(val[1]);
+ return;
+ }
+ setExpiryDate(val);
+ }}
+ onClickDay={() => {
+ setIsCalendarOpen(false);
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/examples/authz/components/authz/Grants.tsx b/examples/authz/components/authz/Grants.tsx
new file mode 100644
index 00000000..8efb08c1
--- /dev/null
+++ b/examples/authz/components/authz/Grants.tsx
@@ -0,0 +1,87 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import { Box, Spinner, Text } from '@interchain-ui/react';
+
+import { useGrants } from '@/hooks';
+import { PrettyGrant } from '@/utils';
+import { GrantCard } from './GrantCard';
+import { GrantDetailsModal } from './GrantDetailsModal';
+
+type GrantsProps = {
+ role: 'granter' | 'grantee';
+ chainName: string;
+};
+
+export const Grants = ({ chainName, role }: GrantsProps) => {
+ const [isOpen, setIsOpen] = useState(false);
+ const [viewingGrant, setViewingGrant] = useState();
+ const { data, isLoading, isError } = useGrants(chainName);
+
+ const isGranter = role === 'granter';
+ const grants = isGranter ? data?.granterGrants : data?.granteeGrants;
+
+ const renderContent = () => {
+ if (isError) {
+ return (
+
+ There was an error fetching grants. Please try again later.
+
+ );
+ }
+
+ if (isLoading) {
+ return ;
+ }
+
+ if (grants && grants.length > 0) {
+ return (
+
+ {grants.map((grant) => (
+ {
+ setIsOpen(true);
+ setViewingGrant(grant);
+ }}
+ />
+ ))}
+
+ );
+ }
+
+ return (
+
+ {isGranter
+ ? "You haven't granted any permission yet"
+ : "You don't have any grants"}
+
+ );
+ };
+
+ return (
+
+ {renderContent()}
+
+ {viewingGrant && (
+ setIsOpen(false)}
+ />
+ )}
+
+ );
+};
diff --git a/examples/authz/components/authz/LoginInfoBanner.tsx b/examples/authz/components/authz/LoginInfoBanner.tsx
new file mode 100644
index 00000000..050a10db
--- /dev/null
+++ b/examples/authz/components/authz/LoginInfoBanner.tsx
@@ -0,0 +1,43 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { WalletState } from '@interchain-kit/core';
+import { useChain } from '@interchain-kit/react';
+import { Box, Icon, Text } from '@interchain-ui/react';
+
+type LoginInfoBannerProps = {
+ loginAddress: string;
+ chainName: string;
+};
+
+export const LoginInfoBanner = ({
+ loginAddress,
+ chainName,
+}: LoginInfoBannerProps) => {
+ const { status } = useChain(chainName);
+
+ if (status === WalletState.Connected) return null;
+
+ return (
+
+
+
+ You are now logged in as
+
+ {loginAddress}
+
+
+
+ );
+};
diff --git a/examples/authz/components/authz/PermissionDetailCard.tsx b/examples/authz/components/authz/PermissionDetailCard.tsx
new file mode 100644
index 00000000..822afcc2
--- /dev/null
+++ b/examples/authz/components/authz/PermissionDetailCard.tsx
@@ -0,0 +1,133 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import Link from 'next/link';
+import { Box, Button, Icon, Skeleton, Text } from '@interchain-ui/react';
+
+import { useValidators } from '@/hooks';
+import { permissionNameToRouteMap } from '@/configs';
+import { getAttributePairs, PrettyGrant } from '@/utils';
+import { useAuthzContext } from '@/context';
+
+type PermissionDetailCardProps = {
+ role: 'granter' | 'grantee';
+ onRevoke: () => void;
+ isRevoking: boolean;
+ chainName: string;
+ permission: PrettyGrant['permissions'][0];
+};
+
+export const PermissionDetailCard = ({
+ role,
+ onRevoke,
+ isRevoking,
+ chainName,
+ permission,
+}: PermissionDetailCardProps) => {
+ const { name, expiration, expiry, authorization } = permission;
+ const isGranter = role === 'granter';
+
+ const { setPermission } = useAuthzContext();
+ const { data, isLoading } = useValidators(chainName, { fetchLogos: false });
+ const attributes = getAttributePairs(authorization, data || []);
+
+ return (
+
+
+ {isGranter ? (
+
+
+ {name}
+
+
+
+ ) : permissionNameToRouteMap[name] ? (
+
+ setPermission(permission) }}
+ >
+
+ {name}
+
+
+
+
+ ) : (
+
+ {name}
+
+ )}
+
+
+
+ {expiration && }
+ {attributes.map((attr) => (
+
+ ))}
+
+
+ );
+};
+
+type PermissionAttributeProps = {
+ label: string;
+ value: string;
+ isLoading?: boolean;
+};
+
+const PermissionAttribute = ({
+ label,
+ value,
+ isLoading = false,
+}: PermissionAttributeProps) => {
+ return (
+
+
+ {label}
+
+ {isLoading ? (
+
+ ) : (
+
+ {value}
+
+ )}
+
+ );
+};
diff --git a/examples/authz/components/authz/SelectValidatorsModal.tsx b/examples/authz/components/authz/SelectValidatorsModal.tsx
new file mode 100644
index 00000000..d0f6cbd0
--- /dev/null
+++ b/examples/authz/components/authz/SelectValidatorsModal.tsx
@@ -0,0 +1,164 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { Dispatch, SetStateAction, useMemo, useState } from 'react';
+import {
+ BasicModal,
+ Box,
+ Button,
+ GovernanceRadio,
+ GovernanceRadioGroup,
+ GridColumn,
+ Spinner,
+ Stack,
+ Text,
+ ValidatorList,
+ ValidatorNameCell,
+} from '@interchain-ui/react';
+
+import { useValidators } from '@/hooks';
+import { ExtendedValidator as Validator } from '@/utils';
+import { AccessList } from './GrantModal';
+
+type SelectValidatorsModalProps = {
+ isOpen: boolean;
+ onClose: () => void;
+ chainName: string;
+ accessList: AccessList;
+ setAccessList: Dispatch>;
+};
+
+type ListType = 'allowList' | 'denyList';
+
+export const SelectValidatorsModal = ({
+ isOpen,
+ onClose,
+ chainName,
+ accessList,
+ setAccessList,
+}: SelectValidatorsModalProps) => {
+ const { data, isLoading } = useValidators(chainName);
+ const listType = accessList.type;
+
+ const columns: GridColumn[] = useMemo(() => {
+ return [
+ {
+ id: 'validator',
+ label: 'Validator',
+ width: '196px',
+ align: 'left',
+ render: (validator: Validator) => (
+
+ ),
+ },
+ {
+ id: 'action',
+ width: '126px',
+ align: 'right',
+ render: (validator: Validator) => (
+
+ {accessList.addresses.includes(validator.address) ? (
+
+ ) : (
+ <>
+
+ >
+ )}
+
+ ),
+ },
+ ];
+ }, [chainName, accessList]);
+
+ return (
+
+
+ {isLoading ? (
+
+ ) : data && data.length > 0 ? (
+
+
+ {
+ setAccessList((prev) => ({
+ ...prev,
+ type: selected as ListType,
+ }));
+ }}
+ >
+
+
+ Allow List
+
+ Deny List
+
+
+
+
+
+
+ ) : (
+
+ No Validators Found
+
+ )}
+
+
+ );
+};
diff --git a/examples/authz/components/authz/index.ts b/examples/authz/components/authz/index.ts
new file mode 100644
index 00000000..fe075840
--- /dev/null
+++ b/examples/authz/components/authz/index.ts
@@ -0,0 +1,2 @@
+export * from './AuthzSection';
+export * from './LoginInfoBanner';
diff --git a/examples/authz/components/claim-rewards/ClaimRewardsSection.tsx b/examples/authz/components/claim-rewards/ClaimRewardsSection.tsx
new file mode 100644
index 00000000..edb287f8
--- /dev/null
+++ b/examples/authz/components/claim-rewards/ClaimRewardsSection.tsx
@@ -0,0 +1,49 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useChain } from '@interchain-kit/react';
+import { Box, Spinner, Text } from '@interchain-ui/react';
+
+import { useStakingData } from '@/hooks';
+import Overview from './Overview';
+import { WalletState } from '@interchain-kit/core';
+
+export const ClaimRewardsSection = ({ chainName }: { chainName: string }) => {
+ const { status } = useChain(chainName);
+ const { data, isLoading, refetch } = useStakingData(chainName);
+
+ return (
+
+ {status !== WalletState.Connected ? (
+
+
+ Please connect the wallet
+
+
+ ) : isLoading || !data ? (
+
+
+
+ ) : (
+
+ )}
+
+ );
+};
diff --git a/examples/authz/components/claim-rewards/Overview.tsx b/examples/authz/components/claim-rewards/Overview.tsx
new file mode 100644
index 00000000..c0cd8d14
--- /dev/null
+++ b/examples/authz/components/claim-rewards/Overview.tsx
@@ -0,0 +1,130 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import {
+ Box,
+ StakingAssetHeader,
+ StakingClaimHeader,
+} from '@interchain-ui/react';
+
+import { getCoin } from '@/configs';
+import { Prices, useAuthzTx, useSigningClient } from '@/hooks';
+import {
+ sum,
+ calcDollarValue,
+ isGreaterThanZero,
+ type ParsedRewards as Rewards,
+} from '@/utils';
+import { MsgWithdrawDelegatorReward } from '@interchainjs/react/cosmos/distribution/v1beta1/tx';
+import { useAuthzContext } from '@/context';
+import { useExec } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
+import { defaultContext } from '@tanstack/react-query';
+
+const Overview = ({
+ balance,
+ rewards,
+ staked,
+ updateData,
+ chainName,
+ prices,
+}: {
+ balance: string;
+ rewards: Rewards;
+ staked: string;
+ updateData: () => void;
+ chainName: string;
+ prices: Prices;
+}) => {
+ const [isClaiming, setIsClaiming] = useState(false);
+
+ const { permission } = useAuthzContext();
+ const { createExecMsg } = useAuthzTx(chainName);
+
+ const { data: client } = useSigningClient(chainName);
+
+ const { mutate: exec } = useExec({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const totalAmount = sum(balance, staked, rewards?.total ?? 0);
+ const coin = getCoin(chainName);
+
+ const onClaimRewardClick = () => {
+ if (!permission) return;
+
+ setIsClaiming(true);
+
+ const { grantee, granter, expiration } = permission;
+
+ const msgs = rewards.byValidators.map(({ validatorAddress }) =>
+ MsgWithdrawDelegatorReward.toProtoMsg({
+ delegatorAddress: granter,
+ validatorAddress,
+ })
+ );
+
+ const fee = {
+ amount: [
+ {
+ denom: token.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ exec(
+ {
+ signerAddress: grantee,
+ message: createExecMsg({ msgs, grantee }),
+ fee: fee,
+ memo: 'executing permission',
+ },
+ {
+ onSuccess: () => {
+ updateData();
+ },
+ onError: () => {
+ setIsClaiming(false);
+ },
+ }
+ );
+ };
+
+ return (
+ <>
+
+
+
+
+
+
+
+ >
+ );
+};
+
+export default Overview;
diff --git a/examples/authz/components/claim-rewards/index.ts b/examples/authz/components/claim-rewards/index.ts
new file mode 100644
index 00000000..68a0b4a8
--- /dev/null
+++ b/examples/authz/components/claim-rewards/index.ts
@@ -0,0 +1 @@
+export * from './ClaimRewardsSection';
diff --git a/examples/authz/components/common/AddressInput.tsx b/examples/authz/components/common/AddressInput.tsx
new file mode 100644
index 00000000..8499239a
--- /dev/null
+++ b/examples/authz/components/common/AddressInput.tsx
@@ -0,0 +1,66 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useMemo } from 'react';
+import { useChain } from '@interchain-kit/react';
+import { fromBech32 } from '@cosmjs/encoding';
+import { TextField, Text, Box, BoxProps } from '@interchain-ui/react';
+
+type AddressInputProps = {
+ chainName: string;
+ address: string;
+ onAddressChange: (address: string) => void;
+ mb?: BoxProps['mb'];
+ label?: string;
+ placeholder?: string;
+ onInvalidAddress?: (error: string) => void;
+};
+
+export const AddressInput = ({
+ chainName,
+ address,
+ onAddressChange,
+ label,
+ mb,
+ onInvalidAddress,
+ placeholder,
+}: AddressInputProps) => {
+ const { chain } = useChain(chainName);
+
+ const errorMessage = useMemo(() => {
+ let errorMsg = '';
+
+ if (!address) {
+ onInvalidAddress && onInvalidAddress(errorMsg);
+ return errorMsg;
+ }
+
+ try {
+ const res = fromBech32(address);
+ if (!address.startsWith(chain.bech32Prefix)) {
+ errorMsg = `Invalid address: Unexpected prefix (expected: ${chain.bech32Prefix}, actual: ${res.prefix})`;
+ }
+ } catch (error) {
+ errorMsg = 'Invalid address';
+ } finally {
+ onInvalidAddress && onInvalidAddress(errorMsg);
+ return errorMsg;
+ }
+ }, [address]);
+
+ return (
+
+ onAddressChange(e.target.value)}
+ label={label}
+ placeholder={placeholder}
+ attributes={{ mb: errorMessage ? '$2' : '0' }}
+ intent={errorMessage ? 'error' : 'default'}
+ />
+
+ {errorMessage && {errorMessage}}
+
+ );
+};
diff --git a/examples/authz/components/common/Footer.tsx b/examples/authz/components/common/Footer.tsx
new file mode 100644
index 00000000..a1d352e1
--- /dev/null
+++ b/examples/authz/components/common/Footer.tsx
@@ -0,0 +1,169 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import {
+ Box,
+ Link,
+ Text,
+ Icon,
+ Stack,
+ Divider,
+ useColorModeValue,
+} from '@interchain-ui/react';
+import { dependencies, products, Project } from '@/configs';
+
+function Product({ name, desc, link }: Project) {
+ return (
+
+
+
+ {name} →
+
+
+ {desc}
+
+
+
+ );
+}
+
+function Dependency({ name, desc, link }: Project) {
+ return (
+
+
+
+
+
+
+
+
+ {name}
+
+
+ {desc}
+
+
+
+
+ );
+}
+
+export function Footer() {
+ return (
+ <>
+
+ {products.map((product) => (
+
+ ))}
+
+
+ {dependencies.map((dependency) => (
+
+ ))}
+
+
+
+
+
+ Built with
+
+ Cosmology
+
+
+ >
+ );
+}
diff --git a/examples/authz/components/common/Header.tsx b/examples/authz/components/common/Header.tsx
new file mode 100644
index 00000000..326a5c95
--- /dev/null
+++ b/examples/authz/components/common/Header.tsx
@@ -0,0 +1,66 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import {
+ Box,
+ Button,
+ Icon,
+ Text,
+ useTheme,
+ useColorModeValue,
+} from '@interchain-ui/react';
+
+const stacks = ['Cosmos Kit', 'Next.js'];
+
+export function Header() {
+ const { theme, setTheme } = useTheme();
+
+ const toggleColorMode = () => {
+ setTheme(theme === 'light' ? 'dark' : 'light');
+ };
+
+ return (
+ <>
+
+
+
+
+
+
+ Create Cosmos App
+
+
+
+ Welcome to
+
+
+ {stacks.join(' + ')}
+
+
+
+ >
+ );
+}
diff --git a/examples/authz/components/common/Layout.tsx b/examples/authz/components/common/Layout.tsx
new file mode 100644
index 00000000..a207f109
--- /dev/null
+++ b/examples/authz/components/common/Layout.tsx
@@ -0,0 +1,21 @@
+import Head from 'next/head';
+import { Container } from '@interchain-ui/react';
+import { Header } from './Header';
+import { Footer } from './Footer';
+
+export function Layout({ children }: { children: React.ReactNode }) {
+ return (
+
+
+ Create Cosmos App
+
+
+
+ {/* @ts-ignore */}
+
+ {children}
+ {/* @ts-ignore */}
+
+
+ );
+}
diff --git a/examples/authz/components/common/index.ts b/examples/authz/components/common/index.ts
new file mode 100644
index 00000000..59579110
--- /dev/null
+++ b/examples/authz/components/common/index.ts
@@ -0,0 +1,2 @@
+export * from './Layout';
+export * from './AddressInput';
diff --git a/examples/authz/components/index.tsx b/examples/authz/components/index.tsx
new file mode 100644
index 00000000..e751a4da
--- /dev/null
+++ b/examples/authz/components/index.tsx
@@ -0,0 +1,7 @@
+export * from './authz';
+export * from './common';
+export * from './wallet';
+export * from './staking';
+export * from './claim-rewards';
+export * from './voting';
+export * from './send';
diff --git a/examples/authz/components/send/index.ts b/examples/authz/components/send/index.ts
new file mode 100644
index 00000000..d1ab99c8
--- /dev/null
+++ b/examples/authz/components/send/index.ts
@@ -0,0 +1 @@
+export * from './send';
diff --git a/examples/authz/components/send/send.tsx b/examples/authz/components/send/send.tsx
new file mode 100644
index 00000000..80ec4690
--- /dev/null
+++ b/examples/authz/components/send/send.tsx
@@ -0,0 +1,174 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import { useChain } from '@interchain-kit/react';
+import { Box, Button, Spinner, Text, TokenInput } from '@interchain-ui/react';
+import BigNumber from 'bignumber.js';
+
+import { useAuthzTx, useSendData, useSigningClient, useToast } from '@/hooks';
+import {
+ getCoin,
+ getExponent,
+ getChainLogoByChainName,
+ shiftDigits,
+} from '@/utils';
+import { useAuthzContext } from '@/context';
+import { AddressInput } from '@/components';
+import { MsgSend } from '@interchainjs/react/cosmos/bank/v1beta1/tx';
+import { SendAuthorization } from '@interchainjs/react/cosmos/bank/v1beta1/authz';
+import { useExec } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
+import { defaultContext } from '@tanstack/react-query';
+import { WalletState } from '@interchain-kit/core';
+
+type SendSectionProps = {
+ chainName: string;
+};
+
+export const SendSection = ({ chainName }: SendSectionProps) => {
+ const [recipientAddress, setRecipientAddress] = useState('');
+ const [amount, setAmount] = useState(undefined);
+ const [isSending, setIsSending] = useState(false);
+ const [errorMsg, setErrorMsg] = useState('');
+
+ const { status } = useChain(chainName);
+ const { data, isLoading, refetch } = useSendData(chainName);
+ const { createExecMsg } = useAuthzTx(chainName);
+ const { data: client } = useSigningClient(chainName);
+
+ const { mutate: exec } = useExec({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const { permission } = useAuthzContext();
+ const { toast } = useToast();
+
+ const coin = getCoin(chainName);
+ const exponent = getExponent(chainName);
+
+ const onSendClick = () => {
+ if (!amount || !recipientAddress || !permission) return;
+
+ const { grantee, granter, authorization, expiration } = permission;
+
+ const sendAmount = shiftDigits(amount, exponent);
+
+ if (SendAuthorization.is(authorization)) {
+ const limitAmount = authorization?.spendLimit?.[0]?.amount;
+ if (limitAmount && new BigNumber(sendAmount).gt(limitAmount)) {
+ toast({
+ type: 'error',
+ title: 'Amount exceeds the spending limit',
+ });
+ return;
+ }
+ }
+
+ setIsSending(true);
+
+ const msg = MsgSend.toProtoMsg({
+ amount: [
+ {
+ amount: sendAmount,
+ denom: coin.base,
+ },
+ ],
+ fromAddress: granter,
+ toAddress: recipientAddress,
+ });
+
+ const fee = {
+ amount: [
+ {
+ denom: coin.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ exec(
+ {
+ signerAddress: grantee,
+ message: createExecMsg({ msgs: [msg], grantee }),
+ fee: fee,
+ memo: 'executing permission',
+ },
+ {
+ onSuccess: () => {
+ refetch();
+ setAmount(undefined);
+ setRecipientAddress('');
+ },
+ onError: () => {
+ setIsSending(false);
+ },
+ }
+ );
+ };
+
+ if (status !== WalletState.Connected) {
+ return (
+
+ Please connect the wallet
+
+ );
+ }
+
+ if (isLoading || !data) {
+ return (
+
+
+
+ );
+ }
+
+ return (
+
+
+ Send
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/examples/authz/components/staking/AllValidators.tsx b/examples/authz/components/staking/AllValidators.tsx
new file mode 100644
index 00000000..3c55d9ae
--- /dev/null
+++ b/examples/authz/components/staking/AllValidators.tsx
@@ -0,0 +1,68 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import { Text } from '@interchain-ui/react';
+
+import { DelegateModal } from './DelegateModal';
+import AllValidatorsList from './AllValidatorsList';
+import { Prices, useDisclosure } from '@/hooks';
+import { type ExtendedValidator as Validator } from '@/utils';
+
+export const AllValidators = ({
+ validators,
+ balance,
+ updateData,
+ unbondingDays,
+ chainName,
+ logos,
+ prices,
+}: {
+ validators: Validator[];
+ balance: string;
+ updateData: () => void;
+ unbondingDays: string;
+ chainName: string;
+ logos: {
+ [key: string]: string;
+ };
+ prices: Prices;
+}) => {
+ const delegateModalControl = useDisclosure();
+ const [selectedValidator, setSelectedValidator] = useState();
+
+ return (
+ <>
+
+ All Validators
+
+
+
+
+ {selectedValidator && (
+
+ )}
+ >
+ );
+};
diff --git a/examples/authz/components/staking/AllValidatorsList.tsx b/examples/authz/components/staking/AllValidatorsList.tsx
new file mode 100644
index 00000000..539cd354
--- /dev/null
+++ b/examples/authz/components/staking/AllValidatorsList.tsx
@@ -0,0 +1,120 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import React, { Dispatch, SetStateAction, useMemo } from 'react';
+import { getCoin } from '@/configs';
+import { shiftDigits, type ExtendedValidator as Validator } from '@/utils';
+import {
+ Text,
+ Button,
+ ValidatorList,
+ ValidatorNameCell,
+ ValidatorTokenAmountCell,
+ GridColumn,
+} from '@interchain-ui/react';
+
+const AllValidatorsList = ({
+ validators,
+ openModal,
+ chainName: string,
+ logos,
+ setSelectedValidator,
+}: {
+ validators: Validator[];
+ chainName: string;
+ openModal: () => void;
+ setSelectedValidator: Dispatch>;
+ logos: {
+ [key: string]: string;
+ };
+}) => {
+ const coin = getCoin(string);
+
+ const columns = useMemo(() => {
+ const _columns: GridColumn[] = [
+ {
+ id: 'validator',
+ label: 'Validator',
+ width: '196px',
+ align: 'left',
+ render: (validator: Validator) => (
+
+ ),
+ },
+ {
+ id: 'voting-power',
+ label: 'Voting Power',
+ width: '196px',
+ align: 'right',
+ render: (validator: Validator) => (
+
+ ),
+ },
+ {
+ id: 'commission',
+ label: 'Commission',
+ width: '196px',
+ align: 'right',
+ render: (validator: Validator) => (
+
+ {shiftDigits(validator.commission, 2)}%
+
+ ),
+ },
+ {
+ id: 'action',
+ width: '196px',
+ align: 'right',
+ render: (validator) => (
+
+ ),
+ },
+ ];
+
+ const hasApr = !!validators[0]?.apr;
+
+ if (hasApr) {
+ _columns.splice(3, 0, {
+ id: 'apr',
+ label: 'APR',
+ width: '196px',
+ align: 'right',
+ render: (validator: Validator) => (
+ {validator.apr}%
+ ),
+ });
+ }
+
+ return _columns;
+ }, [string]);
+
+ return (
+
+ );
+};
+
+export default React.memo(AllValidatorsList);
diff --git a/examples/authz/components/staking/DelegateModal.tsx b/examples/authz/components/staking/DelegateModal.tsx
new file mode 100644
index 00000000..35461d50
--- /dev/null
+++ b/examples/authz/components/staking/DelegateModal.tsx
@@ -0,0 +1,305 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import BigNumber from 'bignumber.js';
+import {
+ BasicModal,
+ StakingDelegate,
+ Box,
+ Button,
+ Callout,
+ Text,
+ NumberField,
+} from '@interchain-ui/react';
+
+import {
+ type ExtendedValidator as Validator,
+ formatValidatorMetaInfo,
+ getAssetLogoUrl,
+ isGreaterThanZero,
+ shiftDigits,
+ calcDollarValue,
+} from '@/utils';
+import { getCoin, getExponent } from '@/configs';
+import { useAuthzContext } from '@/context';
+import {
+ Prices,
+ useAuthzTx,
+ UseDisclosureReturn,
+ useSigningClient,
+ useToast,
+} from '@/hooks';
+import { MsgDelegate } from '@interchainjs/react/cosmos/staking/v1beta1/tx';
+import { StakeAuthorization } from '@interchainjs/react/cosmos/staking/v1beta1/authz';
+import { useExec } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
+import { defaultContext } from '@tanstack/react-query';
+
+export const DelegateModal = ({
+ balance,
+ updateData,
+ unbondingDays,
+ chainName,
+ logoUrl,
+ modalControl,
+ selectedValidator,
+ closeOuterModal,
+ prices,
+ modalTitle,
+ showDescription = true,
+}: {
+ balance: string;
+ updateData: () => void;
+ unbondingDays: string;
+ chainName: string;
+ modalControl: UseDisclosureReturn;
+ selectedValidator: Validator;
+ logoUrl: string;
+ prices: Prices;
+ closeOuterModal?: () => void;
+ modalTitle?: string;
+ showDescription?: boolean;
+}) => {
+ const { isOpen, onClose } = modalControl;
+
+ const [amount, setAmount] = useState(0);
+ const [isDelegating, setIsDelegating] = useState(false);
+ const [, forceUpdate] = useState(0);
+
+ const coin = getCoin(chainName);
+ const exponent = getExponent(chainName);
+
+ const { createExecMsg } = useAuthzTx(chainName);
+
+ const { data: client } = useSigningClient(chainName);
+
+ const { mutate: exec } = useExec({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const { permission } = useAuthzContext();
+ const { toast } = useToast();
+
+ const onModalClose = () => {
+ onClose();
+ setAmount(0);
+ setIsDelegating(false);
+ };
+
+ const onDelegateClick = async () => {
+ if (!amount || !permission) return;
+
+ const { grantee, granter, authorization, expiration } = permission;
+
+ const delegateAmount = shiftDigits(amount, exponent);
+
+ if (StakeAuthorization.is(authorization)) {
+ const maxAmount = authorization?.maxTokens?.amount;
+
+ if (maxAmount && new BigNumber(delegateAmount).gt(maxAmount)) {
+ toast({
+ type: 'error',
+ title: 'Amount exceeds max tokens',
+ });
+ return;
+ }
+
+ const allowList = authorization?.allowList?.address;
+ const denyList = authorization?.denyList?.address;
+
+ if (
+ (allowList && !allowList.includes(selectedValidator.address)) ||
+ (denyList && denyList.includes(selectedValidator.address))
+ ) {
+ toast({
+ type: 'error',
+ title: 'Unauthorized Delegation',
+ description:
+ 'You are not allowed to delegate to this validator from this account.',
+ });
+ return;
+ }
+ }
+
+ setIsDelegating(true);
+
+ const msg = MsgDelegate.toProtoMsg({
+ delegatorAddress: granter,
+ validatorAddress: selectedValidator.address,
+ amount: {
+ amount: delegateAmount,
+ denom: coin.base,
+ },
+ });
+
+ const fee = {
+ amount: [
+ {
+ denom: coin.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ exec(
+ {
+ signerAddress: grantee,
+ message: createExecMsg({ msgs: [msg], grantee }),
+ fee: fee,
+ memo: 'executing permission',
+ },
+ {
+ onSuccess: () => {
+ closeOuterModal && closeOuterModal();
+ updateData();
+ onModalClose();
+ },
+ onError: () => {
+ setIsDelegating(false);
+ },
+ }
+ );
+ };
+
+ const headerExtra = (
+ <>
+ {showDescription && selectedValidator.description && (
+ {selectedValidator.description}
+ )}
+ {unbondingDays && (
+
+ You will need to undelegate in order for your staked assets to be
+ liquid again. This process will take {unbondingDays} days to complete.
+
+ )}
+ >
+ );
+
+ return (
+
+
+
+ {
+ // @ts-ignore
+ const val = e.target.value;
+
+ if (!val) {
+ setAmount(undefined);
+ return;
+ }
+
+ if (new BigNumber(val).gt(balance)) {
+ setAmount(Number(balance));
+ forceUpdate((n) => n + 1);
+ return;
+ }
+
+ setAmount(Number(val));
+ }}
+ />
+
+ {
+ // if (!val) {
+ // setAmount(undefined);
+ // return;
+ // }
+
+ // const max = maxAmountAndFee?.maxAmount || balance;
+
+ // if (new BigNumber(val).gt(max)) {
+ // setAmount(Number(max));
+ // forceUpdate((n) => n + 1);
+ // return;
+ // }
+
+ // setAmount(Number(val));
+ // },
+ partials: [
+ {
+ label: '1/2',
+ onClick: () => {
+ setAmount(new BigNumber(balance).dividedBy(2).toNumber());
+ },
+ },
+ {
+ label: '1/3',
+ onClick: () => {
+ setAmount(new BigNumber(balance).dividedBy(3).toNumber());
+ },
+ },
+ {
+ label: 'Max',
+ onClick: () => setAmount(Number(balance)),
+ },
+ ],
+ }}
+ footer={
+
+ }
+ />
+
+
+ );
+};
diff --git a/examples/authz/components/staking/Overview.tsx b/examples/authz/components/staking/Overview.tsx
new file mode 100644
index 00000000..5f0886df
--- /dev/null
+++ b/examples/authz/components/staking/Overview.tsx
@@ -0,0 +1,122 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import {
+ Box,
+ StakingAssetHeader,
+ StakingClaimHeader,
+} from '@interchain-ui/react';
+import { useChain } from '@interchain-kit/react';
+import { useWithdrawDelegatorReward } from '@interchainjs/react/cosmos/distribution/v1beta1/tx.rpc.react';
+
+import { getCoin } from '@/configs';
+import { Prices, useSigningClient, useTx } from '@/hooks';
+import {
+ sum,
+ calcDollarValue,
+ isGreaterThanZero,
+ type ParsedRewards as Rewards,
+} from '@/utils';
+import { defaultContext } from '@tanstack/react-query';
+import { MsgWithdrawDelegatorReward } from '@interchainjs/react/cosmos/distribution/v1beta1/tx';
+
+const Overview = ({
+ balance,
+ rewards,
+ staked,
+ updateData,
+ chainName,
+ prices,
+}: {
+ balance: string;
+ rewards: Rewards;
+ staked: string;
+ updateData: () => void;
+ chainName: string;
+ prices: Prices;
+}) => {
+ const [isClaiming, setIsClaiming] = useState(false);
+ const { address } = useChain(chainName);
+
+ const { data: client } = useSigningClient(chainName);
+
+ const totalAmount = sum(balance, staked, rewards?.total ?? 0);
+ const coin = getCoin(chainName);
+ const withdrawDelegatorReward = useWithdrawDelegatorReward({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const onClaimRewardClick = async () => {
+ setIsClaiming(true);
+
+ if (!address) return;
+
+ const msgs = rewards.byValidators.map(({ validatorAddress }) =>
+ MsgWithdrawDelegatorReward.fromPartial({
+ delegatorAddress: address,
+ validatorAddress,
+ })
+ );
+
+ const fee = {
+ amount: [
+ {
+ denom: coin.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ withdrawDelegatorReward(
+ {
+ address,
+ message: msgs,
+ fee: fee,
+ memo: 'Claiming rewards',
+ },
+ {
+ onSuccess: updateData,
+ }
+ );
+
+ setIsClaiming(false);
+ };
+
+ return (
+ <>
+
+
+
+
+ {/*
+
+ */}
+ >
+ );
+};
+
+export default Overview;
diff --git a/examples/authz/components/staking/StakingSection.tsx b/examples/authz/components/staking/StakingSection.tsx
new file mode 100644
index 00000000..66450f6e
--- /dev/null
+++ b/examples/authz/components/staking/StakingSection.tsx
@@ -0,0 +1,66 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useChain } from '@interchain-kit/react';
+import { Box, Spinner, Text } from '@interchain-ui/react';
+
+import Overview from './Overview';
+import { AllValidators } from './AllValidators';
+import { useStakingData, useValidatorLogos } from '@/hooks';
+import { WalletState } from '@interchain-kit/core';
+
+export const StakingSection = ({ chainName }: { chainName: string }) => {
+ const { status } = useChain(chainName);
+ const { data, isLoading, refetch } = useStakingData(chainName);
+ const { data: logos, isLoading: isFetchingLogos } = useValidatorLogos(
+ chainName,
+ data?.allValidators || []
+ );
+
+ return (
+
+ {status !== WalletState.Connected ? (
+
+
+ Please connect the wallet
+
+
+ ) : isLoading || isFetchingLogos || !data ? (
+
+
+
+ ) : (
+ <>
+
+
+
+ >
+ )}
+
+ );
+};
diff --git a/examples/authz/components/staking/index.ts b/examples/authz/components/staking/index.ts
new file mode 100644
index 00000000..4deb7bee
--- /dev/null
+++ b/examples/authz/components/staking/index.ts
@@ -0,0 +1 @@
+export * from './StakingSection';
diff --git a/examples/authz/components/voting/Proposal.tsx b/examples/authz/components/voting/Proposal.tsx
new file mode 100644
index 00000000..dbeaa711
--- /dev/null
+++ b/examples/authz/components/voting/Proposal.tsx
@@ -0,0 +1,404 @@
+// TODO fix type issues
+// @ts-nocheck
+import {
+ Box,
+ Button,
+ GovernanceRadio,
+ GovernanceRadioGroup,
+ GovernanceResultCard,
+ GovernanceVoteBreakdown,
+ GovernanceVoteType,
+ Icon,
+ Stack,
+ Text,
+} from '@interchain-ui/react';
+import {
+ Proposal as IProposal,
+ ProposalStatus,
+} from '@interchainjs/react/cosmos/gov/v1beta1/gov';
+import {
+ exponentiate,
+ formatDate,
+ getCoin,
+ getExponent,
+ percent,
+} from '@/utils';
+import Markdown from 'react-markdown';
+import { useEffect, useState } from 'react';
+import { useAuthzTx, useSigningClient, Votes } from '@/hooks';
+import { useAuthzContext } from '@/context';
+import { MsgVote } from '@interchainjs/react/cosmos/gov/v1beta1/tx';
+import { useExec } from '@interchainjs/react/cosmos/authz/v1beta1/tx.rpc.react';
+
+// export declare enum VoteOption {
+// /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */
+// VOTE_OPTION_UNSPECIFIED = 0,
+// /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */
+// VOTE_OPTION_YES = 1,
+// /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */
+// VOTE_OPTION_ABSTAIN = 2,
+// /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */
+// VOTE_OPTION_NO = 3,
+// /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */
+// VOTE_OPTION_NO_WITH_VETO = 4,
+// UNRECOGNIZED = -1
+// }
+
+const VoteTypes = ['', 'yes', 'abstain', 'no', 'noWithVeto'];
+
+export type ProposalProps = {
+ proposal: IProposal;
+ votes?: Votes;
+ quorum?: number;
+ bondedTokens?: string;
+ chainName: string;
+ onVoteSuccess?: () => void;
+};
+
+export function Proposal({
+ votes,
+ quorum,
+ proposal,
+ chainName,
+ bondedTokens,
+ onVoteSuccess = () => {},
+}: ProposalProps) {
+ const vote = votes?.[proposal.proposalId.toString()];
+
+ const [showMore, setShowMore] = useState(false);
+ const [voteType, setVoteType] = useState();
+ const [isVoting, setIsVoting] = useState(false);
+
+ const coin = getCoin(chainName);
+ const exponent = getExponent(chainName);
+
+ const { createExecMsg } = useAuthzTx(chainName);
+ const { data: client } = useSigningClient(chainName);
+
+ const { mutate: exec } = useExec({
+ clientResolver: client,
+ options: {
+ context: defaultContext,
+ },
+ });
+
+ const { permission } = useAuthzContext();
+
+ const toggleShowMore = () => setShowMore((v) => !v);
+
+ useEffect(() => {
+ if (typeof vote === 'number') {
+ setVoteType(VoteTypes[vote] as GovernanceVoteType);
+ }
+ }, [vote]);
+
+ const isChanged =
+ (vote === undefined && voteType) ||
+ (typeof vote === 'number' && voteType && voteType !== VoteTypes[vote]);
+
+ const isPassed = proposal.status === ProposalStatus.PROPOSAL_STATUS_PASSED;
+
+ const isRejected =
+ proposal.status === ProposalStatus.PROPOSAL_STATUS_REJECTED;
+
+ const isDepositPeriod =
+ proposal.status === ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD;
+
+ const isVotingPeriod =
+ proposal.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD;
+
+ const total = proposal.finalTallyResult
+ ? Object.values(proposal.finalTallyResult).reduce(
+ (sum, val) => sum + Number(val),
+ 0
+ )
+ : 0;
+
+ const turnout = total / Number(bondedTokens);
+
+ // @ts-ignore
+ const description = proposal?.content?.description || '';
+ const renderedDescription =
+ description.length > 200
+ ? showMore
+ ? description
+ : `${description.slice(0, 200)}...`
+ : description || '';
+
+ const minStakedTokens =
+ quorum && exponentiate(quorum * Number(bondedTokens), -exponent).toFixed(6);
+
+ const timepoints = [
+ {
+ label: 'Submit Time',
+ timestamp: formatDate(proposal?.submitTime!) || '',
+ },
+ {
+ label: 'Voting Starts',
+ timestamp: isDepositPeriod
+ ? 'Not Specified Yet'
+ : formatDate(proposal.votingStartTime) || '',
+ },
+ {
+ label: 'Voting Ends',
+ timestamp: isDepositPeriod
+ ? 'Not Specified Yet'
+ : formatDate(proposal?.votingEndTime!) || '',
+ },
+ ];
+
+ function onVoteTypeChange(selected: string) {
+ setVoteType(selected as GovernanceVoteType);
+ }
+
+ function onVoteButtonClick() {
+ if (!voteType || !permission) return;
+
+ setIsVoting(true);
+
+ const { grantee, granter, expiration } = permission;
+
+ const msg = MsgVote.toProtoMsg({
+ voter: granter,
+ option: VoteTypes.indexOf(voteType),
+ proposalId: proposal.proposalId,
+ });
+
+ const fee = {
+ amount: [
+ {
+ denom: coin.base,
+ amount: '2500',
+ },
+ ],
+ gas: '1000000',
+ };
+
+ exec(
+ {
+ signerAddress: grantee,
+ message: createExecMsg({ msgs: [msg], grantee }),
+ fee: fee,
+ memo: 'executing permission',
+ },
+ {
+ onSuccess: () => {
+ onVoteSuccess();
+ },
+ onComplete: () => {
+ setIsVoting(false);
+ },
+ }
+ );
+ }
+
+ return (
+
+
+
+ {timepoints.map((timepoint) => (
+
+
+ {timepoint.label}
+
+
+ {timepoint.timestamp}
+
+
+ ))}
+
+
+
+
+ Yes
+ No
+ No with veto
+ Abstain
+
+
+
+
+
+
+
+ Vote Details
+
+ {quorum ? (
+
+
+
+ {`Minimum of staked ${minStakedTokens} ${coin.symbol}(${
+ quorum * 100
+ }%) need to vote
+ for this proposal to pass.`}
+
+
+ ) : null}
+
+
+
+
+
+
+
+
+
+
+ {isPassed ? (
+
+ ) : null}
+ {isRejected ? (
+
+ ) : null}
+
+
+
+
+ {/* Description */}
+
+
+ Description
+
+
+
+ {showMore ? {description} : renderedDescription}
+
+
+
+
+
+
+
+ );
+}
diff --git a/examples/authz/components/voting/Voting.tsx b/examples/authz/components/voting/Voting.tsx
new file mode 100644
index 00000000..e58d11db
--- /dev/null
+++ b/examples/authz/components/voting/Voting.tsx
@@ -0,0 +1,169 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import { useChain } from '@interchain-kit/react';
+import {
+ Proposal as IProposal,
+ ProposalStatus,
+ TallyResult,
+ TextProposal,
+} from '@interchainjs/react/cosmos/gov/v1beta1/gov';
+import {
+ BasicModal,
+ Box,
+ GovernanceProposalItem,
+ Spinner,
+ Text,
+ useColorModeValue,
+} from '@interchain-ui/react';
+import { useModal, useVotingData } from '@/hooks';
+import { Proposal } from '@/components';
+import { formatDate } from '@/utils';
+
+function status(s: ProposalStatus) {
+ switch (s) {
+ case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED:
+ return 'pending';
+ case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD:
+ return 'pending';
+ case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD:
+ return 'pending';
+ case ProposalStatus.PROPOSAL_STATUS_PASSED:
+ return 'passed';
+ case ProposalStatus.PROPOSAL_STATUS_REJECTED:
+ return 'rejected';
+ case ProposalStatus.PROPOSAL_STATUS_FAILED:
+ return 'rejected';
+ default:
+ return 'pending';
+ }
+}
+
+function votes(result: TallyResult) {
+ return {
+ yes: Number(result.yes) || 0,
+ no: Number(result.no) || 0,
+ abstain: Number(result.abstain) || 0,
+ noWithVeto: Number(result.noWithVeto) || 0,
+ };
+}
+
+export type VotingProps = {
+ chainName: string;
+};
+
+export function Voting({ chainName }: VotingProps) {
+ const { address } = useChain(chainName);
+ const [proposal, setProposal] = useState();
+ const { data, isLoading, refetch } = useVotingData(chainName);
+ const { modal, open: openModal, close: closeModal, setTitle } = useModal('');
+
+ const spinnerColor = useColorModeValue('$blackAlpha800', '$whiteAlpha900');
+
+ function onClickProposal(index: number) {
+ const proposal = data.proposals![index];
+ openModal();
+ setProposal(proposal);
+ setTitle(
+ `#${proposal.proposalId?.toString()} ${
+ (proposal.content as TextProposal)?.title
+ }`
+ );
+ }
+
+ if (!address) {
+ return (
+
+
+ Please connect to your wallet to see the proposals.
+
+
+ );
+ }
+
+ if (isLoading) {
+ return (
+
+
+
+ );
+ }
+
+ return (
+
+
+ Proposals
+
+
+
+ {data.proposals && data.proposals.length > 0 ? (
+ data.proposals.map((proposal, index) => (
+ onClickProposal(index) }}
+ >
+ {data.votes[proposal.proposalId.toString()] ? (
+
+
+ Voted
+
+
+ ) : null}
+
+
+ ))
+ ) : (
+
+ No proposals found
+
+ )}
+
+
+
+
+ {modal.title}
+
+
+ }
+ isOpen={modal.open}
+ onOpen={openModal}
+ onClose={closeModal}
+ >
+
+
+
+ );
+}
diff --git a/examples/authz/components/voting/index.ts b/examples/authz/components/voting/index.ts
new file mode 100644
index 00000000..75bcca3d
--- /dev/null
+++ b/examples/authz/components/voting/index.ts
@@ -0,0 +1,2 @@
+export * from './Voting';
+export * from './Proposal';
\ No newline at end of file
diff --git a/examples/authz/components/wallet/Astronaut.tsx b/examples/authz/components/wallet/Astronaut.tsx
new file mode 100644
index 00000000..0704133a
--- /dev/null
+++ b/examples/authz/components/wallet/Astronaut.tsx
@@ -0,0 +1,156 @@
+export const Astronaut = (props: any) => (
+
+);
diff --git a/examples/authz/components/wallet/Chain.tsx b/examples/authz/components/wallet/Chain.tsx
new file mode 100644
index 00000000..3202c2fa
--- /dev/null
+++ b/examples/authz/components/wallet/Chain.tsx
@@ -0,0 +1,133 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import * as React from 'react';
+import { chains } from '@chain-registry/v2';
+import {
+ Box,
+ Combobox,
+ Text,
+ Stack,
+ Avatar,
+ useTheme,
+} from '@interchain-ui/react';
+
+type Option = {
+ label: string;
+ value: string;
+};
+
+export type ChainInfo = typeof chains[number];
+
+export interface ChooseChainProps {
+ chainName?: string;
+ chainInfos: ChainInfo[];
+ onChange: (selectedItem: string | undefined) => void;
+}
+
+const ChainOption = (props: Option & { iconUrl: string }) => {
+ return (
+
+ name[0]}
+ size="xs"
+ src={props.iconUrl}
+ fallbackMode="bg"
+ />
+
+
+ {props.label}
+
+
+ );
+};
+
+export const Chain = (props: ChooseChainProps) => {
+ const { chainName, chainInfos, onChange } = props;
+ const [selectedKey, setSelectedKey] = React.useState();
+ const { themeClass } = useTheme();
+
+ React.useEffect(() => {
+ // Init selected key to provided chainName
+ if (chainName && chainInfos.length > 0) {
+ const initKey = chainInfos.filter(
+ (option) => option.chainName === chainName
+ )[0].chainName;
+
+ return setSelectedKey(initKey);
+ }
+
+ if (!chainName) setSelectedKey(undefined);
+ }, [chainInfos, chainName]);
+
+ const chainOptions = chainInfos
+ .map((chainInfo) => ({
+ iconUrl: chainInfo.logoURIs?.png ?? '',
+ label: chainInfo.prettyName,
+ value: chainInfo.chainName,
+ }))
+ .filter((chainInfo) => chainInfo.label && chainInfo.value);
+
+ return (
+
+ {
+ if (item) {
+ setSelectedKey(item);
+
+ const found =
+ chainInfos.find((options) => options.chain_name === item) ?? null;
+
+ if (found) {
+ onChange?.(found.chain_name);
+ }
+ }
+ }}
+ inputAddonStart={
+ selectedKey ? (
+ name[0]}
+ size="xs"
+ src={
+ chainOptions.find((i) => i.value === selectedKey)?.iconUrl ??
+ undefined
+ }
+ fallbackMode="bg"
+ attributes={{
+ paddingX: '$4',
+ }}
+ />
+ ) : null
+ }
+ styleProps={{
+ width: {
+ mobile: '100%',
+ mdMobile: '420px',
+ },
+ }}
+ >
+ {chainOptions.map((option) => (
+
+
+
+ ))}
+
+
+ );
+};
diff --git a/examples/authz/components/wallet/ChainCard.tsx b/examples/authz/components/wallet/ChainCard.tsx
new file mode 100644
index 00000000..a7502c81
--- /dev/null
+++ b/examples/authz/components/wallet/ChainCard.tsx
@@ -0,0 +1,46 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import Image from 'next/image';
+import { Text, Box, useTheme } from '@interchain-ui/react';
+
+interface IChainCard {
+ prettyName: string;
+ icon?: string;
+}
+
+export const ChainCard = (props: IChainCard) => {
+ const { theme } = useTheme();
+ return (
+
+
+
+
+
+
+ {props.prettyName}
+
+
+ );
+};
diff --git a/examples/authz/components/wallet/Connect.tsx b/examples/authz/components/wallet/Connect.tsx
new file mode 100644
index 00000000..9a3e965e
--- /dev/null
+++ b/examples/authz/components/wallet/Connect.tsx
@@ -0,0 +1,79 @@
+import { MouseEventHandler } from 'react';
+import { Button as UIButton, IconName } from '@interchain-ui/react';
+
+export type ButtonProps = {
+ text?: string;
+ icon?: IconName;
+ loading?: boolean;
+ disabled?: boolean;
+ onClick?: MouseEventHandler;
+}
+
+export type ConnectProps = Pick;
+
+function noop() { }
+
+export function Button({
+ text,
+ icon,
+ loading,
+ disabled,
+ onClick = noop
+}: ButtonProps) {
+ return (
+ // @ts-ignore
+
+ {text}
+
+ );
+};
+
+export const ButtonConnect = ({ text = 'Connect Wallet', onClick = noop }: ConnectProps) => {
+ // @ts-ignore
+ return
+}
+
+export const ButtonConnected = ({ text = 'My Wallet', onClick = noop }: ConnectProps) => {
+ // @ts-ignore
+ return
+}
+
+export const ButtonDisconnected = ({ text = 'Connect Wallet', onClick = noop }: ConnectProps) => {
+ // @ts-ignore
+ return
+};
+
+export const ButtonConnecting = ({ text = 'Connecting ...', loading = true }: ConnectProps) => {
+ // @ts-ignore
+ return
+}
+
+export const ButtonRejected = ({ text = 'Reconnect', onClick = noop }: ConnectProps) => {
+ // @ts-ignore
+ return
+}
+
+export const ButtonError = ({ text = 'Change Wallet', onClick = noop }: ConnectProps) => {
+ return (
+ // @ts-ignore
+
+ );
+}
+
+export const ButtonNotExist = ({ text = 'Install Wallet', onClick = noop }: ConnectProps) => {
+ return (
+ // @ts-ignore
+
+ )
+}
diff --git a/examples/authz/components/wallet/User.tsx b/examples/authz/components/wallet/User.tsx
new file mode 100644
index 00000000..218c7a96
--- /dev/null
+++ b/examples/authz/components/wallet/User.tsx
@@ -0,0 +1,22 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { ReactNode } from 'react';
+import { Box, Text, Stack, useColorModeValue } from '@interchain-ui/react';
+import { Astronaut } from './Astronaut';
+
+export type UserProps = {
+ name: string;
+ icon?: ReactNode;
+}
+
+export function User({ name, icon = }: UserProps) {
+ return
+
+ {icon}
+
+
+ {name}
+
+
+}
\ No newline at end of file
diff --git a/examples/authz/components/wallet/Wallet.tsx b/examples/authz/components/wallet/Wallet.tsx
new file mode 100644
index 00000000..2a380a39
--- /dev/null
+++ b/examples/authz/components/wallet/Wallet.tsx
@@ -0,0 +1,131 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useEffect } from 'react';
+import {
+ Box,
+ ClipboardCopyText,
+ Stack,
+ useColorModeValue,
+} from '@interchain-ui/react';
+import { WalletState } from '@interchain-kit/core';
+import { useChain } from '@interchain-kit/react';
+import { chains } from '@chain-registry/v2';
+import { User } from './User';
+import { Chain } from './Chain';
+import { Warning } from './Warning';
+import {
+ ButtonConnect,
+ ButtonConnected,
+ ButtonConnecting,
+ ButtonDisconnected,
+ ButtonError,
+ ButtonNotExist,
+ ButtonRejected,
+} from './Connect';
+import { ChainCard } from './ChainCard';
+import { defaultChainName } from '@/configs';
+
+export const DEFAULT_CHAIN_NAME = 'cosmoshub';
+export const CHAIN_NAME_STORAGE_KEY = 'selected-chain';
+
+export type WalletProps = {
+ chainName?: string;
+ isMultiChain?: boolean;
+ onChainChange?: (chainName?: string) => void;
+};
+
+export function Wallet({
+ chainName = DEFAULT_CHAIN_NAME,
+ isMultiChain = false,
+ onChainChange = () => {},
+}: WalletProps) {
+ const {
+ chain,
+ status,
+ wallet,
+ username,
+ address,
+ message,
+ connect,
+ openView,
+ } = useChain(chainName);
+
+ const ConnectButton = {
+ [WalletState.Connected]: ,
+ [WalletState.Connecting]: ,
+ [WalletState.Disconnected]: ,
+ [WalletState.Rejected]: ,
+ }[status] || ;
+
+ function handleChainChange(chainName?: string) {
+ onChainChange(chainName);
+ if (chainName) {
+ localStorage.setItem(CHAIN_NAME_STORAGE_KEY, chainName);
+ } else {
+ localStorage.removeItem(CHAIN_NAME_STORAGE_KEY);
+ }
+ }
+
+ useEffect(() => {
+ onChainChange(
+ localStorage.getItem(CHAIN_NAME_STORAGE_KEY) || DEFAULT_CHAIN_NAME
+ );
+ }, []);
+
+ return (
+
+
+ {isMultiChain ? (
+
+ ) : (
+ c.chainName === chain.chainName)?.logoURIs?.png
+ }
+ />
+ )}
+
+
+ {username ? : null}
+ {address ? (
+
+ ) : null}
+
+ {ConnectButton}
+
+
+ {message}
+
+
+ );
+}
diff --git a/examples/authz/components/wallet/Warning.tsx b/examples/authz/components/wallet/Warning.tsx
new file mode 100644
index 00000000..c5fd06f8
--- /dev/null
+++ b/examples/authz/components/wallet/Warning.tsx
@@ -0,0 +1,35 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { ReactNode } from 'react';
+import { Box, Text, Icon, Stack, useColorModeValue } from '@interchain-ui/react';
+
+export type WarningProps = {
+ text: string;
+ icon?: ReactNode;
+}
+
+export const WarningIcon =
+
+export function Warning({ text, icon = WarningIcon }: WarningProps) {
+ return (
+
+
+ {icon}
+
+
+ {text}
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/examples/authz/components/wallet/index.ts b/examples/authz/components/wallet/index.ts
new file mode 100644
index 00000000..7df19835
--- /dev/null
+++ b/examples/authz/components/wallet/index.ts
@@ -0,0 +1 @@
+export * from './Wallet';
diff --git a/examples/authz/configs/defaults.ts b/examples/authz/configs/defaults.ts
new file mode 100644
index 00000000..0d41447b
--- /dev/null
+++ b/examples/authz/configs/defaults.ts
@@ -0,0 +1,19 @@
+import { assetLists } from '@chain-registry/v2';
+import { AssetList, Asset } from '@chain-registry/v2-types';
+
+export const defaultChainName = 'osmosis';
+
+export const getChainAssets = (chainName: string = defaultChainName) => {
+ return assetLists.find((chain) => chain.chainName === chainName) as AssetList;
+};
+
+export const getCoin = (chainName: string = defaultChainName) => {
+ const chainAssets = getChainAssets(chainName);
+ return chainAssets.assets[0] as Asset;
+};
+
+export const getExponent = (chainName: string) => {
+ return getCoin(chainName).denomUnits.find(
+ (unit) => unit.denom === getCoin(chainName).display
+ )?.exponent as number;
+};
diff --git a/examples/authz/configs/features.ts b/examples/authz/configs/features.ts
new file mode 100644
index 00000000..4cee68af
--- /dev/null
+++ b/examples/authz/configs/features.ts
@@ -0,0 +1,51 @@
+export type Project = {
+ name: string;
+ desc: string;
+ link: string;
+};
+
+export const products: Project[] = [
+ {
+ name: 'Interchain Kit',
+ desc: 'A wallet adapter for react with mobile WalletConnect support for the Cosmos ecosystem.',
+ link: 'https://github.com/hyperweb-io/interchain-kit',
+ },
+ {
+ name: 'Telescope',
+ desc: 'A TypeScript Transpiler for Cosmos Protobufs to generate libraries for Cosmos blockchains.',
+ link: 'https://github.com/hyperweb-io/telescope',
+ },
+ {
+ name: 'TS Codegen',
+ desc: 'The quickest and easiest way to convert CosmWasm Contracts into dev-friendly TypeScript classes.',
+ link: 'https://github.com/CosmWasm/ts-codegen',
+ },
+ {
+ name: 'CosmWasm Academy',
+ desc: 'Master CosmWasm and build your secure, multi-chain dApp on any CosmWasm chain!',
+ link: 'https://academy.cosmwasm.com/',
+ },
+ {
+ name: 'Chain Registry',
+ desc: 'Get chain and asset list information from the npm package for the Official Cosmos chain registry.',
+ link: 'https://github.com/hyperweb-io/chain-registry',
+ },
+ {
+ name: 'Videos',
+ desc: 'How-to videos from the official Cosmology website, with learning resources for building in Cosmos.',
+ link: 'https://cosmology.zone/learn',
+ },
+];
+
+export const dependencies: Project[] = [
+ {
+ name: 'Interchain UI',
+ desc: 'Cross-framework UI Kit for Crafting dApps.',
+ link: 'https://github.com/hyperweb-io/interchain-ui',
+ },
+ {
+ name: 'Next.js',
+ desc: 'A React Framework supports hybrid static & server rendering.',
+ link: 'https://nextjs.org/',
+ },
+];
diff --git a/examples/authz/configs/index.ts b/examples/authz/configs/index.ts
new file mode 100644
index 00000000..64654ed9
--- /dev/null
+++ b/examples/authz/configs/index.ts
@@ -0,0 +1,3 @@
+export * from './features';
+export * from './defaults';
+export * from './permissions';
diff --git a/examples/authz/configs/permissions.ts b/examples/authz/configs/permissions.ts
new file mode 100644
index 00000000..51796d13
--- /dev/null
+++ b/examples/authz/configs/permissions.ts
@@ -0,0 +1,44 @@
+export const Permission = {
+ Vote: 'vote',
+ Send: 'send',
+ Delegate: 'delegate',
+ ClaimRewards: 'claim-rewards',
+} as const;
+
+export type PermissionId = typeof Permission[keyof typeof Permission];
+
+export type PermissionItem = {
+ id: PermissionId;
+ name: string;
+ isCustomizable: boolean;
+};
+
+export const permissions: PermissionItem[] = [
+ {
+ id: Permission.Vote,
+ name: 'Vote',
+ isCustomizable: false,
+ },
+ {
+ id: Permission.Send,
+ name: 'Send',
+ isCustomizable: true,
+ },
+ {
+ id: Permission.Delegate,
+ name: 'Delegate',
+ isCustomizable: true,
+ },
+ {
+ id: Permission.ClaimRewards,
+ name: 'Claim Rewards',
+ isCustomizable: false,
+ },
+];
+
+export const permissionNameToRouteMap: Record = {
+ Vote: '/vote',
+ Send: '/send',
+ Delegate: '/stake',
+ WithdrawDelegatorReward: '/claim-rewards',
+};
diff --git a/examples/authz/context/authz-context.tsx b/examples/authz/context/authz-context.tsx
new file mode 100644
index 00000000..c640d7bd
--- /dev/null
+++ b/examples/authz/context/authz-context.tsx
@@ -0,0 +1,38 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { createContext, useContext, useState } from 'react';
+import { PrettyPermission } from '@/utils';
+
+type AuthzProviderProps = { children: React.ReactNode };
+
+type TAuthzContext = {
+ permission: PrettyPermission | undefined;
+ setPermission: (permission: PrettyPermission) => void;
+ chainName: string | undefined;
+ setChainName: (chainName: string | undefined) => void;
+};
+
+const AuthzContext = createContext(undefined);
+
+const AuthzProvider = ({ children }: AuthzProviderProps) => {
+ const [permission, setPermission] = useState();
+ const [chainName, setChainName] = useState();
+ const value = { permission, setPermission, chainName, setChainName };
+
+ return (
+ {children}
+ );
+};
+
+const useAuthzContext = () => {
+ const context = useContext(AuthzContext);
+
+ if (context === undefined) {
+ throw new Error('useAuthzContext must be used within a AuthzProvider');
+ }
+
+ return context;
+};
+
+export { AuthzProvider, useAuthzContext };
diff --git a/examples/authz/context/index.ts b/examples/authz/context/index.ts
new file mode 100644
index 00000000..b4a06dd8
--- /dev/null
+++ b/examples/authz/context/index.ts
@@ -0,0 +1 @@
+export * from './authz-context';
diff --git a/examples/authz/hooks/index.ts b/examples/authz/hooks/index.ts
new file mode 100644
index 00000000..d883ca4a
--- /dev/null
+++ b/examples/authz/hooks/index.ts
@@ -0,0 +1,13 @@
+export * from './useTx';
+export * from './useToast';
+export * from './usePrices';
+export * from './useGrants';
+export * from './useAuthzTx';
+export * from './useValidators';
+export * from './useDisclosure';
+export * from './useStakingData';
+export * from './useValidatorLogos';
+export * from './useQueryHooks';
+export * from './useVotingData';
+export * from './useModal';
+export * from './useSendData';
diff --git a/examples/authz/hooks/useAuthzTx.ts b/examples/authz/hooks/useAuthzTx.ts
new file mode 100644
index 00000000..b80668bb
--- /dev/null
+++ b/examples/authz/hooks/useAuthzTx.ts
@@ -0,0 +1,146 @@
+import { StdFee } from '@cosmjs/stargate';
+
+import { MsgVote } from '@interchainjs/react/cosmos/gov/v1beta1/tx';
+import { MsgWithdrawDelegatorReward } from '@interchainjs/react/cosmos/distribution/v1beta1/tx';
+import { MsgExec, MsgGrant } from '@interchainjs/react/cosmos/authz/v1beta1/tx';
+import { EncodeObject } from '@interchainjs/react/types';
+import { SendAuthorization } from '@interchainjs/react/cosmos/bank/v1beta1/authz';
+import {
+ AuthorizationType,
+ StakeAuthorization,
+} from '@interchainjs/react/cosmos/staking/v1beta1/authz';
+import { GenericAuthorization } from '@interchainjs/react/cosmos/authz/v1beta1/authz';
+
+import { getTokenByChainName, PrettyPermission } from '@/utils';
+import { Permission } from '@/configs';
+import { useToast, type CustomToast } from './useToast';
+import { coin } from '@cosmjs/amino';
+import { MsgSend } from '@interchainjs/react/cosmos/bank/v1beta1/tx';
+import {
+ MsgDelegate,
+ MsgBeginRedelegate,
+ MsgUndelegate,
+} from '@interchainjs/react/cosmos/staking/v1beta1/tx';
+import dayjs from 'dayjs';
+
+// ==========================================
+
+export type GrantMsg =
+ | {
+ grantType: typeof Permission.Send;
+ customize?: SendAuthorization;
+ }
+ | {
+ grantType: typeof Permission.Delegate;
+ customize?: StakeAuthorization;
+ }
+ | {
+ grantType: typeof Permission.ClaimRewards | typeof Permission.Vote;
+ customize?: GenericAuthorization;
+ };
+
+type CreateGrantMsgOptions = GrantMsg & {
+ grantee: MsgGrant['grantee'];
+ granter: MsgGrant['granter'];
+ expiration?: NonNullable['expiration'];
+};
+
+const createGrantMsg = (options: CreateGrantMsgOptions) => {
+ const { grantType, customize, grantee, granter, expiration } = options;
+
+ const authz: Record = {
+ send:
+ customize ||
+ GenericAuthorization.fromPartial({
+ msg: MsgSend.typeUrl,
+ }),
+ delegate:
+ customize ||
+ GenericAuthorization.fromPartial({
+ msg: MsgDelegate.typeUrl,
+ }),
+ vote: GenericAuthorization.fromPartial({
+ msg: MsgVote.typeUrl,
+ }),
+ 'claim-rewards': GenericAuthorization.fromPartial({
+ msg: MsgWithdrawDelegatorReward.typeUrl,
+ }),
+ };
+
+ return {
+ granter,
+ grantee,
+ grant: {
+ authorization: authz[grantType],
+ expiration,
+ },
+ };
+};
+
+// ==========================================
+
+export const createRevokeMsg = (permission: PrettyPermission) => {
+ const { grantee, granter, authorization: authz } = permission;
+
+ let msgTypeUrl = '';
+
+ switch (true) {
+ case GenericAuthorization.is(authz):
+ msgTypeUrl = (authz as GenericAuthorization).msg;
+ break;
+
+ case SendAuthorization.is(authz):
+ msgTypeUrl = MsgSend.typeUrl;
+ break;
+
+ case StakeAuthorization.is(authz):
+ const authzType = (authz as StakeAuthorization).authorizationType;
+ if (authzType === AuthorizationType.AUTHORIZATION_TYPE_DELEGATE) {
+ msgTypeUrl = MsgDelegate.typeUrl;
+ break;
+ }
+ if (authzType === AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE) {
+ msgTypeUrl = MsgUndelegate.typeUrl;
+ break;
+ }
+ if (authzType === AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE) {
+ msgTypeUrl = MsgBeginRedelegate.typeUrl;
+ break;
+ }
+ default:
+ break;
+ }
+
+ return {
+ grantee,
+ granter,
+ msgTypeUrl,
+ };
+};
+
+// ==========================================
+
+export const createExecMsg = ({ grantee, msgs }: MsgExec) => {
+ return { grantee, msgs };
+};
+
+// ==========================================
+
+enum TxStatus {
+ Failed = 'Transaction Failed',
+ Successful = 'Transaction Successful',
+ Broadcasting = 'Transaction Broadcasting',
+}
+
+type AuthzTxOptions = {
+ msgs: EncodeObject[];
+ fee?: StdFee | null;
+ toast?: Partial;
+ onSuccess?: () => void;
+ onComplete?: () => void;
+ execExpiration?: Date | undefined;
+};
+
+export const useAuthzTx = (chainName: string) => {
+ return { createGrantMsg, createRevokeMsg, createExecMsg };
+};
diff --git a/examples/authz/hooks/useDisclosure.ts b/examples/authz/hooks/useDisclosure.ts
new file mode 100644
index 00000000..cb14407a
--- /dev/null
+++ b/examples/authz/hooks/useDisclosure.ts
@@ -0,0 +1,18 @@
+import { useState } from 'react';
+
+export const useDisclosure = (initialState = false) => {
+ const [isOpen, setIsOpen] = useState(initialState);
+
+ const onClose = () => setIsOpen(false);
+ const onOpen = () => setIsOpen(true);
+ const onToggle = () => setIsOpen((prev) => !prev);
+
+ return {
+ isOpen,
+ onClose,
+ onOpen,
+ onToggle,
+ };
+};
+
+export type UseDisclosureReturn = ReturnType;
diff --git a/examples/authz/hooks/useGrants.ts b/examples/authz/hooks/useGrants.ts
new file mode 100644
index 00000000..294cdffe
--- /dev/null
+++ b/examples/authz/hooks/useGrants.ts
@@ -0,0 +1,102 @@
+import { useEffect, useMemo, useRef } from 'react';
+import { useChain } from '@interchain-kit/react';
+import { defaultContext, useQuery } from '@tanstack/react-query';
+
+import { prettyGrants } from '@/utils';
+import { useQueryHooks } from './useQueryHooks';
+import {
+ useGetGranteeGrants,
+ useGetGranterGrants,
+} from '@interchainjs/react/cosmos/authz/v1beta1/query.rpc.react';
+
+export const useGrants = (chainName: string) => {
+ const { address } = useChain(chainName);
+ const prevAddressRef = useRef(address);
+
+ const { rpcEndpoint, isFetching: isRpcQueryClientLoading } =
+ useQueryHooks(chainName, {
+ context: defaultContext,
+ });
+
+ const granterGrantsQuery = useGetGranterGrants({
+ request: {
+ granter: address || '',
+ },
+ options: {
+ context: defaultContext,
+ enabled: !!address && !!rpcEndpoint,
+ select: (data) => data?.grants,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const granteeGrantsQuery = useGetGranteeGrants({
+ request: {
+ grantee: address || '',
+ },
+ options: {
+ context: defaultContext,
+ enabled: !!address && !!rpcEndpoint,
+ select: (data) => data?.grants,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const dataQueries = {
+ granterGrants: granterGrantsQuery,
+ granteeGrants: granteeGrantsQuery,
+ };
+
+ const queriesToRefetch = [
+ dataQueries.granteeGrants,
+ dataQueries.granterGrants,
+ ];
+
+ const refetch = () => {
+ queriesToRefetch.forEach((query) => query.refetch());
+ };
+
+ useEffect(() => {
+ if (prevAddressRef.current !== address) {
+ refetch();
+ prevAddressRef.current = address;
+ }
+ }, [address]);
+
+ const isInitialFetching = Object.values(dataQueries).some(
+ ({ isLoading }) => isLoading
+ );
+
+ const isRefetching = Object.values(dataQueries).some(
+ ({ isRefetching }) => isRefetching
+ );
+
+ const isLoading =
+ isRpcQueryClientLoading || isInitialFetching || isRefetching;
+
+ const isError = !rpcEndpoint && !isRpcQueryClientLoading;
+
+ type DataQueries = typeof dataQueries;
+
+ type QueriesData = {
+ [Key in keyof DataQueries]: NonNullable;
+ };
+
+ const data = useMemo(() => {
+ if (isLoading) return;
+
+ const queriesData = Object.fromEntries(
+ Object.entries(dataQueries).map(([key, query]) => [key, query.data])
+ ) as QueriesData;
+
+ const { granteeGrants, granterGrants } = queriesData;
+
+ return {
+ granteeGrants: prettyGrants(granteeGrants, 'granter'),
+ granterGrants: prettyGrants(granterGrants, 'grantee'),
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isLoading]);
+
+ return { data, isLoading, isError, refetch };
+};
diff --git a/examples/authz/hooks/useModal.ts b/examples/authz/hooks/useModal.ts
new file mode 100644
index 00000000..a0d02c10
--- /dev/null
+++ b/examples/authz/hooks/useModal.ts
@@ -0,0 +1,13 @@
+import { useState } from 'react';
+
+export function useModal(title = '') {
+ const [modal, setModal] = useState({ open: false, title });
+
+ const open = () => setModal(modal => ({ ...modal, open: true }));
+ const close = () => setModal(modal => ({ ...modal, open: false }));
+ const toggle = () => setModal(modal => ({ ...modal, open: !modal.open }));
+
+ const setTitle = (title: string) => setModal(modal => ({ ...modal, title }));
+
+ return { modal, open, close, toggle, setTitle }
+}
\ No newline at end of file
diff --git a/examples/authz/hooks/usePrices.ts b/examples/authz/hooks/usePrices.ts
new file mode 100644
index 00000000..43740aa4
--- /dev/null
+++ b/examples/authz/hooks/usePrices.ts
@@ -0,0 +1,53 @@
+import { assetLists } from '@chain-registry/v2';
+import { useQuery } from '@tanstack/react-query';
+import { AssetList } from '@chain-registry/v2-types';
+
+type CoinGeckoId = string;
+type CoinGeckoUSD = { usd: number };
+type CoinGeckoUSDResponse = Record;
+export type Prices = Record;
+
+const handleError = (resp: Response) => {
+ if (!resp.ok) throw Error(resp.statusText);
+ return resp;
+};
+
+const getGeckoIdsFromAssets = (assets: AssetList[]) => {
+ return assetLists
+ .map((asset) => asset.assets[0].coingeckoId)
+ .filter(Boolean) as string[];
+};
+
+const formatPrices = (
+ prices: CoinGeckoUSDResponse,
+ assets: AssetList[]
+): Prices => {
+ return Object.entries(prices).reduce((priceHash, cur) => {
+ const assetList = assetLists.find(
+ (asset) => asset.assets[0].coingeckoId === cur[0]
+ )!;
+ const denom = assetList.assets[0].base;
+ return { ...priceHash, [denom]: cur[1].usd };
+ }, {});
+};
+
+const fetchPrices = async (
+ geckoIds: string[]
+): Promise => {
+ const url = `https://api.coingecko.com/api/v3/simple/price?ids=${geckoIds.join()}&vs_currencies=usd`;
+
+ return fetch(url)
+ .then(handleError)
+ .then((res) => res.json());
+};
+
+export const usePrices = () => {
+ const geckoIds = getGeckoIdsFromAssets(assetLists);
+
+ return useQuery({
+ queryKey: ['prices'],
+ queryFn: () => fetchPrices(geckoIds),
+ select: (data) => formatPrices(data, assetLists),
+ staleTime: Infinity,
+ });
+};
diff --git a/examples/authz/hooks/useQueryHooks.ts b/examples/authz/hooks/useQueryHooks.ts
new file mode 100644
index 00000000..ad4a4d81
--- /dev/null
+++ b/examples/authz/hooks/useQueryHooks.ts
@@ -0,0 +1,32 @@
+import { useChain } from '@interchain-kit/react';
+import {
+ useRpcEndpoint,
+} from '@interchainjs/react/react-query';
+import { UseQueryOptions } from '@tanstack/react-query';
+import { HttpEndpoint } from '@interchainjs/types';
+export const useQueryHooks = (
+ chainName: string,
+ options?: UseQueryOptions
+) => {
+ const { getRpcEndpoint } = useChain(chainName);
+
+ const rpcEndpointQuery = useRpcEndpoint({
+ getter: getRpcEndpoint,
+ options: {
+ staleTime: Infinity,
+ queryKeyHashFn: (queryKey) => {
+ return JSON.stringify([...queryKey, chainName]);
+ },
+ ...options,
+ },
+ });
+
+ const isReady = Boolean(rpcEndpointQuery.data);
+ const isFetching = rpcEndpointQuery.isFetching || rpcEndpointQuery.isFetching;
+
+ return {
+ isReady,
+ isFetching,
+ rpcEndpoint: rpcEndpointQuery.data,
+ };
+};
diff --git a/examples/authz/hooks/useSendData.ts b/examples/authz/hooks/useSendData.ts
new file mode 100644
index 00000000..72e6f0d7
--- /dev/null
+++ b/examples/authz/hooks/useSendData.ts
@@ -0,0 +1,80 @@
+import { useMemo } from 'react';
+
+import { usePrices } from './usePrices';
+import { shiftDigits } from '@/utils';
+import { useAuthzContext } from '@/context';
+import { getCoin, getExponent } from '@/configs';
+import { useQueryHooks } from './useQueryHooks';
+import { useGetBalance } from '@interchainjs/react/cosmos/bank/v1beta1/query.rpc.react';
+import { defaultContext } from '@tanstack/react-query';
+
+export const useSendData = (chainName: string) => {
+ const { permission } = useAuthzContext();
+
+ const address = permission?.granter;
+
+ const coin = getCoin(chainName);
+ const exp = getExponent(chainName);
+
+ const {
+ isReady: isQueryHooksReady,
+ isFetching: isQueryHooksFetching,
+ rpcEndpoint,
+ } = useQueryHooks(chainName, {
+ context: defaultContext,
+ });
+
+ const balanceQuery = useGetBalance({
+ request: {
+ address: address || '',
+ denom: coin.base,
+ },
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady && !!address,
+ select: ({ balance }) => shiftDigits(balance?.amount || '0', -exp),
+ staleTime: 0,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const pricesQuery = usePrices();
+
+ const allQueries = {
+ prices: pricesQuery,
+ balance: balanceQuery,
+ };
+
+ const updatableQueries = [allQueries.balance];
+
+ const refetch = () => {
+ updatableQueries.forEach((query) => query.refetch());
+ };
+
+ const isInitialFetching = Object.values(allQueries).some(
+ ({ isLoading }) => isLoading
+ );
+
+ const isRefetching = Object.values(allQueries).some(
+ ({ isRefetching }) => isRefetching
+ );
+
+ const isLoading = isQueryHooksFetching || isInitialFetching || isRefetching;
+
+ type AllQueries = typeof allQueries;
+
+ type QueriesData = {
+ [Key in keyof AllQueries]: NonNullable;
+ };
+
+ const data = useMemo(() => {
+ if (isLoading) return;
+
+ return Object.fromEntries(
+ Object.entries(allQueries).map(([key, query]) => [key, query.data])
+ ) as QueriesData;
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isLoading]);
+
+ return { data, isLoading, refetch };
+};
diff --git a/examples/authz/hooks/useStakingData.ts b/examples/authz/hooks/useStakingData.ts
new file mode 100644
index 00000000..f527a763
--- /dev/null
+++ b/examples/authz/hooks/useStakingData.ts
@@ -0,0 +1,280 @@
+import { useEffect, useMemo } from 'react';
+import BigNumber from 'bignumber.js';
+
+import { usePrices } from './usePrices';
+import { getCoin, getExponent } from '@/configs';
+import {
+ shiftDigits,
+ calcTotalDelegation,
+ extendValidators,
+ parseAnnualProvisions,
+ parseDelegations,
+ parseRewards,
+ parseUnbondingDays,
+ parseValidators,
+} from '@/utils';
+import { useAuthzContext } from '@/context';
+import { useQueryHooks } from './useQueryHooks';
+import { useGetBalance } from '@interchainjs/react/cosmos/bank/v1beta1/query.rpc.react';
+import {
+ useGetDelegatorDelegations,
+ useGetDelegatorValidators,
+ useGetParams as useGetStakingParams,
+ useGetPool,
+ useGetValidators,
+} from '@interchainjs/react/cosmos/staking/v1beta1/query.rpc.react';
+import {
+ useGetDelegationTotalRewards,
+ useGetParams as useGetDistributionParams,
+} from '@interchainjs/react/cosmos/distribution/v1beta1/query.rpc.react';
+import { useGetAnnualProvisions } from '@interchainjs/react/cosmos/mint/v1beta1/query.rpc.react';
+import {
+ BondStatus,
+ bondStatusToJSON,
+} from '@interchainjs/react/cosmos/staking/v1beta1/staking';
+import { defaultContext } from '@tanstack/react-query';
+
+(BigInt.prototype as any).toJSON = function () {
+ return this.toString();
+};
+
+export const useStakingData = (chainName: string) => {
+ const { permission } = useAuthzContext();
+
+ const address = permission?.granter;
+
+ const coin = getCoin(chainName);
+ const exp = getExponent(chainName);
+
+ const {
+ rpcEndpoint,
+ isReady: isQueryHooksReady,
+ isFetching: isQueryHooksFetching,
+ } = useQueryHooks(chainName, {
+ context: defaultContext,
+ });
+
+ const balanceQuery = useGetBalance({
+ request: {
+ address: address || '',
+ denom: coin.base,
+ },
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady && !!address,
+ select: ({ balance }) => shiftDigits(balance?.amount || '0', -exp),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const myValidatorsQuery = useGetDelegatorValidators({
+ request: {
+ delegatorAddr: address || '',
+ },
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady && !!address,
+ select: ({ validators }) => parseValidators(validators),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const rewardsQuery = useGetDelegationTotalRewards({
+ request: {
+ delegatorAddress: address || '',
+ },
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady && !!address,
+ select: (data) => parseRewards(data, coin.base, -exp),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const validatorsQuery = useGetValidators({
+ request: {
+ status: bondStatusToJSON(BondStatus.BOND_STATUS_BONDED),
+ pagination: {
+ key: new Uint8Array(),
+ offset: 0n,
+ limit: 200n,
+ countTotal: true,
+ reverse: false,
+ },
+ },
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady,
+ select: ({ validators }) => {
+ const sorted = validators.sort((a, b) =>
+ new BigNumber(b.tokens).minus(a.tokens).toNumber()
+ );
+ return parseValidators(sorted);
+ },
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const delegationsQuery = useGetDelegatorDelegations({
+ request: {
+ delegatorAddr: address || '',
+ pagination: {
+ key: new Uint8Array(),
+ offset: 0n,
+ limit: 100n,
+ countTotal: true,
+ reverse: false,
+ },
+ },
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady && !!address,
+ select: ({ delegationResponses }) =>
+ parseDelegations(delegationResponses, -exp),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const unbondingDaysQuery = useGetStakingParams({
+ request: {},
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady,
+ select: ({ params }) => parseUnbondingDays(params),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const annualProvisionsQuery = useGetAnnualProvisions({
+ request: {},
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady,
+ select: parseAnnualProvisions,
+ retry: false,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const poolQuery = useGetPool({
+ request: {},
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady,
+ select: ({ pool }) => pool,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const communityTaxQuery = useGetDistributionParams({
+ request: {},
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady,
+ select: ({ params }) => shiftDigits(params?.communityTax || '0', -18),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const pricesQuery = usePrices();
+
+ const allQueries = {
+ balance: balanceQuery,
+ myValidators: myValidatorsQuery,
+ rewards: rewardsQuery,
+ allValidators: validatorsQuery,
+ delegations: delegationsQuery,
+ unbondingDays: unbondingDaysQuery,
+ annualProvisions: annualProvisionsQuery,
+ pool: poolQuery,
+ communityTax: communityTaxQuery,
+ prices: pricesQuery,
+ };
+
+ const queriesWithUnchangingKeys = [
+ allQueries.unbondingDays,
+ allQueries.annualProvisions,
+ allQueries.pool,
+ allQueries.communityTax,
+ allQueries.allValidators,
+ ];
+
+ const updatableQueriesAfterMutation = [
+ allQueries.balance,
+ allQueries.myValidators,
+ allQueries.rewards,
+ allQueries.allValidators,
+ allQueries.delegations,
+ ];
+
+ useEffect(() => {
+ queriesWithUnchangingKeys.forEach((query) => query.remove());
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [chainName]);
+
+ const isInitialFetching = Object.values(allQueries).some(
+ ({ isLoading }) => isLoading
+ );
+
+ const isRefetching = Object.values(allQueries).some(
+ ({ isRefetching }) => isRefetching
+ );
+
+ const isLoading = isQueryHooksFetching || isInitialFetching || isRefetching;
+
+ type AllQueries = typeof allQueries;
+
+ type QueriesData = {
+ [Key in keyof AllQueries]: NonNullable;
+ };
+
+ const data = useMemo(() => {
+ if (isLoading) return;
+
+ const queriesData = Object.fromEntries(
+ Object.entries(allQueries).map(([key, query]) => [key, query.data])
+ ) as QueriesData;
+
+ const {
+ allValidators,
+ delegations,
+ rewards,
+ myValidators,
+ annualProvisions,
+ communityTax,
+ pool,
+ } = queriesData;
+
+ const chainMetadata = { annualProvisions, communityTax, pool };
+
+ const extendedAllValidators = extendValidators({
+ validators: allValidators,
+ delegations,
+ rewards: rewards?.byValidators,
+ chainMetadata,
+ });
+
+ const extendedMyValidators = extendValidators({
+ validators: myValidators,
+ delegations,
+ rewards: rewards?.byValidators,
+ chainMetadata,
+ });
+
+ const totalDelegated = calcTotalDelegation(delegations);
+
+ return {
+ ...queriesData,
+ allValidators: extendedAllValidators,
+ myValidators: extendedMyValidators,
+ totalDelegated,
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isLoading]);
+
+ const refetch = () => {
+ updatableQueriesAfterMutation.forEach((query) => query.refetch());
+ };
+
+ return { data, isLoading, refetch };
+};
diff --git a/examples/authz/hooks/useToast.tsx b/examples/authz/hooks/useToast.tsx
new file mode 100644
index 00000000..7fe92538
--- /dev/null
+++ b/examples/authz/hooks/useToast.tsx
@@ -0,0 +1,38 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { toast, Text, ToastType, Spinner } from '@interchain-ui/react';
+
+export type CustomToast = {
+ type: ToastType;
+ title: string;
+ duration?: number;
+ description?: string | JSX.Element;
+};
+
+const ToastTitle = ({ title }: { title: string }) => {
+ return (
+
+ {title}
+
+ );
+};
+
+export const useToast = () => {
+ const customToast = ({
+ type,
+ title,
+ description,
+ duration = 5000,
+ }: CustomToast) => {
+ return toast.custom(type, , {
+ duration,
+ description,
+ icon: type === 'loading' && ,
+ });
+ };
+
+ customToast.close = toast.dismiss;
+
+ return { toast: customToast };
+};
diff --git a/examples/authz/hooks/useTx.ts b/examples/authz/hooks/useTx.ts
new file mode 100644
index 00000000..fe329986
--- /dev/null
+++ b/examples/authz/hooks/useTx.ts
@@ -0,0 +1,42 @@
+import { useChain } from '@interchain-kit/react';
+import { isDeliverTxSuccess, StdFee } from '@cosmjs/stargate';
+import { useToast, type CustomToast } from './useToast';
+import { useQuery } from '@tanstack/react-query';
+
+import { SigningClient } from '@interchainjs/cosmos/signing-client';
+import {
+ AminoGenericOfflineSigner,
+ DirectGenericOfflineSigner,
+} from '@interchainjs/cosmos/types/wallet';
+
+interface Msg {
+ typeUrl: string;
+ value: any;
+}
+
+interface TxOptions {
+ fee?: StdFee | null;
+ toast?: Partial;
+ onSuccess?: () => void;
+}
+
+export enum TxStatus {
+ Failed = 'Transaction Failed',
+ Successful = 'Transaction Successful',
+ Broadcasting = 'Transaction Broadcasting',
+}
+
+export const useSigningClient = (chainName: string) => {
+ const { getSigningClient } = useChain(chainName);
+
+ return useQuery(
+ ['signingClient', chainName],
+ async () => {
+ const client = await getSigningClient();
+ return client;
+ },
+ {
+ enabled: !!chainName,
+ }
+ );
+};
\ No newline at end of file
diff --git a/examples/authz/hooks/useValidatorLogos.ts b/examples/authz/hooks/useValidatorLogos.ts
new file mode 100644
index 00000000..01deb501
--- /dev/null
+++ b/examples/authz/hooks/useValidatorLogos.ts
@@ -0,0 +1,13 @@
+import { ExtendedValidator, getLogoUrls } from '@/utils';
+import { useQuery } from '@tanstack/react-query';
+
+export const useValidatorLogos = (
+ chainName: string,
+ validators: ExtendedValidator[]
+) => {
+ return useQuery({
+ queryKey: ['validatorLogos', chainName, validators.length],
+ queryFn: () => getLogoUrls(validators, chainName),
+ staleTime: Infinity,
+ });
+};
diff --git a/examples/authz/hooks/useValidators.ts b/examples/authz/hooks/useValidators.ts
new file mode 100644
index 00000000..d3aaeb9b
--- /dev/null
+++ b/examples/authz/hooks/useValidators.ts
@@ -0,0 +1,117 @@
+import { useMemo } from 'react';
+import { defaultContext, useQuery } from '@tanstack/react-query';
+import BigNumber from 'bignumber.js';
+
+import { extendValidators, getLogoUrls, parseValidators } from '@/utils';
+import { useQueryHooks } from './useQueryHooks';
+import {
+ BondStatus,
+ bondStatusToJSON,
+} from '@interchainjs/react/cosmos/staking/v1beta1/staking';
+import {
+ useGetValidator,
+ useGetValidators,
+} from '@interchainjs/react/cosmos/staking/v1beta1/query.rpc.react';
+
+(BigInt.prototype as any).toJSON = function () {
+ return this.toString();
+};
+
+type UseValidatorsConfig = {
+ fetchLogos?: boolean;
+};
+
+export const useValidators = (
+ chainName: string,
+ { fetchLogos = true }: UseValidatorsConfig = {}
+) => {
+ const {
+ rpcEndpoint,
+ isReady: isQueryHooksReady,
+ isFetching: isQueryHooksFetching,
+ } = useQueryHooks(chainName, {
+ context: defaultContext,
+ });
+
+ const validatorsQuery = useGetValidators({
+ request: {
+ status: bondStatusToJSON(BondStatus.BOND_STATUS_BONDED),
+ pagination: {
+ key: new Uint8Array(),
+ offset: 0n,
+ limit: 500n,
+ countTotal: true,
+ reverse: false,
+ },
+ },
+ options: {
+ context: defaultContext,
+ enabled: isQueryHooksReady,
+ select: ({ validators }) => {
+ const sorted = validators.sort((a, b) =>
+ new BigNumber(b.tokens).minus(a.tokens).toNumber()
+ );
+ return parseValidators(sorted);
+ },
+ queryKeyHashFn: (queryKey) => {
+ return JSON.stringify([...queryKey, chainName]);
+ },
+ staleTime: Infinity,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const validatorLogosQuery = useQuery({
+ queryKey: ['validatorLogos', chainName],
+ queryFn: () => getLogoUrls(validatorsQuery.data || [], chainName),
+ enabled: !!validatorsQuery.data && fetchLogos,
+ staleTime: Infinity,
+ });
+
+ const allQueries = {
+ validators: validatorsQuery,
+ validatorLogos: validatorLogosQuery,
+ };
+
+ const queriesToRefetch = [allQueries.validators];
+
+ const refetch = () => {
+ queriesToRefetch.forEach((query) => query.refetch());
+ };
+
+ const isInitialFetching = Object.values(allQueries).some(
+ ({ isFetching }) => isFetching
+ );
+
+ const isRefetching = Object.values(allQueries).some(
+ ({ isRefetching }) => isRefetching
+ );
+
+ const isLoading = isQueryHooksFetching || isInitialFetching || isRefetching;
+
+ type AllQueries = typeof allQueries;
+
+ type QueriesData = {
+ [Key in keyof AllQueries]: NonNullable;
+ };
+
+ const data = useMemo(() => {
+ if (isLoading) return;
+
+ const queriesData = Object.fromEntries(
+ Object.entries(allQueries).map(([key, query]) => [key, query.data])
+ ) as QueriesData;
+
+ const { validators, validatorLogos } = queriesData;
+
+ const extendedValidators = extendValidators({
+ validators,
+ logos: validatorLogos,
+ });
+
+ return extendedValidators;
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isLoading]);
+
+ return { data, isLoading, refetch };
+};
diff --git a/examples/authz/hooks/useVotingData.ts b/examples/authz/hooks/useVotingData.ts
new file mode 100644
index 00000000..4a7241a5
--- /dev/null
+++ b/examples/authz/hooks/useVotingData.ts
@@ -0,0 +1,184 @@
+import { useEffect, useMemo, useState } from 'react';
+import { defaultContext, useQueries } from '@tanstack/react-query';
+import { ProposalStatus } from '@interchainjs/react/cosmos/gov/v1beta1/gov';
+
+import { paginate, parseQuorum, processProposals } from '@/utils';
+import { useQueryHooks } from './useQueryHooks';
+import { useAuthzContext } from '@/context';
+
+import {
+ useGetProposals,
+ useGetParams as useGetGovParams,
+ useGetVote,
+} from '@interchainjs/react/cosmos/gov/v1beta1/query.rpc.react';
+import { createGetVote } from "@interchainjs/react/cosmos/gov/v1beta1/query.rpc.func";
+import {
+ useGetDelegatorDelegations,
+ useGetDelegatorValidators,
+ useGetPool,
+ useGetValidators,
+} from '@interchainjs/react/cosmos/staking/v1beta1/query.rpc.react';
+
+(BigInt.prototype as any).toJSON = function () {
+ return this.toString();
+};
+
+export interface Votes {
+ [key: string]: number;
+}
+
+export function useVotingData(chainName: string) {
+ const [isLoading, setIsLoading] = useState(false);
+ const { permission } = useAuthzContext();
+
+ const address = permission?.granter;
+
+ const {
+ rpcEndpoint,
+ isReady,
+ isFetching,
+ } = useQueryHooks(chainName, {
+ context: defaultContext,
+ });
+
+ const proposalsQuery = useGetProposals({
+ request: {
+ voter: '',
+ depositor: '',
+ pagination: paginate(50n, true),
+ proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,
+ },
+ options: {
+ context: defaultContext,
+ enabled: isReady,
+ staleTime: Infinity,
+ select: ({ proposals }) => processProposals(proposals),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const bondedTokensQuery = useGetPool({
+ request: {},
+ options: {
+ context: defaultContext,
+ enabled: isReady,
+ staleTime: Infinity,
+ select: ({ pool }) => pool?.bondedTokens,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const quorumQuery = useGetGovParams({
+ request: {
+ paramsType: 'tallying',
+ },
+ options: {
+ context: defaultContext,
+ enabled: isReady,
+ staleTime: Infinity,
+ select: ({ tallyParams }) => parseQuorum(tallyParams?.quorum),
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const votedProposalsQuery = useGetProposals({
+ request: {
+ voter: address || '/', // use '/' to differentiate from proposalsQuery
+ depositor: '',
+ pagination: paginate(50n, true),
+ proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,
+ },
+ options: {
+ context: defaultContext,
+ enabled: isReady && Boolean(address),
+ select: ({ proposals }) => proposals,
+ keepPreviousData: true,
+ },
+ clientResolver: rpcEndpoint,
+ });
+
+ const getVote = createGetVote(rpcEndpoint);
+
+ const votesQueries = useQueries({
+ queries: (votedProposalsQuery.data || []).map(({ proposalId }) => ({
+ queryKey: ['voteQuery', proposalId, address],
+ queryFn: () =>
+ getVote({
+ proposalId,
+ voter: address || '',
+ }),
+ enabled:
+ Boolean(rpcEndpoint) &&
+ Boolean(address) &&
+ Boolean(votedProposalsQuery.data),
+ keepPreviousData: true,
+ })),
+ context: defaultContext,
+ });
+
+ const singleQueries = {
+ quorum: quorumQuery,
+ proposals: proposalsQuery,
+ bondedTokens: bondedTokensQuery,
+ votedProposals: votedProposalsQuery,
+ };
+
+ const staticQueries = [
+ singleQueries.quorum,
+ singleQueries.proposals,
+ singleQueries.bondedTokens,
+ ];
+
+ const dynamicQueries = [singleQueries.votedProposals];
+
+ useEffect(() => {
+ staticQueries.forEach((query) => query.remove());
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [chainName]);
+
+ const isStaticQueriesFetching = staticQueries.some(
+ ({ isFetching }) => isFetching
+ );
+
+ const isDynamicQueriesFetching =
+ singleQueries.votedProposals.isFetching ||
+ votesQueries.some(({ isFetching }) => isFetching);
+
+ const loading =
+ isFetching || isStaticQueriesFetching || isDynamicQueriesFetching;
+
+ useEffect(() => {
+ // no loading when refetching
+ if (isFetching || isStaticQueriesFetching) setIsLoading(true);
+ if (!loading) setIsLoading(false);
+ }, [isStaticQueriesFetching, loading]);
+
+ type SingleQueries = typeof singleQueries;
+
+ type SingleQueriesData = {
+ [Key in keyof SingleQueries]: NonNullable;
+ };
+
+ const singleQueriesData = useMemo(() => {
+ if (isStaticQueriesFetching || !isReady) return;
+
+ return Object.fromEntries(
+ Object.entries(singleQueries).map(([key, query]) => [key, query.data])
+ ) as SingleQueriesData;
+ }, [isStaticQueriesFetching, isReady]);
+
+ const votes = useMemo(() => {
+ const votesEntries = votesQueries
+ .map((query) => query.data)
+ .map((data) => [data?.vote?.proposalId, data?.vote?.options[0].option]);
+
+ return Object.fromEntries(votesEntries) as Votes;
+ }, [votesQueries]);
+
+ const refetch = () => {
+ votesQueries.forEach((query) => query.remove());
+ dynamicQueries.forEach((query) => query.refetch());
+ };
+
+ return { data: { ...singleQueriesData, votes }, isLoading, refetch };
+}
diff --git a/examples/authz/next.config.js b/examples/authz/next.config.js
new file mode 100644
index 00000000..48b8e8e4
--- /dev/null
+++ b/examples/authz/next.config.js
@@ -0,0 +1,16 @@
+/** @type {import('next').NextConfig} */
+const nextConfig = {
+ typescript: {
+ ignoreBuildErrors: true,
+ },
+ eslint: {
+ ignoreDuringBuilds: true,
+ },
+ reactStrictMode: true,
+ swcMinify: true,
+ images: {
+ domains: ['raw.githubusercontent.com'],
+ },
+};
+
+module.exports = nextConfig;
diff --git a/examples/authz/package.json b/examples/authz/package.json
new file mode 100644
index 00000000..3b0e1813
--- /dev/null
+++ b/examples/authz/package.json
@@ -0,0 +1,90 @@
+{
+ "name": "@cosmology/authz",
+ "version": "1.1.0",
+ "private": true,
+ "scripts": {
+ "dev": "next dev",
+ "build": "yarn build:tsc && next build",
+ "build:tsc": "yarn tsc -p tsconfig.json --outDir main --module commonjs",
+ "clean": "rimraf ./types && rimraf ./src/codegen",
+ "locks:remove": "rm -f yarn.lock",
+ "locks:create": "generate-lockfile --lockfile ../../yarn.lock --package package.json --write yarn.lock --force",
+ "locks": "npm run locks:remove && npm run locks:create",
+ "codegen": "node scripts/codegen.js"
+ },
+ "jest": {
+ "preset": "ts-jest",
+ "testEnvironment": "node",
+ "transform": {
+ "^.+\\.ts?$": "ts-jest"
+ },
+ "transformIgnorePatterns": [
+ "/node_modules/"
+ ],
+ "testPathIgnorePatterns": [
+ "main/",
+ "module/",
+ "types/"
+ ]
+ },
+ "resolutions": {
+ "react": "18.2.0",
+ "react-dom": "18.2.0",
+ "@types/react": "18.0.25",
+ "@types/react-dom": "18.0.9"
+ },
+ "dependencies": {
+ "@chain-registry/client": "^1.53.13",
+ "@chain-registry/types": "^0.50.13",
+ "@cosmjs/amino": "0.32.4",
+ "@cosmjs/cosmwasm-stargate": "0.32.4",
+ "@cosmjs/encoding": "^0.32.4",
+ "@cosmjs/proto-signing": "0.32.4",
+ "@cosmjs/stargate": "0.32.4",
+ "@cosmjs/tendermint-rpc": "0.32.4",
+ "@cosmology/lcd": "^0.12.0",
+ "@interchain-kit/core": "0.0.1-beta.62",
+ "@interchain-kit/keplr-extension": "0.0.1-beta.62",
+ "@interchain-kit/leap-extension": "0.0.1-beta.62",
+ "@interchain-kit/react": "0.0.1-beta.62",
+ "@interchain-ui/react": "1.23.22",
+ "@interchain-ui/react-no-ssr": "^0.1.6",
+ "@interchainjs/cosmos": "1.8.1",
+ "@interchainjs/react": "1.8.1",
+ "@tanstack/react-query": "4.32.0",
+ "bignumber.js": "9.1.0",
+ "chain-registry": "^1.69.32",
+ "dayjs": "1.11.10",
+ "fast-fuzzy": "^1.12.0",
+ "interchain-kit": "0.0.1-beta.62",
+ "next": "^13",
+ "react": "18.2.0",
+ "react-calendar": "4.8.0",
+ "react-dom": "18.2.0",
+ "react-icons": "^4.4.0",
+ "react-markdown": "9.0.1"
+ },
+ "devDependencies": {
+ "@confio/relayer": "0.7.0",
+ "@cosmjson/wasmswap": "^0.0.9",
+ "@cosmology/telescope": "1.11.7",
+ "@protobufs/cosmos": "^0.1.0",
+ "@protobufs/cosmwasm": "^0.1.1",
+ "@protobufs/ibc": "^0.1.0",
+ "@tanstack/react-query-devtools": "4.32.0",
+ "@types/jest": "^29.5.0",
+ "@types/node": "18.19.37",
+ "@types/react": "18.2.0",
+ "@types/react-dom": "18.2.0",
+ "eslint": "8.28.0",
+ "eslint-config-next": "13.0.5",
+ "generate-lockfile": "0.0.12",
+ "jest": "^29.5.0",
+ "jest-in-case": "^1.0.2",
+ "node-fetch": "^2.6.9",
+ "sinon": "17.0.1",
+ "ts-jest": "^29.1.0",
+ "typescript": "^5.1.6"
+ },
+ "packageManager": "yarn@4.3.0"
+}
diff --git a/examples/authz/pages/_app.tsx b/examples/authz/pages/_app.tsx
new file mode 100644
index 00000000..01fab531
--- /dev/null
+++ b/examples/authz/pages/_app.tsx
@@ -0,0 +1,91 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import '@interchain-ui/react/styles';
+import '@interchain-ui/react/globalStyles';
+import 'react-calendar/dist/Calendar.css';
+
+import React from 'react';
+import type { AppProps } from 'next/app';
+import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
+// import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
+
+import { SignerOptions, wallets } from 'interchain-kit';
+import { ChainProvider } from '@interchain-kit/react';
+import { chains, assetLists } from '@chain-registry/v2';
+import { keplrWallet } from '@interchain-kit/keplr-extension';
+import { leapWallet } from '@interchain-kit/leap-extension';
+
+import {
+ Box,
+ Toaster,
+ useTheme,
+ useColorModeValue,
+ ThemeProvider,
+} from '@interchain-ui/react';
+import { AuthzProvider } from '@/context';
+
+const queryClient = new QueryClient({
+ defaultOptions: {
+ queries: {
+ retry: 2,
+ refetchOnWindowFocus: false,
+ staleTime: Infinity,
+ },
+ },
+});
+
+function CreateCosmosApp({ Component, pageProps }: AppProps) {
+ const { themeClass } = useTheme();
+
+ return (
+
+ {
+ if (chain === 'juno') {
+ return {
+ preferredSignType: 'direct',
+ broadcast: {
+ checkTx: true,
+ deliverTx: true,
+ },
+ };
+ }
+ },
+ }}
+ endpointOptions={{
+ endpoints: {
+ osmosis: {
+ rpc: ['https://rpc.osmosis.zone'],
+ },
+ juno: {
+ rpc: ['https://juno-rpc.stakeandrelax.net/'],
+ },
+ },
+ }}
+ >
+
+
+
+ {/* TODO fix type error */}
+ {/* @ts-ignore */}
+
+
+
+
+ {/* */}
+
+
+
+ );
+}
+
+export default CreateCosmosApp;
diff --git a/examples/authz/pages/claim-rewards.tsx b/examples/authz/pages/claim-rewards.tsx
new file mode 100644
index 00000000..8622a211
--- /dev/null
+++ b/examples/authz/pages/claim-rewards.tsx
@@ -0,0 +1,36 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { Divider } from '@interchain-ui/react';
+import { useAuthzContext } from '@/context';
+import {
+ Layout,
+ Wallet,
+ LoginInfoBanner,
+ ClaimRewardsSection,
+} from '@/components';
+import { withServerSideRedirect } from '@/utils';
+
+export const getServerSideProps = withServerSideRedirect({ to: '/' });
+
+export default function ClaimRewards() {
+ const { chainName, permission } = useAuthzContext();
+
+ return (
+
+
+
+ {chainName && (
+ <>
+ {permission && (
+
+ )}
+
+ >
+ )}
+
+ );
+}
diff --git a/examples/authz/pages/index.tsx b/examples/authz/pages/index.tsx
new file mode 100644
index 00000000..2e27b91c
--- /dev/null
+++ b/examples/authz/pages/index.tsx
@@ -0,0 +1,28 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { useState } from 'react';
+import { Divider } from '@interchain-ui/react';
+
+import { useAuthzContext } from '@/context';
+import { Layout, Wallet, AuthzSection } from '@/components';
+
+export default function Home() {
+ const [selectedChain, setSelectedChain] = useState();
+ const { setChainName } = useAuthzContext();
+
+ return (
+
+ {
+ setSelectedChain(chainName);
+ setChainName(chainName);
+ }}
+ />
+
+ {selectedChain && }
+
+ );
+}
diff --git a/examples/authz/pages/send.tsx b/examples/authz/pages/send.tsx
new file mode 100644
index 00000000..c2eb18ab
--- /dev/null
+++ b/examples/authz/pages/send.tsx
@@ -0,0 +1,31 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { Divider } from '@interchain-ui/react';
+import { useAuthzContext } from '@/context';
+import { withServerSideRedirect } from '@/utils';
+import { Layout, Wallet, LoginInfoBanner, SendSection } from '@/components';
+
+export const getServerSideProps = withServerSideRedirect({ to: '/' });
+
+export default function Send() {
+ const { chainName, permission } = useAuthzContext();
+
+ return (
+
+
+
+ {chainName && (
+ <>
+ {permission && (
+
+ )}
+
+ >
+ )}
+
+ );
+}
diff --git a/examples/authz/pages/stake.tsx b/examples/authz/pages/stake.tsx
new file mode 100644
index 00000000..8d491a10
--- /dev/null
+++ b/examples/authz/pages/stake.tsx
@@ -0,0 +1,32 @@
+import { Divider } from '@interchain-ui/react';
+import { useAuthzContext } from '@/context';
+import { withServerSideRedirect } from '@/utils';
+import { Layout, LoginInfoBanner, StakingSection, Wallet } from '@/components';
+
+export const getServerSideProps = withServerSideRedirect({ to: '/' });
+
+export default function Stake() {
+ const { chainName, permission } = useAuthzContext();
+
+ return (
+ // @ts-ignore
+
+ {/* @ts-ignore */}
+
+
+ {chainName && (
+ <>
+ {permission && (
+ // @ts-ignore
+
+ )}
+ {/* @ts-ignore */}
+
+ >
+ )}
+
+ );
+}
diff --git a/examples/authz/pages/vote.tsx b/examples/authz/pages/vote.tsx
new file mode 100644
index 00000000..e7696ae9
--- /dev/null
+++ b/examples/authz/pages/vote.tsx
@@ -0,0 +1,31 @@
+// TODO fix type issues
+// @ts-nocheck
+
+import { Divider } from '@interchain-ui/react';
+import { useAuthzContext } from '@/context';
+import { withServerSideRedirect } from '@/utils';
+import { Layout, Wallet, LoginInfoBanner, Voting } from '@/components';
+
+export const getServerSideProps = withServerSideRedirect({ to: '/' });
+
+export default function Vote() {
+ const { chainName, permission } = useAuthzContext();
+
+ return (
+
+
+
+ {chainName && (
+ <>
+ {permission && (
+
+ )}
+
+ >
+ )}
+
+ );
+}
diff --git a/examples/authz/proto/confio/LICENSE b/examples/authz/proto/confio/LICENSE
new file mode 100644
index 00000000..deaad1f5
--- /dev/null
+++ b/examples/authz/proto/confio/LICENSE
@@ -0,0 +1,204 @@
+Confio/ICS23
+License: Apache2.0
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2019 Confio UO
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/examples/authz/proto/confio/README.md b/examples/authz/proto/confio/README.md
new file mode 100644
index 00000000..af52fb63
--- /dev/null
+++ b/examples/authz/proto/confio/README.md
@@ -0,0 +1 @@
+# confio
\ No newline at end of file
diff --git a/examples/authz/proto/confio/proofs.proto b/examples/authz/proto/confio/proofs.proto
new file mode 100644
index 00000000..da43503e
--- /dev/null
+++ b/examples/authz/proto/confio/proofs.proto
@@ -0,0 +1,234 @@
+syntax = "proto3";
+
+package ics23;
+option go_package = "github.com/confio/ics23/go";
+
+enum HashOp {
+ // NO_HASH is the default if no data passed. Note this is an illegal argument some places.
+ NO_HASH = 0;
+ SHA256 = 1;
+ SHA512 = 2;
+ KECCAK = 3;
+ RIPEMD160 = 4;
+ BITCOIN = 5; // ripemd160(sha256(x))
+}
+
+/**
+LengthOp defines how to process the key and value of the LeafOp
+to include length information. After encoding the length with the given
+algorithm, the length will be prepended to the key and value bytes.
+(Each one with it's own encoded length)
+*/
+enum LengthOp {
+ // NO_PREFIX don't include any length info
+ NO_PREFIX = 0;
+ // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
+ VAR_PROTO = 1;
+ // VAR_RLP uses rlp int encoding of the length
+ VAR_RLP = 2;
+ // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
+ FIXED32_BIG = 3;
+ // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
+ FIXED32_LITTLE = 4;
+ // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
+ FIXED64_BIG = 5;
+ // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
+ FIXED64_LITTLE = 6;
+ // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
+ REQUIRE_32_BYTES = 7;
+ // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
+ REQUIRE_64_BYTES = 8;
+}
+
+/**
+ExistenceProof takes a key and a value and a set of steps to perform on it.
+The result of peforming all these steps will provide a "root hash", which can
+be compared to the value in a header.
+
+Since it is computationally infeasible to produce a hash collission for any of the used
+cryptographic hash functions, if someone can provide a series of operations to transform
+a given key and value into a root hash that matches some trusted root, these key and values
+must be in the referenced merkle tree.
+
+The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+which should be controlled by a spec. Eg. with lengthOp as NONE,
+ prefix = FOO, key = BAR, value = CHOICE
+and
+ prefix = F, key = OOBAR, value = CHOICE
+would produce the same value.
+
+With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+in the ProofSpec is valuable to prevent this mutability. And why all trees should
+length-prefix the data before hashing it.
+*/
+message ExistenceProof {
+ bytes key = 1;
+ bytes value = 2;
+ LeafOp leaf = 3;
+ repeated InnerOp path = 4;
+}
+
+/*
+NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+one right of the desired key. If both proofs are valid AND they are neighbors,
+then there is no valid proof for the given key.
+*/
+message NonExistenceProof {
+ bytes key = 1; // TODO: remove this as unnecessary??? we prove a range
+ ExistenceProof left = 2;
+ ExistenceProof right = 3;
+}
+
+/*
+CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
+*/
+message CommitmentProof {
+ oneof proof {
+ ExistenceProof exist = 1;
+ NonExistenceProof nonexist = 2;
+ BatchProof batch = 3;
+ CompressedBatchProof compressed = 4;
+ }
+}
+
+/**
+LeafOp represents the raw key-value data we wish to prove, and
+must be flexible to represent the internal transformation from
+the original key-value pairs into the basis hash, for many existing
+merkle trees.
+
+key and value are passed in. So that the signature of this operation is:
+ leafOp(key, value) -> output
+
+To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+ hkey = prehashKey(key)
+ hvalue = prehashValue(value)
+
+Then combine the bytes, and hash it
+ output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+*/
+message LeafOp {
+ HashOp hash = 1;
+ HashOp prehash_key = 2;
+ HashOp prehash_value = 3;
+ LengthOp length = 4;
+ // prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+ // a leaf node from an inner node.
+ bytes prefix = 5;
+}
+
+/**
+InnerOp represents a merkle-proof step that is not a leaf.
+It represents concatenating two children and hashing them to provide the next result.
+
+The result of the previous step is passed in, so the signature of this op is:
+ innerOp(child) -> output
+
+The result of applying InnerOp should be:
+ output = op.hash(op.prefix || child || op.suffix)
+
+ where the || operator is concatenation of binary data,
+and child is the result of hashing all the tree below this step.
+
+Any special data, like prepending child with the length, or prepending the entire operation with
+some value to differentiate from leaf nodes, should be included in prefix and suffix.
+If either of prefix or suffix is empty, we just treat it as an empty string
+*/
+message InnerOp {
+ HashOp hash = 1;
+ bytes prefix = 2;
+ bytes suffix = 3;
+}
+
+
+/**
+ProofSpec defines what the expected parameters are for a given proof type.
+This can be stored in the client and used to validate any incoming proofs.
+
+ verify(ProofSpec, Proof) -> Proof | Error
+
+As demonstrated in tests, if we don't fix the algorithm used to calculate the
+LeafHash for a given tree, there are many possible key-value pairs that can
+generate a given hash (by interpretting the preimage differently).
+We need this for proper security, requires client knows a priori what
+tree format server uses. But not in code, rather a configuration object.
+*/
+message ProofSpec {
+ // any field in the ExistenceProof must be the same as in this spec.
+ // except Prefix, which is just the first bytes of prefix (spec can be longer)
+ LeafOp leaf_spec = 1;
+ InnerSpec inner_spec = 2;
+ // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
+ int32 max_depth = 3;
+ // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
+ int32 min_depth = 4;
+}
+
+/*
+InnerSpec contains all store-specific structure info to determine if two proofs from a
+given store are neighbors.
+
+This enables:
+
+ isLeftMost(spec: InnerSpec, op: InnerOp)
+ isRightMost(spec: InnerSpec, op: InnerOp)
+ isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+*/
+message InnerSpec {
+ // Child order is the ordering of the children node, must count from 0
+ // iavl tree is [0, 1] (left then right)
+ // merk is [0, 2, 1] (left, right, here)
+ repeated int32 child_order = 1;
+ int32 child_size = 2;
+ int32 min_prefix_length = 3;
+ int32 max_prefix_length = 4;
+ // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
+ bytes empty_child = 5;
+ // hash is the algorithm that must be used for each InnerOp
+ HashOp hash = 6;
+}
+
+/*
+BatchProof is a group of multiple proof types than can be compressed
+*/
+message BatchProof {
+ repeated BatchEntry entries = 1;
+}
+
+// Use BatchEntry not CommitmentProof, to avoid recursion
+message BatchEntry {
+ oneof proof {
+ ExistenceProof exist = 1;
+ NonExistenceProof nonexist = 2;
+ }
+}
+
+
+/****** all items here are compressed forms *******/
+
+message CompressedBatchProof {
+ repeated CompressedBatchEntry entries = 1;
+ repeated InnerOp lookup_inners = 2;
+}
+
+// Use BatchEntry not CommitmentProof, to avoid recursion
+message CompressedBatchEntry {
+ oneof proof {
+ CompressedExistenceProof exist = 1;
+ CompressedNonExistenceProof nonexist = 2;
+ }
+}
+
+message CompressedExistenceProof {
+ bytes key = 1;
+ bytes value = 2;
+ LeafOp leaf = 3;
+ // these are indexes into the lookup_inners table in CompressedBatchProof
+ repeated int32 path = 4;
+}
+
+message CompressedNonExistenceProof {
+ bytes key = 1; // TODO: remove this as unnecessary??? we prove a range
+ CompressedExistenceProof left = 2;
+ CompressedExistenceProof right = 3;
+}
diff --git a/examples/authz/proto/cosmos/LICENSE b/examples/authz/proto/cosmos/LICENSE
new file mode 100644
index 00000000..063e03fc
--- /dev/null
+++ b/examples/authz/proto/cosmos/LICENSE
@@ -0,0 +1,204 @@
+Cosmos SDK
+License: Apache2.0
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2016 All in Bits, Inc
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/README.md b/examples/authz/proto/cosmos/README.md
new file mode 100644
index 00000000..98a49c6b
--- /dev/null
+++ b/examples/authz/proto/cosmos/README.md
@@ -0,0 +1 @@
+# cosmos
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/app/v1alpha1/config.proto b/examples/authz/proto/cosmos/app/v1alpha1/config.proto
new file mode 100644
index 00000000..ed775006
--- /dev/null
+++ b/examples/authz/proto/cosmos/app/v1alpha1/config.proto
@@ -0,0 +1,36 @@
+syntax = "proto3";
+
+package cosmos.app.v1alpha1;
+
+import "google/protobuf/any.proto";
+
+// Config represents the configuration for a Cosmos SDK ABCI app.
+// It is intended that all state machine logic including the version of
+// baseapp and tx handlers (and possibly even Tendermint) that an app needs
+// can be described in a config object. For compatibility, the framework should
+// allow a mixture of declarative and imperative app wiring, however, apps
+// that strive for the maximum ease of maintainability should be able to describe
+// their state machine with a config object alone.
+message Config {
+ // modules are the module configurations for the app.
+ repeated ModuleConfig modules = 1;
+}
+
+// ModuleConfig is a module configuration for an app.
+message ModuleConfig {
+ // name is the unique name of the module within the app. It should be a name
+ // that persists between different versions of a module so that modules
+ // can be smoothly upgraded to new versions.
+ //
+ // For example, for the module cosmos.bank.module.v1.Module, we may chose
+ // to simply name the module "bank" in the app. When we upgrade to
+ // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same
+ // and the framework knows that the v2 module should receive all the same state
+ // that the v1 module had. Note: modules should provide info on which versions
+ // they can migrate from in the ModuleDescriptor.can_migration_from field.
+ string name = 1;
+
+ // config is the config object for the module. Module config messages should
+ // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension.
+ google.protobuf.Any config = 2;
+}
diff --git a/examples/authz/proto/cosmos/app/v1alpha1/module.proto b/examples/authz/proto/cosmos/app/v1alpha1/module.proto
new file mode 100644
index 00000000..599078d7
--- /dev/null
+++ b/examples/authz/proto/cosmos/app/v1alpha1/module.proto
@@ -0,0 +1,93 @@
+syntax = "proto3";
+
+package cosmos.app.v1alpha1;
+
+import "google/protobuf/descriptor.proto";
+
+extend google.protobuf.MessageOptions {
+ // module indicates that this proto type is a config object for an app module
+ // and optionally provides other descriptive information about the module.
+ // It is recommended that a new module config object and go module is versioned
+ // for every state machine breaking version of a module. The recommended
+ // pattern for doing this is to put module config objects in a separate proto
+ // package from the API they expose. Ex: the cosmos.group.v1 API would be
+ // exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc.
+ ModuleDescriptor module = 57193479;
+}
+
+// ModuleDescriptor describes an app module.
+message ModuleDescriptor {
+ // go_import names the package that should be imported by an app to load the
+ // module in the runtime module registry. Either go_import must be defined here
+ // or the go_package option must be defined at the file level to indicate
+ // to users where to location the module implementation. go_import takes
+ // precedence over go_package when both are defined.
+ string go_import = 1;
+
+ // use_package refers to a protobuf package that this module
+ // uses and exposes to the world. In an app, only one module should "use"
+ // or own a single protobuf package. It is assumed that the module uses
+ // all of the .proto files in a single package.
+ repeated PackageReference use_package = 2;
+
+ // can_migrate_from defines which module versions this module can migrate
+ // state from. The framework will check that one module version is able to
+ // migrate from a previous module version before attempting to update its
+ // config. It is assumed that modules can transitively migrate from earlier
+ // versions. For instance if v3 declares it can migrate from v2, and v2
+ // declares it can migrate from v1, the framework knows how to migrate
+ // from v1 to v3, assuming all 3 module versions are registered at runtime.
+ repeated MigrateFromInfo can_migrate_from = 3;
+}
+
+// PackageReference is a reference to a protobuf package used by a module.
+message PackageReference {
+ // name is the fully-qualified name of the package.
+ string name = 1;
+
+ // revision is the optional revision of the package that is being used.
+ // Protobuf packages used in Cosmos should generally have a major version
+ // as the last part of the package name, ex. foo.bar.baz.v1.
+ // The revision of a package can be thought of as the minor version of a
+ // package which has additional backwards compatible definitions that weren't
+ // present in a previous version.
+ //
+ // A package should indicate its revision with a source code comment
+ // above the package declaration in one of its fields containing the
+ // test "Revision N" where N is an integer revision. All packages start
+ // at revision 0 the first time they are released in a module.
+ //
+ // When a new version of a module is released and items are added to existing
+ // .proto files, these definitions should contain comments of the form
+ // "Since Revision N" where N is an integer revision.
+ //
+ // When the module runtime starts up, it will check the pinned proto
+ // image and panic if there are runtime protobuf definitions that are not
+ // in the pinned descriptor which do not have
+ // a "Since Revision N" comment or have a "Since Revision N" comment where
+ // N is <= to the revision specified here. This indicates that the protobuf
+ // files have been updated, but the pinned file descriptor hasn't.
+ //
+ // If there are items in the pinned file descriptor with a revision
+ // greater than the value indicated here, this will also cause a panic
+ // as it may mean that the pinned descriptor for a legacy module has been
+ // improperly updated or that there is some other versioning discrepancy.
+ // Runtime protobuf definitions will also be checked for compatibility
+ // with pinned file descriptors to make sure there are no incompatible changes.
+ //
+ // This behavior ensures that:
+ // * pinned proto images are up-to-date
+ // * protobuf files are carefully annotated with revision comments which
+ // are important good client UX
+ // * protobuf files are changed in backwards and forwards compatible ways
+ uint32 revision = 2;
+}
+
+// MigrateFromInfo is information on a module version that a newer module
+// can migrate from.
+message MigrateFromInfo {
+
+ // module is the fully-qualified protobuf name of the module config object
+ // for the previous module version, ex: "cosmos.group.module.v1.Module".
+ string module = 1;
+}
diff --git a/examples/authz/proto/cosmos/app/v1alpha1/query.proto b/examples/authz/proto/cosmos/app/v1alpha1/query.proto
new file mode 100644
index 00000000..efec9c81
--- /dev/null
+++ b/examples/authz/proto/cosmos/app/v1alpha1/query.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+
+package cosmos.app.v1alpha1;
+
+import "cosmos/app/v1alpha1/config.proto";
+
+// Query is the app module query service.
+service Query {
+
+ // Config returns the current app config.
+ rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {}
+}
+
+// QueryConfigRequest is the Query/Config request type.
+message QueryConfigRequest {}
+
+// QueryConfigRequest is the Query/Config response type.
+message QueryConfigResponse {
+
+ // config is the current app config.
+ Config config = 1;
+}
diff --git a/examples/authz/proto/cosmos/auth/v1beta1/auth.proto b/examples/authz/proto/cosmos/auth/v1beta1/auth.proto
new file mode 100644
index 00000000..963c6f15
--- /dev/null
+++ b/examples/authz/proto/cosmos/auth/v1beta1/auth.proto
@@ -0,0 +1,47 @@
+syntax = "proto3";
+package cosmos.auth.v1beta1;
+
+import "cosmos_proto/cosmos.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
+
+// BaseAccount defines a base account type. It contains all the necessary fields
+// for basic account functionality. Any custom account type should extend this
+// type for additional functionality (e.g. vesting).
+message BaseAccount {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.equal) = false;
+
+ option (cosmos_proto.implements_interface) = "AccountI";
+
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"];
+ uint64 account_number = 3;
+ uint64 sequence = 4;
+}
+
+// ModuleAccount defines an account for modules that holds coins on a pool.
+message ModuleAccount {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "ModuleAccountI";
+
+ BaseAccount base_account = 1 [(gogoproto.embed) = true];
+ string name = 2;
+ repeated string permissions = 3;
+}
+
+// Params defines the parameters for the auth module.
+message Params {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ uint64 max_memo_characters = 1;
+ uint64 tx_sig_limit = 2;
+ uint64 tx_size_cost_per_byte = 3;
+ uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"];
+ uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"];
+}
diff --git a/examples/authz/proto/cosmos/auth/v1beta1/genesis.proto b/examples/authz/proto/cosmos/auth/v1beta1/genesis.proto
new file mode 100644
index 00000000..c88b94ee
--- /dev/null
+++ b/examples/authz/proto/cosmos/auth/v1beta1/genesis.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+package cosmos.auth.v1beta1;
+
+import "google/protobuf/any.proto";
+import "gogoproto/gogo.proto";
+import "cosmos/auth/v1beta1/auth.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
+
+// GenesisState defines the auth module's genesis state.
+message GenesisState {
+ // params defines all the paramaters of the module.
+ Params params = 1 [(gogoproto.nullable) = false];
+
+ // accounts are the accounts present at genesis.
+ repeated google.protobuf.Any accounts = 2;
+}
diff --git a/examples/authz/proto/cosmos/auth/v1beta1/query.proto b/examples/authz/proto/cosmos/auth/v1beta1/query.proto
new file mode 100644
index 00000000..7798da00
--- /dev/null
+++ b/examples/authz/proto/cosmos/auth/v1beta1/query.proto
@@ -0,0 +1,130 @@
+syntax = "proto3";
+package cosmos.auth.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "google/api/annotations.proto";
+import "cosmos/auth/v1beta1/auth.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Accounts returns all the existing accounts
+ //
+ // Since: cosmos-sdk 0.43
+ rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/accounts";
+ }
+
+ // Account returns account details based on address.
+ rpc Account(QueryAccountRequest) returns (QueryAccountResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}";
+ }
+
+ // Params queries all parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/params";
+ }
+
+ // ModuleAccounts returns all the existing module accounts.
+ rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts";
+ }
+
+ // Bech32 queries bech32Prefix
+ rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/bech32";
+ }
+
+ // AddressBytesToString converts Account Address bytes to string
+ rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}";
+ }
+
+ // AddressStringToBytes converts Address string to bytes
+ rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}";
+ }
+}
+
+// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
+//
+// Since: cosmos-sdk 0.43
+message QueryAccountsRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryAccountsResponse is the response type for the Query/Accounts RPC method.
+//
+// Since: cosmos-sdk 0.43
+message QueryAccountsResponse {
+ // accounts are the existing accounts
+ repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryAccountRequest is the request type for the Query/Account RPC method.
+message QueryAccountRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // address defines the address to query for.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method.
+message QueryModuleAccountsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryAccountResponse is the response type for the Query/Account RPC method.
+message QueryAccountResponse {
+ // account defines the account of the corresponding address.
+ google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"];
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method.
+message QueryModuleAccountsResponse {
+ repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"];
+}
+
+// Bech32PrefixRequest is the request type for Bech32Prefix rpc method
+message Bech32PrefixRequest {}
+
+// Bech32PrefixResponse is the response type for Bech32Prefix rpc method
+message Bech32PrefixResponse {
+ string bech32_prefix = 1;
+}
+
+// AddressBytesToStringRequest is the request type for AddressString rpc method
+message AddressBytesToStringRequest {
+ bytes address_bytes = 1;
+}
+
+// AddressBytesToStringResponse is the response type for AddressString rpc method
+message AddressBytesToStringResponse {
+ string address_string = 1;
+}
+
+// AddressStringToBytesRequest is the request type for AccountBytes rpc method
+message AddressStringToBytesRequest {
+ string address_string = 1;
+}
+
+// AddressStringToBytesResponse is the response type for AddressBytes rpc method
+message AddressStringToBytesResponse {
+ bytes address_bytes = 1;
+}
diff --git a/examples/authz/proto/cosmos/authz/v1beta1/authz.proto b/examples/authz/proto/cosmos/authz/v1beta1/authz.proto
new file mode 100644
index 00000000..06ce288a
--- /dev/null
+++ b/examples/authz/proto/cosmos/authz/v1beta1/authz.proto
@@ -0,0 +1,46 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.authz.v1beta1;
+
+import "cosmos_proto/cosmos.proto";
+import "google/protobuf/timestamp.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
+option (gogoproto.goproto_getters_all) = false;
+
+// GenericAuthorization gives the grantee unrestricted permissions to execute
+// the provided method on behalf of the granter's account.
+message GenericAuthorization {
+ option (cosmos_proto.implements_interface) = "Authorization";
+
+ // Msg, identified by it's type URL, to grant unrestricted permissions to execute
+ string msg = 1;
+}
+
+// Grant gives permissions to execute
+// the provide method with expiration time.
+message Grant {
+ google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"];
+ // time when the grant will expire and will be pruned. If null, then the grant
+ // doesn't have a time expiration (other conditions in `authorization`
+ // may apply to invalidate the grant)
+ google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true];
+}
+
+// GrantAuthorization extends a grant with both the addresses of the grantee and granter.
+// It is used in genesis.proto and query.proto
+message GrantAuthorization {
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"];
+ google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true];
+}
+
+// GrantQueueItem contains the list of TypeURL of a sdk.Msg.
+message GrantQueueItem {
+ // msg_type_urls contains the list of TypeURL of a sdk.Msg.
+ repeated string msg_type_urls = 1;
+}
diff --git a/examples/authz/proto/cosmos/authz/v1beta1/event.proto b/examples/authz/proto/cosmos/authz/v1beta1/event.proto
new file mode 100644
index 00000000..0476649a
--- /dev/null
+++ b/examples/authz/proto/cosmos/authz/v1beta1/event.proto
@@ -0,0 +1,27 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.authz.v1beta1;
+
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
+
+// EventGrant is emitted on Msg/Grant
+message EventGrant {
+ // Msg type URL for which an autorization is granted
+ string msg_type_url = 2;
+ // Granter account address
+ string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // Grantee account address
+ string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// EventRevoke is emitted on Msg/Revoke
+message EventRevoke {
+ // Msg type URL for which an autorization is revoked
+ string msg_type_url = 2;
+ // Granter account address
+ string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // Grantee account address
+ string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
diff --git a/examples/authz/proto/cosmos/authz/v1beta1/genesis.proto b/examples/authz/proto/cosmos/authz/v1beta1/genesis.proto
new file mode 100644
index 00000000..310f6265
--- /dev/null
+++ b/examples/authz/proto/cosmos/authz/v1beta1/genesis.proto
@@ -0,0 +1,13 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.authz.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/authz/v1beta1/authz.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
+
+// GenesisState defines the authz module's genesis state.
+message GenesisState {
+ repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/authz/v1beta1/query.proto b/examples/authz/proto/cosmos/authz/v1beta1/query.proto
new file mode 100644
index 00000000..62154ac1
--- /dev/null
+++ b/examples/authz/proto/cosmos/authz/v1beta1/query.proto
@@ -0,0 +1,82 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.authz.v1beta1;
+
+import "google/api/annotations.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "cosmos/authz/v1beta1/authz.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Returns list of `Authorization`, granted to the grantee by the granter.
+ rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) {
+ option (google.api.http).get = "/cosmos/authz/v1beta1/grants";
+ }
+
+ // GranterGrants returns list of `GrantAuthorization`, granted by granter.
+ //
+ // Since: cosmos-sdk 0.46
+ rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) {
+ option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}";
+ }
+
+ // GranteeGrants returns a list of `GrantAuthorization` by grantee.
+ //
+ // Since: cosmos-sdk 0.46
+ rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) {
+ option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}";
+ }
+}
+
+// QueryGrantsRequest is the request type for the Query/Grants RPC method.
+message QueryGrantsRequest {
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // Optional, msg_type_url, when set, will query only grants matching given msg type.
+ string msg_type_url = 3;
+ // pagination defines an pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 4;
+}
+
+// QueryGrantsResponse is the response type for the Query/Authorizations RPC method.
+message QueryGrantsResponse {
+ // authorizations is a list of grants granted for grantee by granter.
+ repeated Grant grants = 1;
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method.
+message QueryGranterGrantsRequest {
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method.
+message QueryGranterGrantsResponse {
+ // grants is a list of grants granted by the granter.
+ repeated GrantAuthorization grants = 1;
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method.
+message QueryGranteeGrantsRequest {
+ string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method.
+message QueryGranteeGrantsResponse {
+ // grants is a list of grants granted to the grantee.
+ repeated GrantAuthorization grants = 1;
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
diff --git a/examples/authz/proto/cosmos/authz/v1beta1/tx.proto b/examples/authz/proto/cosmos/authz/v1beta1/tx.proto
new file mode 100644
index 00000000..068218ff
--- /dev/null
+++ b/examples/authz/proto/cosmos/authz/v1beta1/tx.proto
@@ -0,0 +1,75 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.authz.v1beta1;
+
+import "cosmos_proto/cosmos.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "cosmos/authz/v1beta1/authz.proto";
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
+option (gogoproto.goproto_getters_all) = false;
+
+// Msg defines the authz Msg service.
+service Msg {
+ // Grant grants the provided authorization to the grantee on the granter's
+ // account with the provided expiration time. If there is already a grant
+ // for the given (granter, grantee, Authorization) triple, then the grant
+ // will be overwritten.
+ rpc Grant(MsgGrant) returns (MsgGrantResponse);
+
+ // Exec attempts to execute the provided messages using
+ // authorizations granted to the grantee. Each message should have only
+ // one signer corresponding to the granter of the authorization.
+ rpc Exec(MsgExec) returns (MsgExecResponse);
+
+ // Revoke revokes any authorization corresponding to the provided method name on the
+ // granter's account that has been granted to the grantee.
+ rpc Revoke(MsgRevoke) returns (MsgRevokeResponse);
+}
+
+// MsgGrant is a request type for Grant method. It declares authorization to the grantee
+// on behalf of the granter with the provided expiration time.
+message MsgGrant {
+ option (cosmos.msg.v1.signer) = "granter";
+
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false];
+}
+
+// MsgExecResponse defines the Msg/MsgExecResponse response type.
+message MsgExecResponse {
+ repeated bytes results = 1;
+}
+
+// MsgExec attempts to execute the provided messages using
+// authorizations granted to the grantee. Each message should have only
+// one signer corresponding to the granter of the authorization.
+message MsgExec {
+ option (cosmos.msg.v1.signer) = "grantee";
+
+ string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // Authorization Msg requests to execute. Each msg must implement Authorization interface
+ // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
+ // triple and validate it.
+ repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"];
+}
+
+// MsgGrantResponse defines the Msg/MsgGrant response type.
+message MsgGrantResponse {}
+
+// MsgRevoke revokes any authorization with the provided sdk.Msg type on the
+// granter's account with that has been granted to the grantee.
+message MsgRevoke {
+ option (cosmos.msg.v1.signer) = "granter";
+
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string msg_type_url = 3;
+}
+
+// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type.
+message MsgRevokeResponse {}
diff --git a/examples/authz/proto/cosmos/bank/v1beta1/authz.proto b/examples/authz/proto/cosmos/bank/v1beta1/authz.proto
new file mode 100644
index 00000000..4f58b15e
--- /dev/null
+++ b/examples/authz/proto/cosmos/bank/v1beta1/authz.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+package cosmos.bank.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
+
+// SendAuthorization allows the grantee to spend up to spend_limit coins from
+// the granter's account.
+//
+// Since: cosmos-sdk 0.43
+message SendAuthorization {
+ option (cosmos_proto.implements_interface) = "Authorization";
+
+ repeated cosmos.base.v1beta1.Coin spend_limit = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
diff --git a/examples/authz/proto/cosmos/bank/v1beta1/bank.proto b/examples/authz/proto/cosmos/bank/v1beta1/bank.proto
new file mode 100644
index 00000000..7bc9819d
--- /dev/null
+++ b/examples/authz/proto/cosmos/bank/v1beta1/bank.proto
@@ -0,0 +1,108 @@
+syntax = "proto3";
+package cosmos.bank.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
+
+// Params defines the parameters for the bank module.
+message Params {
+ option (gogoproto.goproto_stringer) = false;
+ repeated SendEnabled send_enabled = 1;
+ bool default_send_enabled = 2;
+}
+
+// SendEnabled maps coin denom to a send_enabled status (whether a denom is
+// sendable).
+message SendEnabled {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+ string denom = 1;
+ bool enabled = 2;
+}
+
+// Input models transaction input.
+message Input {
+ option (cosmos.msg.v1.signer) = "address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin coins = 2
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// Output models transaction outputs.
+message Output {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin coins = 2
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// Supply represents a struct that passively keeps track of the total supply
+// amounts in the network.
+// This message is deprecated now that supply is indexed by denom.
+message Supply {
+ option deprecated = true;
+
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+
+ option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/migrations/v040.SupplyI";
+
+ repeated cosmos.base.v1beta1.Coin total = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// DenomUnit represents a struct that describes a given
+// denomination unit of the basic token.
+message DenomUnit {
+ // denom represents the string name of the given denom unit (e.g uatom).
+ string denom = 1;
+ // exponent represents power of 10 exponent that one must
+ // raise the base_denom to in order to equal the given DenomUnit's denom
+ // 1 denom = 10^exponent base_denom
+ // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
+ // exponent = 6, thus: 1 atom = 10^6 uatom).
+ uint32 exponent = 2;
+ // aliases is a list of string aliases for the given denom
+ repeated string aliases = 3;
+}
+
+// Metadata represents a struct that describes
+// a basic token.
+message Metadata {
+ string description = 1;
+ // denom_units represents the list of DenomUnit's for a given coin
+ repeated DenomUnit denom_units = 2;
+ // base represents the base denom (should be the DenomUnit with exponent = 0).
+ string base = 3;
+ // display indicates the suggested denom that should be
+ // displayed in clients.
+ string display = 4;
+ // name defines the name of the token (eg: Cosmos Atom)
+ //
+ // Since: cosmos-sdk 0.43
+ string name = 5;
+ // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can
+ // be the same as the display.
+ //
+ // Since: cosmos-sdk 0.43
+ string symbol = 6;
+ // URI to a document (on or off-chain) that contains additional information. Optional.
+ //
+ // Since: cosmos-sdk 0.46
+ string uri = 7 [(gogoproto.customname) = "URI"];
+ // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that
+ // the document didn't change. Optional.
+ //
+ // Since: cosmos-sdk 0.46
+ string uri_hash = 8 [(gogoproto.customname) = "URIHash"];
+}
diff --git a/examples/authz/proto/cosmos/bank/v1beta1/genesis.proto b/examples/authz/proto/cosmos/bank/v1beta1/genesis.proto
new file mode 100644
index 00000000..aa35790b
--- /dev/null
+++ b/examples/authz/proto/cosmos/bank/v1beta1/genesis.proto
@@ -0,0 +1,40 @@
+syntax = "proto3";
+package cosmos.bank.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/bank.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
+
+// GenesisState defines the bank module's genesis state.
+message GenesisState {
+ // params defines all the paramaters of the module.
+ Params params = 1 [(gogoproto.nullable) = false];
+
+ // balances is an array containing the balances of all the accounts.
+ repeated Balance balances = 2 [(gogoproto.nullable) = false];
+
+ // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided
+ // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount.
+ repeated cosmos.base.v1beta1.Coin supply = 3
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
+
+ // denom_metadata defines the metadata of the differents coins.
+ repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false];
+}
+
+// Balance defines an account address and balance pair used in the bank module's
+// genesis state.
+message Balance {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // address is the address of the balance holder.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // coins defines the different coins this balance holds.
+ repeated cosmos.base.v1beta1.Coin coins = 2
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/bank/v1beta1/query.proto b/examples/authz/proto/cosmos/bank/v1beta1/query.proto
new file mode 100644
index 00000000..cbe7f38a
--- /dev/null
+++ b/examples/authz/proto/cosmos/bank/v1beta1/query.proto
@@ -0,0 +1,231 @@
+syntax = "proto3";
+package cosmos.bank.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/bank.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Balance queries the balance of a single coin for a single account.
+ rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom";
+ }
+
+ // AllBalances queries the balance of all coins for a single account.
+ rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}";
+ }
+
+ // SpendableBalances queries the spenable balance of all coins for a single
+ // account.
+ rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}";
+ }
+
+ // TotalSupply queries the total supply of all coins.
+ rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/supply";
+ }
+
+ // SupplyOf queries the supply of a single coin.
+ rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom";
+ }
+
+ // Params queries the parameters of x/bank module.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/params";
+ }
+
+ // DenomsMetadata queries the client metadata of a given coin denomination.
+ rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}";
+ }
+
+ // DenomsMetadata queries the client metadata for all registered coin
+ // denominations.
+ rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata";
+ }
+
+ // DenomOwners queries for all account addresses that own a particular token
+ // denomination.
+ rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}";
+ }
+}
+
+// QueryBalanceRequest is the request type for the Query/Balance RPC method.
+message QueryBalanceRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // address is the address to query balances for.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // denom is the coin denom to query balances for.
+ string denom = 2;
+}
+
+// QueryBalanceResponse is the response type for the Query/Balance RPC method.
+message QueryBalanceResponse {
+ // balance is the balance of the coin.
+ cosmos.base.v1beta1.Coin balance = 1;
+}
+
+// QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
+message QueryAllBalancesRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // address is the address to query balances for.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC
+// method.
+message QueryAllBalancesResponse {
+ // balances is the balances of all the coins.
+ repeated cosmos.base.v1beta1.Coin balances = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QuerySpendableBalancesRequest defines the gRPC request structure for querying
+// an account's spendable balances.
+message QuerySpendableBalancesRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // address is the address to query spendable balances for.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QuerySpendableBalancesResponse defines the gRPC response structure for querying
+// an account's spendable balances.
+message QuerySpendableBalancesResponse {
+ // balances is the spendable balances of all the coins.
+ repeated cosmos.base.v1beta1.Coin balances = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
+// method.
+message QueryTotalSupplyRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // pagination defines an optional pagination for the request.
+ //
+ // Since: cosmos-sdk 0.43
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
+// method
+message QueryTotalSupplyResponse {
+ // supply is the supply of the coins
+ repeated cosmos.base.v1beta1.Coin supply = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ // pagination defines the pagination in the response.
+ //
+ // Since: cosmos-sdk 0.43
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
+message QuerySupplyOfRequest {
+ // denom is the coin denom to query balances for.
+ string denom = 1;
+}
+
+// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method.
+message QuerySupplyOfResponse {
+ // amount is the supply of the coin.
+ cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryParamsRequest defines the request type for querying x/bank parameters.
+message QueryParamsRequest {}
+
+// QueryParamsResponse defines the response type for querying x/bank parameters.
+message QueryParamsResponse {
+ Params params = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.
+message QueryDenomsMetadataRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC
+// method.
+message QueryDenomsMetadataResponse {
+ // metadata provides the client information for all the registered tokens.
+ repeated Metadata metadatas = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method.
+message QueryDenomMetadataRequest {
+ // denom is the coin denom to query the metadata for.
+ string denom = 1;
+}
+
+// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC
+// method.
+message QueryDenomMetadataResponse {
+ // metadata describes and provides all the client information for the requested token.
+ Metadata metadata = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query,
+// which queries for a paginated set of all account holders of a particular
+// denomination.
+message QueryDenomOwnersRequest {
+ // denom defines the coin denomination to query all account holders for.
+ string denom = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// DenomOwner defines structure representing an account that owns or holds a
+// particular denominated token. It contains the account address and account
+// balance of the denominated token.
+message DenomOwner {
+ // address defines the address that owns a particular denomination.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // balance is the balance of the denominated coin for an account.
+ cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false];
+}
+
+// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query.
+message QueryDenomOwnersResponse {
+ repeated DenomOwner denom_owners = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
diff --git a/examples/authz/proto/cosmos/bank/v1beta1/tx.proto b/examples/authz/proto/cosmos/bank/v1beta1/tx.proto
new file mode 100644
index 00000000..22e62cbf
--- /dev/null
+++ b/examples/authz/proto/cosmos/bank/v1beta1/tx.proto
@@ -0,0 +1,48 @@
+syntax = "proto3";
+package cosmos.bank.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/bank.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
+
+// Msg defines the bank Msg service.
+service Msg {
+ // Send defines a method for sending coins from one account to another account.
+ rpc Send(MsgSend) returns (MsgSendResponse);
+
+ // MultiSend defines a method for sending coins from some accounts to other accounts.
+ rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse);
+}
+
+// MsgSend represents a message to send coins from one account to another.
+message MsgSend {
+ option (cosmos.msg.v1.signer) = "from_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin amount = 3
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// MsgSendResponse defines the Msg/Send response type.
+message MsgSendResponse {}
+
+// MsgMultiSend represents an arbitrary multi-in, multi-out send message.
+message MsgMultiSend {
+ option (cosmos.msg.v1.signer) = "inputs";
+
+ option (gogoproto.equal) = false;
+
+ repeated Input inputs = 1 [(gogoproto.nullable) = false];
+ repeated Output outputs = 2 [(gogoproto.nullable) = false];
+}
+
+// MsgMultiSendResponse defines the Msg/MultiSend response type.
+message MsgMultiSendResponse {}
diff --git a/examples/authz/proto/cosmos/base/abci/v1beta1/abci.proto b/examples/authz/proto/cosmos/base/abci/v1beta1/abci.proto
new file mode 100644
index 00000000..09a2fcc4
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/abci/v1beta1/abci.proto
@@ -0,0 +1,158 @@
+syntax = "proto3";
+package cosmos.base.abci.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "tendermint/abci/types.proto";
+import "google/protobuf/any.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/types";
+option (gogoproto.goproto_stringer_all) = false;
+
+// TxResponse defines a structure containing relevant tx data and metadata. The
+// tags are stringified and the log is JSON decoded.
+message TxResponse {
+ option (gogoproto.goproto_getters) = false;
+ // The block height
+ int64 height = 1;
+ // The transaction hash.
+ string txhash = 2 [(gogoproto.customname) = "TxHash"];
+ // Namespace for the Code
+ string codespace = 3;
+ // Response code.
+ uint32 code = 4;
+ // Result bytes, if any.
+ string data = 5;
+ // The output of the application's logger (raw string). May be
+ // non-deterministic.
+ string raw_log = 6;
+ // The output of the application's logger (typed). May be non-deterministic.
+ repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false];
+ // Additional information. May be non-deterministic.
+ string info = 8;
+ // Amount of gas requested for transaction.
+ int64 gas_wanted = 9;
+ // Amount of gas consumed by transaction.
+ int64 gas_used = 10;
+ // The request transaction bytes.
+ google.protobuf.Any tx = 11;
+ // Time of the previous block. For heights > 1, it's the weighted median of
+ // the timestamps of the valid votes in the block.LastCommit. For height == 1,
+ // it's genesis time.
+ string timestamp = 12;
+ // Events defines all the events emitted by processing a transaction. Note,
+ // these events include those emitted by processing all the messages and those
+ // emitted from the ante handler. Whereas Logs contains the events, with
+ // additional metadata, emitted only by processing the messages.
+ //
+ // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45
+ repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false];
+}
+
+// ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
+message ABCIMessageLog {
+ option (gogoproto.stringer) = true;
+
+ uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"];
+ string log = 2;
+
+ // Events contains a slice of Event objects that were emitted during some
+ // execution.
+ repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false];
+}
+
+// StringEvent defines en Event object wrapper where all the attributes
+// contain key/value pairs that are strings instead of raw bytes.
+message StringEvent {
+ option (gogoproto.stringer) = true;
+
+ string type = 1;
+ repeated Attribute attributes = 2 [(gogoproto.nullable) = false];
+}
+
+// Attribute defines an attribute wrapper where the key and value are
+// strings instead of raw bytes.
+message Attribute {
+ string key = 1;
+ string value = 2;
+}
+
+// GasInfo defines tx execution gas context.
+message GasInfo {
+ // GasWanted is the maximum units of work we allow this tx to perform.
+ uint64 gas_wanted = 1;
+
+ // GasUsed is the amount of gas actually consumed.
+ uint64 gas_used = 2;
+}
+
+// Result is the union of ResponseFormat and ResponseCheckTx.
+message Result {
+ option (gogoproto.goproto_getters) = false;
+
+ // Data is any data returned from message or handler execution. It MUST be
+ // length prefixed in order to separate data from multiple message executions.
+ // Deprecated. This field is still populated, but prefer msg_response instead
+ // because it also contains the Msg response typeURL.
+ bytes data = 1 [deprecated = true];
+
+ // Log contains the log information from message or handler execution.
+ string log = 2;
+
+ // Events contains a slice of Event objects that were emitted during message
+ // or handler execution.
+ repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false];
+
+ // msg_responses contains the Msg handler responses type packed in Anys.
+ //
+ // Since: cosmos-sdk 0.46
+ repeated google.protobuf.Any msg_responses = 4;
+}
+
+// SimulationResponse defines the response generated when a transaction is
+// successfully simulated.
+message SimulationResponse {
+ GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
+ Result result = 2;
+}
+
+// MsgData defines the data returned in a Result object during message
+// execution.
+message MsgData {
+ option deprecated = true;
+ option (gogoproto.stringer) = true;
+
+ string msg_type = 1;
+ bytes data = 2;
+}
+
+// TxMsgData defines a list of MsgData. A transaction will have a MsgData object
+// for each message.
+message TxMsgData {
+ option (gogoproto.stringer) = true;
+
+ // data field is deprecated and not populated.
+ repeated MsgData data = 1 [deprecated = true];
+
+ // msg_responses contains the Msg handler responses packed into Anys.
+ //
+ // Since: cosmos-sdk 0.46
+ repeated google.protobuf.Any msg_responses = 2;
+}
+
+// SearchTxsResult defines a structure for querying txs pageable
+message SearchTxsResult {
+ option (gogoproto.stringer) = true;
+
+ // Count of all txs
+ uint64 total_count = 1;
+ // Count of txs in current page
+ uint64 count = 2;
+ // Index of current page, start from 1
+ uint64 page_number = 3;
+ // Count of total pages
+ uint64 page_total = 4;
+ // Max count txs per page
+ uint64 limit = 5;
+ // List of txs in current page
+ repeated TxResponse txs = 6;
+}
diff --git a/examples/authz/proto/cosmos/base/kv/v1beta1/kv.proto b/examples/authz/proto/cosmos/base/kv/v1beta1/kv.proto
new file mode 100644
index 00000000..4e9b8d28
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/kv/v1beta1/kv.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+package cosmos.base.kv.v1beta1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/types/kv";
+
+// Pairs defines a repeated slice of Pair objects.
+message Pairs {
+ repeated Pair pairs = 1 [(gogoproto.nullable) = false];
+}
+
+// Pair defines a key/value bytes tuple.
+message Pair {
+ bytes key = 1;
+ bytes value = 2;
+}
diff --git a/examples/authz/proto/cosmos/base/query/v1beta1/pagination.proto b/examples/authz/proto/cosmos/base/query/v1beta1/pagination.proto
new file mode 100644
index 00000000..0a368144
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/query/v1beta1/pagination.proto
@@ -0,0 +1,56 @@
+syntax = "proto3";
+package cosmos.base.query.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/types/query";
+
+// PageRequest is to be embedded in gRPC request messages for efficient
+// pagination. Ex:
+//
+// message SomeRequest {
+// Foo some_parameter = 1;
+// PageRequest pagination = 2;
+// }
+message PageRequest {
+ // key is a value returned in PageResponse.next_key to begin
+ // querying the next page most efficiently. Only one of offset or key
+ // should be set.
+ bytes key = 1;
+
+ // offset is a numeric offset that can be used when key is unavailable.
+ // It is less efficient than using key. Only one of offset or key should
+ // be set.
+ uint64 offset = 2;
+
+ // limit is the total number of results to be returned in the result page.
+ // If left empty it will default to a value to be set by each app.
+ uint64 limit = 3;
+
+ // count_total is set to true to indicate that the result set should include
+ // a count of the total number of items available for pagination in UIs.
+ // count_total is only respected when offset is used. It is ignored when key
+ // is set.
+ bool count_total = 4;
+
+ // reverse is set to true if results are to be returned in the descending order.
+ //
+ // Since: cosmos-sdk 0.43
+ bool reverse = 5;
+}
+
+// PageResponse is to be embedded in gRPC response messages where the
+// corresponding request message has used PageRequest.
+//
+// message SomeResponse {
+// repeated Bar results = 1;
+// PageResponse page = 2;
+// }
+message PageResponse {
+ // next_key is the key to be passed to PageRequest.key to
+ // query the next page most efficiently. It will be empty if
+ // there are no more results.
+ bytes next_key = 1;
+
+ // total is total number of results available if PageRequest.count_total
+ // was set, its value is undefined otherwise
+ uint64 total = 2;
+}
diff --git a/examples/authz/proto/cosmos/base/reflection/v1beta1/reflection.proto b/examples/authz/proto/cosmos/base/reflection/v1beta1/reflection.proto
new file mode 100644
index 00000000..22670e72
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/reflection/v1beta1/reflection.proto
@@ -0,0 +1,44 @@
+syntax = "proto3";
+package cosmos.base.reflection.v1beta1;
+
+import "google/api/annotations.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection";
+
+// ReflectionService defines a service for interface reflection.
+service ReflectionService {
+ // ListAllInterfaces lists all the interfaces registered in the interface
+ // registry.
+ rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces";
+ };
+
+ // ListImplementations list all the concrete types that implement a given
+ // interface.
+ rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/"
+ "{interface_name}/implementations";
+ };
+}
+
+// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC.
+message ListAllInterfacesRequest {}
+
+// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC.
+message ListAllInterfacesResponse {
+ // interface_names is an array of all the registered interfaces.
+ repeated string interface_names = 1;
+}
+
+// ListImplementationsRequest is the request type of the ListImplementations
+// RPC.
+message ListImplementationsRequest {
+ // interface_name defines the interface to query the implementations for.
+ string interface_name = 1;
+}
+
+// ListImplementationsResponse is the response type of the ListImplementations
+// RPC.
+message ListImplementationsResponse {
+ repeated string implementation_message_names = 1;
+}
diff --git a/examples/authz/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/examples/authz/proto/cosmos/base/reflection/v2alpha1/reflection.proto
new file mode 100644
index 00000000..d5b04855
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/reflection/v2alpha1/reflection.proto
@@ -0,0 +1,218 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.base.reflection.v2alpha1;
+
+import "google/api/annotations.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1";
+
+// AppDescriptor describes a cosmos-sdk based application
+message AppDescriptor {
+ // AuthnDescriptor provides information on how to authenticate transactions on the application
+ // NOTE: experimental and subject to change in future releases.
+ AuthnDescriptor authn = 1;
+ // chain provides the chain descriptor
+ ChainDescriptor chain = 2;
+ // codec provides metadata information regarding codec related types
+ CodecDescriptor codec = 3;
+ // configuration provides metadata information regarding the sdk.Config type
+ ConfigurationDescriptor configuration = 4;
+ // query_services provides metadata information regarding the available queriable endpoints
+ QueryServicesDescriptor query_services = 5;
+ // tx provides metadata information regarding how to send transactions to the given application
+ TxDescriptor tx = 6;
+}
+
+// TxDescriptor describes the accepted transaction type
+message TxDescriptor {
+ // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type)
+ // it is not meant to support polymorphism of transaction types, it is supposed to be used by
+ // reflection clients to understand if they can handle a specific transaction type in an application.
+ string fullname = 1;
+ // msgs lists the accepted application messages (sdk.Msg)
+ repeated MsgDescriptor msgs = 2;
+}
+
+// AuthnDescriptor provides information on how to sign transactions without relying
+// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures
+message AuthnDescriptor {
+ // sign_modes defines the supported signature algorithm
+ repeated SigningModeDescriptor sign_modes = 1;
+}
+
+// SigningModeDescriptor provides information on a signing flow of the application
+// NOTE(fdymylja): here we could go as far as providing an entire flow on how
+// to sign a message given a SigningModeDescriptor, but it's better to think about
+// this another time
+message SigningModeDescriptor {
+ // name defines the unique name of the signing mode
+ string name = 1;
+ // number is the unique int32 identifier for the sign_mode enum
+ int32 number = 2;
+ // authn_info_provider_method_fullname defines the fullname of the method to call to get
+ // the metadata required to authenticate using the provided sign_modes
+ string authn_info_provider_method_fullname = 3;
+}
+
+// ChainDescriptor describes chain information of the application
+message ChainDescriptor {
+ // id is the chain id
+ string id = 1;
+}
+
+// CodecDescriptor describes the registered interfaces and provides metadata information on the types
+message CodecDescriptor {
+ // interfaces is a list of the registerted interfaces descriptors
+ repeated InterfaceDescriptor interfaces = 1;
+}
+
+// InterfaceDescriptor describes the implementation of an interface
+message InterfaceDescriptor {
+ // fullname is the name of the interface
+ string fullname = 1;
+ // interface_accepting_messages contains information regarding the proto messages which contain the interface as
+ // google.protobuf.Any field
+ repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2;
+ // interface_implementers is a list of the descriptors of the interface implementers
+ repeated InterfaceImplementerDescriptor interface_implementers = 3;
+}
+
+// InterfaceImplementerDescriptor describes an interface implementer
+message InterfaceImplementerDescriptor {
+ // fullname is the protobuf queryable name of the interface implementer
+ string fullname = 1;
+ // type_url defines the type URL used when marshalling the type as any
+ // this is required so we can provide type safe google.protobuf.Any marshalling and
+ // unmarshalling, making sure that we don't accept just 'any' type
+ // in our interface fields
+ string type_url = 2;
+}
+
+// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains
+// an interface represented as a google.protobuf.Any
+message InterfaceAcceptingMessageDescriptor {
+ // fullname is the protobuf fullname of the type containing the interface
+ string fullname = 1;
+ // field_descriptor_names is a list of the protobuf name (not fullname) of the field
+ // which contains the interface as google.protobuf.Any (the interface is the same, but
+ // it can be in multiple fields of the same proto message)
+ repeated string field_descriptor_names = 2;
+}
+
+// ConfigurationDescriptor contains metadata information on the sdk.Config
+message ConfigurationDescriptor {
+ // bech32_account_address_prefix is the account address prefix
+ string bech32_account_address_prefix = 1;
+}
+
+// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction
+message MsgDescriptor {
+ // msg_type_url contains the TypeURL of a sdk.Msg.
+ string msg_type_url = 1;
+}
+
+// ReflectionService defines a service for application reflection.
+service ReflectionService {
+ // GetAuthnDescriptor returns information on how to authenticate transactions in the application
+ // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in
+ // future releases of the cosmos-sdk.
+ rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn";
+ }
+ // GetChainDescriptor returns the description of the chain
+ rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain";
+ };
+ // GetCodecDescriptor returns the descriptor of the codec of the application
+ rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec";
+ }
+ // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application
+ rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration";
+ }
+ // GetQueryServicesDescriptor returns the available gRPC queryable services of the application
+ rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services";
+ }
+ // GetTxDescriptor returns information on the used transaction object and available msgs that can be used
+ rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) {
+ option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor";
+ }
+}
+
+// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC
+message GetAuthnDescriptorRequest {}
+// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC
+message GetAuthnDescriptorResponse {
+ // authn describes how to authenticate to the application when sending transactions
+ AuthnDescriptor authn = 1;
+}
+
+// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC
+message GetChainDescriptorRequest {}
+// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC
+message GetChainDescriptorResponse {
+ // chain describes application chain information
+ ChainDescriptor chain = 1;
+}
+
+// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC
+message GetCodecDescriptorRequest {}
+// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC
+message GetCodecDescriptorResponse {
+ // codec describes the application codec such as registered interfaces and implementations
+ CodecDescriptor codec = 1;
+}
+
+// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC
+message GetConfigurationDescriptorRequest {}
+// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC
+message GetConfigurationDescriptorResponse {
+ // config describes the application's sdk.Config
+ ConfigurationDescriptor config = 1;
+}
+
+// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC
+message GetQueryServicesDescriptorRequest {}
+// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC
+message GetQueryServicesDescriptorResponse {
+ // queries provides information on the available queryable services
+ QueryServicesDescriptor queries = 1;
+}
+
+// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC
+message GetTxDescriptorRequest {}
+// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC
+message GetTxDescriptorResponse {
+ // tx provides information on msgs that can be forwarded to the application
+ // alongside the accepted transaction protobuf type
+ TxDescriptor tx = 1;
+}
+
+// QueryServicesDescriptor contains the list of cosmos-sdk queriable services
+message QueryServicesDescriptor {
+ // query_services is a list of cosmos-sdk QueryServiceDescriptor
+ repeated QueryServiceDescriptor query_services = 1;
+}
+
+// QueryServiceDescriptor describes a cosmos-sdk queryable service
+message QueryServiceDescriptor {
+ // fullname is the protobuf fullname of the service descriptor
+ string fullname = 1;
+ // is_module describes if this service is actually exposed by an application's module
+ bool is_module = 2;
+ // methods provides a list of query service methods
+ repeated QueryMethodDescriptor methods = 3;
+}
+
+// QueryMethodDescriptor describes a queryable method of a query service
+// no other info is provided beside method name and tendermint queryable path
+// because it would be redundant with the grpc reflection service
+message QueryMethodDescriptor {
+ // name is the protobuf name (not fullname) of the method
+ string name = 1;
+ // full_query_path is the path that can be used to query
+ // this method via tendermint abci.Query
+ string full_query_path = 2;
+}
diff --git a/examples/authz/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/examples/authz/proto/cosmos/base/snapshots/v1beta1/snapshot.proto
new file mode 100644
index 00000000..a89e0b4c
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/snapshots/v1beta1/snapshot.proto
@@ -0,0 +1,70 @@
+syntax = "proto3";
+package cosmos.base.snapshots.v1beta1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types";
+
+// Snapshot contains Tendermint state sync snapshot info.
+message Snapshot {
+ uint64 height = 1;
+ uint32 format = 2;
+ uint32 chunks = 3;
+ bytes hash = 4;
+ Metadata metadata = 5 [(gogoproto.nullable) = false];
+}
+
+// Metadata contains SDK-specific snapshot metadata.
+message Metadata {
+ repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes
+}
+
+// SnapshotItem is an item contained in a rootmulti.Store snapshot.
+message SnapshotItem {
+ // item is the specific type of snapshot item.
+ oneof item {
+ SnapshotStoreItem store = 1;
+ SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"];
+ SnapshotExtensionMeta extension = 3;
+ SnapshotExtensionPayload extension_payload = 4;
+ SnapshotKVItem kv = 5 [(gogoproto.customname) = "KV"];
+ SnapshotSchema schema = 6;
+ }
+}
+
+// SnapshotStoreItem contains metadata about a snapshotted store.
+message SnapshotStoreItem {
+ string name = 1;
+}
+
+// SnapshotIAVLItem is an exported IAVL node.
+message SnapshotIAVLItem {
+ bytes key = 1;
+ bytes value = 2;
+ // version is block height
+ int64 version = 3;
+ // height is depth of the tree.
+ int32 height = 4;
+}
+
+// SnapshotExtensionMeta contains metadata about an external snapshotter.
+message SnapshotExtensionMeta {
+ string name = 1;
+ uint32 format = 2;
+}
+
+// SnapshotExtensionPayload contains payloads of an external snapshotter.
+message SnapshotExtensionPayload {
+ bytes payload = 1;
+}
+
+// SnapshotKVItem is an exported Key/Value Pair
+message SnapshotKVItem {
+ bytes key = 1;
+ bytes value = 2;
+}
+
+// SnapshotSchema is an exported schema of smt store
+message SnapshotSchema{
+ repeated bytes keys = 1;
+}
diff --git a/examples/authz/proto/cosmos/base/store/v1beta1/commit_info.proto b/examples/authz/proto/cosmos/base/store/v1beta1/commit_info.proto
new file mode 100644
index 00000000..98a33d30
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/store/v1beta1/commit_info.proto
@@ -0,0 +1,29 @@
+syntax = "proto3";
+package cosmos.base.store.v1beta1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/store/types";
+
+// CommitInfo defines commit information used by the multi-store when committing
+// a version/height.
+message CommitInfo {
+ int64 version = 1;
+ repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false];
+}
+
+// StoreInfo defines store-specific commit information. It contains a reference
+// between a store name and the commit ID.
+message StoreInfo {
+ string name = 1;
+ CommitID commit_id = 2 [(gogoproto.nullable) = false];
+}
+
+// CommitID defines the committment information when a specific store is
+// committed.
+message CommitID {
+ option (gogoproto.goproto_stringer) = false;
+
+ int64 version = 1;
+ bytes hash = 2;
+}
diff --git a/examples/authz/proto/cosmos/base/store/v1beta1/listening.proto b/examples/authz/proto/cosmos/base/store/v1beta1/listening.proto
new file mode 100644
index 00000000..35999710
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/store/v1beta1/listening.proto
@@ -0,0 +1,16 @@
+syntax = "proto3";
+package cosmos.base.store.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/store/types";
+
+// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes)
+// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and
+// Deletes
+//
+// Since: cosmos-sdk 0.43
+message StoreKVPair {
+ string store_key = 1; // the store key for the KVStore this pair originates from
+ bool delete = 2; // true indicates a delete operation, false indicates a set operation
+ bytes key = 3;
+ bytes value = 4;
+}
diff --git a/examples/authz/proto/cosmos/base/tendermint/v1beta1/query.proto b/examples/authz/proto/cosmos/base/tendermint/v1beta1/query.proto
new file mode 100644
index 00000000..96a46e53
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/tendermint/v1beta1/query.proto
@@ -0,0 +1,138 @@
+syntax = "proto3";
+package cosmos.base.tendermint.v1beta1;
+
+import "google/protobuf/any.proto";
+import "google/api/annotations.proto";
+import "tendermint/p2p/types.proto";
+import "tendermint/types/block.proto";
+import "tendermint/types/types.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice";
+
+// Service defines the gRPC querier service for tendermint queries.
+service Service {
+ // GetNodeInfo queries the current node info.
+ rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) {
+ option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info";
+ }
+ // GetSyncing queries node syncing.
+ rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) {
+ option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing";
+ }
+ // GetLatestBlock returns the latest block.
+ rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) {
+ option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest";
+ }
+ // GetBlockByHeight queries block for given height.
+ rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) {
+ option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}";
+ }
+
+ // GetLatestValidatorSet queries latest validator-set.
+ rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) {
+ option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest";
+ }
+ // GetValidatorSetByHeight queries validator-set at a given height.
+ rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) {
+ option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}";
+ }
+}
+
+// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method.
+message GetValidatorSetByHeightRequest {
+ int64 height = 1;
+ // pagination defines an pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method.
+message GetValidatorSetByHeightResponse {
+ int64 block_height = 1;
+ repeated Validator validators = 2;
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 3;
+}
+
+// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method.
+message GetLatestValidatorSetRequest {
+ // pagination defines an pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method.
+message GetLatestValidatorSetResponse {
+ int64 block_height = 1;
+ repeated Validator validators = 2;
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 3;
+}
+
+// Validator is the type for the validator-set.
+message Validator {
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ google.protobuf.Any pub_key = 2;
+ int64 voting_power = 3;
+ int64 proposer_priority = 4;
+}
+
+// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method.
+message GetBlockByHeightRequest {
+ int64 height = 1;
+}
+
+// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method.
+message GetBlockByHeightResponse {
+ .tendermint.types.BlockID block_id = 1;
+ .tendermint.types.Block block = 2;
+}
+
+// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method.
+message GetLatestBlockRequest {}
+
+// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method.
+message GetLatestBlockResponse {
+ .tendermint.types.BlockID block_id = 1;
+ .tendermint.types.Block block = 2;
+}
+
+// GetSyncingRequest is the request type for the Query/GetSyncing RPC method.
+message GetSyncingRequest {}
+
+// GetSyncingResponse is the response type for the Query/GetSyncing RPC method.
+message GetSyncingResponse {
+ bool syncing = 1;
+}
+
+// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method.
+message GetNodeInfoRequest {}
+
+// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method.
+message GetNodeInfoResponse {
+ .tendermint.p2p.NodeInfo node_info = 1;
+ VersionInfo application_version = 2;
+}
+
+// VersionInfo is the type for the GetNodeInfoResponse message.
+message VersionInfo {
+ string name = 1;
+ string app_name = 2;
+ string version = 3;
+ string git_commit = 4;
+ string build_tags = 5;
+ string go_version = 6;
+ repeated Module build_deps = 7;
+ // Since: cosmos-sdk 0.43
+ string cosmos_sdk_version = 8;
+}
+
+// Module is the type for VersionInfo
+message Module {
+ // module path
+ string path = 1;
+ // module version
+ string version = 2;
+ // checksum
+ string sum = 3;
+}
diff --git a/examples/authz/proto/cosmos/base/v1beta1/coin.proto b/examples/authz/proto/cosmos/base/v1beta1/coin.proto
new file mode 100644
index 00000000..69e67e09
--- /dev/null
+++ b/examples/authz/proto/cosmos/base/v1beta1/coin.proto
@@ -0,0 +1,43 @@
+syntax = "proto3";
+package cosmos.base.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/types";
+option (gogoproto.goproto_stringer_all) = false;
+option (gogoproto.stringer_all) = false;
+
+// Coin defines a token with a denomination and an amount.
+//
+// NOTE: The amount field is an Int which implements the custom method
+// signatures required by gogoproto.
+message Coin {
+ option (gogoproto.equal) = true;
+
+ string denom = 1;
+ string amount = 2
+ [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
+}
+
+// DecCoin defines a token with a denomination and a decimal amount.
+//
+// NOTE: The amount field is an Dec which implements the custom method
+// signatures required by gogoproto.
+message DecCoin {
+ option (gogoproto.equal) = true;
+
+ string denom = 1;
+ string amount = 2
+ [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
+}
+
+// IntProto defines a Protobuf wrapper around an Int object.
+message IntProto {
+ string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
+}
+
+// DecProto defines a Protobuf wrapper around a Dec object.
+message DecProto {
+ string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/capability/v1beta1/capability.proto b/examples/authz/proto/cosmos/capability/v1beta1/capability.proto
new file mode 100644
index 00000000..c433566d
--- /dev/null
+++ b/examples/authz/proto/cosmos/capability/v1beta1/capability.proto
@@ -0,0 +1,30 @@
+syntax = "proto3";
+package cosmos.capability.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types";
+
+import "gogoproto/gogo.proto";
+
+// Capability defines an implementation of an object capability. The index
+// provided to a Capability must be globally unique.
+message Capability {
+ option (gogoproto.goproto_stringer) = false;
+
+ uint64 index = 1;
+}
+
+// Owner defines a single capability owner. An owner is defined by the name of
+// capability and the module name.
+message Owner {
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string module = 1;
+ string name = 2;
+}
+
+// CapabilityOwners defines a set of owners of a single Capability. The set of
+// owners must be unique.
+message CapabilityOwners {
+ repeated Owner owners = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/capability/v1beta1/genesis.proto b/examples/authz/proto/cosmos/capability/v1beta1/genesis.proto
new file mode 100644
index 00000000..b5482439
--- /dev/null
+++ b/examples/authz/proto/cosmos/capability/v1beta1/genesis.proto
@@ -0,0 +1,26 @@
+syntax = "proto3";
+package cosmos.capability.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/capability/v1beta1/capability.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types";
+
+// GenesisOwners defines the capability owners with their corresponding index.
+message GenesisOwners {
+ // index is the index of the capability owner.
+ uint64 index = 1;
+
+ // index_owners are the owners at the given index.
+ CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false];
+}
+
+// GenesisState defines the capability module's genesis state.
+message GenesisState {
+ // index is the capability global index.
+ uint64 index = 1;
+
+ // owners represents a map from index to owners of the capability index
+ // index key is string to allow amino marshalling.
+ repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/crisis/v1beta1/genesis.proto b/examples/authz/proto/cosmos/crisis/v1beta1/genesis.proto
new file mode 100644
index 00000000..5c291604
--- /dev/null
+++ b/examples/authz/proto/cosmos/crisis/v1beta1/genesis.proto
@@ -0,0 +1,14 @@
+syntax = "proto3";
+package cosmos.crisis.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types";
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+// GenesisState defines the crisis module's genesis state.
+message GenesisState {
+ // constant_fee is the fee used to verify the invariant in the crisis
+ // module.
+ cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/crisis/v1beta1/tx.proto b/examples/authz/proto/cosmos/crisis/v1beta1/tx.proto
new file mode 100644
index 00000000..fea9059f
--- /dev/null
+++ b/examples/authz/proto/cosmos/crisis/v1beta1/tx.proto
@@ -0,0 +1,29 @@
+syntax = "proto3";
+package cosmos.crisis.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types";
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/msg/v1/msg.proto";
+
+// Msg defines the bank Msg service.
+service Msg {
+ // VerifyInvariant defines a method to verify a particular invariance.
+ rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse);
+}
+
+// MsgVerifyInvariant represents a message to verify a particular invariance.
+message MsgVerifyInvariant {
+ option (cosmos.msg.v1.signer) = "sender";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string invariant_module_name = 2;
+ string invariant_route = 3;
+}
+
+// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type.
+message MsgVerifyInvariantResponse {}
diff --git a/examples/authz/proto/cosmos/crypto/ed25519/keys.proto b/examples/authz/proto/cosmos/crypto/ed25519/keys.proto
new file mode 100644
index 00000000..6ffec344
--- /dev/null
+++ b/examples/authz/proto/cosmos/crypto/ed25519/keys.proto
@@ -0,0 +1,23 @@
+syntax = "proto3";
+package cosmos.crypto.ed25519;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519";
+
+// PubKey is an ed25519 public key for handling Tendermint keys in SDK.
+// It's needed for Any serialization and SDK compatibility.
+// It must not be used in a non Tendermint key context because it doesn't implement
+// ADR-28. Nevertheless, you will like to use ed25519 in app user level
+// then you must create a new proto message and follow ADR-28 for Address construction.
+message PubKey {
+ option (gogoproto.goproto_stringer) = false;
+
+ bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"];
+}
+
+// Deprecated: PrivKey defines a ed25519 private key.
+// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context.
+message PrivKey {
+ bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"];
+}
diff --git a/examples/authz/proto/cosmos/crypto/hd/v1/hd.proto b/examples/authz/proto/cosmos/crypto/hd/v1/hd.proto
new file mode 100644
index 00000000..e4a95afc
--- /dev/null
+++ b/examples/authz/proto/cosmos/crypto/hd/v1/hd.proto
@@ -0,0 +1,23 @@
+syntax = "proto3";
+package cosmos.crypto.hd.v1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd";
+option (gogoproto.goproto_getters_all) = false;
+
+// BIP44Params is used as path field in ledger item in Record.
+message BIP44Params {
+ option (gogoproto.goproto_stringer) = false;
+ // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation
+ uint32 purpose = 1;
+ // coin_type is a constant that improves privacy
+ uint32 coin_type = 2;
+ // account splits the key space into independent user identities
+ uint32 account = 3;
+ // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal
+ // chain.
+ bool change = 4;
+ // address_index is used as child index in BIP32 derivation
+ uint32 address_index = 5;
+}
diff --git a/examples/authz/proto/cosmos/crypto/keyring/v1/record.proto b/examples/authz/proto/cosmos/crypto/keyring/v1/record.proto
new file mode 100644
index 00000000..9b2d3c96
--- /dev/null
+++ b/examples/authz/proto/cosmos/crypto/keyring/v1/record.proto
@@ -0,0 +1,47 @@
+syntax = "proto3";
+package cosmos.crypto.keyring.v1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "cosmos/crypto/hd/v1/hd.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring";
+option (gogoproto.goproto_getters_all) = false;
+
+// Record is used for representing a key in the keyring.
+message Record {
+ // name represents a name of Record
+ string name = 1;
+ // pub_key represents a public key in any format
+ google.protobuf.Any pub_key = 2;
+
+ // Record contains one of the following items
+ oneof item {
+ // local stores the public information about a locally stored key
+ Local local = 3;
+ // ledger stores the public information about a Ledger key
+ Ledger ledger = 4;
+ // Multi does not store any information.
+ Multi multi = 5;
+ // Offline does not store any information.
+ Offline offline = 6;
+ }
+
+ // Item is a keyring item stored in a keyring backend.
+ // Local item
+ message Local {
+ google.protobuf.Any priv_key = 1;
+ string priv_key_type = 2;
+ }
+
+ // Ledger item
+ message Ledger {
+ hd.v1.BIP44Params path = 1;
+ }
+
+ // Multi item
+ message Multi {}
+
+ // Offline item
+ message Offline {}
+}
diff --git a/examples/authz/proto/cosmos/crypto/multisig/keys.proto b/examples/authz/proto/cosmos/crypto/multisig/keys.proto
new file mode 100644
index 00000000..7a11fe33
--- /dev/null
+++ b/examples/authz/proto/cosmos/crypto/multisig/keys.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+package cosmos.crypto.multisig;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig";
+
+// LegacyAminoPubKey specifies a public key type
+// which nests multiple public keys and a threshold,
+// it uses legacy amino address rules.
+message LegacyAminoPubKey {
+ option (gogoproto.goproto_getters) = false;
+
+ uint32 threshold = 1;
+ repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys"];
+}
diff --git a/examples/authz/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/examples/authz/proto/cosmos/crypto/multisig/v1beta1/multisig.proto
new file mode 100644
index 00000000..bf671f17
--- /dev/null
+++ b/examples/authz/proto/cosmos/crypto/multisig/v1beta1/multisig.proto
@@ -0,0 +1,25 @@
+syntax = "proto3";
+package cosmos.crypto.multisig.v1beta1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/crypto/types";
+
+// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey.
+// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers
+// signed and with which modes.
+message MultiSignature {
+ option (gogoproto.goproto_unrecognized) = true;
+ repeated bytes signatures = 1;
+}
+
+// CompactBitArray is an implementation of a space efficient bit array.
+// This is used to ensure that the encoded data takes up a minimal amount of
+// space after proto encoding.
+// This is not thread safe, and is not intended for concurrent usage.
+message CompactBitArray {
+ option (gogoproto.goproto_stringer) = false;
+
+ uint32 extra_bits_stored = 1;
+ bytes elems = 2;
+}
diff --git a/examples/authz/proto/cosmos/crypto/secp256k1/keys.proto b/examples/authz/proto/cosmos/crypto/secp256k1/keys.proto
new file mode 100644
index 00000000..a2272571
--- /dev/null
+++ b/examples/authz/proto/cosmos/crypto/secp256k1/keys.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+package cosmos.crypto.secp256k1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1";
+
+// PubKey defines a secp256k1 public key
+// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
+// if the y-coordinate is the lexicographically largest of the two associated with
+// the x-coordinate. Otherwise the first byte is a 0x03.
+// This prefix is followed with the x-coordinate.
+message PubKey {
+ option (gogoproto.goproto_stringer) = false;
+
+ bytes key = 1;
+}
+
+// PrivKey defines a secp256k1 private key.
+message PrivKey {
+ bytes key = 1;
+}
diff --git a/examples/authz/proto/cosmos/crypto/secp256r1/keys.proto b/examples/authz/proto/cosmos/crypto/secp256r1/keys.proto
new file mode 100644
index 00000000..2e96c6e3
--- /dev/null
+++ b/examples/authz/proto/cosmos/crypto/secp256r1/keys.proto
@@ -0,0 +1,23 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.crypto.secp256r1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1";
+option (gogoproto.messagename_all) = true;
+option (gogoproto.goproto_stringer_all) = false;
+option (gogoproto.goproto_getters_all) = false;
+
+// PubKey defines a secp256r1 ECDSA public key.
+message PubKey {
+ // Point on secp256r1 curve in a compressed representation as specified in section
+ // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998
+ bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"];
+}
+
+// PrivKey defines a secp256r1 ECDSA private key.
+message PrivKey {
+ // secret number serialized using big-endian encoding
+ bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"];
+}
diff --git a/examples/authz/proto/cosmos/distribution/v1beta1/distribution.proto b/examples/authz/proto/cosmos/distribution/v1beta1/distribution.proto
new file mode 100644
index 00000000..1afe25ae
--- /dev/null
+++ b/examples/authz/proto/cosmos/distribution/v1beta1/distribution.proto
@@ -0,0 +1,154 @@
+syntax = "proto3";
+package cosmos.distribution.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos_proto/cosmos.proto";
+
+// Params defines the set of params for the distribution module.
+message Params {
+ option (gogoproto.goproto_stringer) = false;
+ string community_tax = 1 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ string base_proposer_reward = 2 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ string bonus_proposer_reward = 3 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ bool withdraw_addr_enabled = 4;
+}
+
+// ValidatorHistoricalRewards represents historical rewards for a validator.
+// Height is implicit within the store key.
+// Cumulative reward ratio is the sum from the zeroeth period
+// until this period of rewards / tokens, per the spec.
+// The reference count indicates the number of objects
+// which might need to reference this historical entry at any point.
+// ReferenceCount =
+// number of outstanding delegations which ended the associated period (and
+// might need to read that record)
+// + number of slashes which ended the associated period (and might need to
+// read that record)
+// + one per validator for the zeroeth period, set on initialization
+message ValidatorHistoricalRewards {
+ repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
+ uint32 reference_count = 2;
+}
+
+// ValidatorCurrentRewards represents current rewards and current
+// period for a validator kept as a running counter and incremented
+// each block as long as the validator's tokens remain constant.
+message ValidatorCurrentRewards {
+ repeated cosmos.base.v1beta1.DecCoin rewards = 1
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
+ uint64 period = 2;
+}
+
+// ValidatorAccumulatedCommission represents accumulated commission
+// for a validator kept as a running counter, can be withdrawn at any time.
+message ValidatorAccumulatedCommission {
+ repeated cosmos.base.v1beta1.DecCoin commission = 1
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
+}
+
+// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards
+// for a validator inexpensive to track, allows simple sanity checks.
+message ValidatorOutstandingRewards {
+ repeated cosmos.base.v1beta1.DecCoin rewards = 1
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
+}
+
+// ValidatorSlashEvent represents a validator slash event.
+// Height is implicit within the store key.
+// This is needed to calculate appropriate amount of staking tokens
+// for delegations which are withdrawn after a slash has occurred.
+message ValidatorSlashEvent {
+ uint64 validator_period = 1;
+ string fraction = 2 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages.
+message ValidatorSlashEvents {
+ option (gogoproto.goproto_stringer) = false;
+ repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false];
+}
+
+// FeePool is the global fee pool for distribution.
+message FeePool {
+ repeated cosmos.base.v1beta1.DecCoin community_pool = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"];
+}
+
+// CommunityPoolSpendProposal details a proposal for use of community funds,
+// together with how many coins are proposed to be spent, and to which
+// recipient account.
+message CommunityPoolSpendProposal {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
+
+ string title = 1;
+ string description = 2;
+ string recipient = 3;
+ repeated cosmos.base.v1beta1.Coin amount = 4
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// DelegatorStartingInfo represents the starting info for a delegator reward
+// period. It tracks the previous validator period, the delegation's amount of
+// staking token, and the creation height (to check later on if any slashes have
+// occurred). NOTE: Even though validators are slashed to whole staking tokens,
+// the delegators within the validator may be left with less than a full token,
+// thus sdk.Dec is used.
+message DelegatorStartingInfo {
+ uint64 previous_period = 1;
+ string stake = 2 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ uint64 height = 3 [(gogoproto.jsontag) = "creation_height"];
+}
+
+// DelegationDelegatorReward represents the properties
+// of a delegator's delegation reward.
+message DelegationDelegatorReward {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = true;
+
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ repeated cosmos.base.v1beta1.DecCoin reward = 2
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
+}
+
+// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal
+// with a deposit
+message CommunityPoolSpendProposalWithDeposit {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = true;
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
+
+ string title = 1;
+ string description = 2;
+ string recipient = 3;
+ string amount = 4;
+ string deposit = 5;
+}
diff --git a/examples/authz/proto/cosmos/distribution/v1beta1/genesis.proto b/examples/authz/proto/cosmos/distribution/v1beta1/genesis.proto
new file mode 100644
index 00000000..4662e8df
--- /dev/null
+++ b/examples/authz/proto/cosmos/distribution/v1beta1/genesis.proto
@@ -0,0 +1,144 @@
+syntax = "proto3";
+package cosmos.distribution.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/distribution/v1beta1/distribution.proto";
+import "cosmos_proto/cosmos.proto";
+
+// DelegatorWithdrawInfo is the address for where distributions rewards are
+// withdrawn to by default this struct is only used at genesis to feed in
+// default withdraw addresses.
+message DelegatorWithdrawInfo {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_address is the address of the delegator.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // withdraw_address is the address to withdraw the delegation rewards to.
+ string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// ValidatorOutstandingRewardsRecord is used for import/export via genesis json.
+message ValidatorOutstandingRewardsRecord {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // validator_address is the address of the validator.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // outstanding_rewards represents the oustanding rewards of a validator.
+ repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
+}
+
+// ValidatorAccumulatedCommissionRecord is used for import / export via genesis
+// json.
+message ValidatorAccumulatedCommissionRecord {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // validator_address is the address of the validator.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // accumulated is the accumulated commission of a validator.
+ ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false];
+}
+
+// ValidatorHistoricalRewardsRecord is used for import / export via genesis
+// json.
+message ValidatorHistoricalRewardsRecord {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // validator_address is the address of the validator.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // period defines the period the historical rewards apply to.
+ uint64 period = 2;
+
+ // rewards defines the historical rewards of a validator.
+ ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false];
+}
+
+// ValidatorCurrentRewardsRecord is used for import / export via genesis json.
+message ValidatorCurrentRewardsRecord {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // validator_address is the address of the validator.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // rewards defines the current rewards of a validator.
+ ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false];
+}
+
+// DelegatorStartingInfoRecord used for import / export via genesis json.
+message DelegatorStartingInfoRecord {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_address is the address of the delegator.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // validator_address is the address of the validator.
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // starting_info defines the starting info of a delegator.
+ DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false];
+}
+
+// ValidatorSlashEventRecord is used for import / export via genesis json.
+message ValidatorSlashEventRecord {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // validator_address is the address of the validator.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // height defines the block height at which the slash event occured.
+ uint64 height = 2;
+ // period is the period of the slash event.
+ uint64 period = 3;
+ // validator_slash_event describes the slash event.
+ ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false];
+}
+
+// GenesisState defines the distribution module's genesis state.
+message GenesisState {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // params defines all the paramaters of the module.
+ Params params = 1 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the fee pool at genesis.
+ FeePool fee_pool = 2 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the delegator withdraw infos at genesis.
+ repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the previous proposer at genesis.
+ string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // fee_pool defines the outstanding rewards of all validators at genesis.
+ repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the accumulated commisions of all validators at genesis.
+ repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the historical rewards of all validators at genesis.
+ repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the current rewards of all validators at genesis.
+ repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the delegator starting infos at genesis.
+ repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 [(gogoproto.nullable) = false];
+
+ // fee_pool defines the validator slash events at genesis.
+ repeated ValidatorSlashEventRecord validator_slash_events = 10 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/distribution/v1beta1/query.proto b/examples/authz/proto/cosmos/distribution/v1beta1/query.proto
new file mode 100644
index 00000000..a09413fc
--- /dev/null
+++ b/examples/authz/proto/cosmos/distribution/v1beta1/query.proto
@@ -0,0 +1,219 @@
+syntax = "proto3";
+package cosmos.distribution.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/distribution/v1beta1/distribution.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types";
+
+// Query defines the gRPC querier service for distribution module.
+service Query {
+ // Params queries params of the distribution module.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/params";
+ }
+
+ // ValidatorOutstandingRewards queries rewards of a validator address.
+ rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest)
+ returns (QueryValidatorOutstandingRewardsResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/"
+ "{validator_address}/outstanding_rewards";
+ }
+
+ // ValidatorCommission queries accumulated commission for a validator.
+ rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/"
+ "{validator_address}/commission";
+ }
+
+ // ValidatorSlashes queries slash events of a validator.
+ rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes";
+ }
+
+ // DelegationRewards queries the total rewards accrued by a delegation.
+ rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/"
+ "{validator_address}";
+ }
+
+ // DelegationTotalRewards queries the total rewards accrued by a each
+ // validator.
+ rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards";
+ }
+
+ // DelegatorValidators queries the validators of a delegator.
+ rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/"
+ "{delegator_address}/validators";
+ }
+
+ // DelegatorWithdrawAddress queries withdraw address of a delegator.
+ rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/"
+ "{delegator_address}/withdraw_address";
+ }
+
+ // CommunityPool queries the community pool coins.
+ rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) {
+ option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryValidatorOutstandingRewardsRequest is the request type for the
+// Query/ValidatorOutstandingRewards RPC method.
+message QueryValidatorOutstandingRewardsRequest {
+ // validator_address defines the validator address to query for.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryValidatorOutstandingRewardsResponse is the response type for the
+// Query/ValidatorOutstandingRewards RPC method.
+message QueryValidatorOutstandingRewardsResponse {
+ ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryValidatorCommissionRequest is the request type for the
+// Query/ValidatorCommission RPC method
+message QueryValidatorCommissionRequest {
+ // validator_address defines the validator address to query for.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryValidatorCommissionResponse is the response type for the
+// Query/ValidatorCommission RPC method
+message QueryValidatorCommissionResponse {
+ // commission defines the commision the validator received.
+ ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryValidatorSlashesRequest is the request type for the
+// Query/ValidatorSlashes RPC method
+message QueryValidatorSlashesRequest {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = true;
+
+ // validator_address defines the validator address to query for.
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // starting_height defines the optional starting height to query the slashes.
+ uint64 starting_height = 2;
+ // starting_height defines the optional ending height to query the slashes.
+ uint64 ending_height = 3;
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 4;
+}
+
+// QueryValidatorSlashesResponse is the response type for the
+// Query/ValidatorSlashes RPC method.
+message QueryValidatorSlashesResponse {
+ // slashes defines the slashes the validator received.
+ repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryDelegationRewardsRequest is the request type for the
+// Query/DelegationRewards RPC method.
+message QueryDelegationRewardsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_address defines the delegator address to query for.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // validator_address defines the validator address to query for.
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDelegationRewardsResponse is the response type for the
+// Query/DelegationRewards RPC method.
+message QueryDelegationRewardsResponse {
+ // rewards defines the rewards accrued by a delegation.
+ repeated cosmos.base.v1beta1.DecCoin rewards = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"];
+}
+
+// QueryDelegationTotalRewardsRequest is the request type for the
+// Query/DelegationTotalRewards RPC method.
+message QueryDelegationTotalRewardsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+ // delegator_address defines the delegator address to query for.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDelegationTotalRewardsResponse is the response type for the
+// Query/DelegationTotalRewards RPC method.
+message QueryDelegationTotalRewardsResponse {
+ // rewards defines all the rewards accrued by a delegator.
+ repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false];
+ // total defines the sum of all the rewards.
+ repeated cosmos.base.v1beta1.DecCoin total = 2
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"];
+}
+
+// QueryDelegatorValidatorsRequest is the request type for the
+// Query/DelegatorValidators RPC method.
+message QueryDelegatorValidatorsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_address defines the delegator address to query for.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDelegatorValidatorsResponse is the response type for the
+// Query/DelegatorValidators RPC method.
+message QueryDelegatorValidatorsResponse {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // validators defines the validators a delegator is delegating for.
+ repeated string validators = 1;
+}
+
+// QueryDelegatorWithdrawAddressRequest is the request type for the
+// Query/DelegatorWithdrawAddress RPC method.
+message QueryDelegatorWithdrawAddressRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_address defines the delegator address to query for.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDelegatorWithdrawAddressResponse is the response type for the
+// Query/DelegatorWithdrawAddress RPC method.
+message QueryDelegatorWithdrawAddressResponse {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // withdraw_address defines the delegator address to query for.
+ string withdraw_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC
+// method.
+message QueryCommunityPoolRequest {}
+
+// QueryCommunityPoolResponse is the response type for the Query/CommunityPool
+// RPC method.
+message QueryCommunityPoolResponse {
+ // pool defines community pool's coins.
+ repeated cosmos.base.v1beta1.DecCoin pool = 1
+ [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/distribution/v1beta1/tx.proto b/examples/authz/proto/cosmos/distribution/v1beta1/tx.proto
new file mode 100644
index 00000000..7f22dce9
--- /dev/null
+++ b/examples/authz/proto/cosmos/distribution/v1beta1/tx.proto
@@ -0,0 +1,95 @@
+syntax = "proto3";
+package cosmos.distribution.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/msg/v1/msg.proto";
+
+// Msg defines the distribution Msg service.
+service Msg {
+ // SetWithdrawAddress defines a method to change the withdraw address
+ // for a delegator (or validator self-delegation).
+ rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse);
+
+ // WithdrawDelegatorReward defines a method to withdraw rewards of delegator
+ // from a single validator.
+ rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse);
+
+ // WithdrawValidatorCommission defines a method to withdraw the
+ // full commission to the validator address.
+ rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse);
+
+ // FundCommunityPool defines a method to allow an account to directly
+ // fund the community pool.
+ rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse);
+}
+
+// MsgSetWithdrawAddress sets the withdraw address for
+// a delegator (or validator self-delegation).
+message MsgSetWithdrawAddress {
+ option (cosmos.msg.v1.signer) = "delegator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type.
+message MsgSetWithdrawAddressResponse {}
+
+// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator
+// from a single validator.
+message MsgWithdrawDelegatorReward {
+ option (cosmos.msg.v1.signer) = "delegator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type.
+message MsgWithdrawDelegatorRewardResponse {
+ repeated cosmos.base.v1beta1.Coin amount = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// MsgWithdrawValidatorCommission withdraws the full commission to the validator
+// address.
+message MsgWithdrawValidatorCommission {
+ option (cosmos.msg.v1.signer) = "validator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type.
+message MsgWithdrawValidatorCommissionResponse {
+ repeated cosmos.base.v1beta1.Coin amount = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// MsgFundCommunityPool allows an account to directly
+// fund the community pool.
+message MsgFundCommunityPool {
+ option (cosmos.msg.v1.signer) = "depositor";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ repeated cosmos.base.v1beta1.Coin amount = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+ string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type.
+message MsgFundCommunityPoolResponse {}
diff --git a/examples/authz/proto/cosmos/evidence/v1beta1/evidence.proto b/examples/authz/proto/cosmos/evidence/v1beta1/evidence.proto
new file mode 100644
index 00000000..83f9ec3d
--- /dev/null
+++ b/examples/authz/proto/cosmos/evidence/v1beta1/evidence.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+package cosmos.evidence.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos_proto/cosmos.proto";
+
+// Equivocation implements the Evidence interface and defines evidence of double
+// signing misbehavior.
+message Equivocation {
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.equal) = false;
+
+ int64 height = 1;
+ google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ int64 power = 3;
+ string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/evidence/v1beta1/genesis.proto b/examples/authz/proto/cosmos/evidence/v1beta1/genesis.proto
new file mode 100644
index 00000000..199f446f
--- /dev/null
+++ b/examples/authz/proto/cosmos/evidence/v1beta1/genesis.proto
@@ -0,0 +1,12 @@
+syntax = "proto3";
+package cosmos.evidence.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types";
+
+import "google/protobuf/any.proto";
+
+// GenesisState defines the evidence module's genesis state.
+message GenesisState {
+ // evidence defines all the evidence at genesis.
+ repeated google.protobuf.Any evidence = 1;
+}
diff --git a/examples/authz/proto/cosmos/evidence/v1beta1/query.proto b/examples/authz/proto/cosmos/evidence/v1beta1/query.proto
new file mode 100644
index 00000000..eda00544
--- /dev/null
+++ b/examples/authz/proto/cosmos/evidence/v1beta1/query.proto
@@ -0,0 +1,51 @@
+syntax = "proto3";
+package cosmos.evidence.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "google/api/annotations.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Evidence queries evidence based on evidence hash.
+ rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) {
+ option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{evidence_hash}";
+ }
+
+ // AllEvidence queries all evidence.
+ rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) {
+ option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence";
+ }
+}
+
+// QueryEvidenceRequest is the request type for the Query/Evidence RPC method.
+message QueryEvidenceRequest {
+ // evidence_hash defines the hash of the requested evidence.
+ bytes evidence_hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"];
+}
+
+// QueryEvidenceResponse is the response type for the Query/Evidence RPC method.
+message QueryEvidenceResponse {
+ // evidence returns the requested evidence.
+ google.protobuf.Any evidence = 1;
+}
+
+// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC
+// method.
+message QueryAllEvidenceRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC
+// method.
+message QueryAllEvidenceResponse {
+ // evidence returns all evidences.
+ repeated google.protobuf.Any evidence = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
diff --git a/examples/authz/proto/cosmos/evidence/v1beta1/tx.proto b/examples/authz/proto/cosmos/evidence/v1beta1/tx.proto
new file mode 100644
index 00000000..223f7e11
--- /dev/null
+++ b/examples/authz/proto/cosmos/evidence/v1beta1/tx.proto
@@ -0,0 +1,35 @@
+syntax = "proto3";
+package cosmos.evidence.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/msg/v1/msg.proto";
+
+// Msg defines the evidence Msg service.
+service Msg {
+ // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or
+ // counterfactual signing.
+ rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse);
+}
+
+// MsgSubmitEvidence represents a message that supports submitting arbitrary
+// Evidence of misbehavior such as equivocation or counterfactual signing.
+message MsgSubmitEvidence {
+ option (cosmos.msg.v1.signer) = "submitter";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"];
+}
+
+// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type.
+message MsgSubmitEvidenceResponse {
+ // hash defines the hash of the evidence.
+ bytes hash = 4;
+}
diff --git a/examples/authz/proto/cosmos/feegrant/v1beta1/feegrant.proto b/examples/authz/proto/cosmos/feegrant/v1beta1/feegrant.proto
new file mode 100644
index 00000000..eca71e2b
--- /dev/null
+++ b/examples/authz/proto/cosmos/feegrant/v1beta1/feegrant.proto
@@ -0,0 +1,78 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.feegrant.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant";
+
+// BasicAllowance implements Allowance with a one-time grant of tokens
+// that optionally expires. The grantee can use up to SpendLimit to cover fees.
+message BasicAllowance {
+ option (cosmos_proto.implements_interface) = "FeeAllowanceI";
+
+ // spend_limit specifies the maximum amount of tokens that can be spent
+ // by this allowance and will be updated as tokens are spent. If it is
+ // empty, there is no spend limit and any amount of coins can be spent.
+ repeated cosmos.base.v1beta1.Coin spend_limit = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ // expiration specifies an optional time when this allowance expires
+ google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true];
+}
+
+// PeriodicAllowance extends Allowance to allow for both a maximum cap,
+// as well as a limit per time period.
+message PeriodicAllowance {
+ option (cosmos_proto.implements_interface) = "FeeAllowanceI";
+
+ // basic specifies a struct of `BasicAllowance`
+ BasicAllowance basic = 1 [(gogoproto.nullable) = false];
+
+ // period specifies the time duration in which period_spend_limit coins can
+ // be spent before that allowance is reset
+ google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
+
+ // period_spend_limit specifies the maximum number of coins that can be spent
+ // in the period
+ repeated cosmos.base.v1beta1.Coin period_spend_limit = 3
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ // period_can_spend is the number of coins left to be spent before the period_reset time
+ repeated cosmos.base.v1beta1.Coin period_can_spend = 4
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ // period_reset is the time at which this period resets and a new one begins,
+ // it is calculated from the start time of the first transaction after the
+ // last period ended
+ google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+}
+
+// AllowedMsgAllowance creates allowance only for specified message types.
+message AllowedMsgAllowance {
+ option (gogoproto.goproto_getters) = false;
+ option (cosmos_proto.implements_interface) = "FeeAllowanceI";
+
+ // allowance can be any of basic and periodic fee allowance.
+ google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"];
+
+ // allowed_messages are the messages for which the grantee has the access.
+ repeated string allowed_messages = 2;
+}
+
+// Grant is stored in the KVStore to record a grant with full context
+message Grant {
+ // granter is the address of the user granting an allowance of their funds.
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // grantee is the address of the user being granted an allowance of another user's funds.
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // allowance can be any of basic, periodic, allowed fee allowance.
+ google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"];
+}
diff --git a/examples/authz/proto/cosmos/feegrant/v1beta1/genesis.proto b/examples/authz/proto/cosmos/feegrant/v1beta1/genesis.proto
new file mode 100644
index 00000000..5b1ac4ca
--- /dev/null
+++ b/examples/authz/proto/cosmos/feegrant/v1beta1/genesis.proto
@@ -0,0 +1,13 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.feegrant.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/feegrant/v1beta1/feegrant.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant";
+
+// GenesisState contains a set of fee allowances, persisted from the store
+message GenesisState {
+ repeated Grant allowances = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/feegrant/v1beta1/query.proto b/examples/authz/proto/cosmos/feegrant/v1beta1/query.proto
new file mode 100644
index 00000000..59c992c9
--- /dev/null
+++ b/examples/authz/proto/cosmos/feegrant/v1beta1/query.proto
@@ -0,0 +1,79 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.feegrant.v1beta1;
+
+import "cosmos/feegrant/v1beta1/feegrant.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "google/api/annotations.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant";
+
+// Query defines the gRPC querier service.
+service Query {
+
+ // Allowance returns fee granted to the grantee by the granter.
+ rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) {
+ option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}";
+ }
+
+ // Allowances returns all the grants for address.
+ rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) {
+ option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}";
+ }
+
+ // AllowancesByGranter returns all the grants given by an address
+ // Since v0.46
+ rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) {
+ option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}";
+ }
+}
+
+// QueryAllowanceRequest is the request type for the Query/Allowance RPC method.
+message QueryAllowanceRequest {
+ // granter is the address of the user granting an allowance of their funds.
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // grantee is the address of the user being granted an allowance of another user's funds.
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryAllowanceResponse is the response type for the Query/Allowance RPC method.
+message QueryAllowanceResponse {
+ // allowance is a allowance granted for grantee by granter.
+ cosmos.feegrant.v1beta1.Grant allowance = 1;
+}
+
+// QueryAllowancesRequest is the request type for the Query/Allowances RPC method.
+message QueryAllowancesRequest {
+ string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryAllowancesResponse is the response type for the Query/Allowances RPC method.
+message QueryAllowancesResponse {
+ // allowances are allowance's granted for grantee by granter.
+ repeated cosmos.feegrant.v1beta1.Grant allowances = 1;
+
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method.
+message QueryAllowancesByGranterRequest {
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method.
+message QueryAllowancesByGranterResponse {
+ // allowances that have been issued by the granter.
+ repeated cosmos.feegrant.v1beta1.Grant allowances = 1;
+
+ // pagination defines an pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
diff --git a/examples/authz/proto/cosmos/feegrant/v1beta1/tx.proto b/examples/authz/proto/cosmos/feegrant/v1beta1/tx.proto
new file mode 100644
index 00000000..a12d9aaa
--- /dev/null
+++ b/examples/authz/proto/cosmos/feegrant/v1beta1/tx.proto
@@ -0,0 +1,53 @@
+// Since: cosmos-sdk 0.43
+syntax = "proto3";
+package cosmos.feegrant.v1beta1;
+
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant";
+
+// Msg defines the feegrant msg service.
+service Msg {
+
+ // GrantAllowance grants fee allowance to the grantee on the granter's
+ // account with the provided expiration time.
+ rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse);
+
+ // RevokeAllowance revokes any fee allowance of granter's account that
+ // has been granted to the grantee.
+ rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse);
+}
+
+// MsgGrantAllowance adds permission for Grantee to spend up to Allowance
+// of fees from the account of Granter.
+message MsgGrantAllowance {
+ option (cosmos.msg.v1.signer) = "granter";
+
+ // granter is the address of the user granting an allowance of their funds.
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // grantee is the address of the user being granted an allowance of another user's funds.
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // allowance can be any of basic, periodic, allowed fee allowance.
+ google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"];
+}
+
+// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type.
+message MsgGrantAllowanceResponse {}
+
+// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee.
+message MsgRevokeAllowance {
+ option (cosmos.msg.v1.signer) = "granter";
+
+ // granter is the address of the user granting an allowance of their funds.
+ string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // grantee is the address of the user being granted an allowance of another user's funds.
+ string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type.
+message MsgRevokeAllowanceResponse {}
diff --git a/examples/authz/proto/cosmos/genutil/v1beta1/genesis.proto b/examples/authz/proto/cosmos/genutil/v1beta1/genesis.proto
new file mode 100644
index 00000000..958d15fe
--- /dev/null
+++ b/examples/authz/proto/cosmos/genutil/v1beta1/genesis.proto
@@ -0,0 +1,12 @@
+syntax = "proto3";
+package cosmos.genutil.v1beta1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types";
+
+// GenesisState defines the raw genesis transaction in JSON.
+message GenesisState {
+ // gen_txs defines the genesis transactions.
+ repeated bytes gen_txs = 1 [(gogoproto.casttype) = "encoding/json.RawMessage", (gogoproto.jsontag) = "gentxs"];
+}
diff --git a/examples/authz/proto/cosmos/gov/v1/genesis.proto b/examples/authz/proto/cosmos/gov/v1/genesis.proto
new file mode 100644
index 00000000..cb44a7f3
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1/genesis.proto
@@ -0,0 +1,26 @@
+// Since: cosmos-sdk 0.46
+syntax = "proto3";
+
+package cosmos.gov.v1;
+
+import "cosmos/gov/v1/gov.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1";
+
+// GenesisState defines the gov module's genesis state.
+message GenesisState {
+ // starting_proposal_id is the ID of the starting proposal.
+ uint64 starting_proposal_id = 1;
+ // deposits defines all the deposits present at genesis.
+ repeated Deposit deposits = 2;
+ // votes defines all the votes present at genesis.
+ repeated Vote votes = 3;
+ // proposals defines all the proposals present at genesis.
+ repeated Proposal proposals = 4;
+ // params defines all the paramaters of related to deposit.
+ DepositParams deposit_params = 5;
+ // params defines all the paramaters of related to voting.
+ VotingParams voting_params = 6;
+ // params defines all the paramaters of related to tally.
+ TallyParams tally_params = 7;
+}
diff --git a/examples/authz/proto/cosmos/gov/v1/gov.proto b/examples/authz/proto/cosmos/gov/v1/gov.proto
new file mode 100644
index 00000000..fb014d65
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1/gov.proto
@@ -0,0 +1,132 @@
+// Since: cosmos-sdk 0.46
+syntax = "proto3";
+package cosmos.gov.v1;
+
+import "cosmos/base/v1beta1/coin.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/duration.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1";
+
+// VoteOption enumerates the valid vote options for a given governance proposal.
+enum VoteOption {
+ // VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ VOTE_OPTION_UNSPECIFIED = 0;
+ // VOTE_OPTION_YES defines a yes vote option.
+ VOTE_OPTION_YES = 1;
+ // VOTE_OPTION_ABSTAIN defines an abstain vote option.
+ VOTE_OPTION_ABSTAIN = 2;
+ // VOTE_OPTION_NO defines a no vote option.
+ VOTE_OPTION_NO = 3;
+ // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.
+ VOTE_OPTION_NO_WITH_VETO = 4;
+}
+
+// WeightedVoteOption defines a unit of vote for vote split.
+message WeightedVoteOption {
+ VoteOption option = 1;
+ string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"];
+}
+
+// Deposit defines an amount deposited by an account address to an active
+// proposal.
+message Deposit {
+ uint64 proposal_id = 1;
+ string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
+}
+
+// Proposal defines the core field members of a governance proposal.
+message Proposal {
+ uint64 id = 1;
+ repeated google.protobuf.Any messages = 2;
+ ProposalStatus status = 3;
+ // final_tally_result is the final tally result of the proposal. When
+ // querying a proposal via gRPC, this field is not populated until the
+ // proposal's voting period has ended.
+ TallyResult final_tally_result = 4;
+ google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true];
+ google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true];
+ repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false];
+ google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true];
+ google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true];
+
+ // metadata is any arbitrary metadata attached to the proposal.
+ string metadata = 10;
+}
+
+// ProposalStatus enumerates the valid statuses of a proposal.
+enum ProposalStatus {
+ // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status.
+ PROPOSAL_STATUS_UNSPECIFIED = 0;
+ // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit
+ // period.
+ PROPOSAL_STATUS_DEPOSIT_PERIOD = 1;
+ // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting
+ // period.
+ PROPOSAL_STATUS_VOTING_PERIOD = 2;
+ // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has
+ // passed.
+ PROPOSAL_STATUS_PASSED = 3;
+ // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has
+ // been rejected.
+ PROPOSAL_STATUS_REJECTED = 4;
+ // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has
+ // failed.
+ PROPOSAL_STATUS_FAILED = 5;
+}
+
+// TallyResult defines a standard tally for a governance proposal.
+message TallyResult {
+ string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"];
+ string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"];
+ string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"];
+ string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"];
+}
+
+// Vote defines a vote on a governance proposal.
+// A Vote consists of a proposal ID, the voter, and the vote option.
+message Vote {
+ uint64 proposal_id = 1;
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ reserved 3;
+ repeated WeightedVoteOption options = 4;
+
+ // metadata is any arbitrary metadata to attached to the vote.
+ string metadata = 5;
+}
+
+// DepositParams defines the params for deposits on governance proposals.
+message DepositParams {
+ // Minimum deposit for a proposal to enter voting period.
+ repeated cosmos.base.v1beta1.Coin min_deposit = 1
+ [(gogoproto.nullable) = false, (gogoproto.jsontag) = "min_deposit,omitempty"];
+
+ // Maximum period for Atom holders to deposit on a proposal. Initial value: 2
+ // months.
+ google.protobuf.Duration max_deposit_period = 2
+ [(gogoproto.stdduration) = true, (gogoproto.jsontag) = "max_deposit_period,omitempty"];
+}
+
+// VotingParams defines the params for voting on governance proposals.
+message VotingParams {
+ // Length of the voting period.
+ google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true];
+}
+
+// TallyParams defines the params for tallying votes on governance proposals.
+message TallyParams {
+ // Minimum percentage of total stake needed to vote for a result to be
+ // considered valid.
+ string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "quorum,omitempty"];
+
+ // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5.
+ string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "threshold,omitempty"];
+
+ // Minimum value of Veto votes to Total votes ratio for proposal to be
+ // vetoed. Default value: 1/3.
+ string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.jsontag) = "veto_threshold,omitempty"];
+}
diff --git a/examples/authz/proto/cosmos/gov/v1/query.proto b/examples/authz/proto/cosmos/gov/v1/query.proto
new file mode 100644
index 00000000..ea46472a
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1/query.proto
@@ -0,0 +1,183 @@
+
+// Since: cosmos-sdk 0.46
+syntax = "proto3";
+package cosmos.gov.v1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "google/api/annotations.proto";
+import "cosmos/gov/v1/gov.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1";
+
+// Query defines the gRPC querier service for gov module
+service Query {
+ // Proposal queries proposal details based on ProposalID.
+ rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}";
+ }
+
+ // Proposals queries all proposals based on given status.
+ rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/proposals";
+ }
+
+ // Vote queries voted information based on proposalID, voterAddr.
+ rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}";
+ }
+
+ // Votes queries votes of a given proposal.
+ rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes";
+ }
+
+ // Params queries all parameters of the gov module.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}";
+ }
+
+ // Deposit queries single deposit information based proposalID, depositAddr.
+ rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}";
+ }
+
+ // Deposits queries all deposits of a single proposal.
+ rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits";
+ }
+
+ // TallyResult queries the tally of a proposal vote.
+ rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally";
+ }
+}
+
+// QueryProposalRequest is the request type for the Query/Proposal RPC method.
+message QueryProposalRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// QueryProposalResponse is the response type for the Query/Proposal RPC method.
+message QueryProposalResponse {
+ Proposal proposal = 1;
+}
+
+// QueryProposalsRequest is the request type for the Query/Proposals RPC method.
+message QueryProposalsRequest {
+ // proposal_status defines the status of the proposals.
+ ProposalStatus proposal_status = 1;
+
+ // voter defines the voter address for the proposals.
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // depositor defines the deposit addresses from the proposals.
+ string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 4;
+}
+
+// QueryProposalsResponse is the response type for the Query/Proposals RPC
+// method.
+message QueryProposalsResponse {
+ repeated Proposal proposals = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryVoteRequest is the request type for the Query/Vote RPC method.
+message QueryVoteRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // voter defines the oter address for the proposals.
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryVoteResponse is the response type for the Query/Vote RPC method.
+message QueryVoteResponse {
+ // vote defined the queried vote.
+ Vote vote = 1;
+}
+
+// QueryVotesRequest is the request type for the Query/Votes RPC method.
+message QueryVotesRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryVotesResponse is the response type for the Query/Votes RPC method.
+message QueryVotesResponse {
+ // votes defined the queried votes.
+ repeated Vote votes = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {
+ // params_type defines which parameters to query for, can be one of "voting",
+ // "tallying" or "deposit".
+ string params_type = 1;
+}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // voting_params defines the parameters related to voting.
+ VotingParams voting_params = 1;
+ // deposit_params defines the parameters related to deposit.
+ DepositParams deposit_params = 2;
+ // tally_params defines the parameters related to tally.
+ TallyParams tally_params = 3;
+}
+
+// QueryDepositRequest is the request type for the Query/Deposit RPC method.
+message QueryDepositRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // depositor defines the deposit addresses from the proposals.
+ string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDepositResponse is the response type for the Query/Deposit RPC method.
+message QueryDepositResponse {
+ // deposit defines the requested deposit.
+ Deposit deposit = 1;
+}
+
+// QueryDepositsRequest is the request type for the Query/Deposits RPC method.
+message QueryDepositsRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryDepositsResponse is the response type for the Query/Deposits RPC method.
+message QueryDepositsResponse {
+ repeated Deposit deposits = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryTallyResultRequest is the request type for the Query/Tally RPC method.
+message QueryTallyResultRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// QueryTallyResultResponse is the response type for the Query/Tally RPC method.
+message QueryTallyResultResponse {
+ // tally defines the requested tally.
+ TallyResult tally = 1;
+}
diff --git a/examples/authz/proto/cosmos/gov/v1/tx.proto b/examples/authz/proto/cosmos/gov/v1/tx.proto
new file mode 100644
index 00000000..9306c51e
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1/tx.proto
@@ -0,0 +1,100 @@
+// Since: cosmos-sdk 0.46
+syntax = "proto3";
+package cosmos.gov.v1;
+
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/gov/v1/gov.proto";
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "google/protobuf/any.proto";
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1";
+
+// Msg defines the gov Msg service.
+service Msg {
+ // SubmitProposal defines a method to create new proposal given a content.
+ rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse);
+
+ // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal
+ // to execute a legacy content-based proposal.
+ rpc ExecLegacyContent(MsgExecLegacyContent) returns (MsgExecLegacyContentResponse);
+
+ // Vote defines a method to add a vote on a specific proposal.
+ rpc Vote(MsgVote) returns (MsgVoteResponse);
+
+ // VoteWeighted defines a method to add a weighted vote on a specific proposal.
+ rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse);
+
+ // Deposit defines a method to add deposit on a specific proposal.
+ rpc Deposit(MsgDeposit) returns (MsgDepositResponse);
+}
+
+// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary
+// proposal Content.
+message MsgSubmitProposal {
+ option (cosmos.msg.v1.signer) = "proposer";
+
+ repeated google.protobuf.Any messages = 1;
+ repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false];
+ string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // metadata is any arbitrary metadata attached to the proposal.
+ string metadata = 4;
+}
+
+// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type.
+message MsgSubmitProposalResponse {
+ uint64 proposal_id = 1;
+}
+
+// MsgExecLegacyContent is used to wrap the legacy content field into a message.
+// This ensures backwards compatibility with v1beta1.MsgSubmitProposal.
+message MsgExecLegacyContent {
+ option (cosmos.msg.v1.signer) = "authority";
+
+ // content is the proposal's content.
+ google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"];
+ // authority must be the gov module address.
+ string authority = 2;
+}
+
+// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type.
+message MsgExecLegacyContentResponse {}
+
+// MsgVote defines a message to cast a vote.
+message MsgVote {
+ option (cosmos.msg.v1.signer) = "voter";
+
+ uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ VoteOption option = 3;
+ string metadata = 4;
+}
+
+// MsgVoteResponse defines the Msg/Vote response type.
+message MsgVoteResponse {}
+
+// MsgVoteWeighted defines a message to cast a vote.
+message MsgVoteWeighted {
+ option (cosmos.msg.v1.signer) = "voter";
+
+ uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated WeightedVoteOption options = 3;
+ string metadata = 4;
+}
+
+// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.
+message MsgVoteWeightedResponse {}
+
+// MsgDeposit defines a message to submit a deposit to an existing proposal.
+message MsgDeposit {
+ option (cosmos.msg.v1.signer) = "depositor";
+
+ uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
+ string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
+}
+
+// MsgDepositResponse defines the Msg/Deposit response type.
+message MsgDepositResponse {}
diff --git a/examples/authz/proto/cosmos/gov/v1beta1/genesis.proto b/examples/authz/proto/cosmos/gov/v1beta1/genesis.proto
new file mode 100644
index 00000000..be9b07e4
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1beta1/genesis.proto
@@ -0,0 +1,26 @@
+syntax = "proto3";
+
+package cosmos.gov.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/gov/v1beta1/gov.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1";
+
+// GenesisState defines the gov module's genesis state.
+message GenesisState {
+ // starting_proposal_id is the ID of the starting proposal.
+ uint64 starting_proposal_id = 1;
+ // deposits defines all the deposits present at genesis.
+ repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false];
+ // votes defines all the votes present at genesis.
+ repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false];
+ // proposals defines all the proposals present at genesis.
+ repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false];
+ // params defines all the paramaters of related to deposit.
+ DepositParams deposit_params = 5 [(gogoproto.nullable) = false];
+ // params defines all the paramaters of related to voting.
+ VotingParams voting_params = 6 [(gogoproto.nullable) = false];
+ // params defines all the paramaters of related to tally.
+ TallyParams tally_params = 7 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/gov/v1beta1/gov.proto b/examples/authz/proto/cosmos/gov/v1beta1/gov.proto
new file mode 100644
index 00000000..f1487fe4
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1beta1/gov.proto
@@ -0,0 +1,201 @@
+syntax = "proto3";
+package cosmos.gov.v1beta1;
+
+import "cosmos/base/v1beta1/coin.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/duration.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1";
+
+option (gogoproto.goproto_stringer_all) = false;
+option (gogoproto.stringer_all) = false;
+option (gogoproto.goproto_getters_all) = false;
+
+// VoteOption enumerates the valid vote options for a given governance proposal.
+enum VoteOption {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"];
+ // VOTE_OPTION_YES defines a yes vote option.
+ VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"];
+ // VOTE_OPTION_ABSTAIN defines an abstain vote option.
+ VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"];
+ // VOTE_OPTION_NO defines a no vote option.
+ VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"];
+ // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.
+ VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"];
+}
+
+// WeightedVoteOption defines a unit of vote for vote split.
+//
+// Since: cosmos-sdk 0.43
+message WeightedVoteOption {
+ VoteOption option = 1;
+ string weight = 2 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// TextProposal defines a standard text proposal whose changes need to be
+// manually updated in case of approval.
+message TextProposal {
+ option (cosmos_proto.implements_interface) = "Content";
+
+ option (gogoproto.equal) = true;
+
+ string title = 1;
+ string description = 2;
+}
+
+// Deposit defines an amount deposited by an account address to an active
+// proposal.
+message Deposit {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.equal) = false;
+
+ uint64 proposal_id = 1;
+ string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin amount = 3
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// Proposal defines the core field members of a governance proposal.
+message Proposal {
+ option (gogoproto.equal) = true;
+
+ uint64 proposal_id = 1;
+ google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"];
+ ProposalStatus status = 3;
+ // final_tally_result is the final tally result of the proposal. When
+ // querying a proposal via gRPC, this field is not populated until the
+ // proposal's voting period has ended.
+ TallyResult final_tally_result = 4 [(gogoproto.nullable) = false];
+ google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+ google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+ repeated cosmos.base.v1beta1.Coin total_deposit = 7
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+ google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+ google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+}
+
+// ProposalStatus enumerates the valid statuses of a proposal.
+enum ProposalStatus {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status.
+ PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"];
+ // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit
+ // period.
+ PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"];
+ // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting
+ // period.
+ PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"];
+ // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has
+ // passed.
+ PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"];
+ // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has
+ // been rejected.
+ PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"];
+ // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has
+ // failed.
+ PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"];
+}
+
+// TallyResult defines a standard tally for a governance proposal.
+message TallyResult {
+ option (gogoproto.equal) = true;
+
+ string yes = 1 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+ string abstain = 2 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+ string no = 3 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+ string no_with_veto = 4 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// Vote defines a vote on a governance proposal.
+// A Vote consists of a proposal ID, the voter, and the vote option.
+message Vote {
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.equal) = false;
+
+ uint64 proposal_id = 1 [(gogoproto.jsontag) = "id"];
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // Deprecated: Prefer to use `options` instead. This field is set in queries
+ // if and only if `len(options) == 1` and that option has weight 1. In all
+ // other cases, this field will default to VOTE_OPTION_UNSPECIFIED.
+ VoteOption option = 3 [deprecated = true];
+ // Since: cosmos-sdk 0.43
+ repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false];
+}
+
+// DepositParams defines the params for deposits on governance proposals.
+message DepositParams {
+ // Minimum deposit for a proposal to enter voting period.
+ repeated cosmos.base.v1beta1.Coin min_deposit = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.jsontag) = "min_deposit,omitempty"
+ ];
+
+ // Maximum period for Atom holders to deposit on a proposal. Initial value: 2
+ // months.
+ google.protobuf.Duration max_deposit_period = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "max_deposit_period,omitempty"
+ ];
+}
+
+// VotingParams defines the params for voting on governance proposals.
+message VotingParams {
+ // Length of the voting period.
+ google.protobuf.Duration voting_period = 1
+ [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"];
+}
+
+// TallyParams defines the params for tallying votes on governance proposals.
+message TallyParams {
+ // Minimum percentage of total stake needed to vote for a result to be
+ // considered valid.
+ bytes quorum = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "quorum,omitempty"
+ ];
+
+ // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5.
+ bytes threshold = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "threshold,omitempty"
+ ];
+
+ // Minimum value of Veto votes to Total votes ratio for proposal to be
+ // vetoed. Default value: 1/3.
+ bytes veto_threshold = 3 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "veto_threshold,omitempty"
+ ];
+}
diff --git a/examples/authz/proto/cosmos/gov/v1beta1/query.proto b/examples/authz/proto/cosmos/gov/v1beta1/query.proto
new file mode 100644
index 00000000..e8837fd2
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1beta1/query.proto
@@ -0,0 +1,191 @@
+syntax = "proto3";
+package cosmos.gov.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/gov/v1beta1/gov.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1";
+
+// Query defines the gRPC querier service for gov module
+service Query {
+ // Proposal queries proposal details based on ProposalID.
+ rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}";
+ }
+
+ // Proposals queries all proposals based on given status.
+ rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/proposals";
+ }
+
+ // Vote queries voted information based on proposalID, voterAddr.
+ rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}";
+ }
+
+ // Votes queries votes of a given proposal.
+ rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes";
+ }
+
+ // Params queries all parameters of the gov module.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}";
+ }
+
+ // Deposit queries single deposit information based proposalID, depositAddr.
+ rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}";
+ }
+
+ // Deposits queries all deposits of a single proposal.
+ rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits";
+ }
+
+ // TallyResult queries the tally of a proposal vote.
+ rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) {
+ option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally";
+ }
+}
+
+// QueryProposalRequest is the request type for the Query/Proposal RPC method.
+message QueryProposalRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// QueryProposalResponse is the response type for the Query/Proposal RPC method.
+message QueryProposalResponse {
+ Proposal proposal = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryProposalsRequest is the request type for the Query/Proposals RPC method.
+message QueryProposalsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // proposal_status defines the status of the proposals.
+ ProposalStatus proposal_status = 1;
+
+ // voter defines the voter address for the proposals.
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // depositor defines the deposit addresses from the proposals.
+ string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 4;
+}
+
+// QueryProposalsResponse is the response type for the Query/Proposals RPC
+// method.
+message QueryProposalsResponse {
+ repeated Proposal proposals = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryVoteRequest is the request type for the Query/Vote RPC method.
+message QueryVoteRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // voter defines the oter address for the proposals.
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryVoteResponse is the response type for the Query/Vote RPC method.
+message QueryVoteResponse {
+ // vote defined the queried vote.
+ Vote vote = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryVotesRequest is the request type for the Query/Votes RPC method.
+message QueryVotesRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryVotesResponse is the response type for the Query/Votes RPC method.
+message QueryVotesResponse {
+ // votes defined the queried votes.
+ repeated Vote votes = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {
+ // params_type defines which parameters to query for, can be one of "voting",
+ // "tallying" or "deposit".
+ string params_type = 1;
+}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // voting_params defines the parameters related to voting.
+ VotingParams voting_params = 1 [(gogoproto.nullable) = false];
+ // deposit_params defines the parameters related to deposit.
+ DepositParams deposit_params = 2 [(gogoproto.nullable) = false];
+ // tally_params defines the parameters related to tally.
+ TallyParams tally_params = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryDepositRequest is the request type for the Query/Deposit RPC method.
+message QueryDepositRequest {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.equal) = false;
+
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // depositor defines the deposit addresses from the proposals.
+ string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDepositResponse is the response type for the Query/Deposit RPC method.
+message QueryDepositResponse {
+ // deposit defines the requested deposit.
+ Deposit deposit = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryDepositsRequest is the request type for the Query/Deposits RPC method.
+message QueryDepositsRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryDepositsResponse is the response type for the Query/Deposits RPC method.
+message QueryDepositsResponse {
+ repeated Deposit deposits = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryTallyResultRequest is the request type for the Query/Tally RPC method.
+message QueryTallyResultRequest {
+ // proposal_id defines the unique id of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// QueryTallyResultResponse is the response type for the Query/Tally RPC method.
+message QueryTallyResultResponse {
+ // tally defines the requested tally.
+ TallyResult tally = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/gov/v1beta1/tx.proto b/examples/authz/proto/cosmos/gov/v1beta1/tx.proto
new file mode 100644
index 00000000..00ce2253
--- /dev/null
+++ b/examples/authz/proto/cosmos/gov/v1beta1/tx.proto
@@ -0,0 +1,106 @@
+syntax = "proto3";
+package cosmos.gov.v1beta1;
+
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/gov/v1beta1/gov.proto";
+import "cosmos_proto/cosmos.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1";
+
+// Msg defines the bank Msg service.
+service Msg {
+ // SubmitProposal defines a method to create new proposal given a content.
+ rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse);
+
+ // Vote defines a method to add a vote on a specific proposal.
+ rpc Vote(MsgVote) returns (MsgVoteResponse);
+
+ // VoteWeighted defines a method to add a weighted vote on a specific proposal.
+ //
+ // Since: cosmos-sdk 0.43
+ rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse);
+
+ // Deposit defines a method to add deposit on a specific proposal.
+ rpc Deposit(MsgDeposit) returns (MsgDepositResponse);
+}
+
+// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary
+// proposal Content.
+message MsgSubmitProposal {
+ option (cosmos.msg.v1.signer) = "proposer";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.stringer) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"];
+ repeated cosmos.base.v1beta1.Coin initial_deposit = 2
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+ string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type.
+message MsgSubmitProposalResponse {
+ uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
+}
+
+// MsgVote defines a message to cast a vote.
+message MsgVote {
+ option (cosmos.msg.v1.signer) = "voter";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.stringer) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ uint64 proposal_id = 1;
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ VoteOption option = 3;
+}
+
+// MsgVoteResponse defines the Msg/Vote response type.
+message MsgVoteResponse {}
+
+// MsgVoteWeighted defines a message to cast a vote.
+//
+// Since: cosmos-sdk 0.43
+message MsgVoteWeighted {
+ option (cosmos.msg.v1.signer) = "voter";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.stringer) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false];
+}
+
+// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.
+//
+// Since: cosmos-sdk 0.43
+message MsgVoteWeightedResponse {}
+
+// MsgDeposit defines a message to submit a deposit to an existing proposal.
+message MsgDeposit {
+ option (cosmos.msg.v1.signer) = "depositor";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.stringer) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"];
+ string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin amount = 3
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// MsgDepositResponse defines the Msg/Deposit response type.
+message MsgDepositResponse {}
diff --git a/examples/authz/proto/cosmos/group/v1/events.proto b/examples/authz/proto/cosmos/group/v1/events.proto
new file mode 100644
index 00000000..e8907243
--- /dev/null
+++ b/examples/authz/proto/cosmos/group/v1/events.proto
@@ -0,0 +1,77 @@
+syntax = "proto3";
+
+package cosmos.group.v1;
+
+import "cosmos_proto/cosmos.proto";
+import "cosmos/group/v1/types.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/group";
+
+// EventCreateGroup is an event emitted when a group is created.
+message EventCreateGroup {
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 1;
+}
+
+// EventUpdateGroup is an event emitted when a group is updated.
+message EventUpdateGroup {
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 1;
+}
+
+// EventCreateGroupPolicy is an event emitted when a group policy is created.
+message EventCreateGroupPolicy {
+
+ // address is the account address of the group policy.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// EventUpdateGroupPolicy is an event emitted when a group policy is updated.
+message EventUpdateGroupPolicy {
+
+ // address is the account address of the group policy.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// EventSubmitProposal is an event emitted when a proposal is created.
+message EventSubmitProposal {
+
+ // proposal_id is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// EventWithdrawProposal is an event emitted when a proposal is withdrawn.
+message EventWithdrawProposal {
+
+ // proposal_id is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// EventVote is an event emitted when a voter votes on a proposal.
+message EventVote {
+
+ // proposal_id is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// EventExec is an event emitted when a proposal is executed.
+message EventExec {
+
+ // proposal_id is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+
+ // result is the proposal execution result.
+ ProposalExecutorResult result = 2;
+}
+
+// EventLeaveGroup is an event emitted when group member leaves the group.
+message EventLeaveGroup {
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 1;
+
+ // address is the account address of the group member.
+ string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
diff --git a/examples/authz/proto/cosmos/group/v1/genesis.proto b/examples/authz/proto/cosmos/group/v1/genesis.proto
new file mode 100644
index 00000000..49655ad2
--- /dev/null
+++ b/examples/authz/proto/cosmos/group/v1/genesis.proto
@@ -0,0 +1,38 @@
+syntax = "proto3";
+
+package cosmos.group.v1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/group";
+
+import "cosmos/group/v1/types.proto";
+
+// GenesisState defines the group module's genesis state.
+message GenesisState {
+
+ // group_seq is the group table orm.Sequence,
+ // it is used to get the next group ID.
+ uint64 group_seq = 1;
+
+ // groups is the list of groups info.
+ repeated GroupInfo groups = 2;
+
+ // group_members is the list of groups members.
+ repeated GroupMember group_members = 3;
+
+ // group_policy_seq is the group policy table orm.Sequence,
+ // it is used to generate the next group policy account address.
+ uint64 group_policy_seq = 4;
+
+ // group_policies is the list of group policies info.
+ repeated GroupPolicyInfo group_policies = 5;
+
+ // proposal_seq is the proposal table orm.Sequence,
+ // it is used to get the next proposal ID.
+ uint64 proposal_seq = 6;
+
+ // proposals is the list of proposals.
+ repeated Proposal proposals = 7;
+
+ // votes is the list of votes.
+ repeated Vote votes = 8;
+}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/group/v1/query.proto b/examples/authz/proto/cosmos/group/v1/query.proto
new file mode 100644
index 00000000..1690d5b7
--- /dev/null
+++ b/examples/authz/proto/cosmos/group/v1/query.proto
@@ -0,0 +1,308 @@
+syntax = "proto3";
+
+package cosmos.group.v1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/group/v1/types.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/group";
+
+// Query is the cosmos.group.v1 Query service.
+service Query {
+
+ // GroupInfo queries group info based on group id.
+ rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/group_info/{group_id}";
+ };
+
+ // GroupPolicyInfo queries group policy info based on account address of group policy.
+ rpc GroupPolicyInfo(QueryGroupPolicyInfoRequest) returns (QueryGroupPolicyInfoResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}";
+ };
+
+ // GroupMembers queries members of a group
+ rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}";
+ };
+
+ // GroupsByAdmin queries groups by admin address.
+ rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/groups_by_admin/{admin}";
+ };
+
+ // GroupPoliciesByGroup queries group policies by group id.
+ rpc GroupPoliciesByGroup(QueryGroupPoliciesByGroupRequest) returns (QueryGroupPoliciesByGroupResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}";
+ };
+
+ // GroupsByAdmin queries group policies by admin address.
+ rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}";
+ };
+
+ // Proposal queries a proposal based on proposal id.
+ rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/proposal/{proposal_id}";
+ };
+
+ // ProposalsByGroupPolicy queries proposals based on account address of group policy.
+ rpc ProposalsByGroupPolicy(QueryProposalsByGroupPolicyRequest) returns (QueryProposalsByGroupPolicyResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/proposals_by_group_policy/{address}";
+ };
+
+ // VoteByProposalVoter queries a vote by proposal id and voter.
+ rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}";
+ };
+
+ // VotesByProposal queries a vote by proposal.
+ rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}";
+ };
+
+ // VotesByVoter queries a vote by voter.
+ rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/votes_by_voter/{voter}";
+ };
+
+ // GroupsByMember queries groups by member address.
+ rpc GroupsByMember(QueryGroupsByMemberRequest) returns (QueryGroupsByMemberResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}";
+ };
+
+ // TallyResult queries the tally of a proposal votes.
+ rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) {
+ option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally";
+ };
+}
+
+// QueryGroupInfoRequest is the Query/GroupInfo request type.
+message QueryGroupInfoRequest {
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 1;
+}
+
+// QueryGroupInfoResponse is the Query/GroupInfo response type.
+message QueryGroupInfoResponse {
+
+ // info is the GroupInfo for the group.
+ GroupInfo info = 1;
+}
+
+// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type.
+message QueryGroupPolicyInfoRequest {
+
+ // address is the account address of the group policy.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type.
+message QueryGroupPolicyInfoResponse {
+
+ // info is the GroupPolicyInfo for the group policy.
+ GroupPolicyInfo info = 1;
+}
+
+// QueryGroupMembersRequest is the Query/GroupMembers request type.
+message QueryGroupMembersRequest {
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryGroupMembersResponse is the Query/GroupMembersResponse response type.
+message QueryGroupMembersResponse {
+
+ // members are the members of the group with given group_id.
+ repeated GroupMember members = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type.
+message QueryGroupsByAdminRequest {
+
+ // admin is the account address of a group's admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type.
+message QueryGroupsByAdminResponse {
+
+ // groups are the groups info with the provided admin.
+ repeated GroupInfo groups = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type.
+message QueryGroupPoliciesByGroupRequest {
+
+ // group_id is the unique ID of the group policy's group.
+ uint64 group_id = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type.
+message QueryGroupPoliciesByGroupResponse {
+
+ // group_policies are the group policies info associated with the provided group.
+ repeated GroupPolicyInfo group_policies = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type.
+message QueryGroupPoliciesByAdminRequest {
+
+ // admin is the admin address of the group policy.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type.
+message QueryGroupPoliciesByAdminResponse {
+
+ // group_policies are the group policies info with provided admin.
+ repeated GroupPolicyInfo group_policies = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryProposalRequest is the Query/Proposal request type.
+message QueryProposalRequest {
+
+ // proposal_id is the unique ID of a proposal.
+ uint64 proposal_id = 1;
+}
+
+// QueryProposalResponse is the Query/Proposal response type.
+message QueryProposalResponse {
+
+ // proposal is the proposal info.
+ Proposal proposal = 1;
+}
+
+// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type.
+message QueryProposalsByGroupPolicyRequest {
+
+ // address is the account address of the group policy related to proposals.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type.
+message QueryProposalsByGroupPolicyResponse {
+
+ // proposals are the proposals with given group policy.
+ repeated Proposal proposals = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type.
+message QueryVoteByProposalVoterRequest {
+
+ // proposal_id is the unique ID of a proposal.
+ uint64 proposal_id = 1;
+
+ // voter is a proposal voter account address.
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type.
+message QueryVoteByProposalVoterResponse {
+
+ // vote is the vote with given proposal_id and voter.
+ Vote vote = 1;
+}
+
+// QueryVotesByProposalRequest is the Query/VotesByProposal request type.
+message QueryVotesByProposalRequest {
+
+ // proposal_id is the unique ID of a proposal.
+ uint64 proposal_id = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryVotesByProposalResponse is the Query/VotesByProposal response type.
+message QueryVotesByProposalResponse {
+
+ // votes are the list of votes for given proposal_id.
+ repeated Vote votes = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryVotesByVoterRequest is the Query/VotesByVoter request type.
+message QueryVotesByVoterRequest {
+ // voter is a proposal voter account address.
+ string voter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryVotesByVoterResponse is the Query/VotesByVoter response type.
+message QueryVotesByVoterResponse {
+
+ // votes are the list of votes by given voter.
+ repeated Vote votes = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryGroupsByMemberRequest is the Query/GroupsByMember request type.
+message QueryGroupsByMemberRequest {
+ // address is the group member address.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryGroupsByMemberResponse is the Query/GroupsByMember response type.
+message QueryGroupsByMemberResponse {
+ // groups are the groups info with the provided group member.
+ repeated GroupInfo groups = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryTallyResultRequest is the Query/TallyResult request type.
+message QueryTallyResultRequest {
+ // proposal_id is the unique id of a proposal.
+ uint64 proposal_id = 1;
+}
+
+// QueryTallyResultResponse is the Query/TallyResult response type.
+message QueryTallyResultResponse {
+ // tally defines the requested tally.
+ TallyResult tally = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/group/v1/tx.proto b/examples/authz/proto/cosmos/group/v1/tx.proto
new file mode 100644
index 00000000..08d83ede
--- /dev/null
+++ b/examples/authz/proto/cosmos/group/v1/tx.proto
@@ -0,0 +1,364 @@
+syntax = "proto3";
+
+package cosmos.group.v1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/group";
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "google/protobuf/any.proto";
+import "cosmos/group/v1/types.proto";
+
+import "cosmos/msg/v1/msg.proto";
+
+// Msg is the cosmos.group.v1 Msg service.
+service Msg {
+
+ // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata.
+ rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse);
+
+ // UpdateGroupMembers updates the group members with given group id and admin address.
+ rpc UpdateGroupMembers(MsgUpdateGroupMembers) returns (MsgUpdateGroupMembersResponse);
+
+ // UpdateGroupAdmin updates the group admin with given group id and previous admin address.
+ rpc UpdateGroupAdmin(MsgUpdateGroupAdmin) returns (MsgUpdateGroupAdminResponse);
+
+ // UpdateGroupMetadata updates the group metadata with given group id and admin address.
+ rpc UpdateGroupMetadata(MsgUpdateGroupMetadata) returns (MsgUpdateGroupMetadataResponse);
+
+ // CreateGroupPolicy creates a new group policy using given DecisionPolicy.
+ rpc CreateGroupPolicy(MsgCreateGroupPolicy) returns (MsgCreateGroupPolicyResponse);
+
+ // CreateGroupWithPolicy creates a new group with policy.
+ rpc CreateGroupWithPolicy(MsgCreateGroupWithPolicy) returns (MsgCreateGroupWithPolicyResponse);
+
+ // UpdateGroupPolicyAdmin updates a group policy admin.
+ rpc UpdateGroupPolicyAdmin(MsgUpdateGroupPolicyAdmin) returns (MsgUpdateGroupPolicyAdminResponse);
+
+ // UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated.
+ rpc UpdateGroupPolicyDecisionPolicy(MsgUpdateGroupPolicyDecisionPolicy)
+ returns (MsgUpdateGroupPolicyDecisionPolicyResponse);
+
+ // UpdateGroupPolicyMetadata updates a group policy metadata.
+ rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse);
+
+ // SubmitProposal submits a new proposal.
+ rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse);
+
+ // WithdrawProposal aborts a proposal.
+ rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse);
+
+ // Vote allows a voter to vote on a proposal.
+ rpc Vote(MsgVote) returns (MsgVoteResponse);
+
+ // Exec executes a proposal.
+ rpc Exec(MsgExec) returns (MsgExecResponse);
+
+ // LeaveGroup allows a group member to leave the group.
+ rpc LeaveGroup(MsgLeaveGroup) returns (MsgLeaveGroupResponse);
+}
+
+//
+// Groups
+//
+
+// MsgCreateGroup is the Msg/CreateGroup request type.
+message MsgCreateGroup {
+ option (cosmos.msg.v1.signer) = "admin";
+ // admin is the account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // members defines the group members.
+ repeated Member members = 2 [(gogoproto.nullable) = false];
+
+ // metadata is any arbitrary metadata to attached to the group.
+ string metadata = 3;
+}
+
+// MsgCreateGroupResponse is the Msg/CreateGroup response type.
+message MsgCreateGroupResponse {
+
+ // group_id is the unique ID of the newly created group.
+ uint64 group_id = 1;
+}
+
+// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type.
+message MsgUpdateGroupMembers {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ // admin is the account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 2;
+
+ // member_updates is the list of members to update,
+ // set weight to 0 to remove a member.
+ repeated Member member_updates = 3 [(gogoproto.nullable) = false];
+}
+
+// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type.
+message MsgUpdateGroupMembersResponse {}
+
+// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type.
+message MsgUpdateGroupAdmin {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ // admin is the current account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 2;
+
+ // new_admin is the group new admin account address.
+ string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type.
+message MsgUpdateGroupAdminResponse {}
+
+// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type.
+message MsgUpdateGroupMetadata {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ // admin is the account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 2;
+
+ // metadata is the updated group's metadata.
+ string metadata = 3;
+}
+
+// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type.
+message MsgUpdateGroupMetadataResponse {}
+
+//
+// Group Policies
+//
+
+// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type.
+message MsgCreateGroupPolicy {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ option (gogoproto.goproto_getters) = false;
+
+ // admin is the account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 2;
+
+ // metadata is any arbitrary metadata attached to the group policy.
+ string metadata = 3;
+
+ // decision_policy specifies the group policy's decision policy.
+ google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
+}
+
+// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type.
+message MsgCreateGroupPolicyResponse {
+
+ // address is the account address of the newly created group policy.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type.
+message MsgUpdateGroupPolicyAdmin {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ // admin is the account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // address is the account address of the group policy.
+ string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // new_admin is the new group policy admin.
+ string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type.
+message MsgCreateGroupWithPolicy {
+ option (gogoproto.goproto_getters) = false;
+
+ // admin is the account address of the group and group policy admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // members defines the group members.
+ repeated Member members = 2 [(gogoproto.nullable) = false];
+
+ // group_metadata is any arbitrary metadata attached to the group.
+ string group_metadata = 3;
+
+ // group_policy_metadata is any arbitrary metadata attached to the group policy.
+ string group_policy_metadata = 4;
+
+ // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin.
+ bool group_policy_as_admin = 5;
+
+ // decision_policy specifies the group policy's decision policy.
+ google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
+}
+
+// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type.
+message MsgCreateGroupWithPolicyResponse {
+
+ // group_id is the unique ID of the newly created group with policy.
+ uint64 group_id = 1;
+
+ // group_policy_address is the account address of the newly created group policy.
+ string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type.
+message MsgUpdateGroupPolicyAdminResponse {}
+
+// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type.
+message MsgUpdateGroupPolicyDecisionPolicy {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ option (gogoproto.goproto_getters) = false;
+
+ // admin is the account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // address is the account address of group policy.
+ string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // decision_policy is the updated group policy's decision policy.
+ google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
+}
+
+// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type.
+message MsgUpdateGroupPolicyDecisionPolicyResponse {}
+
+// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type.
+message MsgUpdateGroupPolicyMetadata {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ // admin is the account address of the group admin.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // address is the account address of group policy.
+ string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // metadata is the updated group policy metadata.
+ string metadata = 3;
+}
+
+// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type.
+message MsgUpdateGroupPolicyMetadataResponse {}
+
+//
+// Proposals and Voting
+//
+
+// Exec defines modes of execution of a proposal on creation or on new vote.
+enum Exec {
+
+ // An empty value means that there should be a separate
+ // MsgExec request for the proposal to execute.
+ EXEC_UNSPECIFIED = 0;
+
+ // Try to execute the proposal immediately.
+ // If the proposal is not allowed per the DecisionPolicy,
+ // the proposal will still be open and could
+ // be executed at a later point.
+ EXEC_TRY = 1;
+}
+
+// MsgSubmitProposal is the Msg/SubmitProposal request type.
+message MsgSubmitProposal {
+ option (cosmos.msg.v1.signer) = "proposers";
+
+ option (gogoproto.goproto_getters) = false;
+
+ // address is the account address of group policy.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // proposers are the account addresses of the proposers.
+ // Proposers signatures will be counted as yes votes.
+ repeated string proposers = 2;
+
+ // metadata is any arbitrary metadata to attached to the proposal.
+ string metadata = 3;
+
+ // messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
+ repeated google.protobuf.Any messages = 4;
+
+ // exec defines the mode of execution of the proposal,
+ // whether it should be executed immediately on creation or not.
+ // If so, proposers signatures are considered as Yes votes.
+ Exec exec = 5;
+}
+
+// MsgSubmitProposalResponse is the Msg/SubmitProposal response type.
+message MsgSubmitProposalResponse {
+
+ // proposal is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+}
+
+// MsgWithdrawProposal is the Msg/WithdrawProposal request type.
+message MsgWithdrawProposal {
+ // proposal is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+
+ // address is the admin of the group policy or one of the proposer of the proposal.
+ string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type.
+message MsgWithdrawProposalResponse {}
+
+// MsgVote is the Msg/Vote request type.
+message MsgVote {
+ option (cosmos.msg.v1.signer) = "voter";
+
+ // proposal is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+ // voter is the voter account address.
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // option is the voter's choice on the proposal.
+ VoteOption option = 3;
+
+ // metadata is any arbitrary metadata to attached to the vote.
+ string metadata = 4;
+
+ // exec defines whether the proposal should be executed
+ // immediately after voting or not.
+ Exec exec = 5;
+}
+
+// MsgVoteResponse is the Msg/Vote response type.
+message MsgVoteResponse {}
+
+// MsgExec is the Msg/Exec request type.
+message MsgExec {
+ option (cosmos.msg.v1.signer) = "signer";
+
+ // proposal is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+
+ // signer is the account address used to execute the proposal.
+ string signer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgExecResponse is the Msg/Exec request type.
+message MsgExecResponse {}
+
+// MsgLeaveGroup is the Msg/LeaveGroup request type.
+message MsgLeaveGroup {
+ option (cosmos.msg.v1.signer) = "address";
+
+ // address is the account address of the group member.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 2;
+}
+
+// MsgLeaveGroupResponse is the Msg/LeaveGroup response type.
+message MsgLeaveGroupResponse {}
diff --git a/examples/authz/proto/cosmos/group/v1/types.proto b/examples/authz/proto/cosmos/group/v1/types.proto
new file mode 100644
index 00000000..e09a74c1
--- /dev/null
+++ b/examples/authz/proto/cosmos/group/v1/types.proto
@@ -0,0 +1,308 @@
+syntax = "proto3";
+
+package cosmos.group.v1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/group";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos_proto/cosmos.proto";
+import "google/protobuf/any.proto";
+
+// Member represents a group member with an account address,
+// non-zero weight and metadata.
+message Member {
+
+ // address is the member's account address.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // weight is the member's voting weight that should be greater than 0.
+ string weight = 2;
+
+ // metadata is any arbitrary metadata to attached to the member.
+ string metadata = 3;
+
+ // added_at is a timestamp specifying when a member was added.
+ google.protobuf.Timestamp added_at = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
+
+// Members defines a repeated slice of Member objects.
+message Members {
+
+ // members is the list of members.
+ repeated Member members = 1 [(gogoproto.nullable) = false];
+}
+
+// ThresholdDecisionPolicy implements the DecisionPolicy interface
+message ThresholdDecisionPolicy {
+ option (cosmos_proto.implements_interface) = "DecisionPolicy";
+
+ // threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed.
+ string threshold = 1;
+
+ // windows defines the different windows for voting and execution.
+ DecisionPolicyWindows windows = 2;
+}
+
+// PercentageDecisionPolicy implements the DecisionPolicy interface
+message PercentageDecisionPolicy {
+ option (cosmos_proto.implements_interface) = "DecisionPolicy";
+
+ // percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed.
+ string percentage = 1;
+
+ // windows defines the different windows for voting and execution.
+ DecisionPolicyWindows windows = 2;
+}
+
+// DecisionPolicyWindows defines the different windows for voting and execution.
+message DecisionPolicyWindows {
+ // voting_period is the duration from submission of a proposal to the end of voting period
+ // Within this times votes can be submitted with MsgVote.
+ google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
+
+ // min_execution_period is the minimum duration after the proposal submission
+ // where members can start sending MsgExec. This means that the window for
+ // sending a MsgExec transaction is:
+ // `[ submission + min_execution_period ; submission + voting_period + max_execution_period]`
+ // where max_execution_period is a app-specific config, defined in the keeper.
+ // If not set, min_execution_period will default to 0.
+ //
+ // Please make sure to set a `min_execution_period` that is smaller than
+ // `voting_period + max_execution_period`, or else the above execution window
+ // is empty, meaning that all proposals created with this decision policy
+ // won't be able to be executed.
+ google.protobuf.Duration min_execution_period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
+}
+
+// VoteOption enumerates the valid vote options for a given proposal.
+enum VoteOption {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // VOTE_OPTION_UNSPECIFIED defines a no-op vote option.
+ VOTE_OPTION_UNSPECIFIED = 0;
+ // VOTE_OPTION_YES defines a yes vote option.
+ VOTE_OPTION_YES = 1;
+ // VOTE_OPTION_ABSTAIN defines an abstain vote option.
+ VOTE_OPTION_ABSTAIN = 2;
+ // VOTE_OPTION_NO defines a no vote option.
+ VOTE_OPTION_NO = 3;
+ // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.
+ VOTE_OPTION_NO_WITH_VETO = 4;
+}
+
+//
+// State
+//
+
+// GroupInfo represents the high-level on-chain information for a group.
+message GroupInfo {
+
+ // id is the unique ID of the group.
+ uint64 id = 1;
+
+ // admin is the account address of the group's admin.
+ string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // metadata is any arbitrary metadata to attached to the group.
+ string metadata = 3;
+
+ // version is used to track changes to a group's membership structure that
+ // would break existing proposals. Whenever any members weight is changed,
+ // or any member is added or removed this version is incremented and will
+ // cause proposals based on older versions of this group to fail
+ uint64 version = 4;
+
+ // total_weight is the sum of the group members' weights.
+ string total_weight = 5;
+
+ // created_at is a timestamp specifying when a group was created.
+ google.protobuf.Timestamp created_at = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
+
+// GroupMember represents the relationship between a group and a member.
+message GroupMember {
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 1;
+
+ // member is the member data.
+ Member member = 2;
+}
+
+// GroupPolicyInfo represents the high-level on-chain information for a group policy.
+message GroupPolicyInfo {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+
+ // address is the account address of group policy.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // group_id is the unique ID of the group.
+ uint64 group_id = 2;
+
+ // admin is the account address of the group admin.
+ string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // metadata is any arbitrary metadata to attached to the group policy.
+ string metadata = 4;
+
+ // version is used to track changes to a group's GroupPolicyInfo structure that
+ // would create a different result on a running proposal.
+ uint64 version = 5;
+
+ // decision_policy specifies the group policy's decision policy.
+ google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "DecisionPolicy"];
+
+ // created_at is a timestamp specifying when a group policy was created.
+ google.protobuf.Timestamp created_at = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
+
+// Proposal defines a group proposal. Any member of a group can submit a proposal
+// for a group policy to decide upon.
+// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal
+// passes as well as some optional metadata associated with the proposal.
+message Proposal {
+ option (gogoproto.goproto_getters) = false;
+
+ // id is the unique id of the proposal.
+ uint64 id = 1;
+
+ // address is the account address of group policy.
+ string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // metadata is any arbitrary metadata to attached to the proposal.
+ string metadata = 3;
+
+ // proposers are the account addresses of the proposers.
+ repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // submit_time is a timestamp specifying when a proposal was submitted.
+ google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+
+ // group_version tracks the version of the group that this proposal corresponds to.
+ // When group membership is changed, existing proposals from previous group versions will become invalid.
+ uint64 group_version = 6;
+
+ // group_policy_version tracks the version of the group policy that this proposal corresponds to.
+ // When a decision policy is changed, existing proposals from previous policy versions will become invalid.
+ uint64 group_policy_version = 7;
+
+ // status represents the high level position in the life cycle of the proposal. Initial value is Submitted.
+ ProposalStatus status = 8;
+
+ // result is the final result based on the votes and election rule. Initial value is unfinalized.
+ // The result is persisted so that clients can always rely on this state and not have to replicate the logic.
+ ProposalResult result = 9;
+
+ // final_tally_result contains the sums of all weighted votes for this
+ // proposal for each vote option, after tallying. When querying a proposal
+ // via gRPC, this field is not populated until the proposal's voting period
+ // has ended.
+ TallyResult final_tally_result = 10 [(gogoproto.nullable) = false];
+
+ // voting_period_end is the timestamp before which voting must be done.
+ // Unless a successfull MsgExec is called before (to execute a proposal whose
+ // tally is successful before the voting period ends), tallying will be done
+ // at this point, and the `final_tally_result`, as well
+ // as `status` and `result` fields will be accordingly updated.
+ google.protobuf.Timestamp voting_period_end = 11 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+
+ // executor_result is the final result based on the votes and election rule. Initial value is NotRun.
+ ProposalExecutorResult executor_result = 12;
+
+ // messages is a list of Msgs that will be executed if the proposal passes.
+ repeated google.protobuf.Any messages = 13;
+}
+
+// ProposalStatus defines proposal statuses.
+enum ProposalStatus {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // An empty value is invalid and not allowed.
+ PROPOSAL_STATUS_UNSPECIFIED = 0;
+
+ // Initial status of a proposal when persisted.
+ PROPOSAL_STATUS_SUBMITTED = 1;
+
+ // Final status of a proposal when the final tally was executed.
+ PROPOSAL_STATUS_CLOSED = 2;
+
+ // Final status of a proposal when the group was modified before the final tally.
+ PROPOSAL_STATUS_ABORTED = 3;
+
+ // A proposal can be deleted before the voting start time by the owner. When this happens the final status
+ // is Withdrawn.
+ PROPOSAL_STATUS_WITHDRAWN = 4;
+}
+
+// ProposalResult defines types of proposal results.
+enum ProposalResult {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // An empty value is invalid and not allowed
+ PROPOSAL_RESULT_UNSPECIFIED = 0;
+
+ // Until a final tally has happened the status is unfinalized
+ PROPOSAL_RESULT_UNFINALIZED = 1;
+
+ // Final result of the tally
+ PROPOSAL_RESULT_ACCEPTED = 2;
+
+ // Final result of the tally
+ PROPOSAL_RESULT_REJECTED = 3;
+}
+
+// ProposalExecutorResult defines types of proposal executor results.
+enum ProposalExecutorResult {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // An empty value is not allowed.
+ PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0;
+
+ // We have not yet run the executor.
+ PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1;
+
+ // The executor was successful and proposed action updated state.
+ PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2;
+
+ // The executor returned an error and proposed action didn't update state.
+ PROPOSAL_EXECUTOR_RESULT_FAILURE = 3;
+}
+
+// TallyResult represents the sum of weighted votes for each vote option.
+message TallyResult {
+ option (gogoproto.goproto_getters) = false;
+
+ // yes_count is the weighted sum of yes votes.
+ string yes_count = 1;
+
+ // abstain_count is the weighted sum of abstainers.
+ string abstain_count = 2;
+
+ // no is the weighted sum of no votes.
+ string no_count = 3;
+
+ // no_with_veto_count is the weighted sum of veto.
+ string no_with_veto_count = 4;
+}
+
+// Vote represents a vote for a proposal.
+message Vote {
+
+ // proposal is the unique ID of the proposal.
+ uint64 proposal_id = 1;
+
+ // voter is the account address of the voter.
+ string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // option is the voter's choice on the proposal.
+ VoteOption option = 3;
+
+ // metadata is any arbitrary metadata to attached to the vote.
+ string metadata = 4;
+
+ // submit_time is the timestamp when the vote was submitted.
+ google.protobuf.Timestamp submit_time = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
diff --git a/examples/authz/proto/cosmos/mint/v1beta1/genesis.proto b/examples/authz/proto/cosmos/mint/v1beta1/genesis.proto
new file mode 100644
index 00000000..4e783fb5
--- /dev/null
+++ b/examples/authz/proto/cosmos/mint/v1beta1/genesis.proto
@@ -0,0 +1,16 @@
+syntax = "proto3";
+package cosmos.mint.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/mint/v1beta1/mint.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types";
+
+// GenesisState defines the mint module's genesis state.
+message GenesisState {
+ // minter is a space for holding current inflation information.
+ Minter minter = 1 [(gogoproto.nullable) = false];
+
+ // params defines all the paramaters of the module.
+ Params params = 2 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/mint/v1beta1/mint.proto b/examples/authz/proto/cosmos/mint/v1beta1/mint.proto
new file mode 100644
index 00000000..9cfe2b76
--- /dev/null
+++ b/examples/authz/proto/cosmos/mint/v1beta1/mint.proto
@@ -0,0 +1,57 @@
+syntax = "proto3";
+package cosmos.mint.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types";
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+
+// Minter represents the minting state.
+message Minter {
+ // current annual inflation rate
+ string inflation = 1 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // current annual expected provisions
+ string annual_provisions = 2 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// Params holds parameters for the mint module.
+message Params {
+ option (gogoproto.goproto_stringer) = false;
+
+ // type of coin to mint
+ string mint_denom = 1;
+ // maximum annual change in inflation rate
+ string inflation_rate_change = 2 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // maximum inflation rate
+ string inflation_max = 3 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // minimum inflation rate
+ string inflation_min = 4 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // goal of percent bonded atoms
+ string goal_bonded = 5 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // expected blocks per year
+ uint64 blocks_per_year = 6;
+}
diff --git a/examples/authz/proto/cosmos/mint/v1beta1/query.proto b/examples/authz/proto/cosmos/mint/v1beta1/query.proto
new file mode 100644
index 00000000..acd341d7
--- /dev/null
+++ b/examples/authz/proto/cosmos/mint/v1beta1/query.proto
@@ -0,0 +1,57 @@
+syntax = "proto3";
+package cosmos.mint.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/mint/v1beta1/mint.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types";
+
+// Query provides defines the gRPC querier service.
+service Query {
+ // Params returns the total set of minting parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/mint/v1beta1/params";
+ }
+
+ // Inflation returns the current minting inflation value.
+ rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) {
+ option (google.api.http).get = "/cosmos/mint/v1beta1/inflation";
+ }
+
+ // AnnualProvisions current minting annual provisions value.
+ rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) {
+ option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryInflationRequest is the request type for the Query/Inflation RPC method.
+message QueryInflationRequest {}
+
+// QueryInflationResponse is the response type for the Query/Inflation RPC
+// method.
+message QueryInflationResponse {
+ // inflation is the current minting inflation value.
+ bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
+}
+
+// QueryAnnualProvisionsRequest is the request type for the
+// Query/AnnualProvisions RPC method.
+message QueryAnnualProvisionsRequest {}
+
+// QueryAnnualProvisionsResponse is the response type for the
+// Query/AnnualProvisions RPC method.
+message QueryAnnualProvisionsResponse {
+ // annual_provisions is the current minting annual provisions value.
+ bytes annual_provisions = 1
+ [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/msg/v1/msg.proto b/examples/authz/proto/cosmos/msg/v1/msg.proto
new file mode 100644
index 00000000..89bdf312
--- /dev/null
+++ b/examples/authz/proto/cosmos/msg/v1/msg.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+
+package cosmos.msg.v1;
+
+import "google/protobuf/descriptor.proto";
+
+// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated.
+// We need this right now because gogoproto codegen needs to import the extension.
+option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice";
+
+extend google.protobuf.MessageOptions {
+ // signer must be used in cosmos messages in order
+ // to signal to external clients which fields in a
+ // given cosmos message must be filled with signer
+ // information (address).
+ // The field must be the protobuf name of the message
+ // field extended with this MessageOption.
+ // The field must either be of string kind, or of message
+ // kind in case the signer information is contained within
+ // a message inside the cosmos message.
+ repeated string signer = 11110000;
+}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/nft/v1beta1/event.proto b/examples/authz/proto/cosmos/nft/v1beta1/event.proto
new file mode 100644
index 00000000..96964f08
--- /dev/null
+++ b/examples/authz/proto/cosmos/nft/v1beta1/event.proto
@@ -0,0 +1,26 @@
+syntax = "proto3";
+package cosmos.nft.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/nft";
+
+// EventSend is emitted on Msg/Send
+message EventSend {
+ string class_id = 1;
+ string id = 2;
+ string sender = 3;
+ string receiver = 4;
+}
+
+// EventMint is emitted on Mint
+message EventMint {
+ string class_id = 1;
+ string id = 2;
+ string owner = 3;
+}
+
+// EventBurn is emitted on Burn
+message EventBurn {
+ string class_id = 1;
+ string id = 2;
+ string owner = 3;
+}
diff --git a/examples/authz/proto/cosmos/nft/v1beta1/genesis.proto b/examples/authz/proto/cosmos/nft/v1beta1/genesis.proto
new file mode 100644
index 00000000..6f36ed34
--- /dev/null
+++ b/examples/authz/proto/cosmos/nft/v1beta1/genesis.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+package cosmos.nft.v1beta1;
+
+import "cosmos/nft/v1beta1/nft.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/nft";
+
+// GenesisState defines the nft module's genesis state.
+message GenesisState {
+ // class defines the class of the nft type.
+ repeated cosmos.nft.v1beta1.Class classes = 1;
+ repeated Entry entries = 2;
+}
+
+// Entry Defines all nft owned by a person
+message Entry {
+ // owner is the owner address of the following nft
+ string owner = 1;
+
+ // nfts is a group of nfts of the same owner
+ repeated cosmos.nft.v1beta1.NFT nfts = 2;
+}
diff --git a/examples/authz/proto/cosmos/nft/v1beta1/nft.proto b/examples/authz/proto/cosmos/nft/v1beta1/nft.proto
new file mode 100644
index 00000000..b1241260
--- /dev/null
+++ b/examples/authz/proto/cosmos/nft/v1beta1/nft.proto
@@ -0,0 +1,48 @@
+syntax = "proto3";
+package cosmos.nft.v1beta1;
+
+import "google/protobuf/any.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/nft";
+
+// Class defines the class of the nft type.
+message Class {
+ // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721
+ string id = 1;
+
+ // name defines the human-readable name of the NFT classification. Optional
+ string name = 2;
+
+ // symbol is an abbreviated name for nft classification. Optional
+ string symbol = 3;
+
+ // description is a brief description of nft classification. Optional
+ string description = 4;
+
+ // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional
+ string uri = 5;
+
+ // uri_hash is a hash of the document pointed by uri. Optional
+ string uri_hash = 6;
+
+ // data is the app specific metadata of the NFT class. Optional
+ google.protobuf.Any data = 7;
+}
+
+// NFT defines the NFT.
+message NFT {
+ // class_id associated with the NFT, similar to the contract address of ERC721
+ string class_id = 1;
+
+ // id is a unique identifier of the NFT
+ string id = 2;
+
+ // uri for the NFT metadata stored off chain
+ string uri = 3;
+
+ // uri_hash is a hash of the document pointed by uri
+ string uri_hash = 4;
+
+ // data is an app specific data of the NFT. Optional
+ google.protobuf.Any data = 10;
+}
diff --git a/examples/authz/proto/cosmos/nft/v1beta1/query.proto b/examples/authz/proto/cosmos/nft/v1beta1/query.proto
new file mode 100644
index 00000000..c1d8070f
--- /dev/null
+++ b/examples/authz/proto/cosmos/nft/v1beta1/query.proto
@@ -0,0 +1,125 @@
+syntax = "proto3";
+package cosmos.nft.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "google/api/annotations.proto";
+import "cosmos/nft/v1beta1/nft.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/nft";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721
+ rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {
+ option (google.api.http).get = "/cosmos/nft/v1beta1/balance/{owner}/{class_id}";
+ }
+
+ // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721
+ rpc Owner(QueryOwnerRequest) returns (QueryOwnerResponse) {
+ option (google.api.http).get = "/cosmos/nft/v1beta1/owner/{class_id}/{id}";
+ }
+
+ // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721.
+ rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) {
+ option (google.api.http).get = "/cosmos/nft/v1beta1/supply/{class_id}";
+ }
+
+ // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in
+ // ERC721Enumerable
+ rpc NFTs(QueryNFTsRequest) returns (QueryNFTsResponse) {
+ option (google.api.http).get = "/cosmos/nft/v1beta1/nfts";
+ }
+
+ // NFT queries an NFT based on its class and id.
+ rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) {
+ option (google.api.http).get = "/cosmos/nft/v1beta1/nfts/{class_id}/{id}";
+ }
+
+ // Class queries an NFT class based on its id
+ rpc Class(QueryClassRequest) returns (QueryClassResponse) {
+ option (google.api.http).get = "/cosmos/nft/v1beta1/classes/{class_id}";
+ }
+
+ // Classes queries all NFT classes
+ rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) {
+ option (google.api.http).get = "/cosmos/nft/v1beta1/classes";
+ }
+}
+
+// QueryBalanceRequest is the request type for the Query/Balance RPC method
+message QueryBalanceRequest {
+ string class_id = 1;
+ string owner = 2;
+}
+
+// QueryBalanceResponse is the response type for the Query/Balance RPC method
+message QueryBalanceResponse {
+ uint64 amount = 1;
+}
+
+// QueryOwnerRequest is the request type for the Query/Owner RPC method
+message QueryOwnerRequest {
+ string class_id = 1;
+ string id = 2;
+}
+
+// QueryOwnerResponse is the response type for the Query/Owner RPC method
+message QueryOwnerResponse {
+ string owner = 1;
+}
+
+// QuerySupplyRequest is the request type for the Query/Supply RPC method
+message QuerySupplyRequest {
+ string class_id = 1;
+}
+
+// QuerySupplyResponse is the response type for the Query/Supply RPC method
+message QuerySupplyResponse {
+ uint64 amount = 1;
+}
+
+// QueryNFTstRequest is the request type for the Query/NFTs RPC method
+message QueryNFTsRequest {
+ string class_id = 1;
+ string owner = 2;
+ cosmos.base.query.v1beta1.PageRequest pagination = 3;
+}
+
+// QueryNFTsResponse is the response type for the Query/NFTs RPC methods
+message QueryNFTsResponse {
+ repeated cosmos.nft.v1beta1.NFT nfts = 1;
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryNFTRequest is the request type for the Query/NFT RPC method
+message QueryNFTRequest {
+ string class_id = 1;
+ string id = 2;
+}
+
+// QueryNFTResponse is the response type for the Query/NFT RPC method
+message QueryNFTResponse {
+ cosmos.nft.v1beta1.NFT nft = 1;
+}
+
+// QueryClassRequest is the request type for the Query/Class RPC method
+message QueryClassRequest {
+ string class_id = 1;
+}
+
+// QueryClassResponse is the response type for the Query/Class RPC method
+message QueryClassResponse {
+ cosmos.nft.v1beta1.Class class = 1;
+}
+
+// QueryClassesRequest is the request type for the Query/Classes RPC method
+message QueryClassesRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryClassesResponse is the response type for the Query/Classes RPC method
+message QueryClassesResponse {
+ repeated cosmos.nft.v1beta1.Class classes = 1;
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
diff --git a/examples/authz/proto/cosmos/nft/v1beta1/tx.proto b/examples/authz/proto/cosmos/nft/v1beta1/tx.proto
new file mode 100644
index 00000000..95b402ce
--- /dev/null
+++ b/examples/authz/proto/cosmos/nft/v1beta1/tx.proto
@@ -0,0 +1,30 @@
+syntax = "proto3";
+package cosmos.nft.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/nft";
+
+import "cosmos/msg/v1/msg.proto";
+
+// Msg defines the nft Msg service.
+service Msg {
+ // Send defines a method to send a nft from one account to another account.
+ rpc Send(MsgSend) returns (MsgSendResponse);
+}
+// MsgSend represents a message to send a nft from one account to another account.
+message MsgSend {
+ option (cosmos.msg.v1.signer) = "sender";
+
+ // class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721
+ string class_id = 1;
+
+ // id defines the unique identification of nft
+ string id = 2;
+
+ // sender is the address of the owner of nft
+ string sender = 3;
+
+ // receiver is the receiver address of nft
+ string receiver = 4;
+}
+// MsgSendResponse defines the Msg/Send response type.
+message MsgSendResponse {}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/orm/v1/orm.proto b/examples/authz/proto/cosmos/orm/v1/orm.proto
new file mode 100644
index 00000000..abfbbd4f
--- /dev/null
+++ b/examples/authz/proto/cosmos/orm/v1/orm.proto
@@ -0,0 +1,104 @@
+syntax = "proto3";
+
+package cosmos.orm.v1;
+
+import "google/protobuf/descriptor.proto";
+
+extend google.protobuf.MessageOptions {
+
+ // table specifies that this message will be used as an ORM table. It cannot
+ // be used together with the singleton option.
+ TableDescriptor table = 104503790;
+
+ // singleton specifies that this message will be used as an ORM singleton. It cannot
+ // be used together with the table option.
+ SingletonDescriptor singleton = 104503791;
+}
+
+// TableDescriptor describes an ORM table.
+message TableDescriptor {
+
+ // primary_key defines the primary key for the table.
+ PrimaryKeyDescriptor primary_key = 1;
+
+ // index defines one or more secondary indexes.
+ repeated SecondaryIndexDescriptor index = 2;
+
+ // id is a non-zero integer ID that must be unique within the
+ // tables and singletons in this file. It may be deprecated in the future when this
+ // can be auto-generated.
+ uint32 id = 3;
+}
+
+// PrimaryKeyDescriptor describes a table primary key.
+message PrimaryKeyDescriptor {
+
+ // fields is a comma-separated list of fields in the primary key. Spaces are
+ // not allowed. Supported field types, their encodings, and any applicable constraints
+ // are described below.
+ // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that
+ // is suitable for sorted iteration (not varint encoding). This type is
+ // well-suited for small integers.
+ // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that
+ // is suitable for sorted iteration (not varint encoding). This type is
+ // well-suited for small integers such as auto-incrementing sequences.
+ // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support
+ // sorted iteration. These types are well-suited for encoding fixed with
+ // decimals as integers.
+ // - string's are encoded as raw bytes in terminal key segments and null-terminated
+ // in non-terminal segments. Null characters are thus forbidden in strings.
+ // string fields support sorted iteration.
+ // - bytes are encoded as raw bytes in terminal segments and length-prefixed
+ // with a 32-bit unsigned varint in non-terminal segments.
+ // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with
+ // an encoding that enables sorted iteration.
+ // - google.protobuf.Timestamp and google.protobuf.Duration are encoded
+ // as 12 bytes using an encoding that enables sorted iteration.
+ // - enum fields are encoded using varint encoding and do not support sorted
+ // iteration.
+ // - bool fields are encoded as a single byte 0 or 1.
+ //
+ // All other fields types are unsupported in keys including repeated and
+ // oneof fields.
+ //
+ // Primary keys are prefixed by the varint encoded table id and the byte 0x0
+ // plus any additional prefix specified by the schema.
+ string fields = 1;
+
+ // auto_increment specifies that the primary key is generated by an
+ // auto-incrementing integer. If this is set to true fields must only
+ // contain one field of that is of type uint64.
+ bool auto_increment = 2;
+}
+
+// PrimaryKeyDescriptor describes a table secondary index.
+message SecondaryIndexDescriptor {
+
+ // fields is a comma-separated list of fields in the index. The supported
+ // field types are the same as those for PrimaryKeyDescriptor.fields.
+ // Index keys are prefixed by the varint encoded table id and the varint
+ // encoded index id plus any additional prefix specified by the schema.
+ //
+ // In addition the the field segments, non-unique index keys are suffixed with
+ // any additional primary key fields not present in the index fields so that the
+ // primary key can be reconstructed. Unique indexes instead of being suffixed
+ // store the remaining primary key fields in the value..
+ string fields = 1;
+
+ // id is a non-zero integer ID that must be unique within the indexes for this
+ // table and less than 32768. It may be deprecated in the future when this can
+ // be auto-generated.
+ uint32 id = 2;
+
+ // unique specifies that this an unique index.
+ bool unique = 3;
+}
+
+// TableDescriptor describes an ORM singleton table which has at most one instance.
+message SingletonDescriptor {
+
+ // id is a non-zero integer ID that must be unique within the
+ // tables and singletons in this file. It may be deprecated in the future when this
+ // can be auto-generated.
+ uint32 id = 1;
+}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/orm/v1alpha1/schema.proto b/examples/authz/proto/cosmos/orm/v1alpha1/schema.proto
new file mode 100644
index 00000000..ab713340
--- /dev/null
+++ b/examples/authz/proto/cosmos/orm/v1alpha1/schema.proto
@@ -0,0 +1,76 @@
+syntax = "proto3";
+
+package cosmos.orm.v1alpha1;
+
+import "google/protobuf/descriptor.proto";
+
+extend google.protobuf.MessageOptions {
+ // module_schema is used to define the ORM schema for an app module.
+ // All module config messages that use module_schema must also declare
+ // themselves as app module config messages using the cosmos.app.v1.is_module
+ // option.
+ ModuleSchemaDescriptor module_schema = 104503792;
+}
+
+// ModuleSchemaDescriptor describe's a module's ORM schema.
+message ModuleSchemaDescriptor {
+ repeated FileEntry schema_file = 1;
+
+ // FileEntry describes an ORM file used in a module.
+ message FileEntry {
+ // id is a prefix that will be varint encoded and prepended to all the
+ // table keys specified in the file's tables.
+ uint32 id = 1;
+
+ // proto_file_name is the name of a file .proto in that contains
+ // table definitions. The .proto file must be in a package that the
+ // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package.
+ string proto_file_name = 2;
+
+ // storage_type optionally indicates the type of storage this file's
+ // tables should used. If it is left unspecified, the default KV-storage
+ // of the app will be used.
+ StorageType storage_type = 3;
+ }
+
+ // prefix is an optional prefix that precedes all keys in this module's
+ // store.
+ bytes prefix = 2;
+}
+
+// StorageType
+enum StorageType {
+ // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent
+ // KV-storage where primary key entries are stored in merkle-tree
+ // backed commitment storage and indexes and seqs are stored in
+ // fast index storage. Note that the Cosmos SDK before store/v2alpha1
+ // does not support this.
+ STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0;
+
+ // STORAGE_TYPE_MEMORY indicates in-memory storage that will be
+ // reloaded every time an app restarts. Tables with this type of storage
+ // will by default be ignored when importing and exporting a module's
+ // state from JSON.
+ STORAGE_TYPE_MEMORY = 1;
+
+ // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset
+ // at the end of every block. Tables with this type of storage
+ // will by default be ignored when importing and exporting a module's
+ // state from JSON.
+ STORAGE_TYPE_TRANSIENT = 2;
+
+ // STORAGE_TYPE_INDEX indicates persistent storage which is not backed
+ // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK
+ // before store/v2alpha1 does not support this.
+ STORAGE_TYPE_INDEX = 3;
+
+ // STORAGE_TYPE_INDEX indicates persistent storage which is backed by
+ // a merkle-tree. With this type of storage, both primary and index keys
+ // will affect the app hash and this is generally less efficient
+ // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index
+ // keys into index storage. Note that modules built with the
+ // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT
+ // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX
+ // because this is the only type of persistent storage available.
+ STORAGE_TYPE_COMMITMENT = 4;
+}
diff --git a/examples/authz/proto/cosmos/params/v1beta1/params.proto b/examples/authz/proto/cosmos/params/v1beta1/params.proto
new file mode 100644
index 00000000..e5aabfec
--- /dev/null
+++ b/examples/authz/proto/cosmos/params/v1beta1/params.proto
@@ -0,0 +1,29 @@
+syntax = "proto3";
+package cosmos.params.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+
+// ParameterChangeProposal defines a proposal to change one or more parameters.
+message ParameterChangeProposal {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
+
+ string title = 1;
+ string description = 2;
+ repeated ParamChange changes = 3 [(gogoproto.nullable) = false];
+}
+
+// ParamChange defines an individual parameter change, for use in
+// ParameterChangeProposal.
+message ParamChange {
+ option (gogoproto.goproto_stringer) = false;
+
+ string subspace = 1;
+ string key = 2;
+ string value = 3;
+}
diff --git a/examples/authz/proto/cosmos/params/v1beta1/query.proto b/examples/authz/proto/cosmos/params/v1beta1/query.proto
new file mode 100644
index 00000000..3b1c9a76
--- /dev/null
+++ b/examples/authz/proto/cosmos/params/v1beta1/query.proto
@@ -0,0 +1,54 @@
+syntax = "proto3";
+package cosmos.params.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/params/v1beta1/params.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Params queries a specific parameter of a module, given its subspace and
+ // key.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/params/v1beta1/params";
+ }
+
+ // Subspaces queries for all registered subspaces and all keys for a subspace.
+ rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) {
+ option (google.api.http).get = "/cosmos/params/v1beta1/subspaces";
+ }
+}
+
+// QueryParamsRequest is request type for the Query/Params RPC method.
+message QueryParamsRequest {
+ // subspace defines the module to query the parameter for.
+ string subspace = 1;
+
+ // key defines the key of the parameter in the subspace.
+ string key = 2;
+}
+
+// QueryParamsResponse is response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // param defines the queried parameter.
+ ParamChange param = 1 [(gogoproto.nullable) = false];
+}
+
+// QuerySubspacesRequest defines a request type for querying for all registered
+// subspaces and all keys for a subspace.
+message QuerySubspacesRequest {}
+
+// QuerySubspacesResponse defines the response types for querying for all
+// registered subspaces and all keys for a subspace.
+message QuerySubspacesResponse {
+ repeated Subspace subspaces = 1;
+}
+
+// Subspace defines a parameter subspace name and all the keys that exist for
+// the subspace.
+message Subspace {
+ string subspace = 1;
+ repeated string keys = 2;
+}
diff --git a/examples/authz/proto/cosmos/slashing/v1beta1/genesis.proto b/examples/authz/proto/cosmos/slashing/v1beta1/genesis.proto
new file mode 100644
index 00000000..312d56aa
--- /dev/null
+++ b/examples/authz/proto/cosmos/slashing/v1beta1/genesis.proto
@@ -0,0 +1,47 @@
+syntax = "proto3";
+package cosmos.slashing.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
+
+import "gogoproto/gogo.proto";
+import "cosmos/slashing/v1beta1/slashing.proto";
+import "cosmos_proto/cosmos.proto";
+
+// GenesisState defines the slashing module's genesis state.
+message GenesisState {
+ // params defines all the paramaters of related to deposit.
+ Params params = 1 [(gogoproto.nullable) = false];
+
+ // signing_infos represents a map between validator addresses and their
+ // signing infos.
+ repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false];
+
+ // missed_blocks represents a map between validator addresses and their
+ // missed blocks.
+ repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false];
+}
+
+// SigningInfo stores validator signing info of corresponding address.
+message SigningInfo {
+ // address is the validator address.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // validator_signing_info represents the signing info of this validator.
+ ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false];
+}
+
+// ValidatorMissedBlocks contains array of missed blocks of corresponding
+// address.
+message ValidatorMissedBlocks {
+ // address is the validator address.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // missed_blocks is an array of missed blocks by the validator.
+ repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false];
+}
+
+// MissedBlock contains height and missed status as boolean.
+message MissedBlock {
+ // index is the height at which the block was missed.
+ int64 index = 1;
+ // missed is the missed status.
+ bool missed = 2;
+}
diff --git a/examples/authz/proto/cosmos/slashing/v1beta1/query.proto b/examples/authz/proto/cosmos/slashing/v1beta1/query.proto
new file mode 100644
index 00000000..f742c1f8
--- /dev/null
+++ b/examples/authz/proto/cosmos/slashing/v1beta1/query.proto
@@ -0,0 +1,64 @@
+syntax = "proto3";
+package cosmos.slashing.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/slashing/v1beta1/slashing.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
+
+// Query provides defines the gRPC querier service
+service Query {
+ // Params queries the parameters of slashing module
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/slashing/v1beta1/params";
+ }
+
+ // SigningInfo queries the signing info of given cons address
+ rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) {
+ option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}";
+ }
+
+ // SigningInfos queries signing info of all validators
+ rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) {
+ option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method
+message QueryParamsResponse {
+ Params params = 1 [(gogoproto.nullable) = false];
+}
+
+// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC
+// method
+message QuerySigningInfoRequest {
+ // cons_address is the address to query signing info of
+ string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC
+// method
+message QuerySigningInfoResponse {
+ // val_signing_info is the signing info of requested val cons address
+ ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false];
+}
+
+// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC
+// method
+message QuerySigningInfosRequest {
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC
+// method
+message QuerySigningInfosResponse {
+ // info is the signing info of all validators
+ repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false];
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
diff --git a/examples/authz/proto/cosmos/slashing/v1beta1/slashing.proto b/examples/authz/proto/cosmos/slashing/v1beta1/slashing.proto
new file mode 100644
index 00000000..0aa9f61f
--- /dev/null
+++ b/examples/authz/proto/cosmos/slashing/v1beta1/slashing.proto
@@ -0,0 +1,45 @@
+syntax = "proto3";
+package cosmos.slashing.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos_proto/cosmos.proto";
+
+// ValidatorSigningInfo defines a validator's signing info for monitoring their
+// liveness activity.
+message ValidatorSigningInfo {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // Height at which validator was first a candidate OR was unjailed
+ int64 start_height = 2;
+ // Index which is incremented each time the validator was a bonded
+ // in a block and may have signed a precommit or not. This in conjunction with the
+ // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`.
+ int64 index_offset = 3;
+ // Timestamp until which the validator is jailed due to liveness downtime.
+ google.protobuf.Timestamp jailed_until = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+ // Whether or not a validator has been tombstoned (killed out of validator set). It is set
+ // once the validator commits an equivocation or for any other configured misbehiavor.
+ bool tombstoned = 5;
+ // A counter kept to avoid unnecessary array reads.
+ // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`.
+ int64 missed_blocks_counter = 6;
+}
+
+// Params represents the parameters used for by the slashing module.
+message Params {
+ int64 signed_blocks_window = 1;
+ bytes min_signed_per_window = 2
+ [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
+ google.protobuf.Duration downtime_jail_duration = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
+ bytes slash_fraction_double_sign = 4
+ [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
+ bytes slash_fraction_downtime = 5
+ [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/slashing/v1beta1/tx.proto b/examples/authz/proto/cosmos/slashing/v1beta1/tx.proto
new file mode 100644
index 00000000..7c90304b
--- /dev/null
+++ b/examples/authz/proto/cosmos/slashing/v1beta1/tx.proto
@@ -0,0 +1,30 @@
+syntax = "proto3";
+package cosmos.slashing.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
+option (gogoproto.equal_all) = true;
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/msg/v1/msg.proto";
+
+// Msg defines the slashing Msg service.
+service Msg {
+ // Unjail defines a method for unjailing a jailed validator, thus returning
+ // them into the bonded validator set, so they can begin receiving provisions
+ // and rewards again.
+ rpc Unjail(MsgUnjail) returns (MsgUnjailResponse);
+}
+
+// MsgUnjail defines the Msg/Unjail request type
+message MsgUnjail {
+ option (cosmos.msg.v1.signer) = "validator_addr";
+
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = true;
+
+ string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "address"];
+}
+
+// MsgUnjailResponse defines the Msg/Unjail response type
+message MsgUnjailResponse {}
diff --git a/examples/authz/proto/cosmos/staking/v1beta1/authz.proto b/examples/authz/proto/cosmos/staking/v1beta1/authz.proto
new file mode 100644
index 00000000..677edaad
--- /dev/null
+++ b/examples/authz/proto/cosmos/staking/v1beta1/authz.proto
@@ -0,0 +1,47 @@
+syntax = "proto3";
+package cosmos.staking.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
+
+// StakeAuthorization defines authorization for delegate/undelegate/redelegate.
+//
+// Since: cosmos-sdk 0.43
+message StakeAuthorization {
+ option (cosmos_proto.implements_interface) = "Authorization";
+
+ // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is
+ // empty, there is no spend limit and any amount of coins can be delegated.
+ cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"];
+ // validators is the oneof that represents either allow_list or deny_list
+ oneof validators {
+ // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's
+ // account.
+ Validators allow_list = 2;
+ // deny_list specifies list of validator addresses to whom grantee can not delegate tokens.
+ Validators deny_list = 3;
+ }
+ // Validators defines list of validator addresses.
+ message Validators {
+ repeated string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ }
+ // authorization_type defines one of AuthorizationType.
+ AuthorizationType authorization_type = 4;
+}
+
+// AuthorizationType defines the type of staking module authorization type
+//
+// Since: cosmos-sdk 0.43
+enum AuthorizationType {
+ // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type
+ AUTHORIZATION_TYPE_UNSPECIFIED = 0;
+ // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate
+ AUTHORIZATION_TYPE_DELEGATE = 1;
+ // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate
+ AUTHORIZATION_TYPE_UNDELEGATE = 2;
+ // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate
+ AUTHORIZATION_TYPE_REDELEGATE = 3;
+}
diff --git a/examples/authz/proto/cosmos/staking/v1beta1/genesis.proto b/examples/authz/proto/cosmos/staking/v1beta1/genesis.proto
new file mode 100644
index 00000000..bf3c298e
--- /dev/null
+++ b/examples/authz/proto/cosmos/staking/v1beta1/genesis.proto
@@ -0,0 +1,49 @@
+syntax = "proto3";
+package cosmos.staking.v1beta1;
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
+
+import "gogoproto/gogo.proto";
+import "cosmos/staking/v1beta1/staking.proto";
+import "cosmos_proto/cosmos.proto";
+
+// GenesisState defines the staking module's genesis state.
+message GenesisState {
+ // params defines all the paramaters of related to deposit.
+ Params params = 1 [(gogoproto.nullable) = false];
+
+ // last_total_power tracks the total amounts of bonded tokens recorded during
+ // the previous end block.
+ bytes last_total_power = 2
+ [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false];
+
+ // last_validator_powers is a special index that provides a historical list
+ // of the last-block's bonded validators.
+ repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false];
+
+ // delegations defines the validator set at genesis.
+ repeated Validator validators = 4 [(gogoproto.nullable) = false];
+
+ // delegations defines the delegations active at genesis.
+ repeated Delegation delegations = 5 [(gogoproto.nullable) = false];
+
+ // unbonding_delegations defines the unbonding delegations active at genesis.
+ repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false];
+
+ // redelegations defines the redelegations active at genesis.
+ repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false];
+
+ bool exported = 8;
+}
+
+// LastValidatorPower required for validator set update logic.
+message LastValidatorPower {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // address is the address of the validator.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // power defines the power of the validator.
+ int64 power = 2;
+}
diff --git a/examples/authz/proto/cosmos/staking/v1beta1/query.proto b/examples/authz/proto/cosmos/staking/v1beta1/query.proto
new file mode 100644
index 00000000..02469232
--- /dev/null
+++ b/examples/authz/proto/cosmos/staking/v1beta1/query.proto
@@ -0,0 +1,349 @@
+syntax = "proto3";
+package cosmos.staking.v1beta1;
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/staking/v1beta1/staking.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Validators queries all validators that match the given status.
+ rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/validators";
+ }
+
+ // Validator queries validator info for given validator address.
+ rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}";
+ }
+
+ // ValidatorDelegations queries delegate info for given validator.
+ rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations";
+ }
+
+ // ValidatorUnbondingDelegations queries unbonding delegations of a validator.
+ rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest)
+ returns (QueryValidatorUnbondingDelegationsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/validators/"
+ "{validator_addr}/unbonding_delegations";
+ }
+
+ // Delegation queries delegate info for given validator delegator pair.
+ rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/"
+ "{delegator_addr}";
+ }
+
+ // UnbondingDelegation queries unbonding info for given validator delegator
+ // pair.
+ rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/"
+ "{delegator_addr}/unbonding_delegation";
+ }
+
+ // DelegatorDelegations queries all delegations of a given delegator address.
+ rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}";
+ }
+
+ // DelegatorUnbondingDelegations queries all unbonding delegations of a given
+ // delegator address.
+ rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest)
+ returns (QueryDelegatorUnbondingDelegationsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/"
+ "{delegator_addr}/unbonding_delegations";
+ }
+
+ // Redelegations queries redelegations of given address.
+ rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations";
+ }
+
+ // DelegatorValidators queries all validators info for given delegator
+ // address.
+ rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators";
+ }
+
+ // DelegatorValidator queries validator info for given delegator validator
+ // pair.
+ rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/"
+ "{validator_addr}";
+ }
+
+ // HistoricalInfo queries the historical info for given height.
+ rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}";
+ }
+
+ // Pool queries the pool info.
+ rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/pool";
+ }
+
+ // Parameters queries the staking parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/cosmos/staking/v1beta1/params";
+ }
+}
+
+// QueryValidatorsRequest is request type for Query/Validators RPC method.
+message QueryValidatorsRequest {
+ // status enables to query for validators matching a given status.
+ string status = 1;
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryValidatorsResponse is response type for the Query/Validators RPC method
+message QueryValidatorsResponse {
+ // validators contains all the queried validators.
+ repeated Validator validators = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryValidatorRequest is response type for the Query/Validator RPC method
+message QueryValidatorRequest {
+ // validator_addr defines the validator address to query for.
+ string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryValidatorResponse is response type for the Query/Validator RPC method
+message QueryValidatorResponse {
+ // validator defines the the validator info.
+ Validator validator = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryValidatorDelegationsRequest is request type for the
+// Query/ValidatorDelegations RPC method
+message QueryValidatorDelegationsRequest {
+ // validator_addr defines the validator address to query for.
+ string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryValidatorDelegationsResponse is response type for the
+// Query/ValidatorDelegations RPC method
+message QueryValidatorDelegationsResponse {
+ repeated DelegationResponse delegation_responses = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryValidatorUnbondingDelegationsRequest is required type for the
+// Query/ValidatorUnbondingDelegations RPC method
+message QueryValidatorUnbondingDelegationsRequest {
+ // validator_addr defines the validator address to query for.
+ string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryValidatorUnbondingDelegationsResponse is response type for the
+// Query/ValidatorUnbondingDelegations RPC method.
+message QueryValidatorUnbondingDelegationsResponse {
+ repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryDelegationRequest is request type for the Query/Delegation RPC method.
+message QueryDelegationRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_addr defines the delegator address to query for.
+ string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // validator_addr defines the validator address to query for.
+ string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDelegationResponse is response type for the Query/Delegation RPC method.
+message QueryDelegationResponse {
+ // delegation_responses defines the delegation info of a delegation.
+ DelegationResponse delegation_response = 1;
+}
+
+// QueryUnbondingDelegationRequest is request type for the
+// Query/UnbondingDelegation RPC method.
+message QueryUnbondingDelegationRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_addr defines the delegator address to query for.
+ string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // validator_addr defines the validator address to query for.
+ string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDelegationResponse is response type for the Query/UnbondingDelegation
+// RPC method.
+message QueryUnbondingDelegationResponse {
+ // unbond defines the unbonding information of a delegation.
+ UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryDelegatorDelegationsRequest is request type for the
+// Query/DelegatorDelegations RPC method.
+message QueryDelegatorDelegationsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_addr defines the delegator address to query for.
+ string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryDelegatorDelegationsResponse is response type for the
+// Query/DelegatorDelegations RPC method.
+message QueryDelegatorDelegationsResponse {
+ // delegation_responses defines all the delegations' info of a delegator.
+ repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryDelegatorUnbondingDelegationsRequest is request type for the
+// Query/DelegatorUnbondingDelegations RPC method.
+message QueryDelegatorUnbondingDelegationsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_addr defines the delegator address to query for.
+ string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryUnbondingDelegatorDelegationsResponse is response type for the
+// Query/UnbondingDelegatorDelegations RPC method.
+message QueryDelegatorUnbondingDelegationsResponse {
+ repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryRedelegationsRequest is request type for the Query/Redelegations RPC
+// method.
+message QueryRedelegationsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_addr defines the delegator address to query for.
+ string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // src_validator_addr defines the validator address to redelegate from.
+ string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // dst_validator_addr defines the validator address to redelegate to.
+ string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 4;
+}
+
+// QueryRedelegationsResponse is response type for the Query/Redelegations RPC
+// method.
+message QueryRedelegationsResponse {
+ repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryDelegatorValidatorsRequest is request type for the
+// Query/DelegatorValidators RPC method.
+message QueryDelegatorValidatorsRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_addr defines the delegator address to query for.
+ string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryDelegatorValidatorsResponse is response type for the
+// Query/DelegatorValidators RPC method.
+message QueryDelegatorValidatorsResponse {
+ // validators defines the the validators' info of a delegator.
+ repeated Validator validators = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryDelegatorValidatorRequest is request type for the
+// Query/DelegatorValidator RPC method.
+message QueryDelegatorValidatorRequest {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // delegator_addr defines the delegator address to query for.
+ string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // validator_addr defines the validator address to query for.
+ string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// QueryDelegatorValidatorResponse response type for the
+// Query/DelegatorValidator RPC method.
+message QueryDelegatorValidatorResponse {
+ // validator defines the the validator info.
+ Validator validator = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC
+// method.
+message QueryHistoricalInfoRequest {
+ // height defines at which height to query the historical info.
+ int64 height = 1;
+}
+
+// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC
+// method.
+message QueryHistoricalInfoResponse {
+ // hist defines the historical info at the given height.
+ HistoricalInfo hist = 1;
+}
+
+// QueryPoolRequest is request type for the Query/Pool RPC method.
+message QueryPoolRequest {}
+
+// QueryPoolResponse is response type for the Query/Pool RPC method.
+message QueryPoolResponse {
+ // pool defines the pool info.
+ Pool pool = 1 [(gogoproto.nullable) = false];
+}
+
+// QueryParamsRequest is request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params holds all the parameters of this module.
+ Params params = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/cosmos/staking/v1beta1/staking.proto b/examples/authz/proto/cosmos/staking/v1beta1/staking.proto
new file mode 100644
index 00000000..dcf2645f
--- /dev/null
+++ b/examples/authz/proto/cosmos/staking/v1beta1/staking.proto
@@ -0,0 +1,358 @@
+syntax = "proto3";
+package cosmos.staking.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "tendermint/types/types.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
+
+// HistoricalInfo contains header and validator information for a given block.
+// It is stored as part of staking module's state, which persists the `n` most
+// recent HistoricalInfo
+// (`n` is set by the staking module's `historical_entries` parameter).
+message HistoricalInfo {
+ tendermint.types.Header header = 1 [(gogoproto.nullable) = false];
+ repeated Validator valset = 2 [(gogoproto.nullable) = false];
+}
+
+// CommissionRates defines the initial commission rates to be used for creating
+// a validator.
+message CommissionRates {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ // rate is the commission rate charged to delegators, as a fraction.
+ string rate = 1 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
+ string max_rate = 2 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
+ string max_change_rate = 3 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// Commission defines commission parameters for a given validator.
+message Commission {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ // commission_rates defines the initial commission rates to be used for creating a validator.
+ CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
+ // update_time is the last time the commission rate was changed.
+ google.protobuf.Timestamp update_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
+
+// Description defines a validator description.
+message Description {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ // moniker defines a human-readable name for the validator.
+ string moniker = 1;
+ // identity defines an optional identity signature (ex. UPort or Keybase).
+ string identity = 2;
+ // website defines an optional website link.
+ string website = 3;
+ // security_contact defines an optional email for security contact.
+ string security_contact = 4;
+ // details define other optional details.
+ string details = 5;
+}
+
+// Validator defines a validator, together with the total amount of the
+// Validator's bond shares and their exchange rate to coins. Slashing results in
+// a decrease in the exchange rate, allowing correct calculation of future
+// undelegations without iterating over delegators. When coins are delegated to
+// this validator, the validator is credited with a delegation whose number of
+// bond shares is based on the amount of coins delegated divided by the current
+// exchange rate. Voting power can be calculated as total bonded shares
+// multiplied by exchange rate.
+message Validator {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // operator_address defines the address of the validator's operator; bech encoded in JSON.
+ string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
+ google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
+ // jailed defined whether the validator has been jailed from bonded status or not.
+ bool jailed = 3;
+ // status is the validator status (bonded/unbonding/unbonded).
+ BondStatus status = 4;
+ // tokens define the delegated tokens (incl. self-delegation).
+ string tokens = 5 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+ // delegator_shares defines total shares issued to a validator's delegators.
+ string delegator_shares = 6 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // description defines the description terms for the validator.
+ Description description = 7 [(gogoproto.nullable) = false];
+ // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
+ int64 unbonding_height = 8;
+ // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
+ google.protobuf.Timestamp unbonding_time = 9 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ // commission defines the commission parameters.
+ Commission commission = 10 [(gogoproto.nullable) = false];
+ // min_self_delegation is the validator's self declared minimum self delegation.
+ string min_self_delegation = 11 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// BondStatus is the status of a validator.
+enum BondStatus {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // UNSPECIFIED defines an invalid validator status.
+ BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"];
+ // UNBONDED defines a validator that is not bonded.
+ BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"];
+ // UNBONDING defines a validator that is unbonding.
+ BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"];
+ // BONDED defines a validator that is bonded.
+ BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"];
+}
+
+// ValAddresses defines a repeated set of validator addresses.
+message ValAddresses {
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.stringer) = true;
+
+ repeated string addresses = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// DVPair is struct that just has a delegator-validator pair with no other data.
+// It is intended to be used as a marshalable pointer. For example, a DVPair can
+// be used to construct the key to getting an UnbondingDelegation from state.
+message DVPair {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// DVPairs defines an array of DVPair objects.
+message DVPairs {
+ repeated DVPair pairs = 1 [(gogoproto.nullable) = false];
+}
+
+// DVVTriplet is struct that just has a delegator-validator-validator triplet
+// with no other data. It is intended to be used as a marshalable pointer. For
+// example, a DVVTriplet can be used to construct the key to getting a
+// Redelegation from state.
+message DVVTriplet {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// DVVTriplets defines an array of DVVTriplet objects.
+message DVVTriplets {
+ repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false];
+}
+
+// Delegation represents the bond with tokens held by an account. It is
+// owned by one delegator, and is associated with the voting power of one
+// validator.
+message Delegation {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ // delegator_address is the bech32-encoded address of the delegator.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // validator_address is the bech32-encoded address of the validator.
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // shares define the delegation shares received.
+ string shares = 3 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// UnbondingDelegation stores all of a single delegator's unbonding bonds
+// for a single validator in an time-ordered list.
+message UnbondingDelegation {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ // delegator_address is the bech32-encoded address of the delegator.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // validator_address is the bech32-encoded address of the validator.
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // entries are the unbonding delegation entries.
+ repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries
+}
+
+// UnbondingDelegationEntry defines an unbonding object with relevant metadata.
+message UnbondingDelegationEntry {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ // creation_height is the height which the unbonding took place.
+ int64 creation_height = 1;
+ // completion_time is the unix time for unbonding completion.
+ google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ // initial_balance defines the tokens initially scheduled to receive at completion.
+ string initial_balance = 3 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+ // balance defines the tokens to receive at completion.
+ string balance = 4 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// RedelegationEntry defines a redelegation object with relevant metadata.
+message RedelegationEntry {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ // creation_height defines the height which the redelegation took place.
+ int64 creation_height = 1;
+ // completion_time defines the unix time for redelegation completion.
+ google.protobuf.Timestamp completion_time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ // initial_balance defines the initial balance when redelegation started.
+ string initial_balance = 3 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+ // shares_dst is the amount of destination-validator shares created by redelegation.
+ string shares_dst = 4 [
+ (cosmos_proto.scalar) = "cosmos.Dec",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// Redelegation contains the list of a particular delegator's redelegating bonds
+// from a particular source validator to a particular destination validator.
+message Redelegation {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ // delegator_address is the bech32-encoded address of the delegator.
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // validator_src_address is the validator redelegation source operator address.
+ string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // validator_dst_address is the validator redelegation destination operator address.
+ string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // entries are the redelegation entries.
+ repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries
+}
+
+// Params defines the parameters for the staking module.
+message Params {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ // unbonding_time is the time duration of unbonding.
+ google.protobuf.Duration unbonding_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
+ // max_validators is the maximum number of validators.
+ uint32 max_validators = 2;
+ // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio).
+ uint32 max_entries = 3;
+ // historical_entries is the number of historical entries to persist.
+ uint32 historical_entries = 4;
+ // bond_denom defines the bondable coin denomination.
+ string bond_denom = 5;
+ // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators
+ string min_commission_rate = 6 [
+ (gogoproto.moretags) = "yaml:\"min_commission_rate\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// DelegationResponse is equivalent to Delegation except that it contains a
+// balance in addition to shares which is more suitable for client responses.
+message DelegationResponse {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ Delegation delegation = 1 [(gogoproto.nullable) = false];
+
+ cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false];
+}
+
+// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
+// contains a balance in addition to shares which is more suitable for client
+// responses.
+message RedelegationEntryResponse {
+ option (gogoproto.equal) = true;
+
+ RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false];
+ string balance = 4 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// RedelegationResponse is equivalent to a Redelegation except that its entries
+// contain a balance in addition to shares which is more suitable for client
+// responses.
+message RedelegationResponse {
+ option (gogoproto.equal) = false;
+
+ Redelegation redelegation = 1 [(gogoproto.nullable) = false];
+ repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false];
+}
+
+// Pool is used for tracking bonded and not-bonded token supply of the bond
+// denomination.
+message Pool {
+ option (gogoproto.description) = true;
+ option (gogoproto.equal) = true;
+ string not_bonded_tokens = 1 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "not_bonded_tokens"
+ ];
+ string bonded_tokens = 2 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "bonded_tokens"
+ ];
+}
diff --git a/examples/authz/proto/cosmos/staking/v1beta1/tx.proto b/examples/authz/proto/cosmos/staking/v1beta1/tx.proto
new file mode 100644
index 00000000..6c8d40a7
--- /dev/null
+++ b/examples/authz/proto/cosmos/staking/v1beta1/tx.proto
@@ -0,0 +1,138 @@
+syntax = "proto3";
+package cosmos.staking.v1beta1;
+
+import "google/protobuf/any.proto";
+import "google/protobuf/timestamp.proto";
+import "gogoproto/gogo.proto";
+
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/staking/v1beta1/staking.proto";
+
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
+
+// Msg defines the staking Msg service.
+service Msg {
+ // CreateValidator defines a method for creating a new validator.
+ rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse);
+
+ // EditValidator defines a method for editing an existing validator.
+ rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse);
+
+ // Delegate defines a method for performing a delegation of coins
+ // from a delegator to a validator.
+ rpc Delegate(MsgDelegate) returns (MsgDelegateResponse);
+
+ // BeginRedelegate defines a method for performing a redelegation
+ // of coins from a delegator and source validator to a destination validator.
+ rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse);
+
+ // Undelegate defines a method for performing an undelegation from a
+ // delegate and a validator.
+ rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse);
+}
+
+// MsgCreateValidator defines a SDK message for creating a new validator.
+message MsgCreateValidator {
+ // NOTE(fdymylja): this is a particular case in which
+ // if validator_address == delegator_address then only one
+ // is expected to sign, otherwise both are.
+ option (cosmos.msg.v1.signer) = "delegator_address";
+ option (cosmos.msg.v1.signer) = "validator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ Description description = 1 [(gogoproto.nullable) = false];
+ CommissionRates commission = 2 [(gogoproto.nullable) = false];
+ string min_self_delegation = 3 [
+ (cosmos_proto.scalar) = "cosmos.Int",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+ string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
+ cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false];
+}
+
+// MsgCreateValidatorResponse defines the Msg/CreateValidator response type.
+message MsgCreateValidatorResponse {}
+
+// MsgEditValidator defines a SDK message for editing an existing validator.
+message MsgEditValidator {
+ option (cosmos.msg.v1.signer) = "validator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ Description description = 1 [(gogoproto.nullable) = false];
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // We pass a reference to the new commission rate and min self delegation as
+ // it's not mandatory to update. If not updated, the deserialized rate will be
+ // zero with no way to distinguish if an update was intended.
+ // REF: #2373
+ string commission_rate = 3
+ [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"];
+ string min_self_delegation = 4
+ [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"];
+}
+
+// MsgEditValidatorResponse defines the Msg/EditValidator response type.
+message MsgEditValidatorResponse {}
+
+// MsgDelegate defines a SDK message for performing a delegation of coins
+// from a delegator to a validator.
+message MsgDelegate {
+ option (cosmos.msg.v1.signer) = "delegator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
+}
+
+// MsgDelegateResponse defines the Msg/Delegate response type.
+message MsgDelegateResponse {}
+
+// MsgBeginRedelegate defines a SDK message for performing a redelegation
+// of coins from a delegator and source validator to a destination validator.
+message MsgBeginRedelegate {
+ option (cosmos.msg.v1.signer) = "delegator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false];
+}
+
+// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type.
+message MsgBeginRedelegateResponse {
+ google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
+
+// MsgUndelegate defines a SDK message for performing an undelegation from a
+// delegate and a validator.
+message MsgUndelegate {
+ option (cosmos.msg.v1.signer) = "delegator_address";
+
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
+}
+
+// MsgUndelegateResponse defines the Msg/Undelegate response type.
+message MsgUndelegateResponse {
+ google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
diff --git a/examples/authz/proto/cosmos/tx/signing/v1beta1/signing.proto b/examples/authz/proto/cosmos/tx/signing/v1beta1/signing.proto
new file mode 100644
index 00000000..5a22616f
--- /dev/null
+++ b/examples/authz/proto/cosmos/tx/signing/v1beta1/signing.proto
@@ -0,0 +1,94 @@
+syntax = "proto3";
+package cosmos.tx.signing.v1beta1;
+
+import "cosmos/crypto/multisig/v1beta1/multisig.proto";
+import "google/protobuf/any.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing";
+
+// SignMode represents a signing mode with its own security guarantees.
+//
+// This enum should be considered a registry of all known sign modes
+// in the Cosmos ecosystem. Apps are not expected to support all known
+// sign modes. Apps that would like to support custom sign modes are
+// encouraged to open a small PR against this file to add a new case
+// to this SignMode enum describing their sign mode so that different
+// apps have a consistent version of this enum.
+enum SignMode {
+ // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
+ // rejected.
+ SIGN_MODE_UNSPECIFIED = 0;
+
+ // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
+ // verified with raw bytes from Tx.
+ SIGN_MODE_DIRECT = 1;
+
+ // SIGN_MODE_TEXTUAL is a future signing mode that will verify some
+ // human-readable textual representation on top of the binary representation
+ // from SIGN_MODE_DIRECT. It is currently not supported.
+ SIGN_MODE_TEXTUAL = 2;
+
+ // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
+ // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
+ // require signers signing over other signers' `signer_info`. It also allows
+ // for adding Tips in transactions.
+ //
+ // Since: cosmos-sdk 0.46
+ SIGN_MODE_DIRECT_AUX = 3;
+
+ // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
+ // Amino JSON and will be removed in the future.
+ SIGN_MODE_LEGACY_AMINO_JSON = 127;
+}
+
+// SignatureDescriptors wraps multiple SignatureDescriptor's.
+message SignatureDescriptors {
+ // signatures are the signature descriptors
+ repeated SignatureDescriptor signatures = 1;
+}
+
+// SignatureDescriptor is a convenience type which represents the full data for
+// a signature including the public key of the signer, signing modes and the
+// signature itself. It is primarily used for coordinating signatures between
+// clients.
+message SignatureDescriptor {
+ // public_key is the public key of the signer
+ google.protobuf.Any public_key = 1;
+
+ Data data = 2;
+
+ // sequence is the sequence of the account, which describes the
+ // number of committed transactions signed by a given address. It is used to prevent
+ // replay attacks.
+ uint64 sequence = 3;
+
+ // Data represents signature data
+ message Data {
+ // sum is the oneof that specifies whether this represents single or multi-signature data
+ oneof sum {
+ // single represents a single signer
+ Single single = 1;
+
+ // multi represents a multisig signer
+ Multi multi = 2;
+ }
+
+ // Single is the signature data for a single signer
+ message Single {
+ // mode is the signing mode of the single signer
+ SignMode mode = 1;
+
+ // signature is the raw signature bytes
+ bytes signature = 2;
+ }
+
+ // Multi is the signature data for a multisig public key
+ message Multi {
+ // bitarray specifies which keys within the multisig are signing
+ cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1;
+
+ // signatures is the signatures of the multi-signature
+ repeated Data signatures = 2;
+ }
+ }
+}
diff --git a/examples/authz/proto/cosmos/tx/v1beta1/service.proto b/examples/authz/proto/cosmos/tx/v1beta1/service.proto
new file mode 100644
index 00000000..e7af1526
--- /dev/null
+++ b/examples/authz/proto/cosmos/tx/v1beta1/service.proto
@@ -0,0 +1,163 @@
+syntax = "proto3";
+package cosmos.tx.v1beta1;
+
+import "google/api/annotations.proto";
+import "cosmos/base/abci/v1beta1/abci.proto";
+import "cosmos/tx/v1beta1/tx.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "tendermint/types/block.proto";
+import "tendermint/types/types.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/types/tx";
+
+// Service defines a gRPC service for interacting with transactions.
+service Service {
+ // Simulate simulates executing a transaction for estimating gas usage.
+ rpc Simulate(SimulateRequest) returns (SimulateResponse) {
+ option (google.api.http) = {
+ post: "/cosmos/tx/v1beta1/simulate"
+ body: "*"
+ };
+ }
+ // GetTx fetches a tx by hash.
+ rpc GetTx(GetTxRequest) returns (GetTxResponse) {
+ option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}";
+ }
+ // BroadcastTx broadcast transaction.
+ rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) {
+ option (google.api.http) = {
+ post: "/cosmos/tx/v1beta1/txs"
+ body: "*"
+ };
+ }
+ // GetTxsEvent fetches txs by event.
+ rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) {
+ option (google.api.http).get = "/cosmos/tx/v1beta1/txs";
+ }
+ // GetBlockWithTxs fetches a block with decoded txs.
+ //
+ // Since: cosmos-sdk 0.45.2
+ rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) {
+ option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}";
+ }
+}
+
+// GetTxsEventRequest is the request type for the Service.TxsByEvents
+// RPC method.
+message GetTxsEventRequest {
+ // events is the list of transaction event type.
+ repeated string events = 1;
+ // pagination defines a pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+ OrderBy order_by = 3;
+}
+
+// OrderBy defines the sorting order
+enum OrderBy {
+ // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case.
+ ORDER_BY_UNSPECIFIED = 0;
+ // ORDER_BY_ASC defines ascending order
+ ORDER_BY_ASC = 1;
+ // ORDER_BY_DESC defines descending order
+ ORDER_BY_DESC = 2;
+}
+
+// GetTxsEventResponse is the response type for the Service.TxsByEvents
+// RPC method.
+message GetTxsEventResponse {
+ // txs is the list of queried transactions.
+ repeated cosmos.tx.v1beta1.Tx txs = 1;
+ // tx_responses is the list of queried TxResponses.
+ repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2;
+ // pagination defines a pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 3;
+}
+
+// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest
+// RPC method.
+message BroadcastTxRequest {
+ // tx_bytes is the raw transaction.
+ bytes tx_bytes = 1;
+ BroadcastMode mode = 2;
+}
+
+// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method.
+enum BroadcastMode {
+ // zero-value for mode ordering
+ BROADCAST_MODE_UNSPECIFIED = 0;
+ // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for
+ // the tx to be committed in a block.
+ BROADCAST_MODE_BLOCK = 1;
+ // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for
+ // a CheckTx execution response only.
+ BROADCAST_MODE_SYNC = 2;
+ // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns
+ // immediately.
+ BROADCAST_MODE_ASYNC = 3;
+}
+
+// BroadcastTxResponse is the response type for the
+// Service.BroadcastTx method.
+message BroadcastTxResponse {
+ // tx_response is the queried TxResponses.
+ cosmos.base.abci.v1beta1.TxResponse tx_response = 1;
+}
+
+// SimulateRequest is the request type for the Service.Simulate
+// RPC method.
+message SimulateRequest {
+ // tx is the transaction to simulate.
+ // Deprecated. Send raw tx bytes instead.
+ cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true];
+ // tx_bytes is the raw transaction.
+ //
+ // Since: cosmos-sdk 0.43
+ bytes tx_bytes = 2;
+}
+
+// SimulateResponse is the response type for the
+// Service.SimulateRPC method.
+message SimulateResponse {
+ // gas_info is the information about gas used in the simulation.
+ cosmos.base.abci.v1beta1.GasInfo gas_info = 1;
+ // result is the result of the simulation.
+ cosmos.base.abci.v1beta1.Result result = 2;
+}
+
+// GetTxRequest is the request type for the Service.GetTx
+// RPC method.
+message GetTxRequest {
+ // hash is the tx hash to query, encoded as a hex string.
+ string hash = 1;
+}
+
+// GetTxResponse is the response type for the Service.GetTx method.
+message GetTxResponse {
+ // tx is the queried transaction.
+ cosmos.tx.v1beta1.Tx tx = 1;
+ // tx_response is the queried TxResponses.
+ cosmos.base.abci.v1beta1.TxResponse tx_response = 2;
+}
+
+// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs
+// RPC method.
+//
+// Since: cosmos-sdk 0.45.2
+message GetBlockWithTxsRequest {
+ // height is the height of the block to query.
+ int64 height = 1;
+ // pagination defines a pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method.
+//
+// Since: cosmos-sdk 0.45.2
+message GetBlockWithTxsResponse {
+ // txs are the transactions in the block.
+ repeated cosmos.tx.v1beta1.Tx txs = 1;
+ .tendermint.types.BlockID block_id = 2;
+ .tendermint.types.Block block = 3;
+ // pagination defines a pagination for the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 4;
+}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/tx/v1beta1/tx.proto b/examples/authz/proto/cosmos/tx/v1beta1/tx.proto
new file mode 100644
index 00000000..ac7b690f
--- /dev/null
+++ b/examples/authz/proto/cosmos/tx/v1beta1/tx.proto
@@ -0,0 +1,249 @@
+syntax = "proto3";
+package cosmos.tx.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/crypto/multisig/v1beta1/multisig.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/tx/signing/v1beta1/signing.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/types/tx";
+
+// Tx is the standard type used for broadcasting transactions.
+message Tx {
+ // body is the processable content of the transaction
+ TxBody body = 1;
+
+ // auth_info is the authorization related content of the transaction,
+ // specifically signers, signer modes and fee
+ AuthInfo auth_info = 2;
+
+ // signatures is a list of signatures that matches the length and order of
+ // AuthInfo's signer_infos to allow connecting signature meta information like
+ // public key and signing mode by position.
+ repeated bytes signatures = 3;
+}
+
+// TxRaw is a variant of Tx that pins the signer's exact binary representation
+// of body and auth_info. This is used for signing, broadcasting and
+// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and
+// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used
+// as the transaction ID.
+message TxRaw {
+ // body_bytes is a protobuf serialization of a TxBody that matches the
+ // representation in SignDoc.
+ bytes body_bytes = 1;
+
+ // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
+ // representation in SignDoc.
+ bytes auth_info_bytes = 2;
+
+ // signatures is a list of signatures that matches the length and order of
+ // AuthInfo's signer_infos to allow connecting signature meta information like
+ // public key and signing mode by position.
+ repeated bytes signatures = 3;
+}
+
+// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT.
+message SignDoc {
+ // body_bytes is protobuf serialization of a TxBody that matches the
+ // representation in TxRaw.
+ bytes body_bytes = 1;
+
+ // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
+ // representation in TxRaw.
+ bytes auth_info_bytes = 2;
+
+ // chain_id is the unique identifier of the chain this transaction targets.
+ // It prevents signed transactions from being used on another chain by an
+ // attacker
+ string chain_id = 3;
+
+ // account_number is the account number of the account in state
+ uint64 account_number = 4;
+}
+
+// SignDocDirectAux is the type used for generating sign bytes for
+// SIGN_MODE_DIRECT_AUX.
+//
+// Since: cosmos-sdk 0.46
+message SignDocDirectAux {
+ // body_bytes is protobuf serialization of a TxBody that matches the
+ // representation in TxRaw.
+ bytes body_bytes = 1;
+
+ // public_key is the public key of the signing account.
+ google.protobuf.Any public_key = 2;
+
+ // chain_id is the identifier of the chain this transaction targets.
+ // It prevents signed transactions from being used on another chain by an
+ // attacker.
+ string chain_id = 3;
+
+ // account_number is the account number of the account in state.
+ uint64 account_number = 4;
+
+ // sequence is the sequence number of the signing account.
+ uint64 sequence = 5;
+
+ // Tip is the optional tip used for meta-transactions. It should be left
+ // empty if the signer is not the tipper for this transaction.
+ Tip tip = 6;
+}
+
+// TxBody is the body of a transaction that all signers sign over.
+message TxBody {
+ // messages is a list of messages to be executed. The required signers of
+ // those messages define the number and order of elements in AuthInfo's
+ // signer_infos and Tx's signatures. Each required signer address is added to
+ // the list only the first time it occurs.
+ // By convention, the first required signer (usually from the first message)
+ // is referred to as the primary signer and pays the fee for the whole
+ // transaction.
+ repeated google.protobuf.Any messages = 1;
+
+ // memo is any arbitrary note/comment to be added to the transaction.
+ // WARNING: in clients, any publicly exposed text should not be called memo,
+ // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122).
+ string memo = 2;
+
+ // timeout is the block height after which this transaction will not
+ // be processed by the chain
+ uint64 timeout_height = 3;
+
+ // extension_options are arbitrary options that can be added by chains
+ // when the default options are not sufficient. If any of these are present
+ // and can't be handled, the transaction will be rejected
+ repeated google.protobuf.Any extension_options = 1023;
+
+ // extension_options are arbitrary options that can be added by chains
+ // when the default options are not sufficient. If any of these are present
+ // and can't be handled, they will be ignored
+ repeated google.protobuf.Any non_critical_extension_options = 2047;
+}
+
+// AuthInfo describes the fee and signer modes that are used to sign a
+// transaction.
+message AuthInfo {
+ // signer_infos defines the signing modes for the required signers. The number
+ // and order of elements must match the required signers from TxBody's
+ // messages. The first element is the primary signer and the one which pays
+ // the fee.
+ repeated SignerInfo signer_infos = 1;
+
+ // Fee is the fee and gas limit for the transaction. The first signer is the
+ // primary signer and the one which pays the fee. The fee can be calculated
+ // based on the cost of evaluating the body and doing signature verification
+ // of the signers. This can be estimated via simulation.
+ Fee fee = 2;
+
+ // Tip is the optional tip used for meta-transactions.
+ //
+ // Since: cosmos-sdk 0.46
+ Tip tip = 3;
+}
+
+// SignerInfo describes the public key and signing mode of a single top-level
+// signer.
+message SignerInfo {
+ // public_key is the public key of the signer. It is optional for accounts
+ // that already exist in state. If unset, the verifier can use the required \
+ // signer address for this position and lookup the public key.
+ google.protobuf.Any public_key = 1;
+
+ // mode_info describes the signing mode of the signer and is a nested
+ // structure to support nested multisig pubkey's
+ ModeInfo mode_info = 2;
+
+ // sequence is the sequence of the account, which describes the
+ // number of committed transactions signed by a given address. It is used to
+ // prevent replay attacks.
+ uint64 sequence = 3;
+}
+
+// ModeInfo describes the signing mode of a single or nested multisig signer.
+message ModeInfo {
+ // sum is the oneof that specifies whether this represents a single or nested
+ // multisig signer
+ oneof sum {
+ // single represents a single signer
+ Single single = 1;
+
+ // multi represents a nested multisig signer
+ Multi multi = 2;
+ }
+
+ // Single is the mode info for a single signer. It is structured as a message
+ // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
+ // future
+ message Single {
+ // mode is the signing mode of the single signer
+ cosmos.tx.signing.v1beta1.SignMode mode = 1;
+ }
+
+ // Multi is the mode info for a multisig public key
+ message Multi {
+ // bitarray specifies which keys within the multisig are signing
+ cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1;
+
+ // mode_infos is the corresponding modes of the signers of the multisig
+ // which could include nested multisig public keys
+ repeated ModeInfo mode_infos = 2;
+ }
+}
+
+// Fee includes the amount of coins paid in fees and the maximum
+// gas to be used by the transaction. The ratio yields an effective "gasprice",
+// which must be above some miminum to be accepted into the mempool.
+message Fee {
+ // amount is the amount of coins to be paid as a fee
+ repeated cosmos.base.v1beta1.Coin amount = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ // gas_limit is the maximum gas that can be used in transaction processing
+ // before an out of gas error occurs
+ uint64 gas_limit = 2;
+
+ // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees.
+ // the payer must be a tx signer (and thus have signed this field in AuthInfo).
+ // setting this field does *not* change the ordering of required signers for the transaction.
+ string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used
+ // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does
+ // not support fee grants, this will fail
+ string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// Tip is the tip used for meta-transactions.
+//
+// Since: cosmos-sdk 0.46
+message Tip {
+ // amount is the amount of the tip
+ repeated cosmos.base.v1beta1.Coin amount = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+ // tipper is the address of the account paying for the tip
+ string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a
+// tipper) builds and sends to the fee payer (who will build and broadcast the
+// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected
+// by the node if sent directly as-is.
+//
+// Since: cosmos-sdk 0.46
+message AuxSignerData {
+ // address is the bech32-encoded address of the auxiliary signer. If using
+ // AuxSignerData across different chains, the bech32 prefix of the target
+ // chain (where the final transaction is broadcasted) should be used.
+ string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer
+ // signs. Note: we use the same sign doc even if we're signing with
+ // LEGACY_AMINO_JSON.
+ SignDocDirectAux sign_doc = 2;
+ // mode is the signing mode of the single signer
+ cosmos.tx.signing.v1beta1.SignMode mode = 3;
+ // sig is the signature of the sign doc.
+ bytes sig = 4;
+}
diff --git a/examples/authz/proto/cosmos/upgrade/v1beta1/query.proto b/examples/authz/proto/cosmos/upgrade/v1beta1/query.proto
new file mode 100644
index 00000000..e8c4baa0
--- /dev/null
+++ b/examples/authz/proto/cosmos/upgrade/v1beta1/query.proto
@@ -0,0 +1,120 @@
+syntax = "proto3";
+package cosmos.upgrade.v1beta1;
+
+import "google/api/annotations.proto";
+import "cosmos/upgrade/v1beta1/upgrade.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types";
+
+// Query defines the gRPC upgrade querier service.
+service Query {
+ // CurrentPlan queries the current upgrade plan.
+ rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) {
+ option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan";
+ }
+
+ // AppliedPlan queries a previously applied upgrade plan by its name.
+ rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) {
+ option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}";
+ }
+
+ // UpgradedConsensusState queries the consensus state that will serve
+ // as a trusted kernel for the next version of this chain. It will only be
+ // stored at the last height of this chain.
+ // UpgradedConsensusState RPC not supported with legacy querier
+ // This rpc is deprecated now that IBC has its own replacement
+ // (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54)
+ rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) {
+ option deprecated = true;
+ option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}";
+ }
+
+ // ModuleVersions queries the list of module versions from state.
+ //
+ // Since: cosmos-sdk 0.43
+ rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) {
+ option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions";
+ }
+
+ // Returns the account with authority to conduct upgrades
+ rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) {
+ option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority";
+ }
+}
+
+// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC
+// method.
+message QueryCurrentPlanRequest {}
+
+// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC
+// method.
+message QueryCurrentPlanResponse {
+ // plan is the current upgrade plan.
+ Plan plan = 1;
+}
+
+// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC
+// method.
+message QueryAppliedPlanRequest {
+ // name is the name of the applied plan to query for.
+ string name = 1;
+}
+
+// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC
+// method.
+message QueryAppliedPlanResponse {
+ // height is the block height at which the plan was applied.
+ int64 height = 1;
+}
+
+// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState
+// RPC method.
+message QueryUpgradedConsensusStateRequest {
+ option deprecated = true;
+
+ // last height of the current chain must be sent in request
+ // as this is the height under which next consensus state is stored
+ int64 last_height = 1;
+}
+
+// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState
+// RPC method.
+message QueryUpgradedConsensusStateResponse {
+ option deprecated = true;
+ reserved 1;
+
+ // Since: cosmos-sdk 0.43
+ bytes upgraded_consensus_state = 2;
+}
+
+// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions
+// RPC method.
+//
+// Since: cosmos-sdk 0.43
+message QueryModuleVersionsRequest {
+ // module_name is a field to query a specific module
+ // consensus version from state. Leaving this empty will
+ // fetch the full list of module versions from state
+ string module_name = 1;
+}
+
+// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions
+// RPC method.
+//
+// Since: cosmos-sdk 0.43
+message QueryModuleVersionsResponse {
+ // module_versions is a list of module names with their consensus versions.
+ repeated ModuleVersion module_versions = 1;
+}
+
+// QueryAuthorityRequest is the request type for Query/Authority
+//
+// Since: cosmos-sdk 0.46
+message QueryAuthorityRequest {}
+
+// QueryAuthorityResponse is the response type for Query/Authority
+//
+// Since: cosmos-sdk 0.46
+message QueryAuthorityResponse {
+ string address = 1;
+}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/upgrade/v1beta1/tx.proto b/examples/authz/proto/cosmos/upgrade/v1beta1/tx.proto
new file mode 100644
index 00000000..9b04bf44
--- /dev/null
+++ b/examples/authz/proto/cosmos/upgrade/v1beta1/tx.proto
@@ -0,0 +1,55 @@
+syntax = "proto3";
+package cosmos.upgrade.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/upgrade/v1beta1/upgrade.proto";
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types";
+
+// Msg defines the upgrade Msg service.
+service Msg {
+ // SoftwareUpgrade is a governance operation for initiating a software upgrade.
+ //
+ // Since: cosmos-sdk 0.46
+ rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse);
+ // CancelUpgrade is a governance operation for cancelling a previously
+ // approvid software upgrade.
+ //
+ // Since: cosmos-sdk 0.46
+ rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse);
+}
+
+// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type.
+//
+// Since: cosmos-sdk 0.46
+message MsgSoftwareUpgrade {
+ option (cosmos.msg.v1.signer) = "authority";
+
+ // authority is the address of the governance account.
+ string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+
+ // plan is the upgrade plan.
+ Plan plan = 2 [(gogoproto.nullable) = false];
+}
+
+// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type.
+//
+// Since: cosmos-sdk 0.46
+message MsgSoftwareUpgradeResponse {}
+
+// MsgCancelUpgrade is the Msg/CancelUpgrade request type.
+//
+// Since: cosmos-sdk 0.46
+message MsgCancelUpgrade {
+ option (cosmos.msg.v1.signer) = "authority";
+
+ // authority is the address of the governance account.
+ string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+}
+
+// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type.
+//
+// Since: cosmos-sdk 0.46
+message MsgCancelUpgradeResponse {}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos/upgrade/v1beta1/upgrade.proto b/examples/authz/proto/cosmos/upgrade/v1beta1/upgrade.proto
new file mode 100644
index 00000000..dc15e27c
--- /dev/null
+++ b/examples/authz/proto/cosmos/upgrade/v1beta1/upgrade.proto
@@ -0,0 +1,86 @@
+syntax = "proto3";
+package cosmos.upgrade.v1beta1;
+
+import "google/protobuf/any.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types";
+option (gogoproto.goproto_getters_all) = false;
+
+// Plan specifies information about a planned upgrade and when it should occur.
+message Plan {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+
+ // Sets the name for the upgrade. This name will be used by the upgraded
+ // version of the software to apply any special "on-upgrade" commands during
+ // the first BeginBlock method after the upgrade is applied. It is also used
+ // to detect whether a software version can handle a given upgrade. If no
+ // upgrade handler with this name has been set in the software, it will be
+ // assumed that the software is out-of-date when the upgrade Time or Height is
+ // reached and the software will exit.
+ string name = 1;
+
+ // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
+ // has been removed from the SDK.
+ // If this field is not empty, an error will be thrown.
+ google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false];
+
+ // The height at which the upgrade must be performed.
+ // Only used if Time is not set.
+ int64 height = 3;
+
+ // Any application specific upgrade info to be included on-chain
+ // such as a git commit that validators could automatically upgrade to
+ string info = 4;
+
+ // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
+ // moved to the IBC module in the sub module 02-client.
+ // If this field is not empty, an error will be thrown.
+ google.protobuf.Any upgraded_client_state = 5 [deprecated = true];
+}
+
+// SoftwareUpgradeProposal is a gov Content type for initiating a software
+// upgrade.
+// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
+// proposals, see MsgSoftwareUpgrade.
+message SoftwareUpgradeProposal {
+ option deprecated = true;
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
+
+ string title = 1;
+ string description = 2;
+ Plan plan = 3 [(gogoproto.nullable) = false];
+}
+
+// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software
+// upgrade.
+// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
+// proposals, see MsgCancelUpgrade.
+message CancelSoftwareUpgradeProposal {
+ option deprecated = true;
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
+
+ string title = 1;
+ string description = 2;
+}
+
+// ModuleVersion specifies a module and its consensus version.
+//
+// Since: cosmos-sdk 0.43
+message ModuleVersion {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_stringer) = true;
+
+ // name of the app module
+ string name = 1;
+
+ // consensus version of the app module
+ uint64 version = 2;
+}
diff --git a/examples/authz/proto/cosmos/vesting/v1beta1/tx.proto b/examples/authz/proto/cosmos/vesting/v1beta1/tx.proto
new file mode 100644
index 00000000..211bad09
--- /dev/null
+++ b/examples/authz/proto/cosmos/vesting/v1beta1/tx.proto
@@ -0,0 +1,74 @@
+syntax = "proto3";
+package cosmos.vesting.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/vesting/v1beta1/vesting.proto";
+
+import "cosmos/msg/v1/msg.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types";
+
+// Msg defines the bank Msg service.
+service Msg {
+ // CreateVestingAccount defines a method that enables creating a vesting
+ // account.
+ rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse);
+ // CreatePermanentLockedAccount defines a method that enables creating a permanent
+ // locked account.
+ rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse);
+ // CreatePeriodicVestingAccount defines a method that enables creating a
+ // periodic vesting account.
+ rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse);
+}
+
+// MsgCreateVestingAccount defines a message that enables creating a vesting
+// account.
+message MsgCreateVestingAccount {
+ option (cosmos.msg.v1.signer) = "from_address";
+
+ option (gogoproto.equal) = true;
+
+ string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ repeated cosmos.base.v1beta1.Coin amount = 3
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+
+ int64 end_time = 4;
+ bool delayed = 5;
+}
+
+// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type.
+message MsgCreateVestingAccountResponse {}
+
+// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent
+// locked account.
+message MsgCreatePermanentLockedAccount {
+ option (gogoproto.equal) = true;
+
+ string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
+ string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
+ repeated cosmos.base.v1beta1.Coin amount = 3
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type.
+message MsgCreatePermanentLockedAccountResponse {}
+
+// MsgCreateVestingAccount defines a message that enables creating a vesting
+// account.
+message MsgCreatePeriodicVestingAccount {
+ option (cosmos.msg.v1.signer) = "from_address";
+
+ option (gogoproto.equal) = false;
+
+ string from_address = 1;
+ string to_address = 2;
+ int64 start_time = 3;
+ repeated Period vesting_periods = 4 [(gogoproto.nullable) = false];
+}
+
+// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount
+// response type.
+message MsgCreatePeriodicVestingAccountResponse {}
diff --git a/examples/authz/proto/cosmos/vesting/v1beta1/vesting.proto b/examples/authz/proto/cosmos/vesting/v1beta1/vesting.proto
new file mode 100644
index 00000000..824cc30d
--- /dev/null
+++ b/examples/authz/proto/cosmos/vesting/v1beta1/vesting.proto
@@ -0,0 +1,76 @@
+syntax = "proto3";
+package cosmos.vesting.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/auth/v1beta1/auth.proto";
+
+option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types";
+
+// BaseVestingAccount implements the VestingAccount interface. It contains all
+// the necessary fields needed for any vesting account implementation.
+message BaseVestingAccount {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true];
+ repeated cosmos.base.v1beta1.Coin original_vesting = 2
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+ repeated cosmos.base.v1beta1.Coin delegated_free = 3
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+ repeated cosmos.base.v1beta1.Coin delegated_vesting = 4
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+ int64 end_time = 5;
+}
+
+// ContinuousVestingAccount implements the VestingAccount interface. It
+// continuously vests by unlocking coins linearly with respect to time.
+message ContinuousVestingAccount {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
+ int64 start_time = 2;
+}
+
+// DelayedVestingAccount implements the VestingAccount interface. It vests all
+// coins after a specific time, but non prior. In other words, it keeps them
+// locked until a specified time.
+message DelayedVestingAccount {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
+}
+
+// Period defines a length of time and amount of coins that will vest.
+message Period {
+ option (gogoproto.goproto_stringer) = false;
+
+ int64 length = 1;
+ repeated cosmos.base.v1beta1.Coin amount = 2
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
+}
+
+// PeriodicVestingAccount implements the VestingAccount interface. It
+// periodically vests by unlocking coins during each specified period.
+message PeriodicVestingAccount {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
+ int64 start_time = 2;
+ repeated Period vesting_periods = 3 [(gogoproto.nullable) = false];
+}
+
+// PermanentLockedAccount implements the VestingAccount interface. It does
+// not ever release coins, locking them indefinitely. Coins in this account can
+// still be used for delegating and for governance votes even while locked.
+//
+// Since: cosmos-sdk 0.43
+message PermanentLockedAccount {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
+}
diff --git a/examples/authz/proto/cosmos_proto/LICENSE b/examples/authz/proto/cosmos_proto/LICENSE
new file mode 100644
index 00000000..6b3e3508
--- /dev/null
+++ b/examples/authz/proto/cosmos_proto/LICENSE
@@ -0,0 +1,204 @@
+Pulsar
+License: Apache2.0
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2021 Regen Network Development, Inc. & All in Bits, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos_proto/README.md b/examples/authz/proto/cosmos_proto/README.md
new file mode 100644
index 00000000..9599cc65
--- /dev/null
+++ b/examples/authz/proto/cosmos_proto/README.md
@@ -0,0 +1 @@
+# cosmos_proto
\ No newline at end of file
diff --git a/examples/authz/proto/cosmos_proto/cosmos.proto b/examples/authz/proto/cosmos_proto/cosmos.proto
new file mode 100644
index 00000000..5c63b86f
--- /dev/null
+++ b/examples/authz/proto/cosmos_proto/cosmos.proto
@@ -0,0 +1,97 @@
+syntax = "proto3";
+package cosmos_proto;
+
+import "google/protobuf/descriptor.proto";
+
+option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto";
+
+extend google.protobuf.MessageOptions {
+
+ // implements_interface is used to indicate the type name of the interface
+ // that a message implements so that it can be used in google.protobuf.Any
+ // fields that accept that interface. A message can implement multiple
+ // interfaces. Interfaces should be declared using a declare_interface
+ // file option.
+ repeated string implements_interface = 93001;
+}
+
+extend google.protobuf.FieldOptions {
+
+ // accepts_interface is used to annotate that a google.protobuf.Any
+ // field accepts messages that implement the specified interface.
+ // Interfaces should be declared using a declare_interface file option.
+ string accepts_interface = 93001;
+
+ // scalar is used to indicate that this field follows the formatting defined
+ // by the named scalar which should be declared with declare_scalar. Code
+ // generators may choose to use this information to map this field to a
+ // language-specific type representing the scalar.
+ string scalar = 93002;
+}
+
+extend google.protobuf.FileOptions {
+
+ // declare_interface declares an interface type to be used with
+ // accepts_interface and implements_interface. Interface names are
+ // expected to follow the following convention such that their declaration
+ // can be discovered by tools: for a given interface type a.b.C, it is
+ // expected that the declaration will be found in a protobuf file named
+ // a/b/interfaces.proto in the file descriptor set.
+ repeated InterfaceDescriptor declare_interface = 793021;
+
+ // declare_scalar declares a scalar type to be used with
+ // the scalar field option. Scalar names are
+ // expected to follow the following convention such that their declaration
+ // can be discovered by tools: for a given scalar type a.b.C, it is
+ // expected that the declaration will be found in a protobuf file named
+ // a/b/scalars.proto in the file descriptor set.
+ repeated ScalarDescriptor declare_scalar = 793022;
+}
+
+// InterfaceDescriptor describes an interface type to be used with
+// accepts_interface and implements_interface and declared by declare_interface.
+message InterfaceDescriptor {
+
+ // name is the name of the interface. It should be a short-name (without
+ // a period) such that the fully qualified name of the interface will be
+ // package.name, ex. for the package a.b and interface named C, the
+ // fully-qualified name will be a.b.C.
+ string name = 1;
+
+ // description is a human-readable description of the interface and its
+ // purpose.
+ string description = 2;
+}
+
+// ScalarDescriptor describes an scalar type to be used with
+// the scalar field option and declared by declare_scalar.
+// Scalars extend simple protobuf built-in types with additional
+// syntax and semantics, for instance to represent big integers.
+// Scalars should ideally define an encoding such that there is only one
+// valid syntactical representation for a given semantic meaning,
+// i.e. the encoding should be deterministic.
+message ScalarDescriptor {
+
+ // name is the name of the scalar. It should be a short-name (without
+ // a period) such that the fully qualified name of the scalar will be
+ // package.name, ex. for the package a.b and scalar named C, the
+ // fully-qualified name will be a.b.C.
+ string name = 1;
+
+ // description is a human-readable description of the scalar and its
+ // encoding format. For instance a big integer or decimal scalar should
+ // specify precisely the expected encoding format.
+ string description = 2;
+
+ // field_type is the type of field with which this scalar can be used.
+ // Scalars can be used with one and only one type of field so that
+ // encoding standards and simple and clear. Currently only string and
+ // bytes fields are supported for scalars.
+ repeated ScalarType field_type = 3;
+}
+
+enum ScalarType {
+ SCALAR_TYPE_UNSPECIFIED = 0;
+ SCALAR_TYPE_STRING = 1;
+ SCALAR_TYPE_BYTES = 2;
+}
diff --git a/examples/authz/proto/cosmwasm/LICENSE b/examples/authz/proto/cosmwasm/LICENSE
new file mode 100644
index 00000000..5a23302b
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/LICENSE
@@ -0,0 +1,204 @@
+Cosmos-SDK
+License: Apache2.0
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2016 All in Bits, Inc
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/examples/authz/proto/cosmwasm/README.md b/examples/authz/proto/cosmwasm/README.md
new file mode 100644
index 00000000..63192e81
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/README.md
@@ -0,0 +1 @@
+# cosmwasm
\ No newline at end of file
diff --git a/examples/authz/proto/cosmwasm/wasm/v1/genesis.proto b/examples/authz/proto/cosmwasm/wasm/v1/genesis.proto
new file mode 100644
index 00000000..f02f3307
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/wasm/v1/genesis.proto
@@ -0,0 +1,60 @@
+syntax = "proto3";
+package cosmwasm.wasm.v1;
+
+import "gogoproto/gogo.proto";
+import "cosmwasm/wasm/v1/types.proto";
+import "cosmwasm/wasm/v1/tx.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
+
+// GenesisState - genesis state of x/wasm
+message GenesisState {
+ Params params = 1 [ (gogoproto.nullable) = false ];
+ repeated Code codes = 2
+ [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ];
+ repeated Contract contracts = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "contracts,omitempty"
+ ];
+ repeated Sequence sequences = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "sequences,omitempty"
+ ];
+ repeated GenMsgs gen_msgs = 5 [
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = "gen_msgs,omitempty"
+ ];
+
+ // GenMsgs define the messages that can be executed during genesis phase in
+ // order. The intention is to have more human readable data that is auditable.
+ message GenMsgs {
+ // sum is a single message
+ oneof sum {
+ MsgStoreCode store_code = 1;
+ MsgInstantiateContract instantiate_contract = 2;
+ MsgExecuteContract execute_contract = 3;
+ }
+ }
+}
+
+// Code struct encompasses CodeInfo and CodeBytes
+message Code {
+ uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
+ CodeInfo code_info = 2 [ (gogoproto.nullable) = false ];
+ bytes code_bytes = 3;
+ // Pinned to wasmvm cache
+ bool pinned = 4;
+}
+
+// Contract struct encompasses ContractAddress, ContractInfo, and ContractState
+message Contract {
+ string contract_address = 1;
+ ContractInfo contract_info = 2 [ (gogoproto.nullable) = false ];
+ repeated Model contract_state = 3 [ (gogoproto.nullable) = false ];
+}
+
+// Sequence key and value of an id generation counter
+message Sequence {
+ bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ];
+ uint64 value = 2;
+}
\ No newline at end of file
diff --git a/examples/authz/proto/cosmwasm/wasm/v1/ibc.proto b/examples/authz/proto/cosmwasm/wasm/v1/ibc.proto
new file mode 100644
index 00000000..d880a707
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/wasm/v1/ibc.proto
@@ -0,0 +1,31 @@
+syntax = "proto3";
+package cosmwasm.wasm.v1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
+option (gogoproto.goproto_getters_all) = false;
+
+// MsgIBCSend
+message MsgIBCSend {
+ // the channel by which the packet will be sent
+ string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ];
+
+ // Timeout height relative to the current block height.
+ // The timeout is disabled when set to 0.
+ uint64 timeout_height = 4
+ [ (gogoproto.moretags) = "yaml:\"timeout_height\"" ];
+ // Timeout timestamp (in nanoseconds) relative to the current block timestamp.
+ // The timeout is disabled when set to 0.
+ uint64 timeout_timestamp = 5
+ [ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ];
+
+ // Data is the payload to transfer. We must not make assumption what format or
+ // content is in here.
+ bytes data = 6;
+}
+
+// MsgIBCCloseChannel port and channel need to be owned by the contract
+message MsgIBCCloseChannel {
+ string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ];
+}
diff --git a/examples/authz/proto/cosmwasm/wasm/v1/proposal.proto b/examples/authz/proto/cosmwasm/wasm/v1/proposal.proto
new file mode 100644
index 00000000..2f36f87f
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/wasm/v1/proposal.proto
@@ -0,0 +1,150 @@
+syntax = "proto3";
+package cosmwasm.wasm.v1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmwasm/wasm/v1/types.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
+option (gogoproto.goproto_stringer_all) = false;
+option (gogoproto.goproto_getters_all) = false;
+option (gogoproto.equal_all) = true;
+
+// StoreCodeProposal gov proposal content type to submit WASM code to the system
+message StoreCodeProposal {
+ // Title is a short summary
+ string title = 1;
+ // Description is a human readable text
+ string description = 2;
+ // RunAs is the address that is passed to the contract's environment as sender
+ string run_as = 3;
+ // WASMByteCode can be raw or gzip compressed
+ bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ];
+ // Used in v1beta1
+ reserved 5, 6;
+ // InstantiatePermission to apply on contract creation, optional
+ AccessConfig instantiate_permission = 7;
+}
+
+// InstantiateContractProposal gov proposal content type to instantiate a
+// contract.
+message InstantiateContractProposal {
+ // Title is a short summary
+ string title = 1;
+ // Description is a human readable text
+ string description = 2;
+ // RunAs is the address that is passed to the contract's environment as sender
+ string run_as = 3;
+ // Admin is an optional address that can execute migrations
+ string admin = 4;
+ // CodeID is the reference to the stored WASM code
+ uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
+ // Label is optional metadata to be stored with a constract instance.
+ string label = 6;
+ // Msg json encoded message to be passed to the contract on instantiation
+ bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ];
+ // Funds coins that are transferred to the contract on instantiation
+ repeated cosmos.base.v1beta1.Coin funds = 8 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+// MigrateContractProposal gov proposal content type to migrate a contract.
+message MigrateContractProposal {
+ // Title is a short summary
+ string title = 1;
+ // Description is a human readable text
+ string description = 2;
+ // Note: skipping 3 as this was previously used for unneeded run_as
+
+ // Contract is the address of the smart contract
+ string contract = 4;
+ // CodeID references the new WASM codesudo
+ uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
+ // Msg json encoded message to be passed to the contract on migration
+ bytes msg = 6 [ (gogoproto.casttype) = "RawContractMessage" ];
+}
+
+// SudoContractProposal gov proposal content type to call sudo on a contract.
+message SudoContractProposal {
+ // Title is a short summary
+ string title = 1;
+ // Description is a human readable text
+ string description = 2;
+ // Contract is the address of the smart contract
+ string contract = 3;
+ // Msg json encoded message to be passed to the contract as sudo
+ bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ];
+}
+
+// ExecuteContractProposal gov proposal content type to call execute on a
+// contract.
+message ExecuteContractProposal {
+ // Title is a short summary
+ string title = 1;
+ // Description is a human readable text
+ string description = 2;
+ // RunAs is the address that is passed to the contract's environment as sender
+ string run_as = 3;
+ // Contract is the address of the smart contract
+ string contract = 4;
+ // Msg json encoded message to be passed to the contract as execute
+ bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ];
+ // Funds coins that are transferred to the contract on instantiation
+ repeated cosmos.base.v1beta1.Coin funds = 6 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+// UpdateAdminProposal gov proposal content type to set an admin for a contract.
+message UpdateAdminProposal {
+ // Title is a short summary
+ string title = 1;
+ // Description is a human readable text
+ string description = 2;
+ // NewAdmin address to be set
+ string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
+ // Contract is the address of the smart contract
+ string contract = 4;
+}
+
+// ClearAdminProposal gov proposal content type to clear the admin of a
+// contract.
+message ClearAdminProposal {
+ // Title is a short summary
+ string title = 1;
+ // Description is a human readable text
+ string description = 2;
+ // Contract is the address of the smart contract
+ string contract = 3;
+}
+
+// PinCodesProposal gov proposal content type to pin a set of code ids in the
+// wasmvm cache.
+message PinCodesProposal {
+ // Title is a short summary
+ string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
+ // Description is a human readable text
+ string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
+ // CodeIDs references the new WASM codes
+ repeated uint64 code_ids = 3 [
+ (gogoproto.customname) = "CodeIDs",
+ (gogoproto.moretags) = "yaml:\"code_ids\""
+ ];
+}
+
+// UnpinCodesProposal gov proposal content type to unpin a set of code ids in
+// the wasmvm cache.
+message UnpinCodesProposal {
+ // Title is a short summary
+ string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
+ // Description is a human readable text
+ string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
+ // CodeIDs references the WASM codes
+ repeated uint64 code_ids = 3 [
+ (gogoproto.customname) = "CodeIDs",
+ (gogoproto.moretags) = "yaml:\"code_ids\""
+ ];
+}
diff --git a/examples/authz/proto/cosmwasm/wasm/v1/query.proto b/examples/authz/proto/cosmwasm/wasm/v1/query.proto
new file mode 100644
index 00000000..dbe7c0fb
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/wasm/v1/query.proto
@@ -0,0 +1,223 @@
+syntax = "proto3";
+package cosmwasm.wasm.v1;
+
+import "gogoproto/gogo.proto";
+import "cosmwasm/wasm/v1/types.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
+option (gogoproto.goproto_getters_all) = false;
+option (gogoproto.equal_all) = false;
+
+// Query provides defines the gRPC querier service
+service Query {
+ // ContractInfo gets the contract meta data
+ rpc ContractInfo(QueryContractInfoRequest)
+ returns (QueryContractInfoResponse) {
+ option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}";
+ }
+ // ContractHistory gets the contract code history
+ rpc ContractHistory(QueryContractHistoryRequest)
+ returns (QueryContractHistoryResponse) {
+ option (google.api.http).get =
+ "/cosmwasm/wasm/v1/contract/{address}/history";
+ }
+ // ContractsByCode lists all smart contracts for a code id
+ rpc ContractsByCode(QueryContractsByCodeRequest)
+ returns (QueryContractsByCodeResponse) {
+ option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}/contracts";
+ }
+ // AllContractState gets all raw store data for a single contract
+ rpc AllContractState(QueryAllContractStateRequest)
+ returns (QueryAllContractStateResponse) {
+ option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/state";
+ }
+ // RawContractState gets single key from the raw store data of a contract
+ rpc RawContractState(QueryRawContractStateRequest)
+ returns (QueryRawContractStateResponse) {
+ option (google.api.http).get =
+ "/wasm/v1/contract/{address}/raw/{query_data}";
+ }
+ // SmartContractState get smart query result from the contract
+ rpc SmartContractState(QuerySmartContractStateRequest)
+ returns (QuerySmartContractStateResponse) {
+ option (google.api.http).get =
+ "/wasm/v1/contract/{address}/smart/{query_data}";
+ }
+ // Code gets the binary code and metadata for a singe wasm code
+ rpc Code(QueryCodeRequest) returns (QueryCodeResponse) {
+ option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}";
+ }
+ // Codes gets the metadata for all stored wasm codes
+ rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) {
+ option (google.api.http).get = "/cosmwasm/wasm/v1/code";
+ }
+
+ // PinnedCodes gets the pinned code ids
+ rpc PinnedCodes(QueryPinnedCodesRequest) returns (QueryPinnedCodesResponse) {
+ option (google.api.http).get = "/cosmwasm/wasm/v1/codes/pinned";
+ }
+}
+
+// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC
+// method
+message QueryContractInfoRequest {
+ // address is the address of the contract to query
+ string address = 1;
+}
+// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC
+// method
+message QueryContractInfoResponse {
+ option (gogoproto.equal) = true;
+
+ // address is the address of the contract
+ string address = 1;
+ ContractInfo contract_info = 2 [
+ (gogoproto.embed) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.jsontag) = ""
+ ];
+}
+
+// QueryContractHistoryRequest is the request type for the Query/ContractHistory
+// RPC method
+message QueryContractHistoryRequest {
+ // address is the address of the contract to query
+ string address = 1;
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryContractHistoryResponse is the response type for the
+// Query/ContractHistory RPC method
+message QueryContractHistoryResponse {
+ repeated ContractCodeHistoryEntry entries = 1
+ [ (gogoproto.nullable) = false ];
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode
+// RPC method
+message QueryContractsByCodeRequest {
+ uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryContractsByCodeResponse is the response type for the
+// Query/ContractsByCode RPC method
+message QueryContractsByCodeResponse {
+ // contracts are a set of contract addresses
+ repeated string contracts = 1;
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryAllContractStateRequest is the request type for the
+// Query/AllContractState RPC method
+message QueryAllContractStateRequest {
+ // address is the address of the contract
+ string address = 1;
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryAllContractStateResponse is the response type for the
+// Query/AllContractState RPC method
+message QueryAllContractStateResponse {
+ repeated Model models = 1 [ (gogoproto.nullable) = false ];
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryRawContractStateRequest is the request type for the
+// Query/RawContractState RPC method
+message QueryRawContractStateRequest {
+ // address is the address of the contract
+ string address = 1;
+ bytes query_data = 2;
+}
+
+// QueryRawContractStateResponse is the response type for the
+// Query/RawContractState RPC method
+message QueryRawContractStateResponse {
+ // Data contains the raw store data
+ bytes data = 1;
+}
+
+// QuerySmartContractStateRequest is the request type for the
+// Query/SmartContractState RPC method
+message QuerySmartContractStateRequest {
+ // address is the address of the contract
+ string address = 1;
+ // QueryData contains the query data passed to the contract
+ bytes query_data = 2 [ (gogoproto.casttype) = "RawContractMessage" ];
+}
+
+// QuerySmartContractStateResponse is the response type for the
+// Query/SmartContractState RPC method
+message QuerySmartContractStateResponse {
+ // Data contains the json data returned from the smart contract
+ bytes data = 1 [ (gogoproto.casttype) = "RawContractMessage" ];
+}
+
+// QueryCodeRequest is the request type for the Query/Code RPC method
+message QueryCodeRequest {
+ uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID
+}
+
+// CodeInfoResponse contains code meta data from CodeInfo
+message CodeInfoResponse {
+ option (gogoproto.equal) = true;
+
+ uint64 code_id = 1 [
+ (gogoproto.customname) = "CodeID",
+ (gogoproto.jsontag) = "id"
+ ]; // id for legacy support
+ string creator = 2;
+ bytes data_hash = 3
+ [ (gogoproto.casttype) =
+ "github.com/tendermint/tendermint/libs/bytes.HexBytes" ];
+ // Used in v1beta1
+ reserved 4, 5;
+}
+
+// QueryCodeResponse is the response type for the Query/Code RPC method
+message QueryCodeResponse {
+ option (gogoproto.equal) = true;
+ CodeInfoResponse code_info = 1
+ [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ];
+ bytes data = 2 [ (gogoproto.jsontag) = "data" ];
+}
+
+// QueryCodesRequest is the request type for the Query/Codes RPC method
+message QueryCodesRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryCodesResponse is the response type for the Query/Codes RPC method
+message QueryCodesResponse {
+ repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ];
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes
+// RPC method
+message QueryPinnedCodesRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryPinnedCodesResponse is the response type for the
+// Query/PinnedCodes RPC method
+message QueryPinnedCodesResponse {
+ repeated uint64 code_ids = 1
+ [ (gogoproto.nullable) = false, (gogoproto.customname) = "CodeIDs" ];
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
diff --git a/examples/authz/proto/cosmwasm/wasm/v1/tx.proto b/examples/authz/proto/cosmwasm/wasm/v1/tx.proto
new file mode 100644
index 00000000..8295907e
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/wasm/v1/tx.proto
@@ -0,0 +1,135 @@
+syntax = "proto3";
+package cosmwasm.wasm.v1;
+
+import "cosmos/base/v1beta1/coin.proto";
+import "gogoproto/gogo.proto";
+import "cosmwasm/wasm/v1/types.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
+option (gogoproto.goproto_getters_all) = false;
+
+// Msg defines the wasm Msg service.
+service Msg {
+ // StoreCode to submit Wasm code to the system
+ rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse);
+ // Instantiate creates a new smart contract instance for the given code id.
+ rpc InstantiateContract(MsgInstantiateContract)
+ returns (MsgInstantiateContractResponse);
+ // Execute submits the given message data to a smart contract
+ rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse);
+ // Migrate runs a code upgrade/ downgrade for a smart contract
+ rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse);
+ // UpdateAdmin sets a new admin for a smart contract
+ rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse);
+ // ClearAdmin removes any admin stored for a smart contract
+ rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse);
+}
+
+// MsgStoreCode submit Wasm code to the system
+message MsgStoreCode {
+ // Sender is the that actor that signed the messages
+ string sender = 1;
+ // WASMByteCode can be raw or gzip compressed
+ bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ];
+ // Used in v1beta1
+ reserved 3, 4;
+ // InstantiatePermission access control to apply on contract creation,
+ // optional
+ AccessConfig instantiate_permission = 5;
+}
+// MsgStoreCodeResponse returns store result data.
+message MsgStoreCodeResponse {
+ // CodeID is the reference to the stored WASM code
+ uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
+}
+
+// MsgInstantiateContract create a new smart contract instance for the given
+// code id.
+message MsgInstantiateContract {
+ // Sender is the that actor that signed the messages
+ string sender = 1;
+ // Admin is an optional address that can execute migrations
+ string admin = 2;
+ // CodeID is the reference to the stored WASM code
+ uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ];
+ // Label is optional metadata to be stored with a contract instance.
+ string label = 4;
+ // Msg json encoded message to be passed to the contract on instantiation
+ bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ];
+ // Funds coins that are transferred to the contract on instantiation
+ repeated cosmos.base.v1beta1.Coin funds = 6 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+// MsgInstantiateContractResponse return instantiation result data
+message MsgInstantiateContractResponse {
+ // Address is the bech32 address of the new contract instance.
+ string address = 1;
+ // Data contains base64-encoded bytes to returned from the contract
+ bytes data = 2;
+}
+
+// MsgExecuteContract submits the given message data to a smart contract
+message MsgExecuteContract {
+ // Sender is the that actor that signed the messages
+ string sender = 1;
+ // Contract is the address of the smart contract
+ string contract = 2;
+ // Msg json encoded message to be passed to the contract
+ bytes msg = 3 [ (gogoproto.casttype) = "RawContractMessage" ];
+ // Funds coins that are transferred to the contract on execution
+ repeated cosmos.base.v1beta1.Coin funds = 5 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+// MsgExecuteContractResponse returns execution result data.
+message MsgExecuteContractResponse {
+ // Data contains base64-encoded bytes to returned from the contract
+ bytes data = 1;
+}
+
+// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
+message MsgMigrateContract {
+ // Sender is the that actor that signed the messages
+ string sender = 1;
+ // Contract is the address of the smart contract
+ string contract = 2;
+ // CodeID references the new WASM code
+ uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ];
+ // Msg json encoded message to be passed to the contract on migration
+ bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ];
+}
+
+// MsgMigrateContractResponse returns contract migration result data.
+message MsgMigrateContractResponse {
+ // Data contains same raw bytes returned as data from the wasm contract.
+ // (May be empty)
+ bytes data = 1;
+}
+
+// MsgUpdateAdmin sets a new admin for a smart contract
+message MsgUpdateAdmin {
+ // Sender is the that actor that signed the messages
+ string sender = 1;
+ // NewAdmin address to be set
+ string new_admin = 2;
+ // Contract is the address of the smart contract
+ string contract = 3;
+}
+
+// MsgUpdateAdminResponse returns empty data
+message MsgUpdateAdminResponse {}
+
+// MsgClearAdmin removes any admin stored for a smart contract
+message MsgClearAdmin {
+ // Sender is the that actor that signed the messages
+ string sender = 1;
+ // Contract is the address of the smart contract
+ string contract = 3;
+}
+
+// MsgClearAdminResponse returns empty data
+message MsgClearAdminResponse {}
diff --git a/examples/authz/proto/cosmwasm/wasm/v1/types.proto b/examples/authz/proto/cosmwasm/wasm/v1/types.proto
new file mode 100644
index 00000000..7ee2f639
--- /dev/null
+++ b/examples/authz/proto/cosmwasm/wasm/v1/types.proto
@@ -0,0 +1,140 @@
+syntax = "proto3";
+package cosmwasm.wasm.v1;
+
+import "cosmos_proto/cosmos.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
+option (gogoproto.goproto_getters_all) = false;
+option (gogoproto.equal_all) = true;
+
+// AccessType permission types
+enum AccessType {
+ option (gogoproto.goproto_enum_prefix) = false;
+ option (gogoproto.goproto_enum_stringer) = false;
+ // AccessTypeUnspecified placeholder for empty value
+ ACCESS_TYPE_UNSPECIFIED = 0
+ [ (gogoproto.enumvalue_customname) = "AccessTypeUnspecified" ];
+ // AccessTypeNobody forbidden
+ ACCESS_TYPE_NOBODY = 1
+ [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ];
+ // AccessTypeOnlyAddress restricted to an address
+ ACCESS_TYPE_ONLY_ADDRESS = 2
+ [ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ];
+ // AccessTypeEverybody unrestricted
+ ACCESS_TYPE_EVERYBODY = 3
+ [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ];
+}
+
+// AccessTypeParam
+message AccessTypeParam {
+ option (gogoproto.goproto_stringer) = true;
+ AccessType value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ];
+}
+
+// AccessConfig access control type.
+message AccessConfig {
+ option (gogoproto.goproto_stringer) = true;
+ AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ];
+ string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
+}
+
+// Params defines the set of wasm parameters.
+message Params {
+ option (gogoproto.goproto_stringer) = false;
+ AccessConfig code_upload_access = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"code_upload_access\""
+ ];
+ AccessType instantiate_default_permission = 2
+ [ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ];
+ uint64 max_wasm_code_size = 3
+ [ (gogoproto.moretags) = "yaml:\"max_wasm_code_size\"" ];
+}
+
+// CodeInfo is data for the uploaded contract WASM code
+message CodeInfo {
+ // CodeHash is the unique identifier created by wasmvm
+ bytes code_hash = 1;
+ // Creator address who initially stored the code
+ string creator = 2;
+ // Used in v1beta1
+ reserved 3, 4;
+ // InstantiateConfig access control to apply on contract creation, optional
+ AccessConfig instantiate_config = 5 [ (gogoproto.nullable) = false ];
+}
+
+// ContractInfo stores a WASM contract instance
+message ContractInfo {
+ option (gogoproto.equal) = true;
+
+ // CodeID is the reference to the stored Wasm code
+ uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
+ // Creator address who initially instantiated the contract
+ string creator = 2;
+ // Admin is an optional address that can execute migrations
+ string admin = 3;
+ // Label is optional metadata to be stored with a contract instance.
+ string label = 4;
+ // Created Tx position when the contract was instantiated.
+ // This data should kept internal and not be exposed via query results. Just
+ // use for sorting
+ AbsoluteTxPosition created = 5;
+ string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ];
+
+ // Extension is an extension point to store custom metadata within the
+ // persistence model.
+ google.protobuf.Any extension = 7
+ [ (cosmos_proto.accepts_interface) = "ContractInfoExtension" ];
+}
+
+// ContractCodeHistoryOperationType actions that caused a code change
+enum ContractCodeHistoryOperationType {
+ option (gogoproto.goproto_enum_prefix) = false;
+ // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value
+ CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0
+ [ (gogoproto.enumvalue_customname) =
+ "ContractCodeHistoryOperationTypeUnspecified" ];
+ // ContractCodeHistoryOperationTypeInit on chain contract instantiation
+ CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1
+ [ (gogoproto.enumvalue_customname) =
+ "ContractCodeHistoryOperationTypeInit" ];
+ // ContractCodeHistoryOperationTypeMigrate code migration
+ CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2
+ [ (gogoproto.enumvalue_customname) =
+ "ContractCodeHistoryOperationTypeMigrate" ];
+ // ContractCodeHistoryOperationTypeGenesis based on genesis data
+ CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3
+ [ (gogoproto.enumvalue_customname) =
+ "ContractCodeHistoryOperationTypeGenesis" ];
+}
+
+// ContractCodeHistoryEntry metadata to a contract.
+message ContractCodeHistoryEntry {
+ ContractCodeHistoryOperationType operation = 1;
+ // CodeID is the reference to the stored WASM code
+ uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ];
+ // Updated Tx position when the operation was executed.
+ AbsoluteTxPosition updated = 3;
+ bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ];
+}
+
+// AbsoluteTxPosition is a unique transaction position that allows for global
+// ordering of transactions.
+message AbsoluteTxPosition {
+ // BlockHeight is the block the contract was created at
+ uint64 block_height = 1;
+ // TxIndex is a monotonic counter within the block (actual transaction index,
+ // or gas consumed)
+ uint64 tx_index = 2;
+}
+
+// Model is a struct that holds a KV pair
+message Model {
+ // hex-encode key to read it better (this is often ascii)
+ bytes key = 1 [ (gogoproto.casttype) =
+ "github.com/tendermint/tendermint/libs/bytes.HexBytes" ];
+ // base64-encode raw value
+ bytes value = 2;
+}
diff --git a/examples/authz/proto/gogoproto/LICENSE b/examples/authz/proto/gogoproto/LICENSE
new file mode 100644
index 00000000..992eb2bd
--- /dev/null
+++ b/examples/authz/proto/gogoproto/LICENSE
@@ -0,0 +1,34 @@
+Copyright (c) 2013, The GoGo Authors. All rights reserved.
+
+Protocol Buffers for Go with Gadgets
+
+Go support for Protocol Buffers - Google's data interchange format
+
+Copyright 2010 The Go Authors. All rights reserved.
+https://github.com/golang/protobuf
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/examples/authz/proto/gogoproto/README.md b/examples/authz/proto/gogoproto/README.md
new file mode 100644
index 00000000..4cfc4768
--- /dev/null
+++ b/examples/authz/proto/gogoproto/README.md
@@ -0,0 +1 @@
+# gogoproto
\ No newline at end of file
diff --git a/examples/authz/proto/gogoproto/gogo.proto b/examples/authz/proto/gogoproto/gogo.proto
new file mode 100644
index 00000000..49e78f99
--- /dev/null
+++ b/examples/authz/proto/gogoproto/gogo.proto
@@ -0,0 +1,145 @@
+// Protocol Buffers for Go with Gadgets
+//
+// Copyright (c) 2013, The GoGo Authors. All rights reserved.
+// http://github.com/gogo/protobuf
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+syntax = "proto2";
+package gogoproto;
+
+import "google/protobuf/descriptor.proto";
+
+option java_package = "com.google.protobuf";
+option java_outer_classname = "GoGoProtos";
+option go_package = "github.com/gogo/protobuf/gogoproto";
+
+extend google.protobuf.EnumOptions {
+ optional bool goproto_enum_prefix = 62001;
+ optional bool goproto_enum_stringer = 62021;
+ optional bool enum_stringer = 62022;
+ optional string enum_customname = 62023;
+ optional bool enumdecl = 62024;
+}
+
+extend google.protobuf.EnumValueOptions {
+ optional string enumvalue_customname = 66001;
+}
+
+extend google.protobuf.FileOptions {
+ optional bool goproto_getters_all = 63001;
+ optional bool goproto_enum_prefix_all = 63002;
+ optional bool goproto_stringer_all = 63003;
+ optional bool verbose_equal_all = 63004;
+ optional bool face_all = 63005;
+ optional bool gostring_all = 63006;
+ optional bool populate_all = 63007;
+ optional bool stringer_all = 63008;
+ optional bool onlyone_all = 63009;
+
+ optional bool equal_all = 63013;
+ optional bool description_all = 63014;
+ optional bool testgen_all = 63015;
+ optional bool benchgen_all = 63016;
+ optional bool marshaler_all = 63017;
+ optional bool unmarshaler_all = 63018;
+ optional bool stable_marshaler_all = 63019;
+
+ optional bool sizer_all = 63020;
+
+ optional bool goproto_enum_stringer_all = 63021;
+ optional bool enum_stringer_all = 63022;
+
+ optional bool unsafe_marshaler_all = 63023;
+ optional bool unsafe_unmarshaler_all = 63024;
+
+ optional bool goproto_extensions_map_all = 63025;
+ optional bool goproto_unrecognized_all = 63026;
+ optional bool gogoproto_import = 63027;
+ optional bool protosizer_all = 63028;
+ optional bool compare_all = 63029;
+ optional bool typedecl_all = 63030;
+ optional bool enumdecl_all = 63031;
+
+ optional bool goproto_registration = 63032;
+ optional bool messagename_all = 63033;
+
+ optional bool goproto_sizecache_all = 63034;
+ optional bool goproto_unkeyed_all = 63035;
+}
+
+extend google.protobuf.MessageOptions {
+ optional bool goproto_getters = 64001;
+ optional bool goproto_stringer = 64003;
+ optional bool verbose_equal = 64004;
+ optional bool face = 64005;
+ optional bool gostring = 64006;
+ optional bool populate = 64007;
+ optional bool stringer = 67008;
+ optional bool onlyone = 64009;
+
+ optional bool equal = 64013;
+ optional bool description = 64014;
+ optional bool testgen = 64015;
+ optional bool benchgen = 64016;
+ optional bool marshaler = 64017;
+ optional bool unmarshaler = 64018;
+ optional bool stable_marshaler = 64019;
+
+ optional bool sizer = 64020;
+
+ optional bool unsafe_marshaler = 64023;
+ optional bool unsafe_unmarshaler = 64024;
+
+ optional bool goproto_extensions_map = 64025;
+ optional bool goproto_unrecognized = 64026;
+
+ optional bool protosizer = 64028;
+ optional bool compare = 64029;
+
+ optional bool typedecl = 64030;
+
+ optional bool messagename = 64033;
+
+ optional bool goproto_sizecache = 64034;
+ optional bool goproto_unkeyed = 64035;
+}
+
+extend google.protobuf.FieldOptions {
+ optional bool nullable = 65001;
+ optional bool embed = 65002;
+ optional string customtype = 65003;
+ optional string customname = 65004;
+ optional string jsontag = 65005;
+ optional string moretags = 65006;
+ optional string casttype = 65007;
+ optional string castkey = 65008;
+ optional string castvalue = 65009;
+
+ optional bool stdtime = 65010;
+ optional bool stdduration = 65011;
+ optional bool wktpointer = 65012;
+
+ optional string castrepeated = 65013;
+}
diff --git a/examples/authz/proto/google/LICENSE b/examples/authz/proto/google/LICENSE
new file mode 100644
index 00000000..261eeb9e
--- /dev/null
+++ b/examples/authz/proto/google/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/examples/authz/proto/google/README.md b/examples/authz/proto/google/README.md
new file mode 100644
index 00000000..3bdc1f83
--- /dev/null
+++ b/examples/authz/proto/google/README.md
@@ -0,0 +1 @@
+# google
\ No newline at end of file
diff --git a/examples/authz/proto/google/api/annotations.proto b/examples/authz/proto/google/api/annotations.proto
new file mode 100644
index 00000000..efdab3db
--- /dev/null
+++ b/examples/authz/proto/google/api/annotations.proto
@@ -0,0 +1,31 @@
+// Copyright 2015 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package google.api;
+
+import "google/api/http.proto";
+import "google/protobuf/descriptor.proto";
+
+option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
+option java_multiple_files = true;
+option java_outer_classname = "AnnotationsProto";
+option java_package = "com.google.api";
+option objc_class_prefix = "GAPI";
+
+extend google.protobuf.MethodOptions {
+ // See `HttpRule`.
+ HttpRule http = 72295728;
+}
diff --git a/examples/authz/proto/google/api/http.proto b/examples/authz/proto/google/api/http.proto
new file mode 100644
index 00000000..113fa936
--- /dev/null
+++ b/examples/authz/proto/google/api/http.proto
@@ -0,0 +1,375 @@
+// Copyright 2015 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package google.api;
+
+option cc_enable_arenas = true;
+option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
+option java_multiple_files = true;
+option java_outer_classname = "HttpProto";
+option java_package = "com.google.api";
+option objc_class_prefix = "GAPI";
+
+// Defines the HTTP configuration for an API service. It contains a list of
+// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
+// to one or more HTTP REST API methods.
+message Http {
+ // A list of HTTP configuration rules that apply to individual API methods.
+ //
+ // **NOTE:** All service configuration rules follow "last one wins" order.
+ repeated HttpRule rules = 1;
+
+ // When set to true, URL path parameters will be fully URI-decoded except in
+ // cases of single segment matches in reserved expansion, where "%2F" will be
+ // left encoded.
+ //
+ // The default behavior is to not decode RFC 6570 reserved characters in multi
+ // segment matches.
+ bool fully_decode_reserved_expansion = 2;
+}
+
+// # gRPC Transcoding
+//
+// gRPC Transcoding is a feature for mapping between a gRPC method and one or
+// more HTTP REST endpoints. It allows developers to build a single API service
+// that supports both gRPC APIs and REST APIs. Many systems, including [Google
+// APIs](https://github.com/googleapis/googleapis),
+// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
+// Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
+// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
+// and use it for large scale production services.
+//
+// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
+// how different portions of the gRPC request message are mapped to the URL
+// path, URL query parameters, and HTTP request body. It also controls how the
+// gRPC response message is mapped to the HTTP response body. `HttpRule` is
+// typically specified as an `google.api.http` annotation on the gRPC method.
+//
+// Each mapping specifies a URL path template and an HTTP method. The path
+// template may refer to one or more fields in the gRPC request message, as long
+// as each field is a non-repeated field with a primitive (non-message) type.
+// The path template controls how fields of the request message are mapped to
+// the URL path.
+//
+// Example:
+//
+// service Messaging {
+// rpc GetMessage(GetMessageRequest) returns (Message) {
+// option (google.api.http) = {
+// get: "/v1/{name=messages/*}"
+// };
+// }
+// }
+// message GetMessageRequest {
+// string name = 1; // Mapped to URL path.
+// }
+// message Message {
+// string text = 1; // The resource content.
+// }
+//
+// This enables an HTTP REST to gRPC mapping as below:
+//
+// HTTP | gRPC
+// -----|-----
+// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
+//
+// Any fields in the request message which are not bound by the path template
+// automatically become HTTP query parameters if there is no HTTP request body.
+// For example:
+//
+// service Messaging {
+// rpc GetMessage(GetMessageRequest) returns (Message) {
+// option (google.api.http) = {
+// get:"/v1/messages/{message_id}"
+// };
+// }
+// }
+// message GetMessageRequest {
+// message SubMessage {
+// string subfield = 1;
+// }
+// string message_id = 1; // Mapped to URL path.
+// int64 revision = 2; // Mapped to URL query parameter `revision`.
+// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
+// }
+//
+// This enables a HTTP JSON to RPC mapping as below:
+//
+// HTTP | gRPC
+// -----|-----
+// `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
+// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
+// "foo"))`
+//
+// Note that fields which are mapped to URL query parameters must have a
+// primitive type or a repeated primitive type or a non-repeated message type.
+// In the case of a repeated type, the parameter can be repeated in the URL
+// as `...?param=A¶m=B`. In the case of a message type, each field of the
+// message is mapped to a separate parameter, such as
+// `...?foo.a=A&foo.b=B&foo.c=C`.
+//
+// For HTTP methods that allow a request body, the `body` field
+// specifies the mapping. Consider a REST update method on the
+// message resource collection:
+//
+// service Messaging {
+// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
+// option (google.api.http) = {
+// patch: "/v1/messages/{message_id}"
+// body: "message"
+// };
+// }
+// }
+// message UpdateMessageRequest {
+// string message_id = 1; // mapped to the URL
+// Message message = 2; // mapped to the body
+// }
+//
+// The following HTTP JSON to RPC mapping is enabled, where the
+// representation of the JSON in the request body is determined by
+// protos JSON encoding:
+//
+// HTTP | gRPC
+// -----|-----
+// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
+// "123456" message { text: "Hi!" })`
+//
+// The special name `*` can be used in the body mapping to define that
+// every field not bound by the path template should be mapped to the
+// request body. This enables the following alternative definition of
+// the update method:
+//
+// service Messaging {
+// rpc UpdateMessage(Message) returns (Message) {
+// option (google.api.http) = {
+// patch: "/v1/messages/{message_id}"
+// body: "*"
+// };
+// }
+// }
+// message Message {
+// string message_id = 1;
+// string text = 2;
+// }
+//
+//
+// The following HTTP JSON to RPC mapping is enabled:
+//
+// HTTP | gRPC
+// -----|-----
+// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
+// "123456" text: "Hi!")`
+//
+// Note that when using `*` in the body mapping, it is not possible to
+// have HTTP parameters, as all fields not bound by the path end in
+// the body. This makes this option more rarely used in practice when
+// defining REST APIs. The common usage of `*` is in custom methods
+// which don't use the URL at all for transferring data.
+//
+// It is possible to define multiple HTTP methods for one RPC by using
+// the `additional_bindings` option. Example:
+//
+// service Messaging {
+// rpc GetMessage(GetMessageRequest) returns (Message) {
+// option (google.api.http) = {
+// get: "/v1/messages/{message_id}"
+// additional_bindings {
+// get: "/v1/users/{user_id}/messages/{message_id}"
+// }
+// };
+// }
+// }
+// message GetMessageRequest {
+// string message_id = 1;
+// string user_id = 2;
+// }
+//
+// This enables the following two alternative HTTP JSON to RPC mappings:
+//
+// HTTP | gRPC
+// -----|-----
+// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
+// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
+// "123456")`
+//
+// ## Rules for HTTP mapping
+//
+// 1. Leaf request fields (recursive expansion nested messages in the request
+// message) are classified into three categories:
+// - Fields referred by the path template. They are passed via the URL path.
+// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP
+// request body.
+// - All other fields are passed via the URL query parameters, and the
+// parameter name is the field path in the request message. A repeated
+// field can be represented as multiple query parameters under the same
+// name.
+// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields
+// are passed via URL path and HTTP request body.
+// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
+// fields are passed via URL path and URL query parameters.
+//
+// ### Path template syntax
+//
+// Template = "/" Segments [ Verb ] ;
+// Segments = Segment { "/" Segment } ;
+// Segment = "*" | "**" | LITERAL | Variable ;
+// Variable = "{" FieldPath [ "=" Segments ] "}" ;
+// FieldPath = IDENT { "." IDENT } ;
+// Verb = ":" LITERAL ;
+//
+// The syntax `*` matches a single URL path segment. The syntax `**` matches
+// zero or more URL path segments, which must be the last part of the URL path
+// except the `Verb`.
+//
+// The syntax `Variable` matches part of the URL path as specified by its
+// template. A variable template must not contain other variables. If a variable
+// matches a single path segment, its template may be omitted, e.g. `{var}`
+// is equivalent to `{var=*}`.
+//
+// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
+// contains any reserved character, such characters should be percent-encoded
+// before the matching.
+//
+// If a variable contains exactly one path segment, such as `"{var}"` or
+// `"{var=*}"`, when such a variable is expanded into a URL path on the client
+// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
+// server side does the reverse decoding. Such variables show up in the
+// [Discovery
+// Document](https://developers.google.com/discovery/v1/reference/apis) as
+// `{var}`.
+//
+// If a variable contains multiple path segments, such as `"{var=foo/*}"`
+// or `"{var=**}"`, when such a variable is expanded into a URL path on the
+// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
+// The server side does the reverse decoding, except "%2F" and "%2f" are left
+// unchanged. Such variables show up in the
+// [Discovery
+// Document](https://developers.google.com/discovery/v1/reference/apis) as
+// `{+var}`.
+//
+// ## Using gRPC API Service Configuration
+//
+// gRPC API Service Configuration (service config) is a configuration language
+// for configuring a gRPC service to become a user-facing product. The
+// service config is simply the YAML representation of the `google.api.Service`
+// proto message.
+//
+// As an alternative to annotating your proto file, you can configure gRPC
+// transcoding in your service config YAML files. You do this by specifying a
+// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
+// effect as the proto annotation. This can be particularly useful if you
+// have a proto that is reused in multiple services. Note that any transcoding
+// specified in the service config will override any matching transcoding
+// configuration in the proto.
+//
+// Example:
+//
+// http:
+// rules:
+// # Selects a gRPC method and applies HttpRule to it.
+// - selector: example.v1.Messaging.GetMessage
+// get: /v1/messages/{message_id}/{sub.subfield}
+//
+// ## Special notes
+//
+// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
+// proto to JSON conversion must follow the [proto3
+// specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
+//
+// While the single segment variable follows the semantics of
+// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
+// Expansion, the multi segment variable **does not** follow RFC 6570 Section
+// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
+// does not expand special characters like `?` and `#`, which would lead
+// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
+// for multi segment variables.
+//
+// The path variables **must not** refer to any repeated or mapped field,
+// because client libraries are not capable of handling such variable expansion.
+//
+// The path variables **must not** capture the leading "/" character. The reason
+// is that the most common use case "{var}" does not capture the leading "/"
+// character. For consistency, all path variables must share the same behavior.
+//
+// Repeated message fields must not be mapped to URL query parameters, because
+// no client library can support such complicated mapping.
+//
+// If an API needs to use a JSON array for request or response body, it can map
+// the request or response body to a repeated field. However, some gRPC
+// Transcoding implementations may not support this feature.
+message HttpRule {
+ // Selects a method to which this rule applies.
+ //
+ // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+ string selector = 1;
+
+ // Determines the URL pattern is matched by this rules. This pattern can be
+ // used with any of the {get|put|post|delete|patch} methods. A custom method
+ // can be defined using the 'custom' field.
+ oneof pattern {
+ // Maps to HTTP GET. Used for listing and getting information about
+ // resources.
+ string get = 2;
+
+ // Maps to HTTP PUT. Used for replacing a resource.
+ string put = 3;
+
+ // Maps to HTTP POST. Used for creating a resource or performing an action.
+ string post = 4;
+
+ // Maps to HTTP DELETE. Used for deleting a resource.
+ string delete = 5;
+
+ // Maps to HTTP PATCH. Used for updating a resource.
+ string patch = 6;
+
+ // The custom pattern is used for specifying an HTTP method that is not
+ // included in the `pattern` field, such as HEAD, or "*" to leave the
+ // HTTP method unspecified for this rule. The wild-card rule is useful
+ // for services that provide content to Web (HTML) clients.
+ CustomHttpPattern custom = 8;
+ }
+
+ // The name of the request field whose value is mapped to the HTTP request
+ // body, or `*` for mapping all request fields not captured by the path
+ // pattern to the HTTP body, or omitted for not having any HTTP request body.
+ //
+ // NOTE: the referred field must be present at the top-level of the request
+ // message type.
+ string body = 7;
+
+ // Optional. The name of the response field whose value is mapped to the HTTP
+ // response body. When omitted, the entire response message will be used
+ // as the HTTP response body.
+ //
+ // NOTE: The referred field must be present at the top-level of the response
+ // message type.
+ string response_body = 12;
+
+ // Additional HTTP bindings for the selector. Nested bindings must
+ // not contain an `additional_bindings` field themselves (that is,
+ // the nesting may only be one level deep).
+ repeated HttpRule additional_bindings = 11;
+}
+
+// A custom pattern is used for defining custom HTTP verb.
+message CustomHttpPattern {
+ // The name of this custom HTTP verb.
+ string kind = 1;
+
+ // The path matched by this custom verb.
+ string path = 2;
+}
diff --git a/examples/authz/proto/google/protobuf/any.proto b/examples/authz/proto/google/protobuf/any.proto
new file mode 100644
index 00000000..4cf3843b
--- /dev/null
+++ b/examples/authz/proto/google/protobuf/any.proto
@@ -0,0 +1,155 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+syntax = "proto3";
+
+package google.protobuf;
+
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option go_package = "types";
+option java_package = "com.google.protobuf";
+option java_outer_classname = "AnyProto";
+option java_multiple_files = true;
+option objc_class_prefix = "GPB";
+
+// `Any` contains an arbitrary serialized protocol buffer message along with a
+// URL that describes the type of the serialized message.
+//
+// Protobuf library provides support to pack/unpack Any values in the form
+// of utility functions or additional generated methods of the Any type.
+//
+// Example 1: Pack and unpack a message in C++.
+//
+// Foo foo = ...;
+// Any any;
+// any.PackFrom(foo);
+// ...
+// if (any.UnpackTo(&foo)) {
+// ...
+// }
+//
+// Example 2: Pack and unpack a message in Java.
+//
+// Foo foo = ...;
+// Any any = Any.pack(foo);
+// ...
+// if (any.is(Foo.class)) {
+// foo = any.unpack(Foo.class);
+// }
+//
+// Example 3: Pack and unpack a message in Python.
+//
+// foo = Foo(...)
+// any = Any()
+// any.Pack(foo)
+// ...
+// if any.Is(Foo.DESCRIPTOR):
+// any.Unpack(foo)
+// ...
+//
+// Example 4: Pack and unpack a message in Go
+//
+// foo := &pb.Foo{...}
+// any, err := ptypes.MarshalAny(foo)
+// ...
+// foo := &pb.Foo{}
+// if err := ptypes.UnmarshalAny(any, foo); err != nil {
+// ...
+// }
+//
+// The pack methods provided by protobuf library will by default use
+// 'type.googleapis.com/full.type.name' as the type URL and the unpack
+// methods only use the fully qualified type name after the last '/'
+// in the type URL, for example "foo.bar.com/x/y.z" will yield type
+// name "y.z".
+//
+//
+// JSON
+// ====
+// The JSON representation of an `Any` value uses the regular
+// representation of the deserialized, embedded message, with an
+// additional field `@type` which contains the type URL. Example:
+//
+// package google.profile;
+// message Person {
+// string first_name = 1;
+// string last_name = 2;
+// }
+//
+// {
+// "@type": "type.googleapis.com/google.profile.Person",
+// "firstName": ,
+// "lastName":
+// }
+//
+// If the embedded message type is well-known and has a custom JSON
+// representation, that representation will be embedded adding a field
+// `value` which holds the custom JSON in addition to the `@type`
+// field. Example (for message [google.protobuf.Duration][]):
+//
+// {
+// "@type": "type.googleapis.com/google.protobuf.Duration",
+// "value": "1.212s"
+// }
+//
+message Any {
+ // A URL/resource name that uniquely identifies the type of the serialized
+ // protocol buffer message. This string must contain at least
+ // one "/" character. The last segment of the URL's path must represent
+ // the fully qualified name of the type (as in
+ // `path/google.protobuf.Duration`). The name should be in a canonical form
+ // (e.g., leading "." is not accepted).
+ //
+ // In practice, teams usually precompile into the binary all types that they
+ // expect it to use in the context of Any. However, for URLs which use the
+ // scheme `http`, `https`, or no scheme, one can optionally set up a type
+ // server that maps type URLs to message definitions as follows:
+ //
+ // * If no scheme is provided, `https` is assumed.
+ // * An HTTP GET on the URL must yield a [google.protobuf.Type][]
+ // value in binary format, or produce an error.
+ // * Applications are allowed to cache lookup results based on the
+ // URL, or have them precompiled into a binary to avoid any
+ // lookup. Therefore, binary compatibility needs to be preserved
+ // on changes to types. (Use versioned type names to manage
+ // breaking changes.)
+ //
+ // Note: this functionality is not currently available in the official
+ // protobuf release, and it is not used for type URLs beginning with
+ // type.googleapis.com.
+ //
+ // Schemes other than `http`, `https` (or the empty scheme) might be
+ // used with implementation specific semantics.
+ //
+ string type_url = 1;
+
+ // Must be a valid serialized protocol buffer of the above specified type.
+ bytes value = 2;
+}
diff --git a/examples/authz/proto/google/protobuf/descriptor.proto b/examples/authz/proto/google/protobuf/descriptor.proto
new file mode 100644
index 00000000..4a08905a
--- /dev/null
+++ b/examples/authz/proto/google/protobuf/descriptor.proto
@@ -0,0 +1,885 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Author: kenton@google.com (Kenton Varda)
+// Based on original Protocol Buffers design by
+// Sanjay Ghemawat, Jeff Dean, and others.
+//
+// The messages in this file describe the definitions found in .proto files.
+// A valid .proto file can be translated directly to a FileDescriptorProto
+// without any other information (e.g. without reading its imports).
+
+
+syntax = "proto2";
+
+package google.protobuf;
+
+option go_package = "descriptor";
+option java_package = "com.google.protobuf";
+option java_outer_classname = "DescriptorProtos";
+option csharp_namespace = "Google.Protobuf.Reflection";
+option objc_class_prefix = "GPB";
+option cc_enable_arenas = true;
+
+// descriptor.proto must be optimized for speed because reflection-based
+// algorithms don't work during bootstrapping.
+option optimize_for = SPEED;
+
+// The protocol compiler can output a FileDescriptorSet containing the .proto
+// files it parses.
+message FileDescriptorSet {
+ repeated FileDescriptorProto file = 1;
+}
+
+// Describes a complete .proto file.
+message FileDescriptorProto {
+ optional string name = 1; // file name, relative to root of source tree
+ optional string package = 2; // e.g. "foo", "foo.bar", etc.
+
+ // Names of files imported by this file.
+ repeated string dependency = 3;
+ // Indexes of the public imported files in the dependency list above.
+ repeated int32 public_dependency = 10;
+ // Indexes of the weak imported files in the dependency list.
+ // For Google-internal migration only. Do not use.
+ repeated int32 weak_dependency = 11;
+
+ // All top-level definitions in this file.
+ repeated DescriptorProto message_type = 4;
+ repeated EnumDescriptorProto enum_type = 5;
+ repeated ServiceDescriptorProto service = 6;
+ repeated FieldDescriptorProto extension = 7;
+
+ optional FileOptions options = 8;
+
+ // This field contains optional information about the original source code.
+ // You may safely remove this entire field without harming runtime
+ // functionality of the descriptors -- the information is needed only by
+ // development tools.
+ optional SourceCodeInfo source_code_info = 9;
+
+ // The syntax of the proto file.
+ // The supported values are "proto2" and "proto3".
+ optional string syntax = 12;
+}
+
+// Describes a message type.
+message DescriptorProto {
+ optional string name = 1;
+
+ repeated FieldDescriptorProto field = 2;
+ repeated FieldDescriptorProto extension = 6;
+
+ repeated DescriptorProto nested_type = 3;
+ repeated EnumDescriptorProto enum_type = 4;
+
+ message ExtensionRange {
+ optional int32 start = 1; // Inclusive.
+ optional int32 end = 2; // Exclusive.
+
+ optional ExtensionRangeOptions options = 3;
+ }
+ repeated ExtensionRange extension_range = 5;
+
+ repeated OneofDescriptorProto oneof_decl = 8;
+
+ optional MessageOptions options = 7;
+
+ // Range of reserved tag numbers. Reserved tag numbers may not be used by
+ // fields or extension ranges in the same message. Reserved ranges may
+ // not overlap.
+ message ReservedRange {
+ optional int32 start = 1; // Inclusive.
+ optional int32 end = 2; // Exclusive.
+ }
+ repeated ReservedRange reserved_range = 9;
+ // Reserved field names, which may not be used by fields in the same message.
+ // A given name may only be reserved once.
+ repeated string reserved_name = 10;
+}
+
+message ExtensionRangeOptions {
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+}
+
+// Describes a field within a message.
+message FieldDescriptorProto {
+ enum Type {
+ // 0 is reserved for errors.
+ // Order is weird for historical reasons.
+ TYPE_DOUBLE = 1;
+ TYPE_FLOAT = 2;
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
+ // negative values are likely.
+ TYPE_INT64 = 3;
+ TYPE_UINT64 = 4;
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
+ // negative values are likely.
+ TYPE_INT32 = 5;
+ TYPE_FIXED64 = 6;
+ TYPE_FIXED32 = 7;
+ TYPE_BOOL = 8;
+ TYPE_STRING = 9;
+ // Tag-delimited aggregate.
+ // Group type is deprecated and not supported in proto3. However, Proto3
+ // implementations should still be able to parse the group wire format and
+ // treat group fields as unknown fields.
+ TYPE_GROUP = 10;
+ TYPE_MESSAGE = 11; // Length-delimited aggregate.
+
+ // New in version 2.
+ TYPE_BYTES = 12;
+ TYPE_UINT32 = 13;
+ TYPE_ENUM = 14;
+ TYPE_SFIXED32 = 15;
+ TYPE_SFIXED64 = 16;
+ TYPE_SINT32 = 17; // Uses ZigZag encoding.
+ TYPE_SINT64 = 18; // Uses ZigZag encoding.
+ }
+
+ enum Label {
+ // 0 is reserved for errors
+ LABEL_OPTIONAL = 1;
+ LABEL_REQUIRED = 2;
+ LABEL_REPEATED = 3;
+ }
+
+ optional string name = 1;
+ optional int32 number = 3;
+ optional Label label = 4;
+
+ // If type_name is set, this need not be set. If both this and type_name
+ // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
+ optional Type type = 5;
+
+ // For message and enum types, this is the name of the type. If the name
+ // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
+ // rules are used to find the type (i.e. first the nested types within this
+ // message are searched, then within the parent, on up to the root
+ // namespace).
+ optional string type_name = 6;
+
+ // For extensions, this is the name of the type being extended. It is
+ // resolved in the same manner as type_name.
+ optional string extendee = 2;
+
+ // For numeric types, contains the original text representation of the value.
+ // For booleans, "true" or "false".
+ // For strings, contains the default text contents (not escaped in any way).
+ // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
+ // TODO(kenton): Base-64 encode?
+ optional string default_value = 7;
+
+ // If set, gives the index of a oneof in the containing type's oneof_decl
+ // list. This field is a member of that oneof.
+ optional int32 oneof_index = 9;
+
+ // JSON name of this field. The value is set by protocol compiler. If the
+ // user has set a "json_name" option on this field, that option's value
+ // will be used. Otherwise, it's deduced from the field's name by converting
+ // it to camelCase.
+ optional string json_name = 10;
+
+ optional FieldOptions options = 8;
+}
+
+// Describes a oneof.
+message OneofDescriptorProto {
+ optional string name = 1;
+ optional OneofOptions options = 2;
+}
+
+// Describes an enum type.
+message EnumDescriptorProto {
+ optional string name = 1;
+
+ repeated EnumValueDescriptorProto value = 2;
+
+ optional EnumOptions options = 3;
+
+ // Range of reserved numeric values. Reserved values may not be used by
+ // entries in the same enum. Reserved ranges may not overlap.
+ //
+ // Note that this is distinct from DescriptorProto.ReservedRange in that it
+ // is inclusive such that it can appropriately represent the entire int32
+ // domain.
+ message EnumReservedRange {
+ optional int32 start = 1; // Inclusive.
+ optional int32 end = 2; // Inclusive.
+ }
+
+ // Range of reserved numeric values. Reserved numeric values may not be used
+ // by enum values in the same enum declaration. Reserved ranges may not
+ // overlap.
+ repeated EnumReservedRange reserved_range = 4;
+
+ // Reserved enum value names, which may not be reused. A given name may only
+ // be reserved once.
+ repeated string reserved_name = 5;
+}
+
+// Describes a value within an enum.
+message EnumValueDescriptorProto {
+ optional string name = 1;
+ optional int32 number = 2;
+
+ optional EnumValueOptions options = 3;
+}
+
+// Describes a service.
+message ServiceDescriptorProto {
+ optional string name = 1;
+ repeated MethodDescriptorProto method = 2;
+
+ optional ServiceOptions options = 3;
+}
+
+// Describes a method of a service.
+message MethodDescriptorProto {
+ optional string name = 1;
+
+ // Input and output type names. These are resolved in the same way as
+ // FieldDescriptorProto.type_name, but must refer to a message type.
+ optional string input_type = 2;
+ optional string output_type = 3;
+
+ optional MethodOptions options = 4;
+
+ // Identifies if client streams multiple client messages
+ optional bool client_streaming = 5 [default = false];
+ // Identifies if server streams multiple server messages
+ optional bool server_streaming = 6 [default = false];
+}
+
+
+// ===================================================================
+// Options
+
+// Each of the definitions above may have "options" attached. These are
+// just annotations which may cause code to be generated slightly differently
+// or may contain hints for code that manipulates protocol messages.
+//
+// Clients may define custom options as extensions of the *Options messages.
+// These extensions may not yet be known at parsing time, so the parser cannot
+// store the values in them. Instead it stores them in a field in the *Options
+// message called uninterpreted_option. This field must have the same name
+// across all *Options messages. We then use this field to populate the
+// extensions when we build a descriptor, at which point all protos have been
+// parsed and so all extensions are known.
+//
+// Extension numbers for custom options may be chosen as follows:
+// * For options which will only be used within a single application or
+// organization, or for experimental options, use field numbers 50000
+// through 99999. It is up to you to ensure that you do not use the
+// same number for multiple options.
+// * For options which will be published and used publicly by multiple
+// independent entities, e-mail protobuf-global-extension-registry@google.com
+// to reserve extension numbers. Simply provide your project name (e.g.
+// Objective-C plugin) and your project website (if available) -- there's no
+// need to explain how you intend to use them. Usually you only need one
+// extension number. You can declare multiple options with only one extension
+// number by putting them in a sub-message. See the Custom Options section of
+// the docs for examples:
+// https://developers.google.com/protocol-buffers/docs/proto#options
+// If this turns out to be popular, a web service will be set up
+// to automatically assign option numbers.
+
+message FileOptions {
+
+ // Sets the Java package where classes generated from this .proto will be
+ // placed. By default, the proto package is used, but this is often
+ // inappropriate because proto packages do not normally start with backwards
+ // domain names.
+ optional string java_package = 1;
+
+
+ // If set, all the classes from the .proto file are wrapped in a single
+ // outer class with the given name. This applies to both Proto1
+ // (equivalent to the old "--one_java_file" option) and Proto2 (where
+ // a .proto always translates to a single class, but you may want to
+ // explicitly choose the class name).
+ optional string java_outer_classname = 8;
+
+ // If set true, then the Java code generator will generate a separate .java
+ // file for each top-level message, enum, and service defined in the .proto
+ // file. Thus, these types will *not* be nested inside the outer class
+ // named by java_outer_classname. However, the outer class will still be
+ // generated to contain the file's getDescriptor() method as well as any
+ // top-level extensions defined in the file.
+ optional bool java_multiple_files = 10 [default = false];
+
+ // This option does nothing.
+ optional bool java_generate_equals_and_hash = 20 [deprecated=true];
+
+ // If set true, then the Java2 code generator will generate code that
+ // throws an exception whenever an attempt is made to assign a non-UTF-8
+ // byte sequence to a string field.
+ // Message reflection will do the same.
+ // However, an extension field still accepts non-UTF-8 byte sequences.
+ // This option has no effect on when used with the lite runtime.
+ optional bool java_string_check_utf8 = 27 [default = false];
+
+
+ // Generated classes can be optimized for speed or code size.
+ enum OptimizeMode {
+ SPEED = 1; // Generate complete code for parsing, serialization,
+ // etc.
+ CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
+ LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
+ }
+ optional OptimizeMode optimize_for = 9 [default = SPEED];
+
+ // Sets the Go package where structs generated from this .proto will be
+ // placed. If omitted, the Go package will be derived from the following:
+ // - The basename of the package import path, if provided.
+ // - Otherwise, the package statement in the .proto file, if present.
+ // - Otherwise, the basename of the .proto file, without extension.
+ optional string go_package = 11;
+
+
+
+
+ // Should generic services be generated in each language? "Generic" services
+ // are not specific to any particular RPC system. They are generated by the
+ // main code generators in each language (without additional plugins).
+ // Generic services were the only kind of service generation supported by
+ // early versions of google.protobuf.
+ //
+ // Generic services are now considered deprecated in favor of using plugins
+ // that generate code specific to your particular RPC system. Therefore,
+ // these default to false. Old code which depends on generic services should
+ // explicitly set them to true.
+ optional bool cc_generic_services = 16 [default = false];
+ optional bool java_generic_services = 17 [default = false];
+ optional bool py_generic_services = 18 [default = false];
+ optional bool php_generic_services = 42 [default = false];
+
+ // Is this file deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for everything in the file, or it will be completely ignored; in the very
+ // least, this is a formalization for deprecating files.
+ optional bool deprecated = 23 [default = false];
+
+ // Enables the use of arenas for the proto messages in this file. This applies
+ // only to generated classes for C++.
+ optional bool cc_enable_arenas = 31 [default = false];
+
+
+ // Sets the objective c class prefix which is prepended to all objective c
+ // generated classes from this .proto. There is no default.
+ optional string objc_class_prefix = 36;
+
+ // Namespace for generated classes; defaults to the package.
+ optional string csharp_namespace = 37;
+
+ // By default Swift generators will take the proto package and CamelCase it
+ // replacing '.' with underscore and use that to prefix the types/symbols
+ // defined. When this options is provided, they will use this value instead
+ // to prefix the types/symbols defined.
+ optional string swift_prefix = 39;
+
+ // Sets the php class prefix which is prepended to all php generated classes
+ // from this .proto. Default is empty.
+ optional string php_class_prefix = 40;
+
+ // Use this option to change the namespace of php generated classes. Default
+ // is empty. When this option is empty, the package name will be used for
+ // determining the namespace.
+ optional string php_namespace = 41;
+
+ // Use this option to change the namespace of php generated metadata classes.
+ // Default is empty. When this option is empty, the proto file name will be
+ // used for determining the namespace.
+ optional string php_metadata_namespace = 44;
+
+ // Use this option to change the package of ruby generated classes. Default
+ // is empty. When this option is not set, the package name will be used for
+ // determining the ruby package.
+ optional string ruby_package = 45;
+
+
+ // The parser stores options it doesn't recognize here.
+ // See the documentation for the "Options" section above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message.
+ // See the documentation for the "Options" section above.
+ extensions 1000 to max;
+
+ //reserved 38;
+}
+
+message MessageOptions {
+ // Set true to use the old proto1 MessageSet wire format for extensions.
+ // This is provided for backwards-compatibility with the MessageSet wire
+ // format. You should not use this for any other reason: It's less
+ // efficient, has fewer features, and is more complicated.
+ //
+ // The message must be defined exactly as follows:
+ // message Foo {
+ // option message_set_wire_format = true;
+ // extensions 4 to max;
+ // }
+ // Note that the message cannot have any defined fields; MessageSets only
+ // have extensions.
+ //
+ // All extensions of your type must be singular messages; e.g. they cannot
+ // be int32s, enums, or repeated messages.
+ //
+ // Because this is an option, the above two restrictions are not enforced by
+ // the protocol compiler.
+ optional bool message_set_wire_format = 1 [default = false];
+
+ // Disables the generation of the standard "descriptor()" accessor, which can
+ // conflict with a field of the same name. This is meant to make migration
+ // from proto1 easier; new code should avoid fields named "descriptor".
+ optional bool no_standard_descriptor_accessor = 2 [default = false];
+
+ // Is this message deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the message, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating messages.
+ optional bool deprecated = 3 [default = false];
+
+ // Whether the message is an automatically generated map entry type for the
+ // maps field.
+ //
+ // For maps fields:
+ // map map_field = 1;
+ // The parsed descriptor looks like:
+ // message MapFieldEntry {
+ // option map_entry = true;
+ // optional KeyType key = 1;
+ // optional ValueType value = 2;
+ // }
+ // repeated MapFieldEntry map_field = 1;
+ //
+ // Implementations may choose not to generate the map_entry=true message, but
+ // use a native map in the target language to hold the keys and values.
+ // The reflection APIs in such implementations still need to work as
+ // if the field is a repeated message field.
+ //
+ // NOTE: Do not set the option in .proto files. Always use the maps syntax
+ // instead. The option should only be implicitly set by the proto compiler
+ // parser.
+ optional bool map_entry = 7;
+
+ //reserved 8; // javalite_serializable
+ //reserved 9; // javanano_as_lite
+
+
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+}
+
+message FieldOptions {
+ // The ctype option instructs the C++ code generator to use a different
+ // representation of the field than it normally would. See the specific
+ // options below. This option is not yet implemented in the open source
+ // release -- sorry, we'll try to include it in a future version!
+ optional CType ctype = 1 [default = STRING];
+ enum CType {
+ // Default mode.
+ STRING = 0;
+
+ CORD = 1;
+
+ STRING_PIECE = 2;
+ }
+ // The packed option can be enabled for repeated primitive fields to enable
+ // a more efficient representation on the wire. Rather than repeatedly
+ // writing the tag and type for each element, the entire array is encoded as
+ // a single length-delimited blob. In proto3, only explicit setting it to
+ // false will avoid using packed encoding.
+ optional bool packed = 2;
+
+ // The jstype option determines the JavaScript type used for values of the
+ // field. The option is permitted only for 64 bit integral and fixed types
+ // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
+ // is represented as JavaScript string, which avoids loss of precision that
+ // can happen when a large value is converted to a floating point JavaScript.
+ // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
+ // use the JavaScript "number" type. The behavior of the default option
+ // JS_NORMAL is implementation dependent.
+ //
+ // This option is an enum to permit additional types to be added, e.g.
+ // goog.math.Integer.
+ optional JSType jstype = 6 [default = JS_NORMAL];
+ enum JSType {
+ // Use the default type.
+ JS_NORMAL = 0;
+
+ // Use JavaScript strings.
+ JS_STRING = 1;
+
+ // Use JavaScript numbers.
+ JS_NUMBER = 2;
+ }
+
+ // Should this field be parsed lazily? Lazy applies only to message-type
+ // fields. It means that when the outer message is initially parsed, the
+ // inner message's contents will not be parsed but instead stored in encoded
+ // form. The inner message will actually be parsed when it is first accessed.
+ //
+ // This is only a hint. Implementations are free to choose whether to use
+ // eager or lazy parsing regardless of the value of this option. However,
+ // setting this option true suggests that the protocol author believes that
+ // using lazy parsing on this field is worth the additional bookkeeping
+ // overhead typically needed to implement it.
+ //
+ // This option does not affect the public interface of any generated code;
+ // all method signatures remain the same. Furthermore, thread-safety of the
+ // interface is not affected by this option; const methods remain safe to
+ // call from multiple threads concurrently, while non-const methods continue
+ // to require exclusive access.
+ //
+ //
+ // Note that implementations may choose not to check required fields within
+ // a lazy sub-message. That is, calling IsInitialized() on the outer message
+ // may return true even if the inner message has missing required fields.
+ // This is necessary because otherwise the inner message would have to be
+ // parsed in order to perform the check, defeating the purpose of lazy
+ // parsing. An implementation which chooses not to check required fields
+ // must be consistent about it. That is, for any particular sub-message, the
+ // implementation must either *always* check its required fields, or *never*
+ // check its required fields, regardless of whether or not the message has
+ // been parsed.
+ optional bool lazy = 5 [default = false];
+
+ // Is this field deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for accessors, or it will be completely ignored; in the very least, this
+ // is a formalization for deprecating fields.
+ optional bool deprecated = 3 [default = false];
+
+ // For Google-internal migration only. Do not use.
+ optional bool weak = 10 [default = false];
+
+
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+
+ //reserved 4; // removed jtype
+}
+
+message OneofOptions {
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+}
+
+message EnumOptions {
+
+ // Set this option to true to allow mapping different tag names to the same
+ // value.
+ optional bool allow_alias = 2;
+
+ // Is this enum deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the enum, or it will be completely ignored; in the very least, this
+ // is a formalization for deprecating enums.
+ optional bool deprecated = 3 [default = false];
+
+ //reserved 5; // javanano_as_lite
+
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+}
+
+message EnumValueOptions {
+ // Is this enum value deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the enum value, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating enum values.
+ optional bool deprecated = 1 [default = false];
+
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+}
+
+message ServiceOptions {
+
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
+ // framework. We apologize for hoarding these numbers to ourselves, but
+ // we were already using them long before we decided to release Protocol
+ // Buffers.
+
+ // Is this service deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the service, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating services.
+ optional bool deprecated = 33 [default = false];
+
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+}
+
+message MethodOptions {
+
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
+ // framework. We apologize for hoarding these numbers to ourselves, but
+ // we were already using them long before we decided to release Protocol
+ // Buffers.
+
+ // Is this method deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the method, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating methods.
+ optional bool deprecated = 33 [default = false];
+
+ // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
+ // or neither? HTTP based RPC implementation may choose GET verb for safe
+ // methods, and PUT verb for idempotent methods instead of the default POST.
+ enum IdempotencyLevel {
+ IDEMPOTENCY_UNKNOWN = 0;
+ NO_SIDE_EFFECTS = 1; // implies idempotent
+ IDEMPOTENT = 2; // idempotent, but may have side effects
+ }
+ optional IdempotencyLevel idempotency_level = 34
+ [default = IDEMPOTENCY_UNKNOWN];
+
+ // The parser stores options it doesn't recognize here. See above.
+ repeated UninterpretedOption uninterpreted_option = 999;
+
+ // Clients can define custom options in extensions of this message. See above.
+ extensions 1000 to max;
+}
+
+
+// A message representing a option the parser does not recognize. This only
+// appears in options protos created by the compiler::Parser class.
+// DescriptorPool resolves these when building Descriptor objects. Therefore,
+// options protos in descriptor objects (e.g. returned by Descriptor::options(),
+// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
+// in them.
+message UninterpretedOption {
+ // The name of the uninterpreted option. Each string represents a segment in
+ // a dot-separated name. is_extension is true iff a segment represents an
+ // extension (denoted with parentheses in options specs in .proto files).
+ // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
+ // "foo.(bar.baz).qux".
+ message NamePart {
+ required string name_part = 1;
+ required bool is_extension = 2;
+ }
+ repeated NamePart name = 2;
+
+ // The value of the uninterpreted option, in whatever type the tokenizer
+ // identified it as during parsing. Exactly one of these should be set.
+ optional string identifier_value = 3;
+ optional uint64 positive_int_value = 4;
+ optional int64 negative_int_value = 5;
+ optional double double_value = 6;
+ optional bytes string_value = 7;
+ optional string aggregate_value = 8;
+}
+
+// ===================================================================
+// Optional source code info
+
+// Encapsulates information about the original source file from which a
+// FileDescriptorProto was generated.
+message SourceCodeInfo {
+ // A Location identifies a piece of source code in a .proto file which
+ // corresponds to a particular definition. This information is intended
+ // to be useful to IDEs, code indexers, documentation generators, and similar
+ // tools.
+ //
+ // For example, say we have a file like:
+ // message Foo {
+ // optional string foo = 1;
+ // }
+ // Let's look at just the field definition:
+ // optional string foo = 1;
+ // ^ ^^ ^^ ^ ^^^
+ // a bc de f ghi
+ // We have the following locations:
+ // span path represents
+ // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
+ // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
+ // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
+ // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
+ // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
+ //
+ // Notes:
+ // - A location may refer to a repeated field itself (i.e. not to any
+ // particular index within it). This is used whenever a set of elements are
+ // logically enclosed in a single code segment. For example, an entire
+ // extend block (possibly containing multiple extension definitions) will
+ // have an outer location whose path refers to the "extensions" repeated
+ // field without an index.
+ // - Multiple locations may have the same path. This happens when a single
+ // logical declaration is spread out across multiple places. The most
+ // obvious example is the "extend" block again -- there may be multiple
+ // extend blocks in the same scope, each of which will have the same path.
+ // - A location's span is not always a subset of its parent's span. For
+ // example, the "extendee" of an extension declaration appears at the
+ // beginning of the "extend" block and is shared by all extensions within
+ // the block.
+ // - Just because a location's span is a subset of some other location's span
+ // does not mean that it is a descendant. For example, a "group" defines
+ // both a type and a field in a single declaration. Thus, the locations
+ // corresponding to the type and field and their components will overlap.
+ // - Code which tries to interpret locations should probably be designed to
+ // ignore those that it doesn't understand, as more types of locations could
+ // be recorded in the future.
+ repeated Location location = 1;
+ message Location {
+ // Identifies which part of the FileDescriptorProto was defined at this
+ // location.
+ //
+ // Each element is a field number or an index. They form a path from
+ // the root FileDescriptorProto to the place where the definition. For
+ // example, this path:
+ // [ 4, 3, 2, 7, 1 ]
+ // refers to:
+ // file.message_type(3) // 4, 3
+ // .field(7) // 2, 7
+ // .name() // 1
+ // This is because FileDescriptorProto.message_type has field number 4:
+ // repeated DescriptorProto message_type = 4;
+ // and DescriptorProto.field has field number 2:
+ // repeated FieldDescriptorProto field = 2;
+ // and FieldDescriptorProto.name has field number 1:
+ // optional string name = 1;
+ //
+ // Thus, the above path gives the location of a field name. If we removed
+ // the last element:
+ // [ 4, 3, 2, 7 ]
+ // this path refers to the whole field declaration (from the beginning
+ // of the label to the terminating semicolon).
+ repeated int32 path = 1 [packed = true];
+
+ // Always has exactly three or four elements: start line, start column,
+ // end line (optional, otherwise assumed same as start line), end column.
+ // These are packed into a single field for efficiency. Note that line
+ // and column numbers are zero-based -- typically you will want to add
+ // 1 to each before displaying to a user.
+ repeated int32 span = 2 [packed = true];
+
+ // If this SourceCodeInfo represents a complete declaration, these are any
+ // comments appearing before and after the declaration which appear to be
+ // attached to the declaration.
+ //
+ // A series of line comments appearing on consecutive lines, with no other
+ // tokens appearing on those lines, will be treated as a single comment.
+ //
+ // leading_detached_comments will keep paragraphs of comments that appear
+ // before (but not connected to) the current element. Each paragraph,
+ // separated by empty lines, will be one comment element in the repeated
+ // field.
+ //
+ // Only the comment content is provided; comment markers (e.g. //) are
+ // stripped out. For block comments, leading whitespace and an asterisk
+ // will be stripped from the beginning of each line other than the first.
+ // Newlines are included in the output.
+ //
+ // Examples:
+ //
+ // optional int32 foo = 1; // Comment attached to foo.
+ // // Comment attached to bar.
+ // optional int32 bar = 2;
+ //
+ // optional string baz = 3;
+ // // Comment attached to baz.
+ // // Another line attached to baz.
+ //
+ // // Comment attached to qux.
+ // //
+ // // Another line attached to qux.
+ // optional double qux = 4;
+ //
+ // // Detached comment for corge. This is not leading or trailing comments
+ // // to qux or corge because there are blank lines separating it from
+ // // both.
+ //
+ // // Detached comment for corge paragraph 2.
+ //
+ // optional string corge = 5;
+ // /* Block comment attached
+ // * to corge. Leading asterisks
+ // * will be removed. */
+ // /* Block comment attached to
+ // * grault. */
+ // optional int32 grault = 6;
+ //
+ // // ignored detached comments.
+ optional string leading_comments = 3;
+ optional string trailing_comments = 4;
+ repeated string leading_detached_comments = 6;
+ }
+}
+
+// Describes the relationship between generated code and its original source
+// file. A GeneratedCodeInfo message is associated with only one generated
+// source file, but may contain references to different source .proto files.
+message GeneratedCodeInfo {
+ // An Annotation connects some span of text in generated code to an element
+ // of its generating .proto file.
+ repeated Annotation annotation = 1;
+ message Annotation {
+ // Identifies the element in the original source .proto file. This field
+ // is formatted the same as SourceCodeInfo.Location.path.
+ repeated int32 path = 1 [packed = true];
+
+ // Identifies the filesystem path to the original source .proto.
+ optional string source_file = 2;
+
+ // Identifies the starting offset in bytes in the generated code
+ // that relates to the identified object.
+ optional int32 begin = 3;
+
+ // Identifies the ending offset in bytes in the generated code that
+ // relates to the identified offset. The end offset should be one past
+ // the last relevant byte (so the length of the text = end - begin).
+ optional int32 end = 4;
+ }
+}
diff --git a/examples/authz/proto/google/protobuf/duration.proto b/examples/authz/proto/google/protobuf/duration.proto
new file mode 100644
index 00000000..b14bea5d
--- /dev/null
+++ b/examples/authz/proto/google/protobuf/duration.proto
@@ -0,0 +1,116 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+syntax = "proto3";
+
+package google.protobuf;
+
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option cc_enable_arenas = true;
+option go_package = "types";
+option java_package = "com.google.protobuf";
+option java_outer_classname = "DurationProto";
+option java_multiple_files = true;
+option objc_class_prefix = "GPB";
+
+// A Duration represents a signed, fixed-length span of time represented
+// as a count of seconds and fractions of seconds at nanosecond
+// resolution. It is independent of any calendar and concepts like "day"
+// or "month". It is related to Timestamp in that the difference between
+// two Timestamp values is a Duration and it can be added or subtracted
+// from a Timestamp. Range is approximately +-10,000 years.
+//
+// # Examples
+//
+// Example 1: Compute Duration from two Timestamps in pseudo code.
+//
+// Timestamp start = ...;
+// Timestamp end = ...;
+// Duration duration = ...;
+//
+// duration.seconds = end.seconds - start.seconds;
+// duration.nanos = end.nanos - start.nanos;
+//
+// if (duration.seconds < 0 && duration.nanos > 0) {
+// duration.seconds += 1;
+// duration.nanos -= 1000000000;
+// } else if (durations.seconds > 0 && duration.nanos < 0) {
+// duration.seconds -= 1;
+// duration.nanos += 1000000000;
+// }
+//
+// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
+//
+// Timestamp start = ...;
+// Duration duration = ...;
+// Timestamp end = ...;
+//
+// end.seconds = start.seconds + duration.seconds;
+// end.nanos = start.nanos + duration.nanos;
+//
+// if (end.nanos < 0) {
+// end.seconds -= 1;
+// end.nanos += 1000000000;
+// } else if (end.nanos >= 1000000000) {
+// end.seconds += 1;
+// end.nanos -= 1000000000;
+// }
+//
+// Example 3: Compute Duration from datetime.timedelta in Python.
+//
+// td = datetime.timedelta(days=3, minutes=10)
+// duration = Duration()
+// duration.FromTimedelta(td)
+//
+// # JSON Mapping
+//
+// In JSON format, the Duration type is encoded as a string rather than an
+// object, where the string ends in the suffix "s" (indicating seconds) and
+// is preceded by the number of seconds, with nanoseconds expressed as
+// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
+// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
+// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
+// microsecond should be expressed in JSON format as "3.000001s".
+//
+//
+message Duration {
+ // Signed seconds of the span of time. Must be from -315,576,000,000
+ // to +315,576,000,000 inclusive. Note: these bounds are computed from:
+ // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
+ int64 seconds = 1;
+
+ // Signed fractions of a second at nanosecond resolution of the span
+ // of time. Durations less than one second are represented with a 0
+ // `seconds` field and a positive or negative `nanos` field. For durations
+ // of one second or more, a non-zero value for the `nanos` field must be
+ // of the same sign as the `seconds` field. Must be from -999,999,999
+ // to +999,999,999 inclusive.
+ int32 nanos = 2;
+}
diff --git a/examples/authz/proto/google/protobuf/empty.proto b/examples/authz/proto/google/protobuf/empty.proto
new file mode 100644
index 00000000..6057c852
--- /dev/null
+++ b/examples/authz/proto/google/protobuf/empty.proto
@@ -0,0 +1,52 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+syntax = "proto3";
+
+package google.protobuf;
+
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option go_package = "types";
+option java_package = "com.google.protobuf";
+option java_outer_classname = "EmptyProto";
+option java_multiple_files = true;
+option objc_class_prefix = "GPB";
+option cc_enable_arenas = true;
+
+// A generic empty message that you can re-use to avoid defining duplicated
+// empty messages in your APIs. A typical example is to use it as the request
+// or the response type of an API method. For instance:
+//
+// service Foo {
+// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
+// }
+//
+// The JSON representation for `Empty` is empty JSON object `{}`.
+message Empty {}
diff --git a/examples/authz/proto/google/protobuf/timestamp.proto b/examples/authz/proto/google/protobuf/timestamp.proto
new file mode 100644
index 00000000..0ebe36ea
--- /dev/null
+++ b/examples/authz/proto/google/protobuf/timestamp.proto
@@ -0,0 +1,138 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+syntax = "proto3";
+
+package google.protobuf;
+
+option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option cc_enable_arenas = true;
+option go_package = "types";
+option java_package = "com.google.protobuf";
+option java_outer_classname = "TimestampProto";
+option java_multiple_files = true;
+option objc_class_prefix = "GPB";
+
+// A Timestamp represents a point in time independent of any time zone or local
+// calendar, encoded as a count of seconds and fractions of seconds at
+// nanosecond resolution. The count is relative to an epoch at UTC midnight on
+// January 1, 1970, in the proleptic Gregorian calendar which extends the
+// Gregorian calendar backwards to year one.
+//
+// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
+// second table is needed for interpretation, using a [24-hour linear
+// smear](https://developers.google.com/time/smear).
+//
+// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
+// restricting to that range, we ensure that we can convert to and from [RFC
+// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
+//
+// # Examples
+//
+// Example 1: Compute Timestamp from POSIX `time()`.
+//
+// Timestamp timestamp;
+// timestamp.set_seconds(time(NULL));
+// timestamp.set_nanos(0);
+//
+// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
+//
+// struct timeval tv;
+// gettimeofday(&tv, NULL);
+//
+// Timestamp timestamp;
+// timestamp.set_seconds(tv.tv_sec);
+// timestamp.set_nanos(tv.tv_usec * 1000);
+//
+// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
+//
+// FILETIME ft;
+// GetSystemTimeAsFileTime(&ft);
+// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
+//
+// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
+// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
+// Timestamp timestamp;
+// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
+// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
+//
+// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
+//
+// long millis = System.currentTimeMillis();
+//
+// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
+// .setNanos((int) ((millis % 1000) * 1000000)).build();
+//
+//
+// Example 5: Compute Timestamp from current time in Python.
+//
+// timestamp = Timestamp()
+// timestamp.GetCurrentTime()
+//
+// # JSON Mapping
+//
+// In JSON format, the Timestamp type is encoded as a string in the
+// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
+// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
+// where {year} is always expressed using four digits while {month}, {day},
+// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
+// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
+// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
+// is required. A proto3 JSON serializer should always use UTC (as indicated by
+// "Z") when printing the Timestamp type and a proto3 JSON parser should be
+// able to accept both UTC and other timezones (as indicated by an offset).
+//
+// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
+// 01:30 UTC on January 15, 2017.
+//
+// In JavaScript, one can convert a Date object to this format using the
+// standard
+// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
+// method. In Python, a standard `datetime.datetime` object can be converted
+// to this format using
+// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
+// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
+// the Joda Time's [`ISODateTimeFormat.dateTime()`](
+// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
+// ) to obtain a formatter capable of generating timestamps in this format.
+//
+//
+message Timestamp {
+ // Represents seconds of UTC time since Unix epoch
+ // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+ // 9999-12-31T23:59:59Z inclusive.
+ int64 seconds = 1;
+
+ // Non-negative fractions of a second at nanosecond resolution. Negative
+ // second values with fractions must still have non-negative nanos values
+ // that count forward in time. Must be from 0 to 999,999,999
+ // inclusive.
+ int32 nanos = 2;
+}
diff --git a/examples/authz/proto/ibc/LICENSE b/examples/authz/proto/ibc/LICENSE
new file mode 100644
index 00000000..c04a16b3
--- /dev/null
+++ b/examples/authz/proto/ibc/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 COSMOS
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/examples/authz/proto/ibc/README.md b/examples/authz/proto/ibc/README.md
new file mode 100644
index 00000000..e4ee70c7
--- /dev/null
+++ b/examples/authz/proto/ibc/README.md
@@ -0,0 +1 @@
+# ibc
\ No newline at end of file
diff --git a/examples/authz/proto/ibc/applications/transfer/v1/genesis.proto b/examples/authz/proto/ibc/applications/transfer/v1/genesis.proto
new file mode 100644
index 00000000..73d9fddd
--- /dev/null
+++ b/examples/authz/proto/ibc/applications/transfer/v1/genesis.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+
+package ibc.applications.transfer.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types";
+
+import "ibc/applications/transfer/v1/transfer.proto";
+import "gogoproto/gogo.proto";
+
+// GenesisState defines the ibc-transfer genesis state
+message GenesisState {
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ repeated DenomTrace denom_traces = 2 [
+ (gogoproto.castrepeated) = "Traces",
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"denom_traces\""
+ ];
+ Params params = 3 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/ibc/applications/transfer/v1/query.proto b/examples/authz/proto/ibc/applications/transfer/v1/query.proto
new file mode 100644
index 00000000..f2faa87b
--- /dev/null
+++ b/examples/authz/proto/ibc/applications/transfer/v1/query.proto
@@ -0,0 +1,67 @@
+syntax = "proto3";
+
+package ibc.applications.transfer.v1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "ibc/applications/transfer/v1/transfer.proto";
+import "google/api/annotations.proto";
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types";
+
+// Query provides defines the gRPC querier service.
+service Query {
+ // DenomTrace queries a denomination trace information.
+ rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) {
+ option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}";
+ }
+
+ // DenomTraces queries all denomination traces.
+ rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) {
+ option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces";
+ }
+
+ // Params queries all parameters of the ibc-transfer module.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/ibc/apps/transfer/v1/params";
+ }
+}
+
+// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC
+// method
+message QueryDenomTraceRequest {
+ // hash (in hex format) of the denomination trace information.
+ string hash = 1;
+}
+
+// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC
+// method.
+message QueryDenomTraceResponse {
+ // denom_trace returns the requested denomination trace information.
+ DenomTrace denom_trace = 1;
+}
+
+// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC
+// method
+message QueryDenomTracesRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC
+// method.
+message QueryDenomTracesResponse {
+ // denom_traces returns all denominations trace information.
+ repeated DenomTrace denom_traces = 1 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false];
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1;
+}
diff --git a/examples/authz/proto/ibc/applications/transfer/v1/transfer.proto b/examples/authz/proto/ibc/applications/transfer/v1/transfer.proto
new file mode 100644
index 00000000..10ce92f9
--- /dev/null
+++ b/examples/authz/proto/ibc/applications/transfer/v1/transfer.proto
@@ -0,0 +1,30 @@
+syntax = "proto3";
+
+package ibc.applications.transfer.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types";
+
+import "gogoproto/gogo.proto";
+
+// DenomTrace contains the base denomination for ICS20 fungible tokens and the
+// source tracing information path.
+message DenomTrace {
+ // path defines the chain of port/channel identifiers used for tracing the
+ // source of the fungible token.
+ string path = 1;
+ // base denomination of the relayed fungible token.
+ string base_denom = 2;
+}
+
+// Params defines the set of IBC transfer parameters.
+// NOTE: To prevent a single token from being transferred, set the
+// TransfersEnabled parameter to true and then set the bank module's SendEnabled
+// parameter for the denomination to false.
+message Params {
+ // send_enabled enables or disables all cross-chain token transfers from this
+ // chain.
+ bool send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled\""];
+ // receive_enabled enables or disables all cross-chain token transfers to this
+ // chain.
+ bool receive_enabled = 2 [(gogoproto.moretags) = "yaml:\"receive_enabled\""];
+}
diff --git a/examples/authz/proto/ibc/applications/transfer/v1/tx.proto b/examples/authz/proto/ibc/applications/transfer/v1/tx.proto
new file mode 100644
index 00000000..dfc480d0
--- /dev/null
+++ b/examples/authz/proto/ibc/applications/transfer/v1/tx.proto
@@ -0,0 +1,44 @@
+syntax = "proto3";
+
+package ibc.applications.transfer.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types";
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "ibc/core/client/v1/client.proto";
+
+// Msg defines the ibc/transfer Msg service.
+service Msg {
+ // Transfer defines a rpc handler method for MsgTransfer.
+ rpc Transfer(MsgTransfer) returns (MsgTransferResponse);
+}
+
+// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between
+// ICS20 enabled chains. See ICS Spec here:
+// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures
+message MsgTransfer {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // the port on which the packet will be sent
+ string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""];
+ // the channel by which the packet will be sent
+ string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""];
+ // the tokens to be transferred
+ cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false];
+ // the sender address
+ string sender = 4;
+ // the recipient address on the destination chain
+ string receiver = 5;
+ // Timeout height relative to the current block height.
+ // The timeout is disabled when set to 0.
+ ibc.core.client.v1.Height timeout_height = 6
+ [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false];
+ // Timeout timestamp (in nanoseconds) relative to the current block timestamp.
+ // The timeout is disabled when set to 0.
+ uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];
+}
+
+// MsgTransferResponse defines the Msg/Transfer response type.
+message MsgTransferResponse {}
diff --git a/examples/authz/proto/ibc/applications/transfer/v2/packet.proto b/examples/authz/proto/ibc/applications/transfer/v2/packet.proto
new file mode 100644
index 00000000..593392a9
--- /dev/null
+++ b/examples/authz/proto/ibc/applications/transfer/v2/packet.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+
+package ibc.applications.transfer.v2;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types";
+
+// FungibleTokenPacketData defines a struct for the packet payload
+// See FungibleTokenPacketData spec:
+// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures
+message FungibleTokenPacketData {
+ // the token denomination to be transferred
+ string denom = 1;
+ // the token amount to be transferred
+ string amount = 2;
+ // the sender address
+ string sender = 3;
+ // the recipient address on the destination chain
+ string receiver = 4;
+}
diff --git a/examples/authz/proto/ibc/core/channel/v1/channel.proto b/examples/authz/proto/ibc/core/channel/v1/channel.proto
new file mode 100644
index 00000000..c7f42dbf
--- /dev/null
+++ b/examples/authz/proto/ibc/core/channel/v1/channel.proto
@@ -0,0 +1,148 @@
+syntax = "proto3";
+
+package ibc.core.channel.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types";
+
+import "gogoproto/gogo.proto";
+import "ibc/core/client/v1/client.proto";
+
+// Channel defines pipeline for exactly-once packet delivery between specific
+// modules on separate blockchains, which has at least one end capable of
+// sending packets and one end capable of receiving packets.
+message Channel {
+ option (gogoproto.goproto_getters) = false;
+
+ // current state of the channel end
+ State state = 1;
+ // whether the channel is ordered or unordered
+ Order ordering = 2;
+ // counterparty channel end
+ Counterparty counterparty = 3 [(gogoproto.nullable) = false];
+ // list of connection identifiers, in order, along which packets sent on
+ // this channel will travel
+ repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""];
+ // opaque channel version, which is agreed upon during the handshake
+ string version = 5;
+}
+
+// IdentifiedChannel defines a channel with additional port and channel
+// identifier fields.
+message IdentifiedChannel {
+ option (gogoproto.goproto_getters) = false;
+
+ // current state of the channel end
+ State state = 1;
+ // whether the channel is ordered or unordered
+ Order ordering = 2;
+ // counterparty channel end
+ Counterparty counterparty = 3 [(gogoproto.nullable) = false];
+ // list of connection identifiers, in order, along which packets sent on
+ // this channel will travel
+ repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""];
+ // opaque channel version, which is agreed upon during the handshake
+ string version = 5;
+ // port identifier
+ string port_id = 6;
+ // channel identifier
+ string channel_id = 7;
+}
+
+// State defines if a channel is in one of the following states:
+// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.
+enum State {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // Default State
+ STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"];
+ // A channel has just started the opening handshake.
+ STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"];
+ // A channel has acknowledged the handshake step on the counterparty chain.
+ STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"];
+ // A channel has completed the handshake. Open channels are
+ // ready to send and receive packets.
+ STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"];
+ // A channel has been closed and can no longer be used to send or receive
+ // packets.
+ STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"];
+}
+
+// Order defines if a channel is ORDERED or UNORDERED
+enum Order {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // zero-value for channel ordering
+ ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"];
+ // packets can be delivered in any order, which may differ from the order in
+ // which they were sent.
+ ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"];
+ // packets are delivered exactly in the order which they were sent
+ ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"];
+}
+
+// Counterparty defines a channel end counterparty
+message Counterparty {
+ option (gogoproto.goproto_getters) = false;
+
+ // port on the counterparty chain which owns the other end of the channel.
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ // channel end on the counterparty chain
+ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
+}
+
+// Packet defines a type that carries data across different chains through IBC
+message Packet {
+ option (gogoproto.goproto_getters) = false;
+
+ // number corresponds to the order of sends and receives, where a Packet
+ // with an earlier sequence number must be sent and received before a Packet
+ // with a later sequence number.
+ uint64 sequence = 1;
+ // identifies the port on the sending chain.
+ string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""];
+ // identifies the channel end on the sending chain.
+ string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""];
+ // identifies the port on the receiving chain.
+ string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""];
+ // identifies the channel end on the receiving chain.
+ string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""];
+ // actual opaque bytes transferred directly to the application module
+ bytes data = 6;
+ // block height after which the packet times out
+ ibc.core.client.v1.Height timeout_height = 7
+ [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false];
+ // block timestamp (in nanoseconds) after which the packet times out
+ uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];
+}
+
+// PacketState defines the generic type necessary to retrieve and store
+// packet commitments, acknowledgements, and receipts.
+// Caller is responsible for knowing the context necessary to interpret this
+// state as a commitment, acknowledgement, or a receipt.
+message PacketState {
+ option (gogoproto.goproto_getters) = false;
+
+ // channel port identifier.
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ // channel unique identifier.
+ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
+ // packet sequence.
+ uint64 sequence = 3;
+ // embedded data that represents packet state.
+ bytes data = 4;
+}
+
+// Acknowledgement is the recommended acknowledgement format to be used by
+// app-specific protocols.
+// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental
+// conflicts with other protobuf message formats used for acknowledgements.
+// The first byte of any message with this format will be the non-ASCII values
+// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS:
+// https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope
+message Acknowledgement {
+ // response contains either a result or an error and must be non-empty
+ oneof response {
+ bytes result = 21;
+ string error = 22;
+ }
+}
diff --git a/examples/authz/proto/ibc/core/channel/v1/genesis.proto b/examples/authz/proto/ibc/core/channel/v1/genesis.proto
new file mode 100644
index 00000000..38b57ed6
--- /dev/null
+++ b/examples/authz/proto/ibc/core/channel/v1/genesis.proto
@@ -0,0 +1,32 @@
+syntax = "proto3";
+
+package ibc.core.channel.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types";
+
+import "gogoproto/gogo.proto";
+import "ibc/core/channel/v1/channel.proto";
+
+// GenesisState defines the ibc channel submodule's genesis state.
+message GenesisState {
+ repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false];
+ repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false];
+ repeated PacketState commitments = 3 [(gogoproto.nullable) = false];
+ repeated PacketState receipts = 4 [(gogoproto.nullable) = false];
+ repeated PacketSequence send_sequences = 5
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"send_sequences\""];
+ repeated PacketSequence recv_sequences = 6
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recv_sequences\""];
+ repeated PacketSequence ack_sequences = 7
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ack_sequences\""];
+ // the sequence for the next generated channel identifier
+ uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""];
+}
+
+// PacketSequence defines the genesis type necessary to retrieve and store
+// next send and receive sequences.
+message PacketSequence {
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
+ uint64 sequence = 3;
+}
diff --git a/examples/authz/proto/ibc/core/channel/v1/query.proto b/examples/authz/proto/ibc/core/channel/v1/query.proto
new file mode 100644
index 00000000..212cb645
--- /dev/null
+++ b/examples/authz/proto/ibc/core/channel/v1/query.proto
@@ -0,0 +1,376 @@
+syntax = "proto3";
+
+package ibc.core.channel.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types";
+
+import "ibc/core/client/v1/client.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "ibc/core/channel/v1/channel.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/any.proto";
+import "gogoproto/gogo.proto";
+
+// Query provides defines the gRPC querier service
+service Query {
+ // Channel queries an IBC Channel.
+ rpc Channel(QueryChannelRequest) returns (QueryChannelResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}";
+ }
+
+ // Channels queries all the IBC channels of a chain.
+ rpc Channels(QueryChannelsRequest) returns (QueryChannelsResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels";
+ }
+
+ // ConnectionChannels queries all the channels associated with a connection
+ // end.
+ rpc ConnectionChannels(QueryConnectionChannelsRequest) returns (QueryConnectionChannelsResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/connections/{connection}/channels";
+ }
+
+ // ChannelClientState queries for the client state for the channel associated
+ // with the provided channel identifiers.
+ rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/client_state";
+ }
+
+ // ChannelConsensusState queries for the consensus state for the channel
+ // associated with the provided channel identifiers.
+ rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/consensus_state/revision/"
+ "{revision_number}/height/{revision_height}";
+ }
+
+ // PacketCommitment queries a stored packet commitment hash.
+ rpc PacketCommitment(QueryPacketCommitmentRequest) returns (QueryPacketCommitmentResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/"
+ "packet_commitments/{sequence}";
+ }
+
+ // PacketCommitments returns all the packet commitments hashes associated
+ // with a channel.
+ rpc PacketCommitments(QueryPacketCommitmentsRequest) returns (QueryPacketCommitmentsResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/packet_commitments";
+ }
+
+ // PacketReceipt queries if a given packet sequence has been received on the
+ // queried chain
+ rpc PacketReceipt(QueryPacketReceiptRequest) returns (QueryPacketReceiptResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/packet_receipts/{sequence}";
+ }
+
+ // PacketAcknowledgement queries a stored packet acknowledgement hash.
+ rpc PacketAcknowledgement(QueryPacketAcknowledgementRequest) returns (QueryPacketAcknowledgementResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/packet_acks/{sequence}";
+ }
+
+ // PacketAcknowledgements returns all the packet acknowledgements associated
+ // with a channel.
+ rpc PacketAcknowledgements(QueryPacketAcknowledgementsRequest) returns (QueryPacketAcknowledgementsResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/packet_acknowledgements";
+ }
+
+ // UnreceivedPackets returns all the unreceived IBC packets associated with a
+ // channel and sequences.
+ rpc UnreceivedPackets(QueryUnreceivedPacketsRequest) returns (QueryUnreceivedPacketsResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/"
+ "packet_commitments/"
+ "{packet_commitment_sequences}/unreceived_packets";
+ }
+
+ // UnreceivedAcks returns all the unreceived IBC acknowledgements associated
+ // with a channel and sequences.
+ rpc UnreceivedAcks(QueryUnreceivedAcksRequest) returns (QueryUnreceivedAcksResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/packet_commitments/"
+ "{packet_ack_sequences}/unreceived_acks";
+ }
+
+ // NextSequenceReceive returns the next receive sequence for a given channel.
+ rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) {
+ option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
+ "ports/{port_id}/next_sequence";
+ }
+}
+
+// QueryChannelRequest is the request type for the Query/Channel RPC method
+message QueryChannelRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+}
+
+// QueryChannelResponse is the response type for the Query/Channel RPC method.
+// Besides the Channel end, it includes a proof and the height from which the
+// proof was retrieved.
+message QueryChannelResponse {
+ // channel associated with the request identifiers
+ ibc.core.channel.v1.Channel channel = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryChannelsRequest is the request type for the Query/Channels RPC method
+message QueryChannelsRequest {
+ // pagination request
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryChannelsResponse is the response type for the Query/Channels RPC method.
+message QueryChannelsResponse {
+ // list of stored channels of the chain.
+ repeated ibc.core.channel.v1.IdentifiedChannel channels = 1;
+ // pagination response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+ // query block height
+ ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryConnectionChannelsRequest is the request type for the
+// Query/QueryConnectionChannels RPC method
+message QueryConnectionChannelsRequest {
+ // connection unique identifier
+ string connection = 1;
+ // pagination request
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryConnectionChannelsResponse is the Response type for the
+// Query/QueryConnectionChannels RPC method
+message QueryConnectionChannelsResponse {
+ // list of channels associated with a connection.
+ repeated ibc.core.channel.v1.IdentifiedChannel channels = 1;
+ // pagination response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+ // query block height
+ ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryChannelClientStateRequest is the request type for the Query/ClientState
+// RPC method
+message QueryChannelClientStateRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+}
+
+// QueryChannelClientStateResponse is the Response type for the
+// Query/QueryChannelClientState RPC method
+message QueryChannelClientStateResponse {
+ // client state associated with the channel
+ ibc.core.client.v1.IdentifiedClientState identified_client_state = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryChannelConsensusStateRequest is the request type for the
+// Query/ConsensusState RPC method
+message QueryChannelConsensusStateRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // revision number of the consensus state
+ uint64 revision_number = 3;
+ // revision height of the consensus state
+ uint64 revision_height = 4;
+}
+
+// QueryChannelClientStateResponse is the Response type for the
+// Query/QueryChannelClientState RPC method
+message QueryChannelConsensusStateResponse {
+ // consensus state associated with the channel
+ google.protobuf.Any consensus_state = 1;
+ // client ID associated with the consensus state
+ string client_id = 2;
+ // merkle proof of existence
+ bytes proof = 3;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false];
+}
+
+// QueryPacketCommitmentRequest is the request type for the
+// Query/PacketCommitment RPC method
+message QueryPacketCommitmentRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // packet sequence
+ uint64 sequence = 3;
+}
+
+// QueryPacketCommitmentResponse defines the client query response for a packet
+// which also includes a proof and the height from which the proof was
+// retrieved
+message QueryPacketCommitmentResponse {
+ // packet associated with the request fields
+ bytes commitment = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryPacketCommitmentsRequest is the request type for the
+// Query/QueryPacketCommitments RPC method
+message QueryPacketCommitmentsRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // pagination request
+ cosmos.base.query.v1beta1.PageRequest pagination = 3;
+}
+
+// QueryPacketCommitmentsResponse is the request type for the
+// Query/QueryPacketCommitments RPC method
+message QueryPacketCommitmentsResponse {
+ repeated ibc.core.channel.v1.PacketState commitments = 1;
+ // pagination response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+ // query block height
+ ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryPacketReceiptRequest is the request type for the
+// Query/PacketReceipt RPC method
+message QueryPacketReceiptRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // packet sequence
+ uint64 sequence = 3;
+}
+
+// QueryPacketReceiptResponse defines the client query response for a packet
+// receipt which also includes a proof, and the height from which the proof was
+// retrieved
+message QueryPacketReceiptResponse {
+ // success flag for if receipt exists
+ bool received = 2;
+ // merkle proof of existence
+ bytes proof = 3;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false];
+}
+
+// QueryPacketAcknowledgementRequest is the request type for the
+// Query/PacketAcknowledgement RPC method
+message QueryPacketAcknowledgementRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // packet sequence
+ uint64 sequence = 3;
+}
+
+// QueryPacketAcknowledgementResponse defines the client query response for a
+// packet which also includes a proof and the height from which the
+// proof was retrieved
+message QueryPacketAcknowledgementResponse {
+ // packet associated with the request fields
+ bytes acknowledgement = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryPacketAcknowledgementsRequest is the request type for the
+// Query/QueryPacketCommitments RPC method
+message QueryPacketAcknowledgementsRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // pagination request
+ cosmos.base.query.v1beta1.PageRequest pagination = 3;
+ // list of packet sequences
+ repeated uint64 packet_commitment_sequences = 4;
+}
+
+// QueryPacketAcknowledgemetsResponse is the request type for the
+// Query/QueryPacketAcknowledgements RPC method
+message QueryPacketAcknowledgementsResponse {
+ repeated ibc.core.channel.v1.PacketState acknowledgements = 1;
+ // pagination response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+ // query block height
+ ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryUnreceivedPacketsRequest is the request type for the
+// Query/UnreceivedPackets RPC method
+message QueryUnreceivedPacketsRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // list of packet sequences
+ repeated uint64 packet_commitment_sequences = 3;
+}
+
+// QueryUnreceivedPacketsResponse is the response type for the
+// Query/UnreceivedPacketCommitments RPC method
+message QueryUnreceivedPacketsResponse {
+ // list of unreceived packet sequences
+ repeated uint64 sequences = 1;
+ // query block height
+ ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false];
+}
+
+// QueryUnreceivedAcks is the request type for the
+// Query/UnreceivedAcks RPC method
+message QueryUnreceivedAcksRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+ // list of acknowledgement sequences
+ repeated uint64 packet_ack_sequences = 3;
+}
+
+// QueryUnreceivedAcksResponse is the response type for the
+// Query/UnreceivedAcks RPC method
+message QueryUnreceivedAcksResponse {
+ // list of unreceived acknowledgement sequences
+ repeated uint64 sequences = 1;
+ // query block height
+ ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false];
+}
+
+// QueryNextSequenceReceiveRequest is the request type for the
+// Query/QueryNextSequenceReceiveRequest RPC method
+message QueryNextSequenceReceiveRequest {
+ // port unique identifier
+ string port_id = 1;
+ // channel unique identifier
+ string channel_id = 2;
+}
+
+// QuerySequenceResponse is the request type for the
+// Query/QueryNextSequenceReceiveResponse RPC method
+message QueryNextSequenceReceiveResponse {
+ // next sequence receive number
+ uint64 next_sequence_receive = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/ibc/core/channel/v1/tx.proto b/examples/authz/proto/ibc/core/channel/v1/tx.proto
new file mode 100644
index 00000000..dab45080
--- /dev/null
+++ b/examples/authz/proto/ibc/core/channel/v1/tx.proto
@@ -0,0 +1,211 @@
+syntax = "proto3";
+
+package ibc.core.channel.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types";
+
+import "gogoproto/gogo.proto";
+import "ibc/core/client/v1/client.proto";
+import "ibc/core/channel/v1/channel.proto";
+
+// Msg defines the ibc/channel Msg service.
+service Msg {
+ // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit.
+ rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse);
+
+ // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry.
+ rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse);
+
+ // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck.
+ rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse);
+
+ // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm.
+ rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse);
+
+ // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit.
+ rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse);
+
+ // ChannelCloseConfirm defines a rpc handler method for
+ // MsgChannelCloseConfirm.
+ rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse);
+
+ // RecvPacket defines a rpc handler method for MsgRecvPacket.
+ rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse);
+
+ // Timeout defines a rpc handler method for MsgTimeout.
+ rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse);
+
+ // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose.
+ rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse);
+
+ // Acknowledgement defines a rpc handler method for MsgAcknowledgement.
+ rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse);
+}
+
+// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It
+// is called by a relayer on Chain A.
+message MsgChannelOpenInit {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ Channel channel = 2 [(gogoproto.nullable) = false];
+ string signer = 3;
+}
+
+// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type.
+message MsgChannelOpenInitResponse {}
+
+// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel
+// on Chain B.
+message MsgChannelOpenTry {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ // in the case of crossing hello's, when both chains call OpenInit, we need
+ // the channel identifier of the previous channel in state INIT
+ string previous_channel_id = 2 [(gogoproto.moretags) = "yaml:\"previous_channel_id\""];
+ Channel channel = 3 [(gogoproto.nullable) = false];
+ string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""];
+ bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""];
+ ibc.core.client.v1.Height proof_height = 6
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ string signer = 7;
+}
+
+// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type.
+message MsgChannelOpenTryResponse {}
+
+// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge
+// the change of channel state to TRYOPEN on Chain B.
+message MsgChannelOpenAck {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
+ string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""];
+ string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""];
+ bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""];
+ ibc.core.client.v1.Height proof_height = 6
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ string signer = 7;
+}
+
+// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type.
+message MsgChannelOpenAckResponse {}
+
+// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to
+// acknowledge the change of channel state to OPEN on Chain A.
+message MsgChannelOpenConfirm {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
+ bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""];
+ ibc.core.client.v1.Height proof_height = 4
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ string signer = 5;
+}
+
+// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response
+// type.
+message MsgChannelOpenConfirmResponse {}
+
+// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A
+// to close a channel with Chain B.
+message MsgChannelCloseInit {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
+ string signer = 3;
+}
+
+// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type.
+message MsgChannelCloseInitResponse {}
+
+// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B
+// to acknowledge the change of channel state to CLOSED on Chain A.
+message MsgChannelCloseConfirm {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
+ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
+ bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""];
+ ibc.core.client.v1.Height proof_height = 4
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ string signer = 5;
+}
+
+// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response
+// type.
+message MsgChannelCloseConfirmResponse {}
+
+// MsgRecvPacket receives incoming IBC packet
+message MsgRecvPacket {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ Packet packet = 1 [(gogoproto.nullable) = false];
+ bytes proof_commitment = 2 [(gogoproto.moretags) = "yaml:\"proof_commitment\""];
+ ibc.core.client.v1.Height proof_height = 3
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ string signer = 4;
+}
+
+// MsgRecvPacketResponse defines the Msg/RecvPacket response type.
+message MsgRecvPacketResponse {}
+
+// MsgTimeout receives timed-out packet
+message MsgTimeout {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ Packet packet = 1 [(gogoproto.nullable) = false];
+ bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""];
+ ibc.core.client.v1.Height proof_height = 3
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
+ string signer = 5;
+}
+
+// MsgTimeoutResponse defines the Msg/Timeout response type.
+message MsgTimeoutResponse {}
+
+// MsgTimeoutOnClose timed-out packet upon counterparty channel closure.
+message MsgTimeoutOnClose {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ Packet packet = 1 [(gogoproto.nullable) = false];
+ bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""];
+ bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""];
+ ibc.core.client.v1.Height proof_height = 4
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
+ string signer = 6;
+}
+
+// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type.
+message MsgTimeoutOnCloseResponse {}
+
+// MsgAcknowledgement receives incoming IBC acknowledgement
+message MsgAcknowledgement {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ Packet packet = 1 [(gogoproto.nullable) = false];
+ bytes acknowledgement = 2;
+ bytes proof_acked = 3 [(gogoproto.moretags) = "yaml:\"proof_acked\""];
+ ibc.core.client.v1.Height proof_height = 4
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ string signer = 5;
+}
+
+// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type.
+message MsgAcknowledgementResponse {}
diff --git a/examples/authz/proto/ibc/core/client/v1/client.proto b/examples/authz/proto/ibc/core/client/v1/client.proto
new file mode 100644
index 00000000..f0a1538e
--- /dev/null
+++ b/examples/authz/proto/ibc/core/client/v1/client.proto
@@ -0,0 +1,104 @@
+syntax = "proto3";
+
+package ibc.core.client.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "cosmos/upgrade/v1beta1/upgrade.proto";
+import "cosmos_proto/cosmos.proto";
+
+// IdentifiedClientState defines a client state with an additional client
+// identifier field.
+message IdentifiedClientState {
+ // client identifier
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // client state
+ google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""];
+}
+
+// ConsensusStateWithHeight defines a consensus state with an additional height
+// field.
+message ConsensusStateWithHeight {
+ // consensus state height
+ Height height = 1 [(gogoproto.nullable) = false];
+ // consensus state
+ google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""];
+}
+
+// ClientConsensusStates defines all the stored consensus states for a given
+// client.
+message ClientConsensusStates {
+ // client identifier
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // consensus states and their heights associated with the client
+ repeated ConsensusStateWithHeight consensus_states = 2
+ [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false];
+}
+
+// ClientUpdateProposal is a governance proposal. If it passes, the substitute
+// client's latest consensus state is copied over to the subject client. The proposal
+// handler may fail if the subject and the substitute do not match in client and
+// chain parameters (with exception to latest height, frozen height, and chain-id).
+message ClientUpdateProposal {
+ option (gogoproto.goproto_getters) = false;
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
+
+ // the title of the update proposal
+ string title = 1;
+ // the description of the proposal
+ string description = 2;
+ // the client identifier for the client to be updated if the proposal passes
+ string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""];
+ // the substitute client identifier for the client standing in for the subject
+ // client
+ string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""];
+}
+
+// UpgradeProposal is a gov Content type for initiating an IBC breaking
+// upgrade.
+message UpgradeProposal {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (gogoproto.equal) = true;
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
+
+ string title = 1;
+ string description = 2;
+ cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false];
+
+ // An UpgradedClientState must be provided to perform an IBC breaking upgrade.
+ // This will make the chain commit to the correct upgraded (self) client state
+ // before the upgrade occurs, so that connecting chains can verify that the
+ // new upgraded client is valid by verifying a proof on the previous version
+ // of the chain. This will allow IBC connections to persist smoothly across
+ // planned chain upgrades
+ google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""];
+}
+
+// Height is a monotonically increasing data type
+// that can be compared against another Height for the purposes of updating and
+// freezing clients
+//
+// Normally the RevisionHeight is incremented at each height while keeping
+// RevisionNumber the same. However some consensus algorithms may choose to
+// reset the height in certain conditions e.g. hard forks, state-machine
+// breaking changes In these cases, the RevisionNumber is incremented so that
+// height continues to be monitonically increasing even as the RevisionHeight
+// gets reset
+message Height {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ // the revision that the client is currently on
+ uint64 revision_number = 1 [(gogoproto.moretags) = "yaml:\"revision_number\""];
+ // the height within the given revision
+ uint64 revision_height = 2 [(gogoproto.moretags) = "yaml:\"revision_height\""];
+}
+
+// Params defines the set of IBC light client parameters.
+message Params {
+ // allowed_clients defines the list of allowed client state types.
+ repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""];
+}
diff --git a/examples/authz/proto/ibc/core/client/v1/genesis.proto b/examples/authz/proto/ibc/core/client/v1/genesis.proto
new file mode 100644
index 00000000..6668f2ca
--- /dev/null
+++ b/examples/authz/proto/ibc/core/client/v1/genesis.proto
@@ -0,0 +1,48 @@
+syntax = "proto3";
+
+package ibc.core.client.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types";
+
+import "ibc/core/client/v1/client.proto";
+import "gogoproto/gogo.proto";
+
+// GenesisState defines the ibc client submodule's genesis state.
+message GenesisState {
+ // client states with their corresponding identifiers
+ repeated IdentifiedClientState clients = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"];
+ // consensus states from each client
+ repeated ClientConsensusStates clients_consensus = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "ClientsConsensusStates",
+ (gogoproto.moretags) = "yaml:\"clients_consensus\""
+ ];
+ // metadata from each client
+ repeated IdentifiedGenesisMetadata clients_metadata = 3
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"clients_metadata\""];
+ Params params = 4 [(gogoproto.nullable) = false];
+ // create localhost on initialization
+ bool create_localhost = 5 [(gogoproto.moretags) = "yaml:\"create_localhost\""];
+ // the sequence for the next generated client identifier
+ uint64 next_client_sequence = 6 [(gogoproto.moretags) = "yaml:\"next_client_sequence\""];
+}
+
+// GenesisMetadata defines the genesis type for metadata that clients may return
+// with ExportMetadata
+message GenesisMetadata {
+ option (gogoproto.goproto_getters) = false;
+
+ // store key of metadata without clientID-prefix
+ bytes key = 1;
+ // metadata value
+ bytes value = 2;
+}
+
+// IdentifiedGenesisMetadata has the client metadata with the corresponding
+// client id.
+message IdentifiedGenesisMetadata {
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ repeated GenesisMetadata client_metadata = 2
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_metadata\""];
+}
diff --git a/examples/authz/proto/ibc/core/client/v1/query.proto b/examples/authz/proto/ibc/core/client/v1/query.proto
new file mode 100644
index 00000000..b6f8eb47
--- /dev/null
+++ b/examples/authz/proto/ibc/core/client/v1/query.proto
@@ -0,0 +1,184 @@
+syntax = "proto3";
+
+package ibc.core.client.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types";
+
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "ibc/core/client/v1/client.proto";
+import "google/protobuf/any.proto";
+import "google/api/annotations.proto";
+import "gogoproto/gogo.proto";
+
+// Query provides defines the gRPC querier service
+service Query {
+ // ClientState queries an IBC light client.
+ rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) {
+ option (google.api.http).get = "/ibc/core/client/v1/client_states/{client_id}";
+ }
+
+ // ClientStates queries all the IBC light clients of a chain.
+ rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) {
+ option (google.api.http).get = "/ibc/core/client/v1/client_states";
+ }
+
+ // ConsensusState queries a consensus state associated with a client state at
+ // a given height.
+ rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) {
+ option (google.api.http).get = "/ibc/core/client/v1/consensus_states/"
+ "{client_id}/revision/{revision_number}/"
+ "height/{revision_height}";
+ }
+
+ // ConsensusStates queries all the consensus state associated with a given
+ // client.
+ rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) {
+ option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}";
+ }
+
+ // Status queries the status of an IBC client.
+ rpc ClientStatus(QueryClientStatusRequest) returns (QueryClientStatusResponse) {
+ option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}";
+ }
+
+ // ClientParams queries all parameters of the ibc client.
+ rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) {
+ option (google.api.http).get = "/ibc/client/v1/params";
+ }
+
+ // UpgradedClientState queries an Upgraded IBC light client.
+ rpc UpgradedClientState(QueryUpgradedClientStateRequest) returns (QueryUpgradedClientStateResponse) {
+ option (google.api.http).get = "/ibc/core/client/v1/upgraded_client_states";
+ }
+
+ // UpgradedConsensusState queries an Upgraded IBC consensus state.
+ rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) {
+ option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states";
+ }
+}
+
+// QueryClientStateRequest is the request type for the Query/ClientState RPC
+// method
+message QueryClientStateRequest {
+ // client state unique identifier
+ string client_id = 1;
+}
+
+// QueryClientStateResponse is the response type for the Query/ClientState RPC
+// method. Besides the client state, it includes a proof and the height from
+// which the proof was retrieved.
+message QueryClientStateResponse {
+ // client state associated with the request identifier
+ google.protobuf.Any client_state = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryClientStatesRequest is the request type for the Query/ClientStates RPC
+// method
+message QueryClientStatesRequest {
+ // pagination request
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryClientStatesResponse is the response type for the Query/ClientStates RPC
+// method.
+message QueryClientStatesResponse {
+ // list of stored ClientStates of the chain.
+ repeated IdentifiedClientState client_states = 1
+ [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"];
+ // pagination response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryConsensusStateRequest is the request type for the Query/ConsensusState
+// RPC method. Besides the consensus state, it includes a proof and the height
+// from which the proof was retrieved.
+message QueryConsensusStateRequest {
+ // client identifier
+ string client_id = 1;
+ // consensus state revision number
+ uint64 revision_number = 2;
+ // consensus state revision height
+ uint64 revision_height = 3;
+ // latest_height overrrides the height field and queries the latest stored
+ // ConsensusState
+ bool latest_height = 4;
+}
+
+// QueryConsensusStateResponse is the response type for the Query/ConsensusState
+// RPC method
+message QueryConsensusStateResponse {
+ // consensus state associated with the client identifier at the given height
+ google.protobuf.Any consensus_state = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates
+// RPC method.
+message QueryConsensusStatesRequest {
+ // client identifier
+ string client_id = 1;
+ // pagination request
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+// QueryConsensusStatesResponse is the response type for the
+// Query/ConsensusStates RPC method
+message QueryConsensusStatesResponse {
+ // consensus states associated with the identifier
+ repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false];
+ // pagination response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC
+// method
+message QueryClientStatusRequest {
+ // client unique identifier
+ string client_id = 1;
+}
+
+// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC
+// method. It returns the current status of the IBC client.
+message QueryClientStatusResponse {
+ string status = 1;
+}
+
+// QueryClientParamsRequest is the request type for the Query/ClientParams RPC
+// method.
+message QueryClientParamsRequest {}
+
+// QueryClientParamsResponse is the response type for the Query/ClientParams RPC
+// method.
+message QueryClientParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1;
+}
+
+// QueryUpgradedClientStateRequest is the request type for the
+// Query/UpgradedClientState RPC method
+message QueryUpgradedClientStateRequest {}
+
+// QueryUpgradedClientStateResponse is the response type for the
+// Query/UpgradedClientState RPC method.
+message QueryUpgradedClientStateResponse {
+ // client state associated with the request identifier
+ google.protobuf.Any upgraded_client_state = 1;
+}
+
+// QueryUpgradedConsensusStateRequest is the request type for the
+// Query/UpgradedConsensusState RPC method
+message QueryUpgradedConsensusStateRequest {}
+
+// QueryUpgradedConsensusStateResponse is the response type for the
+// Query/UpgradedConsensusState RPC method.
+message QueryUpgradedConsensusStateResponse {
+ // Consensus state associated with the request identifier
+ google.protobuf.Any upgraded_consensus_state = 1;
+}
diff --git a/examples/authz/proto/ibc/core/client/v1/tx.proto b/examples/authz/proto/ibc/core/client/v1/tx.proto
new file mode 100644
index 00000000..82df96de
--- /dev/null
+++ b/examples/authz/proto/ibc/core/client/v1/tx.proto
@@ -0,0 +1,99 @@
+syntax = "proto3";
+
+package ibc.core.client.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+// Msg defines the ibc/client Msg service.
+service Msg {
+ // CreateClient defines a rpc handler method for MsgCreateClient.
+ rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse);
+
+ // UpdateClient defines a rpc handler method for MsgUpdateClient.
+ rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse);
+
+ // UpgradeClient defines a rpc handler method for MsgUpgradeClient.
+ rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse);
+
+ // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour.
+ rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse);
+}
+
+// MsgCreateClient defines a message to create an IBC client
+message MsgCreateClient {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // light client state
+ google.protobuf.Any client_state = 1 [(gogoproto.moretags) = "yaml:\"client_state\""];
+ // consensus state associated with the client that corresponds to a given
+ // height.
+ google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
+ // signer address
+ string signer = 3;
+}
+
+// MsgCreateClientResponse defines the Msg/CreateClient response type.
+message MsgCreateClientResponse {}
+
+// MsgUpdateClient defines an sdk.Msg to update a IBC client state using
+// the given header.
+message MsgUpdateClient {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // client unique identifier
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // header to update the light client
+ google.protobuf.Any header = 2;
+ // signer address
+ string signer = 3;
+}
+
+// MsgUpdateClientResponse defines the Msg/UpdateClient response type.
+message MsgUpdateClientResponse {}
+
+// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client
+// state
+message MsgUpgradeClient {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // client unique identifier
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // upgraded client state
+ google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""];
+ // upgraded consensus state, only contains enough information to serve as a
+ // basis of trust in update logic
+ google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
+ // proof that old chain committed to new client
+ bytes proof_upgrade_client = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade_client\""];
+ // proof that old chain committed to new consensus state
+ bytes proof_upgrade_consensus_state = 5 [(gogoproto.moretags) = "yaml:\"proof_upgrade_consensus_state\""];
+ // signer address
+ string signer = 6;
+}
+
+// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type.
+message MsgUpgradeClientResponse {}
+
+// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for
+// light client misbehaviour.
+message MsgSubmitMisbehaviour {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ // client unique identifier
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // misbehaviour used for freezing the light client
+ google.protobuf.Any misbehaviour = 2;
+ // signer address
+ string signer = 3;
+}
+
+// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response
+// type.
+message MsgSubmitMisbehaviourResponse {}
diff --git a/examples/authz/proto/ibc/core/commitment/v1/commitment.proto b/examples/authz/proto/ibc/core/commitment/v1/commitment.proto
new file mode 100644
index 00000000..b460b9a1
--- /dev/null
+++ b/examples/authz/proto/ibc/core/commitment/v1/commitment.proto
@@ -0,0 +1,41 @@
+syntax = "proto3";
+
+package ibc.core.commitment.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/23-commitment/types";
+
+import "gogoproto/gogo.proto";
+import "confio/proofs.proto";
+
+// MerkleRoot defines a merkle root hash.
+// In the Cosmos SDK, the AppHash of a block header becomes the root.
+message MerkleRoot {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes hash = 1;
+}
+
+// MerklePrefix is merkle path prefixed to the key.
+// The constructed key from the Path and the key will be append(Path.KeyPath,
+// append(Path.KeyPrefix, key...))
+message MerklePrefix {
+ bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""];
+}
+
+// MerklePath is the path used to verify commitment proofs, which can be an
+// arbitrary structured object (defined by a commitment type).
+// MerklePath is represented from root-to-leaf
+message MerklePath {
+ option (gogoproto.goproto_stringer) = false;
+
+ repeated string key_path = 1 [(gogoproto.moretags) = "yaml:\"key_path\""];
+}
+
+// MerkleProof is a wrapper type over a chain of CommitmentProofs.
+// It demonstrates membership or non-membership for an element or set of
+// elements, verifiable in conjunction with a known commitment root. Proofs
+// should be succinct.
+// MerkleProofs are ordered from leaf-to-root
+message MerkleProof {
+ repeated ics23.CommitmentProof proofs = 1;
+}
diff --git a/examples/authz/proto/ibc/core/connection/v1/connection.proto b/examples/authz/proto/ibc/core/connection/v1/connection.proto
new file mode 100644
index 00000000..74c39e26
--- /dev/null
+++ b/examples/authz/proto/ibc/core/connection/v1/connection.proto
@@ -0,0 +1,114 @@
+syntax = "proto3";
+
+package ibc.core.connection.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types";
+
+import "gogoproto/gogo.proto";
+import "ibc/core/commitment/v1/commitment.proto";
+
+// ICS03 - Connection Data Structures as defined in
+// https://github.com/cosmos/ibc/blob/master/spec/core/ics-003-connection-semantics#data-structures
+
+// ConnectionEnd defines a stateful object on a chain connected to another
+// separate one.
+// NOTE: there must only be 2 defined ConnectionEnds to establish
+// a connection between two chains.
+message ConnectionEnd {
+ option (gogoproto.goproto_getters) = false;
+ // client associated with this connection.
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // IBC version which can be utilised to determine encodings or protocols for
+ // channels or packets utilising this connection.
+ repeated Version versions = 2;
+ // current state of the connection end.
+ State state = 3;
+ // counterparty chain associated with this connection.
+ Counterparty counterparty = 4 [(gogoproto.nullable) = false];
+ // delay period that must pass before a consensus state can be used for
+ // packet-verification NOTE: delay period logic is only implemented by some
+ // clients.
+ uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""];
+}
+
+// IdentifiedConnection defines a connection with additional connection
+// identifier field.
+message IdentifiedConnection {
+ option (gogoproto.goproto_getters) = false;
+ // connection identifier.
+ string id = 1 [(gogoproto.moretags) = "yaml:\"id\""];
+ // client associated with this connection.
+ string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // IBC version which can be utilised to determine encodings or protocols for
+ // channels or packets utilising this connection
+ repeated Version versions = 3;
+ // current state of the connection end.
+ State state = 4;
+ // counterparty chain associated with this connection.
+ Counterparty counterparty = 5 [(gogoproto.nullable) = false];
+ // delay period associated with this connection.
+ uint64 delay_period = 6 [(gogoproto.moretags) = "yaml:\"delay_period\""];
+}
+
+// State defines if a connection is in one of the following states:
+// INIT, TRYOPEN, OPEN or UNINITIALIZED.
+enum State {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // Default State
+ STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"];
+ // A connection end has just started the opening handshake.
+ STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"];
+ // A connection end has acknowledged the handshake step on the counterparty
+ // chain.
+ STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"];
+ // A connection end has completed the handshake.
+ STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"];
+}
+
+// Counterparty defines the counterparty chain associated with a connection end.
+message Counterparty {
+ option (gogoproto.goproto_getters) = false;
+
+ // identifies the client on the counterparty chain associated with a given
+ // connection.
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // identifies the connection end on the counterparty chain associated with a
+ // given connection.
+ string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""];
+ // commitment merkle prefix of the counterparty chain.
+ ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false];
+}
+
+// ClientPaths define all the connection paths for a client state.
+message ClientPaths {
+ // list of connection paths
+ repeated string paths = 1;
+}
+
+// ConnectionPaths define all the connection paths for a given client state.
+message ConnectionPaths {
+ // client state unique identifier
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // list of connection paths
+ repeated string paths = 2;
+}
+
+// Version defines the versioning scheme used to negotiate the IBC verison in
+// the connection handshake.
+message Version {
+ option (gogoproto.goproto_getters) = false;
+
+ // unique version identifier
+ string identifier = 1;
+ // list of features compatible with the specified identifier
+ repeated string features = 2;
+}
+
+// Params defines the set of Connection parameters.
+message Params {
+ // maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the
+ // largest amount of time that the chain might reasonably take to produce the next block under normal operating
+ // conditions. A safe choice is 3-5x the expected time per block.
+ uint64 max_expected_time_per_block = 1 [(gogoproto.moretags) = "yaml:\"max_expected_time_per_block\""];
+}
diff --git a/examples/authz/proto/ibc/core/connection/v1/genesis.proto b/examples/authz/proto/ibc/core/connection/v1/genesis.proto
new file mode 100644
index 00000000..ec5be642
--- /dev/null
+++ b/examples/authz/proto/ibc/core/connection/v1/genesis.proto
@@ -0,0 +1,18 @@
+syntax = "proto3";
+
+package ibc.core.connection.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types";
+
+import "gogoproto/gogo.proto";
+import "ibc/core/connection/v1/connection.proto";
+
+// GenesisState defines the ibc connection submodule's genesis state.
+message GenesisState {
+ repeated IdentifiedConnection connections = 1 [(gogoproto.nullable) = false];
+ repeated ConnectionPaths client_connection_paths = 2
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_connection_paths\""];
+ // the sequence for the next generated connection identifier
+ uint64 next_connection_sequence = 3 [(gogoproto.moretags) = "yaml:\"next_connection_sequence\""];
+ Params params = 4 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/ibc/core/connection/v1/query.proto b/examples/authz/proto/ibc/core/connection/v1/query.proto
new file mode 100644
index 00000000..d668c3d2
--- /dev/null
+++ b/examples/authz/proto/ibc/core/connection/v1/query.proto
@@ -0,0 +1,138 @@
+syntax = "proto3";
+
+package ibc.core.connection.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types";
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "ibc/core/client/v1/client.proto";
+import "ibc/core/connection/v1/connection.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/any.proto";
+
+// Query provides defines the gRPC querier service
+service Query {
+ // Connection queries an IBC connection end.
+ rpc Connection(QueryConnectionRequest) returns (QueryConnectionResponse) {
+ option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}";
+ }
+
+ // Connections queries all the IBC connections of a chain.
+ rpc Connections(QueryConnectionsRequest) returns (QueryConnectionsResponse) {
+ option (google.api.http).get = "/ibc/core/connection/v1/connections";
+ }
+
+ // ClientConnections queries the connection paths associated with a client
+ // state.
+ rpc ClientConnections(QueryClientConnectionsRequest) returns (QueryClientConnectionsResponse) {
+ option (google.api.http).get = "/ibc/core/connection/v1/client_connections/{client_id}";
+ }
+
+ // ConnectionClientState queries the client state associated with the
+ // connection.
+ rpc ConnectionClientState(QueryConnectionClientStateRequest) returns (QueryConnectionClientStateResponse) {
+ option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/client_state";
+ }
+
+ // ConnectionConsensusState queries the consensus state associated with the
+ // connection.
+ rpc ConnectionConsensusState(QueryConnectionConsensusStateRequest) returns (QueryConnectionConsensusStateResponse) {
+ option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/consensus_state/"
+ "revision/{revision_number}/height/{revision_height}";
+ }
+}
+
+// QueryConnectionRequest is the request type for the Query/Connection RPC
+// method
+message QueryConnectionRequest {
+ // connection unique identifier
+ string connection_id = 1;
+}
+
+// QueryConnectionResponse is the response type for the Query/Connection RPC
+// method. Besides the connection end, it includes a proof and the height from
+// which the proof was retrieved.
+message QueryConnectionResponse {
+ // connection associated with the request identifier
+ ibc.core.connection.v1.ConnectionEnd connection = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryConnectionsRequest is the request type for the Query/Connections RPC
+// method
+message QueryConnectionsRequest {
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryConnectionsResponse is the response type for the Query/Connections RPC
+// method.
+message QueryConnectionsResponse {
+ // list of stored connections of the chain.
+ repeated ibc.core.connection.v1.IdentifiedConnection connections = 1;
+ // pagination response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+ // query block height
+ ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryClientConnectionsRequest is the request type for the
+// Query/ClientConnections RPC method
+message QueryClientConnectionsRequest {
+ // client identifier associated with a connection
+ string client_id = 1;
+}
+
+// QueryClientConnectionsResponse is the response type for the
+// Query/ClientConnections RPC method
+message QueryClientConnectionsResponse {
+ // slice of all the connection paths associated with a client.
+ repeated string connection_paths = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was generated
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryConnectionClientStateRequest is the request type for the
+// Query/ConnectionClientState RPC method
+message QueryConnectionClientStateRequest {
+ // connection identifier
+ string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""];
+}
+
+// QueryConnectionClientStateResponse is the response type for the
+// Query/ConnectionClientState RPC method
+message QueryConnectionClientStateResponse {
+ // client state associated with the channel
+ ibc.core.client.v1.IdentifiedClientState identified_client_state = 1;
+ // merkle proof of existence
+ bytes proof = 2;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
+}
+
+// QueryConnectionConsensusStateRequest is the request type for the
+// Query/ConnectionConsensusState RPC method
+message QueryConnectionConsensusStateRequest {
+ // connection identifier
+ string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""];
+ uint64 revision_number = 2;
+ uint64 revision_height = 3;
+}
+
+// QueryConnectionConsensusStateResponse is the response type for the
+// Query/ConnectionConsensusState RPC method
+message QueryConnectionConsensusStateResponse {
+ // consensus state associated with the channel
+ google.protobuf.Any consensus_state = 1;
+ // client ID associated with the consensus state
+ string client_id = 2;
+ // merkle proof of existence
+ bytes proof = 3;
+ // height at which the proof was retrieved
+ ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/ibc/core/connection/v1/tx.proto b/examples/authz/proto/ibc/core/connection/v1/tx.proto
new file mode 100644
index 00000000..9d4e577e
--- /dev/null
+++ b/examples/authz/proto/ibc/core/connection/v1/tx.proto
@@ -0,0 +1,119 @@
+syntax = "proto3";
+
+package ibc.core.connection.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/03-connection/types";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "ibc/core/client/v1/client.proto";
+import "ibc/core/connection/v1/connection.proto";
+
+// Msg defines the ibc/connection Msg service.
+service Msg {
+ // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit.
+ rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse);
+
+ // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry.
+ rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse);
+
+ // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck.
+ rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse);
+
+ // ConnectionOpenConfirm defines a rpc handler method for
+ // MsgConnectionOpenConfirm.
+ rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse);
+}
+
+// MsgConnectionOpenInit defines the msg sent by an account on Chain A to
+// initialize a connection with Chain B.
+message MsgConnectionOpenInit {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ Counterparty counterparty = 2 [(gogoproto.nullable) = false];
+ Version version = 3;
+ uint64 delay_period = 4 [(gogoproto.moretags) = "yaml:\"delay_period\""];
+ string signer = 5;
+}
+
+// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response
+// type.
+message MsgConnectionOpenInitResponse {}
+
+// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a
+// connection on Chain B.
+message MsgConnectionOpenTry {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ // in the case of crossing hello's, when both chains call OpenInit, we need
+ // the connection identifier of the previous connection in state INIT
+ string previous_connection_id = 2 [(gogoproto.moretags) = "yaml:\"previous_connection_id\""];
+ google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""];
+ Counterparty counterparty = 4 [(gogoproto.nullable) = false];
+ uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""];
+ repeated Version counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""];
+ ibc.core.client.v1.Height proof_height = 7
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ // proof of the initialization the connection on Chain A: `UNITIALIZED ->
+ // INIT`
+ bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""];
+ // proof of client state included in message
+ bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""];
+ // proof of client consensus state
+ bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
+ ibc.core.client.v1.Height consensus_height = 11
+ [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false];
+ string signer = 12;
+}
+
+// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type.
+message MsgConnectionOpenTryResponse {}
+
+// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to
+// acknowledge the change of connection state to TRYOPEN on Chain B.
+message MsgConnectionOpenAck {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""];
+ string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""];
+ Version version = 3;
+ google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""];
+ ibc.core.client.v1.Height proof_height = 5
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ // proof of the initialization the connection on Chain B: `UNITIALIZED ->
+ // TRYOPEN`
+ bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""];
+ // proof of client state included in message
+ bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""];
+ // proof of client consensus state
+ bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""];
+ ibc.core.client.v1.Height consensus_height = 9
+ [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false];
+ string signer = 10;
+}
+
+// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type.
+message MsgConnectionOpenAckResponse {}
+
+// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to
+// acknowledge the change of connection state to OPEN on Chain A.
+message MsgConnectionOpenConfirm {
+ option (gogoproto.equal) = false;
+ option (gogoproto.goproto_getters) = false;
+
+ string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""];
+ // proof for the change of the connection state on Chain A: `INIT -> OPEN`
+ bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""];
+ ibc.core.client.v1.Height proof_height = 3
+ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
+ string signer = 4;
+}
+
+// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm
+// response type.
+message MsgConnectionOpenConfirmResponse {}
diff --git a/examples/authz/proto/ibc/core/port/v1/query.proto b/examples/authz/proto/ibc/core/port/v1/query.proto
new file mode 100644
index 00000000..3c7fb7cb
--- /dev/null
+++ b/examples/authz/proto/ibc/core/port/v1/query.proto
@@ -0,0 +1,35 @@
+syntax = "proto3";
+
+package ibc.core.port.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/05-port/types";
+
+import "ibc/core/channel/v1/channel.proto";
+
+// Query defines the gRPC querier service
+service Query {
+ // AppVersion queries an IBC Port and determines the appropriate application version to be used
+ rpc AppVersion(QueryAppVersionRequest) returns (QueryAppVersionResponse) {}
+}
+
+// QueryAppVersionRequest is the request type for the Query/AppVersion RPC method
+message QueryAppVersionRequest {
+ // port unique identifier
+ string port_id = 1;
+ // connection unique identifier
+ string connection_id = 2;
+ // whether the channel is ordered or unordered
+ ibc.core.channel.v1.Order ordering = 3;
+ // counterparty channel end
+ ibc.core.channel.v1.Counterparty counterparty = 4;
+ // proposed version
+ string proposed_version = 5;
+}
+
+// QueryAppVersionResponse is the response type for the Query/AppVersion RPC method.
+message QueryAppVersionResponse {
+ // port id associated with the request identifiers
+ string port_id = 1;
+ // supported app version
+ string version = 2;
+}
diff --git a/examples/authz/proto/ibc/core/types/v1/genesis.proto b/examples/authz/proto/ibc/core/types/v1/genesis.proto
new file mode 100644
index 00000000..e39f6cdb
--- /dev/null
+++ b/examples/authz/proto/ibc/core/types/v1/genesis.proto
@@ -0,0 +1,23 @@
+syntax = "proto3";
+
+package ibc.core.types.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/types";
+
+import "gogoproto/gogo.proto";
+import "ibc/core/client/v1/genesis.proto";
+import "ibc/core/connection/v1/genesis.proto";
+import "ibc/core/channel/v1/genesis.proto";
+
+// GenesisState defines the ibc module's genesis state.
+message GenesisState {
+ // ICS002 - Clients genesis state
+ ibc.core.client.v1.GenesisState client_genesis = 1
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_genesis\""];
+ // ICS003 - Connections genesis state
+ ibc.core.connection.v1.GenesisState connection_genesis = 2
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"connection_genesis\""];
+ // ICS004 - Channel genesis state
+ ibc.core.channel.v1.GenesisState channel_genesis = 3
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"channel_genesis\""];
+}
diff --git a/examples/authz/proto/ibc/lightclients/localhost/v1/localhost.proto b/examples/authz/proto/ibc/lightclients/localhost/v1/localhost.proto
new file mode 100644
index 00000000..4fe05b78
--- /dev/null
+++ b/examples/authz/proto/ibc/lightclients/localhost/v1/localhost.proto
@@ -0,0 +1,18 @@
+syntax = "proto3";
+
+package ibc.lightclients.localhost.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/light-clients/09-localhost/types";
+
+import "gogoproto/gogo.proto";
+import "ibc/core/client/v1/client.proto";
+
+// ClientState defines a loopback (localhost) client. It requires (read-only)
+// access to keys outside the client prefix.
+message ClientState {
+ option (gogoproto.goproto_getters) = false;
+ // self chain ID
+ string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""];
+ // self latest block height
+ ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/ibc/lightclients/solomachine/v1/solomachine.proto b/examples/authz/proto/ibc/lightclients/solomachine/v1/solomachine.proto
new file mode 100644
index 00000000..b9b8a3a2
--- /dev/null
+++ b/examples/authz/proto/ibc/lightclients/solomachine/v1/solomachine.proto
@@ -0,0 +1,189 @@
+syntax = "proto3";
+
+package ibc.lightclients.solomachine.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/legacy/v100";
+
+import "ibc/core/connection/v1/connection.proto";
+import "ibc/core/channel/v1/channel.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+// ClientState defines a solo machine client that tracks the current consensus
+// state and if the client is frozen.
+message ClientState {
+ option (gogoproto.goproto_getters) = false;
+ // latest sequence of the client state
+ uint64 sequence = 1;
+ // frozen sequence of the solo machine
+ uint64 frozen_sequence = 2 [(gogoproto.moretags) = "yaml:\"frozen_sequence\""];
+ ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
+ // when set to true, will allow governance to update a solo machine client.
+ // The client will be unfrozen if it is frozen.
+ bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""];
+}
+
+// ConsensusState defines a solo machine consensus state. The sequence of a
+// consensus state is contained in the "height" key used in storing the
+// consensus state.
+message ConsensusState {
+ option (gogoproto.goproto_getters) = false;
+ // public key of the solo machine
+ google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""];
+ // diversifier allows the same public key to be re-used across different solo
+ // machine clients (potentially on different chains) without being considered
+ // misbehaviour.
+ string diversifier = 2;
+ uint64 timestamp = 3;
+}
+
+// Header defines a solo machine consensus header
+message Header {
+ option (gogoproto.goproto_getters) = false;
+ // sequence to update solo machine public key at
+ uint64 sequence = 1;
+ uint64 timestamp = 2;
+ bytes signature = 3;
+ google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""];
+ string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""];
+}
+
+// Misbehaviour defines misbehaviour for a solo machine which consists
+// of a sequence and two signatures over different messages at that sequence.
+message Misbehaviour {
+ option (gogoproto.goproto_getters) = false;
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ uint64 sequence = 2;
+ SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""];
+ SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""];
+}
+
+// SignatureAndData contains a signature and the data signed over to create that
+// signature.
+message SignatureAndData {
+ option (gogoproto.goproto_getters) = false;
+ bytes signature = 1;
+ DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""];
+ bytes data = 3;
+ uint64 timestamp = 4;
+}
+
+// TimestampedSignatureData contains the signature data and the timestamp of the
+// signature.
+message TimestampedSignatureData {
+ option (gogoproto.goproto_getters) = false;
+ bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""];
+ uint64 timestamp = 2;
+}
+
+// SignBytes defines the signed bytes used for signature verification.
+message SignBytes {
+ option (gogoproto.goproto_getters) = false;
+
+ uint64 sequence = 1;
+ uint64 timestamp = 2;
+ string diversifier = 3;
+ // type of the data used
+ DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""];
+ // marshaled data
+ bytes data = 5;
+}
+
+// DataType defines the type of solo machine proof being created. This is done
+// to preserve uniqueness of different data sign byte encodings.
+enum DataType {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // Default State
+ DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"];
+ // Data type for client state verification
+ DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"];
+ // Data type for consensus state verification
+ DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"];
+ // Data type for connection state verification
+ DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"];
+ // Data type for channel state verification
+ DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"];
+ // Data type for packet commitment verification
+ DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"];
+ // Data type for packet acknowledgement verification
+ DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"];
+ // Data type for packet receipt absence verification
+ DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"];
+ // Data type for next sequence recv verification
+ DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"];
+ // Data type for header verification
+ DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"];
+}
+
+// HeaderData returns the SignBytes data for update verification.
+message HeaderData {
+ option (gogoproto.goproto_getters) = false;
+
+ // header public key
+ google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""];
+ // header diversifier
+ string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""];
+}
+
+// ClientStateData returns the SignBytes data for client state verification.
+message ClientStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""];
+}
+
+// ConsensusStateData returns the SignBytes data for consensus state
+// verification.
+message ConsensusStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
+}
+
+// ConnectionStateData returns the SignBytes data for connection state
+// verification.
+message ConnectionStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ ibc.core.connection.v1.ConnectionEnd connection = 2;
+}
+
+// ChannelStateData returns the SignBytes data for channel state
+// verification.
+message ChannelStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ ibc.core.channel.v1.Channel channel = 2;
+}
+
+// PacketCommitmentData returns the SignBytes data for packet commitment
+// verification.
+message PacketCommitmentData {
+ bytes path = 1;
+ bytes commitment = 2;
+}
+
+// PacketAcknowledgementData returns the SignBytes data for acknowledgement
+// verification.
+message PacketAcknowledgementData {
+ bytes path = 1;
+ bytes acknowledgement = 2;
+}
+
+// PacketReceiptAbsenceData returns the SignBytes data for
+// packet receipt absence verification.
+message PacketReceiptAbsenceData {
+ bytes path = 1;
+}
+
+// NextSequenceRecvData returns the SignBytes data for verification of the next
+// sequence to be received.
+message NextSequenceRecvData {
+ bytes path = 1;
+ uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""];
+}
diff --git a/examples/authz/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/examples/authz/proto/ibc/lightclients/solomachine/v2/solomachine.proto
new file mode 100644
index 00000000..0c8c638c
--- /dev/null
+++ b/examples/authz/proto/ibc/lightclients/solomachine/v2/solomachine.proto
@@ -0,0 +1,189 @@
+syntax = "proto3";
+
+package ibc.lightclients.solomachine.v2;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/light-clients/06-solomachine/types";
+
+import "ibc/core/connection/v1/connection.proto";
+import "ibc/core/channel/v1/channel.proto";
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+
+// ClientState defines a solo machine client that tracks the current consensus
+// state and if the client is frozen.
+message ClientState {
+ option (gogoproto.goproto_getters) = false;
+ // latest sequence of the client state
+ uint64 sequence = 1;
+ // frozen sequence of the solo machine
+ bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""];
+ ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
+ // when set to true, will allow governance to update a solo machine client.
+ // The client will be unfrozen if it is frozen.
+ bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""];
+}
+
+// ConsensusState defines a solo machine consensus state. The sequence of a
+// consensus state is contained in the "height" key used in storing the
+// consensus state.
+message ConsensusState {
+ option (gogoproto.goproto_getters) = false;
+ // public key of the solo machine
+ google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""];
+ // diversifier allows the same public key to be re-used across different solo
+ // machine clients (potentially on different chains) without being considered
+ // misbehaviour.
+ string diversifier = 2;
+ uint64 timestamp = 3;
+}
+
+// Header defines a solo machine consensus header
+message Header {
+ option (gogoproto.goproto_getters) = false;
+ // sequence to update solo machine public key at
+ uint64 sequence = 1;
+ uint64 timestamp = 2;
+ bytes signature = 3;
+ google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""];
+ string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""];
+}
+
+// Misbehaviour defines misbehaviour for a solo machine which consists
+// of a sequence and two signatures over different messages at that sequence.
+message Misbehaviour {
+ option (gogoproto.goproto_getters) = false;
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ uint64 sequence = 2;
+ SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""];
+ SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""];
+}
+
+// SignatureAndData contains a signature and the data signed over to create that
+// signature.
+message SignatureAndData {
+ option (gogoproto.goproto_getters) = false;
+ bytes signature = 1;
+ DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""];
+ bytes data = 3;
+ uint64 timestamp = 4;
+}
+
+// TimestampedSignatureData contains the signature data and the timestamp of the
+// signature.
+message TimestampedSignatureData {
+ option (gogoproto.goproto_getters) = false;
+ bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""];
+ uint64 timestamp = 2;
+}
+
+// SignBytes defines the signed bytes used for signature verification.
+message SignBytes {
+ option (gogoproto.goproto_getters) = false;
+
+ uint64 sequence = 1;
+ uint64 timestamp = 2;
+ string diversifier = 3;
+ // type of the data used
+ DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""];
+ // marshaled data
+ bytes data = 5;
+}
+
+// DataType defines the type of solo machine proof being created. This is done
+// to preserve uniqueness of different data sign byte encodings.
+enum DataType {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ // Default State
+ DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"];
+ // Data type for client state verification
+ DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"];
+ // Data type for consensus state verification
+ DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"];
+ // Data type for connection state verification
+ DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"];
+ // Data type for channel state verification
+ DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"];
+ // Data type for packet commitment verification
+ DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"];
+ // Data type for packet acknowledgement verification
+ DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"];
+ // Data type for packet receipt absence verification
+ DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"];
+ // Data type for next sequence recv verification
+ DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"];
+ // Data type for header verification
+ DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"];
+}
+
+// HeaderData returns the SignBytes data for update verification.
+message HeaderData {
+ option (gogoproto.goproto_getters) = false;
+
+ // header public key
+ google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""];
+ // header diversifier
+ string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""];
+}
+
+// ClientStateData returns the SignBytes data for client state verification.
+message ClientStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""];
+}
+
+// ConsensusStateData returns the SignBytes data for consensus state
+// verification.
+message ConsensusStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
+}
+
+// ConnectionStateData returns the SignBytes data for connection state
+// verification.
+message ConnectionStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ ibc.core.connection.v1.ConnectionEnd connection = 2;
+}
+
+// ChannelStateData returns the SignBytes data for channel state
+// verification.
+message ChannelStateData {
+ option (gogoproto.goproto_getters) = false;
+
+ bytes path = 1;
+ ibc.core.channel.v1.Channel channel = 2;
+}
+
+// PacketCommitmentData returns the SignBytes data for packet commitment
+// verification.
+message PacketCommitmentData {
+ bytes path = 1;
+ bytes commitment = 2;
+}
+
+// PacketAcknowledgementData returns the SignBytes data for acknowledgement
+// verification.
+message PacketAcknowledgementData {
+ bytes path = 1;
+ bytes acknowledgement = 2;
+}
+
+// PacketReceiptAbsenceData returns the SignBytes data for
+// packet receipt absence verification.
+message PacketReceiptAbsenceData {
+ bytes path = 1;
+}
+
+// NextSequenceRecvData returns the SignBytes data for verification of the next
+// sequence to be received.
+message NextSequenceRecvData {
+ bytes path = 1;
+ uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""];
+}
diff --git a/examples/authz/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/examples/authz/proto/ibc/lightclients/tendermint/v1/tendermint.proto
new file mode 100644
index 00000000..54e229b2
--- /dev/null
+++ b/examples/authz/proto/ibc/lightclients/tendermint/v1/tendermint.proto
@@ -0,0 +1,115 @@
+syntax = "proto3";
+
+package ibc.lightclients.tendermint.v1;
+
+option go_package = "github.com/cosmos/ibc-go/v2/modules/light-clients/07-tendermint/types";
+
+import "tendermint/types/validator.proto";
+import "tendermint/types/types.proto";
+import "confio/proofs.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+import "ibc/core/client/v1/client.proto";
+import "ibc/core/commitment/v1/commitment.proto";
+import "gogoproto/gogo.proto";
+
+// ClientState from Tendermint tracks the current validator set, latest height,
+// and a possible frozen height.
+message ClientState {
+ option (gogoproto.goproto_getters) = false;
+
+ string chain_id = 1;
+ Fraction trust_level = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trust_level\""];
+ // duration of the period since the LastestTimestamp during which the
+ // submitted headers are valid for upgrade
+ google.protobuf.Duration trusting_period = 3
+ [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"trusting_period\""];
+ // duration of the staking unbonding period
+ google.protobuf.Duration unbonding_period = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"unbonding_period\""
+ ];
+ // defines how much new (untrusted) header's Time can drift into the future.
+ google.protobuf.Duration max_clock_drift = 5
+ [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"max_clock_drift\""];
+ // Block height when the client was frozen due to a misbehaviour
+ ibc.core.client.v1.Height frozen_height = 6
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"frozen_height\""];
+ // Latest height the client was updated to
+ ibc.core.client.v1.Height latest_height = 7
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""];
+
+ // Proof specifications used in verifying counterparty state
+ repeated ics23.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""];
+
+ // Path at which next upgraded client will be committed.
+ // Each element corresponds to the key for a single CommitmentProof in the
+ // chained proof. NOTE: ClientState must stored under
+ // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
+ // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
+ // the default upgrade module, upgrade_path should be []string{"upgrade",
+ // "upgradedIBCState"}`
+ repeated string upgrade_path = 9 [(gogoproto.moretags) = "yaml:\"upgrade_path\""];
+
+ // This flag, when set to true, will allow governance to recover a client
+ // which has expired
+ bool allow_update_after_expiry = 10 [(gogoproto.moretags) = "yaml:\"allow_update_after_expiry\""];
+ // This flag, when set to true, will allow governance to unfreeze a client
+ // whose chain has experienced a misbehaviour event
+ bool allow_update_after_misbehaviour = 11 [(gogoproto.moretags) = "yaml:\"allow_update_after_misbehaviour\""];
+}
+
+// ConsensusState defines the consensus state from Tendermint.
+message ConsensusState {
+ option (gogoproto.goproto_getters) = false;
+
+ // timestamp that corresponds to the block height in which the ConsensusState
+ // was stored.
+ google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ // commitment root (i.e app hash)
+ ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false];
+ bytes next_validators_hash = 3 [
+ (gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes",
+ (gogoproto.moretags) = "yaml:\"next_validators_hash\""
+ ];
+}
+
+// Misbehaviour is a wrapper over two conflicting Headers
+// that implements Misbehaviour interface expected by ICS-02
+message Misbehaviour {
+ option (gogoproto.goproto_getters) = false;
+
+ string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
+ Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""];
+ Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""];
+}
+
+// Header defines the Tendermint client consensus Header.
+// It encapsulates all the information necessary to update from a trusted
+// Tendermint ConsensusState. The inclusion of TrustedHeight and
+// TrustedValidators allows this update to process correctly, so long as the
+// ConsensusState for the TrustedHeight exists, this removes race conditions
+// among relayers The SignedHeader and ValidatorSet are the new untrusted update
+// fields for the client. The TrustedHeight is the height of a stored
+// ConsensusState on the client that will be used to verify the new untrusted
+// header. The Trusted ConsensusState must be within the unbonding period of
+// current time in order to correctly verify, and the TrustedValidators must
+// hash to TrustedConsensusState.NextValidatorsHash since that is the last
+// trusted validator set at the TrustedHeight.
+message Header {
+ .tendermint.types.SignedHeader signed_header = 1
+ [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"signed_header\""];
+
+ .tendermint.types.ValidatorSet validator_set = 2 [(gogoproto.moretags) = "yaml:\"validator_set\""];
+ ibc.core.client.v1.Height trusted_height = 3
+ [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trusted_height\""];
+ .tendermint.types.ValidatorSet trusted_validators = 4 [(gogoproto.moretags) = "yaml:\"trusted_validators\""];
+}
+
+// Fraction defines the protobuf message type for tmmath.Fraction that only
+// supports positive values.
+message Fraction {
+ uint64 numerator = 1;
+ uint64 denominator = 2;
+}
diff --git a/examples/authz/proto/osmosis/claim/v1beta1/claim.proto b/examples/authz/proto/osmosis/claim/v1beta1/claim.proto
new file mode 100644
index 00000000..47e824ab
--- /dev/null
+++ b/examples/authz/proto/osmosis/claim/v1beta1/claim.proto
@@ -0,0 +1,35 @@
+syntax = "proto3";
+package osmosis.claim.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/genesis.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v7/x/claim/types";
+
+enum Action {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ ActionAddLiquidity = 0;
+ ActionSwap = 1;
+ ActionVote = 2;
+ ActionDelegateStake = 3;
+}
+
+// A Claim Records is the metadata of claim data per address
+message ClaimRecord {
+ // address of claim user
+ string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
+
+ // total initial claimable amount for the user
+ repeated cosmos.base.v1beta1.Coin initial_claimable_amount = 2 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"initial_claimable_amount\""
+ ];
+
+ // true if action is completed
+ // index of bool in array refers to action enum #
+ repeated bool action_completed = 3
+ [ (gogoproto.moretags) = "yaml:\"action_completed\"" ];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/claim/v1beta1/genesis.proto b/examples/authz/proto/osmosis/claim/v1beta1/genesis.proto
new file mode 100644
index 00000000..1166a25c
--- /dev/null
+++ b/examples/authz/proto/osmosis/claim/v1beta1/genesis.proto
@@ -0,0 +1,33 @@
+syntax = "proto3";
+package osmosis.claim.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/genesis.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+import "osmosis/claim/v1beta1/claim.proto";
+import "osmosis/claim/v1beta1/params.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v7/x/claim/types";
+
+// GenesisState defines the claim module's genesis state.
+message GenesisState {
+ // balance of the claim module's account
+ cosmos.base.v1beta1.Coin module_account_balance = 1 [
+ (gogoproto.moretags) = "yaml:\"module_account_balance\"",
+ (gogoproto.nullable) = false
+ ];
+
+ // params defines all the parameters of the module.
+ Params params = 2 [
+ (gogoproto.moretags) = "yaml:\"params\"",
+ (gogoproto.nullable) = false
+ ];
+
+ // list of claim records, one for every airdrop recipient
+ repeated ClaimRecord claim_records = 3 [
+ (gogoproto.moretags) = "yaml:\"claim_records\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/claim/v1beta1/params.proto b/examples/authz/proto/osmosis/claim/v1beta1/params.proto
new file mode 100644
index 00000000..3398b0da
--- /dev/null
+++ b/examples/authz/proto/osmosis/claim/v1beta1/params.proto
@@ -0,0 +1,31 @@
+syntax = "proto3";
+package osmosis.claim.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v7/x/claim/types";
+
+// Params defines the claim module's parameters.
+message Params {
+ google.protobuf.Timestamp airdrop_start_time = 1 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"airdrop_start_time\""
+ ];
+ google.protobuf.Duration duration_until_decay = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration_until_decay,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration_until_decay\""
+ ];
+ google.protobuf.Duration duration_of_decay = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration_of_decay,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration_of_decay\""
+ ];
+ // denom of claimable asset
+ string claim_denom = 4;
+}
diff --git a/examples/authz/proto/osmosis/claim/v1beta1/query.proto b/examples/authz/proto/osmosis/claim/v1beta1/query.proto
new file mode 100644
index 00000000..cca55759
--- /dev/null
+++ b/examples/authz/proto/osmosis/claim/v1beta1/query.proto
@@ -0,0 +1,94 @@
+syntax = "proto3";
+package osmosis.claim.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "osmosis/claim/v1beta1/claim.proto";
+import "osmosis/claim/v1beta1/params.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v7/x/claim/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ rpc ModuleAccountBalance(QueryModuleAccountBalanceRequest)
+ returns (QueryModuleAccountBalanceResponse) {
+ option (google.api.http).get =
+ "/osmosis/claim/v1beta1/module_account_balance";
+ }
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/claim/v1beta1/params";
+ }
+ rpc ClaimRecord(QueryClaimRecordRequest) returns (QueryClaimRecordResponse) {
+ option (google.api.http).get =
+ "/osmosis/claim/v1beta1/claim_record/{address}";
+ }
+ rpc ClaimableForAction(QueryClaimableForActionRequest)
+ returns (QueryClaimableForActionResponse) {
+ option (google.api.http).get =
+ "/osmosis/claim/v1beta1/claimable_for_action/{address}/{action}";
+ }
+ rpc TotalClaimable(QueryTotalClaimableRequest)
+ returns (QueryTotalClaimableResponse) {
+ option (google.api.http).get =
+ "/osmosis/claim/v1beta1/total_claimable/{address}";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryModuleAccountBalanceRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryModuleAccountBalanceResponse {
+ // params defines the parameters of the module.
+ repeated cosmos.base.v1beta1.Coin moduleAccountBalance = 1 [
+ (gogoproto.moretags) = "yaml:\"coins\"",
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
+
+message QueryClaimRecordRequest {
+ string address = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+}
+
+message QueryClaimRecordResponse {
+ ClaimRecord claim_record = 1 [
+ (gogoproto.moretags) = "yaml:\"claim_record\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message QueryClaimableForActionRequest {
+ string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
+ Action action = 2 [ (gogoproto.moretags) = "yaml:\"action\"" ];
+}
+
+message QueryClaimableForActionResponse {
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.moretags) = "yaml:\"coins\"",
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message QueryTotalClaimableRequest {
+ string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
+}
+
+message QueryTotalClaimableResponse {
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.moretags) = "yaml:\"coins\"",
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/epochs/genesis.proto b/examples/authz/proto/osmosis/epochs/genesis.proto
new file mode 100644
index 00000000..f8a2754b
--- /dev/null
+++ b/examples/authz/proto/osmosis/epochs/genesis.proto
@@ -0,0 +1,72 @@
+syntax = "proto3";
+package osmosis.epochs.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/epochs/types";
+
+// EpochInfo is a struct that describes the data going into
+// a timer defined by the x/epochs module.
+message EpochInfo {
+ // identifier is a unique reference to this particular timer.
+ string identifier = 1;
+ // start_time is the time at which the timer first ever ticks.
+ // If start_time is in the future, the epoch will not begin until the start
+ // time.
+ google.protobuf.Timestamp start_time = 2 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"start_time\""
+ ];
+ // duration is the time in between epoch ticks.
+ // In order for intended behavior to be met, duration should
+ // be greater than the chains expected block time.
+ // Duration must be non-zero.
+ google.protobuf.Duration duration = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+ // current_epoch is the current epoch number, or in other words,
+ // how many times has the timer 'ticked'.
+ // The first tick (current_epoch=1) is defined as
+ // the first block whose blocktime is greater than the EpochInfo start_time.
+ int64 current_epoch = 4;
+ // current_epoch_start_time describes the start time of the current timer
+ // interval. The interval is (current_epoch_start_time,
+ // current_epoch_start_time + duration] When the timer ticks, this is set to
+ // current_epoch_start_time = last_epoch_start_time + duration only one timer
+ // tick for a given identifier can occur per block.
+ //
+ // NOTE! The current_epoch_start_time may diverge significantly from the
+ // wall-clock time the epoch began at. Wall-clock time of epoch start may be
+ // >> current_epoch_start_time. Suppose current_epoch_start_time = 10,
+ // duration = 5. Suppose the chain goes offline at t=14, and comes back online
+ // at t=30, and produces blocks at every successive time. (t=31, 32, etc.)
+ // * The t=30 block will start the epoch for (10, 15]
+ // * The t=31 block will start the epoch for (15, 20]
+ // * The t=32 block will start the epoch for (20, 25]
+ // * The t=33 block will start the epoch for (25, 30]
+ // * The t=34 block will start the epoch for (30, 35]
+ // * The **t=36** block will start the epoch for (35, 40]
+ google.protobuf.Timestamp current_epoch_start_time = 5 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"current_epoch_start_time\""
+ ];
+ // epoch_counting_started is a boolean, that indicates whether this
+ // epoch timer has began yet.
+ bool epoch_counting_started = 6;
+ reserved 7;
+ // current_epoch_start_height is the block height at which the current epoch
+ // started. (The block height at which the timer last ticked)
+ int64 current_epoch_start_height = 8;
+}
+
+// GenesisState defines the epochs module's genesis state.
+message GenesisState {
+ repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/epochs/query.proto b/examples/authz/proto/osmosis/epochs/query.proto
new file mode 100644
index 00000000..9fde25db
--- /dev/null
+++ b/examples/authz/proto/osmosis/epochs/query.proto
@@ -0,0 +1,30 @@
+syntax = "proto3";
+package osmosis.epochs.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "osmosis/epochs/genesis.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/epochs/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // EpochInfos provide running epochInfos
+ rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) {
+ option (google.api.http).get = "/osmosis/epochs/v1beta1/epochs";
+ }
+ // CurrentEpoch provide current epoch of specified identifier
+ rpc CurrentEpoch(QueryCurrentEpochRequest)
+ returns (QueryCurrentEpochResponse) {
+ option (google.api.http).get = "/osmosis/epochs/v1beta1/current_epoch";
+ }
+}
+
+message QueryEpochsInfoRequest {}
+message QueryEpochsInfoResponse {
+ repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ];
+}
+
+message QueryCurrentEpochRequest { string identifier = 1; }
+message QueryCurrentEpochResponse { int64 current_epoch = 1; }
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto b/examples/authz/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto
new file mode 100644
index 00000000..6ee8f133
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto
@@ -0,0 +1,151 @@
+syntax = "proto3";
+// this is a legacy package that requires additional migration logic
+// in order to use the correct packge. Decision made to use legacy package path
+// until clear steps for migration logic and the unknowns for state breaking are
+// investigated for changing proto package.
+package osmosis.gamm.v1beta1;
+
+import "cosmos_proto/cosmos.proto";
+import "gogoproto/gogo.proto";
+
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+
+import "cosmos/auth/v1beta1/auth.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer";
+
+// Parameters for changing the weights in a balancer pool smoothly from
+// a start weight and end weight over a period of time.
+// Currently, the only smooth change supported is linear changing between
+// the two weights, but more types may be added in the future.
+// When these parameters are set, the weight w(t) for pool time `t` is the
+// following:
+// t <= start_time: w(t) = initial_pool_weights
+// start_time < t <= start_time + duration:
+// w(t) = initial_pool_weights + (t - start_time) *
+// (target_pool_weights - initial_pool_weights) / (duration)
+// t > start_time + duration: w(t) = target_pool_weights
+message SmoothWeightChangeParams {
+ // The start time for beginning the weight change.
+ // If a parameter change / pool instantiation leaves this blank,
+ // it should be generated by the state_machine as the current time.
+ google.protobuf.Timestamp start_time = 1 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"start_time\""
+ ];
+ // Duration for the weights to change over
+ google.protobuf.Duration duration = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+ // The initial pool weights. These are copied from the pool's settings
+ // at the time of weight change instantiation.
+ // The amount PoolAsset.token.amount field is ignored if present,
+ // future type refactorings should just have a type with the denom & weight
+ // here.
+ repeated osmosis.gamm.v1beta1.PoolAsset initial_pool_weights = 3 [
+ (gogoproto.moretags) = "yaml:\"initial_pool_weights\"",
+ (gogoproto.nullable) = false
+ ];
+ // The target pool weights. The pool weights will change linearly with respect
+ // to time between start_time, and start_time + duration. The amount
+ // PoolAsset.token.amount field is ignored if present, future type
+ // refactorings should just have a type with the denom & weight here.
+ repeated osmosis.gamm.v1beta1.PoolAsset target_pool_weights = 4 [
+ (gogoproto.moretags) = "yaml:\"target_pool_weights\"",
+ (gogoproto.nullable) = false
+ ];
+ // Intermediate variable for the 'slope' of pool weights. This is equal to
+ // (target_pool_weights - initial_pool_weights) / (duration)
+ // TODO: Work out precision, and decide if this is good to add
+ // repeated PoolAsset poolWeightSlope = 5 [
+ // (gogoproto.moretags) = "yaml:\"pool_weight_slope\"",
+ // (gogoproto.nullable) = false
+ // ];
+}
+
+// PoolParams defined the parameters that will be managed by the pool
+// governance in the future. This params are not managed by the chain
+// governance. Instead they will be managed by the token holders of the pool.
+// The pool's token holders are specified in future_pool_governor.
+message PoolParams {
+ string swap_fee = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"swap_fee\"",
+ (gogoproto.nullable) = false
+ ];
+ string exit_fee = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"exit_fee\"",
+ (gogoproto.nullable) = false
+ ];
+ SmoothWeightChangeParams smooth_weight_change_params = 3 [
+ (gogoproto.moretags) = "yaml:\"smooth_weight_change_params\"",
+ (gogoproto.nullable) = true
+ ];
+}
+
+// Pool asset is an internal struct that combines the amount of the
+// token in the pool, and its balancer weight.
+// This is an awkward packaging of data,
+// and should be revisited in a future state migration.
+message PoolAsset {
+ // Coins we are talking about,
+ // the denomination must be unique amongst all PoolAssets for this pool.
+ cosmos.base.v1beta1.Coin token = 1
+ [ (gogoproto.moretags) = "yaml:\"token\"", (gogoproto.nullable) = false ];
+ // Weight that is not normalized. This weight must be less than 2^50
+ string weight = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"weight\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message Pool {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "PoolI";
+
+ string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
+ uint64 id = 2;
+
+ PoolParams pool_params = 3 [
+ (gogoproto.moretags) = "yaml:\"balancer_pool_params\"",
+ (gogoproto.nullable) = false
+ ];
+
+ // This string specifies who will govern the pool in the future.
+ // Valid forms of this are:
+ // {token name},{duration}
+ // {duration}
+ // where {token name} if specified is the token which determines the
+ // governor, and if not specified is the LP token for this pool.duration is
+ // a time specified as 0w,1w,2w, etc. which specifies how long the token
+ // would need to be locked up to count in governance. 0w means no lockup.
+ // TODO: Further improve these docs
+ string future_pool_governor = 4
+ [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ];
+ // sum of all LP tokens sent out
+ cosmos.base.v1beta1.Coin total_shares = 5 [
+ (gogoproto.moretags) = "yaml:\"total_shares\"",
+ (gogoproto.nullable) = false
+ ];
+ // These are assumed to be sorted by denomiation.
+ // They contain the pool asset and the information about the weight
+ repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 6 [
+ (gogoproto.moretags) = "yaml:\"pool_assets\"",
+ (gogoproto.nullable) = false
+ ];
+ // sum of all non-normalized pool weights
+ string total_weight = 7 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"total_weight\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto b/examples/authz/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto
new file mode 100644
index 00000000..5ed0fdc0
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto
@@ -0,0 +1,31 @@
+syntax = "proto3";
+package osmosis.gamm.poolmodels.balancer.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/gamm/pool-models/balancer/balancerPool.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer";
+
+service Msg {
+ rpc CreateBalancerPool(MsgCreateBalancerPool)
+ returns (MsgCreateBalancerPoolResponse);
+}
+
+// ===================== MsgCreatePool
+message MsgCreateBalancerPool {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+
+ osmosis.gamm.v1beta1.PoolParams pool_params = 2
+ [ (gogoproto.moretags) = "yaml:\"pool_params\"" ];
+
+ repeated osmosis.gamm.v1beta1.PoolAsset pool_assets = 3
+ [ (gogoproto.nullable) = false ];
+
+ string future_pool_governor = 4
+ [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ];
+}
+
+// Returns the poolID
+message MsgCreateBalancerPoolResponse {
+ uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ];
+}
diff --git a/examples/authz/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto b/examples/authz/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto
new file mode 100644
index 00000000..582a37b3
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto
@@ -0,0 +1,73 @@
+syntax = "proto3";
+package osmosis.gamm.poolmodels.stableswap.v1beta1;
+
+import "cosmos_proto/cosmos.proto";
+import "gogoproto/gogo.proto";
+
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+
+import "cosmos/auth/v1beta1/auth.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/stableswap";
+
+// PoolParams defined the parameters that will be managed by the pool
+// governance in the future. This params are not managed by the chain
+// governance. Instead they will be managed by the token holders of the pool.
+// The pool's token holders are specified in future_pool_governor.
+message PoolParams {
+ string swap_fee = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"swap_fee\"",
+ (gogoproto.nullable) = false
+ ];
+ string exit_fee = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"exit_fee\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// Pool is the stableswap Pool struct
+message Pool {
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "PoolI";
+
+ string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
+ uint64 id = 2;
+
+ PoolParams pool_params = 3 [
+ (gogoproto.moretags) = "yaml:\"stableswap_pool_params\"",
+ (gogoproto.nullable) = false
+ ];
+
+ // This string specifies who will govern the pool in the future.
+ // Valid forms of this are:
+ // {token name},{duration}
+ // {duration}
+ // where {token name} if specified is the token which determines the
+ // governor, and if not specified is the LP token for this pool.duration is
+ // a time specified as 0w,1w,2w, etc. which specifies how long the token
+ // would need to be locked up to count in governance. 0w means no lockup.
+ string future_pool_governor = 4
+ [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ];
+ // sum of all LP shares
+ cosmos.base.v1beta1.Coin total_shares = 5 [
+ (gogoproto.moretags) = "yaml:\"total_shares\"",
+ (gogoproto.nullable) = false
+ ];
+ // assets in the pool
+ repeated cosmos.base.v1beta1.Coin pool_liquidity = 6 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+
+ // for calculation amognst assets with different precisions
+ repeated uint64 scaling_factors = 7
+ [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factors\"" ];
+ // scaling_factor_controller is the address can adjust pool scaling factors
+ string scaling_factor_controller = 8
+ [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ];
+}
diff --git a/examples/authz/proto/osmosis/gamm/pool-models/stableswap/tx.proto b/examples/authz/proto/osmosis/gamm/pool-models/stableswap/tx.proto
new file mode 100644
index 00000000..73a74b06
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/pool-models/stableswap/tx.proto
@@ -0,0 +1,53 @@
+syntax = "proto3";
+package osmosis.gamm.poolmodels.stableswap.v1beta1;
+
+import "cosmos/base/v1beta1/coin.proto";
+import "gogoproto/gogo.proto";
+import "osmosis/gamm/pool-models/stableswap/stableswap_pool.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/stableswap";
+
+service Msg {
+ rpc CreateStableswapPool(MsgCreateStableswapPool)
+ returns (MsgCreateStableswapPoolResponse);
+ rpc StableSwapAdjustScalingFactors(MsgStableSwapAdjustScalingFactors)
+ returns (MsgStableSwapAdjustScalingFactorsResponse);
+}
+
+// ===================== MsgCreatePool
+message MsgCreateStableswapPool {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+
+ PoolParams pool_params = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ];
+
+ repeated cosmos.base.v1beta1.Coin initial_pool_liquidity = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+
+ repeated uint64 scaling_factors = 4
+ [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"" ];
+
+ string future_pool_governor = 5
+ [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ];
+
+ string scaling_factor_controller = 6
+ [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ];
+}
+
+// Returns a poolID with custom poolName.
+message MsgCreateStableswapPoolResponse {
+ uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ];
+}
+
+// Sender must be the pool's scaling_factor_governor in order for the tx to
+// succeed. Adjusts stableswap scaling factors.
+message MsgStableSwapAdjustScalingFactors {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.customname) = "PoolID" ];
+
+ repeated uint64 scaling_factors = 3
+ [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"" ];
+}
+
+message MsgStableSwapAdjustScalingFactorsResponse {}
diff --git a/examples/authz/proto/osmosis/gamm/v1beta1/genesis.proto b/examples/authz/proto/osmosis/gamm/v1beta1/genesis.proto
new file mode 100644
index 00000000..d2d71c0e
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/v1beta1/genesis.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+package osmosis.gamm.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+// Params holds parameters for the incentives module
+message Params {
+ repeated cosmos.base.v1beta1.Coin pool_creation_fee = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.moretags) = "yaml:\"pool_creation_fee\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/types";
+
+// GenesisState defines the gamm module's genesis state.
+message GenesisState {
+ repeated google.protobuf.Any pools = 1
+ [ (cosmos_proto.accepts_interface) = "PoolI" ];
+ // will be renamed to next_pool_id in an upcoming version
+ uint64 next_pool_number = 2;
+ Params params = 3 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/gamm/v1beta1/query.proto b/examples/authz/proto/osmosis/gamm/v1beta1/query.proto
new file mode 100644
index 00000000..9d6a521c
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/v1beta1/query.proto
@@ -0,0 +1,308 @@
+syntax = "proto3";
+package osmosis.gamm.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/gamm/v1beta1/tx.proto";
+
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/types";
+
+service Query {
+ rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) {
+ option (google.api.http).get = "/osmosis/gamm/v1beta1/pools";
+ }
+
+ rpc NumPools(QueryNumPoolsRequest) returns (QueryNumPoolsResponse) {
+ option (google.api.http).get = "/osmosis/gamm/v1beta1/num_pools";
+ }
+
+ rpc TotalLiquidity(QueryTotalLiquidityRequest)
+ returns (QueryTotalLiquidityResponse) {
+ option (google.api.http).get = "/osmosis/gamm/v1beta1/total_liquidity";
+ }
+
+ // PoolsWithFilter allows you to query specific pools with requested
+ // parameters
+ rpc PoolsWithFilter(QueryPoolsWithFilterRequest)
+ returns (QueryPoolsWithFilterResponse) {
+ option (google.api.http).get = "/osmosis/gamm/v1beta1/filtered_pools";
+ }
+
+ // Per Pool gRPC Endpoints
+ rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) {
+ option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{pool_id}";
+ }
+
+ // PoolType returns the type of the pool.
+ // Returns "Balancer" as a string literal when the pool is a balancer pool.
+ // Errors if the pool is failed to be type caseted.
+ rpc PoolType(QueryPoolTypeRequest) returns (QueryPoolTypeResponse) {
+ option (google.api.http).get = "/osmosis/gamm/v1beta1/pool_type/{pool_id}";
+ }
+
+ // Simulates joining pool without a swap. Returns the amount of shares you'd
+ // get and tokens needed to provide
+ rpc CalcJoinPoolNoSwapShares(QueryCalcJoinPoolNoSwapSharesRequest)
+ returns (QueryCalcJoinPoolNoSwapSharesResponse) {}
+
+ rpc CalcJoinPoolShares(QueryCalcJoinPoolSharesRequest)
+ returns (QueryCalcJoinPoolSharesResponse) {
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/pools/{pool_id}/join_swap_exact_in";
+ }
+ rpc CalcExitPoolCoinsFromShares(QueryCalcExitPoolCoinsFromSharesRequest)
+ returns (QueryCalcExitPoolCoinsFromSharesResponse) {
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/pools/{pool_id}/exit_swap_share_amount_in";
+ }
+
+ rpc PoolParams(QueryPoolParamsRequest) returns (QueryPoolParamsResponse) {
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/pools/{pool_id}/params";
+ }
+
+ rpc TotalPoolLiquidity(QueryTotalPoolLiquidityRequest)
+ returns (QueryTotalPoolLiquidityResponse) {
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/pools/{pool_id}/total_pool_liquidity";
+ }
+
+ rpc TotalShares(QueryTotalSharesRequest) returns (QueryTotalSharesResponse) {
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/pools/{pool_id}/total_shares";
+ }
+
+ // SpotPrice defines a gRPC query handler that returns the spot price given
+ // a base denomination and a quote denomination.
+ rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) {
+ option deprecated = true;
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/pools/{pool_id}/prices";
+ }
+
+ // Estimate the swap.
+ rpc EstimateSwapExactAmountIn(QuerySwapExactAmountInRequest)
+ returns (QuerySwapExactAmountInResponse) {
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/{pool_id}/estimate/swap_exact_amount_in";
+ }
+
+ rpc EstimateSwapExactAmountOut(QuerySwapExactAmountOutRequest)
+ returns (QuerySwapExactAmountOutResponse) {
+ option (google.api.http).get =
+ "/osmosis/gamm/v1beta1/{pool_id}/estimate/swap_exact_amount_out";
+ }
+}
+
+//=============================== Pool
+message QueryPoolRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+message QueryPoolResponse {
+ google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "PoolI" ];
+}
+
+//=============================== Pools
+message QueryPoolsRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+message QueryPoolsResponse {
+ repeated google.protobuf.Any pools = 1
+ [ (cosmos_proto.accepts_interface) = "PoolI" ];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+//=============================== NumPools
+message QueryNumPoolsRequest {}
+message QueryNumPoolsResponse {
+ uint64 num_pools = 1 [ (gogoproto.moretags) = "yaml:\"num_pools\"" ];
+}
+
+//=============================== PoolType
+message QueryPoolTypeRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+message QueryPoolTypeResponse {
+ string pool_type = 1 [ (gogoproto.moretags) = "yaml:\"pool_type\"" ];
+}
+
+//=============================== CalcJoinPoolShares
+message QueryCalcJoinPoolSharesRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ repeated cosmos.base.v1beta1.Coin tokens_in = 2 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.nullable) = false
+ ];
+}
+message QueryCalcJoinPoolSharesResponse {
+ string share_out_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_out_amount\"",
+ (gogoproto.nullable) = false
+ ];
+ repeated cosmos.base.v1beta1.Coin tokens_out = 2 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.nullable) = false
+ ];
+}
+
+//=============================== CalcExitPoolCoinsFromShares
+message QueryCalcExitPoolCoinsFromSharesRequest {
+ uint64 pool_id = 1;
+ string share_in_amount = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+message QueryCalcExitPoolCoinsFromSharesResponse {
+ repeated cosmos.base.v1beta1.Coin tokens_out = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.nullable) = false
+ ];
+}
+
+//=============================== PoolParams
+message QueryPoolParamsRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+message QueryPoolParamsResponse { google.protobuf.Any params = 1; }
+
+//=============================== PoolLiquidity
+message QueryTotalPoolLiquidityRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+
+message QueryTotalPoolLiquidityResponse {
+ repeated cosmos.base.v1beta1.Coin liquidity = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.moretags) = "yaml:\"liquidity\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+//=============================== TotalShares
+message QueryTotalSharesRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+message QueryTotalSharesResponse {
+ cosmos.base.v1beta1.Coin total_shares = 1 [
+ (gogoproto.moretags) = "yaml:\"total_shares\"",
+ (gogoproto.nullable) = false
+ ];
+}
+//=============================== CalcJoinPoolNoSwapShares
+message QueryCalcJoinPoolNoSwapSharesRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ repeated cosmos.base.v1beta1.Coin tokens_in = 2 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.nullable) = false
+ ];
+}
+message QueryCalcJoinPoolNoSwapSharesResponse {
+ repeated cosmos.base.v1beta1.Coin tokens_out = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.moretags) = "yaml:\"tokens_out\"",
+ (gogoproto.nullable) = false
+ ];
+ string shares_out = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice
+// query.
+message QuerySpotPriceRequest {
+ option deprecated = true;
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string base_asset_denom = 2
+ [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ];
+ string quote_asset_denom = 3
+ [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ];
+ reserved 4;
+ reserved "withSwapFee";
+}
+
+//=============================== PoolsWithFilter
+
+message QueryPoolsWithFilterRequest {
+ repeated cosmos.base.v1beta1.Coin min_liquidity = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.moretags) = "yaml:\"min_liquidity\"",
+ (gogoproto.nullable) = false
+ ];
+ string pool_type = 2;
+ cosmos.base.query.v1beta1.PageRequest pagination = 3;
+}
+
+message QueryPoolsWithFilterResponse {
+ repeated google.protobuf.Any pools = 1
+ [ (cosmos_proto.accepts_interface) = "PoolI" ];
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice
+// query.
+message QuerySpotPriceResponse {
+ option deprecated = true;
+ // String of the Dec. Ex) 10.203uatom
+ string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ];
+}
+
+//=============================== EstimateSwapExactAmountIn
+message QuerySwapExactAmountInRequest {
+ // TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string token_in = 3 [ (gogoproto.moretags) = "yaml:\"token_in\"" ];
+ repeated SwapAmountInRoute routes = 4 [
+ (gogoproto.moretags) = "yaml:\"routes\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message QuerySwapExactAmountInResponse {
+ string token_out_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_out_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+//=============================== EstimateSwapExactAmountOut
+message QuerySwapExactAmountOutRequest {
+ // TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ repeated SwapAmountOutRoute routes = 3 [
+ (gogoproto.moretags) = "yaml:\"routes\"",
+ (gogoproto.nullable) = false
+ ];
+ string token_out = 4 [ (gogoproto.moretags) = "yaml:\"token_out\"" ];
+}
+
+message QuerySwapExactAmountOutResponse {
+ string token_in_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_in_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message QueryTotalLiquidityRequest {}
+
+message QueryTotalLiquidityResponse {
+ repeated cosmos.base.v1beta1.Coin liquidity = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.moretags) = "yaml:\"liquidity\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/gamm/v1beta1/tx.proto b/examples/authz/proto/osmosis/gamm/v1beta1/tx.proto
new file mode 100644
index 00000000..1421e624
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/v1beta1/tx.proto
@@ -0,0 +1,237 @@
+syntax = "proto3";
+package osmosis.gamm.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/types";
+
+service Msg {
+ rpc JoinPool(MsgJoinPool) returns (MsgJoinPoolResponse);
+ rpc ExitPool(MsgExitPool) returns (MsgExitPoolResponse);
+ rpc SwapExactAmountIn(MsgSwapExactAmountIn)
+ returns (MsgSwapExactAmountInResponse);
+ rpc SwapExactAmountOut(MsgSwapExactAmountOut)
+ returns (MsgSwapExactAmountOutResponse);
+ rpc JoinSwapExternAmountIn(MsgJoinSwapExternAmountIn)
+ returns (MsgJoinSwapExternAmountInResponse);
+ rpc JoinSwapShareAmountOut(MsgJoinSwapShareAmountOut)
+ returns (MsgJoinSwapShareAmountOutResponse);
+ rpc ExitSwapExternAmountOut(MsgExitSwapExternAmountOut)
+ returns (MsgExitSwapExternAmountOutResponse);
+ rpc ExitSwapShareAmountIn(MsgExitSwapShareAmountIn)
+ returns (MsgExitSwapShareAmountInResponse);
+}
+
+// ===================== MsgJoinPool
+// This is really MsgJoinPoolNoSwap
+message MsgJoinPool {
+
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string share_out_amount = 3 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"pool_amount_out\"",
+ (gogoproto.nullable) = false
+ ];
+ repeated cosmos.base.v1beta1.Coin token_in_maxs = 4 [
+ (gogoproto.moretags) = "yaml:\"token_in_max_amounts\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgJoinPoolResponse {
+ string share_out_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_out_amount\"",
+ (gogoproto.nullable) = false
+ ];
+ repeated cosmos.base.v1beta1.Coin token_in = 2 [
+ (gogoproto.moretags) = "yaml:\"token_in\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ===================== MsgExitPool
+message MsgExitPool {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string share_in_amount = 3 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_in_amount\"",
+ (gogoproto.nullable) = false
+ ];
+
+ repeated cosmos.base.v1beta1.Coin token_out_mins = 4 [
+ (gogoproto.moretags) = "yaml:\"token_out_min_amounts\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgExitPoolResponse {
+ repeated cosmos.base.v1beta1.Coin token_out = 1 [
+ (gogoproto.moretags) = "yaml:\"token_out\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ===================== MsgSwapExactAmountIn
+message SwapAmountInRoute {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string token_out_denom = 2
+ [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ];
+}
+
+message MsgSwapExactAmountIn {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ repeated SwapAmountInRoute routes = 2 [ (gogoproto.nullable) = false ];
+ cosmos.base.v1beta1.Coin token_in = 3 [
+ (gogoproto.moretags) = "yaml:\"token_in\"",
+ (gogoproto.nullable) = false
+ ];
+ string token_out_min_amount = 4 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_out_min_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgSwapExactAmountInResponse {
+ string token_out_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_out_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ===================== MsgSwapExactAmountOut
+message SwapAmountOutRoute {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string token_in_denom = 2
+ [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ];
+}
+
+message MsgSwapExactAmountOut {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ repeated SwapAmountOutRoute routes = 2 [ (gogoproto.nullable) = false ];
+ string token_in_max_amount = 3 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_in_max_amount\"",
+ (gogoproto.nullable) = false
+ ];
+ cosmos.base.v1beta1.Coin token_out = 4 [
+ (gogoproto.moretags) = "yaml:\"token_out\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgSwapExactAmountOutResponse {
+ string token_in_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_in_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ===================== MsgJoinSwapExternAmountIn
+// TODO: Rename to MsgJoinSwapExactAmountIn
+message MsgJoinSwapExternAmountIn {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ cosmos.base.v1beta1.Coin token_in = 3 [
+ (gogoproto.moretags) = "yaml:\"token_in\"",
+ (gogoproto.nullable) = false
+ ];
+ string share_out_min_amount = 4 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_out_min_amount\"",
+ (gogoproto.nullable) = false
+ ];
+ // repeated cosmos.base.v1beta1.Coin tokensIn = 5 [
+ // (gogoproto.moretags) = "yaml:\"tokens_in\"",
+ // (gogoproto.nullable) = false
+ // ];
+}
+
+message MsgJoinSwapExternAmountInResponse {
+ string share_out_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_out_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ===================== MsgJoinSwapShareAmountOut
+message MsgJoinSwapShareAmountOut {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string token_in_denom = 3
+ [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ];
+ string share_out_amount = 4 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_out_amount\"",
+ (gogoproto.nullable) = false
+ ];
+ string token_in_max_amount = 5 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_in_max_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgJoinSwapShareAmountOutResponse {
+ string token_in_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_in_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ===================== MsgExitSwapShareAmountIn
+message MsgExitSwapShareAmountIn {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string token_out_denom = 3
+ [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ];
+ string share_in_amount = 4 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_in_amount\"",
+ (gogoproto.nullable) = false
+ ];
+ string token_out_min_amount = 5 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_out_min_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgExitSwapShareAmountInResponse {
+ string token_out_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"token_out_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// ===================== MsgExitSwapExternAmountOut
+message MsgExitSwapExternAmountOut {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ cosmos.base.v1beta1.Coin token_out = 3 [
+ (gogoproto.moretags) = "yaml:\"token_out\"",
+ (gogoproto.nullable) = false
+ ];
+ string share_in_max_amount = 4 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_in_max_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgExitSwapExternAmountOutResponse {
+ string share_in_amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"share_in_amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/gamm/v2/query.proto b/examples/authz/proto/osmosis/gamm/v2/query.proto
new file mode 100644
index 00000000..02ec334c
--- /dev/null
+++ b/examples/authz/proto/osmosis/gamm/v2/query.proto
@@ -0,0 +1,38 @@
+syntax = "proto3";
+package osmosis.gamm.v2;
+
+import "gogoproto/gogo.proto";
+import "osmosis/gamm/v1beta1/tx.proto";
+
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/v2types";
+
+service Query {
+ // SpotPrice defines a gRPC query handler that returns the spot price given
+ // a base denomination and a quote denomination.
+ rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) {
+ option (google.api.http).get = "/osmosis/gamm/v2/pools/{pool_id}/prices";
+ }
+}
+
+// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice
+// query.
+message QuerySpotPriceRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string base_asset_denom = 2
+ [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ];
+ string quote_asset_denom = 3
+ [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ];
+}
+
+// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice
+// query.
+message QuerySpotPriceResponse {
+ // String of the Dec. Ex) 10.203uatom
+ string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ];
+}
diff --git a/examples/authz/proto/osmosis/ibc-rate-limit/v1beta1/params.proto b/examples/authz/proto/osmosis/ibc-rate-limit/v1beta1/params.proto
new file mode 100644
index 00000000..5f66b2b3
--- /dev/null
+++ b/examples/authz/proto/osmosis/ibc-rate-limit/v1beta1/params.proto
@@ -0,0 +1,12 @@
+syntax = "proto3";
+package osmosis.ibcratelimit.v1beta1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit/types";
+
+// Params defines the parameters for the ibc-rate-limit module.
+message Params {
+ string contract_address = 1
+ [ (gogoproto.moretags) = "yaml:\"contract_address\"" ];
+}
diff --git a/examples/authz/proto/osmosis/ibc-rate-limit/v1beta1/query.proto b/examples/authz/proto/osmosis/ibc-rate-limit/v1beta1/query.proto
new file mode 100644
index 00000000..01d2eb2d
--- /dev/null
+++ b/examples/authz/proto/osmosis/ibc-rate-limit/v1beta1/query.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+package osmosis.ibcratelimit.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "osmosis/ibc-rate-limit/v1beta1/params.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Params defines a gRPC query method that returns the ibc-rate-limit module's
+ // parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/ibc-rate-limit/v1beta1/params";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/incentives/gauge.proto b/examples/authz/proto/osmosis/incentives/gauge.proto
new file mode 100644
index 00000000..39fc45de
--- /dev/null
+++ b/examples/authz/proto/osmosis/incentives/gauge.proto
@@ -0,0 +1,60 @@
+syntax = "proto3";
+package osmosis.incentives;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "osmosis/lockup/lock.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types";
+
+// Gauge is an object that stores and distributes yields to recipients who
+// satisfy certain conditions. Currently gauges support conditions around the
+// duration for which a given denom is locked.
+message Gauge {
+ // id is the unique ID of a Gauge
+ uint64 id = 1;
+ // is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge
+ // Non-perpetual gauges distribute their tokens equally per epoch while the
+ // gauge is in the active period. Perpetual gauges distribute all their tokens
+ // at a single time and only distribute their tokens again once the gauge is
+ // refilled, Intended for use with incentives that get refilled daily.
+ bool is_perpetual = 2;
+ // distribute_to is where the gauge rewards are distributed to.
+ // This is queried via lock duration or by timestamp
+ osmosis.lockup.QueryCondition distribute_to = 3
+ [ (gogoproto.nullable) = false ];
+ // coins is the total amount of coins that have been in the gauge
+ // Can distribute multiple coin denoms
+ repeated cosmos.base.v1beta1.Coin coins = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+ // start_time is the distribution start time
+ google.protobuf.Timestamp start_time = 5 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"start_time\""
+ ];
+ // num_epochs_paid_over is the number of total epochs distribution will be
+ // completed over
+ uint64 num_epochs_paid_over = 6;
+ // filled_epochs is the number of epochs distribution has been completed on
+ // already
+ uint64 filled_epochs = 7;
+ // distributed_coins are coins that have been distributed already
+ repeated cosmos.base.v1beta1.Coin distributed_coins = 8 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message LockableDurationsInfo {
+ // List of incentivised durations that gauges will pay out to
+ repeated google.protobuf.Duration lockable_durations = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"lockable_durations\""
+ ];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/incentives/genesis.proto b/examples/authz/proto/osmosis/incentives/genesis.proto
new file mode 100644
index 00000000..402970b0
--- /dev/null
+++ b/examples/authz/proto/osmosis/incentives/genesis.proto
@@ -0,0 +1,28 @@
+syntax = "proto3";
+package osmosis.incentives;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "osmosis/incentives/params.proto";
+import "osmosis/incentives/gauge.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types";
+
+// GenesisState defines the incentives module's various parameters when first
+// initialized
+message GenesisState {
+ // params are all the parameters of the module
+ Params params = 1 [ (gogoproto.nullable) = false ];
+ // gauges are all gauges that should exist at genesis
+ repeated Gauge gauges = 2 [ (gogoproto.nullable) = false ];
+ // lockable_durations are all lockup durations that gauges can be locked for
+ // in order to recieve incentives
+ repeated google.protobuf.Duration lockable_durations = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"lockable_durations\""
+ ];
+ // last_gauge_id is what the gauge number will increment from when creating
+ // the next gauge after genesis
+ uint64 last_gauge_id = 4;
+}
diff --git a/examples/authz/proto/osmosis/incentives/params.proto b/examples/authz/proto/osmosis/incentives/params.proto
new file mode 100644
index 00000000..9056bb36
--- /dev/null
+++ b/examples/authz/proto/osmosis/incentives/params.proto
@@ -0,0 +1,14 @@
+syntax = "proto3";
+package osmosis.incentives;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types";
+
+// Params holds parameters for the incentives module
+message Params {
+ // distr_epoch_identifier is what epoch type distribution will be triggered by
+ // (day, week, etc.)
+ string distr_epoch_identifier = 1
+ [ (gogoproto.moretags) = "yaml:\"distr_epoch_identifier\"" ];
+}
diff --git a/examples/authz/proto/osmosis/incentives/query.proto b/examples/authz/proto/osmosis/incentives/query.proto
new file mode 100644
index 00000000..d2d0e64f
--- /dev/null
+++ b/examples/authz/proto/osmosis/incentives/query.proto
@@ -0,0 +1,175 @@
+syntax = "proto3";
+package osmosis.incentives;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/duration.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "osmosis/incentives/gauge.proto";
+import "osmosis/lockup/lock.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types";
+
+// Query defines the gRPC querier service
+service Query {
+ // ModuleToDistributeCoins returns coins that are going to be distributed
+ rpc ModuleToDistributeCoins(ModuleToDistributeCoinsRequest)
+ returns (ModuleToDistributeCoinsResponse) {
+ option (google.api.http).get =
+ "/osmosis/incentives/v1beta1/module_to_distribute_coins";
+ }
+
+ // GaugeByID returns gauges by their respective ID
+ rpc GaugeByID(GaugeByIDRequest) returns (GaugeByIDResponse) {
+ option (google.api.http).get =
+ "/osmosis/incentives/v1beta1/gauge_by_id/{id}";
+ }
+ // Gauges returns both upcoming and active gauges
+ rpc Gauges(GaugesRequest) returns (GaugesResponse) {
+ option (google.api.http).get = "/osmosis/incentives/v1beta1/gauges";
+ }
+ // ActiveGauges returns active gauges
+ rpc ActiveGauges(ActiveGaugesRequest) returns (ActiveGaugesResponse) {
+ option (google.api.http).get = "/osmosis/incentives/v1beta1/active_gauges";
+ }
+ // ActiveGaugesPerDenom returns active gauges by denom
+ rpc ActiveGaugesPerDenom(ActiveGaugesPerDenomRequest)
+ returns (ActiveGaugesPerDenomResponse) {
+ option (google.api.http).get =
+ "/osmosis/incentives/v1beta1/active_gauges_per_denom";
+ }
+ // Returns scheduled gauges that have not yet occured
+ rpc UpcomingGauges(UpcomingGaugesRequest) returns (UpcomingGaugesResponse) {
+ option (google.api.http).get =
+ "/osmosis/incentives/v1beta1/upcoming_gauges";
+ }
+ // UpcomingGaugesPerDenom returns scheduled gauges that have not yet occured
+ // by denom
+ rpc UpcomingGaugesPerDenom(UpcomingGaugesPerDenomRequest)
+ returns (UpcomingGaugesPerDenomResponse) {
+ option (google.api.http).get =
+ "/osmosis/incentives/v1beta1/upcoming_gauges_per_denom";
+ }
+
+ // RewardsEst returns an estimate of the rewards from now until a specified
+ // time in the future The querier either provides an address or a set of locks
+ // for which they want to find the associated rewards
+ rpc RewardsEst(RewardsEstRequest) returns (RewardsEstResponse) {
+ option (google.api.http).get =
+ "/osmosis/incentives/v1beta1/rewards_est/{owner}";
+ }
+ // LockableDurations returns lockable durations that are valid to distribute
+ // incentives for
+ rpc LockableDurations(QueryLockableDurationsRequest)
+ returns (QueryLockableDurationsResponse) {
+ option (google.api.http).get =
+ "/osmosis/incentives/v1beta1/lockable_durations";
+ }
+}
+
+message ModuleToDistributeCoinsRequest {}
+message ModuleToDistributeCoinsResponse {
+ // Coins that have yet to be distributed
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message GaugeByIDRequest {
+ // Gague ID being queried
+ uint64 id = 1;
+}
+message GaugeByIDResponse {
+ // Gauge that corresponds to provided gague ID
+ Gauge gauge = 1;
+}
+
+message GaugesRequest {
+ // Pagination defines pagination for the request
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+message GaugesResponse {
+ // Upcoming and active gauges
+ repeated Gauge data = 1 [ (gogoproto.nullable) = false ];
+ // Pagination defines pagination for the response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+message ActiveGaugesRequest {
+ // Pagination defines pagination for the request
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+message ActiveGaugesResponse {
+ // Active gagues only
+ repeated Gauge data = 1 [ (gogoproto.nullable) = false ];
+ // Pagination defines pagination for the response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+message ActiveGaugesPerDenomRequest {
+ // Desired denom when querying active gagues
+ string denom = 1;
+ // Pagination defines pagination for the request
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+message ActiveGaugesPerDenomResponse {
+ // Active gagues that match denom in query
+ repeated Gauge data = 1 [ (gogoproto.nullable) = false ];
+ // Pagination defines pagination for the response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+message UpcomingGaugesRequest {
+ // Pagination defines pagination for the request
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+message UpcomingGaugesResponse {
+ // Gauges whose distribution is upcoming
+ repeated Gauge data = 1 [ (gogoproto.nullable) = false ];
+ // Pagination defines pagination for the response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+message UpcomingGaugesPerDenomRequest {
+ // Filter for upcoming gagues that match specific denom
+ string denom = 1;
+ // Pagination defines pagination for the request
+ cosmos.base.query.v1beta1.PageRequest pagination = 2;
+}
+
+message UpcomingGaugesPerDenomResponse {
+ // Upcoming gagues that match denom in query
+ repeated Gauge upcoming_gauges = 1 [ (gogoproto.nullable) = false ];
+ // Pagination defines pagination for the response
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+message RewardsEstRequest {
+ // Address that is being queried for future estimated rewards
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ // Lock IDs included in future reward estimation
+ repeated uint64 lock_ids = 2;
+ // Upper time limit of reward estimation
+ // Lower limit is current epoch
+ int64 end_epoch = 3;
+}
+message RewardsEstResponse {
+ // Estimated coin rewards that will be recieved at provided address
+ // from specified locks between current time and end epoch
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message QueryLockableDurationsRequest {}
+message QueryLockableDurationsResponse {
+ // Time durations that users can lock coins for in order to recieve rewards
+ repeated google.protobuf.Duration lockable_durations = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"lockable_durations\""
+ ];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/incentives/tx.proto b/examples/authz/proto/osmosis/incentives/tx.proto
new file mode 100644
index 00000000..b0881650
--- /dev/null
+++ b/examples/authz/proto/osmosis/incentives/tx.proto
@@ -0,0 +1,60 @@
+syntax = "proto3";
+package osmosis.incentives;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "osmosis/incentives/gauge.proto";
+import "osmosis/lockup/lock.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types";
+
+service Msg {
+ rpc CreateGauge(MsgCreateGauge) returns (MsgCreateGaugeResponse);
+ rpc AddToGauge(MsgAddToGauge) returns (MsgAddToGaugeResponse);
+}
+
+// MsgCreateGauge creates a gague to distribute rewards to users
+message MsgCreateGauge {
+ // is_perpetual shows if it's a perpetual or non-perpetual gauge
+ // Non-perpetual gauges distribute their tokens equally per epoch while the
+ // gauge is in the active period. Perpetual gauges distribute all their tokens
+ // at a single time and only distribute their tokens again once the gauge is
+ // refilled
+ bool is_perpetual = 1;
+ // owner is the address of gauge creator
+ string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ // distribute_to show which lock the gauge should distribute to by time
+ // duration or by timestamp
+ osmosis.lockup.QueryCondition distribute_to = 3
+ [ (gogoproto.nullable) = false ];
+ // coins are coin(s) to be distributed by the gauge
+ repeated cosmos.base.v1beta1.Coin coins = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+ // start_time is the distribution start time
+ google.protobuf.Timestamp start_time = 5 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"timestamp\""
+ ];
+ // num_epochs_paid_over is the number of epochs distribution will be completed
+ // over
+ uint64 num_epochs_paid_over = 6;
+}
+message MsgCreateGaugeResponse {}
+
+// MsgAddToGauge adds coins to a previously created gauge
+message MsgAddToGauge {
+ // owner is the gauge owner's address
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ // gauge_id is the ID of gauge that rewards are getting added to
+ uint64 gauge_id = 2;
+ // rewards are the coin(s) to add to gauge
+ repeated cosmos.base.v1beta1.Coin rewards = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+message MsgAddToGaugeResponse {}
diff --git a/examples/authz/proto/osmosis/lockup/genesis.proto b/examples/authz/proto/osmosis/lockup/genesis.proto
new file mode 100644
index 00000000..ff486713
--- /dev/null
+++ b/examples/authz/proto/osmosis/lockup/genesis.proto
@@ -0,0 +1,14 @@
+syntax = "proto3";
+package osmosis.lockup;
+
+import "gogoproto/gogo.proto";
+import "osmosis/lockup/lock.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types";
+
+// GenesisState defines the lockup module's genesis state.
+message GenesisState {
+ uint64 last_lock_id = 1;
+ repeated PeriodLock locks = 2 [ (gogoproto.nullable) = false ];
+ repeated SyntheticLock synthetic_locks = 3 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/lockup/lock.proto b/examples/authz/proto/osmosis/lockup/lock.proto
new file mode 100644
index 00000000..577a8d2b
--- /dev/null
+++ b/examples/authz/proto/osmosis/lockup/lock.proto
@@ -0,0 +1,108 @@
+syntax = "proto3";
+package osmosis.lockup;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types";
+
+// PeriodLock is a single lock unit by period defined by the x/lockup module.
+// It's a record of a locked coin at a specific time. It stores owner, duration,
+// unlock time and the number of coins locked. A state of a period lock is
+// created upon lock creation, and deleted once the lock has been matured after
+// the `duration` has passed since unbonding started.
+message PeriodLock {
+ // ID is the unique id of the lock.
+ // The ID of the lock is decided upon lock creation, incrementing by 1 for
+ // every lock.
+ uint64 ID = 1;
+ // Owner is the account address of the lock owner.
+ // Only the owner can modify the state of the lock.
+ string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ // Duration is the time needed for a lock to mature after unlocking has
+ // started.
+ google.protobuf.Duration duration = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+ // EndTime refers to the time at which the lock would mature and get deleted.
+ // This value is first initialized when an unlock has started for the lock,
+ // end time being block time + duration.
+ google.protobuf.Timestamp end_time = 4 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"end_time\""
+ ];
+ // Coins are the tokens locked within the lock, kept in the module account.
+ repeated cosmos.base.v1beta1.Coin coins = 5 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+// LockQueryType defines the type of the lock query that can
+// either be by duration or start time of the lock.
+enum LockQueryType {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ ByDuration = 0;
+ ByTime = 1;
+}
+
+// QueryCondition is a struct used for querying locks upon different conditions.
+// Duration field and timestamp fields could be optional, depending on the
+// LockQueryType.
+message QueryCondition {
+ // LockQueryType is a type of lock query, ByLockDuration | ByLockTime
+ LockQueryType lock_query_type = 1;
+ // Denom represents the token denomination we are looking to lock up
+ string denom = 2;
+ // Duration is used to query locks with longer duration than the specified
+ // duration. Duration field must not be nil when the lock query type is
+ // `ByLockDuration`.
+ google.protobuf.Duration duration = 3 [
+ (gogoproto.stdduration) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+ // Timestamp is used by locks started before the specified duration.
+ // Timestamp field must not be nil when the lock query type is `ByLockTime`.
+ // Querying locks with timestamp is currently not implemented.
+ google.protobuf.Timestamp timestamp = 4 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"timestamp\""
+ ];
+}
+
+// SyntheticLock is creating virtual lockup where new denom is combination of
+// original denom and synthetic suffix. At the time of synthetic lockup creation
+// and deletion, accumulation store is also being updated and on querier side,
+// they can query as freely as native lockup.
+message SyntheticLock {
+ // Underlying Lock ID is the underlying native lock's id for this synthetic
+ // lockup. A synthetic lock MUST have an underlying lock.
+ uint64 underlying_lock_id = 1;
+ // SynthDenom is the synthetic denom that is a combination of
+ // gamm share + bonding status + validator address.
+ string synth_denom = 2;
+ // used for unbonding synthetic lockups, for active synthetic lockups, this
+ // value is set to uninitialized value
+ google.protobuf.Timestamp end_time = 3 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"end_time\""
+ ];
+ // Duration is the duration for a synthetic lock to mature
+ // at the point of unbonding has started.
+ google.protobuf.Duration duration = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+}
diff --git a/examples/authz/proto/osmosis/lockup/params.proto b/examples/authz/proto/osmosis/lockup/params.proto
new file mode 100644
index 00000000..1c66228f
--- /dev/null
+++ b/examples/authz/proto/osmosis/lockup/params.proto
@@ -0,0 +1,11 @@
+syntax = "proto3";
+package osmosis.lockup;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types";
+
+message Params {
+ repeated string force_unlock_allowed_addresses = 1
+ [ (gogoproto.moretags) = "yaml:\"force_unlock_allowed_address\"" ];
+}
diff --git a/examples/authz/proto/osmosis/lockup/query.proto b/examples/authz/proto/osmosis/lockup/query.proto
new file mode 100644
index 00000000..8e69afbf
--- /dev/null
+++ b/examples/authz/proto/osmosis/lockup/query.proto
@@ -0,0 +1,299 @@
+syntax = "proto3";
+package osmosis.lockup;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
+import "osmosis/lockup/lock.proto";
+import "osmosis/lockup/params.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Return full balance of the module
+ rpc ModuleBalance(ModuleBalanceRequest) returns (ModuleBalanceResponse) {
+ option (google.api.http).get = "/osmosis/lockup/v1beta1/module_balance";
+ }
+ // Return locked balance of the module
+ rpc ModuleLockedAmount(ModuleLockedAmountRequest)
+ returns (ModuleLockedAmountResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/module_locked_amount";
+ }
+
+ // Returns unlockable coins which are not withdrawn yet
+ rpc AccountUnlockableCoins(AccountUnlockableCoinsRequest)
+ returns (AccountUnlockableCoinsResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_unlockable_coins/{owner}";
+ }
+ // Returns unlocking coins
+ rpc AccountUnlockingCoins(AccountUnlockingCoinsRequest)
+ returns (AccountUnlockingCoinsResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_unlocking_coins/{owner}";
+ }
+ // Return a locked coins that can't be withdrawn
+ rpc AccountLockedCoins(AccountLockedCoinsRequest)
+ returns (AccountLockedCoinsResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_locked_coins/{owner}";
+ }
+
+ // Returns locked records of an account with unlock time beyond timestamp
+ rpc AccountLockedPastTime(AccountLockedPastTimeRequest)
+ returns (AccountLockedPastTimeResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_locked_pasttime/{owner}";
+ }
+ // Returns locked records of an account with unlock time beyond timestamp
+ // excluding tokens started unlocking
+ rpc AccountLockedPastTimeNotUnlockingOnly(
+ AccountLockedPastTimeNotUnlockingOnlyRequest)
+ returns (AccountLockedPastTimeNotUnlockingOnlyResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_locked_pasttime_not_unlocking_only/"
+ "{owner}";
+ }
+ // Returns unlocked records with unlock time before timestamp
+ rpc AccountUnlockedBeforeTime(AccountUnlockedBeforeTimeRequest)
+ returns (AccountUnlockedBeforeTimeResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_unlocked_before_time/{owner}";
+ }
+
+ // Returns lock records by address, timestamp, denom
+ rpc AccountLockedPastTimeDenom(AccountLockedPastTimeDenomRequest)
+ returns (AccountLockedPastTimeDenomResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_locked_pasttime_denom/{owner}";
+ }
+
+ // Returns total locked per denom with longer past given time
+ rpc LockedDenom(LockedDenomRequest) returns (LockedDenomResponse) {
+ option (google.api.http).get = "/osmosis/lockup/v1beta1/locked_denom";
+ }
+
+ // Returns lock record by id
+ rpc LockedByID(LockedRequest) returns (LockedResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/locked_by_id/{lock_id}";
+ }
+
+ // Returns synthetic lockups by native lockup id
+ rpc SyntheticLockupsByLockupID(SyntheticLockupsByLockupIDRequest)
+ returns (SyntheticLockupsByLockupIDResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/synthetic_lockups_by_lock_id/{lock_id}";
+ }
+
+ // Returns account locked records with longer duration
+ rpc AccountLockedLongerDuration(AccountLockedLongerDurationRequest)
+ returns (AccountLockedLongerDurationResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_locked_longer_duration/{owner}";
+ }
+
+ // Returns account locked records with a specific duration
+ rpc AccountLockedDuration(AccountLockedDurationRequest)
+ returns (AccountLockedDurationResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_locked_duration/{owner}";
+ }
+
+ // Returns account locked records with longer duration excluding tokens
+ // started unlocking
+ rpc AccountLockedLongerDurationNotUnlockingOnly(
+ AccountLockedLongerDurationNotUnlockingOnlyRequest)
+ returns (AccountLockedLongerDurationNotUnlockingOnlyResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/"
+ "account_locked_longer_duration_not_unlocking_only/{owner}";
+ }
+ // Returns account's locked records for a denom with longer duration
+ rpc AccountLockedLongerDurationDenom(AccountLockedLongerDurationDenomRequest)
+ returns (AccountLockedLongerDurationDenomResponse) {
+ option (google.api.http).get =
+ "/osmosis/lockup/v1beta1/account_locked_longer_duration_denom/{owner}";
+ }
+ // Params returns lockup params.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/lockup/v1beta1/params";
+ }
+}
+
+message ModuleBalanceRequest {};
+message ModuleBalanceResponse {
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+};
+
+message ModuleLockedAmountRequest {};
+message ModuleLockedAmountResponse {
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+};
+
+message AccountUnlockableCoinsRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+};
+message AccountUnlockableCoinsResponse {
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+};
+
+message AccountUnlockingCoinsRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+}
+message AccountUnlockingCoinsResponse {
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message AccountLockedCoinsRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+};
+message AccountLockedCoinsResponse {
+ repeated cosmos.base.v1beta1.Coin coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+};
+
+message AccountLockedPastTimeRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Timestamp timestamp = 2 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"timestamp\""
+ ];
+};
+message AccountLockedPastTimeResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+};
+
+message AccountLockedPastTimeNotUnlockingOnlyRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Timestamp timestamp = 2 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"timestamp\""
+ ];
+};
+message AccountLockedPastTimeNotUnlockingOnlyResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+};
+
+message AccountUnlockedBeforeTimeRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Timestamp timestamp = 2 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"timestamp\""
+ ];
+};
+message AccountUnlockedBeforeTimeResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+}
+
+message AccountLockedPastTimeDenomRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Timestamp timestamp = 2 [
+ (gogoproto.stdtime) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"timestamp\""
+ ];
+ string denom = 3;
+};
+message AccountLockedPastTimeDenomResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+};
+
+message LockedDenomRequest {
+ string denom = 1;
+ google.protobuf.Duration duration = 2 [
+ (gogoproto.stdduration) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+}
+message LockedDenomResponse {
+ string amount = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message LockedRequest { uint64 lock_id = 1; };
+message LockedResponse { PeriodLock lock = 1; };
+
+message SyntheticLockupsByLockupIDRequest { uint64 lock_id = 1; }
+message SyntheticLockupsByLockupIDResponse {
+ repeated SyntheticLock synthetic_locks = 1 [ (gogoproto.nullable) = false ];
+}
+
+message AccountLockedLongerDurationRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Duration duration = 2 [
+ (gogoproto.stdduration) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+};
+message AccountLockedLongerDurationResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+};
+
+message AccountLockedDurationRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Duration duration = 2 [
+ (gogoproto.stdduration) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+};
+message AccountLockedDurationResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+};
+
+message AccountLockedLongerDurationNotUnlockingOnlyRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Duration duration = 2 [
+ (gogoproto.stdduration) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+};
+message AccountLockedLongerDurationNotUnlockingOnlyResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+};
+
+message AccountLockedLongerDurationDenomRequest {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Duration duration = 2 [
+ (gogoproto.stdduration) = true,
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+ string denom = 3;
+};
+message AccountLockedLongerDurationDenomResponse {
+ repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ];
+};
+
+message QueryParamsRequest {}
+message QueryParamsResponse {
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/lockup/tx.proto b/examples/authz/proto/osmosis/lockup/tx.proto
new file mode 100644
index 00000000..9d5c0642
--- /dev/null
+++ b/examples/authz/proto/osmosis/lockup/tx.proto
@@ -0,0 +1,88 @@
+syntax = "proto3";
+package osmosis.lockup;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "osmosis/lockup/lock.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types";
+
+// Msg defines the Msg service.
+service Msg {
+ // LockTokens lock tokens
+ rpc LockTokens(MsgLockTokens) returns (MsgLockTokensResponse);
+ // BeginUnlockingAll begin unlocking all tokens
+ rpc BeginUnlockingAll(MsgBeginUnlockingAll)
+ returns (MsgBeginUnlockingAllResponse);
+ // MsgBeginUnlocking begins unlocking tokens by lock ID
+ rpc BeginUnlocking(MsgBeginUnlocking) returns (MsgBeginUnlockingResponse);
+ // MsgEditLockup edits the existing lockups by lock ID
+ rpc ExtendLockup(MsgExtendLockup) returns (MsgExtendLockupResponse);
+ rpc ForceUnlock(MsgForceUnlock) returns (MsgForceUnlockResponse);
+}
+
+message MsgLockTokens {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ google.protobuf.Duration duration = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+ repeated cosmos.base.v1beta1.Coin coins = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+message MsgLockTokensResponse { uint64 ID = 1; }
+
+message MsgBeginUnlockingAll {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+}
+message MsgBeginUnlockingAllResponse { repeated PeriodLock unlocks = 1; }
+
+message MsgBeginUnlocking {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ uint64 ID = 2;
+ // Amount of unlocking coins. Unlock all if not set.
+ repeated cosmos.base.v1beta1.Coin coins = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+message MsgBeginUnlockingResponse { bool success = 1; }
+
+// MsgExtendLockup extends the existing lockup's duration.
+// The new duration is longer than the original.
+message MsgExtendLockup {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ uint64 ID = 2;
+
+ // duration to be set. fails if lower than the current duration, or is
+ // unlocking
+ google.protobuf.Duration duration = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.jsontag) = "duration,omitempty",
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+
+ // extend for other edit, e.g. cancel unlocking
+}
+
+message MsgExtendLockupResponse { bool success = 1; }
+
+// MsgForceUnlock unlocks locks immediately for
+// addresses registered via governance.
+message MsgForceUnlock {
+ string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ];
+ uint64 ID = 2;
+ // Amount of unlocking coins. Unlock all if not set.
+ repeated cosmos.base.v1beta1.Coin coins = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message MsgForceUnlockResponse { bool success = 1; }
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/mint/v1beta1/genesis.proto b/examples/authz/proto/osmosis/mint/v1beta1/genesis.proto
new file mode 100644
index 00000000..67534deb
--- /dev/null
+++ b/examples/authz/proto/osmosis/mint/v1beta1/genesis.proto
@@ -0,0 +1,21 @@
+syntax = "proto3";
+package osmosis.mint.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/mint/v1beta1/mint.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/mint/types";
+
+// GenesisState defines the mint module's genesis state.
+message GenesisState {
+ // minter is an abstraction for holding current rewards information.
+ Minter minter = 1 [ (gogoproto.nullable) = false ];
+
+ // params defines all the paramaters of the mint module.
+ Params params = 2 [ (gogoproto.nullable) = false ];
+
+ // reduction_started_epoch is the first epoch in which the reduction of mint
+ // begins.
+ int64 reduction_started_epoch = 3
+ [ (gogoproto.moretags) = "yaml:\"reduction_started_epoch\"" ];
+}
diff --git a/examples/authz/proto/osmosis/mint/v1beta1/mint.proto b/examples/authz/proto/osmosis/mint/v1beta1/mint.proto
new file mode 100644
index 00000000..d0a8223f
--- /dev/null
+++ b/examples/authz/proto/osmosis/mint/v1beta1/mint.proto
@@ -0,0 +1,111 @@
+syntax = "proto3";
+package osmosis.mint.v1beta1;
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/mint/types";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/duration.proto";
+
+// Minter represents the minting state.
+message Minter {
+ // epoch_provisions represent rewards for the current epoch.
+ string epoch_provisions = 1 [
+ (gogoproto.moretags) = "yaml:\"epoch_provisions\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// WeightedAddress represents an address with a weight assigned to it.
+// The weight is used to determine the proportion of the total minted
+// tokens to be minted to the address.
+message WeightedAddress {
+ string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
+ string weight = 2 [
+ (gogoproto.moretags) = "yaml:\"weight\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// DistributionProportions defines the distribution proportions of the minted
+// denom. In other words, defines which stakeholders will receive the minted
+// denoms and how much.
+message DistributionProportions {
+ // staking defines the proportion of the minted mint_denom that is to be
+ // allocated as staking rewards.
+ string staking = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"staking\"",
+ (gogoproto.nullable) = false
+ ];
+ // pool_incentives defines the proportion of the minted mint_denom that is
+ // to be allocated as pool incentives.
+ string pool_incentives = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"pool_incentives\"",
+ (gogoproto.nullable) = false
+ ];
+ // developer_rewards defines the proportion of the minted mint_denom that is
+ // to be allocated to developer rewards address.
+ string developer_rewards = 3 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"developer_rewards\"",
+ (gogoproto.nullable) = false
+ ];
+ // community_pool defines the proportion of the minted mint_denom that is
+ // to be allocated to the community pool.
+ string community_pool = 4 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"community_pool\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// Params holds parameters for the x/mint module.
+message Params {
+ option (gogoproto.goproto_stringer) = false;
+
+ // mint_denom is the denom of the coin to mint.
+ string mint_denom = 1;
+ // genesis_epoch_provisions epoch provisions from the first epoch.
+ string genesis_epoch_provisions = 2 [
+ (gogoproto.moretags) = "yaml:\"genesis_epoch_provisions\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // epoch_identifier mint epoch identifier e.g. (day, week).
+ string epoch_identifier = 3
+ [ (gogoproto.moretags) = "yaml:\"epoch_identifier\"" ];
+ // reduction_period_in_epochs the number of epochs it takes
+ // to reduce the rewards.
+ int64 reduction_period_in_epochs = 4
+ [ (gogoproto.moretags) = "yaml:\"reduction_period_in_epochs\"" ];
+ // reduction_factor is the reduction multiplier to execute
+ // at the end of each period set by reduction_period_in_epochs.
+ string reduction_factor = 5 [
+ (gogoproto.moretags) = "yaml:\"reduction_factor\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // distribution_proportions defines the distribution proportions of the minted
+ // denom. In other words, defines which stakeholders will receive the minted
+ // denoms and how much.
+ DistributionProportions distribution_proportions = 6
+ [ (gogoproto.nullable) = false ];
+ // weighted_developer_rewards_receivers is the address to receive developer
+ // rewards with weights assignedt to each address. The final amount that each
+ // address receives is: epoch_provisions *
+ // distribution_proportions.developer_rewards * Address's Weight.
+ repeated WeightedAddress weighted_developer_rewards_receivers = 7 [
+ (gogoproto.moretags) = "yaml:\"developer_rewards_receiver\"",
+ (gogoproto.nullable) = false
+ ];
+ // minting_rewards_distribution_start_epoch start epoch to distribute minting
+ // rewards
+ int64 minting_rewards_distribution_start_epoch = 8
+ [ (gogoproto.moretags) =
+ "yaml:\"minting_rewards_distribution_start_epoch\"" ];
+}
diff --git a/examples/authz/proto/osmosis/mint/v1beta1/query.proto b/examples/authz/proto/osmosis/mint/v1beta1/query.proto
new file mode 100644
index 00000000..9960e6ef
--- /dev/null
+++ b/examples/authz/proto/osmosis/mint/v1beta1/query.proto
@@ -0,0 +1,45 @@
+syntax = "proto3";
+package osmosis.mint.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "osmosis/mint/v1beta1/mint.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/mint/types";
+
+// Query provides defines the gRPC querier service.
+service Query {
+ // Params returns the total set of minting parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/mint/v1beta1/params";
+ }
+
+ // EpochProvisions returns the current minting epoch provisions value.
+ rpc EpochProvisions(QueryEpochProvisionsRequest)
+ returns (QueryEpochProvisionsResponse) {
+ option (google.api.http).get = "/osmosis/mint/v1beta1/epoch_provisions";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
+
+// QueryEpochProvisionsRequest is the request type for the
+// Query/EpochProvisions RPC method.
+message QueryEpochProvisionsRequest {}
+
+// QueryEpochProvisionsResponse is the response type for the
+// Query/EpochProvisions RPC method.
+message QueryEpochProvisionsResponse {
+ // epoch_provisions is the current minting per epoch provisions value.
+ bytes epoch_provisions = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/pool-incentives/v1beta1/genesis.proto b/examples/authz/proto/osmosis/pool-incentives/v1beta1/genesis.proto
new file mode 100644
index 00000000..51302029
--- /dev/null
+++ b/examples/authz/proto/osmosis/pool-incentives/v1beta1/genesis.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+package osmosis.poolincentives.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "osmosis/pool-incentives/v1beta1/incentives.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types";
+
+// GenesisState defines the pool incentives module's genesis state.
+message GenesisState {
+ // params defines all the paramaters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+ repeated google.protobuf.Duration lockable_durations = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"lockable_durations\""
+ ];
+ DistrInfo distr_info = 3 [
+ (gogoproto.nullable) = true,
+ (gogoproto.moretags) = "yaml:\"distr_info\""
+ ];
+ PoolToGauges pool_to_gauges = 4 [
+ (gogoproto.nullable) = true,
+ (gogoproto.moretags) = "yaml:\"pool_to_gauges\""
+ ];
+}
diff --git a/examples/authz/proto/osmosis/pool-incentives/v1beta1/gov.proto b/examples/authz/proto/osmosis/pool-incentives/v1beta1/gov.proto
new file mode 100644
index 00000000..d0a48bca
--- /dev/null
+++ b/examples/authz/proto/osmosis/pool-incentives/v1beta1/gov.proto
@@ -0,0 +1,52 @@
+syntax = "proto3";
+package osmosis.poolincentives.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/pool-incentives/v1beta1/incentives.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types";
+
+// ReplacePoolIncentivesProposal is a gov Content type for updating the pool
+// incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records
+// override the existing DistrRecords set in the module. Each record has a
+// specified gauge id and weight, and the incentives are distributed to each
+// gauge according to weight/total_weight. The incentives are put in the fee
+// pool and it is allocated to gauges and community pool by the DistrRecords
+// configuration. Note that gaugeId=0 represents the community pool.
+message ReplacePoolIncentivesProposal {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+ option (cosmos_proto.implements_interface) = "ProposalContentI";
+
+ string title = 1;
+ string description = 2;
+ repeated DistrRecord records = 3 [ (gogoproto.nullable) = false ];
+}
+
+// UpdatePoolIncentivesProposal is a gov Content type for updating the pool
+// incentives. If a UpdatePoolIncentivesProposal passes, all the DistrRecords
+// in the proposals are edited. An existing DistrRecord is not overriden unless
+// explicitly included in the proposal.
+// This differs from an ReplacePoolIncentivesProposal because it only does an
+// in place update of the DistrRecords for gauges explicitly mentioned in the
+// proposal.
+
+// For example: if the existing DistrRecords were:
+// [(Gauge 0, 5), (Gauge 1, 6), (Gauge 2, 6)]
+// An UpdatePoolIncentivesProposal includes
+// [(Gauge 1, 0), (Gauge 2, 4), (Gauge 3, 10)]
+// This would delete Gauge 1, Edit Gauge 2, and Add Gauge 3
+// The result DistrRecords in state would be:
+// [(Gauge 0, 5), (Gauge 2, 4), (Gauge 3, 10)]
+message UpdatePoolIncentivesProposal {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ option (cosmos_proto.implements_interface) = "ProposalContentI";
+
+ string title = 1;
+ string description = 2;
+ repeated DistrRecord records = 3 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/pool-incentives/v1beta1/incentives.proto b/examples/authz/proto/osmosis/pool-incentives/v1beta1/incentives.proto
new file mode 100644
index 00000000..f26183a4
--- /dev/null
+++ b/examples/authz/proto/osmosis/pool-incentives/v1beta1/incentives.proto
@@ -0,0 +1,58 @@
+syntax = "proto3";
+package osmosis.poolincentives.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types";
+
+message Params {
+ option (gogoproto.goproto_stringer) = false;
+
+ // minted_denom is the denomination of the coin expected to be minted by the
+ // minting module. Pool-incentives module doesn’t actually mint the coin
+ // itself, but rather manages the distribution of coins that matches the
+ // defined minted_denom.
+ string minted_denom = 1 [ (gogoproto.moretags) = "yaml:\"minted_denom\"" ];
+}
+
+message LockableDurationsInfo {
+ repeated google.protobuf.Duration lockable_durations = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"lockable_durations\""
+ ];
+}
+
+message DistrInfo {
+ string total_weight = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"total_weight\"",
+ (gogoproto.nullable) = false
+ ];
+ repeated DistrRecord records = 2 [ (gogoproto.nullable) = false ];
+}
+
+message DistrRecord {
+ option (gogoproto.equal) = true;
+
+ uint64 gauge_id = 1 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ];
+ string weight = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message PoolToGauge {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ uint64 gauge_id = 2 [ (gogoproto.moretags) = "yaml:\"gauge\"" ];
+ google.protobuf.Duration duration = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"duration\""
+ ];
+}
+
+message PoolToGauges {
+ repeated PoolToGauge pool_to_gauge = 2 [ (gogoproto.nullable) = false ];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/pool-incentives/v1beta1/query.proto b/examples/authz/proto/osmosis/pool-incentives/v1beta1/query.proto
new file mode 100644
index 00000000..3af16e93
--- /dev/null
+++ b/examples/authz/proto/osmosis/pool-incentives/v1beta1/query.proto
@@ -0,0 +1,108 @@
+syntax = "proto3";
+package osmosis.poolincentives.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/duration.proto";
+import "osmosis/incentives/gauge.proto";
+import "osmosis/pool-incentives/v1beta1/incentives.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types";
+
+service Query {
+ // GaugeIds takes the pool id and returns the matching gauge ids and durations
+ rpc GaugeIds(QueryGaugeIdsRequest) returns (QueryGaugeIdsResponse) {
+ option (google.api.http).get =
+ "/osmosis/pool-incentives/v1beta1/gauge-ids/{pool_id}";
+ }
+ // DistrInfo returns the pool's matching gauge ids and weights.
+ rpc DistrInfo(QueryDistrInfoRequest) returns (QueryDistrInfoResponse) {
+ option (google.api.http).get =
+ "/osmosis/pool-incentives/v1beta1/distr_info";
+ }
+
+ // Params returns pool incentives params.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/pool-incentives/v1beta1/params";
+ }
+
+ // LockableDurations returns lock durations for pools.
+ rpc LockableDurations(QueryLockableDurationsRequest)
+ returns (QueryLockableDurationsResponse) {
+ option (google.api.http).get =
+ "/osmosis/pool-incentives/v1beta1/lockable_durations";
+ }
+
+ // IncentivizedPools returns currently incentivized pools
+ rpc IncentivizedPools(QueryIncentivizedPoolsRequest)
+ returns (QueryIncentivizedPoolsResponse) {
+ option (google.api.http).get =
+ "/osmosis/pool-incentives/v1beta1/incentivized_pools";
+ }
+
+ // ExternalIncentiveGauges returns external incentive gauges.
+ rpc ExternalIncentiveGauges(QueryExternalIncentiveGaugesRequest)
+ returns (QueryExternalIncentiveGaugesResponse) {
+ option (google.api.http).get =
+ "/osmosis/pool-incentives/v1beta1/external_incentive_gauges";
+ }
+}
+
+message QueryGaugeIdsRequest {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+message QueryGaugeIdsResponse {
+ message GaugeIdWithDuration {
+ uint64 gauge_id = 1 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ];
+ google.protobuf.Duration duration = 2
+ [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ];
+ string gauge_incentive_percentage = 3;
+ }
+
+ repeated GaugeIdWithDuration gauge_ids_with_duration = 1
+ [ (gogoproto.moretags) = "yaml:\"gauge_ids_with_duration\"" ];
+}
+
+message QueryDistrInfoRequest {}
+message QueryDistrInfoResponse {
+ DistrInfo distr_info = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"distr_info\""
+ ];
+}
+
+message QueryParamsRequest {}
+message QueryParamsResponse {
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
+
+message QueryLockableDurationsRequest {}
+message QueryLockableDurationsResponse {
+ repeated google.protobuf.Duration lockable_durations = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"lockable_durations\""
+ ];
+}
+
+message QueryIncentivizedPoolsRequest {}
+message IncentivizedPool {
+ uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ google.protobuf.Duration lockable_duration = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdduration) = true,
+ (gogoproto.moretags) = "yaml:\"lockable_duration\""
+ ];
+ uint64 gauge_id = 3 [ (gogoproto.moretags) = "yaml:\"gauge_id\"" ];
+}
+message QueryIncentivizedPoolsResponse {
+ repeated IncentivizedPool incentivized_pools = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.moretags) = "yaml:\"incentivized_pools\""
+ ];
+}
+
+message QueryExternalIncentiveGaugesRequest {}
+message QueryExternalIncentiveGaugesResponse {
+ repeated osmosis.incentives.Gauge data = 1 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/sumtree/v1beta1/tree.proto b/examples/authz/proto/osmosis/sumtree/v1beta1/tree.proto
new file mode 100644
index 00000000..ff9a1f32
--- /dev/null
+++ b/examples/authz/proto/osmosis/sumtree/v1beta1/tree.proto
@@ -0,0 +1,19 @@
+syntax = "proto3";
+package osmosis.store.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/osmoutils/sumtree";
+
+message Node { repeated Child children = 1; }
+
+message Child {
+ bytes index = 1;
+ string accumulation = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message Leaf { Child leaf = 1; }
diff --git a/examples/authz/proto/osmosis/superfluid/genesis.proto b/examples/authz/proto/osmosis/superfluid/genesis.proto
new file mode 100644
index 00000000..a068d0ff
--- /dev/null
+++ b/examples/authz/proto/osmosis/superfluid/genesis.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+package osmosis.superfluid;
+
+import "gogoproto/gogo.proto";
+import "osmosis/superfluid/superfluid.proto";
+import "osmosis/superfluid/params.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types";
+
+// GenesisState defines the module's genesis state.
+message GenesisState {
+ Params params = 1 [ (gogoproto.nullable) = false ];
+ // superfluid_assets defines the registered superfluid assets that have been
+ // registered via governance.
+ repeated SuperfluidAsset superfluid_assets = 2
+ [ (gogoproto.nullable) = false ];
+ // osmo_equivalent_multipliers is the records of osmo equivalent amount of
+ // each superfluid registered pool, updated every epoch.
+ repeated OsmoEquivalentMultiplierRecord osmo_equivalent_multipliers = 3
+ [ (gogoproto.nullable) = false ];
+ // intermediary_accounts is a secondary account for superfluid staking that
+ // plays an intermediary role between validators and the delegators.
+ repeated SuperfluidIntermediaryAccount intermediary_accounts = 4
+ [ (gogoproto.nullable) = false ];
+ repeated LockIdIntermediaryAccountConnection intemediary_account_connections =
+ 5 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/superfluid/params.proto b/examples/authz/proto/osmosis/superfluid/params.proto
new file mode 100644
index 00000000..754f6a7e
--- /dev/null
+++ b/examples/authz/proto/osmosis/superfluid/params.proto
@@ -0,0 +1,20 @@
+syntax = "proto3";
+package osmosis.superfluid;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types";
+
+// Params holds parameters for the superfluid module
+message Params {
+ // minimum_risk_factor is to be cut on OSMO equivalent value of lp tokens for
+ // superfluid staking, default: 5%. The minimum risk factor works
+ // to counter-balance the staked amount on chain's exposure to various asset
+ // volatilities, and have base staking be 'resistant' to volatility.
+ string minimum_risk_factor = 1 [
+ (gogoproto.moretags) = "yaml:\"minimum_risk_factor\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/superfluid/query.proto b/examples/authz/proto/osmosis/superfluid/query.proto
new file mode 100644
index 00000000..71f80d62
--- /dev/null
+++ b/examples/authz/proto/osmosis/superfluid/query.proto
@@ -0,0 +1,284 @@
+syntax = "proto3";
+package osmosis.superfluid;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
+import "osmosis/superfluid/superfluid.proto";
+import "osmosis/superfluid/params.proto";
+import "osmosis/lockup/lock.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "cosmos/staking/v1beta1/staking.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Params returns the total set of superfluid parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/superfluid/v1beta1/params";
+ }
+
+ // Returns superfluid asset type, whether if it's a native asset or an lp
+ // share.
+ rpc AssetType(AssetTypeRequest) returns (AssetTypeResponse) {
+ option (google.api.http).get = "/osmosis/superfluid/v1beta1/asset_type";
+ }
+
+ // Returns all registered superfluid assets.
+ rpc AllAssets(AllAssetsRequest) returns (AllAssetsResponse) {
+ option (google.api.http).get = "/osmosis/superfluid/v1beta1/all_assets";
+ }
+
+ // Returns the osmo equivalent multiplier used in the most recent epoch.
+ rpc AssetMultiplier(AssetMultiplierRequest)
+ returns (AssetMultiplierResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/asset_multiplier";
+ }
+
+ // Returns all superfluid intermediary accounts.
+ rpc AllIntermediaryAccounts(AllIntermediaryAccountsRequest)
+ returns (AllIntermediaryAccountsResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/all_intermediary_accounts";
+ }
+
+ // Returns intermediary account connected to a superfluid staked lock by id
+ rpc ConnectedIntermediaryAccount(ConnectedIntermediaryAccountRequest)
+ returns (ConnectedIntermediaryAccountResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/connected_intermediary_account/{lock_id}";
+ }
+
+ // Returns the amount of delegations of specific denom for all validators
+ rpc TotalDelegationByValidatorForDenom(
+ QueryTotalDelegationByValidatorForDenomRequest)
+ returns (QueryTotalDelegationByValidatorForDenomResponse) {}
+
+ // Returns the total amount of osmo superfluidly staked.
+ // Response is denominated in uosmo.
+ rpc TotalSuperfluidDelegations(TotalSuperfluidDelegationsRequest)
+ returns (TotalSuperfluidDelegationsResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/all_superfluid_delegations";
+ }
+
+ // Returns the coins superfluid delegated for the delegator, validator, denom
+ // triplet
+ rpc SuperfluidDelegationAmount(SuperfluidDelegationAmountRequest)
+ returns (SuperfluidDelegationAmountResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/superfluid_delegation_amount";
+ }
+
+ // Returns all the delegated superfluid poistions for a specific delegator.
+ rpc SuperfluidDelegationsByDelegator(SuperfluidDelegationsByDelegatorRequest)
+ returns (SuperfluidDelegationsByDelegatorResponse) {
+ option (google.api.http).get = "/osmosis/superfluid/v1beta1/"
+ "superfluid_delegations/{delegator_address}";
+ }
+
+ // Returns all the undelegating superfluid poistions for a specific delegator.
+ rpc SuperfluidUndelegationsByDelegator(
+ SuperfluidUndelegationsByDelegatorRequest)
+ returns (SuperfluidUndelegationsByDelegatorResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/"
+ "superfluid_undelegations_by_delegator/{delegator_address}";
+ }
+
+ // Returns all the superfluid positions of a specific denom delegated to one
+ // validator
+ rpc SuperfluidDelegationsByValidatorDenom(
+ SuperfluidDelegationsByValidatorDenomRequest)
+ returns (SuperfluidDelegationsByValidatorDenomResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/superfluid_delegations_by_validator_denom";
+ }
+
+ // Returns the amount of a specific denom delegated to a specific validator
+ // This is labeled an estimate, because the way it calculates the amount can
+ // lead rounding errors from the true delegated amount
+ rpc EstimateSuperfluidDelegatedAmountByValidatorDenom(
+ EstimateSuperfluidDelegatedAmountByValidatorDenomRequest)
+ returns (EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/"
+ "estimate_superfluid_delegation_amount_by_validator_denom";
+ }
+
+ // Returns the specified delegations for a specific delegator
+ rpc TotalDelegationByDelegator(QueryTotalDelegationByDelegatorRequest)
+ returns (QueryTotalDelegationByDelegatorResponse) {
+ option (google.api.http).get =
+ "/osmosis/superfluid/v1beta1/"
+ "total_delegation_by_delegator/{delegator_address}";
+ }
+
+ // Returns a list of whitelisted pool ids to unpool.
+ rpc UnpoolWhitelist(QueryUnpoolWhitelistRequest)
+ returns (QueryUnpoolWhitelistResponse) {
+ option (google.api.http).get = "/osmosis/superfluid/v1beta1/"
+ "unpool_whitelist";
+ }
+}
+
+message QueryParamsRequest {}
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
+
+message AssetTypeRequest { string denom = 1; };
+message AssetTypeResponse { SuperfluidAssetType asset_type = 1; };
+
+message AllAssetsRequest {};
+message AllAssetsResponse {
+ repeated SuperfluidAsset assets = 1 [ (gogoproto.nullable) = false ];
+};
+
+message AssetMultiplierRequest { string denom = 1; };
+message AssetMultiplierResponse {
+ OsmoEquivalentMultiplierRecord osmo_equivalent_multiplier = 1;
+};
+
+message SuperfluidIntermediaryAccountInfo {
+ string denom = 1;
+ string val_addr = 2;
+ uint64 gauge_id = 3;
+ string address = 4;
+}
+message AllIntermediaryAccountsRequest {
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+};
+message AllIntermediaryAccountsResponse {
+ repeated SuperfluidIntermediaryAccountInfo accounts = 1
+ [ (gogoproto.nullable) = false ];
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+};
+
+message ConnectedIntermediaryAccountRequest { uint64 lock_id = 1; }
+message ConnectedIntermediaryAccountResponse {
+ SuperfluidIntermediaryAccountInfo account = 1;
+}
+
+message QueryTotalDelegationByValidatorForDenomRequest { string denom = 1; }
+message QueryTotalDelegationByValidatorForDenomResponse {
+ repeated Delegations assets = 1 [ (gogoproto.nullable) = false ];
+}
+
+message Delegations {
+ string val_addr = 1;
+ string amount_sfsd = 2 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"amount_sfsd\"",
+ (gogoproto.nullable) = false
+ ];
+ string osmo_equivalent = 3 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"osmo_equivalent\"",
+ (gogoproto.nullable) = false
+ ];
+}
+message TotalSuperfluidDelegationsRequest {}
+
+message TotalSuperfluidDelegationsResponse {
+ string total_delegations = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
+ (gogoproto.moretags) = "yaml:\"total_superfluid_delegations\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message SuperfluidDelegationAmountRequest {
+ string delegator_address = 1;
+ string validator_address = 2;
+ string denom = 3;
+}
+
+message SuperfluidDelegationAmountResponse {
+ repeated cosmos.base.v1beta1.Coin amount = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message SuperfluidDelegationsByDelegatorRequest {
+ string delegator_address = 1;
+}
+
+message SuperfluidDelegationsByDelegatorResponse {
+ repeated SuperfluidDelegationRecord superfluid_delegation_records = 1
+ [ (gogoproto.nullable) = false ];
+ repeated cosmos.base.v1beta1.Coin total_delegated_coins = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+ cosmos.base.v1beta1.Coin total_equivalent_staked_amount = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
+ ];
+}
+
+message SuperfluidUndelegationsByDelegatorRequest {
+ string delegator_address = 1;
+ string denom = 2;
+}
+
+message SuperfluidUndelegationsByDelegatorResponse {
+ repeated SuperfluidDelegationRecord superfluid_delegation_records = 1
+ [ (gogoproto.nullable) = false ];
+ repeated cosmos.base.v1beta1.Coin total_undelegated_coins = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+ repeated osmosis.lockup.SyntheticLock synthetic_locks = 3
+ [ (gogoproto.nullable) = false ];
+}
+
+message SuperfluidDelegationsByValidatorDenomRequest {
+ string validator_address = 1;
+ string denom = 2;
+}
+
+message SuperfluidDelegationsByValidatorDenomResponse {
+ repeated SuperfluidDelegationRecord superfluid_delegation_records = 1
+ [ (gogoproto.nullable) = false ];
+}
+
+message EstimateSuperfluidDelegatedAmountByValidatorDenomRequest {
+ string validator_address = 1;
+ string denom = 2;
+}
+
+message EstimateSuperfluidDelegatedAmountByValidatorDenomResponse {
+ repeated cosmos.base.v1beta1.Coin total_delegated_coins = 1 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+}
+
+message QueryTotalDelegationByDelegatorRequest { string delegator_address = 1; }
+
+message QueryTotalDelegationByDelegatorResponse {
+ repeated SuperfluidDelegationRecord superfluid_delegation_records = 1
+ [ (gogoproto.nullable) = false ];
+
+ repeated cosmos.staking.v1beta1.DelegationResponse delegation_response = 2
+ [ (gogoproto.nullable) = false ];
+ repeated cosmos.base.v1beta1.Coin total_delegated_coins = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+ cosmos.base.v1beta1.Coin total_equivalent_staked_amount = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
+ ];
+}
+
+message QueryUnpoolWhitelistRequest {}
+
+message QueryUnpoolWhitelistResponse { repeated uint64 pool_ids = 1; }
diff --git a/examples/authz/proto/osmosis/superfluid/superfluid.proto b/examples/authz/proto/osmosis/superfluid/superfluid.proto
new file mode 100644
index 00000000..fdf8d5a1
--- /dev/null
+++ b/examples/authz/proto/osmosis/superfluid/superfluid.proto
@@ -0,0 +1,82 @@
+syntax = "proto3";
+package osmosis.superfluid;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/timestamp.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types";
+
+// SuperfluidAssetType indicates whether the superfluid asset is
+// a native token itself or the lp share of a pool.
+enum SuperfluidAssetType {
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ SuperfluidAssetTypeNative = 0;
+ SuperfluidAssetTypeLPShare = 1;
+ // SuperfluidAssetTypeLendingShare = 2; // for now not exist
+}
+
+// SuperfluidAsset stores the pair of superfluid asset type and denom pair
+message SuperfluidAsset {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+
+ string denom = 1;
+ // AssetType indicates whether the superfluid asset is a native token or an lp
+ // share
+ SuperfluidAssetType asset_type = 2;
+}
+
+// SuperfluidIntermediaryAccount takes the role of intermediary between LP token
+// and OSMO tokens for superfluid staking. The intermediary account is the
+// actual account responsible for delegation, not the validator account itself.
+message SuperfluidIntermediaryAccount {
+ // Denom indicates the denom of the superfluid asset.
+ string denom = 1;
+ string val_addr = 2;
+ // perpetual gauge for rewards distribution
+ uint64 gauge_id = 3;
+}
+
+// The Osmo-Equivalent-Multiplier Record for epoch N refers to the osmo worth we
+// treat an LP share as having, for all of epoch N. Eventually this is intended
+// to be set as the Time-weighted-average-osmo-backing for the entire duration
+// of epoch N-1. (Thereby locking whats in use for epoch N as based on the prior
+// epochs rewards) However for now, this is not the TWAP but instead the spot
+// price at the boundary. For different types of assets in the future, it could
+// change.
+message OsmoEquivalentMultiplierRecord {
+ int64 epoch_number = 1;
+ // superfluid asset denom, can be LP token or native token
+ string denom = 2;
+ string multiplier = 3 [
+ (gogoproto.moretags) = "yaml:\"multiplier\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// SuperfluidDelegationRecord is a struct used to indicate superfluid
+// delegations of an account in the state machine in a user friendly form.
+message SuperfluidDelegationRecord {
+ string delegator_address = 1;
+ string validator_address = 2;
+ cosmos.base.v1beta1.Coin delegation_amount = 3 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
+ ];
+ cosmos.base.v1beta1.Coin equivalent_staked_amount = 4
+ [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ];
+}
+
+// LockIdIntermediaryAccountConnection is a struct used to indicate the
+// relationship between the underlying lock id and superfluid delegation done
+// via lp shares.
+message LockIdIntermediaryAccountConnection {
+ uint64 lock_id = 1;
+ string intermediary_account = 2;
+}
+
+message UnpoolWhitelistedPools { repeated uint64 ids = 1; }
diff --git a/examples/authz/proto/osmosis/superfluid/tx.proto b/examples/authz/proto/osmosis/superfluid/tx.proto
new file mode 100644
index 00000000..67b4a915
--- /dev/null
+++ b/examples/authz/proto/osmosis/superfluid/tx.proto
@@ -0,0 +1,92 @@
+syntax = "proto3";
+package osmosis.superfluid;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "osmosis/superfluid/superfluid.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types";
+
+// Msg defines the Msg service.
+service Msg {
+ // Execute superfluid delegation for a lockup
+ rpc SuperfluidDelegate(MsgSuperfluidDelegate)
+ returns (MsgSuperfluidDelegateResponse);
+
+ // Execute superfluid undelegation for a lockup
+ rpc SuperfluidUndelegate(MsgSuperfluidUndelegate)
+ returns (MsgSuperfluidUndelegateResponse);
+
+ // Execute superfluid redelegation for a lockup
+ // rpc SuperfluidRedelegate(MsgSuperfluidRedelegate) returns
+ // (MsgSuperfluidRedelegateResponse);
+
+ // For a given lock that is being superfluidly undelegated,
+ // also unbond the underlying lock.
+ rpc SuperfluidUnbondLock(MsgSuperfluidUnbondLock)
+ returns (MsgSuperfluidUnbondLockResponse);
+
+ // Execute lockup lock and superfluid delegation in a single msg
+ rpc LockAndSuperfluidDelegate(MsgLockAndSuperfluidDelegate)
+ returns (MsgLockAndSuperfluidDelegateResponse);
+
+ rpc UnPoolWhitelistedPool(MsgUnPoolWhitelistedPool)
+ returns (MsgUnPoolWhitelistedPoolResponse);
+}
+
+message MsgSuperfluidDelegate {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 lock_id = 2;
+ string val_addr = 3;
+}
+message MsgSuperfluidDelegateResponse {}
+
+message MsgSuperfluidUndelegate {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 lock_id = 2;
+}
+message MsgSuperfluidUndelegateResponse {}
+
+message MsgSuperfluidUnbondLock {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 lock_id = 2;
+}
+message MsgSuperfluidUnbondLockResponse {}
+
+// message MsgSuperfluidRedelegate {
+// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+// uint64 lock_id = 2;
+// string new_val_addr = 3;
+// }
+// message MsgSuperfluidRedelegateResponse {}
+
+// MsgLockAndSuperfluidDelegate locks coins with the unbonding period duration,
+// and then does a superfluid lock from the newly created lockup, to the
+// specified validator addr.
+message MsgLockAndSuperfluidDelegate {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ repeated cosmos.base.v1beta1.Coin coins = 2 [
+ (gogoproto.nullable) = false,
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
+ ];
+ string val_addr = 3;
+}
+message MsgLockAndSuperfluidDelegateResponse { uint64 ID = 1; }
+
+// MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is
+// associated with pool pool_id. If pool_id is not approved for unpooling by
+// governance, this is a no-op. Unpooling takes the locked gamm shares, and runs
+// "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens
+// ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new
+// lock for every constituent token, with the duration associated with the lock.
+// If the lock was unbonding, the new lockup durations should be the time left
+// until unbond completion.
+message MsgUnPoolWhitelistedPool {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+
+message MsgUnPoolWhitelistedPoolResponse {
+ repeated uint64 exited_lock_ids = 1;
+}
diff --git a/examples/authz/proto/osmosis/superfluid/v1beta1/gov.proto b/examples/authz/proto/osmosis/superfluid/v1beta1/gov.proto
new file mode 100644
index 00000000..787a45c6
--- /dev/null
+++ b/examples/authz/proto/osmosis/superfluid/v1beta1/gov.proto
@@ -0,0 +1,50 @@
+syntax = "proto3";
+package osmosis.superfluid.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/superfluid/superfluid.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types";
+
+// SetSuperfluidAssetsProposal is a gov Content type to update the superfluid
+// assets
+message SetSuperfluidAssetsProposal {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ option (cosmos_proto.implements_interface) = "ProposalContentI";
+
+ string title = 1;
+ string description = 2;
+ repeated SuperfluidAsset assets = 3 [ (gogoproto.nullable) = false ];
+}
+
+// RemoveSuperfluidAssetsProposal is a gov Content type to remove the superfluid
+// assets by denom
+message RemoveSuperfluidAssetsProposal {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ option (cosmos_proto.implements_interface) = "ProposalContentI";
+
+ string title = 1;
+ string description = 2;
+ repeated string superfluid_asset_denoms = 3;
+}
+
+// UpdateUnpoolWhiteListProposal is a gov Content type to update the
+// allowed list of pool ids.
+message UpdateUnpoolWhiteListProposal {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ option (cosmos_proto.implements_interface) = "ProposalContentI";
+
+ string title = 1;
+ string description = 2;
+ repeated uint64 ids = 3;
+ bool is_overwrite = 4;
+}
diff --git a/examples/authz/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/examples/authz/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto
new file mode 100644
index 00000000..cc58a6d5
--- /dev/null
+++ b/examples/authz/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+package osmosis.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types";
+
+// DenomAuthorityMetadata specifies metadata for addresses that have specific
+// capabilities over a token factory denom. Right now there is only one Admin
+// permission, but is planned to be extended to the future.
+message DenomAuthorityMetadata {
+ option (gogoproto.equal) = true;
+
+ // Can be empty for no admin, or a valid osmosis address
+ string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ];
+}
diff --git a/examples/authz/proto/osmosis/tokenfactory/v1beta1/genesis.proto b/examples/authz/proto/osmosis/tokenfactory/v1beta1/genesis.proto
new file mode 100644
index 00000000..e8c2c7c2
--- /dev/null
+++ b/examples/authz/proto/osmosis/tokenfactory/v1beta1/genesis.proto
@@ -0,0 +1,32 @@
+syntax = "proto3";
+package osmosis.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto";
+import "osmosis/tokenfactory/v1beta1/params.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types";
+
+// GenesisState defines the tokenfactory module's genesis state.
+message GenesisState {
+ // params defines the paramaters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+
+ repeated GenesisDenom factory_denoms = 2 [
+ (gogoproto.moretags) = "yaml:\"factory_denoms\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// GenesisDenom defines a tokenfactory denom that is defined within genesis
+// state. The structure contains DenomAuthorityMetadata which defines the
+// denom's admin.
+message GenesisDenom {
+ option (gogoproto.equal) = true;
+
+ string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+ DenomAuthorityMetadata authority_metadata = 2 [
+ (gogoproto.moretags) = "yaml:\"authority_metadata\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/tokenfactory/v1beta1/params.proto b/examples/authz/proto/osmosis/tokenfactory/v1beta1/params.proto
new file mode 100644
index 00000000..7e14273d
--- /dev/null
+++ b/examples/authz/proto/osmosis/tokenfactory/v1beta1/params.proto
@@ -0,0 +1,18 @@
+syntax = "proto3";
+package osmosis.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types";
+
+// Params defines the parameters for the tokenfactory module.
+message Params {
+ repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.moretags) = "yaml:\"denom_creation_fee\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/examples/authz/proto/osmosis/tokenfactory/v1beta1/query.proto b/examples/authz/proto/osmosis/tokenfactory/v1beta1/query.proto
new file mode 100644
index 00000000..7b347161
--- /dev/null
+++ b/examples/authz/proto/osmosis/tokenfactory/v1beta1/query.proto
@@ -0,0 +1,71 @@
+syntax = "proto3";
+package osmosis.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto";
+import "osmosis/tokenfactory/v1beta1/params.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Params defines a gRPC query method that returns the tokenfactory module's
+ // parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/params";
+ }
+
+ // DenomAuthorityMetadata defines a gRPC query method for fetching
+ // DenomAuthorityMetadata for a particular denom.
+ rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest)
+ returns (QueryDenomAuthorityMetadataResponse) {
+ option (google.api.http).get =
+ "/osmosis/tokenfactory/v1beta1/denoms/{denom}/authority_metadata";
+ }
+
+ // DenomsFromCreator defines a gRPC query method for fetching all
+ // denominations created by a specific admin/creator.
+ rpc DenomsFromCreator(QueryDenomsFromCreatorRequest)
+ returns (QueryDenomsFromCreatorResponse) {
+ option (google.api.http).get =
+ "/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
+
+// QueryDenomAuthorityMetadataRequest defines the request structure for the
+// DenomAuthorityMetadata gRPC query.
+message QueryDenomAuthorityMetadataRequest {
+ string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+}
+
+// QueryDenomAuthorityMetadataResponse defines the response structure for the
+// DenomAuthorityMetadata gRPC query.
+message QueryDenomAuthorityMetadataResponse {
+ DenomAuthorityMetadata authority_metadata = 1 [
+ (gogoproto.moretags) = "yaml:\"authority_metadata\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// QueryDenomsFromCreatorRequest defines the request structure for the
+// DenomsFromCreator gRPC query.
+message QueryDenomsFromCreatorRequest {
+ string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ];
+}
+
+// QueryDenomsFromCreatorRequest defines the response structure for the
+// DenomsFromCreator gRPC query.
+message QueryDenomsFromCreatorResponse {
+ repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ];
+}
diff --git a/examples/authz/proto/osmosis/tokenfactory/v1beta1/tx.proto b/examples/authz/proto/osmosis/tokenfactory/v1beta1/tx.proto
new file mode 100644
index 00000000..938b1fa9
--- /dev/null
+++ b/examples/authz/proto/osmosis/tokenfactory/v1beta1/tx.proto
@@ -0,0 +1,108 @@
+syntax = "proto3";
+package osmosis.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/bank.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types";
+
+// Msg defines the tokefactory module's gRPC message service.
+service Msg {
+ rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse);
+ rpc Mint(MsgMint) returns (MsgMintResponse);
+ rpc Burn(MsgBurn) returns (MsgBurnResponse);
+ rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse);
+ rpc SetDenomMetadata(MsgSetDenomMetadata)
+ returns (MsgSetDenomMetadataResponse);
+
+ // ForceTransfer is deactivated for now because we need to think through edge
+ // cases rpc ForceTransfer(MsgForceTransfer) returns
+ // (MsgForceTransferResponse);
+}
+
+// MsgCreateDenom defines the message structure for the CreateDenom gRPC service
+// method. It allows an account to create a new denom. It requires a sender
+// address and a sub denomination. The (sender_address, sub_denomination) tuple
+// must be unique and cannot be re-used.
+//
+// The resulting denom created is defined as
+// . The resulting denom's admin is
+// originally set to be the creator, but this can be changed later. The token
+// denom does not indicate the current admin.
+message MsgCreateDenom {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ // subdenom can be up to 44 "alphanumeric" characters long.
+ string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ];
+}
+
+// MsgCreateDenomResponse is the return value of MsgCreateDenom
+// It returns the full string of the newly created denom
+message MsgCreateDenomResponse {
+ string new_token_denom = 1
+ [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ];
+}
+
+// MsgMint is the sdk.Msg type for allowing an admin account to mint
+// more of a token. For now, we only support minting to the sender account
+message MsgMint {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.base.v1beta1.Coin amount = 2 [
+ (gogoproto.moretags) = "yaml:\"amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgMintResponse {}
+
+// MsgBurn is the sdk.Msg type for allowing an admin account to burn
+// a token. For now, we only support burning from the sender account.
+message MsgBurn {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.base.v1beta1.Coin amount = 2 [
+ (gogoproto.moretags) = "yaml:\"amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgBurnResponse {}
+
+// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign
+// adminship of a denom to a new account
+message MsgChangeAdmin {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+ string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
+}
+
+// MsgChangeAdminResponse defines the response structure for an executed
+// MsgChangeAdmin message.
+message MsgChangeAdminResponse {}
+
+// message MsgForceTransfer {
+// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+// cosmos.base.v1beta1.Coin amount = 2 [
+// (gogoproto.moretags) = "yaml:\"amount\"",
+// (gogoproto.nullable) = false
+// ];
+// string transferFromAddress = 3
+// [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ];
+// string transferToAddress = 4
+// [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ];
+// }
+
+// message MsgForceTransferResponse {}
+
+// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set
+// the denom's bank metadata
+message MsgSetDenomMetadata {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.bank.v1beta1.Metadata metadata = 2 [
+ (gogoproto.moretags) = "yaml:\"metadata\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// MsgSetDenomMetadataResponse defines the response structure for an executed
+// MsgSetDenomMetadata message.
+message MsgSetDenomMetadataResponse {}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/twap/v1beta1/genesis.proto b/examples/authz/proto/osmosis/twap/v1beta1/genesis.proto
new file mode 100644
index 00000000..e9c377b0
--- /dev/null
+++ b/examples/authz/proto/osmosis/twap/v1beta1/genesis.proto
@@ -0,0 +1,29 @@
+syntax = "proto3";
+package osmosis.twap.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/twap/v1beta1/twap_record.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+import "google/protobuf/duration.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/twap/types";
+
+// Params holds parameters for the twap module
+message Params {
+ string prune_epoch_identifier = 1;
+ google.protobuf.Duration record_history_keep_period = 2 [
+ (gogoproto.moretags) = "yaml:\"record_history_keep_period\"",
+ (gogoproto.stdduration) = true,
+ (gogoproto.nullable) = false
+ ];
+}
+
+// GenesisState defines the twap module's genesis state.
+message GenesisState {
+ // twaps is the collection of all twap records.
+ repeated TwapRecord twaps = 1 [ (gogoproto.nullable) = false ];
+
+ // params is the container of twap parameters.
+ Params params = 2 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/twap/v1beta1/query.proto b/examples/authz/proto/osmosis/twap/v1beta1/query.proto
new file mode 100644
index 00000000..95374ece
--- /dev/null
+++ b/examples/authz/proto/osmosis/twap/v1beta1/query.proto
@@ -0,0 +1,73 @@
+syntax = "proto3";
+package osmosis.twap.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/twap/v1beta1/twap_record.proto";
+import "osmosis/twap/v1beta1/genesis.proto";
+
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+import "google/protobuf/timestamp.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/twap/client/queryproto";
+
+service Query {
+ rpc Params(ParamsRequest) returns (ParamsResponse) {
+ option (google.api.http).get = "/osmosis/twap/v1beta1/Params";
+ }
+ rpc ArithmeticTwap(ArithmeticTwapRequest) returns (ArithmeticTwapResponse) {
+ option (google.api.http).get = "/osmosis/twap/v1beta1/ArithmeticTwap";
+ }
+ rpc ArithmeticTwapToNow(ArithmeticTwapToNowRequest)
+ returns (ArithmeticTwapToNowResponse) {
+ option deprecated = true;
+ option (google.api.http).get = "/osmosis/twap/v1beta1/ArithmeticTwapToNow";
+ }
+}
+
+message ArithmeticTwapRequest {
+ uint64 pool_id = 1;
+ string base_asset = 2;
+ string quote_asset = 3;
+ google.protobuf.Timestamp start_time = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdtime) = true,
+ (gogoproto.moretags) = "yaml:\"start_time\""
+ ];
+ google.protobuf.Timestamp end_time = 5 [
+ (gogoproto.nullable) = true,
+ (gogoproto.stdtime) = true,
+ (gogoproto.moretags) = "yaml:\"end_time\""
+ ];
+}
+message ArithmeticTwapResponse {
+ string arithmetic_twap = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"arithmetic_twap\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message ArithmeticTwapToNowRequest {
+ uint64 pool_id = 1;
+ string base_asset = 2;
+ string quote_asset = 3;
+ google.protobuf.Timestamp start_time = 4 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdtime) = true,
+ (gogoproto.moretags) = "yaml:\"start_time\""
+ ];
+}
+message ArithmeticTwapToNowResponse {
+ string arithmetic_twap = 1 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.moretags) = "yaml:\"arithmetic_twap\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message ParamsRequest {}
+message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; }
diff --git a/examples/authz/proto/osmosis/twap/v1beta1/query.yml b/examples/authz/proto/osmosis/twap/v1beta1/query.yml
new file mode 100644
index 00000000..6763392a
--- /dev/null
+++ b/examples/authz/proto/osmosis/twap/v1beta1/query.yml
@@ -0,0 +1,22 @@
+keeper:
+ path: "github.com/osmosis-labs/osmosis/v13/x/twap"
+ struct: "Keeper"
+client_path: "github.com/osmosis-labs/osmosis/v13/x/twap/client"
+queries:
+ ArithmeticTwap:
+ proto_wrapper:
+ default_values:
+ Req.end_time: "ctx.BlockTime()"
+ query_func: "k.GetArithmeticTwap"
+ cli:
+ cmd: "ArithmeticTwap"
+ ArithmeticTwapToNow:
+ proto_wrapper:
+ query_func: "k.GetArithmeticTwapToNow"
+ cli:
+ cmd: "ArithmeticTwapToNow"
+ Params:
+ proto_wrapper:
+ query_func: "k.GetParams"
+ cli:
+ cmd: "GetArithmeticTwapToNow"
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/twap/v1beta1/twap_record.proto b/examples/authz/proto/osmosis/twap/v1beta1/twap_record.proto
new file mode 100644
index 00000000..d040b318
--- /dev/null
+++ b/examples/authz/proto/osmosis/twap/v1beta1/twap_record.proto
@@ -0,0 +1,69 @@
+syntax = "proto3";
+package osmosis.twap.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/any.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "google/protobuf/timestamp.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/twap/types";
+
+// A TWAP record should be indexed in state by pool_id, (asset pair), timestamp
+// The asset pair assets should be lexicographically sorted.
+// Technically (pool_id, asset_0_denom, asset_1_denom, height) do not need to
+// appear in the struct however we view this as the wrong performance tradeoff
+// given SDK today. Would rather we optimize for readability and correctness,
+// than an optimal state storage format. The system bottleneck is elsewhere for
+// now.
+message TwapRecord {
+ uint64 pool_id = 1;
+ // Lexicographically smaller denom of the pair
+ string asset0_denom = 2;
+ // Lexicographically larger denom of the pair
+ string asset1_denom = 3;
+ // height this record corresponds to, for debugging purposes
+ int64 height = 4 [
+ (gogoproto.moretags) = "yaml:\"record_height\"",
+ (gogoproto.jsontag) = "record_height"
+ ];
+ // This field should only exist until we have a global registry in the state
+ // machine, mapping prior block heights within {TIME RANGE} to times.
+ google.protobuf.Timestamp time = 5 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdtime) = true,
+ (gogoproto.moretags) = "yaml:\"record_time\""
+ ];
+
+ // We store the last spot prices in the struct, so that we can interpolate
+ // accumulator values for times between when accumulator records are stored.
+ string p0_last_spot_price = 6 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ string p1_last_spot_price = 7 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+
+ string p0_arithmetic_twap_accumulator = 8 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ string p1_arithmetic_twap_accumulator = 9 [
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+ // string geometric_twap_accumulator = 7 [(gogoproto.customtype) =
+ // "github.com/cosmos/cosmos-sdk/types.Dec",
+ // (gogoproto.nullable) = false];
+
+ // This field contains the time in which the last spot price error occured.
+ // It is used to alert the caller if they are getting a potentially erroneous
+ // TWAP, due to an unforeseen underlying error.
+ google.protobuf.Timestamp last_error_time = 11 [
+ (gogoproto.nullable) = false,
+ (gogoproto.stdtime) = true,
+ (gogoproto.moretags) = "yaml:\"last_error_time\""
+ ];
+}
diff --git a/examples/authz/proto/osmosis/txfees/v1beta1/feetoken.proto b/examples/authz/proto/osmosis/txfees/v1beta1/feetoken.proto
new file mode 100644
index 00000000..3b18f58f
--- /dev/null
+++ b/examples/authz/proto/osmosis/txfees/v1beta1/feetoken.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+package osmosis.txfees.v1beta1;
+
+import "gogoproto/gogo.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types";
+
+// FeeToken is a struct that specifies a coin denom, and pool ID pair.
+// This marks the token as eligible for use as a tx fee asset in Osmosis.
+// Its price in osmo is derived through looking at the provided pool ID.
+// The pool ID must have osmo as one of its assets.
+message FeeToken {
+ option (gogoproto.equal) = true;
+
+ string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+ uint64 poolID = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/txfees/v1beta1/genesis.proto b/examples/authz/proto/osmosis/txfees/v1beta1/genesis.proto
new file mode 100644
index 00000000..4ac7a282
--- /dev/null
+++ b/examples/authz/proto/osmosis/txfees/v1beta1/genesis.proto
@@ -0,0 +1,13 @@
+syntax = "proto3";
+package osmosis.txfees.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/txfees/v1beta1/feetoken.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types";
+
+// GenesisState defines the txfees module's genesis state.
+message GenesisState {
+ string basedenom = 1;
+ repeated FeeToken feetokens = 2 [ (gogoproto.nullable) = false ];
+}
diff --git a/examples/authz/proto/osmosis/txfees/v1beta1/gov.proto b/examples/authz/proto/osmosis/txfees/v1beta1/gov.proto
new file mode 100644
index 00000000..a87a2afa
--- /dev/null
+++ b/examples/authz/proto/osmosis/txfees/v1beta1/gov.proto
@@ -0,0 +1,27 @@
+syntax = "proto3";
+package osmosis.txfees.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "osmosis/txfees/v1beta1/feetoken.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types";
+
+// UpdateFeeTokenProposal is a gov Content type for adding a new whitelisted fee
+// token. It must specify a denom along with gamm pool ID to use as a spot price
+// calculator. It can be used to add a new denom to the whitelist It can also be
+// used to update the Pool to associate with the denom. If Pool ID is set to 0,
+// it will remove the denom from the whitelisted set.
+message UpdateFeeTokenProposal {
+ option (gogoproto.equal) = true;
+ option (gogoproto.goproto_getters) = false;
+ option (gogoproto.goproto_stringer) = false;
+
+ option (cosmos_proto.implements_interface) = "ProposalContentI";
+
+ string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
+ string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
+ FeeToken feetoken = 3 [
+ (gogoproto.moretags) = "yaml:\"fee_token\"",
+ (gogoproto.nullable) = false
+ ];
+}
\ No newline at end of file
diff --git a/examples/authz/proto/osmosis/txfees/v1beta1/query.proto b/examples/authz/proto/osmosis/txfees/v1beta1/query.proto
new file mode 100644
index 00000000..395eb113
--- /dev/null
+++ b/examples/authz/proto/osmosis/txfees/v1beta1/query.proto
@@ -0,0 +1,74 @@
+syntax = "proto3";
+package osmosis.txfees.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "google/protobuf/duration.proto";
+
+import "osmosis/txfees/v1beta1/feetoken.proto";
+
+option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types";
+
+service Query {
+ // FeeTokens returns a list of all the whitelisted fee tokens and their
+ // corresponding pools. It does not include the BaseDenom, which has its own
+ // query endpoint
+ rpc FeeTokens(QueryFeeTokensRequest) returns (QueryFeeTokensResponse) {
+ option (google.api.http).get = "/osmosis/txfees/v1beta1/fee_tokens";
+ }
+
+ // DenomSpotPrice returns all spot prices by each registered token denom.
+ rpc DenomSpotPrice(QueryDenomSpotPriceRequest)
+ returns (QueryDenomSpotPriceResponse) {
+ option (google.api.http).get =
+ "/osmosis/txfees/v1beta1/spot_price_by_denom";
+ }
+
+ // Returns the poolID for a specified denom input.
+ rpc DenomPoolId(QueryDenomPoolIdRequest) returns (QueryDenomPoolIdResponse) {
+ option (google.api.http).get =
+ "/osmosis/txfees/v1beta1/denom_pool_id/{denom}";
+ }
+
+ // Returns a list of all base denom tokens and their corresponding pools.
+ rpc BaseDenom(QueryBaseDenomRequest) returns (QueryBaseDenomResponse) {
+ option (google.api.http).get = "/osmosis/txfees/v1beta1/base_denom";
+ }
+}
+
+message QueryFeeTokensRequest {}
+message QueryFeeTokensResponse {
+ repeated FeeToken fee_tokens = 1 [
+ (gogoproto.moretags) = "yaml:\"fee_tokens\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// QueryDenomSpotPriceRequest defines grpc request structure for querying spot
+// price for the specified tx fee denom
+message QueryDenomSpotPriceRequest {
+ string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+}
+
+// QueryDenomSpotPriceRequest defines grpc response structure for querying spot
+// price for the specified tx fee denom
+message QueryDenomSpotPriceResponse {
+ uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+ string spot_price = 2 [
+ (gogoproto.moretags) = "yaml:\"spot_price\"",
+ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message QueryDenomPoolIdRequest {
+ string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+}
+message QueryDenomPoolIdResponse {
+ uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ];
+}
+
+message QueryBaseDenomRequest {}
+message QueryBaseDenomResponse {
+ string base_denom = 1 [ (gogoproto.moretags) = "yaml:\"base_denom\"" ];
+}
diff --git a/examples/authz/proto/tendermint/LICENSE b/examples/authz/proto/tendermint/LICENSE
new file mode 100644
index 00000000..eaf92fbf
--- /dev/null
+++ b/examples/authz/proto/tendermint/LICENSE
@@ -0,0 +1,204 @@
+Tendermint Core
+License: Apache2.0
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2016 All in Bits, Inc
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/examples/authz/proto/tendermint/README.md b/examples/authz/proto/tendermint/README.md
new file mode 100644
index 00000000..74fcf8b8
--- /dev/null
+++ b/examples/authz/proto/tendermint/README.md
@@ -0,0 +1 @@
+# tendermint
\ No newline at end of file
diff --git a/examples/authz/proto/tendermint/abci/types.proto b/examples/authz/proto/tendermint/abci/types.proto
new file mode 100644
index 00000000..d41a5226
--- /dev/null
+++ b/examples/authz/proto/tendermint/abci/types.proto
@@ -0,0 +1,394 @@
+syntax = "proto3";
+package tendermint.abci;
+
+option go_package = "github.com/tendermint/tendermint/abci/types";
+
+// For more information on gogo.proto, see:
+// https://github.com/gogo/protobuf/blob/master/extensions.md
+import "tendermint/crypto/proof.proto";
+import "tendermint/types/types.proto";
+import "tendermint/crypto/keys.proto";
+import "tendermint/types/params.proto";
+import "google/protobuf/timestamp.proto";
+import "gogoproto/gogo.proto";
+
+// This file is copied from http://github.com/tendermint/abci
+// NOTE: When using custom types, mind the warnings.
+// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues
+
+//----------------------------------------
+// Request types
+
+message Request {
+ oneof value {
+ RequestEcho echo = 1;
+ RequestFlush flush = 2;
+ RequestInfo info = 3;
+ RequestSetOption set_option = 4;
+ RequestInitChain init_chain = 5;
+ RequestQuery query = 6;
+ RequestBeginBlock begin_block = 7;
+ RequestCheckTx check_tx = 8;
+ RequestDeliverTx deliver_tx = 9;
+ RequestEndBlock end_block = 10;
+ RequestCommit commit = 11;
+ RequestListSnapshots list_snapshots = 12;
+ RequestOfferSnapshot offer_snapshot = 13;
+ RequestLoadSnapshotChunk load_snapshot_chunk = 14;
+ RequestApplySnapshotChunk apply_snapshot_chunk = 15;
+ }
+}
+
+message RequestEcho {
+ string message = 1;
+}
+
+message RequestFlush {}
+
+message RequestInfo {
+ string version = 1;
+ uint64 block_version = 2;
+ uint64 p2p_version = 3;
+}
+
+// nondeterministic
+message RequestSetOption {
+ string key = 1;
+ string value = 2;
+}
+
+message RequestInitChain {
+ google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ string chain_id = 2;
+ ConsensusParams consensus_params = 3;
+ repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false];
+ bytes app_state_bytes = 5;
+ int64 initial_height = 6;
+}
+
+message RequestQuery {
+ bytes data = 1;
+ string path = 2;
+ int64 height = 3;
+ bool prove = 4;
+}
+
+message RequestBeginBlock {
+ bytes hash = 1;
+ tendermint.types.Header header = 2 [(gogoproto.nullable) = false];
+ LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false];
+ repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false];
+}
+
+enum CheckTxType {
+ NEW = 0 [(gogoproto.enumvalue_customname) = "New"];
+ RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"];
+}
+
+message RequestCheckTx {
+ bytes tx = 1;
+ CheckTxType type = 2;
+}
+
+message RequestDeliverTx {
+ bytes tx = 1;
+}
+
+message RequestEndBlock {
+ int64 height = 1;
+}
+
+message RequestCommit {}
+
+// lists available snapshots
+message RequestListSnapshots {}
+
+// offers a snapshot to the application
+message RequestOfferSnapshot {
+ Snapshot snapshot = 1; // snapshot offered by peers
+ bytes app_hash = 2; // light client-verified app hash for snapshot height
+}
+
+// loads a snapshot chunk
+message RequestLoadSnapshotChunk {
+ uint64 height = 1;
+ uint32 format = 2;
+ uint32 chunk = 3;
+}
+
+// Applies a snapshot chunk
+message RequestApplySnapshotChunk {
+ uint32 index = 1;
+ bytes chunk = 2;
+ string sender = 3;
+}
+
+//----------------------------------------
+// Response types
+
+message Response {
+ oneof value {
+ ResponseException exception = 1;
+ ResponseEcho echo = 2;
+ ResponseFlush flush = 3;
+ ResponseInfo info = 4;
+ ResponseSetOption set_option = 5;
+ ResponseInitChain init_chain = 6;
+ ResponseQuery query = 7;
+ ResponseBeginBlock begin_block = 8;
+ ResponseCheckTx check_tx = 9;
+ ResponseDeliverTx deliver_tx = 10;
+ ResponseEndBlock end_block = 11;
+ ResponseCommit commit = 12;
+ ResponseListSnapshots list_snapshots = 13;
+ ResponseOfferSnapshot offer_snapshot = 14;
+ ResponseLoadSnapshotChunk load_snapshot_chunk = 15;
+ ResponseApplySnapshotChunk apply_snapshot_chunk = 16;
+ }
+}
+
+// nondeterministic
+message ResponseException {
+ string error = 1;
+}
+
+message ResponseEcho {
+ string message = 1;
+}
+
+message ResponseFlush {}
+
+message ResponseInfo {
+ string data = 1;
+
+ string version = 2;
+ uint64 app_version = 3;
+
+ int64 last_block_height = 4;
+ bytes last_block_app_hash = 5;
+}
+
+// nondeterministic
+message ResponseSetOption {
+ uint32 code = 1;
+ // bytes data = 2;
+ string log = 3;
+ string info = 4;
+}
+
+message ResponseInitChain {
+ ConsensusParams consensus_params = 1;
+ repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false];
+ bytes app_hash = 3;
+}
+
+message ResponseQuery {
+ uint32 code = 1;
+ // bytes data = 2; // use "value" instead.
+ string log = 3; // nondeterministic
+ string info = 4; // nondeterministic
+ int64 index = 5;
+ bytes key = 6;
+ bytes value = 7;
+ tendermint.crypto.ProofOps proof_ops = 8;
+ int64 height = 9;
+ string codespace = 10;
+}
+
+message ResponseBeginBlock {
+ repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
+}
+
+message ResponseCheckTx {
+ uint32 code = 1;
+ bytes data = 2;
+ string log = 3; // nondeterministic
+ string info = 4; // nondeterministic
+ int64 gas_wanted = 5 [json_name = "gas_wanted"];
+ int64 gas_used = 6 [json_name = "gas_used"];
+ repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
+ string codespace = 8;
+}
+
+message ResponseDeliverTx {
+ uint32 code = 1;
+ bytes data = 2;
+ string log = 3; // nondeterministic
+ string info = 4; // nondeterministic
+ int64 gas_wanted = 5 [json_name = "gas_wanted"];
+ int64 gas_used = 6 [json_name = "gas_used"];
+ repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
+ string codespace = 8;
+}
+
+message ResponseEndBlock {
+ repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false];
+ ConsensusParams consensus_param_updates = 2;
+ repeated Event events = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
+}
+
+message ResponseCommit {
+ // reserve 1
+ bytes data = 2;
+ int64 retain_height = 3;
+}
+
+message ResponseListSnapshots {
+ repeated Snapshot snapshots = 1;
+}
+
+message ResponseOfferSnapshot {
+ Result result = 1;
+
+ enum Result {
+ UNKNOWN = 0; // Unknown result, abort all snapshot restoration
+ ACCEPT = 1; // Snapshot accepted, apply chunks
+ ABORT = 2; // Abort all snapshot restoration
+ REJECT = 3; // Reject this specific snapshot, try others
+ REJECT_FORMAT = 4; // Reject all snapshots of this format, try others
+ REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others
+ }
+}
+
+message ResponseLoadSnapshotChunk {
+ bytes chunk = 1;
+}
+
+message ResponseApplySnapshotChunk {
+ Result result = 1;
+ repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply
+ repeated string reject_senders = 3; // Chunk senders to reject and ban
+
+ enum Result {
+ UNKNOWN = 0; // Unknown result, abort all snapshot restoration
+ ACCEPT = 1; // Chunk successfully accepted
+ ABORT = 2; // Abort all snapshot restoration
+ RETRY = 3; // Retry chunk (combine with refetch and reject)
+ RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject)
+ REJECT_SNAPSHOT = 5; // Reject this snapshot, try others
+ }
+}
+
+//----------------------------------------
+// Misc.
+
+// ConsensusParams contains all consensus-relevant parameters
+// that can be adjusted by the abci app
+message ConsensusParams {
+ BlockParams block = 1;
+ tendermint.types.EvidenceParams evidence = 2;
+ tendermint.types.ValidatorParams validator = 3;
+ tendermint.types.VersionParams version = 4;
+}
+
+// BlockParams contains limits on the block size.
+message BlockParams {
+ // Note: must be greater than 0
+ int64 max_bytes = 1;
+ // Note: must be greater or equal to -1
+ int64 max_gas = 2;
+}
+
+message LastCommitInfo {
+ int32 round = 1;
+ repeated VoteInfo votes = 2 [(gogoproto.nullable) = false];
+}
+
+// Event allows application developers to attach additional information to
+// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
+// Later, transactions may be queried using these events.
+message Event {
+ string type = 1;
+ repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"];
+}
+
+// EventAttribute is a single key-value pair, associated with an event.
+message EventAttribute {
+ bytes key = 1;
+ bytes value = 2;
+ bool index = 3; // nondeterministic
+}
+
+// TxResult contains results of executing the transaction.
+//
+// One usage is indexing transaction results.
+message TxResult {
+ int64 height = 1;
+ uint32 index = 2;
+ bytes tx = 3;
+ ResponseDeliverTx result = 4 [(gogoproto.nullable) = false];
+}
+
+//----------------------------------------
+// Blockchain Types
+
+// Validator
+message Validator {
+ bytes address = 1; // The first 20 bytes of SHA256(public key)
+ // PubKey pub_key = 2 [(gogoproto.nullable)=false];
+ int64 power = 3; // The voting power
+}
+
+// ValidatorUpdate
+message ValidatorUpdate {
+ tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
+ int64 power = 2;
+}
+
+// VoteInfo
+message VoteInfo {
+ Validator validator = 1 [(gogoproto.nullable) = false];
+ bool signed_last_block = 2;
+}
+
+enum EvidenceType {
+ UNKNOWN = 0;
+ DUPLICATE_VOTE = 1;
+ LIGHT_CLIENT_ATTACK = 2;
+}
+
+message Evidence {
+ EvidenceType type = 1;
+ // The offending validator
+ Validator validator = 2 [(gogoproto.nullable) = false];
+ // The height when the offense occurred
+ int64 height = 3;
+ // The corresponding time where the offense occurred
+ google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ // Total voting power of the validator set in case the ABCI application does
+ // not store historical validators.
+ // https://github.com/tendermint/tendermint/issues/4581
+ int64 total_voting_power = 5;
+}
+
+//----------------------------------------
+// State Sync Types
+
+message Snapshot {
+ uint64 height = 1; // The height at which the snapshot was taken
+ uint32 format = 2; // The application-specific snapshot format
+ uint32 chunks = 3; // Number of chunks in the snapshot
+ bytes hash = 4; // Arbitrary snapshot hash, equal only if identical
+ bytes metadata = 5; // Arbitrary application metadata
+}
+
+//----------------------------------------
+// Service Definition
+
+service ABCIApplication {
+ rpc Echo(RequestEcho) returns (ResponseEcho);
+ rpc Flush(RequestFlush) returns (ResponseFlush);
+ rpc Info(RequestInfo) returns (ResponseInfo);
+ rpc SetOption(RequestSetOption) returns (ResponseSetOption);
+ rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
+ rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
+ rpc Query(RequestQuery) returns (ResponseQuery);
+ rpc Commit(RequestCommit) returns (ResponseCommit);
+ rpc InitChain(RequestInitChain) returns (ResponseInitChain);
+ rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
+ rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
+ rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots);
+ rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot);
+ rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk);
+ rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk);
+}
diff --git a/examples/authz/proto/tendermint/crypto/keys.proto b/examples/authz/proto/tendermint/crypto/keys.proto
new file mode 100644
index 00000000..16fd7adf
--- /dev/null
+++ b/examples/authz/proto/tendermint/crypto/keys.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+package tendermint.crypto;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto";
+
+import "gogoproto/gogo.proto";
+
+// PublicKey defines the keys available for use with Tendermint Validators
+message PublicKey {
+ option (gogoproto.compare) = true;
+ option (gogoproto.equal) = true;
+
+ oneof sum {
+ bytes ed25519 = 1;
+ bytes secp256k1 = 2;
+ }
+}
diff --git a/examples/authz/proto/tendermint/crypto/proof.proto b/examples/authz/proto/tendermint/crypto/proof.proto
new file mode 100644
index 00000000..975df768
--- /dev/null
+++ b/examples/authz/proto/tendermint/crypto/proof.proto
@@ -0,0 +1,41 @@
+syntax = "proto3";
+package tendermint.crypto;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto";
+
+import "gogoproto/gogo.proto";
+
+message Proof {
+ int64 total = 1;
+ int64 index = 2;
+ bytes leaf_hash = 3;
+ repeated bytes aunts = 4;
+}
+
+message ValueOp {
+ // Encoded in ProofOp.Key.
+ bytes key = 1;
+
+ // To encode in ProofOp.Data
+ Proof proof = 2;
+}
+
+message DominoOp {
+ string key = 1;
+ string input = 2;
+ string output = 3;
+}
+
+// ProofOp defines an operation used for calculating Merkle root
+// The data could be arbitrary format, providing nessecary data
+// for example neighbouring node hash
+message ProofOp {
+ string type = 1;
+ bytes key = 2;
+ bytes data = 3;
+}
+
+// ProofOps is Merkle proof defined by the list of ProofOps
+message ProofOps {
+ repeated ProofOp ops = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/tendermint/libs/bits/types.proto b/examples/authz/proto/tendermint/libs/bits/types.proto
new file mode 100644
index 00000000..3111d113
--- /dev/null
+++ b/examples/authz/proto/tendermint/libs/bits/types.proto
@@ -0,0 +1,9 @@
+syntax = "proto3";
+package tendermint.libs.bits;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits";
+
+message BitArray {
+ int64 bits = 1;
+ repeated uint64 elems = 2;
+}
diff --git a/examples/authz/proto/tendermint/p2p/types.proto b/examples/authz/proto/tendermint/p2p/types.proto
new file mode 100644
index 00000000..216a6d8d
--- /dev/null
+++ b/examples/authz/proto/tendermint/p2p/types.proto
@@ -0,0 +1,42 @@
+syntax = "proto3";
+package tendermint.p2p;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+
+message ProtocolVersion {
+ uint64 p2p = 1 [(gogoproto.customname) = "P2P"];
+ uint64 block = 2;
+ uint64 app = 3;
+}
+
+message NodeInfo {
+ ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false];
+ string node_id = 2 [(gogoproto.customname) = "NodeID"];
+ string listen_addr = 3;
+ string network = 4;
+ string version = 5;
+ bytes channels = 6;
+ string moniker = 7;
+ NodeInfoOther other = 8 [(gogoproto.nullable) = false];
+}
+
+message NodeInfoOther {
+ string tx_index = 1;
+ string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"];
+}
+
+message PeerInfo {
+ string id = 1 [(gogoproto.customname) = "ID"];
+ repeated PeerAddressInfo address_info = 2;
+ google.protobuf.Timestamp last_connected = 3 [(gogoproto.stdtime) = true];
+}
+
+message PeerAddressInfo {
+ string address = 1;
+ google.protobuf.Timestamp last_dial_success = 2 [(gogoproto.stdtime) = true];
+ google.protobuf.Timestamp last_dial_failure = 3 [(gogoproto.stdtime) = true];
+ uint32 dial_failures = 4;
+}
diff --git a/examples/authz/proto/tendermint/types/block.proto b/examples/authz/proto/tendermint/types/block.proto
new file mode 100644
index 00000000..84e9bb15
--- /dev/null
+++ b/examples/authz/proto/tendermint/types/block.proto
@@ -0,0 +1,15 @@
+syntax = "proto3";
+package tendermint.types;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
+
+import "gogoproto/gogo.proto";
+import "tendermint/types/types.proto";
+import "tendermint/types/evidence.proto";
+
+message Block {
+ Header header = 1 [(gogoproto.nullable) = false];
+ Data data = 2 [(gogoproto.nullable) = false];
+ tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false];
+ Commit last_commit = 4;
+}
diff --git a/examples/authz/proto/tendermint/types/evidence.proto b/examples/authz/proto/tendermint/types/evidence.proto
new file mode 100644
index 00000000..d9548a43
--- /dev/null
+++ b/examples/authz/proto/tendermint/types/evidence.proto
@@ -0,0 +1,38 @@
+syntax = "proto3";
+package tendermint.types;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "tendermint/types/types.proto";
+import "tendermint/types/validator.proto";
+
+message Evidence {
+ oneof sum {
+ DuplicateVoteEvidence duplicate_vote_evidence = 1;
+ LightClientAttackEvidence light_client_attack_evidence = 2;
+ }
+}
+
+// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
+message DuplicateVoteEvidence {
+ tendermint.types.Vote vote_a = 1;
+ tendermint.types.Vote vote_b = 2;
+ int64 total_voting_power = 3;
+ int64 validator_power = 4;
+ google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
+
+// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client.
+message LightClientAttackEvidence {
+ tendermint.types.LightBlock conflicting_block = 1;
+ int64 common_height = 2;
+ repeated tendermint.types.Validator byzantine_validators = 3;
+ int64 total_voting_power = 4;
+ google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+}
+
+message EvidenceList {
+ repeated Evidence evidence = 1 [(gogoproto.nullable) = false];
+}
diff --git a/examples/authz/proto/tendermint/types/params.proto b/examples/authz/proto/tendermint/types/params.proto
new file mode 100644
index 00000000..70789222
--- /dev/null
+++ b/examples/authz/proto/tendermint/types/params.proto
@@ -0,0 +1,79 @@
+syntax = "proto3";
+package tendermint.types;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/duration.proto";
+
+option (gogoproto.equal_all) = true;
+
+// ConsensusParams contains consensus critical parameters that determine the
+// validity of blocks.
+message ConsensusParams {
+ BlockParams block = 1 [(gogoproto.nullable) = false];
+ EvidenceParams evidence = 2 [(gogoproto.nullable) = false];
+ ValidatorParams validator = 3 [(gogoproto.nullable) = false];
+ VersionParams version = 4 [(gogoproto.nullable) = false];
+}
+
+// BlockParams contains limits on the block size.
+message BlockParams {
+ // Max block size, in bytes.
+ // Note: must be greater than 0
+ int64 max_bytes = 1;
+ // Max gas per block.
+ // Note: must be greater or equal to -1
+ int64 max_gas = 2;
+ // Minimum time increment between consecutive blocks (in milliseconds) If the
+ // block header timestamp is ahead of the system clock, decrease this value.
+ //
+ // Not exposed to the application.
+ int64 time_iota_ms = 3;
+}
+
+// EvidenceParams determine how we handle evidence of malfeasance.
+message EvidenceParams {
+ // Max age of evidence, in blocks.
+ //
+ // The basic formula for calculating this is: MaxAgeDuration / {average block
+ // time}.
+ int64 max_age_num_blocks = 1;
+
+ // Max age of evidence, in time.
+ //
+ // It should correspond with an app's "unbonding period" or other similar
+ // mechanism for handling [Nothing-At-Stake
+ // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
+ google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
+
+ // This sets the maximum size of total evidence in bytes that can be committed in a single block.
+ // and should fall comfortably under the max block bytes.
+ // Default is 1048576 or 1MB
+ int64 max_bytes = 3;
+}
+
+// ValidatorParams restrict the public key types validators can use.
+// NOTE: uses ABCI pubkey naming, not Amino names.
+message ValidatorParams {
+ option (gogoproto.populate) = true;
+ option (gogoproto.equal) = true;
+
+ repeated string pub_key_types = 1;
+}
+
+// VersionParams contains the ABCI application version.
+message VersionParams {
+ option (gogoproto.populate) = true;
+ option (gogoproto.equal) = true;
+
+ uint64 app_version = 1;
+}
+
+// HashedParams is a subset of ConsensusParams.
+//
+// It is hashed into the Header.ConsensusHash.
+message HashedParams {
+ int64 block_max_bytes = 1;
+ int64 block_max_gas = 2;
+}
diff --git a/examples/authz/proto/tendermint/types/types.proto b/examples/authz/proto/tendermint/types/types.proto
new file mode 100644
index 00000000..57efc33c
--- /dev/null
+++ b/examples/authz/proto/tendermint/types/types.proto
@@ -0,0 +1,153 @@
+syntax = "proto3";
+package tendermint.types;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
+
+import "gogoproto/gogo.proto";
+import "google/protobuf/timestamp.proto";
+import "tendermint/crypto/proof.proto";
+import "tendermint/version/types.proto";
+import "tendermint/types/validator.proto";
+
+// BlockIdFlag indicates which BlcokID the signature is for
+enum BlockIDFlag {
+ option (gogoproto.goproto_enum_stringer) = true;
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"];
+ BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"];
+ BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"];
+ BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"];
+}
+
+// SignedMsgType is a type of signed message in the consensus.
+enum SignedMsgType {
+ option (gogoproto.goproto_enum_stringer) = true;
+ option (gogoproto.goproto_enum_prefix) = false;
+
+ SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"];
+ // Votes
+ SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"];
+ SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"];
+
+ // Proposals
+ SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"];
+}
+
+// PartsetHeader
+message PartSetHeader {
+ uint32 total = 1;
+ bytes hash = 2;
+}
+
+message Part {
+ uint32 index = 1;
+ bytes bytes = 2;
+ tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false];
+}
+
+// BlockID
+message BlockID {
+ bytes hash = 1;
+ PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false];
+}
+
+// --------------------------------
+
+// Header defines the structure of a Tendermint block header.
+message Header {
+ // basic block info
+ tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false];
+ string chain_id = 2 [(gogoproto.customname) = "ChainID"];
+ int64 height = 3;
+ google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+
+ // prev block info
+ BlockID last_block_id = 5 [(gogoproto.nullable) = false];
+
+ // hashes of block data
+ bytes last_commit_hash = 6; // commit from validators from the last block
+ bytes data_hash = 7; // transactions
+
+ // hashes from the app output from the prev block
+ bytes validators_hash = 8; // validators for the current block
+ bytes next_validators_hash = 9; // validators for the next block
+ bytes consensus_hash = 10; // consensus params for current block
+ bytes app_hash = 11; // state after txs from the previous block
+ bytes last_results_hash = 12; // root hash of all results from the txs from the previous block
+
+ // consensus info
+ bytes evidence_hash = 13; // evidence included in the block
+ bytes proposer_address = 14; // original proposer of the block
+}
+
+// Data contains the set of transactions included in the block
+message Data {
+ // Txs that will be applied by state @ block.Height+1.
+ // NOTE: not all txs here are valid. We're just agreeing on the order first.
+ // This means that block.AppHash does not include these txs.
+ repeated bytes txs = 1;
+}
+
+// Vote represents a prevote, precommit, or commit vote from validators for
+// consensus.
+message Vote {
+ SignedMsgType type = 1;
+ int64 height = 2;
+ int32 round = 3;
+ BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil.
+ google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ bytes validator_address = 6;
+ int32 validator_index = 7;
+ bytes signature = 8;
+}
+
+// Commit contains the evidence that a block was committed by a set of validators.
+message Commit {
+ int64 height = 1;
+ int32 round = 2;
+ BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
+ repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
+}
+
+// CommitSig is a part of the Vote included in a Commit.
+message CommitSig {
+ BlockIDFlag block_id_flag = 1;
+ bytes validator_address = 2;
+ google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ bytes signature = 4;
+}
+
+message Proposal {
+ SignedMsgType type = 1;
+ int64 height = 2;
+ int32 round = 3;
+ int32 pol_round = 4;
+ BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
+ google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
+ bytes signature = 7;
+}
+
+message SignedHeader {
+ Header header = 1;
+ Commit commit = 2;
+}
+
+message LightBlock {
+ SignedHeader signed_header = 1;
+ tendermint.types.ValidatorSet validator_set = 2;
+}
+
+message BlockMeta {
+ BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
+ int64 block_size = 2;
+ Header header = 3 [(gogoproto.nullable) = false];
+ int64 num_txs = 4;
+}
+
+// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
+message TxProof {
+ bytes root_hash = 1;
+ bytes data = 2;
+ tendermint.crypto.Proof proof = 3;
+}
diff --git a/examples/authz/proto/tendermint/types/validator.proto b/examples/authz/proto/tendermint/types/validator.proto
new file mode 100644
index 00000000..49860b96
--- /dev/null
+++ b/examples/authz/proto/tendermint/types/validator.proto
@@ -0,0 +1,25 @@
+syntax = "proto3";
+package tendermint.types;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
+
+import "gogoproto/gogo.proto";
+import "tendermint/crypto/keys.proto";
+
+message ValidatorSet {
+ repeated Validator validators = 1;
+ Validator proposer = 2;
+ int64 total_voting_power = 3;
+}
+
+message Validator {
+ bytes address = 1;
+ tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false];
+ int64 voting_power = 3;
+ int64 proposer_priority = 4;
+}
+
+message SimpleValidator {
+ tendermint.crypto.PublicKey pub_key = 1;
+ int64 voting_power = 2;
+}
diff --git a/examples/authz/proto/tendermint/version/types.proto b/examples/authz/proto/tendermint/version/types.proto
new file mode 100644
index 00000000..6061868b
--- /dev/null
+++ b/examples/authz/proto/tendermint/version/types.proto
@@ -0,0 +1,24 @@
+syntax = "proto3";
+package tendermint.version;
+
+option go_package = "github.com/tendermint/tendermint/proto/tendermint/version";
+
+import "gogoproto/gogo.proto";
+
+// App includes the protocol and software version for the application.
+// This information is included in ResponseInfo. The App.Protocol can be
+// updated in ResponseEndBlock.
+message App {
+ uint64 protocol = 1;
+ string software = 2;
+}
+
+// Consensus captures the consensus rules for processing a block in the blockchain,
+// including all blockchain data structures and the rules of the application's
+// state transition machine.
+message Consensus {
+ option (gogoproto.equal) = true;
+
+ uint64 block = 1;
+ uint64 app = 2;
+}
diff --git a/examples/authz/public/image/favicon.ico b/examples/authz/public/image/favicon.ico
new file mode 100644
index 00000000..d7b1d76a
Binary files /dev/null and b/examples/authz/public/image/favicon.ico differ
diff --git a/examples/authz/scripts/codegen.js b/examples/authz/scripts/codegen.js
new file mode 100644
index 00000000..c2d5c1b9
--- /dev/null
+++ b/examples/authz/scripts/codegen.js
@@ -0,0 +1,172 @@
+const { join, resolve } = require('path');
+const telescope = require('@cosmology/telescope').default;
+
+const protoDirs = [join(__dirname, '/../proto')];
+
+telescope({
+ protoDirs,
+ outPath: join(__dirname, '../src/codegen'),
+ options: {
+ env: 'v-next',
+ removeUnusedImports: false,
+ classesUseArrowFunctions: true,
+
+ tsDisable: {
+ disableAll: true
+ },
+ interfaces: {
+ enabled: true,
+ useGlobalDecoderRegistry: true,
+ registerAllDecodersToGlobal: false,
+ useUnionTypes: true
+ },
+
+ prototypes: {
+ enabled: true,
+ addTypeUrlToObjects: true,
+ addTypeUrlToDecoders: true,
+ addAminoTypeToObjects: true,
+ excluded: {
+ packages: ['google.api.**', 'google.logging.**', 'google.protobuf.**']
+ },
+ parser: {
+ keepCase: false
+ },
+ methods: {
+ encode: true,
+ decode: true,
+ fromJSON: true,
+ toJSON: true,
+ fromPartial: true,
+ toSDK: true,
+ fromSDK: true,
+ toAmino: true,
+ fromAmino: true,
+ toProto: true,
+ fromProto: true
+ },
+ strictNullCheckForPrototypeMethods: true,
+ paginationDefaultFromPartial: true,
+ includePackageVar: true,
+ fieldDefaultIsOptional: false,
+ useOptionalNullable: true,
+ allowUndefinedTypes: false,
+ allowEncodeDefaultScalars: true,
+ typingsFormat: {
+ customTypes: {
+ useCosmosSDKDec: true
+ },
+ num64: 'bigint',
+ useDeepPartial: true,
+ useExact: false,
+ timestamp: 'date',
+ duration: 'duration',
+ useTelescopeGeneratedType: true
+ }
+ },
+
+ bundle: {
+ enabled: true
+ },
+
+ stargateClients: {
+ enabled: true,
+ includeCosmosDefaultTypes: true,
+ addGetTxRpc: true
+ },
+
+ aggregatedLCD: {
+ dir: 'osmosis',
+ filename: 'agg-lcd.ts',
+ packages: ['cosmos.bank.v1beta1', 'osmosis.gamm.v1beta1'],
+ addToBundle: true
+ },
+
+ lcdClients: {
+ enabled: true,
+ scopedIsExclusive: false,
+ scoped: [
+ {
+ dir: 'osmosis',
+ filename: 'custom-lcd-client.ts',
+ packages: [
+ 'cosmos.bank.v1beta1',
+ 'cosmos.gov.v1beta1',
+ 'osmosis.gamm.v1beta1'
+ ],
+ addToBundle: true,
+ methodName: 'createCustomLCDClient'
+ },
+ {
+ dir: 'evmos',
+ filename: 'custom-lcd-client.ts',
+ packages: [
+ 'cosmos.bank.v1beta1',
+ 'cosmos.gov.v1beta1',
+ 'evmos.erc20.v1'
+ ],
+ addToBundle: true,
+ methodName: 'createEvmosLCDClient'
+ }
+ ]
+ },
+
+ rpcClients: {
+ enabled: true,
+ extensions: true,
+ camelCase: true,
+ scopedIsExclusive: false,
+ useConnectComet: true,
+ scoped: [
+ {
+ dir: 'cosmos',
+ filename: 'cosmos-rpc-client.ts',
+ packages: ['cosmos.bank.v1beta1', 'cosmos.gov.v1beta1'],
+ addToBundle: true,
+ methodNameQuery: 'createCosmicRPCQueryClient',
+ methodNameTx: 'createCosmicRPCTxClient'
+ },
+ {
+ dir: 'evmos',
+ filename: 'evmos-rpc-client.ts',
+ packages: [
+ 'cosmos.bank.v1beta1',
+ 'cosmos.gov.v1beta1',
+ 'evmos.erc20.v1'
+ ],
+ addToBundle: true,
+ methodNameQuery: 'createEvmosRPCQueryClient',
+ methodNameTx: 'createEvmosRPCTxClient'
+ }
+ ],
+ serviceImplement: {
+ Msg: {
+ type: 'Tx'
+ }
+ },
+ enabledServices: [
+ 'Msg',
+ 'Query',
+ 'Service',
+ 'ReflectionService',
+ 'ABCIApplication'
+ ]
+ },
+
+ helperFuncCreators: {
+ enabled: true,
+ useGlobalDecoderRegistry: true,
+ genCustomHooks: true
+ },
+
+ aminoEncoding: {
+ enabled: true
+ }
+ },
+})
+ .then(() => {
+ console.log('✨ all done!');
+ })
+ .catch((e) => {
+ console.error(e);
+ });
diff --git a/examples/authz/styles/custom.module.css b/examples/authz/styles/custom.module.css
new file mode 100644
index 00000000..afe9c65b
--- /dev/null
+++ b/examples/authz/styles/custom.module.css
@@ -0,0 +1,16 @@
+.customInput {
+ background-color: #eef2f8;
+}
+
+.containerSm,
+.listItem {
+ width: 640px;
+}
+
+.listItem {
+ background-color: #eef2f8;
+}
+
+.listItem:hover {
+ background-color: #dde4ed;
+}
diff --git a/examples/authz/tsconfig.json b/examples/authz/tsconfig.json
new file mode 100644
index 00000000..b9f87464
--- /dev/null
+++ b/examples/authz/tsconfig.json
@@ -0,0 +1,40 @@
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "baseUrl": ".",
+ "paths": {
+ "@/*": [
+ "*"
+ ],
+ "react": [
+ "./node_modules/@types/react"
+ ]
+ }
+ },
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx"
+ ],
+ "exclude": [
+ "node_modules",
+ "src/codegen/**/*.ts"
+ ]
+}
\ No newline at end of file
diff --git a/examples/authz/types/codegen/binary.d.ts b/examples/authz/types/codegen/binary.d.ts
new file mode 100644
index 00000000..16d16295
--- /dev/null
+++ b/examples/authz/types/codegen/binary.d.ts
@@ -0,0 +1,130 @@
+/**
+* This file and any referenced files were automatically generated by @cosmology/telescope@1.3.2
+* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
+* and run the transpile command or yarn proto command to regenerate this bundle.
+*/
+export declare enum WireType {
+ Varint = 0,
+ Fixed64 = 1,
+ Bytes = 2,
+ Fixed32 = 5
+}
+export interface IBinaryReader {
+ buf: Uint8Array;
+ pos: number;
+ type: number;
+ len: number;
+ tag(): [number, WireType, number];
+ skip(length?: number): this;
+ skipType(wireType: number): this;
+ uint32(): number;
+ int32(): number;
+ sint32(): number;
+ fixed32(): number;
+ sfixed32(): number;
+ int64(): bigint;
+ uint64(): bigint;
+ sint64(): bigint;
+ fixed64(): bigint;
+ sfixed64(): bigint;
+ float(): number;
+ double(): number;
+ bool(): boolean;
+ bytes(): Uint8Array;
+ string(): string;
+}
+export declare class BinaryReader implements IBinaryReader {
+ buf: Uint8Array;
+ pos: number;
+ type: number;
+ len: number;
+ assertBounds(): void;
+ constructor(buf?: ArrayLike);
+ tag(): [number, WireType, number];
+ skip(length?: number): this;
+ skipType(wireType: number): this;
+ uint32(): number;
+ int32(): number;
+ sint32(): number;
+ fixed32(): number;
+ sfixed32(): number;
+ int64(): bigint;
+ uint64(): bigint;
+ sint64(): bigint;
+ fixed64(): bigint;
+ sfixed64(): bigint;
+ float(): number;
+ double(): number;
+ bool(): boolean;
+ bytes(): Uint8Array;
+ string(): string;
+}
+export interface IBinaryWriter {
+ len: number;
+ head: IOp;
+ tail: IOp;
+ states: State | null;
+ finish(): Uint8Array;
+ fork(): IBinaryWriter;
+ reset(): IBinaryWriter;
+ ldelim(): IBinaryWriter;
+ tag(fieldNo: number, type: WireType): IBinaryWriter;
+ uint32(value: number): IBinaryWriter;
+ int32(value: number): IBinaryWriter;
+ sint32(value: number): IBinaryWriter;
+ int64(value: string | number | bigint): IBinaryWriter;
+ uint64: (value: string | number | bigint) => IBinaryWriter;
+ sint64(value: string | number | bigint): IBinaryWriter;
+ fixed64(value: string | number | bigint): IBinaryWriter;
+ sfixed64: (value: string | number | bigint) => IBinaryWriter;
+ bool(value: boolean): IBinaryWriter;
+ fixed32(value: number): IBinaryWriter;
+ sfixed32: (value: number) => IBinaryWriter;
+ float(value: number): IBinaryWriter;
+ double(value: number): IBinaryWriter;
+ bytes(value: Uint8Array): IBinaryWriter;
+ string(value: string): IBinaryWriter;
+}
+interface IOp {
+ len: number;
+ next?: IOp;
+ proceed(buf: Uint8Array | number[], pos: number): void;
+}
+declare class State {
+ head: IOp;
+ tail: IOp;
+ len: number;
+ next: State | null;
+ constructor(writer: BinaryWriter);
+}
+export declare class BinaryWriter implements IBinaryWriter {
+ len: number;
+ head: IOp;
+ tail: IOp;
+ states: State | null;
+ constructor();
+ static create(): BinaryWriter;
+ static alloc(size: number): Uint8Array | number[];
+ private _push;
+ finish(): Uint8Array;
+ fork(): BinaryWriter;
+ reset(): BinaryWriter;
+ ldelim(): BinaryWriter;
+ tag(fieldNo: number, type: WireType): BinaryWriter;
+ uint32(value: number): BinaryWriter;
+ int32(value: number): BinaryWriter;
+ sint32(value: number): BinaryWriter;
+ int64(value: string | number | bigint): BinaryWriter;
+ uint64: (value: string | number | bigint) => BinaryWriter;
+ sint64(value: string | number | bigint): BinaryWriter;
+ fixed64(value: string | number | bigint): BinaryWriter;
+ sfixed64: (value: string | number | bigint) => BinaryWriter;
+ bool(value: boolean): BinaryWriter;
+ fixed32(value: number): BinaryWriter;
+ sfixed32: (value: number) => BinaryWriter;
+ float(value: number): BinaryWriter;
+ double(value: number): BinaryWriter;
+ bytes(value: Uint8Array): BinaryWriter;
+ string(value: string): BinaryWriter;
+}
+export {};
diff --git a/examples/authz/types/codegen/confio/proofs.d.ts b/examples/authz/types/codegen/confio/proofs.d.ts
new file mode 100644
index 00000000..ac542047
--- /dev/null
+++ b/examples/authz/types/codegen/confio/proofs.d.ts
@@ -0,0 +1,901 @@
+import { BinaryReader, BinaryWriter } from "../binary";
+import { DeepPartial } from "../helpers";
+export declare enum HashOp {
+ /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */
+ NO_HASH = 0,
+ SHA256 = 1,
+ SHA512 = 2,
+ KECCAK = 3,
+ RIPEMD160 = 4,
+ /** BITCOIN - ripemd160(sha256(x)) */
+ BITCOIN = 5,
+ UNRECOGNIZED = -1
+}
+export declare const HashOpSDKType: typeof HashOp;
+export declare const HashOpAmino: typeof HashOp;
+export declare function hashOpFromJSON(object: any): HashOp;
+export declare function hashOpToJSON(object: HashOp): string;
+/**
+ * LengthOp defines how to process the key and value of the LeafOp
+ * to include length information. After encoding the length with the given
+ * algorithm, the length will be prepended to the key and value bytes.
+ * (Each one with it's own encoded length)
+ */
+export declare enum LengthOp {
+ /** NO_PREFIX - NO_PREFIX don't include any length info */
+ NO_PREFIX = 0,
+ /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */
+ VAR_PROTO = 1,
+ /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */
+ VAR_RLP = 2,
+ /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */
+ FIXED32_BIG = 3,
+ /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */
+ FIXED32_LITTLE = 4,
+ /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */
+ FIXED64_BIG = 5,
+ /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */
+ FIXED64_LITTLE = 6,
+ /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */
+ REQUIRE_32_BYTES = 7,
+ /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */
+ REQUIRE_64_BYTES = 8,
+ UNRECOGNIZED = -1
+}
+export declare const LengthOpSDKType: typeof LengthOp;
+export declare const LengthOpAmino: typeof LengthOp;
+export declare function lengthOpFromJSON(object: any): LengthOp;
+export declare function lengthOpToJSON(object: LengthOp): string;
+/**
+ * ExistenceProof takes a key and a value and a set of steps to perform on it.
+ * The result of peforming all these steps will provide a "root hash", which can
+ * be compared to the value in a header.
+ *
+ * Since it is computationally infeasible to produce a hash collission for any of the used
+ * cryptographic hash functions, if someone can provide a series of operations to transform
+ * a given key and value into a root hash that matches some trusted root, these key and values
+ * must be in the referenced merkle tree.
+ *
+ * The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+ * which should be controlled by a spec. Eg. with lengthOp as NONE,
+ * prefix = FOO, key = BAR, value = CHOICE
+ * and
+ * prefix = F, key = OOBAR, value = CHOICE
+ * would produce the same value.
+ *
+ * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+ * in the ProofSpec is valuable to prevent this mutability. And why all trees should
+ * length-prefix the data before hashing it.
+ */
+export interface ExistenceProof {
+ key: Uint8Array;
+ value: Uint8Array;
+ leaf?: LeafOp | undefined;
+ path: InnerOp[];
+}
+export interface ExistenceProofProtoMsg {
+ typeUrl: "/ics23.ExistenceProof";
+ value: Uint8Array;
+}
+/**
+ * ExistenceProof takes a key and a value and a set of steps to perform on it.
+ * The result of peforming all these steps will provide a "root hash", which can
+ * be compared to the value in a header.
+ *
+ * Since it is computationally infeasible to produce a hash collission for any of the used
+ * cryptographic hash functions, if someone can provide a series of operations to transform
+ * a given key and value into a root hash that matches some trusted root, these key and values
+ * must be in the referenced merkle tree.
+ *
+ * The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+ * which should be controlled by a spec. Eg. with lengthOp as NONE,
+ * prefix = FOO, key = BAR, value = CHOICE
+ * and
+ * prefix = F, key = OOBAR, value = CHOICE
+ * would produce the same value.
+ *
+ * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+ * in the ProofSpec is valuable to prevent this mutability. And why all trees should
+ * length-prefix the data before hashing it.
+ */
+export interface ExistenceProofAmino {
+ key?: string;
+ value?: string;
+ leaf?: LeafOpAmino | undefined;
+ path?: InnerOpAmino[];
+}
+export interface ExistenceProofAminoMsg {
+ type: "/ics23.ExistenceProof";
+ value: ExistenceProofAmino;
+}
+/**
+ * ExistenceProof takes a key and a value and a set of steps to perform on it.
+ * The result of peforming all these steps will provide a "root hash", which can
+ * be compared to the value in a header.
+ *
+ * Since it is computationally infeasible to produce a hash collission for any of the used
+ * cryptographic hash functions, if someone can provide a series of operations to transform
+ * a given key and value into a root hash that matches some trusted root, these key and values
+ * must be in the referenced merkle tree.
+ *
+ * The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
+ * which should be controlled by a spec. Eg. with lengthOp as NONE,
+ * prefix = FOO, key = BAR, value = CHOICE
+ * and
+ * prefix = F, key = OOBAR, value = CHOICE
+ * would produce the same value.
+ *
+ * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
+ * in the ProofSpec is valuable to prevent this mutability. And why all trees should
+ * length-prefix the data before hashing it.
+ */
+export interface ExistenceProofSDKType {
+ key: Uint8Array;
+ value: Uint8Array;
+ leaf?: LeafOpSDKType | undefined;
+ path: InnerOpSDKType[];
+}
+/**
+ * NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+ * one right of the desired key. If both proofs are valid AND they are neighbors,
+ * then there is no valid proof for the given key.
+ */
+export interface NonExistenceProof {
+ /** TODO: remove this as unnecessary??? we prove a range */
+ key: Uint8Array;
+ left?: ExistenceProof | undefined;
+ right?: ExistenceProof | undefined;
+}
+export interface NonExistenceProofProtoMsg {
+ typeUrl: "/ics23.NonExistenceProof";
+ value: Uint8Array;
+}
+/**
+ * NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+ * one right of the desired key. If both proofs are valid AND they are neighbors,
+ * then there is no valid proof for the given key.
+ */
+export interface NonExistenceProofAmino {
+ /** TODO: remove this as unnecessary??? we prove a range */
+ key?: string;
+ left?: ExistenceProofAmino | undefined;
+ right?: ExistenceProofAmino | undefined;
+}
+export interface NonExistenceProofAminoMsg {
+ type: "/ics23.NonExistenceProof";
+ value: NonExistenceProofAmino;
+}
+/**
+ * NonExistenceProof takes a proof of two neighbors, one left of the desired key,
+ * one right of the desired key. If both proofs are valid AND they are neighbors,
+ * then there is no valid proof for the given key.
+ */
+export interface NonExistenceProofSDKType {
+ key: Uint8Array;
+ left?: ExistenceProofSDKType | undefined;
+ right?: ExistenceProofSDKType | undefined;
+}
+/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */
+export interface CommitmentProof {
+ exist?: ExistenceProof | undefined;
+ nonexist?: NonExistenceProof | undefined;
+ batch?: BatchProof | undefined;
+ compressed?: CompressedBatchProof | undefined;
+}
+export interface CommitmentProofProtoMsg {
+ typeUrl: "/ics23.CommitmentProof";
+ value: Uint8Array;
+}
+/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */
+export interface CommitmentProofAmino {
+ exist?: ExistenceProofAmino | undefined;
+ nonexist?: NonExistenceProofAmino | undefined;
+ batch?: BatchProofAmino | undefined;
+ compressed?: CompressedBatchProofAmino | undefined;
+}
+export interface CommitmentProofAminoMsg {
+ type: "/ics23.CommitmentProof";
+ value: CommitmentProofAmino;
+}
+/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */
+export interface CommitmentProofSDKType {
+ exist?: ExistenceProofSDKType | undefined;
+ nonexist?: NonExistenceProofSDKType | undefined;
+ batch?: BatchProofSDKType | undefined;
+ compressed?: CompressedBatchProofSDKType | undefined;
+}
+/**
+ * LeafOp represents the raw key-value data we wish to prove, and
+ * must be flexible to represent the internal transformation from
+ * the original key-value pairs into the basis hash, for many existing
+ * merkle trees.
+ *
+ * key and value are passed in. So that the signature of this operation is:
+ * leafOp(key, value) -> output
+ *
+ * To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+ * hkey = prehashKey(key)
+ * hvalue = prehashValue(value)
+ *
+ * Then combine the bytes, and hash it
+ * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+ */
+export interface LeafOp {
+ hash: HashOp;
+ prehashKey: HashOp;
+ prehashValue: HashOp;
+ length: LengthOp;
+ /**
+ * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+ * a leaf node from an inner node.
+ */
+ prefix: Uint8Array;
+}
+export interface LeafOpProtoMsg {
+ typeUrl: "/ics23.LeafOp";
+ value: Uint8Array;
+}
+/**
+ * LeafOp represents the raw key-value data we wish to prove, and
+ * must be flexible to represent the internal transformation from
+ * the original key-value pairs into the basis hash, for many existing
+ * merkle trees.
+ *
+ * key and value are passed in. So that the signature of this operation is:
+ * leafOp(key, value) -> output
+ *
+ * To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+ * hkey = prehashKey(key)
+ * hvalue = prehashValue(value)
+ *
+ * Then combine the bytes, and hash it
+ * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+ */
+export interface LeafOpAmino {
+ hash?: HashOp;
+ prehash_key?: HashOp;
+ prehash_value?: HashOp;
+ length?: LengthOp;
+ /**
+ * prefix is a fixed bytes that may optionally be included at the beginning to differentiate
+ * a leaf node from an inner node.
+ */
+ prefix?: string;
+}
+export interface LeafOpAminoMsg {
+ type: "/ics23.LeafOp";
+ value: LeafOpAmino;
+}
+/**
+ * LeafOp represents the raw key-value data we wish to prove, and
+ * must be flexible to represent the internal transformation from
+ * the original key-value pairs into the basis hash, for many existing
+ * merkle trees.
+ *
+ * key and value are passed in. So that the signature of this operation is:
+ * leafOp(key, value) -> output
+ *
+ * To process this, first prehash the keys and values if needed (ANY means no hash in this case):
+ * hkey = prehashKey(key)
+ * hvalue = prehashValue(value)
+ *
+ * Then combine the bytes, and hash it
+ * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
+ */
+export interface LeafOpSDKType {
+ hash: HashOp;
+ prehash_key: HashOp;
+ prehash_value: HashOp;
+ length: LengthOp;
+ prefix: Uint8Array;
+}
+/**
+ * InnerOp represents a merkle-proof step that is not a leaf.
+ * It represents concatenating two children and hashing them to provide the next result.
+ *
+ * The result of the previous step is passed in, so the signature of this op is:
+ * innerOp(child) -> output
+ *
+ * The result of applying InnerOp should be:
+ * output = op.hash(op.prefix || child || op.suffix)
+ *
+ * where the || operator is concatenation of binary data,
+ * and child is the result of hashing all the tree below this step.
+ *
+ * Any special data, like prepending child with the length, or prepending the entire operation with
+ * some value to differentiate from leaf nodes, should be included in prefix and suffix.
+ * If either of prefix or suffix is empty, we just treat it as an empty string
+ */
+export interface InnerOp {
+ hash: HashOp;
+ prefix: Uint8Array;
+ suffix: Uint8Array;
+}
+export interface InnerOpProtoMsg {
+ typeUrl: "/ics23.InnerOp";
+ value: Uint8Array;
+}
+/**
+ * InnerOp represents a merkle-proof step that is not a leaf.
+ * It represents concatenating two children and hashing them to provide the next result.
+ *
+ * The result of the previous step is passed in, so the signature of this op is:
+ * innerOp(child) -> output
+ *
+ * The result of applying InnerOp should be:
+ * output = op.hash(op.prefix || child || op.suffix)
+ *
+ * where the || operator is concatenation of binary data,
+ * and child is the result of hashing all the tree below this step.
+ *
+ * Any special data, like prepending child with the length, or prepending the entire operation with
+ * some value to differentiate from leaf nodes, should be included in prefix and suffix.
+ * If either of prefix or suffix is empty, we just treat it as an empty string
+ */
+export interface InnerOpAmino {
+ hash?: HashOp;
+ prefix?: string;
+ suffix?: string;
+}
+export interface InnerOpAminoMsg {
+ type: "/ics23.InnerOp";
+ value: InnerOpAmino;
+}
+/**
+ * InnerOp represents a merkle-proof step that is not a leaf.
+ * It represents concatenating two children and hashing them to provide the next result.
+ *
+ * The result of the previous step is passed in, so the signature of this op is:
+ * innerOp(child) -> output
+ *
+ * The result of applying InnerOp should be:
+ * output = op.hash(op.prefix || child || op.suffix)
+ *
+ * where the || operator is concatenation of binary data,
+ * and child is the result of hashing all the tree below this step.
+ *
+ * Any special data, like prepending child with the length, or prepending the entire operation with
+ * some value to differentiate from leaf nodes, should be included in prefix and suffix.
+ * If either of prefix or suffix is empty, we just treat it as an empty string
+ */
+export interface InnerOpSDKType {
+ hash: HashOp;
+ prefix: Uint8Array;
+ suffix: Uint8Array;
+}
+/**
+ * ProofSpec defines what the expected parameters are for a given proof type.
+ * This can be stored in the client and used to validate any incoming proofs.
+ *
+ * verify(ProofSpec, Proof) -> Proof | Error
+ *
+ * As demonstrated in tests, if we don't fix the algorithm used to calculate the
+ * LeafHash for a given tree, there are many possible key-value pairs that can
+ * generate a given hash (by interpretting the preimage differently).
+ * We need this for proper security, requires client knows a priori what
+ * tree format server uses. But not in code, rather a configuration object.
+ */
+export interface ProofSpec {
+ /**
+ * any field in the ExistenceProof must be the same as in this spec.
+ * except Prefix, which is just the first bytes of prefix (spec can be longer)
+ */
+ leafSpec?: LeafOp | undefined;
+ innerSpec?: InnerSpec | undefined;
+ /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */
+ maxDepth: number;
+ /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */
+ minDepth: number;
+}
+export interface ProofSpecProtoMsg {
+ typeUrl: "/ics23.ProofSpec";
+ value: Uint8Array;
+}
+/**
+ * ProofSpec defines what the expected parameters are for a given proof type.
+ * This can be stored in the client and used to validate any incoming proofs.
+ *
+ * verify(ProofSpec, Proof) -> Proof | Error
+ *
+ * As demonstrated in tests, if we don't fix the algorithm used to calculate the
+ * LeafHash for a given tree, there are many possible key-value pairs that can
+ * generate a given hash (by interpretting the preimage differently).
+ * We need this for proper security, requires client knows a priori what
+ * tree format server uses. But not in code, rather a configuration object.
+ */
+export interface ProofSpecAmino {
+ /**
+ * any field in the ExistenceProof must be the same as in this spec.
+ * except Prefix, which is just the first bytes of prefix (spec can be longer)
+ */
+ leaf_spec?: LeafOpAmino | undefined;
+ inner_spec?: InnerSpecAmino | undefined;
+ /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */
+ max_depth?: number;
+ /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */
+ min_depth?: number;
+}
+export interface ProofSpecAminoMsg {
+ type: "/ics23.ProofSpec";
+ value: ProofSpecAmino;
+}
+/**
+ * ProofSpec defines what the expected parameters are for a given proof type.
+ * This can be stored in the client and used to validate any incoming proofs.
+ *
+ * verify(ProofSpec, Proof) -> Proof | Error
+ *
+ * As demonstrated in tests, if we don't fix the algorithm used to calculate the
+ * LeafHash for a given tree, there are many possible key-value pairs that can
+ * generate a given hash (by interpretting the preimage differently).
+ * We need this for proper security, requires client knows a priori what
+ * tree format server uses. But not in code, rather a configuration object.
+ */
+export interface ProofSpecSDKType {
+ leaf_spec?: LeafOpSDKType | undefined;
+ inner_spec?: InnerSpecSDKType | undefined;
+ max_depth: number;
+ min_depth: number;
+}
+/**
+ * InnerSpec contains all store-specific structure info to determine if two proofs from a
+ * given store are neighbors.
+ *
+ * This enables:
+ *
+ * isLeftMost(spec: InnerSpec, op: InnerOp)
+ * isRightMost(spec: InnerSpec, op: InnerOp)
+ * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+ */
+export interface InnerSpec {
+ /**
+ * Child order is the ordering of the children node, must count from 0
+ * iavl tree is [0, 1] (left then right)
+ * merk is [0, 2, 1] (left, right, here)
+ */
+ childOrder: number[];
+ childSize: number;
+ minPrefixLength: number;
+ maxPrefixLength: number;
+ /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */
+ emptyChild: Uint8Array;
+ /** hash is the algorithm that must be used for each InnerOp */
+ hash: HashOp;
+}
+export interface InnerSpecProtoMsg {
+ typeUrl: "/ics23.InnerSpec";
+ value: Uint8Array;
+}
+/**
+ * InnerSpec contains all store-specific structure info to determine if two proofs from a
+ * given store are neighbors.
+ *
+ * This enables:
+ *
+ * isLeftMost(spec: InnerSpec, op: InnerOp)
+ * isRightMost(spec: InnerSpec, op: InnerOp)
+ * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+ */
+export interface InnerSpecAmino {
+ /**
+ * Child order is the ordering of the children node, must count from 0
+ * iavl tree is [0, 1] (left then right)
+ * merk is [0, 2, 1] (left, right, here)
+ */
+ child_order?: number[];
+ child_size?: number;
+ min_prefix_length?: number;
+ max_prefix_length?: number;
+ /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */
+ empty_child?: string;
+ /** hash is the algorithm that must be used for each InnerOp */
+ hash?: HashOp;
+}
+export interface InnerSpecAminoMsg {
+ type: "/ics23.InnerSpec";
+ value: InnerSpecAmino;
+}
+/**
+ * InnerSpec contains all store-specific structure info to determine if two proofs from a
+ * given store are neighbors.
+ *
+ * This enables:
+ *
+ * isLeftMost(spec: InnerSpec, op: InnerOp)
+ * isRightMost(spec: InnerSpec, op: InnerOp)
+ * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
+ */
+export interface InnerSpecSDKType {
+ child_order: number[];
+ child_size: number;
+ min_prefix_length: number;
+ max_prefix_length: number;
+ empty_child: Uint8Array;
+ hash: HashOp;
+}
+/** BatchProof is a group of multiple proof types than can be compressed */
+export interface BatchProof {
+ entries: BatchEntry[];
+}
+export interface BatchProofProtoMsg {
+ typeUrl: "/ics23.BatchProof";
+ value: Uint8Array;
+}
+/** BatchProof is a group of multiple proof types than can be compressed */
+export interface BatchProofAmino {
+ entries?: BatchEntryAmino[];
+}
+export interface BatchProofAminoMsg {
+ type: "/ics23.BatchProof";
+ value: BatchProofAmino;
+}
+/** BatchProof is a group of multiple proof types than can be compressed */
+export interface BatchProofSDKType {
+ entries: BatchEntrySDKType[];
+}
+/** Use BatchEntry not CommitmentProof, to avoid recursion */
+export interface BatchEntry {
+ exist?: ExistenceProof | undefined;
+ nonexist?: NonExistenceProof | undefined;
+}
+export interface BatchEntryProtoMsg {
+ typeUrl: "/ics23.BatchEntry";
+ value: Uint8Array;
+}
+/** Use BatchEntry not CommitmentProof, to avoid recursion */
+export interface BatchEntryAmino {
+ exist?: ExistenceProofAmino | undefined;
+ nonexist?: NonExistenceProofAmino | undefined;
+}
+export interface BatchEntryAminoMsg {
+ type: "/ics23.BatchEntry";
+ value: BatchEntryAmino;
+}
+/** Use BatchEntry not CommitmentProof, to avoid recursion */
+export interface BatchEntrySDKType {
+ exist?: ExistenceProofSDKType | undefined;
+ nonexist?: NonExistenceProofSDKType | undefined;
+}
+export interface CompressedBatchProof {
+ entries: CompressedBatchEntry[];
+ lookupInners: InnerOp[];
+}
+export interface CompressedBatchProofProtoMsg {
+ typeUrl: "/ics23.CompressedBatchProof";
+ value: Uint8Array;
+}
+export interface CompressedBatchProofAmino {
+ entries?: CompressedBatchEntryAmino[];
+ lookup_inners?: InnerOpAmino[];
+}
+export interface CompressedBatchProofAminoMsg {
+ type: "/ics23.CompressedBatchProof";
+ value: CompressedBatchProofAmino;
+}
+export interface CompressedBatchProofSDKType {
+ entries: CompressedBatchEntrySDKType[];
+ lookup_inners: InnerOpSDKType[];
+}
+/** Use BatchEntry not CommitmentProof, to avoid recursion */
+export interface CompressedBatchEntry {
+ exist?: CompressedExistenceProof | undefined;
+ nonexist?: CompressedNonExistenceProof | undefined;
+}
+export interface CompressedBatchEntryProtoMsg {
+ typeUrl: "/ics23.CompressedBatchEntry";
+ value: Uint8Array;
+}
+/** Use BatchEntry not CommitmentProof, to avoid recursion */
+export interface CompressedBatchEntryAmino {
+ exist?: CompressedExistenceProofAmino | undefined;
+ nonexist?: CompressedNonExistenceProofAmino | undefined;
+}
+export interface CompressedBatchEntryAminoMsg {
+ type: "/ics23.CompressedBatchEntry";
+ value: CompressedBatchEntryAmino;
+}
+/** Use BatchEntry not CommitmentProof, to avoid recursion */
+export interface CompressedBatchEntrySDKType {
+ exist?: CompressedExistenceProofSDKType | undefined;
+ nonexist?: CompressedNonExistenceProofSDKType | undefined;
+}
+export interface CompressedExistenceProof {
+ key: Uint8Array;
+ value: Uint8Array;
+ leaf?: LeafOp | undefined;
+ /** these are indexes into the lookup_inners table in CompressedBatchProof */
+ path: number[];
+}
+export interface CompressedExistenceProofProtoMsg {
+ typeUrl: "/ics23.CompressedExistenceProof";
+ value: Uint8Array;
+}
+export interface CompressedExistenceProofAmino {
+ key?: string;
+ value?: string;
+ leaf?: LeafOpAmino | undefined;
+ /** these are indexes into the lookup_inners table in CompressedBatchProof */
+ path?: number[];
+}
+export interface CompressedExistenceProofAminoMsg {
+ type: "/ics23.CompressedExistenceProof";
+ value: CompressedExistenceProofAmino;
+}
+export interface CompressedExistenceProofSDKType {
+ key: Uint8Array;
+ value: Uint8Array;
+ leaf?: LeafOpSDKType | undefined;
+ path: number[];
+}
+export interface CompressedNonExistenceProof {
+ /** TODO: remove this as unnecessary??? we prove a range */
+ key: Uint8Array;
+ left?: CompressedExistenceProof | undefined;
+ right?: CompressedExistenceProof | undefined;
+}
+export interface CompressedNonExistenceProofProtoMsg {
+ typeUrl: "/ics23.CompressedNonExistenceProof";
+ value: Uint8Array;
+}
+export interface CompressedNonExistenceProofAmino {
+ /** TODO: remove this as unnecessary??? we prove a range */
+ key?: string;
+ left?: CompressedExistenceProofAmino | undefined;
+ right?: CompressedExistenceProofAmino | undefined;
+}
+export interface CompressedNonExistenceProofAminoMsg {
+ type: "/ics23.CompressedNonExistenceProof";
+ value: CompressedNonExistenceProofAmino;
+}
+export interface CompressedNonExistenceProofSDKType {
+ key: Uint8Array;
+ left?: CompressedExistenceProofSDKType | undefined;
+ right?: CompressedExistenceProofSDKType | undefined;
+}
+export declare const ExistenceProof: {
+ typeUrl: string;
+ is(o: any): o is ExistenceProof;
+ isSDK(o: any): o is ExistenceProofSDKType;
+ isAmino(o: any): o is ExistenceProofAmino;
+ encode(message: ExistenceProof, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): ExistenceProof;
+ fromJSON(object: any): ExistenceProof;
+ toJSON(message: ExistenceProof): unknown;
+ fromPartial(object: DeepPartial): ExistenceProof;
+ fromSDK(object: ExistenceProofSDKType): ExistenceProof;
+ toSDK(message: ExistenceProof): ExistenceProofSDKType;
+ fromAmino(object: ExistenceProofAmino): ExistenceProof;
+ toAmino(message: ExistenceProof): ExistenceProofAmino;
+ fromAminoMsg(object: ExistenceProofAminoMsg): ExistenceProof;
+ fromProtoMsg(message: ExistenceProofProtoMsg): ExistenceProof;
+ toProto(message: ExistenceProof): Uint8Array;
+ toProtoMsg(message: ExistenceProof): ExistenceProofProtoMsg;
+};
+export declare const NonExistenceProof: {
+ typeUrl: string;
+ is(o: any): o is NonExistenceProof;
+ isSDK(o: any): o is NonExistenceProofSDKType;
+ isAmino(o: any): o is NonExistenceProofAmino;
+ encode(message: NonExistenceProof, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): NonExistenceProof;
+ fromJSON(object: any): NonExistenceProof;
+ toJSON(message: NonExistenceProof): unknown;
+ fromPartial(object: DeepPartial): NonExistenceProof;
+ fromSDK(object: NonExistenceProofSDKType): NonExistenceProof;
+ toSDK(message: NonExistenceProof): NonExistenceProofSDKType;
+ fromAmino(object: NonExistenceProofAmino): NonExistenceProof;
+ toAmino(message: NonExistenceProof): NonExistenceProofAmino;
+ fromAminoMsg(object: NonExistenceProofAminoMsg): NonExistenceProof;
+ fromProtoMsg(message: NonExistenceProofProtoMsg): NonExistenceProof;
+ toProto(message: NonExistenceProof): Uint8Array;
+ toProtoMsg(message: NonExistenceProof): NonExistenceProofProtoMsg;
+};
+export declare const CommitmentProof: {
+ typeUrl: string;
+ is(o: any): o is CommitmentProof;
+ isSDK(o: any): o is CommitmentProofSDKType;
+ isAmino(o: any): o is CommitmentProofAmino;
+ encode(message: CommitmentProof, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): CommitmentProof;
+ fromJSON(object: any): CommitmentProof;
+ toJSON(message: CommitmentProof): unknown;
+ fromPartial(object: DeepPartial): CommitmentProof;
+ fromSDK(object: CommitmentProofSDKType): CommitmentProof;
+ toSDK(message: CommitmentProof): CommitmentProofSDKType;
+ fromAmino(object: CommitmentProofAmino): CommitmentProof;
+ toAmino(message: CommitmentProof): CommitmentProofAmino;
+ fromAminoMsg(object: CommitmentProofAminoMsg): CommitmentProof;
+ fromProtoMsg(message: CommitmentProofProtoMsg): CommitmentProof;
+ toProto(message: CommitmentProof): Uint8Array;
+ toProtoMsg(message: CommitmentProof): CommitmentProofProtoMsg;
+};
+export declare const LeafOp: {
+ typeUrl: string;
+ is(o: any): o is LeafOp;
+ isSDK(o: any): o is LeafOpSDKType;
+ isAmino(o: any): o is LeafOpAmino;
+ encode(message: LeafOp, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): LeafOp;
+ fromJSON(object: any): LeafOp;
+ toJSON(message: LeafOp): unknown;
+ fromPartial(object: DeepPartial): LeafOp;
+ fromSDK(object: LeafOpSDKType): LeafOp;
+ toSDK(message: LeafOp): LeafOpSDKType;
+ fromAmino(object: LeafOpAmino): LeafOp;
+ toAmino(message: LeafOp): LeafOpAmino;
+ fromAminoMsg(object: LeafOpAminoMsg): LeafOp;
+ fromProtoMsg(message: LeafOpProtoMsg): LeafOp;
+ toProto(message: LeafOp): Uint8Array;
+ toProtoMsg(message: LeafOp): LeafOpProtoMsg;
+};
+export declare const InnerOp: {
+ typeUrl: string;
+ is(o: any): o is InnerOp;
+ isSDK(o: any): o is InnerOpSDKType;
+ isAmino(o: any): o is InnerOpAmino;
+ encode(message: InnerOp, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): InnerOp;
+ fromJSON(object: any): InnerOp;
+ toJSON(message: InnerOp): unknown;
+ fromPartial(object: DeepPartial): InnerOp;
+ fromSDK(object: InnerOpSDKType): InnerOp;
+ toSDK(message: InnerOp): InnerOpSDKType;
+ fromAmino(object: InnerOpAmino): InnerOp;
+ toAmino(message: InnerOp): InnerOpAmino;
+ fromAminoMsg(object: InnerOpAminoMsg): InnerOp;
+ fromProtoMsg(message: InnerOpProtoMsg): InnerOp;
+ toProto(message: InnerOp): Uint8Array;
+ toProtoMsg(message: InnerOp): InnerOpProtoMsg;
+};
+export declare const ProofSpec: {
+ typeUrl: string;
+ is(o: any): o is ProofSpec;
+ isSDK(o: any): o is ProofSpecSDKType;
+ isAmino(o: any): o is ProofSpecAmino;
+ encode(message: ProofSpec, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): ProofSpec;
+ fromJSON(object: any): ProofSpec;
+ toJSON(message: ProofSpec): unknown;
+ fromPartial(object: DeepPartial): ProofSpec;
+ fromSDK(object: ProofSpecSDKType): ProofSpec;
+ toSDK(message: ProofSpec): ProofSpecSDKType;
+ fromAmino(object: ProofSpecAmino): ProofSpec;
+ toAmino(message: ProofSpec): ProofSpecAmino;
+ fromAminoMsg(object: ProofSpecAminoMsg): ProofSpec;
+ fromProtoMsg(message: ProofSpecProtoMsg): ProofSpec;
+ toProto(message: ProofSpec): Uint8Array;
+ toProtoMsg(message: ProofSpec): ProofSpecProtoMsg;
+};
+export declare const InnerSpec: {
+ typeUrl: string;
+ is(o: any): o is InnerSpec;
+ isSDK(o: any): o is InnerSpecSDKType;
+ isAmino(o: any): o is InnerSpecAmino;
+ encode(message: InnerSpec, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): InnerSpec;
+ fromJSON(object: any): InnerSpec;
+ toJSON(message: InnerSpec): unknown;
+ fromPartial(object: DeepPartial): InnerSpec;
+ fromSDK(object: InnerSpecSDKType): InnerSpec;
+ toSDK(message: InnerSpec): InnerSpecSDKType;
+ fromAmino(object: InnerSpecAmino): InnerSpec;
+ toAmino(message: InnerSpec): InnerSpecAmino;
+ fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec;
+ fromProtoMsg(message: InnerSpecProtoMsg): InnerSpec;
+ toProto(message: InnerSpec): Uint8Array;
+ toProtoMsg(message: InnerSpec): InnerSpecProtoMsg;
+};
+export declare const BatchProof: {
+ typeUrl: string;
+ is(o: any): o is BatchProof;
+ isSDK(o: any): o is BatchProofSDKType;
+ isAmino(o: any): o is BatchProofAmino;
+ encode(message: BatchProof, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): BatchProof;
+ fromJSON(object: any): BatchProof;
+ toJSON(message: BatchProof): unknown;
+ fromPartial(object: DeepPartial): BatchProof;
+ fromSDK(object: BatchProofSDKType): BatchProof;
+ toSDK(message: BatchProof): BatchProofSDKType;
+ fromAmino(object: BatchProofAmino): BatchProof;
+ toAmino(message: BatchProof): BatchProofAmino;
+ fromAminoMsg(object: BatchProofAminoMsg): BatchProof;
+ fromProtoMsg(message: BatchProofProtoMsg): BatchProof;
+ toProto(message: BatchProof): Uint8Array;
+ toProtoMsg(message: BatchProof): BatchProofProtoMsg;
+};
+export declare const BatchEntry: {
+ typeUrl: string;
+ is(o: any): o is BatchEntry;
+ isSDK(o: any): o is BatchEntrySDKType;
+ isAmino(o: any): o is BatchEntryAmino;
+ encode(message: BatchEntry, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): BatchEntry;
+ fromJSON(object: any): BatchEntry;
+ toJSON(message: BatchEntry): unknown;
+ fromPartial(object: DeepPartial): BatchEntry;
+ fromSDK(object: BatchEntrySDKType): BatchEntry;
+ toSDK(message: BatchEntry): BatchEntrySDKType;
+ fromAmino(object: BatchEntryAmino): BatchEntry;
+ toAmino(message: BatchEntry): BatchEntryAmino;
+ fromAminoMsg(object: BatchEntryAminoMsg): BatchEntry;
+ fromProtoMsg(message: BatchEntryProtoMsg): BatchEntry;
+ toProto(message: BatchEntry): Uint8Array;
+ toProtoMsg(message: BatchEntry): BatchEntryProtoMsg;
+};
+export declare const CompressedBatchProof: {
+ typeUrl: string;
+ is(o: any): o is CompressedBatchProof;
+ isSDK(o: any): o is CompressedBatchProofSDKType;
+ isAmino(o: any): o is CompressedBatchProofAmino;
+ encode(message: CompressedBatchProof, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchProof;
+ fromJSON(object: any): CompressedBatchProof;
+ toJSON(message: CompressedBatchProof): unknown;
+ fromPartial(object: DeepPartial): CompressedBatchProof;
+ fromSDK(object: CompressedBatchProofSDKType): CompressedBatchProof;
+ toSDK(message: CompressedBatchProof): CompressedBatchProofSDKType;
+ fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof;
+ toAmino(message: CompressedBatchProof): CompressedBatchProofAmino;
+ fromAminoMsg(object: CompressedBatchProofAminoMsg): CompressedBatchProof;
+ fromProtoMsg(message: CompressedBatchProofProtoMsg): CompressedBatchProof;
+ toProto(message: CompressedBatchProof): Uint8Array;
+ toProtoMsg(message: CompressedBatchProof): CompressedBatchProofProtoMsg;
+};
+export declare const CompressedBatchEntry: {
+ typeUrl: string;
+ is(o: any): o is CompressedBatchEntry;
+ isSDK(o: any): o is CompressedBatchEntrySDKType;
+ isAmino(o: any): o is CompressedBatchEntryAmino;
+ encode(message: CompressedBatchEntry, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchEntry;
+ fromJSON(object: any): CompressedBatchEntry;
+ toJSON(message: CompressedBatchEntry): unknown;
+ fromPartial(object: DeepPartial): CompressedBatchEntry;
+ fromSDK(object: CompressedBatchEntrySDKType): CompressedBatchEntry;
+ toSDK(message: CompressedBatchEntry): CompressedBatchEntrySDKType;
+ fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry;
+ toAmino(message: CompressedBatchEntry): CompressedBatchEntryAmino;
+ fromAminoMsg(object: CompressedBatchEntryAminoMsg): CompressedBatchEntry;
+ fromProtoMsg(message: CompressedBatchEntryProtoMsg): CompressedBatchEntry;
+ toProto(message: CompressedBatchEntry): Uint8Array;
+ toProtoMsg(message: CompressedBatchEntry): CompressedBatchEntryProtoMsg;
+};
+export declare const CompressedExistenceProof: {
+ typeUrl: string;
+ is(o: any): o is CompressedExistenceProof;
+ isSDK(o: any): o is CompressedExistenceProofSDKType;
+ isAmino(o: any): o is CompressedExistenceProofAmino;
+ encode(message: CompressedExistenceProof, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): CompressedExistenceProof;
+ fromJSON(object: any): CompressedExistenceProof;
+ toJSON(message: CompressedExistenceProof): unknown;
+ fromPartial(object: DeepPartial): CompressedExistenceProof;
+ fromSDK(object: CompressedExistenceProofSDKType): CompressedExistenceProof;
+ toSDK(message: CompressedExistenceProof): CompressedExistenceProofSDKType;
+ fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof;
+ toAmino(message: CompressedExistenceProof): CompressedExistenceProofAmino;
+ fromAminoMsg(object: CompressedExistenceProofAminoMsg): CompressedExistenceProof;
+ fromProtoMsg(message: CompressedExistenceProofProtoMsg): CompressedExistenceProof;
+ toProto(message: CompressedExistenceProof): Uint8Array;
+ toProtoMsg(message: CompressedExistenceProof): CompressedExistenceProofProtoMsg;
+};
+export declare const CompressedNonExistenceProof: {
+ typeUrl: string;
+ is(o: any): o is CompressedNonExistenceProof;
+ isSDK(o: any): o is CompressedNonExistenceProofSDKType;
+ isAmino(o: any): o is CompressedNonExistenceProofAmino;
+ encode(message: CompressedNonExistenceProof, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): CompressedNonExistenceProof;
+ fromJSON(object: any): CompressedNonExistenceProof;
+ toJSON(message: CompressedNonExistenceProof): unknown;
+ fromPartial(object: DeepPartial): CompressedNonExistenceProof;
+ fromSDK(object: CompressedNonExistenceProofSDKType): CompressedNonExistenceProof;
+ toSDK(message: CompressedNonExistenceProof): CompressedNonExistenceProofSDKType;
+ fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof;
+ toAmino(message: CompressedNonExistenceProof): CompressedNonExistenceProofAmino;
+ fromAminoMsg(object: CompressedNonExistenceProofAminoMsg): CompressedNonExistenceProof;
+ fromProtoMsg(message: CompressedNonExistenceProofProtoMsg): CompressedNonExistenceProof;
+ toProto(message: CompressedNonExistenceProof): Uint8Array;
+ toProtoMsg(message: CompressedNonExistenceProof): CompressedNonExistenceProofProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/app/v1alpha1/config.d.ts b/examples/authz/types/codegen/cosmos/app/v1alpha1/config.d.ts
new file mode 100644
index 00000000..2f9ad126
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/app/v1alpha1/config.d.ts
@@ -0,0 +1,146 @@
+import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/**
+ * Config represents the configuration for a Cosmos SDK ABCI app.
+ * It is intended that all state machine logic including the version of
+ * baseapp and tx handlers (and possibly even Tendermint) that an app needs
+ * can be described in a config object. For compatibility, the framework should
+ * allow a mixture of declarative and imperative app wiring, however, apps
+ * that strive for the maximum ease of maintainability should be able to describe
+ * their state machine with a config object alone.
+ */
+export interface Config {
+ /** modules are the module configurations for the app. */
+ modules: ModuleConfig[];
+}
+export interface ConfigProtoMsg {
+ typeUrl: "/cosmos.app.v1alpha1.Config";
+ value: Uint8Array;
+}
+/**
+ * Config represents the configuration for a Cosmos SDK ABCI app.
+ * It is intended that all state machine logic including the version of
+ * baseapp and tx handlers (and possibly even Tendermint) that an app needs
+ * can be described in a config object. For compatibility, the framework should
+ * allow a mixture of declarative and imperative app wiring, however, apps
+ * that strive for the maximum ease of maintainability should be able to describe
+ * their state machine with a config object alone.
+ */
+export interface ConfigAmino {
+ /** modules are the module configurations for the app. */
+ modules?: ModuleConfigAmino[];
+}
+export interface ConfigAminoMsg {
+ type: "cosmos-sdk/Config";
+ value: ConfigAmino;
+}
+/**
+ * Config represents the configuration for a Cosmos SDK ABCI app.
+ * It is intended that all state machine logic including the version of
+ * baseapp and tx handlers (and possibly even Tendermint) that an app needs
+ * can be described in a config object. For compatibility, the framework should
+ * allow a mixture of declarative and imperative app wiring, however, apps
+ * that strive for the maximum ease of maintainability should be able to describe
+ * their state machine with a config object alone.
+ */
+export interface ConfigSDKType {
+ modules: ModuleConfigSDKType[];
+}
+/** ModuleConfig is a module configuration for an app. */
+export interface ModuleConfig {
+ /**
+ * name is the unique name of the module within the app. It should be a name
+ * that persists between different versions of a module so that modules
+ * can be smoothly upgraded to new versions.
+ *
+ * For example, for the module cosmos.bank.module.v1.Module, we may chose
+ * to simply name the module "bank" in the app. When we upgrade to
+ * cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same
+ * and the framework knows that the v2 module should receive all the same state
+ * that the v1 module had. Note: modules should provide info on which versions
+ * they can migrate from in the ModuleDescriptor.can_migration_from field.
+ */
+ name: string;
+ /**
+ * config is the config object for the module. Module config messages should
+ * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension.
+ */
+ config?: Any | undefined;
+}
+export interface ModuleConfigProtoMsg {
+ typeUrl: "/cosmos.app.v1alpha1.ModuleConfig";
+ value: Uint8Array;
+}
+/** ModuleConfig is a module configuration for an app. */
+export interface ModuleConfigAmino {
+ /**
+ * name is the unique name of the module within the app. It should be a name
+ * that persists between different versions of a module so that modules
+ * can be smoothly upgraded to new versions.
+ *
+ * For example, for the module cosmos.bank.module.v1.Module, we may chose
+ * to simply name the module "bank" in the app. When we upgrade to
+ * cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same
+ * and the framework knows that the v2 module should receive all the same state
+ * that the v1 module had. Note: modules should provide info on which versions
+ * they can migrate from in the ModuleDescriptor.can_migration_from field.
+ */
+ name?: string;
+ /**
+ * config is the config object for the module. Module config messages should
+ * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension.
+ */
+ config?: AnyAmino | undefined;
+}
+export interface ModuleConfigAminoMsg {
+ type: "cosmos-sdk/ModuleConfig";
+ value: ModuleConfigAmino;
+}
+/** ModuleConfig is a module configuration for an app. */
+export interface ModuleConfigSDKType {
+ name: string;
+ config?: AnySDKType | undefined;
+}
+export declare const Config: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Config;
+ isSDK(o: any): o is ConfigSDKType;
+ isAmino(o: any): o is ConfigAmino;
+ encode(message: Config, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Config;
+ fromJSON(object: any): Config;
+ toJSON(message: Config): unknown;
+ fromPartial(object: DeepPartial): Config;
+ fromSDK(object: ConfigSDKType): Config;
+ toSDK(message: Config): ConfigSDKType;
+ fromAmino(object: ConfigAmino): Config;
+ toAmino(message: Config): ConfigAmino;
+ fromAminoMsg(object: ConfigAminoMsg): Config;
+ toAminoMsg(message: Config): ConfigAminoMsg;
+ fromProtoMsg(message: ConfigProtoMsg): Config;
+ toProto(message: Config): Uint8Array;
+ toProtoMsg(message: Config): ConfigProtoMsg;
+};
+export declare const ModuleConfig: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is ModuleConfig;
+ isSDK(o: any): o is ModuleConfigSDKType;
+ isAmino(o: any): o is ModuleConfigAmino;
+ encode(message: ModuleConfig, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): ModuleConfig;
+ fromJSON(object: any): ModuleConfig;
+ toJSON(message: ModuleConfig): unknown;
+ fromPartial(object: DeepPartial): ModuleConfig;
+ fromSDK(object: ModuleConfigSDKType): ModuleConfig;
+ toSDK(message: ModuleConfig): ModuleConfigSDKType;
+ fromAmino(object: ModuleConfigAmino): ModuleConfig;
+ toAmino(message: ModuleConfig): ModuleConfigAmino;
+ fromAminoMsg(object: ModuleConfigAminoMsg): ModuleConfig;
+ toAminoMsg(message: ModuleConfig): ModuleConfigAminoMsg;
+ fromProtoMsg(message: ModuleConfigProtoMsg): ModuleConfig;
+ toProto(message: ModuleConfig): Uint8Array;
+ toProtoMsg(message: ModuleConfig): ModuleConfigProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/app/v1alpha1/module.d.ts b/examples/authz/types/codegen/cosmos/app/v1alpha1/module.d.ts
new file mode 100644
index 00000000..98cfbe4b
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/app/v1alpha1/module.d.ts
@@ -0,0 +1,271 @@
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/** ModuleDescriptor describes an app module. */
+export interface ModuleDescriptor {
+ /**
+ * go_import names the package that should be imported by an app to load the
+ * module in the runtime module registry. Either go_import must be defined here
+ * or the go_package option must be defined at the file level to indicate
+ * to users where to location the module implementation. go_import takes
+ * precedence over go_package when both are defined.
+ */
+ goImport: string;
+ /**
+ * use_package refers to a protobuf package that this module
+ * uses and exposes to the world. In an app, only one module should "use"
+ * or own a single protobuf package. It is assumed that the module uses
+ * all of the .proto files in a single package.
+ */
+ usePackage: PackageReference[];
+ /**
+ * can_migrate_from defines which module versions this module can migrate
+ * state from. The framework will check that one module version is able to
+ * migrate from a previous module version before attempting to update its
+ * config. It is assumed that modules can transitively migrate from earlier
+ * versions. For instance if v3 declares it can migrate from v2, and v2
+ * declares it can migrate from v1, the framework knows how to migrate
+ * from v1 to v3, assuming all 3 module versions are registered at runtime.
+ */
+ canMigrateFrom: MigrateFromInfo[];
+}
+export interface ModuleDescriptorProtoMsg {
+ typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor";
+ value: Uint8Array;
+}
+/** ModuleDescriptor describes an app module. */
+export interface ModuleDescriptorAmino {
+ /**
+ * go_import names the package that should be imported by an app to load the
+ * module in the runtime module registry. Either go_import must be defined here
+ * or the go_package option must be defined at the file level to indicate
+ * to users where to location the module implementation. go_import takes
+ * precedence over go_package when both are defined.
+ */
+ go_import?: string;
+ /**
+ * use_package refers to a protobuf package that this module
+ * uses and exposes to the world. In an app, only one module should "use"
+ * or own a single protobuf package. It is assumed that the module uses
+ * all of the .proto files in a single package.
+ */
+ use_package?: PackageReferenceAmino[];
+ /**
+ * can_migrate_from defines which module versions this module can migrate
+ * state from. The framework will check that one module version is able to
+ * migrate from a previous module version before attempting to update its
+ * config. It is assumed that modules can transitively migrate from earlier
+ * versions. For instance if v3 declares it can migrate from v2, and v2
+ * declares it can migrate from v1, the framework knows how to migrate
+ * from v1 to v3, assuming all 3 module versions are registered at runtime.
+ */
+ can_migrate_from?: MigrateFromInfoAmino[];
+}
+export interface ModuleDescriptorAminoMsg {
+ type: "cosmos-sdk/ModuleDescriptor";
+ value: ModuleDescriptorAmino;
+}
+/** ModuleDescriptor describes an app module. */
+export interface ModuleDescriptorSDKType {
+ go_import: string;
+ use_package: PackageReferenceSDKType[];
+ can_migrate_from: MigrateFromInfoSDKType[];
+}
+/** PackageReference is a reference to a protobuf package used by a module. */
+export interface PackageReference {
+ /** name is the fully-qualified name of the package. */
+ name: string;
+ /**
+ * revision is the optional revision of the package that is being used.
+ * Protobuf packages used in Cosmos should generally have a major version
+ * as the last part of the package name, ex. foo.bar.baz.v1.
+ * The revision of a package can be thought of as the minor version of a
+ * package which has additional backwards compatible definitions that weren't
+ * present in a previous version.
+ *
+ * A package should indicate its revision with a source code comment
+ * above the package declaration in one of its fields containing the
+ * test "Revision N" where N is an integer revision. All packages start
+ * at revision 0 the first time they are released in a module.
+ *
+ * When a new version of a module is released and items are added to existing
+ * .proto files, these definitions should contain comments of the form
+ * "Since Revision N" where N is an integer revision.
+ *
+ * When the module runtime starts up, it will check the pinned proto
+ * image and panic if there are runtime protobuf definitions that are not
+ * in the pinned descriptor which do not have
+ * a "Since Revision N" comment or have a "Since Revision N" comment where
+ * N is <= to the revision specified here. This indicates that the protobuf
+ * files have been updated, but the pinned file descriptor hasn't.
+ *
+ * If there are items in the pinned file descriptor with a revision
+ * greater than the value indicated here, this will also cause a panic
+ * as it may mean that the pinned descriptor for a legacy module has been
+ * improperly updated or that there is some other versioning discrepancy.
+ * Runtime protobuf definitions will also be checked for compatibility
+ * with pinned file descriptors to make sure there are no incompatible changes.
+ *
+ * This behavior ensures that:
+ * * pinned proto images are up-to-date
+ * * protobuf files are carefully annotated with revision comments which
+ * are important good client UX
+ * * protobuf files are changed in backwards and forwards compatible ways
+ */
+ revision: number;
+}
+export interface PackageReferenceProtoMsg {
+ typeUrl: "/cosmos.app.v1alpha1.PackageReference";
+ value: Uint8Array;
+}
+/** PackageReference is a reference to a protobuf package used by a module. */
+export interface PackageReferenceAmino {
+ /** name is the fully-qualified name of the package. */
+ name?: string;
+ /**
+ * revision is the optional revision of the package that is being used.
+ * Protobuf packages used in Cosmos should generally have a major version
+ * as the last part of the package name, ex. foo.bar.baz.v1.
+ * The revision of a package can be thought of as the minor version of a
+ * package which has additional backwards compatible definitions that weren't
+ * present in a previous version.
+ *
+ * A package should indicate its revision with a source code comment
+ * above the package declaration in one of its fields containing the
+ * test "Revision N" where N is an integer revision. All packages start
+ * at revision 0 the first time they are released in a module.
+ *
+ * When a new version of a module is released and items are added to existing
+ * .proto files, these definitions should contain comments of the form
+ * "Since Revision N" where N is an integer revision.
+ *
+ * When the module runtime starts up, it will check the pinned proto
+ * image and panic if there are runtime protobuf definitions that are not
+ * in the pinned descriptor which do not have
+ * a "Since Revision N" comment or have a "Since Revision N" comment where
+ * N is <= to the revision specified here. This indicates that the protobuf
+ * files have been updated, but the pinned file descriptor hasn't.
+ *
+ * If there are items in the pinned file descriptor with a revision
+ * greater than the value indicated here, this will also cause a panic
+ * as it may mean that the pinned descriptor for a legacy module has been
+ * improperly updated or that there is some other versioning discrepancy.
+ * Runtime protobuf definitions will also be checked for compatibility
+ * with pinned file descriptors to make sure there are no incompatible changes.
+ *
+ * This behavior ensures that:
+ * * pinned proto images are up-to-date
+ * * protobuf files are carefully annotated with revision comments which
+ * are important good client UX
+ * * protobuf files are changed in backwards and forwards compatible ways
+ */
+ revision?: number;
+}
+export interface PackageReferenceAminoMsg {
+ type: "cosmos-sdk/PackageReference";
+ value: PackageReferenceAmino;
+}
+/** PackageReference is a reference to a protobuf package used by a module. */
+export interface PackageReferenceSDKType {
+ name: string;
+ revision: number;
+}
+/**
+ * MigrateFromInfo is information on a module version that a newer module
+ * can migrate from.
+ */
+export interface MigrateFromInfo {
+ /**
+ * module is the fully-qualified protobuf name of the module config object
+ * for the previous module version, ex: "cosmos.group.module.v1.Module".
+ */
+ module: string;
+}
+export interface MigrateFromInfoProtoMsg {
+ typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo";
+ value: Uint8Array;
+}
+/**
+ * MigrateFromInfo is information on a module version that a newer module
+ * can migrate from.
+ */
+export interface MigrateFromInfoAmino {
+ /**
+ * module is the fully-qualified protobuf name of the module config object
+ * for the previous module version, ex: "cosmos.group.module.v1.Module".
+ */
+ module?: string;
+}
+export interface MigrateFromInfoAminoMsg {
+ type: "cosmos-sdk/MigrateFromInfo";
+ value: MigrateFromInfoAmino;
+}
+/**
+ * MigrateFromInfo is information on a module version that a newer module
+ * can migrate from.
+ */
+export interface MigrateFromInfoSDKType {
+ module: string;
+}
+export declare const ModuleDescriptor: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is ModuleDescriptor;
+ isSDK(o: any): o is ModuleDescriptorSDKType;
+ isAmino(o: any): o is ModuleDescriptorAmino;
+ encode(message: ModuleDescriptor, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): ModuleDescriptor;
+ fromJSON(object: any): ModuleDescriptor;
+ toJSON(message: ModuleDescriptor): unknown;
+ fromPartial(object: DeepPartial): ModuleDescriptor;
+ fromSDK(object: ModuleDescriptorSDKType): ModuleDescriptor;
+ toSDK(message: ModuleDescriptor): ModuleDescriptorSDKType;
+ fromAmino(object: ModuleDescriptorAmino): ModuleDescriptor;
+ toAmino(message: ModuleDescriptor): ModuleDescriptorAmino;
+ fromAminoMsg(object: ModuleDescriptorAminoMsg): ModuleDescriptor;
+ toAminoMsg(message: ModuleDescriptor): ModuleDescriptorAminoMsg;
+ fromProtoMsg(message: ModuleDescriptorProtoMsg): ModuleDescriptor;
+ toProto(message: ModuleDescriptor): Uint8Array;
+ toProtoMsg(message: ModuleDescriptor): ModuleDescriptorProtoMsg;
+};
+export declare const PackageReference: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is PackageReference;
+ isSDK(o: any): o is PackageReferenceSDKType;
+ isAmino(o: any): o is PackageReferenceAmino;
+ encode(message: PackageReference, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): PackageReference;
+ fromJSON(object: any): PackageReference;
+ toJSON(message: PackageReference): unknown;
+ fromPartial(object: DeepPartial): PackageReference;
+ fromSDK(object: PackageReferenceSDKType): PackageReference;
+ toSDK(message: PackageReference): PackageReferenceSDKType;
+ fromAmino(object: PackageReferenceAmino): PackageReference;
+ toAmino(message: PackageReference): PackageReferenceAmino;
+ fromAminoMsg(object: PackageReferenceAminoMsg): PackageReference;
+ toAminoMsg(message: PackageReference): PackageReferenceAminoMsg;
+ fromProtoMsg(message: PackageReferenceProtoMsg): PackageReference;
+ toProto(message: PackageReference): Uint8Array;
+ toProtoMsg(message: PackageReference): PackageReferenceProtoMsg;
+};
+export declare const MigrateFromInfo: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is MigrateFromInfo;
+ isSDK(o: any): o is MigrateFromInfoSDKType;
+ isAmino(o: any): o is MigrateFromInfoAmino;
+ encode(message: MigrateFromInfo, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): MigrateFromInfo;
+ fromJSON(object: any): MigrateFromInfo;
+ toJSON(message: MigrateFromInfo): unknown;
+ fromPartial(object: DeepPartial): MigrateFromInfo;
+ fromSDK(object: MigrateFromInfoSDKType): MigrateFromInfo;
+ toSDK(message: MigrateFromInfo): MigrateFromInfoSDKType;
+ fromAmino(object: MigrateFromInfoAmino): MigrateFromInfo;
+ toAmino(message: MigrateFromInfo): MigrateFromInfoAmino;
+ fromAminoMsg(object: MigrateFromInfoAminoMsg): MigrateFromInfo;
+ toAminoMsg(message: MigrateFromInfo): MigrateFromInfoAminoMsg;
+ fromProtoMsg(message: MigrateFromInfoProtoMsg): MigrateFromInfo;
+ toProto(message: MigrateFromInfo): Uint8Array;
+ toProtoMsg(message: MigrateFromInfo): MigrateFromInfoProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/app/v1alpha1/query.d.ts b/examples/authz/types/codegen/cosmos/app/v1alpha1/query.d.ts
new file mode 100644
index 00000000..4d1c4238
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/app/v1alpha1/query.d.ts
@@ -0,0 +1,84 @@
+import { Config, ConfigAmino, ConfigSDKType } from "./config";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/** QueryConfigRequest is the Query/Config request type. */
+export interface QueryConfigRequest {
+}
+export interface QueryConfigRequestProtoMsg {
+ typeUrl: "/cosmos.app.v1alpha1.QueryConfigRequest";
+ value: Uint8Array;
+}
+/** QueryConfigRequest is the Query/Config request type. */
+export interface QueryConfigRequestAmino {
+}
+export interface QueryConfigRequestAminoMsg {
+ type: "cosmos-sdk/QueryConfigRequest";
+ value: QueryConfigRequestAmino;
+}
+/** QueryConfigRequest is the Query/Config request type. */
+export interface QueryConfigRequestSDKType {
+}
+/** QueryConfigRequest is the Query/Config response type. */
+export interface QueryConfigResponse {
+ /** config is the current app config. */
+ config?: Config | undefined;
+}
+export interface QueryConfigResponseProtoMsg {
+ typeUrl: "/cosmos.app.v1alpha1.QueryConfigResponse";
+ value: Uint8Array;
+}
+/** QueryConfigRequest is the Query/Config response type. */
+export interface QueryConfigResponseAmino {
+ /** config is the current app config. */
+ config?: ConfigAmino | undefined;
+}
+export interface QueryConfigResponseAminoMsg {
+ type: "cosmos-sdk/QueryConfigResponse";
+ value: QueryConfigResponseAmino;
+}
+/** QueryConfigRequest is the Query/Config response type. */
+export interface QueryConfigResponseSDKType {
+ config?: ConfigSDKType | undefined;
+}
+export declare const QueryConfigRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryConfigRequest;
+ isSDK(o: any): o is QueryConfigRequestSDKType;
+ isAmino(o: any): o is QueryConfigRequestAmino;
+ encode(_: QueryConfigRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigRequest;
+ fromJSON(_: any): QueryConfigRequest;
+ toJSON(_: QueryConfigRequest): unknown;
+ fromPartial(_: DeepPartial): QueryConfigRequest;
+ fromSDK(_: QueryConfigRequestSDKType): QueryConfigRequest;
+ toSDK(_: QueryConfigRequest): QueryConfigRequestSDKType;
+ fromAmino(_: QueryConfigRequestAmino): QueryConfigRequest;
+ toAmino(_: QueryConfigRequest): QueryConfigRequestAmino;
+ fromAminoMsg(object: QueryConfigRequestAminoMsg): QueryConfigRequest;
+ toAminoMsg(message: QueryConfigRequest): QueryConfigRequestAminoMsg;
+ fromProtoMsg(message: QueryConfigRequestProtoMsg): QueryConfigRequest;
+ toProto(message: QueryConfigRequest): Uint8Array;
+ toProtoMsg(message: QueryConfigRequest): QueryConfigRequestProtoMsg;
+};
+export declare const QueryConfigResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryConfigResponse;
+ isSDK(o: any): o is QueryConfigResponseSDKType;
+ isAmino(o: any): o is QueryConfigResponseAmino;
+ encode(message: QueryConfigResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigResponse;
+ fromJSON(object: any): QueryConfigResponse;
+ toJSON(message: QueryConfigResponse): unknown;
+ fromPartial(object: DeepPartial): QueryConfigResponse;
+ fromSDK(object: QueryConfigResponseSDKType): QueryConfigResponse;
+ toSDK(message: QueryConfigResponse): QueryConfigResponseSDKType;
+ fromAmino(object: QueryConfigResponseAmino): QueryConfigResponse;
+ toAmino(message: QueryConfigResponse): QueryConfigResponseAmino;
+ fromAminoMsg(object: QueryConfigResponseAminoMsg): QueryConfigResponse;
+ toAminoMsg(message: QueryConfigResponse): QueryConfigResponseAminoMsg;
+ fromProtoMsg(message: QueryConfigResponseProtoMsg): QueryConfigResponse;
+ toProto(message: QueryConfigResponse): Uint8Array;
+ toProtoMsg(message: QueryConfigResponse): QueryConfigResponseProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/app/v1alpha1/query.rpc.Query.d.ts b/examples/authz/types/codegen/cosmos/app/v1alpha1/query.rpc.Query.d.ts
new file mode 100644
index 00000000..33d2e350
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/app/v1alpha1/query.rpc.Query.d.ts
@@ -0,0 +1,30 @@
+import { TxRpc } from "../../../types";
+import { ReactQueryParams } from "../../../react-query";
+import { ProtobufRpcClient } from "@cosmjs/stargate";
+import { QueryStore } from "../../../mobx";
+import { QueryConfigRequest, QueryConfigResponse } from "./query";
+/** Query is the app module query service. */
+export interface Query {
+ /** Config returns the current app config. */
+ config(request?: QueryConfigRequest): Promise;
+}
+export declare class QueryClientImpl implements Query {
+ private readonly rpc;
+ constructor(rpc: TxRpc);
+ config: (request?: QueryConfigRequest) => Promise;
+}
+export declare const createClientImpl: (rpc: TxRpc) => QueryClientImpl;
+export interface UseConfigQuery extends ReactQueryParams {
+ request?: QueryConfigRequest;
+}
+export declare const createRpcQueryHooks: (rpc: ProtobufRpcClient | undefined) => {
+ /** Config returns the current app config. */ useConfig: ({ request, options }: UseConfigQuery) => import("@tanstack/react-query").UseQueryResult;
+};
+export declare const createRpcQueryMobxStores: (rpc: ProtobufRpcClient | undefined) => {
+ /** Config returns the current app config. */ QueryConfigStore: {
+ new (): {
+ store: QueryStore;
+ config(request: QueryConfigRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+};
diff --git a/examples/authz/types/codegen/cosmos/auth/v1beta1/auth.d.ts b/examples/authz/types/codegen/cosmos/auth/v1beta1/auth.d.ts
new file mode 100644
index 00000000..66305369
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/auth/v1beta1/auth.d.ts
@@ -0,0 +1,169 @@
+import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/**
+ * BaseAccount defines a base account type. It contains all the necessary fields
+ * for basic account functionality. Any custom account type should extend this
+ * type for additional functionality (e.g. vesting).
+ */
+export interface BaseAccount {
+ $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount";
+ address: string;
+ pubKey?: Any | undefined;
+ accountNumber: bigint;
+ sequence: bigint;
+}
+export interface BaseAccountProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.BaseAccount";
+ value: Uint8Array;
+}
+/**
+ * BaseAccount defines a base account type. It contains all the necessary fields
+ * for basic account functionality. Any custom account type should extend this
+ * type for additional functionality (e.g. vesting).
+ */
+export interface BaseAccountAmino {
+ address?: string;
+ pub_key?: AnyAmino | undefined;
+ account_number?: string;
+ sequence?: string;
+}
+export interface BaseAccountAminoMsg {
+ type: "cosmos-sdk/BaseAccount";
+ value: BaseAccountAmino;
+}
+/**
+ * BaseAccount defines a base account type. It contains all the necessary fields
+ * for basic account functionality. Any custom account type should extend this
+ * type for additional functionality (e.g. vesting).
+ */
+export interface BaseAccountSDKType {
+ $typeUrl?: "/cosmos.auth.v1beta1.BaseAccount";
+ address: string;
+ pub_key?: AnySDKType | undefined;
+ account_number: bigint;
+ sequence: bigint;
+}
+/** ModuleAccount defines an account for modules that holds coins on a pool. */
+export interface ModuleAccount {
+ $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount";
+ baseAccount?: BaseAccount | undefined;
+ name: string;
+ permissions: string[];
+}
+export interface ModuleAccountProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.ModuleAccount";
+ value: Uint8Array;
+}
+/** ModuleAccount defines an account for modules that holds coins on a pool. */
+export interface ModuleAccountAmino {
+ base_account?: BaseAccountAmino | undefined;
+ name?: string;
+ permissions?: string[];
+}
+export interface ModuleAccountAminoMsg {
+ type: "cosmos-sdk/ModuleAccount";
+ value: ModuleAccountAmino;
+}
+/** ModuleAccount defines an account for modules that holds coins on a pool. */
+export interface ModuleAccountSDKType {
+ $typeUrl?: "/cosmos.auth.v1beta1.ModuleAccount";
+ base_account?: BaseAccountSDKType | undefined;
+ name: string;
+ permissions: string[];
+}
+/** Params defines the parameters for the auth module. */
+export interface Params {
+ maxMemoCharacters: bigint;
+ txSigLimit: bigint;
+ txSizeCostPerByte: bigint;
+ sigVerifyCostEd25519: bigint;
+ sigVerifyCostSecp256k1: bigint;
+}
+export interface ParamsProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.Params";
+ value: Uint8Array;
+}
+/** Params defines the parameters for the auth module. */
+export interface ParamsAmino {
+ max_memo_characters?: string;
+ tx_sig_limit?: string;
+ tx_size_cost_per_byte?: string;
+ sig_verify_cost_ed25519?: string;
+ sig_verify_cost_secp256k1?: string;
+}
+export interface ParamsAminoMsg {
+ type: "cosmos-sdk/Params";
+ value: ParamsAmino;
+}
+/** Params defines the parameters for the auth module. */
+export interface ParamsSDKType {
+ max_memo_characters: bigint;
+ tx_sig_limit: bigint;
+ tx_size_cost_per_byte: bigint;
+ sig_verify_cost_ed25519: bigint;
+ sig_verify_cost_secp256k1: bigint;
+}
+export declare const BaseAccount: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is BaseAccount;
+ isSDK(o: any): o is BaseAccountSDKType;
+ isAmino(o: any): o is BaseAccountAmino;
+ encode(message: BaseAccount, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount;
+ fromJSON(object: any): BaseAccount;
+ toJSON(message: BaseAccount): unknown;
+ fromPartial(object: DeepPartial): BaseAccount;
+ fromSDK(object: BaseAccountSDKType): BaseAccount;
+ toSDK(message: BaseAccount): BaseAccountSDKType;
+ fromAmino(object: BaseAccountAmino): BaseAccount;
+ toAmino(message: BaseAccount): BaseAccountAmino;
+ fromAminoMsg(object: BaseAccountAminoMsg): BaseAccount;
+ toAminoMsg(message: BaseAccount): BaseAccountAminoMsg;
+ fromProtoMsg(message: BaseAccountProtoMsg): BaseAccount;
+ toProto(message: BaseAccount): Uint8Array;
+ toProtoMsg(message: BaseAccount): BaseAccountProtoMsg;
+};
+export declare const ModuleAccount: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is ModuleAccount;
+ isSDK(o: any): o is ModuleAccountSDKType;
+ isAmino(o: any): o is ModuleAccountAmino;
+ encode(message: ModuleAccount, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount;
+ fromJSON(object: any): ModuleAccount;
+ toJSON(message: ModuleAccount): unknown;
+ fromPartial(object: DeepPartial): ModuleAccount;
+ fromSDK(object: ModuleAccountSDKType): ModuleAccount;
+ toSDK(message: ModuleAccount): ModuleAccountSDKType;
+ fromAmino(object: ModuleAccountAmino): ModuleAccount;
+ toAmino(message: ModuleAccount): ModuleAccountAmino;
+ fromAminoMsg(object: ModuleAccountAminoMsg): ModuleAccount;
+ toAminoMsg(message: ModuleAccount): ModuleAccountAminoMsg;
+ fromProtoMsg(message: ModuleAccountProtoMsg): ModuleAccount;
+ toProto(message: ModuleAccount): Uint8Array;
+ toProtoMsg(message: ModuleAccount): ModuleAccountProtoMsg;
+};
+export declare const Params: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Params;
+ isSDK(o: any): o is ParamsSDKType;
+ isAmino(o: any): o is ParamsAmino;
+ encode(message: Params, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Params;
+ fromJSON(object: any): Params;
+ toJSON(message: Params): unknown;
+ fromPartial(object: DeepPartial): Params;
+ fromSDK(object: ParamsSDKType): Params;
+ toSDK(message: Params): ParamsSDKType;
+ fromAmino(object: ParamsAmino): Params;
+ toAmino(message: Params): ParamsAmino;
+ fromAminoMsg(object: ParamsAminoMsg): Params;
+ toAminoMsg(message: Params): ParamsAminoMsg;
+ fromProtoMsg(message: ParamsProtoMsg): Params;
+ toProto(message: Params): Uint8Array;
+ toProtoMsg(message: Params): ParamsProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/auth/v1beta1/genesis.d.ts b/examples/authz/types/codegen/cosmos/auth/v1beta1/genesis.d.ts
new file mode 100644
index 00000000..b6eeeafd
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/auth/v1beta1/genesis.d.ts
@@ -0,0 +1,52 @@
+import { Params, ParamsAmino, ParamsSDKType } from "./auth";
+import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/** GenesisState defines the auth module's genesis state. */
+export interface GenesisState {
+ /** params defines all the paramaters of the module. */
+ params: Params | undefined;
+ /** accounts are the accounts present at genesis. */
+ accounts: Any[];
+}
+export interface GenesisStateProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.GenesisState";
+ value: Uint8Array;
+}
+/** GenesisState defines the auth module's genesis state. */
+export interface GenesisStateAmino {
+ /** params defines all the paramaters of the module. */
+ params?: ParamsAmino | undefined;
+ /** accounts are the accounts present at genesis. */
+ accounts?: AnyAmino[];
+}
+export interface GenesisStateAminoMsg {
+ type: "cosmos-sdk/GenesisState";
+ value: GenesisStateAmino;
+}
+/** GenesisState defines the auth module's genesis state. */
+export interface GenesisStateSDKType {
+ params: ParamsSDKType | undefined;
+ accounts: AnySDKType[];
+}
+export declare const GenesisState: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is GenesisState;
+ isSDK(o: any): o is GenesisStateSDKType;
+ isAmino(o: any): o is GenesisStateAmino;
+ encode(message: GenesisState, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): GenesisState;
+ fromJSON(object: any): GenesisState;
+ toJSON(message: GenesisState): unknown;
+ fromPartial(object: DeepPartial): GenesisState;
+ fromSDK(object: GenesisStateSDKType): GenesisState;
+ toSDK(message: GenesisState): GenesisStateSDKType;
+ fromAmino(object: GenesisStateAmino): GenesisState;
+ toAmino(message: GenesisState): GenesisStateAmino;
+ fromAminoMsg(object: GenesisStateAminoMsg): GenesisState;
+ toAminoMsg(message: GenesisState): GenesisStateAminoMsg;
+ fromProtoMsg(message: GenesisStateProtoMsg): GenesisState;
+ toProto(message: GenesisState): Uint8Array;
+ toProtoMsg(message: GenesisState): GenesisStateProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/auth/v1beta1/query.d.ts b/examples/authz/types/codegen/cosmos/auth/v1beta1/query.d.ts
new file mode 100644
index 00000000..5f8653f2
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/auth/v1beta1/query.d.ts
@@ -0,0 +1,618 @@
+import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination";
+import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any";
+import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountProtoMsg, BaseAccountSDKType, ModuleAccount, ModuleAccountProtoMsg, ModuleAccountSDKType } from "./auth";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/**
+ * QueryAccountsRequest is the request type for the Query/Accounts RPC method.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface QueryAccountsRequest {
+ /** pagination defines an optional pagination for the request. */
+ pagination?: PageRequest | undefined;
+}
+export interface QueryAccountsRequestProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryAccountsRequest";
+ value: Uint8Array;
+}
+/**
+ * QueryAccountsRequest is the request type for the Query/Accounts RPC method.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface QueryAccountsRequestAmino {
+ /** pagination defines an optional pagination for the request. */
+ pagination?: PageRequestAmino | undefined;
+}
+export interface QueryAccountsRequestAminoMsg {
+ type: "cosmos-sdk/QueryAccountsRequest";
+ value: QueryAccountsRequestAmino;
+}
+/**
+ * QueryAccountsRequest is the request type for the Query/Accounts RPC method.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface QueryAccountsRequestSDKType {
+ pagination?: PageRequestSDKType | undefined;
+}
+/**
+ * QueryAccountsResponse is the response type for the Query/Accounts RPC method.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface QueryAccountsResponse {
+ /** accounts are the existing accounts */
+ accounts: (BaseAccount | Any)[] | Any[];
+ /** pagination defines the pagination in the response. */
+ pagination?: PageResponse | undefined;
+}
+export interface QueryAccountsResponseProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryAccountsResponse";
+ value: Uint8Array;
+}
+export type QueryAccountsResponseEncoded = Omit & {
+ /** accounts are the existing accounts */ accounts: (BaseAccountProtoMsg | AnyProtoMsg)[];
+};
+/**
+ * QueryAccountsResponse is the response type for the Query/Accounts RPC method.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface QueryAccountsResponseAmino {
+ /** accounts are the existing accounts */
+ accounts?: AnyAmino[];
+ /** pagination defines the pagination in the response. */
+ pagination?: PageResponseAmino | undefined;
+}
+export interface QueryAccountsResponseAminoMsg {
+ type: "cosmos-sdk/QueryAccountsResponse";
+ value: QueryAccountsResponseAmino;
+}
+/**
+ * QueryAccountsResponse is the response type for the Query/Accounts RPC method.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface QueryAccountsResponseSDKType {
+ accounts: (BaseAccountSDKType | AnySDKType)[];
+ pagination?: PageResponseSDKType | undefined;
+}
+/** QueryAccountRequest is the request type for the Query/Account RPC method. */
+export interface QueryAccountRequest {
+ /** address defines the address to query for. */
+ address: string;
+}
+export interface QueryAccountRequestProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryAccountRequest";
+ value: Uint8Array;
+}
+/** QueryAccountRequest is the request type for the Query/Account RPC method. */
+export interface QueryAccountRequestAmino {
+ /** address defines the address to query for. */
+ address?: string;
+}
+export interface QueryAccountRequestAminoMsg {
+ type: "cosmos-sdk/QueryAccountRequest";
+ value: QueryAccountRequestAmino;
+}
+/** QueryAccountRequest is the request type for the Query/Account RPC method. */
+export interface QueryAccountRequestSDKType {
+ address: string;
+}
+/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */
+export interface QueryModuleAccountsRequest {
+}
+export interface QueryModuleAccountsRequestProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest";
+ value: Uint8Array;
+}
+/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */
+export interface QueryModuleAccountsRequestAmino {
+}
+export interface QueryModuleAccountsRequestAminoMsg {
+ type: "cosmos-sdk/QueryModuleAccountsRequest";
+ value: QueryModuleAccountsRequestAmino;
+}
+/** QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. */
+export interface QueryModuleAccountsRequestSDKType {
+}
+/** QueryParamsResponse is the response type for the Query/Params RPC method. */
+export interface QueryParamsResponse {
+ /** params defines the parameters of the module. */
+ params: Params | undefined;
+}
+export interface QueryParamsResponseProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryParamsResponse";
+ value: Uint8Array;
+}
+/** QueryParamsResponse is the response type for the Query/Params RPC method. */
+export interface QueryParamsResponseAmino {
+ /** params defines the parameters of the module. */
+ params?: ParamsAmino | undefined;
+}
+export interface QueryParamsResponseAminoMsg {
+ type: "cosmos-sdk/QueryParamsResponse";
+ value: QueryParamsResponseAmino;
+}
+/** QueryParamsResponse is the response type for the Query/Params RPC method. */
+export interface QueryParamsResponseSDKType {
+ params: ParamsSDKType | undefined;
+}
+/** QueryAccountResponse is the response type for the Query/Account RPC method. */
+export interface QueryAccountResponse {
+ /** account defines the account of the corresponding address. */
+ account?: BaseAccount | Any | undefined;
+}
+export interface QueryAccountResponseProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryAccountResponse";
+ value: Uint8Array;
+}
+export type QueryAccountResponseEncoded = Omit & {
+ /** account defines the account of the corresponding address. */ account?: BaseAccountProtoMsg | AnyProtoMsg | undefined;
+};
+/** QueryAccountResponse is the response type for the Query/Account RPC method. */
+export interface QueryAccountResponseAmino {
+ /** account defines the account of the corresponding address. */
+ account?: AnyAmino | undefined;
+}
+export interface QueryAccountResponseAminoMsg {
+ type: "cosmos-sdk/QueryAccountResponse";
+ value: QueryAccountResponseAmino;
+}
+/** QueryAccountResponse is the response type for the Query/Account RPC method. */
+export interface QueryAccountResponseSDKType {
+ account?: BaseAccountSDKType | AnySDKType | undefined;
+}
+/** QueryParamsRequest is the request type for the Query/Params RPC method. */
+export interface QueryParamsRequest {
+}
+export interface QueryParamsRequestProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryParamsRequest";
+ value: Uint8Array;
+}
+/** QueryParamsRequest is the request type for the Query/Params RPC method. */
+export interface QueryParamsRequestAmino {
+}
+export interface QueryParamsRequestAminoMsg {
+ type: "cosmos-sdk/QueryParamsRequest";
+ value: QueryParamsRequestAmino;
+}
+/** QueryParamsRequest is the request type for the Query/Params RPC method. */
+export interface QueryParamsRequestSDKType {
+}
+/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */
+export interface QueryModuleAccountsResponse {
+ accounts: (ModuleAccount | Any)[] | Any[];
+}
+export interface QueryModuleAccountsResponseProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse";
+ value: Uint8Array;
+}
+export type QueryModuleAccountsResponseEncoded = Omit & {
+ accounts: (ModuleAccountProtoMsg | AnyProtoMsg)[];
+};
+/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */
+export interface QueryModuleAccountsResponseAmino {
+ accounts?: AnyAmino[];
+}
+export interface QueryModuleAccountsResponseAminoMsg {
+ type: "cosmos-sdk/QueryModuleAccountsResponse";
+ value: QueryModuleAccountsResponseAmino;
+}
+/** QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. */
+export interface QueryModuleAccountsResponseSDKType {
+ accounts: (ModuleAccountSDKType | AnySDKType)[];
+}
+/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */
+export interface Bech32PrefixRequest {
+}
+export interface Bech32PrefixRequestProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest";
+ value: Uint8Array;
+}
+/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */
+export interface Bech32PrefixRequestAmino {
+}
+export interface Bech32PrefixRequestAminoMsg {
+ type: "cosmos-sdk/Bech32PrefixRequest";
+ value: Bech32PrefixRequestAmino;
+}
+/** Bech32PrefixRequest is the request type for Bech32Prefix rpc method */
+export interface Bech32PrefixRequestSDKType {
+}
+/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */
+export interface Bech32PrefixResponse {
+ bech32Prefix: string;
+}
+export interface Bech32PrefixResponseProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse";
+ value: Uint8Array;
+}
+/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */
+export interface Bech32PrefixResponseAmino {
+ bech32_prefix?: string;
+}
+export interface Bech32PrefixResponseAminoMsg {
+ type: "cosmos-sdk/Bech32PrefixResponse";
+ value: Bech32PrefixResponseAmino;
+}
+/** Bech32PrefixResponse is the response type for Bech32Prefix rpc method */
+export interface Bech32PrefixResponseSDKType {
+ bech32_prefix: string;
+}
+/** AddressBytesToStringRequest is the request type for AddressString rpc method */
+export interface AddressBytesToStringRequest {
+ addressBytes: Uint8Array;
+}
+export interface AddressBytesToStringRequestProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest";
+ value: Uint8Array;
+}
+/** AddressBytesToStringRequest is the request type for AddressString rpc method */
+export interface AddressBytesToStringRequestAmino {
+ address_bytes?: string;
+}
+export interface AddressBytesToStringRequestAminoMsg {
+ type: "cosmos-sdk/AddressBytesToStringRequest";
+ value: AddressBytesToStringRequestAmino;
+}
+/** AddressBytesToStringRequest is the request type for AddressString rpc method */
+export interface AddressBytesToStringRequestSDKType {
+ address_bytes: Uint8Array;
+}
+/** AddressBytesToStringResponse is the response type for AddressString rpc method */
+export interface AddressBytesToStringResponse {
+ addressString: string;
+}
+export interface AddressBytesToStringResponseProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse";
+ value: Uint8Array;
+}
+/** AddressBytesToStringResponse is the response type for AddressString rpc method */
+export interface AddressBytesToStringResponseAmino {
+ address_string?: string;
+}
+export interface AddressBytesToStringResponseAminoMsg {
+ type: "cosmos-sdk/AddressBytesToStringResponse";
+ value: AddressBytesToStringResponseAmino;
+}
+/** AddressBytesToStringResponse is the response type for AddressString rpc method */
+export interface AddressBytesToStringResponseSDKType {
+ address_string: string;
+}
+/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */
+export interface AddressStringToBytesRequest {
+ addressString: string;
+}
+export interface AddressStringToBytesRequestProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest";
+ value: Uint8Array;
+}
+/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */
+export interface AddressStringToBytesRequestAmino {
+ address_string?: string;
+}
+export interface AddressStringToBytesRequestAminoMsg {
+ type: "cosmos-sdk/AddressStringToBytesRequest";
+ value: AddressStringToBytesRequestAmino;
+}
+/** AddressStringToBytesRequest is the request type for AccountBytes rpc method */
+export interface AddressStringToBytesRequestSDKType {
+ address_string: string;
+}
+/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */
+export interface AddressStringToBytesResponse {
+ addressBytes: Uint8Array;
+}
+export interface AddressStringToBytesResponseProtoMsg {
+ typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse";
+ value: Uint8Array;
+}
+/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */
+export interface AddressStringToBytesResponseAmino {
+ address_bytes?: string;
+}
+export interface AddressStringToBytesResponseAminoMsg {
+ type: "cosmos-sdk/AddressStringToBytesResponse";
+ value: AddressStringToBytesResponseAmino;
+}
+/** AddressStringToBytesResponse is the response type for AddressBytes rpc method */
+export interface AddressStringToBytesResponseSDKType {
+ address_bytes: Uint8Array;
+}
+export declare const QueryAccountsRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryAccountsRequest;
+ isSDK(o: any): o is QueryAccountsRequestSDKType;
+ isAmino(o: any): o is QueryAccountsRequestAmino;
+ encode(message: QueryAccountsRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsRequest;
+ fromJSON(object: any): QueryAccountsRequest;
+ toJSON(message: QueryAccountsRequest): unknown;
+ fromPartial(object: DeepPartial): QueryAccountsRequest;
+ fromSDK(object: QueryAccountsRequestSDKType): QueryAccountsRequest;
+ toSDK(message: QueryAccountsRequest): QueryAccountsRequestSDKType;
+ fromAmino(object: QueryAccountsRequestAmino): QueryAccountsRequest;
+ toAmino(message: QueryAccountsRequest): QueryAccountsRequestAmino;
+ fromAminoMsg(object: QueryAccountsRequestAminoMsg): QueryAccountsRequest;
+ toAminoMsg(message: QueryAccountsRequest): QueryAccountsRequestAminoMsg;
+ fromProtoMsg(message: QueryAccountsRequestProtoMsg): QueryAccountsRequest;
+ toProto(message: QueryAccountsRequest): Uint8Array;
+ toProtoMsg(message: QueryAccountsRequest): QueryAccountsRequestProtoMsg;
+};
+export declare const QueryAccountsResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryAccountsResponse;
+ isSDK(o: any): o is QueryAccountsResponseSDKType;
+ isAmino(o: any): o is QueryAccountsResponseAmino;
+ encode(message: QueryAccountsResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsResponse;
+ fromJSON(object: any): QueryAccountsResponse;
+ toJSON(message: QueryAccountsResponse): unknown;
+ fromPartial(object: DeepPartial): QueryAccountsResponse;
+ fromSDK(object: QueryAccountsResponseSDKType): QueryAccountsResponse;
+ toSDK(message: QueryAccountsResponse): QueryAccountsResponseSDKType;
+ fromAmino(object: QueryAccountsResponseAmino): QueryAccountsResponse;
+ toAmino(message: QueryAccountsResponse): QueryAccountsResponseAmino;
+ fromAminoMsg(object: QueryAccountsResponseAminoMsg): QueryAccountsResponse;
+ toAminoMsg(message: QueryAccountsResponse): QueryAccountsResponseAminoMsg;
+ fromProtoMsg(message: QueryAccountsResponseProtoMsg): QueryAccountsResponse;
+ toProto(message: QueryAccountsResponse): Uint8Array;
+ toProtoMsg(message: QueryAccountsResponse): QueryAccountsResponseProtoMsg;
+};
+export declare const QueryAccountRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryAccountRequest;
+ isSDK(o: any): o is QueryAccountRequestSDKType;
+ isAmino(o: any): o is QueryAccountRequestAmino;
+ encode(message: QueryAccountRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountRequest;
+ fromJSON(object: any): QueryAccountRequest;
+ toJSON(message: QueryAccountRequest): unknown;
+ fromPartial(object: DeepPartial): QueryAccountRequest;
+ fromSDK(object: QueryAccountRequestSDKType): QueryAccountRequest;
+ toSDK(message: QueryAccountRequest): QueryAccountRequestSDKType;
+ fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest;
+ toAmino(message: QueryAccountRequest): QueryAccountRequestAmino;
+ fromAminoMsg(object: QueryAccountRequestAminoMsg): QueryAccountRequest;
+ toAminoMsg(message: QueryAccountRequest): QueryAccountRequestAminoMsg;
+ fromProtoMsg(message: QueryAccountRequestProtoMsg): QueryAccountRequest;
+ toProto(message: QueryAccountRequest): Uint8Array;
+ toProtoMsg(message: QueryAccountRequest): QueryAccountRequestProtoMsg;
+};
+export declare const QueryModuleAccountsRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryModuleAccountsRequest;
+ isSDK(o: any): o is QueryModuleAccountsRequestSDKType;
+ isAmino(o: any): o is QueryModuleAccountsRequestAmino;
+ encode(_: QueryModuleAccountsRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsRequest;
+ fromJSON(_: any): QueryModuleAccountsRequest;
+ toJSON(_: QueryModuleAccountsRequest): unknown;
+ fromPartial(_: DeepPartial): QueryModuleAccountsRequest;
+ fromSDK(_: QueryModuleAccountsRequestSDKType): QueryModuleAccountsRequest;
+ toSDK(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestSDKType;
+ fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest;
+ toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino;
+ fromAminoMsg(object: QueryModuleAccountsRequestAminoMsg): QueryModuleAccountsRequest;
+ toAminoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestAminoMsg;
+ fromProtoMsg(message: QueryModuleAccountsRequestProtoMsg): QueryModuleAccountsRequest;
+ toProto(message: QueryModuleAccountsRequest): Uint8Array;
+ toProtoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestProtoMsg;
+};
+export declare const QueryParamsResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryParamsResponse;
+ isSDK(o: any): o is QueryParamsResponseSDKType;
+ isAmino(o: any): o is QueryParamsResponseAmino;
+ encode(message: QueryParamsResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse;
+ fromJSON(object: any): QueryParamsResponse;
+ toJSON(message: QueryParamsResponse): unknown;
+ fromPartial(object: DeepPartial): QueryParamsResponse;
+ fromSDK(object: QueryParamsResponseSDKType): QueryParamsResponse;
+ toSDK(message: QueryParamsResponse): QueryParamsResponseSDKType;
+ fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse;
+ toAmino(message: QueryParamsResponse): QueryParamsResponseAmino;
+ fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse;
+ toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg;
+ fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse;
+ toProto(message: QueryParamsResponse): Uint8Array;
+ toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg;
+};
+export declare const QueryAccountResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryAccountResponse;
+ isSDK(o: any): o is QueryAccountResponseSDKType;
+ isAmino(o: any): o is QueryAccountResponseAmino;
+ encode(message: QueryAccountResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountResponse;
+ fromJSON(object: any): QueryAccountResponse;
+ toJSON(message: QueryAccountResponse): unknown;
+ fromPartial(object: DeepPartial): QueryAccountResponse;
+ fromSDK(object: QueryAccountResponseSDKType): QueryAccountResponse;
+ toSDK(message: QueryAccountResponse): QueryAccountResponseSDKType;
+ fromAmino(object: QueryAccountResponseAmino): QueryAccountResponse;
+ toAmino(message: QueryAccountResponse): QueryAccountResponseAmino;
+ fromAminoMsg(object: QueryAccountResponseAminoMsg): QueryAccountResponse;
+ toAminoMsg(message: QueryAccountResponse): QueryAccountResponseAminoMsg;
+ fromProtoMsg(message: QueryAccountResponseProtoMsg): QueryAccountResponse;
+ toProto(message: QueryAccountResponse): Uint8Array;
+ toProtoMsg(message: QueryAccountResponse): QueryAccountResponseProtoMsg;
+};
+export declare const QueryParamsRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryParamsRequest;
+ isSDK(o: any): o is QueryParamsRequestSDKType;
+ isAmino(o: any): o is QueryParamsRequestAmino;
+ encode(_: QueryParamsRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest;
+ fromJSON(_: any): QueryParamsRequest;
+ toJSON(_: QueryParamsRequest): unknown;
+ fromPartial(_: DeepPartial): QueryParamsRequest;
+ fromSDK(_: QueryParamsRequestSDKType): QueryParamsRequest;
+ toSDK(_: QueryParamsRequest): QueryParamsRequestSDKType;
+ fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest;
+ toAmino(_: QueryParamsRequest): QueryParamsRequestAmino;
+ fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest;
+ toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg;
+ fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest;
+ toProto(message: QueryParamsRequest): Uint8Array;
+ toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg;
+};
+export declare const QueryModuleAccountsResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryModuleAccountsResponse;
+ isSDK(o: any): o is QueryModuleAccountsResponseSDKType;
+ isAmino(o: any): o is QueryModuleAccountsResponseAmino;
+ encode(message: QueryModuleAccountsResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsResponse;
+ fromJSON(object: any): QueryModuleAccountsResponse;
+ toJSON(message: QueryModuleAccountsResponse): unknown;
+ fromPartial(object: DeepPartial): QueryModuleAccountsResponse;
+ fromSDK(object: QueryModuleAccountsResponseSDKType): QueryModuleAccountsResponse;
+ toSDK(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseSDKType;
+ fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse;
+ toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino;
+ fromAminoMsg(object: QueryModuleAccountsResponseAminoMsg): QueryModuleAccountsResponse;
+ toAminoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAminoMsg;
+ fromProtoMsg(message: QueryModuleAccountsResponseProtoMsg): QueryModuleAccountsResponse;
+ toProto(message: QueryModuleAccountsResponse): Uint8Array;
+ toProtoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseProtoMsg;
+};
+export declare const Bech32PrefixRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Bech32PrefixRequest;
+ isSDK(o: any): o is Bech32PrefixRequestSDKType;
+ isAmino(o: any): o is Bech32PrefixRequestAmino;
+ encode(_: Bech32PrefixRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixRequest;
+ fromJSON(_: any): Bech32PrefixRequest;
+ toJSON(_: Bech32PrefixRequest): unknown;
+ fromPartial(_: DeepPartial): Bech32PrefixRequest;
+ fromSDK(_: Bech32PrefixRequestSDKType): Bech32PrefixRequest;
+ toSDK(_: Bech32PrefixRequest): Bech32PrefixRequestSDKType;
+ fromAmino(_: Bech32PrefixRequestAmino): Bech32PrefixRequest;
+ toAmino(_: Bech32PrefixRequest): Bech32PrefixRequestAmino;
+ fromAminoMsg(object: Bech32PrefixRequestAminoMsg): Bech32PrefixRequest;
+ toAminoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestAminoMsg;
+ fromProtoMsg(message: Bech32PrefixRequestProtoMsg): Bech32PrefixRequest;
+ toProto(message: Bech32PrefixRequest): Uint8Array;
+ toProtoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestProtoMsg;
+};
+export declare const Bech32PrefixResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Bech32PrefixResponse;
+ isSDK(o: any): o is Bech32PrefixResponseSDKType;
+ isAmino(o: any): o is Bech32PrefixResponseAmino;
+ encode(message: Bech32PrefixResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixResponse;
+ fromJSON(object: any): Bech32PrefixResponse;
+ toJSON(message: Bech32PrefixResponse): unknown;
+ fromPartial(object: DeepPartial): Bech32PrefixResponse;
+ fromSDK(object: Bech32PrefixResponseSDKType): Bech32PrefixResponse;
+ toSDK(message: Bech32PrefixResponse): Bech32PrefixResponseSDKType;
+ fromAmino(object: Bech32PrefixResponseAmino): Bech32PrefixResponse;
+ toAmino(message: Bech32PrefixResponse): Bech32PrefixResponseAmino;
+ fromAminoMsg(object: Bech32PrefixResponseAminoMsg): Bech32PrefixResponse;
+ toAminoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseAminoMsg;
+ fromProtoMsg(message: Bech32PrefixResponseProtoMsg): Bech32PrefixResponse;
+ toProto(message: Bech32PrefixResponse): Uint8Array;
+ toProtoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseProtoMsg;
+};
+export declare const AddressBytesToStringRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is AddressBytesToStringRequest;
+ isSDK(o: any): o is AddressBytesToStringRequestSDKType;
+ isAmino(o: any): o is AddressBytesToStringRequestAmino;
+ encode(message: AddressBytesToStringRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringRequest;
+ fromJSON(object: any): AddressBytesToStringRequest;
+ toJSON(message: AddressBytesToStringRequest): unknown;
+ fromPartial(object: DeepPartial): AddressBytesToStringRequest;
+ fromSDK(object: AddressBytesToStringRequestSDKType): AddressBytesToStringRequest;
+ toSDK(message: AddressBytesToStringRequest): AddressBytesToStringRequestSDKType;
+ fromAmino(object: AddressBytesToStringRequestAmino): AddressBytesToStringRequest;
+ toAmino(message: AddressBytesToStringRequest): AddressBytesToStringRequestAmino;
+ fromAminoMsg(object: AddressBytesToStringRequestAminoMsg): AddressBytesToStringRequest;
+ toAminoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestAminoMsg;
+ fromProtoMsg(message: AddressBytesToStringRequestProtoMsg): AddressBytesToStringRequest;
+ toProto(message: AddressBytesToStringRequest): Uint8Array;
+ toProtoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestProtoMsg;
+};
+export declare const AddressBytesToStringResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is AddressBytesToStringResponse;
+ isSDK(o: any): o is AddressBytesToStringResponseSDKType;
+ isAmino(o: any): o is AddressBytesToStringResponseAmino;
+ encode(message: AddressBytesToStringResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringResponse;
+ fromJSON(object: any): AddressBytesToStringResponse;
+ toJSON(message: AddressBytesToStringResponse): unknown;
+ fromPartial(object: DeepPartial): AddressBytesToStringResponse;
+ fromSDK(object: AddressBytesToStringResponseSDKType): AddressBytesToStringResponse;
+ toSDK(message: AddressBytesToStringResponse): AddressBytesToStringResponseSDKType;
+ fromAmino(object: AddressBytesToStringResponseAmino): AddressBytesToStringResponse;
+ toAmino(message: AddressBytesToStringResponse): AddressBytesToStringResponseAmino;
+ fromAminoMsg(object: AddressBytesToStringResponseAminoMsg): AddressBytesToStringResponse;
+ toAminoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseAminoMsg;
+ fromProtoMsg(message: AddressBytesToStringResponseProtoMsg): AddressBytesToStringResponse;
+ toProto(message: AddressBytesToStringResponse): Uint8Array;
+ toProtoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseProtoMsg;
+};
+export declare const AddressStringToBytesRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is AddressStringToBytesRequest;
+ isSDK(o: any): o is AddressStringToBytesRequestSDKType;
+ isAmino(o: any): o is AddressStringToBytesRequestAmino;
+ encode(message: AddressStringToBytesRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesRequest;
+ fromJSON(object: any): AddressStringToBytesRequest;
+ toJSON(message: AddressStringToBytesRequest): unknown;
+ fromPartial(object: DeepPartial): AddressStringToBytesRequest;
+ fromSDK(object: AddressStringToBytesRequestSDKType): AddressStringToBytesRequest;
+ toSDK(message: AddressStringToBytesRequest): AddressStringToBytesRequestSDKType;
+ fromAmino(object: AddressStringToBytesRequestAmino): AddressStringToBytesRequest;
+ toAmino(message: AddressStringToBytesRequest): AddressStringToBytesRequestAmino;
+ fromAminoMsg(object: AddressStringToBytesRequestAminoMsg): AddressStringToBytesRequest;
+ toAminoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestAminoMsg;
+ fromProtoMsg(message: AddressStringToBytesRequestProtoMsg): AddressStringToBytesRequest;
+ toProto(message: AddressStringToBytesRequest): Uint8Array;
+ toProtoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestProtoMsg;
+};
+export declare const AddressStringToBytesResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is AddressStringToBytesResponse;
+ isSDK(o: any): o is AddressStringToBytesResponseSDKType;
+ isAmino(o: any): o is AddressStringToBytesResponseAmino;
+ encode(message: AddressStringToBytesResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesResponse;
+ fromJSON(object: any): AddressStringToBytesResponse;
+ toJSON(message: AddressStringToBytesResponse): unknown;
+ fromPartial(object: DeepPartial): AddressStringToBytesResponse;
+ fromSDK(object: AddressStringToBytesResponseSDKType): AddressStringToBytesResponse;
+ toSDK(message: AddressStringToBytesResponse): AddressStringToBytesResponseSDKType;
+ fromAmino(object: AddressStringToBytesResponseAmino): AddressStringToBytesResponse;
+ toAmino(message: AddressStringToBytesResponse): AddressStringToBytesResponseAmino;
+ fromAminoMsg(object: AddressStringToBytesResponseAminoMsg): AddressStringToBytesResponse;
+ toAminoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseAminoMsg;
+ fromProtoMsg(message: AddressStringToBytesResponseProtoMsg): AddressStringToBytesResponse;
+ toProto(message: AddressStringToBytesResponse): Uint8Array;
+ toProtoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/auth/v1beta1/query.rpc.Query.d.ts b/examples/authz/types/codegen/cosmos/auth/v1beta1/query.rpc.Query.d.ts
new file mode 100644
index 00000000..6d17e2b5
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/auth/v1beta1/query.rpc.Query.d.ts
@@ -0,0 +1,122 @@
+import { TxRpc } from "../../../types";
+import { ReactQueryParams } from "../../../react-query";
+import { ProtobufRpcClient } from "@cosmjs/stargate";
+import { QueryStore } from "../../../mobx";
+import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse } from "./query";
+/** Query defines the gRPC querier service. */
+export interface Query {
+ /**
+ * Accounts returns all the existing accounts
+ *
+ * Since: cosmos-sdk 0.43
+ */
+ accounts(request?: QueryAccountsRequest): Promise;
+ /** Account returns account details based on address. */
+ account(request: QueryAccountRequest): Promise;
+ /** Params queries all parameters. */
+ params(request?: QueryParamsRequest): Promise;
+ /** ModuleAccounts returns all the existing module accounts. */
+ moduleAccounts(request?: QueryModuleAccountsRequest): Promise;
+ /** Bech32 queries bech32Prefix */
+ bech32Prefix(request?: Bech32PrefixRequest): Promise;
+ /** AddressBytesToString converts Account Address bytes to string */
+ addressBytesToString(request: AddressBytesToStringRequest): Promise;
+ /** AddressStringToBytes converts Address string to bytes */
+ addressStringToBytes(request: AddressStringToBytesRequest): Promise;
+}
+export declare class QueryClientImpl implements Query {
+ private readonly rpc;
+ constructor(rpc: TxRpc);
+ accounts: (request?: QueryAccountsRequest) => Promise;
+ account: (request: QueryAccountRequest) => Promise;
+ params: (request?: QueryParamsRequest) => Promise;
+ moduleAccounts: (request?: QueryModuleAccountsRequest) => Promise;
+ bech32Prefix: (request?: Bech32PrefixRequest) => Promise;
+ addressBytesToString: (request: AddressBytesToStringRequest) => Promise;
+ addressStringToBytes: (request: AddressStringToBytesRequest) => Promise;
+}
+export declare const createClientImpl: (rpc: TxRpc) => QueryClientImpl;
+export interface UseAccountsQuery extends ReactQueryParams {
+ request?: QueryAccountsRequest;
+}
+export interface UseAccountQuery extends ReactQueryParams {
+ request: QueryAccountRequest;
+}
+export interface UseParamsQuery extends ReactQueryParams {
+ request?: QueryParamsRequest;
+}
+export interface UseModuleAccountsQuery extends ReactQueryParams {
+ request?: QueryModuleAccountsRequest;
+}
+export interface UseBech32PrefixQuery extends ReactQueryParams {
+ request?: Bech32PrefixRequest;
+}
+export interface UseAddressBytesToStringQuery extends ReactQueryParams {
+ request: AddressBytesToStringRequest;
+}
+export interface UseAddressStringToBytesQuery extends ReactQueryParams {
+ request: AddressStringToBytesRequest;
+}
+export declare const createRpcQueryHooks: (rpc: ProtobufRpcClient | undefined) => {
+ /**
+ * Accounts returns all the existing accounts
+ *
+ * Since: cosmos-sdk 0.43
+ */
+ useAccounts: ({ request, options }: UseAccountsQuery) => import("@tanstack/react-query").UseQueryResult;
+ /** Account returns account details based on address. */ useAccount: ({ request, options }: UseAccountQuery) => import("@tanstack/react-query").UseQueryResult;
+ /** Params queries all parameters. */ useParams: ({ request, options }: UseParamsQuery) => import("@tanstack/react-query").UseQueryResult;
+ /** ModuleAccounts returns all the existing module accounts. */ useModuleAccounts: ({ request, options }: UseModuleAccountsQuery) => import("@tanstack/react-query").UseQueryResult;
+ /** Bech32 queries bech32Prefix */ useBech32Prefix: ({ request, options }: UseBech32PrefixQuery) => import("@tanstack/react-query").UseQueryResult;
+ /** AddressBytesToString converts Account Address bytes to string */ useAddressBytesToString: ({ request, options }: UseAddressBytesToStringQuery) => import("@tanstack/react-query").UseQueryResult;
+ /** AddressStringToBytes converts Address string to bytes */ useAddressStringToBytes: ({ request, options }: UseAddressStringToBytesQuery) => import("@tanstack/react-query").UseQueryResult;
+};
+export declare const createRpcQueryMobxStores: (rpc: ProtobufRpcClient | undefined) => {
+ /**
+ * Accounts returns all the existing accounts
+ *
+ * Since: cosmos-sdk 0.43
+ */
+ QueryAccountsStore: {
+ new (): {
+ store: QueryStore;
+ accounts(request: QueryAccountsRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /** Account returns account details based on address. */ QueryAccountStore: {
+ new (): {
+ store: QueryStore;
+ account(request: QueryAccountRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /** Params queries all parameters. */ QueryParamsStore: {
+ new (): {
+ store: QueryStore;
+ params(request: QueryParamsRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /** ModuleAccounts returns all the existing module accounts. */ QueryModuleAccountsStore: {
+ new (): {
+ store: QueryStore;
+ moduleAccounts(request: QueryModuleAccountsRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /** Bech32 queries bech32Prefix */ QueryBech32PrefixStore: {
+ new (): {
+ store: QueryStore;
+ bech32Prefix(request: Bech32PrefixRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /** AddressBytesToString converts Account Address bytes to string */ QueryAddressBytesToStringStore: {
+ new (): {
+ store: QueryStore;
+ addressBytesToString(request: AddressBytesToStringRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /** AddressStringToBytes converts Address string to bytes */ QueryAddressStringToBytesStore: {
+ new (): {
+ store: QueryStore;
+ addressStringToBytes(request: AddressStringToBytesRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/authz.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/authz.d.ts
new file mode 100644
index 00000000..1fdaa53a
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/authz.d.ts
@@ -0,0 +1,230 @@
+import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any";
+import { SendAuthorization, SendAuthorizationProtoMsg, SendAuthorizationSDKType } from "../../bank/v1beta1/authz";
+import { StakeAuthorization, StakeAuthorizationProtoMsg, StakeAuthorizationSDKType } from "../../staking/v1beta1/authz";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/**
+ * GenericAuthorization gives the grantee unrestricted permissions to execute
+ * the provided method on behalf of the granter's account.
+ */
+export interface GenericAuthorization {
+ $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization";
+ /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */
+ msg: string;
+}
+export interface GenericAuthorizationProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.GenericAuthorization";
+ value: Uint8Array;
+}
+/**
+ * GenericAuthorization gives the grantee unrestricted permissions to execute
+ * the provided method on behalf of the granter's account.
+ */
+export interface GenericAuthorizationAmino {
+ /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */
+ msg?: string;
+}
+export interface GenericAuthorizationAminoMsg {
+ type: "cosmos-sdk/GenericAuthorization";
+ value: GenericAuthorizationAmino;
+}
+/**
+ * GenericAuthorization gives the grantee unrestricted permissions to execute
+ * the provided method on behalf of the granter's account.
+ */
+export interface GenericAuthorizationSDKType {
+ $typeUrl?: "/cosmos.authz.v1beta1.GenericAuthorization";
+ msg: string;
+}
+/**
+ * Grant gives permissions to execute
+ * the provide method with expiration time.
+ */
+export interface Grant {
+ authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | Any | undefined;
+ /**
+ * time when the grant will expire and will be pruned. If null, then the grant
+ * doesn't have a time expiration (other conditions in `authorization`
+ * may apply to invalidate the grant)
+ */
+ expiration?: Date | undefined;
+}
+export interface GrantProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.Grant";
+ value: Uint8Array;
+}
+export type GrantEncoded = Omit & {
+ authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined;
+};
+/**
+ * Grant gives permissions to execute
+ * the provide method with expiration time.
+ */
+export interface GrantAmino {
+ authorization?: AnyAmino | undefined;
+ /**
+ * time when the grant will expire and will be pruned. If null, then the grant
+ * doesn't have a time expiration (other conditions in `authorization`
+ * may apply to invalidate the grant)
+ */
+ expiration?: string | undefined;
+}
+export interface GrantAminoMsg {
+ type: "cosmos-sdk/Grant";
+ value: GrantAmino;
+}
+/**
+ * Grant gives permissions to execute
+ * the provide method with expiration time.
+ */
+export interface GrantSDKType {
+ authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined;
+ expiration?: Date | undefined;
+}
+/**
+ * GrantAuthorization extends a grant with both the addresses of the grantee and granter.
+ * It is used in genesis.proto and query.proto
+ */
+export interface GrantAuthorization {
+ granter: string;
+ grantee: string;
+ authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | Any | undefined;
+ expiration?: Date | undefined;
+}
+export interface GrantAuthorizationProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization";
+ value: Uint8Array;
+}
+export type GrantAuthorizationEncoded = Omit & {
+ authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined;
+};
+/**
+ * GrantAuthorization extends a grant with both the addresses of the grantee and granter.
+ * It is used in genesis.proto and query.proto
+ */
+export interface GrantAuthorizationAmino {
+ granter?: string;
+ grantee?: string;
+ authorization?: AnyAmino | undefined;
+ expiration?: string | undefined;
+}
+export interface GrantAuthorizationAminoMsg {
+ type: "cosmos-sdk/GrantAuthorization";
+ value: GrantAuthorizationAmino;
+}
+/**
+ * GrantAuthorization extends a grant with both the addresses of the grantee and granter.
+ * It is used in genesis.proto and query.proto
+ */
+export interface GrantAuthorizationSDKType {
+ granter: string;
+ grantee: string;
+ authorization?: GenericAuthorizationSDKType | SendAuthorizationSDKType | StakeAuthorizationSDKType | AnySDKType | undefined;
+ expiration?: Date | undefined;
+}
+/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */
+export interface GrantQueueItem {
+ /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */
+ msgTypeUrls: string[];
+}
+export interface GrantQueueItemProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem";
+ value: Uint8Array;
+}
+/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */
+export interface GrantQueueItemAmino {
+ /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */
+ msg_type_urls?: string[];
+}
+export interface GrantQueueItemAminoMsg {
+ type: "cosmos-sdk/GrantQueueItem";
+ value: GrantQueueItemAmino;
+}
+/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */
+export interface GrantQueueItemSDKType {
+ msg_type_urls: string[];
+}
+export declare const GenericAuthorization: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is GenericAuthorization;
+ isSDK(o: any): o is GenericAuthorizationSDKType;
+ isAmino(o: any): o is GenericAuthorizationAmino;
+ encode(message: GenericAuthorization, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): GenericAuthorization;
+ fromJSON(object: any): GenericAuthorization;
+ toJSON(message: GenericAuthorization): unknown;
+ fromPartial(object: DeepPartial): GenericAuthorization;
+ fromSDK(object: GenericAuthorizationSDKType): GenericAuthorization;
+ toSDK(message: GenericAuthorization): GenericAuthorizationSDKType;
+ fromAmino(object: GenericAuthorizationAmino): GenericAuthorization;
+ toAmino(message: GenericAuthorization): GenericAuthorizationAmino;
+ fromAminoMsg(object: GenericAuthorizationAminoMsg): GenericAuthorization;
+ toAminoMsg(message: GenericAuthorization): GenericAuthorizationAminoMsg;
+ fromProtoMsg(message: GenericAuthorizationProtoMsg): GenericAuthorization;
+ toProto(message: GenericAuthorization): Uint8Array;
+ toProtoMsg(message: GenericAuthorization): GenericAuthorizationProtoMsg;
+};
+export declare const Grant: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Grant;
+ isSDK(o: any): o is GrantSDKType;
+ isAmino(o: any): o is GrantAmino;
+ encode(message: Grant, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Grant;
+ fromJSON(object: any): Grant;
+ toJSON(message: Grant): unknown;
+ fromPartial(object: DeepPartial): Grant;
+ fromSDK(object: GrantSDKType): Grant;
+ toSDK(message: Grant): GrantSDKType;
+ fromAmino(object: GrantAmino): Grant;
+ toAmino(message: Grant): GrantAmino;
+ fromAminoMsg(object: GrantAminoMsg): Grant;
+ toAminoMsg(message: Grant): GrantAminoMsg;
+ fromProtoMsg(message: GrantProtoMsg): Grant;
+ toProto(message: Grant): Uint8Array;
+ toProtoMsg(message: Grant): GrantProtoMsg;
+};
+export declare const GrantAuthorization: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is GrantAuthorization;
+ isSDK(o: any): o is GrantAuthorizationSDKType;
+ isAmino(o: any): o is GrantAuthorizationAmino;
+ encode(message: GrantAuthorization, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): GrantAuthorization;
+ fromJSON(object: any): GrantAuthorization;
+ toJSON(message: GrantAuthorization): unknown;
+ fromPartial(object: DeepPartial): GrantAuthorization;
+ fromSDK(object: GrantAuthorizationSDKType): GrantAuthorization;
+ toSDK(message: GrantAuthorization): GrantAuthorizationSDKType;
+ fromAmino(object: GrantAuthorizationAmino): GrantAuthorization;
+ toAmino(message: GrantAuthorization): GrantAuthorizationAmino;
+ fromAminoMsg(object: GrantAuthorizationAminoMsg): GrantAuthorization;
+ toAminoMsg(message: GrantAuthorization): GrantAuthorizationAminoMsg;
+ fromProtoMsg(message: GrantAuthorizationProtoMsg): GrantAuthorization;
+ toProto(message: GrantAuthorization): Uint8Array;
+ toProtoMsg(message: GrantAuthorization): GrantAuthorizationProtoMsg;
+};
+export declare const GrantQueueItem: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is GrantQueueItem;
+ isSDK(o: any): o is GrantQueueItemSDKType;
+ isAmino(o: any): o is GrantQueueItemAmino;
+ encode(message: GrantQueueItem, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): GrantQueueItem;
+ fromJSON(object: any): GrantQueueItem;
+ toJSON(message: GrantQueueItem): unknown;
+ fromPartial(object: DeepPartial): GrantQueueItem;
+ fromSDK(object: GrantQueueItemSDKType): GrantQueueItem;
+ toSDK(message: GrantQueueItem): GrantQueueItemSDKType;
+ fromAmino(object: GrantQueueItemAmino): GrantQueueItem;
+ toAmino(message: GrantQueueItem): GrantQueueItemAmino;
+ fromAminoMsg(object: GrantQueueItemAminoMsg): GrantQueueItem;
+ toAminoMsg(message: GrantQueueItem): GrantQueueItemAminoMsg;
+ fromProtoMsg(message: GrantQueueItemProtoMsg): GrantQueueItem;
+ toProto(message: GrantQueueItem): Uint8Array;
+ toProtoMsg(message: GrantQueueItem): GrantQueueItemProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/event.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/event.d.ts
new file mode 100644
index 00000000..fefd89cb
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/event.d.ts
@@ -0,0 +1,108 @@
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/** EventGrant is emitted on Msg/Grant */
+export interface EventGrant {
+ /** Msg type URL for which an autorization is granted */
+ msgTypeUrl: string;
+ /** Granter account address */
+ granter: string;
+ /** Grantee account address */
+ grantee: string;
+}
+export interface EventGrantProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.EventGrant";
+ value: Uint8Array;
+}
+/** EventGrant is emitted on Msg/Grant */
+export interface EventGrantAmino {
+ /** Msg type URL for which an autorization is granted */
+ msg_type_url?: string;
+ /** Granter account address */
+ granter?: string;
+ /** Grantee account address */
+ grantee?: string;
+}
+export interface EventGrantAminoMsg {
+ type: "cosmos-sdk/EventGrant";
+ value: EventGrantAmino;
+}
+/** EventGrant is emitted on Msg/Grant */
+export interface EventGrantSDKType {
+ msg_type_url: string;
+ granter: string;
+ grantee: string;
+}
+/** EventRevoke is emitted on Msg/Revoke */
+export interface EventRevoke {
+ /** Msg type URL for which an autorization is revoked */
+ msgTypeUrl: string;
+ /** Granter account address */
+ granter: string;
+ /** Grantee account address */
+ grantee: string;
+}
+export interface EventRevokeProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.EventRevoke";
+ value: Uint8Array;
+}
+/** EventRevoke is emitted on Msg/Revoke */
+export interface EventRevokeAmino {
+ /** Msg type URL for which an autorization is revoked */
+ msg_type_url?: string;
+ /** Granter account address */
+ granter?: string;
+ /** Grantee account address */
+ grantee?: string;
+}
+export interface EventRevokeAminoMsg {
+ type: "cosmos-sdk/EventRevoke";
+ value: EventRevokeAmino;
+}
+/** EventRevoke is emitted on Msg/Revoke */
+export interface EventRevokeSDKType {
+ msg_type_url: string;
+ granter: string;
+ grantee: string;
+}
+export declare const EventGrant: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is EventGrant;
+ isSDK(o: any): o is EventGrantSDKType;
+ isAmino(o: any): o is EventGrantAmino;
+ encode(message: EventGrant, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): EventGrant;
+ fromJSON(object: any): EventGrant;
+ toJSON(message: EventGrant): unknown;
+ fromPartial(object: DeepPartial): EventGrant;
+ fromSDK(object: EventGrantSDKType): EventGrant;
+ toSDK(message: EventGrant): EventGrantSDKType;
+ fromAmino(object: EventGrantAmino): EventGrant;
+ toAmino(message: EventGrant): EventGrantAmino;
+ fromAminoMsg(object: EventGrantAminoMsg): EventGrant;
+ toAminoMsg(message: EventGrant): EventGrantAminoMsg;
+ fromProtoMsg(message: EventGrantProtoMsg): EventGrant;
+ toProto(message: EventGrant): Uint8Array;
+ toProtoMsg(message: EventGrant): EventGrantProtoMsg;
+};
+export declare const EventRevoke: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is EventRevoke;
+ isSDK(o: any): o is EventRevokeSDKType;
+ isAmino(o: any): o is EventRevokeAmino;
+ encode(message: EventRevoke, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): EventRevoke;
+ fromJSON(object: any): EventRevoke;
+ toJSON(message: EventRevoke): unknown;
+ fromPartial(object: DeepPartial): EventRevoke;
+ fromSDK(object: EventRevokeSDKType): EventRevoke;
+ toSDK(message: EventRevoke): EventRevokeSDKType;
+ fromAmino(object: EventRevokeAmino): EventRevoke;
+ toAmino(message: EventRevoke): EventRevokeAmino;
+ fromAminoMsg(object: EventRevokeAminoMsg): EventRevoke;
+ toAminoMsg(message: EventRevoke): EventRevokeAminoMsg;
+ fromProtoMsg(message: EventRevokeProtoMsg): EventRevoke;
+ toProto(message: EventRevoke): Uint8Array;
+ toProtoMsg(message: EventRevoke): EventRevokeProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/genesis.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/genesis.d.ts
new file mode 100644
index 00000000..475a7287
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/genesis.d.ts
@@ -0,0 +1,44 @@
+import { GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/** GenesisState defines the authz module's genesis state. */
+export interface GenesisState {
+ authorization: GrantAuthorization[];
+}
+export interface GenesisStateProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.GenesisState";
+ value: Uint8Array;
+}
+/** GenesisState defines the authz module's genesis state. */
+export interface GenesisStateAmino {
+ authorization?: GrantAuthorizationAmino[];
+}
+export interface GenesisStateAminoMsg {
+ type: "cosmos-sdk/GenesisState";
+ value: GenesisStateAmino;
+}
+/** GenesisState defines the authz module's genesis state. */
+export interface GenesisStateSDKType {
+ authorization: GrantAuthorizationSDKType[];
+}
+export declare const GenesisState: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is GenesisState;
+ isSDK(o: any): o is GenesisStateSDKType;
+ isAmino(o: any): o is GenesisStateAmino;
+ encode(message: GenesisState, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): GenesisState;
+ fromJSON(object: any): GenesisState;
+ toJSON(message: GenesisState): unknown;
+ fromPartial(object: DeepPartial): GenesisState;
+ fromSDK(object: GenesisStateSDKType): GenesisState;
+ toSDK(message: GenesisState): GenesisStateSDKType;
+ fromAmino(object: GenesisStateAmino): GenesisState;
+ toAmino(message: GenesisState): GenesisStateAmino;
+ fromAminoMsg(object: GenesisStateAminoMsg): GenesisState;
+ toAminoMsg(message: GenesisState): GenesisStateAminoMsg;
+ fromProtoMsg(message: GenesisStateProtoMsg): GenesisState;
+ toProto(message: GenesisState): Uint8Array;
+ toProtoMsg(message: GenesisState): GenesisStateProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/query.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/query.d.ts
new file mode 100644
index 00000000..407cb422
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/query.d.ts
@@ -0,0 +1,294 @@
+import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination";
+import { Grant, GrantAmino, GrantSDKType, GrantAuthorization, GrantAuthorizationAmino, GrantAuthorizationSDKType } from "./authz";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/** QueryGrantsRequest is the request type for the Query/Grants RPC method. */
+export interface QueryGrantsRequest {
+ granter: string;
+ grantee: string;
+ /** Optional, msg_type_url, when set, will query only grants matching given msg type. */
+ msgTypeUrl: string;
+ /** pagination defines an pagination for the request. */
+ pagination?: PageRequest | undefined;
+}
+export interface QueryGrantsRequestProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.QueryGrantsRequest";
+ value: Uint8Array;
+}
+/** QueryGrantsRequest is the request type for the Query/Grants RPC method. */
+export interface QueryGrantsRequestAmino {
+ granter?: string;
+ grantee?: string;
+ /** Optional, msg_type_url, when set, will query only grants matching given msg type. */
+ msg_type_url?: string;
+ /** pagination defines an pagination for the request. */
+ pagination?: PageRequestAmino | undefined;
+}
+export interface QueryGrantsRequestAminoMsg {
+ type: "cosmos-sdk/QueryGrantsRequest";
+ value: QueryGrantsRequestAmino;
+}
+/** QueryGrantsRequest is the request type for the Query/Grants RPC method. */
+export interface QueryGrantsRequestSDKType {
+ granter: string;
+ grantee: string;
+ msg_type_url: string;
+ pagination?: PageRequestSDKType | undefined;
+}
+/** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */
+export interface QueryGrantsResponse {
+ /** authorizations is a list of grants granted for grantee by granter. */
+ grants: Grant[];
+ /** pagination defines an pagination for the response. */
+ pagination?: PageResponse | undefined;
+}
+export interface QueryGrantsResponseProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.QueryGrantsResponse";
+ value: Uint8Array;
+}
+/** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */
+export interface QueryGrantsResponseAmino {
+ /** authorizations is a list of grants granted for grantee by granter. */
+ grants?: GrantAmino[];
+ /** pagination defines an pagination for the response. */
+ pagination?: PageResponseAmino | undefined;
+}
+export interface QueryGrantsResponseAminoMsg {
+ type: "cosmos-sdk/QueryGrantsResponse";
+ value: QueryGrantsResponseAmino;
+}
+/** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */
+export interface QueryGrantsResponseSDKType {
+ grants: GrantSDKType[];
+ pagination?: PageResponseSDKType | undefined;
+}
+/** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */
+export interface QueryGranterGrantsRequest {
+ granter: string;
+ /** pagination defines an pagination for the request. */
+ pagination?: PageRequest | undefined;
+}
+export interface QueryGranterGrantsRequestProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsRequest";
+ value: Uint8Array;
+}
+/** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */
+export interface QueryGranterGrantsRequestAmino {
+ granter?: string;
+ /** pagination defines an pagination for the request. */
+ pagination?: PageRequestAmino | undefined;
+}
+export interface QueryGranterGrantsRequestAminoMsg {
+ type: "cosmos-sdk/QueryGranterGrantsRequest";
+ value: QueryGranterGrantsRequestAmino;
+}
+/** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */
+export interface QueryGranterGrantsRequestSDKType {
+ granter: string;
+ pagination?: PageRequestSDKType | undefined;
+}
+/** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */
+export interface QueryGranterGrantsResponse {
+ /** grants is a list of grants granted by the granter. */
+ grants: GrantAuthorization[];
+ /** pagination defines an pagination for the response. */
+ pagination?: PageResponse | undefined;
+}
+export interface QueryGranterGrantsResponseProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.QueryGranterGrantsResponse";
+ value: Uint8Array;
+}
+/** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */
+export interface QueryGranterGrantsResponseAmino {
+ /** grants is a list of grants granted by the granter. */
+ grants?: GrantAuthorizationAmino[];
+ /** pagination defines an pagination for the response. */
+ pagination?: PageResponseAmino | undefined;
+}
+export interface QueryGranterGrantsResponseAminoMsg {
+ type: "cosmos-sdk/QueryGranterGrantsResponse";
+ value: QueryGranterGrantsResponseAmino;
+}
+/** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */
+export interface QueryGranterGrantsResponseSDKType {
+ grants: GrantAuthorizationSDKType[];
+ pagination?: PageResponseSDKType | undefined;
+}
+/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */
+export interface QueryGranteeGrantsRequest {
+ grantee: string;
+ /** pagination defines an pagination for the request. */
+ pagination?: PageRequest | undefined;
+}
+export interface QueryGranteeGrantsRequestProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest";
+ value: Uint8Array;
+}
+/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */
+export interface QueryGranteeGrantsRequestAmino {
+ grantee?: string;
+ /** pagination defines an pagination for the request. */
+ pagination?: PageRequestAmino | undefined;
+}
+export interface QueryGranteeGrantsRequestAminoMsg {
+ type: "cosmos-sdk/QueryGranteeGrantsRequest";
+ value: QueryGranteeGrantsRequestAmino;
+}
+/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */
+export interface QueryGranteeGrantsRequestSDKType {
+ grantee: string;
+ pagination?: PageRequestSDKType | undefined;
+}
+/** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */
+export interface QueryGranteeGrantsResponse {
+ /** grants is a list of grants granted to the grantee. */
+ grants: GrantAuthorization[];
+ /** pagination defines an pagination for the response. */
+ pagination?: PageResponse | undefined;
+}
+export interface QueryGranteeGrantsResponseProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse";
+ value: Uint8Array;
+}
+/** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */
+export interface QueryGranteeGrantsResponseAmino {
+ /** grants is a list of grants granted to the grantee. */
+ grants?: GrantAuthorizationAmino[];
+ /** pagination defines an pagination for the response. */
+ pagination?: PageResponseAmino | undefined;
+}
+export interface QueryGranteeGrantsResponseAminoMsg {
+ type: "cosmos-sdk/QueryGranteeGrantsResponse";
+ value: QueryGranteeGrantsResponseAmino;
+}
+/** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */
+export interface QueryGranteeGrantsResponseSDKType {
+ grants: GrantAuthorizationSDKType[];
+ pagination?: PageResponseSDKType | undefined;
+}
+export declare const QueryGrantsRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryGrantsRequest;
+ isSDK(o: any): o is QueryGrantsRequestSDKType;
+ isAmino(o: any): o is QueryGrantsRequestAmino;
+ encode(message: QueryGrantsRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsRequest;
+ fromJSON(object: any): QueryGrantsRequest;
+ toJSON(message: QueryGrantsRequest): unknown;
+ fromPartial(object: DeepPartial): QueryGrantsRequest;
+ fromSDK(object: QueryGrantsRequestSDKType): QueryGrantsRequest;
+ toSDK(message: QueryGrantsRequest): QueryGrantsRequestSDKType;
+ fromAmino(object: QueryGrantsRequestAmino): QueryGrantsRequest;
+ toAmino(message: QueryGrantsRequest): QueryGrantsRequestAmino;
+ fromAminoMsg(object: QueryGrantsRequestAminoMsg): QueryGrantsRequest;
+ toAminoMsg(message: QueryGrantsRequest): QueryGrantsRequestAminoMsg;
+ fromProtoMsg(message: QueryGrantsRequestProtoMsg): QueryGrantsRequest;
+ toProto(message: QueryGrantsRequest): Uint8Array;
+ toProtoMsg(message: QueryGrantsRequest): QueryGrantsRequestProtoMsg;
+};
+export declare const QueryGrantsResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryGrantsResponse;
+ isSDK(o: any): o is QueryGrantsResponseSDKType;
+ isAmino(o: any): o is QueryGrantsResponseAmino;
+ encode(message: QueryGrantsResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsResponse;
+ fromJSON(object: any): QueryGrantsResponse;
+ toJSON(message: QueryGrantsResponse): unknown;
+ fromPartial(object: DeepPartial): QueryGrantsResponse;
+ fromSDK(object: QueryGrantsResponseSDKType): QueryGrantsResponse;
+ toSDK(message: QueryGrantsResponse): QueryGrantsResponseSDKType;
+ fromAmino(object: QueryGrantsResponseAmino): QueryGrantsResponse;
+ toAmino(message: QueryGrantsResponse): QueryGrantsResponseAmino;
+ fromAminoMsg(object: QueryGrantsResponseAminoMsg): QueryGrantsResponse;
+ toAminoMsg(message: QueryGrantsResponse): QueryGrantsResponseAminoMsg;
+ fromProtoMsg(message: QueryGrantsResponseProtoMsg): QueryGrantsResponse;
+ toProto(message: QueryGrantsResponse): Uint8Array;
+ toProtoMsg(message: QueryGrantsResponse): QueryGrantsResponseProtoMsg;
+};
+export declare const QueryGranterGrantsRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryGranterGrantsRequest;
+ isSDK(o: any): o is QueryGranterGrantsRequestSDKType;
+ isAmino(o: any): o is QueryGranterGrantsRequestAmino;
+ encode(message: QueryGranterGrantsRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsRequest;
+ fromJSON(object: any): QueryGranterGrantsRequest;
+ toJSON(message: QueryGranterGrantsRequest): unknown;
+ fromPartial(object: DeepPartial): QueryGranterGrantsRequest;
+ fromSDK(object: QueryGranterGrantsRequestSDKType): QueryGranterGrantsRequest;
+ toSDK(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestSDKType;
+ fromAmino(object: QueryGranterGrantsRequestAmino): QueryGranterGrantsRequest;
+ toAmino(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAmino;
+ fromAminoMsg(object: QueryGranterGrantsRequestAminoMsg): QueryGranterGrantsRequest;
+ toAminoMsg(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestAminoMsg;
+ fromProtoMsg(message: QueryGranterGrantsRequestProtoMsg): QueryGranterGrantsRequest;
+ toProto(message: QueryGranterGrantsRequest): Uint8Array;
+ toProtoMsg(message: QueryGranterGrantsRequest): QueryGranterGrantsRequestProtoMsg;
+};
+export declare const QueryGranterGrantsResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryGranterGrantsResponse;
+ isSDK(o: any): o is QueryGranterGrantsResponseSDKType;
+ isAmino(o: any): o is QueryGranterGrantsResponseAmino;
+ encode(message: QueryGranterGrantsResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsResponse;
+ fromJSON(object: any): QueryGranterGrantsResponse;
+ toJSON(message: QueryGranterGrantsResponse): unknown;
+ fromPartial(object: DeepPartial): QueryGranterGrantsResponse;
+ fromSDK(object: QueryGranterGrantsResponseSDKType): QueryGranterGrantsResponse;
+ toSDK(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseSDKType;
+ fromAmino(object: QueryGranterGrantsResponseAmino): QueryGranterGrantsResponse;
+ toAmino(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseAmino;
+ fromAminoMsg(object: QueryGranterGrantsResponseAminoMsg): QueryGranterGrantsResponse;
+ toAminoMsg(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseAminoMsg;
+ fromProtoMsg(message: QueryGranterGrantsResponseProtoMsg): QueryGranterGrantsResponse;
+ toProto(message: QueryGranterGrantsResponse): Uint8Array;
+ toProtoMsg(message: QueryGranterGrantsResponse): QueryGranterGrantsResponseProtoMsg;
+};
+export declare const QueryGranteeGrantsRequest: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryGranteeGrantsRequest;
+ isSDK(o: any): o is QueryGranteeGrantsRequestSDKType;
+ isAmino(o: any): o is QueryGranteeGrantsRequestAmino;
+ encode(message: QueryGranteeGrantsRequest, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsRequest;
+ fromJSON(object: any): QueryGranteeGrantsRequest;
+ toJSON(message: QueryGranteeGrantsRequest): unknown;
+ fromPartial(object: DeepPartial): QueryGranteeGrantsRequest;
+ fromSDK(object: QueryGranteeGrantsRequestSDKType): QueryGranteeGrantsRequest;
+ toSDK(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestSDKType;
+ fromAmino(object: QueryGranteeGrantsRequestAmino): QueryGranteeGrantsRequest;
+ toAmino(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAmino;
+ fromAminoMsg(object: QueryGranteeGrantsRequestAminoMsg): QueryGranteeGrantsRequest;
+ toAminoMsg(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestAminoMsg;
+ fromProtoMsg(message: QueryGranteeGrantsRequestProtoMsg): QueryGranteeGrantsRequest;
+ toProto(message: QueryGranteeGrantsRequest): Uint8Array;
+ toProtoMsg(message: QueryGranteeGrantsRequest): QueryGranteeGrantsRequestProtoMsg;
+};
+export declare const QueryGranteeGrantsResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is QueryGranteeGrantsResponse;
+ isSDK(o: any): o is QueryGranteeGrantsResponseSDKType;
+ isAmino(o: any): o is QueryGranteeGrantsResponseAmino;
+ encode(message: QueryGranteeGrantsResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsResponse;
+ fromJSON(object: any): QueryGranteeGrantsResponse;
+ toJSON(message: QueryGranteeGrantsResponse): unknown;
+ fromPartial(object: DeepPartial): QueryGranteeGrantsResponse;
+ fromSDK(object: QueryGranteeGrantsResponseSDKType): QueryGranteeGrantsResponse;
+ toSDK(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseSDKType;
+ fromAmino(object: QueryGranteeGrantsResponseAmino): QueryGranteeGrantsResponse;
+ toAmino(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseAmino;
+ fromAminoMsg(object: QueryGranteeGrantsResponseAminoMsg): QueryGranteeGrantsResponse;
+ toAminoMsg(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseAminoMsg;
+ fromProtoMsg(message: QueryGranteeGrantsResponseProtoMsg): QueryGranteeGrantsResponse;
+ toProto(message: QueryGranteeGrantsResponse): Uint8Array;
+ toProtoMsg(message: QueryGranteeGrantsResponse): QueryGranteeGrantsResponseProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/query.rpc.Query.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/query.rpc.Query.d.ts
new file mode 100644
index 00000000..22884b9a
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/query.rpc.Query.d.ts
@@ -0,0 +1,84 @@
+import { TxRpc } from "../../../types";
+import { ReactQueryParams } from "../../../react-query";
+import { ProtobufRpcClient } from "@cosmjs/stargate";
+import { QueryStore } from "../../../mobx";
+import { QueryGrantsRequest, QueryGrantsResponse, QueryGranterGrantsRequest, QueryGranterGrantsResponse, QueryGranteeGrantsRequest, QueryGranteeGrantsResponse } from "./query";
+/** Query defines the gRPC querier service. */
+export interface Query {
+ /** Returns list of `Authorization`, granted to the grantee by the granter. */
+ grants(request: QueryGrantsRequest): Promise;
+ /**
+ * GranterGrants returns list of `GrantAuthorization`, granted by granter.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ granterGrants(request: QueryGranterGrantsRequest): Promise;
+ /**
+ * GranteeGrants returns a list of `GrantAuthorization` by grantee.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ granteeGrants(request: QueryGranteeGrantsRequest): Promise;
+}
+export declare class QueryClientImpl implements Query {
+ private readonly rpc;
+ constructor(rpc: TxRpc);
+ grants: (request: QueryGrantsRequest) => Promise;
+ granterGrants: (request: QueryGranterGrantsRequest) => Promise;
+ granteeGrants: (request: QueryGranteeGrantsRequest) => Promise;
+}
+export declare const createClientImpl: (rpc: TxRpc) => QueryClientImpl;
+export interface UseGrantsQuery extends ReactQueryParams {
+ request: QueryGrantsRequest;
+}
+export interface UseGranterGrantsQuery extends ReactQueryParams {
+ request: QueryGranterGrantsRequest;
+}
+export interface UseGranteeGrantsQuery extends ReactQueryParams {
+ request: QueryGranteeGrantsRequest;
+}
+export declare const createRpcQueryHooks: (rpc: ProtobufRpcClient | undefined) => {
+ /** Returns list of `Authorization`, granted to the grantee by the granter. */ useGrants: ({ request, options }: UseGrantsQuery) => import("@tanstack/react-query").UseQueryResult;
+ /**
+ * GranterGrants returns list of `GrantAuthorization`, granted by granter.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ useGranterGrants: ({ request, options }: UseGranterGrantsQuery) => import("@tanstack/react-query").UseQueryResult;
+ /**
+ * GranteeGrants returns a list of `GrantAuthorization` by grantee.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ useGranteeGrants: ({ request, options }: UseGranteeGrantsQuery) => import("@tanstack/react-query").UseQueryResult;
+};
+export declare const createRpcQueryMobxStores: (rpc: ProtobufRpcClient | undefined) => {
+ /** Returns list of `Authorization`, granted to the grantee by the granter. */ QueryGrantsStore: {
+ new (): {
+ store: QueryStore;
+ grants(request: QueryGrantsRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /**
+ * GranterGrants returns list of `GrantAuthorization`, granted by granter.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ QueryGranterGrantsStore: {
+ new (): {
+ store: QueryStore;
+ granterGrants(request: QueryGranterGrantsRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+ /**
+ * GranteeGrants returns a list of `GrantAuthorization` by grantee.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ QueryGranteeGrantsStore: {
+ new (): {
+ store: QueryStore;
+ granteeGrants(request: QueryGranteeGrantsRequest): import("../../../mobx").MobxResponse;
+ };
+ };
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.amino.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.amino.d.ts
new file mode 100644
index 00000000..6f44ab84
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.amino.d.ts
@@ -0,0 +1,18 @@
+import { MsgGrant, MsgExec, MsgRevoke } from "./tx";
+export declare const AminoConverter: {
+ "/cosmos.authz.v1beta1.MsgGrant": {
+ aminoType: string;
+ toAmino: (message: MsgGrant) => import("./tx").MsgGrantAmino;
+ fromAmino: (object: import("./tx").MsgGrantAmino) => MsgGrant;
+ };
+ "/cosmos.authz.v1beta1.MsgExec": {
+ aminoType: string;
+ toAmino: (message: MsgExec) => import("./tx").MsgExecAmino;
+ fromAmino: (object: import("./tx").MsgExecAmino) => MsgExec;
+ };
+ "/cosmos.authz.v1beta1.MsgRevoke": {
+ aminoType: string;
+ toAmino: (message: MsgRevoke) => import("./tx").MsgRevokeAmino;
+ fromAmino: (object: import("./tx").MsgRevokeAmino) => MsgRevoke;
+ };
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.d.ts
new file mode 100644
index 00000000..eaca1ca4
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.d.ts
@@ -0,0 +1,307 @@
+import { Grant, GrantAmino, GrantSDKType } from "./authz";
+import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/**
+ * MsgGrant is a request type for Grant method. It declares authorization to the grantee
+ * on behalf of the granter with the provided expiration time.
+ */
+export interface MsgGrant {
+ granter: string;
+ grantee: string;
+ grant: Grant | undefined;
+}
+export interface MsgGrantProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.MsgGrant";
+ value: Uint8Array;
+}
+/**
+ * MsgGrant is a request type for Grant method. It declares authorization to the grantee
+ * on behalf of the granter with the provided expiration time.
+ */
+export interface MsgGrantAmino {
+ granter?: string;
+ grantee?: string;
+ grant?: GrantAmino | undefined;
+}
+export interface MsgGrantAminoMsg {
+ type: "cosmos-sdk/MsgGrant";
+ value: MsgGrantAmino;
+}
+/**
+ * MsgGrant is a request type for Grant method. It declares authorization to the grantee
+ * on behalf of the granter with the provided expiration time.
+ */
+export interface MsgGrantSDKType {
+ granter: string;
+ grantee: string;
+ grant: GrantSDKType | undefined;
+}
+/** MsgExecResponse defines the Msg/MsgExecResponse response type. */
+export interface MsgExecResponse {
+ results: Uint8Array[];
+}
+export interface MsgExecResponseProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse";
+ value: Uint8Array;
+}
+/** MsgExecResponse defines the Msg/MsgExecResponse response type. */
+export interface MsgExecResponseAmino {
+ results?: string[];
+}
+export interface MsgExecResponseAminoMsg {
+ type: "cosmos-sdk/MsgExecResponse";
+ value: MsgExecResponseAmino;
+}
+/** MsgExecResponse defines the Msg/MsgExecResponse response type. */
+export interface MsgExecResponseSDKType {
+ results: Uint8Array[];
+}
+/**
+ * MsgExec attempts to execute the provided messages using
+ * authorizations granted to the grantee. Each message should have only
+ * one signer corresponding to the granter of the authorization.
+ */
+export interface MsgExec {
+ grantee: string;
+ /**
+ * Authorization Msg requests to execute. Each msg must implement Authorization interface
+ * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
+ * triple and validate it.
+ */
+ msgs: (Any)[] | Any[];
+}
+export interface MsgExecProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.MsgExec";
+ value: Uint8Array;
+}
+export type MsgExecEncoded = Omit & {
+ /**
+ * Authorization Msg requests to execute. Each msg must implement Authorization interface
+ * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
+ * triple and validate it.
+ */
+ msgs: (AnyProtoMsg)[];
+};
+/**
+ * MsgExec attempts to execute the provided messages using
+ * authorizations granted to the grantee. Each message should have only
+ * one signer corresponding to the granter of the authorization.
+ */
+export interface MsgExecAmino {
+ grantee?: string;
+ /**
+ * Authorization Msg requests to execute. Each msg must implement Authorization interface
+ * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
+ * triple and validate it.
+ */
+ msgs?: AnyAmino[];
+}
+export interface MsgExecAminoMsg {
+ type: "cosmos-sdk/MsgExec";
+ value: MsgExecAmino;
+}
+/**
+ * MsgExec attempts to execute the provided messages using
+ * authorizations granted to the grantee. Each message should have only
+ * one signer corresponding to the granter of the authorization.
+ */
+export interface MsgExecSDKType {
+ grantee: string;
+ msgs: (AnySDKType)[];
+}
+/** MsgGrantResponse defines the Msg/MsgGrant response type. */
+export interface MsgGrantResponse {
+}
+export interface MsgGrantResponseProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse";
+ value: Uint8Array;
+}
+/** MsgGrantResponse defines the Msg/MsgGrant response type. */
+export interface MsgGrantResponseAmino {
+}
+export interface MsgGrantResponseAminoMsg {
+ type: "cosmos-sdk/MsgGrantResponse";
+ value: MsgGrantResponseAmino;
+}
+/** MsgGrantResponse defines the Msg/MsgGrant response type. */
+export interface MsgGrantResponseSDKType {
+}
+/**
+ * MsgRevoke revokes any authorization with the provided sdk.Msg type on the
+ * granter's account with that has been granted to the grantee.
+ */
+export interface MsgRevoke {
+ granter: string;
+ grantee: string;
+ msgTypeUrl: string;
+}
+export interface MsgRevokeProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.MsgRevoke";
+ value: Uint8Array;
+}
+/**
+ * MsgRevoke revokes any authorization with the provided sdk.Msg type on the
+ * granter's account with that has been granted to the grantee.
+ */
+export interface MsgRevokeAmino {
+ granter?: string;
+ grantee?: string;
+ msg_type_url?: string;
+}
+export interface MsgRevokeAminoMsg {
+ type: "cosmos-sdk/MsgRevoke";
+ value: MsgRevokeAmino;
+}
+/**
+ * MsgRevoke revokes any authorization with the provided sdk.Msg type on the
+ * granter's account with that has been granted to the grantee.
+ */
+export interface MsgRevokeSDKType {
+ granter: string;
+ grantee: string;
+ msg_type_url: string;
+}
+/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */
+export interface MsgRevokeResponse {
+}
+export interface MsgRevokeResponseProtoMsg {
+ typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse";
+ value: Uint8Array;
+}
+/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */
+export interface MsgRevokeResponseAmino {
+}
+export interface MsgRevokeResponseAminoMsg {
+ type: "cosmos-sdk/MsgRevokeResponse";
+ value: MsgRevokeResponseAmino;
+}
+/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */
+export interface MsgRevokeResponseSDKType {
+}
+export declare const MsgGrant: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is MsgGrant;
+ isSDK(o: any): o is MsgGrantSDKType;
+ isAmino(o: any): o is MsgGrantAmino;
+ encode(message: MsgGrant, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgGrant;
+ fromJSON(object: any): MsgGrant;
+ toJSON(message: MsgGrant): unknown;
+ fromPartial(object: DeepPartial): MsgGrant;
+ fromSDK(object: MsgGrantSDKType): MsgGrant;
+ toSDK(message: MsgGrant): MsgGrantSDKType;
+ fromAmino(object: MsgGrantAmino): MsgGrant;
+ toAmino(message: MsgGrant): MsgGrantAmino;
+ fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant;
+ toAminoMsg(message: MsgGrant): MsgGrantAminoMsg;
+ fromProtoMsg(message: MsgGrantProtoMsg): MsgGrant;
+ toProto(message: MsgGrant): Uint8Array;
+ toProtoMsg(message: MsgGrant): MsgGrantProtoMsg;
+};
+export declare const MsgExecResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is MsgExecResponse;
+ isSDK(o: any): o is MsgExecResponseSDKType;
+ isAmino(o: any): o is MsgExecResponseAmino;
+ encode(message: MsgExecResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse;
+ fromJSON(object: any): MsgExecResponse;
+ toJSON(message: MsgExecResponse): unknown;
+ fromPartial(object: DeepPartial): MsgExecResponse;
+ fromSDK(object: MsgExecResponseSDKType): MsgExecResponse;
+ toSDK(message: MsgExecResponse): MsgExecResponseSDKType;
+ fromAmino(object: MsgExecResponseAmino): MsgExecResponse;
+ toAmino(message: MsgExecResponse): MsgExecResponseAmino;
+ fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse;
+ toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg;
+ fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse;
+ toProto(message: MsgExecResponse): Uint8Array;
+ toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg;
+};
+export declare const MsgExec: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is MsgExec;
+ isSDK(o: any): o is MsgExecSDKType;
+ isAmino(o: any): o is MsgExecAmino;
+ encode(message: MsgExec, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgExec;
+ fromJSON(object: any): MsgExec;
+ toJSON(message: MsgExec): unknown;
+ fromPartial(object: DeepPartial): MsgExec;
+ fromSDK(object: MsgExecSDKType): MsgExec;
+ toSDK(message: MsgExec): MsgExecSDKType;
+ fromAmino(object: MsgExecAmino): MsgExec;
+ toAmino(message: MsgExec): MsgExecAmino;
+ fromAminoMsg(object: MsgExecAminoMsg): MsgExec;
+ toAminoMsg(message: MsgExec): MsgExecAminoMsg;
+ fromProtoMsg(message: MsgExecProtoMsg): MsgExec;
+ toProto(message: MsgExec): Uint8Array;
+ toProtoMsg(message: MsgExec): MsgExecProtoMsg;
+};
+export declare const MsgGrantResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is MsgGrantResponse;
+ isSDK(o: any): o is MsgGrantResponseSDKType;
+ isAmino(o: any): o is MsgGrantResponseAmino;
+ encode(_: MsgGrantResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantResponse;
+ fromJSON(_: any): MsgGrantResponse;
+ toJSON(_: MsgGrantResponse): unknown;
+ fromPartial(_: DeepPartial): MsgGrantResponse;
+ fromSDK(_: MsgGrantResponseSDKType): MsgGrantResponse;
+ toSDK(_: MsgGrantResponse): MsgGrantResponseSDKType;
+ fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse;
+ toAmino(_: MsgGrantResponse): MsgGrantResponseAmino;
+ fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse;
+ toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg;
+ fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse;
+ toProto(message: MsgGrantResponse): Uint8Array;
+ toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg;
+};
+export declare const MsgRevoke: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is MsgRevoke;
+ isSDK(o: any): o is MsgRevokeSDKType;
+ isAmino(o: any): o is MsgRevokeAmino;
+ encode(message: MsgRevoke, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgRevoke;
+ fromJSON(object: any): MsgRevoke;
+ toJSON(message: MsgRevoke): unknown;
+ fromPartial(object: DeepPartial): MsgRevoke;
+ fromSDK(object: MsgRevokeSDKType): MsgRevoke;
+ toSDK(message: MsgRevoke): MsgRevokeSDKType;
+ fromAmino(object: MsgRevokeAmino): MsgRevoke;
+ toAmino(message: MsgRevoke): MsgRevokeAmino;
+ fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke;
+ toAminoMsg(message: MsgRevoke): MsgRevokeAminoMsg;
+ fromProtoMsg(message: MsgRevokeProtoMsg): MsgRevoke;
+ toProto(message: MsgRevoke): Uint8Array;
+ toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg;
+};
+export declare const MsgRevokeResponse: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is MsgRevokeResponse;
+ isSDK(o: any): o is MsgRevokeResponseSDKType;
+ isAmino(o: any): o is MsgRevokeResponseAmino;
+ encode(_: MsgRevokeResponse, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeResponse;
+ fromJSON(_: any): MsgRevokeResponse;
+ toJSON(_: MsgRevokeResponse): unknown;
+ fromPartial(_: DeepPartial): MsgRevokeResponse;
+ fromSDK(_: MsgRevokeResponseSDKType): MsgRevokeResponse;
+ toSDK(_: MsgRevokeResponse): MsgRevokeResponseSDKType;
+ fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse;
+ toAmino(_: MsgRevokeResponse): MsgRevokeResponseAmino;
+ fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse;
+ toAminoMsg(message: MsgRevokeResponse): MsgRevokeResponseAminoMsg;
+ fromProtoMsg(message: MsgRevokeResponseProtoMsg): MsgRevokeResponse;
+ toProto(message: MsgRevokeResponse): Uint8Array;
+ toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.registry.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.registry.d.ts
new file mode 100644
index 00000000..1d1c7f3e
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.registry.d.ts
@@ -0,0 +1,77 @@
+import { TelescopeGeneratedType } from "../../../types";
+import { Registry } from "@cosmjs/proto-signing";
+import { MsgGrant, MsgExec, MsgRevoke } from "./tx";
+export declare const registry: ReadonlyArray<[string, TelescopeGeneratedType]>;
+export declare const load: (protoRegistry: Registry) => void;
+export declare const MessageComposer: {
+ encoded: {
+ grant(value: MsgGrant): {
+ typeUrl: string;
+ value: Uint8Array;
+ };
+ exec(value: MsgExec): {
+ typeUrl: string;
+ value: Uint8Array;
+ };
+ revoke(value: MsgRevoke): {
+ typeUrl: string;
+ value: Uint8Array;
+ };
+ };
+ withTypeUrl: {
+ grant(value: MsgGrant): {
+ typeUrl: string;
+ value: MsgGrant;
+ };
+ exec(value: MsgExec): {
+ typeUrl: string;
+ value: MsgExec;
+ };
+ revoke(value: MsgRevoke): {
+ typeUrl: string;
+ value: MsgRevoke;
+ };
+ };
+ toJSON: {
+ grant(value: MsgGrant): {
+ typeUrl: string;
+ value: unknown;
+ };
+ exec(value: MsgExec): {
+ typeUrl: string;
+ value: unknown;
+ };
+ revoke(value: MsgRevoke): {
+ typeUrl: string;
+ value: unknown;
+ };
+ };
+ fromJSON: {
+ grant(value: any): {
+ typeUrl: string;
+ value: MsgGrant;
+ };
+ exec(value: any): {
+ typeUrl: string;
+ value: MsgExec;
+ };
+ revoke(value: any): {
+ typeUrl: string;
+ value: MsgRevoke;
+ };
+ };
+ fromPartial: {
+ grant(value: MsgGrant): {
+ typeUrl: string;
+ value: MsgGrant;
+ };
+ exec(value: MsgExec): {
+ typeUrl: string;
+ value: MsgExec;
+ };
+ revoke(value: MsgRevoke): {
+ typeUrl: string;
+ value: MsgRevoke;
+ };
+ };
+};
diff --git a/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.rpc.msg.d.ts b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.rpc.msg.d.ts
new file mode 100644
index 00000000..86139055
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/authz/v1beta1/tx.rpc.msg.d.ts
@@ -0,0 +1,31 @@
+import { DeliverTxResponse, StdFee, TxRpc } from "../../../types";
+import { MsgGrant, MsgExec, MsgRevoke } from "./tx";
+/** Msg defines the authz Msg service. */
+export interface Msg {
+ /**
+ * Grant grants the provided authorization to the grantee on the granter's
+ * account with the provided expiration time. If there is already a grant
+ * for the given (granter, grantee, Authorization) triple, then the grant
+ * will be overwritten.
+ */
+ grant(signerAddress: string, message: MsgGrant, fee: number | StdFee | "auto", memo: string): Promise;
+ /**
+ * Exec attempts to execute the provided messages using
+ * authorizations granted to the grantee. Each message should have only
+ * one signer corresponding to the granter of the authorization.
+ */
+ exec(signerAddress: string, message: MsgExec, fee: number | StdFee | "auto", memo: string): Promise;
+ /**
+ * Revoke revokes any authorization corresponding to the provided method name on the
+ * granter's account that has been granted to the grantee.
+ */
+ revoke(signerAddress: string, message: MsgRevoke, fee: number | StdFee | "auto", memo: string): Promise;
+}
+export declare class MsgClientImpl implements Msg {
+ private readonly rpc;
+ constructor(rpc: TxRpc);
+ grant: (signerAddress: string, message: MsgGrant, fee?: number | StdFee | "auto", memo?: string) => Promise;
+ exec: (signerAddress: string, message: MsgExec, fee?: number | StdFee | "auto", memo?: string) => Promise;
+ revoke: (signerAddress: string, message: MsgRevoke, fee?: number | StdFee | "auto", memo?: string) => Promise;
+}
+export declare const createClientImpl: (rpc: TxRpc) => MsgClientImpl;
diff --git a/examples/authz/types/codegen/cosmos/bank/v1beta1/authz.d.ts b/examples/authz/types/codegen/cosmos/bank/v1beta1/authz.d.ts
new file mode 100644
index 00000000..aaef2f41
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/bank/v1beta1/authz.d.ts
@@ -0,0 +1,61 @@
+import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/**
+ * SendAuthorization allows the grantee to spend up to spend_limit coins from
+ * the granter's account.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface SendAuthorization {
+ $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization";
+ spendLimit: Coin[];
+}
+export interface SendAuthorizationProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.SendAuthorization";
+ value: Uint8Array;
+}
+/**
+ * SendAuthorization allows the grantee to spend up to spend_limit coins from
+ * the granter's account.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface SendAuthorizationAmino {
+ spend_limit?: CoinAmino[];
+}
+export interface SendAuthorizationAminoMsg {
+ type: "cosmos-sdk/SendAuthorization";
+ value: SendAuthorizationAmino;
+}
+/**
+ * SendAuthorization allows the grantee to spend up to spend_limit coins from
+ * the granter's account.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+export interface SendAuthorizationSDKType {
+ $typeUrl?: "/cosmos.bank.v1beta1.SendAuthorization";
+ spend_limit: CoinSDKType[];
+}
+export declare const SendAuthorization: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is SendAuthorization;
+ isSDK(o: any): o is SendAuthorizationSDKType;
+ isAmino(o: any): o is SendAuthorizationAmino;
+ encode(message: SendAuthorization, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization;
+ fromJSON(object: any): SendAuthorization;
+ toJSON(message: SendAuthorization): unknown;
+ fromPartial(object: DeepPartial): SendAuthorization;
+ fromSDK(object: SendAuthorizationSDKType): SendAuthorization;
+ toSDK(message: SendAuthorization): SendAuthorizationSDKType;
+ fromAmino(object: SendAuthorizationAmino): SendAuthorization;
+ toAmino(message: SendAuthorization): SendAuthorizationAmino;
+ fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization;
+ toAminoMsg(message: SendAuthorization): SendAuthorizationAminoMsg;
+ fromProtoMsg(message: SendAuthorizationProtoMsg): SendAuthorization;
+ toProto(message: SendAuthorization): Uint8Array;
+ toProtoMsg(message: SendAuthorization): SendAuthorizationProtoMsg;
+};
diff --git a/examples/authz/types/codegen/cosmos/bank/v1beta1/bank.d.ts b/examples/authz/types/codegen/cosmos/bank/v1beta1/bank.d.ts
new file mode 100644
index 00000000..c51ad0ce
--- /dev/null
+++ b/examples/authz/types/codegen/cosmos/bank/v1beta1/bank.d.ts
@@ -0,0 +1,447 @@
+import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin";
+import { BinaryReader, BinaryWriter } from "../../../binary";
+import { DeepPartial } from "../../../helpers";
+/** Params defines the parameters for the bank module. */
+export interface Params {
+ sendEnabled: SendEnabled[];
+ defaultSendEnabled: boolean;
+}
+export interface ParamsProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.Params";
+ value: Uint8Array;
+}
+/** Params defines the parameters for the bank module. */
+export interface ParamsAmino {
+ send_enabled?: SendEnabledAmino[];
+ default_send_enabled?: boolean;
+}
+export interface ParamsAminoMsg {
+ type: "cosmos-sdk/Params";
+ value: ParamsAmino;
+}
+/** Params defines the parameters for the bank module. */
+export interface ParamsSDKType {
+ send_enabled: SendEnabledSDKType[];
+ default_send_enabled: boolean;
+}
+/**
+ * SendEnabled maps coin denom to a send_enabled status (whether a denom is
+ * sendable).
+ */
+export interface SendEnabled {
+ denom: string;
+ enabled: boolean;
+}
+export interface SendEnabledProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.SendEnabled";
+ value: Uint8Array;
+}
+/**
+ * SendEnabled maps coin denom to a send_enabled status (whether a denom is
+ * sendable).
+ */
+export interface SendEnabledAmino {
+ denom?: string;
+ enabled?: boolean;
+}
+export interface SendEnabledAminoMsg {
+ type: "cosmos-sdk/SendEnabled";
+ value: SendEnabledAmino;
+}
+/**
+ * SendEnabled maps coin denom to a send_enabled status (whether a denom is
+ * sendable).
+ */
+export interface SendEnabledSDKType {
+ denom: string;
+ enabled: boolean;
+}
+/** Input models transaction input. */
+export interface Input {
+ address: string;
+ coins: Coin[];
+}
+export interface InputProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.Input";
+ value: Uint8Array;
+}
+/** Input models transaction input. */
+export interface InputAmino {
+ address?: string;
+ coins?: CoinAmino[];
+}
+export interface InputAminoMsg {
+ type: "cosmos-sdk/Input";
+ value: InputAmino;
+}
+/** Input models transaction input. */
+export interface InputSDKType {
+ address: string;
+ coins: CoinSDKType[];
+}
+/** Output models transaction outputs. */
+export interface Output {
+ address: string;
+ coins: Coin[];
+}
+export interface OutputProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.Output";
+ value: Uint8Array;
+}
+/** Output models transaction outputs. */
+export interface OutputAmino {
+ address?: string;
+ coins?: CoinAmino[];
+}
+export interface OutputAminoMsg {
+ type: "cosmos-sdk/Output";
+ value: OutputAmino;
+}
+/** Output models transaction outputs. */
+export interface OutputSDKType {
+ address: string;
+ coins: CoinSDKType[];
+}
+/**
+ * Supply represents a struct that passively keeps track of the total supply
+ * amounts in the network.
+ * This message is deprecated now that supply is indexed by denom.
+ */
+/** @deprecated */
+export interface Supply {
+ $typeUrl?: "/cosmos.bank.v1beta1.Supply";
+ total: Coin[];
+}
+export interface SupplyProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.Supply";
+ value: Uint8Array;
+}
+/**
+ * Supply represents a struct that passively keeps track of the total supply
+ * amounts in the network.
+ * This message is deprecated now that supply is indexed by denom.
+ */
+/** @deprecated */
+export interface SupplyAmino {
+ total?: CoinAmino[];
+}
+export interface SupplyAminoMsg {
+ type: "cosmos-sdk/Supply";
+ value: SupplyAmino;
+}
+/**
+ * Supply represents a struct that passively keeps track of the total supply
+ * amounts in the network.
+ * This message is deprecated now that supply is indexed by denom.
+ */
+/** @deprecated */
+export interface SupplySDKType {
+ $typeUrl?: "/cosmos.bank.v1beta1.Supply";
+ total: CoinSDKType[];
+}
+/**
+ * DenomUnit represents a struct that describes a given
+ * denomination unit of the basic token.
+ */
+export interface DenomUnit {
+ /** denom represents the string name of the given denom unit (e.g uatom). */
+ denom: string;
+ /**
+ * exponent represents power of 10 exponent that one must
+ * raise the base_denom to in order to equal the given DenomUnit's denom
+ * 1 denom = 10^exponent base_denom
+ * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
+ * exponent = 6, thus: 1 atom = 10^6 uatom).
+ */
+ exponent: number;
+ /** aliases is a list of string aliases for the given denom */
+ aliases: string[];
+}
+export interface DenomUnitProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.DenomUnit";
+ value: Uint8Array;
+}
+/**
+ * DenomUnit represents a struct that describes a given
+ * denomination unit of the basic token.
+ */
+export interface DenomUnitAmino {
+ /** denom represents the string name of the given denom unit (e.g uatom). */
+ denom?: string;
+ /**
+ * exponent represents power of 10 exponent that one must
+ * raise the base_denom to in order to equal the given DenomUnit's denom
+ * 1 denom = 10^exponent base_denom
+ * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
+ * exponent = 6, thus: 1 atom = 10^6 uatom).
+ */
+ exponent?: number;
+ /** aliases is a list of string aliases for the given denom */
+ aliases?: string[];
+}
+export interface DenomUnitAminoMsg {
+ type: "cosmos-sdk/DenomUnit";
+ value: DenomUnitAmino;
+}
+/**
+ * DenomUnit represents a struct that describes a given
+ * denomination unit of the basic token.
+ */
+export interface DenomUnitSDKType {
+ denom: string;
+ exponent: number;
+ aliases: string[];
+}
+/**
+ * Metadata represents a struct that describes
+ * a basic token.
+ */
+export interface Metadata {
+ description: string;
+ /** denom_units represents the list of DenomUnit's for a given coin */
+ denomUnits: DenomUnit[];
+ /** base represents the base denom (should be the DenomUnit with exponent = 0). */
+ base: string;
+ /**
+ * display indicates the suggested denom that should be
+ * displayed in clients.
+ */
+ display: string;
+ /**
+ * name defines the name of the token (eg: Cosmos Atom)
+ *
+ * Since: cosmos-sdk 0.43
+ */
+ name: string;
+ /**
+ * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can
+ * be the same as the display.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+ symbol: string;
+ /**
+ * URI to a document (on or off-chain) that contains additional information. Optional.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ uri: string;
+ /**
+ * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that
+ * the document didn't change. Optional.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ uriHash: string;
+}
+export interface MetadataProtoMsg {
+ typeUrl: "/cosmos.bank.v1beta1.Metadata";
+ value: Uint8Array;
+}
+/**
+ * Metadata represents a struct that describes
+ * a basic token.
+ */
+export interface MetadataAmino {
+ description?: string;
+ /** denom_units represents the list of DenomUnit's for a given coin */
+ denom_units?: DenomUnitAmino[];
+ /** base represents the base denom (should be the DenomUnit with exponent = 0). */
+ base?: string;
+ /**
+ * display indicates the suggested denom that should be
+ * displayed in clients.
+ */
+ display?: string;
+ /**
+ * name defines the name of the token (eg: Cosmos Atom)
+ *
+ * Since: cosmos-sdk 0.43
+ */
+ name?: string;
+ /**
+ * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can
+ * be the same as the display.
+ *
+ * Since: cosmos-sdk 0.43
+ */
+ symbol?: string;
+ /**
+ * URI to a document (on or off-chain) that contains additional information. Optional.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ uri?: string;
+ /**
+ * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that
+ * the document didn't change. Optional.
+ *
+ * Since: cosmos-sdk 0.46
+ */
+ uri_hash?: string;
+}
+export interface MetadataAminoMsg {
+ type: "cosmos-sdk/Metadata";
+ value: MetadataAmino;
+}
+/**
+ * Metadata represents a struct that describes
+ * a basic token.
+ */
+export interface MetadataSDKType {
+ description: string;
+ denom_units: DenomUnitSDKType[];
+ base: string;
+ display: string;
+ name: string;
+ symbol: string;
+ uri: string;
+ uri_hash: string;
+}
+export declare const Params: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Params;
+ isSDK(o: any): o is ParamsSDKType;
+ isAmino(o: any): o is ParamsAmino;
+ encode(message: Params, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Params;
+ fromJSON(object: any): Params;
+ toJSON(message: Params): unknown;
+ fromPartial(object: DeepPartial): Params;
+ fromSDK(object: ParamsSDKType): Params;
+ toSDK(message: Params): ParamsSDKType;
+ fromAmino(object: ParamsAmino): Params;
+ toAmino(message: Params): ParamsAmino;
+ fromAminoMsg(object: ParamsAminoMsg): Params;
+ toAminoMsg(message: Params): ParamsAminoMsg;
+ fromProtoMsg(message: ParamsProtoMsg): Params;
+ toProto(message: Params): Uint8Array;
+ toProtoMsg(message: Params): ParamsProtoMsg;
+};
+export declare const SendEnabled: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is SendEnabled;
+ isSDK(o: any): o is SendEnabledSDKType;
+ isAmino(o: any): o is SendEnabledAmino;
+ encode(message: SendEnabled, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled;
+ fromJSON(object: any): SendEnabled;
+ toJSON(message: SendEnabled): unknown;
+ fromPartial(object: DeepPartial): SendEnabled;
+ fromSDK(object: SendEnabledSDKType): SendEnabled;
+ toSDK(message: SendEnabled): SendEnabledSDKType;
+ fromAmino(object: SendEnabledAmino): SendEnabled;
+ toAmino(message: SendEnabled): SendEnabledAmino;
+ fromAminoMsg(object: SendEnabledAminoMsg): SendEnabled;
+ toAminoMsg(message: SendEnabled): SendEnabledAminoMsg;
+ fromProtoMsg(message: SendEnabledProtoMsg): SendEnabled;
+ toProto(message: SendEnabled): Uint8Array;
+ toProtoMsg(message: SendEnabled): SendEnabledProtoMsg;
+};
+export declare const Input: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Input;
+ isSDK(o: any): o is InputSDKType;
+ isAmino(o: any): o is InputAmino;
+ encode(message: Input, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Input;
+ fromJSON(object: any): Input;
+ toJSON(message: Input): unknown;
+ fromPartial(object: DeepPartial): Input;
+ fromSDK(object: InputSDKType): Input;
+ toSDK(message: Input): InputSDKType;
+ fromAmino(object: InputAmino): Input;
+ toAmino(message: Input): InputAmino;
+ fromAminoMsg(object: InputAminoMsg): Input;
+ toAminoMsg(message: Input): InputAminoMsg;
+ fromProtoMsg(message: InputProtoMsg): Input;
+ toProto(message: Input): Uint8Array;
+ toProtoMsg(message: Input): InputProtoMsg;
+};
+export declare const Output: {
+ typeUrl: string;
+ aminoType: string;
+ is(o: any): o is Output;
+ isSDK(o: any): o is OutputSDKType;
+ isAmino(o: any): o is OutputAmino;
+ encode(message: Output, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): Output;
+ fromJSON(object: any): Output;
+ toJSON(message: Output): unknown;
+ fromPartial(object: DeepPartial