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

Proof of concept - export message types #83

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all 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
19 changes: 18 additions & 1 deletion src/msg/cosmos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ function newMsgVoteGovernance(
};
}

export interface Msg<V = any, T = string> {
type: T;
value: V;
}
export type TransferMsg = Msg<
{
source_port: string;
source_channel: string;
token: Coin;
sender: string;
receiver: string;
timeout_height: {};
timeout_timestamp: string;
},
'cosmos-sdk/MsgTransfer'
>;

/**
* Creates an IBC transfer
* @param {String} sourcePort the port identifier, we would expect to always be "transfer" * @param {String} sourcePort the port identifier, we would expect to always be "transfer"
Expand All @@ -75,7 +92,7 @@ function newMsgTransfer(
sender: string,
receiver: string,
timeoutTimestamp: number
) {
): TransferMsg {
return {
type: 'cosmos-sdk/MsgTransfer',
value: {
Expand Down