Skip to content

Commit

Permalink
Merge pull request #88 from hyperweb-io/cosmwasm-lib
Browse files Browse the repository at this point in the history
add cosmwasm and ibc types
  • Loading branch information
Zetazzz authored Feb 12, 2025
2 parents 8a12dd3 + 9321e04 commit 471a2c6
Show file tree
Hide file tree
Showing 253 changed files with 95,692 additions and 36 deletions.
18 changes: 14 additions & 4 deletions libs/interchain-react/src/cosmos/authz/v1beta1/authz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any";
import { Timestamp } from "../../../google/protobuf/timestamp";
import { SendAuthorization, SendAuthorizationProtoMsg } from "../../bank/v1beta1/authz";
import { StakeAuthorization, StakeAuthorizationProtoMsg } from "../../staking/v1beta1/authz";
import { StoreCodeAuthorization, StoreCodeAuthorizationProtoMsg, ContractExecutionAuthorization, ContractExecutionAuthorizationProtoMsg, ContractMigrationAuthorization, ContractMigrationAuthorizationProtoMsg } from "../../../cosmwasm/wasm/v1/authz";
import { TransferAuthorization, TransferAuthorizationProtoMsg } from "../../../ibc/applications/transfer/v1/authz";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers";
import { GlobalDecoderRegistry } from "../../../registry";
Expand Down Expand Up @@ -34,7 +36,7 @@ export interface GenericAuthorizationAminoMsg {
* the provide method with expiration time.
*/
export interface Grant {
authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | Any | undefined;
authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | StoreCodeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | TransferAuthorization | 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`
Expand All @@ -47,7 +49,7 @@ export interface GrantProtoMsg {
value: Uint8Array;
}
export type GrantEncoded = Omit<Grant, "authorization"> & {
authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined;
authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | StoreCodeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | TransferAuthorizationProtoMsg | AnyProtoMsg | undefined;
};
/**
* Grant gives permissions to execute
Expand All @@ -73,15 +75,15 @@ export interface GrantAminoMsg {
export interface GrantAuthorization {
granter: string;
grantee: string;
authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | Any | undefined;
authorization?: GenericAuthorization | SendAuthorization | StakeAuthorization | StoreCodeAuthorization | ContractExecutionAuthorization | ContractMigrationAuthorization | TransferAuthorization | Any | undefined;
expiration?: Date;
}
export interface GrantAuthorizationProtoMsg {
typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization";
value: Uint8Array;
}
export type GrantAuthorizationEncoded = Omit<GrantAuthorization, "authorization"> & {
authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | AnyProtoMsg | undefined;
authorization?: GenericAuthorizationProtoMsg | SendAuthorizationProtoMsg | StakeAuthorizationProtoMsg | StoreCodeAuthorizationProtoMsg | ContractExecutionAuthorizationProtoMsg | ContractMigrationAuthorizationProtoMsg | TransferAuthorizationProtoMsg | AnyProtoMsg | undefined;
};
/**
* GrantAuthorization extends a grant with both the addresses of the grantee and granter.
Expand Down Expand Up @@ -286,6 +288,10 @@ export const Grant = {
GenericAuthorization.registerTypeUrl();
SendAuthorization.registerTypeUrl();
StakeAuthorization.registerTypeUrl();
StoreCodeAuthorization.registerTypeUrl();
ContractExecutionAuthorization.registerTypeUrl();
ContractMigrationAuthorization.registerTypeUrl();
TransferAuthorization.registerTypeUrl();
}
};
function createBaseGrantAuthorization(): GrantAuthorization {
Expand Down Expand Up @@ -403,6 +409,10 @@ export const GrantAuthorization = {
GenericAuthorization.registerTypeUrl();
SendAuthorization.registerTypeUrl();
StakeAuthorization.registerTypeUrl();
StoreCodeAuthorization.registerTypeUrl();
ContractExecutionAuthorization.registerTypeUrl();
ContractMigrationAuthorization.registerTypeUrl();
TransferAuthorization.registerTypeUrl();
}
};
function createBaseGrantQueueItem(): GrantQueueItem {
Expand Down
17 changes: 15 additions & 2 deletions libs/interchain-react/src/cosmos/gov/v1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, Communi
import { TextProposal, TextProposalProtoMsg } from "../v1beta1/gov";
import { ParameterChangeProposal, ParameterChangeProposalProtoMsg } from "../../params/v1beta1/params";
import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade";
import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, isSet, toTimestamp, fromTimestamp } from "../../../helpers";
import { GlobalDecoderRegistry } from "../../../registry";
Expand Down Expand Up @@ -105,7 +106,7 @@ export interface MsgSubmitProposalResponseAminoMsg {
*/
export interface MsgExecLegacyContent {
/** content is the proposal's content. */
content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | Any | undefined;
content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | Any | undefined;
/** authority must be the gov module address. */
authority: string;
}
Expand All @@ -114,7 +115,7 @@ export interface MsgExecLegacyContentProtoMsg {
value: Uint8Array;
}
export type MsgExecLegacyContentEncoded = Omit<MsgExecLegacyContent, "content"> & {
/** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | AnyProtoMsg | undefined;
/** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | AnyProtoMsg | undefined;
};
/**
* MsgExecLegacyContent is used to wrap the legacy content field into a message.
Expand Down Expand Up @@ -716,6 +717,18 @@ export const MsgExecLegacyContent = {
ParameterChangeProposal.registerTypeUrl();
SoftwareUpgradeProposal.registerTypeUrl();
CancelSoftwareUpgradeProposal.registerTypeUrl();
StoreCodeProposal.registerTypeUrl();
InstantiateContractProposal.registerTypeUrl();
InstantiateContract2Proposal.registerTypeUrl();
MigrateContractProposal.registerTypeUrl();
SudoContractProposal.registerTypeUrl();
ExecuteContractProposal.registerTypeUrl();
UpdateAdminProposal.registerTypeUrl();
ClearAdminProposal.registerTypeUrl();
PinCodesProposal.registerTypeUrl();
UnpinCodesProposal.registerTypeUrl();
UpdateInstantiateConfigProposal.registerTypeUrl();
StoreAndInstantiateContractProposal.registerTypeUrl();
}
};
function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse {
Expand Down
17 changes: 15 additions & 2 deletions libs/interchain-react/src/cosmos/gov/v1beta1/gov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Duration, DurationAmino } from "../../../google/protobuf/duration";
import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution";
import { ParameterChangeProposal, ParameterChangeProposalProtoMsg } from "../../params/v1beta1/params";
import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade";
import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy";
import { isSet, DeepPartial, toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { GlobalDecoderRegistry } from "../../../registry";
Expand Down Expand Up @@ -235,7 +236,7 @@ export interface Proposal {
/** proposal_id defines the unique id of the proposal. */
proposalId: bigint;
/** content is the proposal's content. */
content?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | Any | undefined;
content?: TextProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | Any | undefined;
/** status defines the proposal status. */
status: ProposalStatus;
/**
Expand All @@ -260,7 +261,7 @@ export interface ProposalProtoMsg {
value: Uint8Array;
}
export type ProposalEncoded = Omit<Proposal, "content"> & {
/** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | AnyProtoMsg | undefined;
/** content is the proposal's content. */content?: TextProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | AnyProtoMsg | undefined;
};
/** Proposal defines the core field members of a governance proposal. */
export interface ProposalAmino {
Expand Down Expand Up @@ -925,6 +926,18 @@ export const Proposal = {
ParameterChangeProposal.registerTypeUrl();
SoftwareUpgradeProposal.registerTypeUrl();
CancelSoftwareUpgradeProposal.registerTypeUrl();
StoreCodeProposal.registerTypeUrl();
InstantiateContractProposal.registerTypeUrl();
InstantiateContract2Proposal.registerTypeUrl();
MigrateContractProposal.registerTypeUrl();
SudoContractProposal.registerTypeUrl();
ExecuteContractProposal.registerTypeUrl();
UpdateAdminProposal.registerTypeUrl();
ClearAdminProposal.registerTypeUrl();
PinCodesProposal.registerTypeUrl();
UnpinCodesProposal.registerTypeUrl();
UpdateInstantiateConfigProposal.registerTypeUrl();
StoreAndInstantiateContractProposal.registerTypeUrl();
TallyResult.registerTypeUrl();
Coin.registerTypeUrl();
}
Expand Down
17 changes: 15 additions & 2 deletions libs/interchain-react/src/cosmos/gov/v1beta1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, TextProposal,
import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg } from "../../distribution/v1beta1/distribution";
import { ParameterChangeProposal, ParameterChangeProposalProtoMsg } from "../../params/v1beta1/params";
import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg } from "../../upgrade/v1beta1/upgrade";
import { StoreCodeProposal, StoreCodeProposalProtoMsg, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, MigrateContractProposal, MigrateContractProposalProtoMsg, SudoContractProposal, SudoContractProposalProtoMsg, ExecuteContractProposal, ExecuteContractProposalProtoMsg, UpdateAdminProposal, UpdateAdminProposalProtoMsg, ClearAdminProposal, ClearAdminProposalProtoMsg, PinCodesProposal, PinCodesProposalProtoMsg, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg } from "../../../cosmwasm/wasm/v1/proposal_legacy";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { GlobalDecoderRegistry } from "../../../registry";
import { DeepPartial, isSet } from "../../../helpers";
Expand All @@ -13,7 +14,7 @@ import { DeepPartial, isSet } from "../../../helpers";
*/
export interface MsgSubmitProposal {
/** content is the proposal's content. */
content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | Any | undefined;
content?: CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | Any | undefined;
/** initial_deposit is the deposit value that must be paid at proposal submission. */
initialDeposit: Coin[];
/** proposer is the account address of the proposer. */
Expand All @@ -24,7 +25,7 @@ export interface MsgSubmitProposalProtoMsg {
value: Uint8Array;
}
export type MsgSubmitProposalEncoded = Omit<MsgSubmitProposal, "content"> & {
/** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | AnyProtoMsg | undefined;
/** content is the proposal's content. */content?: CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | AnyProtoMsg | undefined;
};
/**
* MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary
Expand Down Expand Up @@ -298,6 +299,18 @@ export const MsgSubmitProposal = {
ParameterChangeProposal.registerTypeUrl();
SoftwareUpgradeProposal.registerTypeUrl();
CancelSoftwareUpgradeProposal.registerTypeUrl();
StoreCodeProposal.registerTypeUrl();
InstantiateContractProposal.registerTypeUrl();
InstantiateContract2Proposal.registerTypeUrl();
MigrateContractProposal.registerTypeUrl();
SudoContractProposal.registerTypeUrl();
ExecuteContractProposal.registerTypeUrl();
UpdateAdminProposal.registerTypeUrl();
ClearAdminProposal.registerTypeUrl();
PinCodesProposal.registerTypeUrl();
UnpinCodesProposal.registerTypeUrl();
UpdateInstantiateConfigProposal.registerTypeUrl();
StoreAndInstantiateContractProposal.registerTypeUrl();
Coin.registerTypeUrl();
}
};
Expand Down
Loading

0 comments on commit 471a2c6

Please sign in to comment.