From 12c92616f226c68453842037a5bbc3f612319e7c Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 11:08:10 +0100 Subject: [PATCH 01/19] Add MsgTimeout and MsgUpdateClient --- src/messages/ibc/MsgTimeout.ts | 20 ++++++++++++++++++++ src/messages/ibc/MsgUpdateClient.ts | 16 ++++++++++++++++ src/messages/ibc/index.ts | 2 ++ src/messages/index.ts | 1 + 4 files changed, 39 insertions(+) create mode 100644 src/messages/ibc/MsgTimeout.ts create mode 100644 src/messages/ibc/MsgUpdateClient.ts create mode 100644 src/messages/ibc/index.ts diff --git a/src/messages/ibc/MsgTimeout.ts b/src/messages/ibc/MsgTimeout.ts new file mode 100644 index 0000000..115706e --- /dev/null +++ b/src/messages/ibc/MsgTimeout.ts @@ -0,0 +1,20 @@ +import { Message } from '../Message'; +import { MsgTimeout } from '../../codec/ibc/core/channel/v1/tx'; +import Long from 'long'; +import { Packet } from '../../codec/ibc/core/channel/v1/channel'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgTimeoutUrl = '/ibc.core.channel.v1.MsgTimeout'; + +export const BuildMsgTimeout = (nextSequenceRecv: Long.Long, proofUnreceived: Uint8Array, signer: string, packet?: Packet, proofHeight?: Height): Message => { + return { + typeUrl: MsgTimeoutUrl, + value: { + nextSequenceRecv, + packet, + proofHeight, + proofUnreceived, + signer, + } as MsgTimeout, + }; +}; diff --git a/src/messages/ibc/MsgUpdateClient.ts b/src/messages/ibc/MsgUpdateClient.ts new file mode 100644 index 0000000..94b6cd5 --- /dev/null +++ b/src/messages/ibc/MsgUpdateClient.ts @@ -0,0 +1,16 @@ +import { Message } from '../Message'; +import { MsgUpdateClient } from '../../codec/ibc/core/client/v1/tx'; +import { Any } from '../../codec/google/protobuf/any'; + +export const MsgUpdateClientUrl = '/ibc.core.client.v1.MsgUpdateClient'; + +export const BuildMsgUpdateClient = (clientId: string, signer: string, header?: Any): Message => { + return { + typeUrl: MsgUpdateClientUrl, + value: { + clientId, + signer, + header, + } as MsgUpdateClient, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts new file mode 100644 index 0000000..8d86f15 --- /dev/null +++ b/src/messages/ibc/index.ts @@ -0,0 +1,2 @@ +export * from './MsgTimeout'; +export * from './MsgUpdateClient'; diff --git a/src/messages/index.ts b/src/messages/index.ts index 5e1c9b7..6696bab 100644 --- a/src/messages/index.ts +++ b/src/messages/index.ts @@ -8,3 +8,4 @@ export * from './authz'; export * from './feegrant'; export * from './slashing'; export * from './vesting'; +export * from './ibc'; From 687cb8b471b3860f160cef9fb27e21570c5fe04c Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 11:14:15 +0100 Subject: [PATCH 02/19] Add MsgAcknowledgement --- src/messages/ibc/MsgAcknowledgement.ts | 19 +++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 20 insertions(+) create mode 100644 src/messages/ibc/MsgAcknowledgement.ts diff --git a/src/messages/ibc/MsgAcknowledgement.ts b/src/messages/ibc/MsgAcknowledgement.ts new file mode 100644 index 0000000..de8057b --- /dev/null +++ b/src/messages/ibc/MsgAcknowledgement.ts @@ -0,0 +1,19 @@ +import { Message } from '../Message'; +import { MsgAcknowledgement } from '../../codec/ibc/core/channel/v1/tx'; +import { Packet } from '../../codec/ibc/core/channel/v1/channel'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgAcknowledgementUrl = '/ibc.core.channel.v1.MsgAcknowledgement'; + +export const BuildMsgAcknowledgement = (acknowledgement: Uint8Array, proofAcked: Uint8Array, signer: string, packet?: Packet, proofHeight?: Height): Message => { + return { + typeUrl: MsgAcknowledgementUrl, + value: { + acknowledgement, + proofAcked, + signer, + packet, + proofHeight, + } as MsgAcknowledgement, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 8d86f15..3fec79d 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -1,2 +1,3 @@ export * from './MsgTimeout'; export * from './MsgUpdateClient'; +export * from './MsgAcknowledgement'; From d80916796a3c56b31ca7500e1b005d77f36d669d Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 11:18:46 +0100 Subject: [PATCH 03/19] Add MsgTransfer --- src/messages/ibc/MsgTransfer.ts | 22 ++++++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 23 insertions(+) create mode 100644 src/messages/ibc/MsgTransfer.ts diff --git a/src/messages/ibc/MsgTransfer.ts b/src/messages/ibc/MsgTransfer.ts new file mode 100644 index 0000000..67ef540 --- /dev/null +++ b/src/messages/ibc/MsgTransfer.ts @@ -0,0 +1,22 @@ +import { Message } from '../Message'; +import { MsgTransfer } from '../../codec/ibc/applications/transfer/v1/tx'; +import Long from 'long'; +import { Height } from '../../codec/ibc/core/client/v1/client'; +import { Coin } from '../../types'; + +export const MsgTransferUrl = '/ibc.applications.transfer.v1.MsgTransfer'; + +export const BuildMsgTransfer = (receiver: string, sender: string, sourceChannel: string, sourcePort: string, timeoutTimestamp: Long.Long, timeoutHeight?: Height, token?: Coin): Message => { + return { + typeUrl: MsgTransferUrl, + value: { + receiver, + sender, + sourceChannel, + sourcePort, + timeoutTimestamp, + timeoutHeight, + token, + } as MsgTransfer, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 3fec79d..a12f6d9 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -1,3 +1,4 @@ export * from './MsgTimeout'; export * from './MsgUpdateClient'; export * from './MsgAcknowledgement'; +export * from './MsgTransfer'; From 9ebda7c86a2799a5a8531ed6dfdf16a40b69c623 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 11:38:33 +0100 Subject: [PATCH 04/19] Add MsgChannelOpenInit --- src/messages/ibc/MsgChannelOpenInit.ts | 16 ++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 17 insertions(+) create mode 100644 src/messages/ibc/MsgChannelOpenInit.ts diff --git a/src/messages/ibc/MsgChannelOpenInit.ts b/src/messages/ibc/MsgChannelOpenInit.ts new file mode 100644 index 0000000..9320f76 --- /dev/null +++ b/src/messages/ibc/MsgChannelOpenInit.ts @@ -0,0 +1,16 @@ +import { Message } from '../Message'; +import { MsgChannelOpenInit } from '../../codec/ibc/core/channel/v1/tx'; +import { Channel } from '../../codec/ibc/core/channel/v1/channel'; + +export const MsgChannelOpenInitUrl = '/ibc.core.channel.v1.MsgChannelOpenInit'; + +export const BuildMsgChannelOpenInit = (portId: string, signer: string, channel?: Channel): Message => { + return { + typeUrl: MsgChannelOpenInitUrl, + value: { + portId, + signer, + channel, + } as MsgChannelOpenInit, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index a12f6d9..e1dd766 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -2,3 +2,4 @@ export * from './MsgTimeout'; export * from './MsgUpdateClient'; export * from './MsgAcknowledgement'; export * from './MsgTransfer'; +export * from './MsgChannelOpenInit'; From 46c8411dd35590734e34b274db715df575d31b78 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 11:43:08 +0100 Subject: [PATCH 05/19] Add MsgChannelOpenTry --- src/messages/ibc/MsgChannelOpenTry.ts | 29 +++++++++++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 30 insertions(+) create mode 100644 src/messages/ibc/MsgChannelOpenTry.ts diff --git a/src/messages/ibc/MsgChannelOpenTry.ts b/src/messages/ibc/MsgChannelOpenTry.ts new file mode 100644 index 0000000..4e11450 --- /dev/null +++ b/src/messages/ibc/MsgChannelOpenTry.ts @@ -0,0 +1,29 @@ +import { Message } from '../Message'; +import { MsgChannelOpenTry } from '../../codec/ibc/core/channel/v1/tx'; +import { Channel } from '../../codec/ibc/core/channel/v1/channel'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgChannelOpenTryUrl = '/ibc.core.channel.v1.MsgChannelOpenTry'; + +export const BuildMsgChannelOpenTry = ( + portId: string, + previousChannelId: string, + counterpartyVersion: string, + signer: string, + proofInit: Uint8Array, + channel?: Channel, + proofHeight?: Height, +): Message => { + return { + typeUrl: MsgChannelOpenTryUrl, + value: { + portId, + previousChannelId, + counterpartyVersion, + signer, + proofInit, + channel, + proofHeight, + } as MsgChannelOpenTry, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index e1dd766..5fbc562 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -3,3 +3,4 @@ export * from './MsgUpdateClient'; export * from './MsgAcknowledgement'; export * from './MsgTransfer'; export * from './MsgChannelOpenInit'; +export * from './MsgChannelOpenTry'; From 81568802c9995d489aec64e000f71a572bbb3e7b Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 11:46:58 +0100 Subject: [PATCH 06/19] Add MsgChannelOpenAck --- src/messages/ibc/MsgChannelOpenAck.ts | 28 +++++++++++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 29 insertions(+) create mode 100644 src/messages/ibc/MsgChannelOpenAck.ts diff --git a/src/messages/ibc/MsgChannelOpenAck.ts b/src/messages/ibc/MsgChannelOpenAck.ts new file mode 100644 index 0000000..a5550c6 --- /dev/null +++ b/src/messages/ibc/MsgChannelOpenAck.ts @@ -0,0 +1,28 @@ +import { Message } from '../Message'; +import { MsgChannelOpenAck } from '../../codec/ibc/core/channel/v1/tx'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgChannelOpenAckUrl = '/ibc.core.channel.v1.MsgChannelOpenAck'; + +export const BuildMsgChannelOpenAck = ( + portId: string, + channelId: string, + counterpartyChannelId: string, + counterpartyVersion: string, + signer: string, + proofTry: Uint8Array, + proofHeight?: Height, +): Message => { + return { + typeUrl: MsgChannelOpenAckUrl, + value: { + portId, + channelId, + counterpartyChannelId, + counterpartyVersion, + signer, + proofTry, + proofHeight, + } as MsgChannelOpenAck, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 5fbc562..78fd550 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -4,3 +4,4 @@ export * from './MsgAcknowledgement'; export * from './MsgTransfer'; export * from './MsgChannelOpenInit'; export * from './MsgChannelOpenTry'; +export * from './MsgChannelOpenAck'; From a7f575aba9b1b5ef03264c61a2bde16c81126aa5 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 11:52:25 +0100 Subject: [PATCH 07/19] Add MsgChannelOpenConfirm --- src/messages/ibc/MsgChannelOpenConfirm.ts | 18 ++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 19 insertions(+) create mode 100644 src/messages/ibc/MsgChannelOpenConfirm.ts diff --git a/src/messages/ibc/MsgChannelOpenConfirm.ts b/src/messages/ibc/MsgChannelOpenConfirm.ts new file mode 100644 index 0000000..09a9b3c --- /dev/null +++ b/src/messages/ibc/MsgChannelOpenConfirm.ts @@ -0,0 +1,18 @@ +import { Message } from '../Message'; +import { MsgChannelOpenConfirm } from '../../codec/ibc/core/channel/v1/tx'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgChannelOpenConfirmUrl = '/ibc.core.channel.v1.MsgChannelOpenConfirm'; + +export const BuildMsgChannelOpenConfirm = (channelId: string, portId: string, signer: string, proofAck: Uint8Array, proofHeight?: Height): Message => { + return { + typeUrl: MsgChannelOpenConfirmUrl, + value: { + channelId, + portId, + signer, + proofAck, + proofHeight, + } as MsgChannelOpenConfirm, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 78fd550..e452255 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -5,3 +5,4 @@ export * from './MsgTransfer'; export * from './MsgChannelOpenInit'; export * from './MsgChannelOpenTry'; export * from './MsgChannelOpenAck'; +export * from './MsgChannelOpenConfirm'; From 91b676fdfbc9621851f3da8ac1597971c2fd2c0c Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:07:53 +0100 Subject: [PATCH 08/19] Add MsgChannelCloseInit --- src/messages/ibc/MsgChannelCloseInit.ts | 15 +++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 16 insertions(+) create mode 100644 src/messages/ibc/MsgChannelCloseInit.ts diff --git a/src/messages/ibc/MsgChannelCloseInit.ts b/src/messages/ibc/MsgChannelCloseInit.ts new file mode 100644 index 0000000..a0b6893 --- /dev/null +++ b/src/messages/ibc/MsgChannelCloseInit.ts @@ -0,0 +1,15 @@ +import { Message } from '../Message'; +import { MsgChannelCloseInit } from '../../codec/ibc/core/channel/v1/tx'; + +export const MsgChannelCloseInitUrl = '/ibc.core.channel.v1.MsgChannelCloseInit'; + +export const BuildMsgChannelCloseInit = (channelId: string, signer: string, portId: string): Message => { + return { + typeUrl: MsgChannelCloseInitUrl, + value: { + channelId, + signer, + portId, + } as MsgChannelCloseInit, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index e452255..3be0aa2 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -6,3 +6,4 @@ export * from './MsgChannelOpenInit'; export * from './MsgChannelOpenTry'; export * from './MsgChannelOpenAck'; export * from './MsgChannelOpenConfirm'; +export * from './MsgChannelCloseInit'; From fdd5d1471cbc7e77a0526944e9363ac92d30b915 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:23:53 +0100 Subject: [PATCH 09/19] Add MsgChannelCloseConfirm --- src/messages/ibc/MsgChannelCloseConfirm.ts | 18 ++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 19 insertions(+) create mode 100644 src/messages/ibc/MsgChannelCloseConfirm.ts diff --git a/src/messages/ibc/MsgChannelCloseConfirm.ts b/src/messages/ibc/MsgChannelCloseConfirm.ts new file mode 100644 index 0000000..ca99f1a --- /dev/null +++ b/src/messages/ibc/MsgChannelCloseConfirm.ts @@ -0,0 +1,18 @@ +import { Message } from '../Message'; +import { MsgChannelCloseConfirm } from '../../codec/ibc/core/channel/v1/tx'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgChannelCloseConfirmUrl = '/ibc.core.channel.v1.MsgChannelCloseConfirm'; + +export const BuildMsgChannelCloseConfirm = (channelId: string, portId: string, signer: string, proofInit: Uint8Array, proofHeight?: Height): Message => { + return { + typeUrl: MsgChannelCloseConfirmUrl, + value: { + channelId, + portId, + signer, + proofInit, + proofHeight, + } as MsgChannelCloseConfirm, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 3be0aa2..39364f6 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -7,3 +7,4 @@ export * from './MsgChannelOpenTry'; export * from './MsgChannelOpenAck'; export * from './MsgChannelOpenConfirm'; export * from './MsgChannelCloseInit'; +export * from './MsgChannelCloseConfirm'; From 6a4534780d90b1f7b6bd1ef7d4337a2dca91fcdd Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:27:55 +0100 Subject: [PATCH 10/19] Add MsgRecvPacket --- src/messages/ibc/MsgRecvPacket.ts | 18 ++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 19 insertions(+) create mode 100644 src/messages/ibc/MsgRecvPacket.ts diff --git a/src/messages/ibc/MsgRecvPacket.ts b/src/messages/ibc/MsgRecvPacket.ts new file mode 100644 index 0000000..229a4d6 --- /dev/null +++ b/src/messages/ibc/MsgRecvPacket.ts @@ -0,0 +1,18 @@ +import { Message } from '../Message'; +import { MsgRecvPacket } from '../../codec/ibc/core/channel/v1/tx'; +import { Packet } from '../../codec/ibc/core/channel/v1/channel'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgRecvPacketUrl = '/ibc.core.channel.v1.MsgRecvPacket'; + +export const BuildMsgRecvPacket = (signer: string, proofCommitment: Uint8Array, packet?: Packet, proofHeight?: Height): Message => { + return { + typeUrl: MsgRecvPacketUrl, + value: { + signer, + proofCommitment, + packet, + proofHeight, + } as MsgRecvPacket, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 39364f6..d67397e 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -8,3 +8,4 @@ export * from './MsgChannelOpenAck'; export * from './MsgChannelOpenConfirm'; export * from './MsgChannelCloseInit'; export * from './MsgChannelCloseConfirm'; +export * from './MsgRecvPacket'; From cf09655ce60d8cabe4ddcb548607746aca33c1ba Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:32:03 +0100 Subject: [PATCH 11/19] Add MsgTimeoutOnClose --- src/messages/ibc/MsgTimeoutOnClose.ts | 21 +++++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 22 insertions(+) create mode 100644 src/messages/ibc/MsgTimeoutOnClose.ts diff --git a/src/messages/ibc/MsgTimeoutOnClose.ts b/src/messages/ibc/MsgTimeoutOnClose.ts new file mode 100644 index 0000000..ff16b2e --- /dev/null +++ b/src/messages/ibc/MsgTimeoutOnClose.ts @@ -0,0 +1,21 @@ +import { Message } from '../Message'; +import { MsgTimeoutOnClose } from '../../codec/ibc/core/channel/v1/tx'; +import Long from 'long'; +import { Packet } from '../../codec/ibc/core/channel/v1/channel'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgTimeoutOnCloseUrl = '/ibc.core.channel.v1.MsgTimeoutOnClose'; + +export const BuildMsgTimeoutOnClose = (nextSequenceRecv: Long.Long, signer: string, proofClose: Uint8Array, proofUnreceived: Uint8Array, packet?: Packet, proofHeight?: Height): Message => { + return { + typeUrl: MsgTimeoutOnCloseUrl, + value: { + nextSequenceRecv, + signer, + proofClose, + proofUnreceived, + packet, + proofHeight, + } as MsgTimeoutOnClose, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index d67397e..7fac134 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -9,3 +9,4 @@ export * from './MsgChannelOpenConfirm'; export * from './MsgChannelCloseInit'; export * from './MsgChannelCloseConfirm'; export * from './MsgRecvPacket'; +export * from './MsgTimeoutOnClose'; From 92c1f755ea718695067877835cee6bfc6dbcf778 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:39:40 +0100 Subject: [PATCH 12/19] Add MsgCreateClient --- src/messages/ibc/MsgCreateClient.ts | 16 ++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 17 insertions(+) create mode 100644 src/messages/ibc/MsgCreateClient.ts diff --git a/src/messages/ibc/MsgCreateClient.ts b/src/messages/ibc/MsgCreateClient.ts new file mode 100644 index 0000000..2b3aef6 --- /dev/null +++ b/src/messages/ibc/MsgCreateClient.ts @@ -0,0 +1,16 @@ +import { Message } from '../Message'; +import { MsgCreateClient } from '../../codec/ibc/core/client/v1/tx'; +import { Any } from '../../codec/google/protobuf/any'; + +export const MsgCreateClientUrl = '/ibc.core.client.v1.MsgCreateClient'; + +export const BuildMsgCreateClient = (signer: string, clientState?: Any, consensusState?: Any): Message => { + return { + typeUrl: MsgCreateClientUrl, + value: { + signer, + clientState, + consensusState, + } as MsgCreateClient, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 7fac134..3796d54 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -10,3 +10,4 @@ export * from './MsgChannelCloseInit'; export * from './MsgChannelCloseConfirm'; export * from './MsgRecvPacket'; export * from './MsgTimeoutOnClose'; +export * from './MsgCreateClient'; From 831280e75af5522cde1b6328c3ea702219d14157 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:46:07 +0100 Subject: [PATCH 13/19] Add MsgUpgradeClient --- src/messages/ibc/MsgUpgradeClient.ts | 19 +++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 20 insertions(+) create mode 100644 src/messages/ibc/MsgUpgradeClient.ts diff --git a/src/messages/ibc/MsgUpgradeClient.ts b/src/messages/ibc/MsgUpgradeClient.ts new file mode 100644 index 0000000..52e7ef8 --- /dev/null +++ b/src/messages/ibc/MsgUpgradeClient.ts @@ -0,0 +1,19 @@ +import { Message } from '../Message'; +import { MsgUpgradeClient } from '../../codec/ibc/core/client/v1/tx'; +import { Any } from '../../codec/google/protobuf/any'; + +export const MsgUpgradeClientUrl = '/ibc.core.client.v1.MsgUpgradeClient'; + +export const BuildMsgUpgradeClient = (clientId: string, proofUpgradeClient: Uint8Array, signer: string, proofUpgradeConsensusState: Uint8Array, clientState?: Any, consensusState?: Any): Message => { + return { + typeUrl: MsgUpgradeClientUrl, + value: { + clientId, + proofUpgradeClient, + signer, + proofUpgradeConsensusState, + clientState, + consensusState, + } as MsgUpgradeClient, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 3796d54..3e04b5e 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -11,3 +11,4 @@ export * from './MsgChannelCloseConfirm'; export * from './MsgRecvPacket'; export * from './MsgTimeoutOnClose'; export * from './MsgCreateClient'; +export * from './MsgUpgradeClient'; From 717bee59fdd1c5537f5a5a5f5ffca57a7d4fd22c Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:50:11 +0100 Subject: [PATCH 14/19] Add MsgSubmitMisbehaviour --- src/messages/ibc/MsgSubmitMisbehaviour.ts | 16 ++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 17 insertions(+) create mode 100644 src/messages/ibc/MsgSubmitMisbehaviour.ts diff --git a/src/messages/ibc/MsgSubmitMisbehaviour.ts b/src/messages/ibc/MsgSubmitMisbehaviour.ts new file mode 100644 index 0000000..10cb30c --- /dev/null +++ b/src/messages/ibc/MsgSubmitMisbehaviour.ts @@ -0,0 +1,16 @@ +import { Message } from '../Message'; +import { MsgSubmitMisbehaviour } from '../../codec/ibc/core/client/v1/tx'; +import { Any } from '../../codec/google/protobuf/any'; + +export const MsgSubmitMisbehaviourUrl = '/ibc.core.client.v1.MsgSubmitMisbehaviour'; + +export const BuildMsgSubmitMisbehaviour = (signer: string, clientId: string, misbehaviour?: Any): Message => { + return { + typeUrl: MsgSubmitMisbehaviourUrl, + value: { + signer, + clientId, + misbehaviour, + } as MsgSubmitMisbehaviour, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 3e04b5e..ce52ae1 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -12,3 +12,4 @@ export * from './MsgRecvPacket'; export * from './MsgTimeoutOnClose'; export * from './MsgCreateClient'; export * from './MsgUpgradeClient'; +export * from './MsgSubmitMisbehaviour'; From da1ee16d114c3368e435ef4b4a860943821e9dc6 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 12:57:28 +0100 Subject: [PATCH 15/19] Add MsgConnectionOpenInit --- src/messages/ibc/MsgConnectionOpenInit.ts | 19 +++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 20 insertions(+) create mode 100644 src/messages/ibc/MsgConnectionOpenInit.ts diff --git a/src/messages/ibc/MsgConnectionOpenInit.ts b/src/messages/ibc/MsgConnectionOpenInit.ts new file mode 100644 index 0000000..085a022 --- /dev/null +++ b/src/messages/ibc/MsgConnectionOpenInit.ts @@ -0,0 +1,19 @@ +import { Message } from '../Message'; +import { MsgConnectionOpenInit } from '../../codec/ibc/core/connection/v1/tx'; +import Long from 'long'; +import { Version, Counterparty } from '../../codec/ibc/core/connection/v1/connection'; + +export const MsgConnectionOpenInitUrl = '/ibc.core.connection.v1.MsgConnectionOpenInit'; + +export const BuildMsgConnectionOpenInit = (clientId: string, signer: string, delayPeriod: Long.Long, counterparty?: Counterparty, version?: Version): Message => { + return { + typeUrl: MsgConnectionOpenInitUrl, + value: { + clientId, + signer, + delayPeriod, + counterparty, + version, + } as MsgConnectionOpenInit, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index ce52ae1..07f9daa 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -13,3 +13,4 @@ export * from './MsgTimeoutOnClose'; export * from './MsgCreateClient'; export * from './MsgUpgradeClient'; export * from './MsgSubmitMisbehaviour'; +export * from './MsgConnectionOpenInit'; From 48c45b5b2a45d9f12305dc4034c05887b7d22b8d Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 13:03:31 +0100 Subject: [PATCH 16/19] Add MsgConnectionOpenTry --- src/messages/ibc/MsgConnectionOpenTry.ts | 41 ++++++++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 42 insertions(+) create mode 100644 src/messages/ibc/MsgConnectionOpenTry.ts diff --git a/src/messages/ibc/MsgConnectionOpenTry.ts b/src/messages/ibc/MsgConnectionOpenTry.ts new file mode 100644 index 0000000..9ff28fb --- /dev/null +++ b/src/messages/ibc/MsgConnectionOpenTry.ts @@ -0,0 +1,41 @@ +import { Message } from '../Message'; +import { MsgConnectionOpenTry } from '../../codec/ibc/core/connection/v1/tx'; +import Long from 'long'; +import { Counterparty, Version } from '../../codec/ibc/core/connection/v1/connection'; +import { Any } from '../../codec/google/protobuf/any'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgConnectionOpenTryUrl = '/ibc.core.connection.v1.MsgConnectionOpenTry'; + +export const BuildMsgConnectionOpenTry = ( + signer: string, + clientId: string, + previousConnectionId: string, + delayPeriod: Long.Long, + counterpartyVersions: Version[], + proofClient: Uint8Array, + proofConsensus: Uint8Array, + proofInit: Uint8Array, + clientState?: Any, + proofHeight?: Height, + consensusHeight?: Height, + counterparty?: Counterparty, +): Message => { + return { + typeUrl: MsgConnectionOpenTryUrl, + value: { + signer, + clientId, + previousConnectionId, + delayPeriod, + counterpartyVersions, + proofClient, + proofConsensus, + proofInit, + clientState, + proofHeight, + consensusHeight, + counterparty, + } as MsgConnectionOpenTry, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 07f9daa..845a73a 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -14,3 +14,4 @@ export * from './MsgCreateClient'; export * from './MsgUpgradeClient'; export * from './MsgSubmitMisbehaviour'; export * from './MsgConnectionOpenInit'; +export * from './MsgConnectionOpenTry'; From b18e580109bcaa829e0ae06521c83fbc4f0b2b5a Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 13:11:22 +0100 Subject: [PATCH 17/19] Add MsgConnectionOpenAck --- src/messages/ibc/MsgConnectionOpenAck.ts | 36 ++++++++++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 37 insertions(+) create mode 100644 src/messages/ibc/MsgConnectionOpenAck.ts diff --git a/src/messages/ibc/MsgConnectionOpenAck.ts b/src/messages/ibc/MsgConnectionOpenAck.ts new file mode 100644 index 0000000..e32dcc8 --- /dev/null +++ b/src/messages/ibc/MsgConnectionOpenAck.ts @@ -0,0 +1,36 @@ +import { Message } from '../Message'; +import { MsgConnectionOpenAck } from '../../codec/ibc/core/connection/v1/tx'; +import { Any } from '../../codec/google/protobuf/any'; +import { Height } from '../../codec/ibc/core/client/v1/client'; +import { Version } from '../../codec/ibc/core/connection/v1/connection'; + +export const MsgConnectionOpenAckUrl = '/ibc.core.connection.v1.MsgConnectionOpenAck'; + +export const BuildMsgConnectionOpenAck = ( + connectionId: string, + signer: string, + counterpartyConnectionId: string, + proofClient: Uint8Array, + proofConsensus: Uint8Array, + proofTry: Uint8Array, + clientState?: Any, + proofHeight?: Height, + consensusHeight?: Height, + version?: Version, +): Message => { + return { + typeUrl: MsgConnectionOpenAckUrl, + value: { + connectionId, + signer, + counterpartyConnectionId, + proofClient, + proofConsensus, + proofTry, + clientState, + proofHeight, + consensusHeight, + version, + } as MsgConnectionOpenAck, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 845a73a..2d4ff95 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -15,3 +15,4 @@ export * from './MsgUpgradeClient'; export * from './MsgSubmitMisbehaviour'; export * from './MsgConnectionOpenInit'; export * from './MsgConnectionOpenTry'; +export * from './MsgConnectionOpenAck'; From 592d7f4913811ca681175ae39f5e2e200f815b45 Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 13:15:28 +0100 Subject: [PATCH 18/19] Add MsgConnectionOpenConfirm --- src/messages/ibc/MsgConnectionOpenConfirm.ts | 17 +++++++++++++++++ src/messages/ibc/index.ts | 1 + 2 files changed, 18 insertions(+) create mode 100644 src/messages/ibc/MsgConnectionOpenConfirm.ts diff --git a/src/messages/ibc/MsgConnectionOpenConfirm.ts b/src/messages/ibc/MsgConnectionOpenConfirm.ts new file mode 100644 index 0000000..7a90dfd --- /dev/null +++ b/src/messages/ibc/MsgConnectionOpenConfirm.ts @@ -0,0 +1,17 @@ +import { Message } from '../Message'; +import { MsgConnectionOpenConfirm } from '../../codec/ibc/core/connection/v1/tx'; +import { Height } from '../../codec/ibc/core/client/v1/client'; + +export const MsgConnectionOpenConfirmUrl = '/ibc.core.connection.v1.MsgConnectionOpenConfirm'; + +export const BuildMsgConnectionOpenConfirm = (connectionId: string, signer: string, proofAck: Uint8Array, proofHeight?: Height): Message => { + return { + typeUrl: MsgConnectionOpenConfirmUrl, + value: { + connectionId, + signer, + proofAck, + proofHeight, + } as MsgConnectionOpenConfirm, + }; +}; diff --git a/src/messages/ibc/index.ts b/src/messages/ibc/index.ts index 2d4ff95..2bebc98 100644 --- a/src/messages/ibc/index.ts +++ b/src/messages/ibc/index.ts @@ -16,3 +16,4 @@ export * from './MsgSubmitMisbehaviour'; export * from './MsgConnectionOpenInit'; export * from './MsgConnectionOpenTry'; export * from './MsgConnectionOpenAck'; +export * from './MsgConnectionOpenAck'; From 7aeae19ee900da34520d961e3c009361ccdaa8ad Mon Sep 17 00:00:00 2001 From: Thibault Jaillard Date: Wed, 26 Jan 2022 13:19:40 +0100 Subject: [PATCH 19/19] Bump version to 0.7.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 507b9a6..93fb6c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lum-network/sdk-javascript", - "version": "0.7.3", + "version": "0.7.4", "license": "Apache-2.0", "description": "Javascript SDK library for NodeJS and Web browsers to interact with the Lum Network.", "homepage": "https://github.com/lum-network/sdk-javascript#readme",