Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message encode object interface in each module #47

Merged
merged 7 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to

### Added
- [\#44](https://github.com/line/lbmjs/pull/44) @lbmjs/finshia: Add amino messages to lbm specific modules, support changed foundation module
- [\#47](https://github.com/line/lbmjs/pull/47) @lbmjs/finshia: Add message encode object interface to token, collection, foundation module
### Changed

### Deprecated
Expand Down
118 changes: 108 additions & 10 deletions packages/finschia/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,54 @@
export { FinschiaClient, QueryClientWithExtensions } from "./finschiaclient";
export { collectionTypes } from "./modules";
export { CollectionExtension, setupCollectionExtension } from "./modules";
export {
CollectionExtension,
collectionTypes,
isMsgAttachEncodeObject,
isMsgAttachFromEncodeObject,
isMsgBurnFTEncodeObject,
isMsgBurnFTFromEncodeObject,
isMsgBurnNFTEncodeObject,
isMsgBurnNFTFromEncodeObject,
isMsgCollectionApproveEncodeObject,
isMsgCollectionGrantPermissionEncodeObject,
isMsgCollectionModifyEncodeObject,
isMsgCollectionRevokePermissionEncodeObject,
isMsgCreateContractEncodeObject,
isMsgDetachFromEncodeObject,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not isMsgDetachEncodeObject.

isMsgDisapproveEncodeObject,
isMsgIssueFTEncodeObject,
isMsgIssueNFTEncodeObject,
isMsgMintFTEncodeObject,
isMsgMintNFTEncodeObject,
isMsgTransferFTEncodeObject,
isMsgTransferFTFromEncodeObject,
isMsgTransferNFTEncodeObject,
isMsgTransferNFTFromEncodeObject,
MsgAttachEncodeObject,
MsgAttachFromEncodeObject,
MsgBurnFTEncodeObject,
MsgBurnFTFromEncodeObject,
MsgBurnNFTEncodeObject,
MsgBurnNFTFromEncodeObject,
MsgCollectionApproveEncodeObject,
MsgCollectionGrantPermissionEncodeObject,
MsgCollectionModifyEncodeObject,
MsgCollectionRevokePermissionEncodeObject,
MsgCreateContractEncodeObject,
MsgDetachEncodeObject,
MsgDetachFromEncodeObject,
MsgDisapproveEncodeObject,
MsgIssueFTEncodeObject,
MsgIssueNFTEncodeObject,
MsgMintFTEncodeObject,
MsgMintNFTEncodeObject,
MsgTransferFTEncodeObject,
MsgTransferFTFromEncodeObject,
MsgTransferNFTEncodeObject,
MsgTransferNFTFromEncodeObject,
setupCollectionExtension,
} from "./modules";
export { EvidenceExtension, setupEvidenceExtension } from "./modules";
export { feegrantTypes } from "./modules";
export { FeeGrantExtension, setupFeeGrantExtension } from "./modules";
export { FeeGrantExtension, feegrantTypes, setupFeeGrantExtension } from "./modules";
export {
createMsgGrant,
createMsgRevoke,
Expand All @@ -13,23 +58,76 @@ export {
createMsgWithdrawFromTreasury,
createPercentageDecisionPolicy,
createThresholdDecisionPolicy,
FoundationExtension,
FoundationProposalId,
foundationTypes,
isMsgExecEncodeObject,
isMsgFundTreasuryEncodeObject,
isMsgGovMintEncodeObject,
isMsgGrantEncodeObject,
isMsgLeaveFoundationEncodeObject,
isMsgRevokeEncodeObject,
isMsgSubmitProposalEncodeObject,
isMsgUpdateDecisionPolicyEncodeObject,
isMsgUpdateMembersEncodeObject,
isMsgUpdateParamsEncodeObject,
isMsgVoteEncodeObject,
isMsgWithdrawFromTreasuryEncodeObject,
isMsgWithdrawProposalEncodeObject,
isPercentageDecisionPolicyEncodeObject,
isThresholdDecisionPolicyEncodeObject,
MsgExecEncodeObject,
MsgFundTreasuryEncodeObject,
MsgGovMintEncodeObject,
MsgGrantEncodeObject,
MsgLeaveFoundationEncodeObject,
MsgRevokeEncodeObject,
MsgSubmitProposalEncodeObject,
MsgUpdateDecisionPolicyEncodeObject,
MsgUpdateMembersEncodeObject,
MsgUpdateParamsEncodeObject,
MsgVoteEncodeObject,
MsgWithdrawFromTreasuryEncodeObject,
MsgWithdrawProposalEncodeObject,
PercentageDecisionPolicyEncodeObject,
setupFoundationExtension,
ThresholdDecisionPolicyEncodeObject,
} from "./modules";
export { FoundationExtension, FoundationProposalId, setupFoundationExtension } from "./modules";
export { ibcTypes } from "./modules";
export { IbcExtension, setupIbcExtension } from "./modules";
export { tokenTypes } from "./modules";
export { setupTokenExtension, TokenExtension } from "./modules";
export { IbcExtension, ibcTypes, setupIbcExtension } from "./modules";
export {
isMsgBurnEncodeObject,
isMsgBurnFromEncodeObject,
isMsgIssueEncodeObject,
isMsgMintEncodeObject,
isMsgRevokeOperatorEncodeObject,
isMsgSendEncodeObject,
isMsgTokenApproveEncodeObject,
isMsgTokenGrantPermissionEncodeObject,
isMsgTokenModifyEncodeObject,
isMsgTokenRevokePermissionEncodeObject,
isMsgTransferFromEncodeObject,
MsgBurnEncodeObject,
MsgBurnFromEncodeObject,
MsgIssueEncodeObject,
MsgMintEncodeObject,
MsgRevokeOperatorEncodeObject,
MsgSendEncodeObject,
MsgTokenApproveEncodeObject,
MsgTokenGrantPermissionEncodeObject,
MsgTokenModifyEncodeObject,
MsgTokenRevokePermissionEncodeObject,
MsgTransferFromEncodeObject,
setupTokenExtension,
TokenExtension,
tokenTypes,
} from "./modules";
export {
isMsgStoreCodeAndInstantiateContract,
MsgStoreCodeAndInstantiateContractEncodeObject,
setupWasmplusExtension,
WasmplusExtension,
wasmTypes,
} from "./modules";
export { setupWasmplusExtension, WasmplusExtension } from "./modules";
export { makeLinkPath } from "./paths";
export {
finschiaRegistryTypes,
Expand Down
210 changes: 209 additions & 1 deletion packages/finschia/src/modules/collection/messages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GeneratedType } from "@cosmjs/proto-signing";
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing";
import {
MsgApprove,
MsgAttach,
Expand Down Expand Up @@ -48,3 +48,211 @@ export const collectionTypes: ReadonlyArray<[string, GeneratedType]> = [
["/lbm.collection.v1.MsgAttachFrom", MsgAttachFrom],
["/lbm.collection.v1.MsgDetachFrom", MsgDetachFrom],
];

export interface MsgTransferFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgTransferFT";
readonly value: Partial<MsgTransferFT>;
}

export function isMsgTransferFTEncodeObject(object: EncodeObject): object is MsgTransferFTEncodeObject {
return (object as MsgTransferFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgTransferFT";
}

export interface MsgTransferFTFromEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgTransferFTFrom";
readonly value: Partial<MsgTransferFTFrom>;
}

export function isMsgTransferFTFromEncodeObject(
object: EncodeObject,
): object is MsgTransferFTFromEncodeObject {
return (object as MsgTransferFTFromEncodeObject).typeUrl === "/lbm.collection.v1.MsgTransferFTFrom";
}

export interface MsgTransferNFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgTransferNFT";
readonly value: Partial<MsgTransferNFT>;
}

export function isMsgTransferNFTEncodeObject(object: EncodeObject): object is MsgTransferNFTEncodeObject {
return (object as MsgTransferNFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgTransferNFT";
}

export interface MsgTransferNFTFromEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgTransferNFTFrom";
readonly value: Partial<MsgTransferNFTFrom>;
}

export function isMsgTransferNFTFromEncodeObject(
object: EncodeObject,
): object is MsgTransferNFTFromEncodeObject {
return (object as MsgTransferNFTFromEncodeObject).typeUrl === "/lbm.collection.v1.MsgTransferNFTFrom";
}

export interface MsgApproveEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgApprove";
readonly value: Partial<MsgApprove>;
}

export function isMsgApproveEncodeObject(object: EncodeObject): object is MsgApproveEncodeObject {
return (object as MsgApproveEncodeObject).typeUrl === "/lbm.collection.v1.MsgApprove";
}

export interface MsgDisapproveEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgDisapprove";
readonly value: Partial<MsgDisapprove>;
}

export function isMsgDisapproveEncodeObject(object: EncodeObject): object is MsgDisapproveEncodeObject {
return (object as MsgDisapproveEncodeObject).typeUrl === "/lbm.collection.v1.MsgDisapprove";
}

export interface MsgCreateContractEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgCreateContract";
readonly value: Partial<MsgCreateContract>;
}

export function isMsgCreateContractEncodeObject(
object: EncodeObject,
): object is MsgCreateContractEncodeObject {
return (object as MsgCreateContractEncodeObject).typeUrl === "/lbm.collection.v1.MsgCreateContract";
}

export interface MsgIssueFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgIssueFT";
readonly value: Partial<MsgIssueFT>;
}

export function isMsgIssueFTEncodeObject(object: EncodeObject): object is MsgIssueFTEncodeObject {
return (object as MsgIssueFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgIssueFT";
}

export interface MsgIssueNFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgIssueNFT";
readonly value: Partial<MsgIssueNFT>;
}

export function isMsgIssueNFTEncodeObject(object: EncodeObject): object is MsgIssueNFTEncodeObject {
return (object as MsgIssueNFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgIssueNFT";
}

export interface MsgMintFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgMintFT";
readonly value: Partial<MsgMintFT>;
}

export function isMsgMintFTEncodeObject(object: EncodeObject): object is MsgMintFTEncodeObject {
return (object as MsgMintFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgMintFT";
}

export interface MsgMintNFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgMintNFT";
readonly value: Partial<MsgMintNFT>;
}

export function isMsgMintNFTEncodeObject(object: EncodeObject): object is MsgMintNFTEncodeObject {
return (object as MsgMintNFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgMintNFT";
}

export interface MsgBurnFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgBurnFT";
readonly value: Partial<MsgBurnFT>;
}

export function isMsgBurnFTEncodeObject(object: EncodeObject): object is MsgBurnFTEncodeObject {
return (object as MsgBurnFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgBurnFT";
}

export interface MsgBurnFTFromEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgBurnFTFrom";
readonly value: Partial<MsgBurnFTFrom>;
}

export function isMsgBurnFTFromEncodeObject(object: EncodeObject): object is MsgBurnFTFromEncodeObject {
return (object as MsgBurnFTFromEncodeObject).typeUrl === "/lbm.collection.v1.MsgBurnFTFrom";
}

export interface MsgBurnNFTEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgBurnNFT";
readonly value: Partial<MsgBurnNFT>;
}

export function isMsgBurnNFTEncodeObject(object: EncodeObject): object is MsgBurnNFTEncodeObject {
return (object as MsgBurnNFTEncodeObject).typeUrl === "/lbm.collection.v1.MsgBurnNFT";
}

export interface MsgBurnNFTFromEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgBurnNFTFrom";
readonly value: Partial<MsgBurnNFTFrom>;
}

export function isMsgBurnNFTFromEncodeObject(object: EncodeObject): object is MsgBurnNFTFromEncodeObject {
return (object as MsgBurnNFTFromEncodeObject).typeUrl === "/lbm.collection.v1.MsgBurnNFTFrom";
}

export interface MsgModifyEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgModify";
readonly value: Partial<MsgModify>;
}

export function isMsgModifyEncodeObject(object: EncodeObject): object is MsgModifyEncodeObject {
return (object as MsgModifyEncodeObject).typeUrl === "/lbm.collection.v1.MsgModify";
}

export interface MsgGrantPermissionEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgGrantPermission";
readonly value: Partial<MsgGrantPermission>;
}

export function isMsgGrantPermissionEncodeObject(
object: EncodeObject,
): object is MsgGrantPermissionEncodeObject {
return (object as MsgGrantPermissionEncodeObject).typeUrl === "/lbm.collection.v1.MsgGrantPermission";
}

export interface MsgRevokePermissionEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgRevokePermission";
readonly value: Partial<MsgRevokePermission>;
}

export function isMsgRevokePermissionEncodeObject(
object: EncodeObject,
): object is MsgRevokePermissionEncodeObject {
return (object as MsgRevokePermissionEncodeObject).typeUrl === "/lbm.collection.v1.MsgRevokePermission";
}

export interface MsgAttachEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgAttach";
readonly value: Partial<MsgAttach>;
}

export function isMsgAttachEncodeObject(object: EncodeObject): object is MsgAttachEncodeObject {
return (object as MsgAttachEncodeObject).typeUrl === "/lbm.collection.v1.MsgAttach";
}

export interface MsgDetachEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgDetach";
readonly value: Partial<MsgDetach>;
}

export function isMsgDetachEncodeObject(object: EncodeObject): object is MsgDetachEncodeObject {
return (object as MsgDetachEncodeObject).typeUrl === "/lbm.collection.v1.MsgDetach";
}

export interface MsgAttachFromEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgAttachFrom";
readonly value: Partial<MsgAttachFrom>;
}

export function isMsgAttachFromEncodeObject(object: EncodeObject): object is MsgAttachFromEncodeObject {
return (object as MsgAttachFromEncodeObject).typeUrl === "/lbm.collection.v1.MsgAttachFrom";
}

export interface MsgDetachFromEncodeObject extends EncodeObject {
readonly typeUrl: "/lbm.collection.v1.MsgDetachFrom";
readonly value: Partial<MsgDetachFrom>;
}

export function isMsgDetachFromEncodeObject(object: EncodeObject): object is MsgDetachFromEncodeObject {
return (object as MsgDetachFromEncodeObject).typeUrl === "/lbm.collection.v1.MsgDetachFrom";
}
Loading