Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
19 changes: 19 additions & 0 deletions src/messages/ibc/MsgAcknowledgement.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
18 changes: 18 additions & 0 deletions src/messages/ibc/MsgChannelCloseConfirm.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
15 changes: 15 additions & 0 deletions src/messages/ibc/MsgChannelCloseInit.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
28 changes: 28 additions & 0 deletions src/messages/ibc/MsgChannelOpenAck.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
18 changes: 18 additions & 0 deletions src/messages/ibc/MsgChannelOpenConfirm.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
16 changes: 16 additions & 0 deletions src/messages/ibc/MsgChannelOpenInit.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
29 changes: 29 additions & 0 deletions src/messages/ibc/MsgChannelOpenTry.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
36 changes: 36 additions & 0 deletions src/messages/ibc/MsgConnectionOpenAck.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
17 changes: 17 additions & 0 deletions src/messages/ibc/MsgConnectionOpenConfirm.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
19 changes: 19 additions & 0 deletions src/messages/ibc/MsgConnectionOpenInit.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
41 changes: 41 additions & 0 deletions src/messages/ibc/MsgConnectionOpenTry.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
16 changes: 16 additions & 0 deletions src/messages/ibc/MsgCreateClient.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
18 changes: 18 additions & 0 deletions src/messages/ibc/MsgRecvPacket.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
16 changes: 16 additions & 0 deletions src/messages/ibc/MsgSubmitMisbehaviour.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
20 changes: 20 additions & 0 deletions src/messages/ibc/MsgTimeout.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
21 changes: 21 additions & 0 deletions src/messages/ibc/MsgTimeoutOnClose.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
22 changes: 22 additions & 0 deletions src/messages/ibc/MsgTransfer.ts
Original file line number Diff line number Diff line change
@@ -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,
};
};
Loading