stargate: Add IBC packetAcknowledgements query

This commit is contained in:
willclarktech 2020-11-11 15:42:27 +01:00
parent d9b8110999
commit b252074c11
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
2 changed files with 18 additions and 0 deletions

View File

@ -46,6 +46,11 @@ export interface IbcExtension {
channelId: string,
sequence: number,
) => Promise<ibc.core.channel.v1.IQueryPacketAcknowledgementResponse>;
readonly packetAcknowledgements: (
portId: string,
channelId: string,
paginationKey?: Uint8Array,
) => Promise<ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse>;
readonly unreceivedPackets: (
portId: string,
channelId: string,
@ -175,6 +180,14 @@ export function setupIbcExtension(base: QueryClient): IbcExtension {
});
return toObject(response);
},
packetAcknowledgements: async (portId: string, channelId: string, paginationKey?: Uint8Array) => {
const response = await channelQueryService.packetAcknowledgements({
portId: portId,
channelId: channelId,
pagination: paginationKey ? { key: paginationKey } : undefined,
});
return toObject(response);
},
unreceivedPackets: async (
portId: string,
channelId: string,

View File

@ -35,6 +35,11 @@ export interface IbcExtension {
channelId: string,
sequence: number,
) => Promise<ibc.core.channel.v1.IQueryPacketAcknowledgementResponse>;
readonly packetAcknowledgements: (
portId: string,
channelId: string,
paginationKey?: Uint8Array,
) => Promise<ibc.core.channel.v1.IQueryPacketAcknowledgementsResponse>;
readonly unreceivedPackets: (
portId: string,
channelId: string,