stargate: Add logs helper

This commit is contained in:
willclarktech
2020-12-10 16:23:43 +00:00
parent 879a733b5b
commit 4b35668981
4 changed files with 15 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
export * as codec from "./codec";
export { getMsgType, getMsgTypeUrl } from "./encoding";
export { parseRawLog } from "./logs";
export {
AuthExtension,
BankExtension,
+11
View File
@@ -0,0 +1,11 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { logs } from "@cosmjs/launchpad";
export function parseRawLog(input = "[]"): readonly logs.Log[] {
const logsToParse = JSON.parse(input).map(({ events }: { events: readonly unknown[] }, i: number) => ({
msg_index: i,
events,
log: "",
}));
return logs.parseLogs(logsToParse);
}
+1
View File
@@ -1,5 +1,6 @@
export * as codec from "./codec";
export { getMsgType, getMsgTypeUrl } from "./encoding";
export { parseRawLog } from "./logs";
export {
AuthExtension,
BankExtension,
+2
View File
@@ -0,0 +1,2 @@
import { logs } from "@cosmjs/launchpad";
export declare function parseRawLog(input?: string): readonly logs.Log[];