From caad35decb7851c89a93c8214afec20e6159b7a5 Mon Sep 17 00:00:00 2001 From: Cameron Gilbert Date: Tue, 23 Jan 2024 10:41:00 -0500 Subject: [PATCH] fix: path resolution (#294) --- scripts/build.sh | 10 +++++++++- src/sdk/msg/encode-types.ts | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 6ae379be..3e1f9cb3 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,10 +1,18 @@ #!/bin/bash set -e +# TODO: This assumes nibiru is a relative path in the current working directory, but this doesn't work locally cd nibiru git checkout releases/v0.21.x cd .. yarn gql-generate yarn proto-gen yarn build:tsc -yarn docgen + +echo "Fix path resolution" +dist_folder="./dist" +# Go through all ts and js files in the dist folder +find "$dist_folder" -type f \( -name "*.ts" -o -name "*.js" \) -exec sed -i 's|require("@/|require("src/|g' {} + + + +# yarn docgen diff --git a/src/sdk/msg/encode-types.ts b/src/sdk/msg/encode-types.ts index 13f471f3..0fb71b3d 100644 --- a/src/sdk/msg/encode-types.ts +++ b/src/sdk/msg/encode-types.ts @@ -1,9 +1,18 @@ import { EncodeObject } from "@cosmjs/proto-signing" +import { PerpMsgFactory } from "./perp" +import { SpotMsgFactory } from "./spot" export interface MsgTypeUrls { [msg: string]: string } +export declare class MsgFactory { + spot: typeof SpotMsgFactory + perp: typeof PerpMsgFactory +} + +export declare const Msg: MsgFactory + /** TxMessage: a message contained within a transaction. * * @field typeUrl: registered identifier for the proto message