From 105279afb824940e744a4366be25b83fb8fb74e0 Mon Sep 17 00:00:00 2001 From: Justin <328965+justinbarry@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:57:32 -0800 Subject: [PATCH] Fix vite issue with graz package deep imports (#61) --- .changeset/two-impalas-peel.md | 6 +++ .../hooks/useAbstraxionSigningClient.ts | 2 +- apps/abstraxion-dashboard/package.json | 1 + .../components/AbstraxionContext/index.tsx | 2 +- .../src/components/AbstraxionSignin/index.tsx | 2 +- .../src/hooks/useAbstraxionSigningClient.ts | 2 +- .../abstraxion/utils/get-account-address.ts | 2 +- pnpm-lock.yaml | 45 ++++++++++--------- 8 files changed, 36 insertions(+), 26 deletions(-) create mode 100644 .changeset/two-impalas-peel.md diff --git a/.changeset/two-impalas-peel.md b/.changeset/two-impalas-peel.md new file mode 100644 index 00000000..94602080 --- /dev/null +++ b/.changeset/two-impalas-peel.md @@ -0,0 +1,6 @@ +--- +"abstraxion-dashboard": minor +"@burnt-labs/abstraxion": minor +--- + +Fix vite issue with graz package deep imports diff --git a/apps/abstraxion-dashboard/hooks/useAbstraxionSigningClient.ts b/apps/abstraxion-dashboard/hooks/useAbstraxionSigningClient.ts index 05b1df20..81a2119e 100644 --- a/apps/abstraxion-dashboard/hooks/useAbstraxionSigningClient.ts +++ b/apps/abstraxion-dashboard/hooks/useAbstraxionSigningClient.ts @@ -1,5 +1,4 @@ import { useContext, useEffect, useState } from "react"; -import { GasPrice } from "graz/dist/cosmjs"; import { useStytch } from "@stytch/nextjs"; import { useCosmWasmSigningClient } from "graz"; import { AAClient, AbstractAccountJWTSigner } from "@burnt-labs/signers"; @@ -8,6 +7,7 @@ import { AbstraxionContext, AbstraxionContextProps, } from "@/components/AbstraxionContext"; +import { GasPrice } from "@cosmjs/stargate"; export const useAbstraxionSigningClient = () => { const { connectionType, abstractAccount } = useContext( diff --git a/apps/abstraxion-dashboard/package.json b/apps/abstraxion-dashboard/package.json index 330f52b5..bbe1d6e0 100644 --- a/apps/abstraxion-dashboard/package.json +++ b/apps/abstraxion-dashboard/package.json @@ -16,6 +16,7 @@ "@burnt-labs/tailwind-config": "workspace:*", "@burnt-labs/ui": "workspace:*", "@cosmjs/proto-signing": "^0.31.3", + "@cosmjs/stargate": "^0.31.3", "@stytch/nextjs": "^14.0.0", "@stytch/vanilla-js": "^3.2.1", "@tanstack/react-query": "^4.36.1", diff --git a/packages/abstraxion/src/components/AbstraxionContext/index.tsx b/packages/abstraxion/src/components/AbstraxionContext/index.tsx index 94cfd154..0312210a 100644 --- a/packages/abstraxion/src/components/AbstraxionContext/index.tsx +++ b/packages/abstraxion/src/components/AbstraxionContext/index.tsx @@ -1,5 +1,5 @@ import { ReactNode, createContext, useState } from "react"; -import type { DirectSecp256k1HdWallet } from "graz/dist/cosmjs"; +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; export interface AbstraxionContextProps { isConnected: boolean; diff --git a/packages/abstraxion/src/components/AbstraxionSignin/index.tsx b/packages/abstraxion/src/components/AbstraxionSignin/index.tsx index 5e23b97b..75f08698 100644 --- a/packages/abstraxion/src/components/AbstraxionSignin/index.tsx +++ b/packages/abstraxion/src/components/AbstraxionSignin/index.tsx @@ -1,9 +1,9 @@ "use client"; import { useContext, useEffect, useRef, useState } from "react"; -import { DirectSecp256k1HdWallet } from "graz/dist/cosmjs"; import { Button, ModalSection, BrowserIcon } from "@burnt-labs/ui"; import { wait } from "@/utils/wait"; import { AbstraxionContext } from "../AbstraxionContext"; +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; type GrantsResponse = { grants: Grant[]; diff --git a/packages/abstraxion/src/hooks/useAbstraxionSigningClient.ts b/packages/abstraxion/src/hooks/useAbstraxionSigningClient.ts index e337435f..3dede4e3 100644 --- a/packages/abstraxion/src/hooks/useAbstraxionSigningClient.ts +++ b/packages/abstraxion/src/hooks/useAbstraxionSigningClient.ts @@ -1,11 +1,11 @@ import { useContext, useEffect, useState } from "react"; -import { GasPrice } from "graz/dist/cosmjs"; import { testnetChainInfo } from "@burnt-labs/constants"; import { AbstraxionContext, AbstraxionContextProps, } from "@/src/components/AbstraxionContext"; import { GranteeSignerClient } from "@/src/GranteeSignerClient.ts"; +import { GasPrice } from "@cosmjs/stargate"; export const useAbstraxionSigningClient = () => { const { isConnected, abstraxionAccount, granterAddress } = useContext( diff --git a/packages/abstraxion/utils/get-account-address.ts b/packages/abstraxion/utils/get-account-address.ts index e3fa879d..3e3667f9 100644 --- a/packages/abstraxion/utils/get-account-address.ts +++ b/packages/abstraxion/utils/get-account-address.ts @@ -1,4 +1,4 @@ -import { DirectSecp256k1HdWallet } from "graz/dist/cosmjs"; +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; export async function getAccountAddress() { const existingKeypair = localStorage.getItem("xion-authz-temp-account"); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5e5a736d..4ec28783 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,7 @@ importers: version: 0.5.3(prettier@3.0.3) turbo: specifier: latest - version: 1.11.2 + version: 1.11.3 apps/abstraxion-dashboard: dependencies: @@ -53,6 +53,9 @@ importers: '@cosmjs/proto-signing': specifier: ^0.31.3 version: 0.31.3 + '@cosmjs/stargate': + specifier: ^0.31.3 + version: 0.31.3 '@stytch/nextjs': specifier: ^14.0.0 version: 14.0.0(@stytch/vanilla-js@3.2.1)(react-dom@18.2.0)(react@18.2.0) @@ -9915,64 +9918,64 @@ packages: yargs: 17.7.2 dev: false - /turbo-darwin-64@1.11.2: - resolution: {integrity: sha512-toFmRG/adriZY3hOps7nYCfqHAS+Ci6xqgX3fbo82kkLpC6OBzcXnleSwuPqjHVAaRNhVoB83L5njcE9Qwi2og==} + /turbo-darwin-64@1.11.3: + resolution: {integrity: sha512-IsOOg2bVbIt3o/X8Ew9fbQp5t1hTHN3fGNQYrPQwMR2W1kIAC6RfbVD4A9OeibPGyEPUpwOH79hZ9ydFH5kifw==} cpu: [x64] os: [darwin] requiresBuild: true dev: false optional: true - /turbo-darwin-arm64@1.11.2: - resolution: {integrity: sha512-FCsEDZ8BUSFYEOSC3rrARQrj7x2VOrmVcfrMUIhexTxproRh4QyMxLfr6LALk4ymx6jbDCxWa6Szal8ckldFbA==} + /turbo-darwin-arm64@1.11.3: + resolution: {integrity: sha512-FsJL7k0SaPbJzI/KCnrf/fi3PgCDCjTliMc/kEFkuWVA6Httc3Q4lxyLIIinz69q6JTx8wzh6yznUMzJRI3+dg==} cpu: [arm64] os: [darwin] requiresBuild: true dev: false optional: true - /turbo-linux-64@1.11.2: - resolution: {integrity: sha512-Vzda/o/QyEske5CxLf0wcu7UUS+7zB90GgHZV4tyN+WZtoouTvbwuvZ3V6b5Wgd3OJ/JwWR0CXDK7Sf4VEMr7A==} + /turbo-linux-64@1.11.3: + resolution: {integrity: sha512-SvW7pvTVRGsqtSkII5w+wriZXvxqkluw5FO/MNAdFw0qmoov+PZ237+37/NgArqE3zVn1GX9P6nUx9VO+xcQAg==} cpu: [x64] os: [linux] requiresBuild: true dev: false optional: true - /turbo-linux-arm64@1.11.2: - resolution: {integrity: sha512-bRLwovQRz0yxDZrM4tQEAYV0fBHEaTzUF0JZ8RG1UmZt/CqtpnUrJpYb1VK8hj1z46z9YehARpYCwQ2K0qU4yw==} + /turbo-linux-arm64@1.11.3: + resolution: {integrity: sha512-YhUfBi1deB3m+3M55X458J6B7RsIS7UtM3P1z13cUIhF+pOt65BgnaSnkHLwETidmhRh8Dl3GelaQGrB3RdCDw==} cpu: [arm64] os: [linux] requiresBuild: true dev: false optional: true - /turbo-windows-64@1.11.2: - resolution: {integrity: sha512-LgTWqkHAKgyVuLYcEPxZVGPInTjjeCnN5KQMdJ4uQZ+xMDROvMFS2rM93iQl4ieDJgidwHCxxCxaU9u8c3d/Kg==} + /turbo-windows-64@1.11.3: + resolution: {integrity: sha512-s+vEnuM2TiZuAUUUpmBHDr6vnNbJgj+5JYfnYmVklYs16kXh+EppafYQOAkcRIMAh7GjV3pLq5/uGqc7seZeHA==} cpu: [x64] os: [win32] requiresBuild: true dev: false optional: true - /turbo-windows-arm64@1.11.2: - resolution: {integrity: sha512-829aVBU7IX0c/B4G7g1VI8KniAGutHhIupkYMgF6xPkYVev2G3MYe6DMS/vsLt9GGM9ulDtdWxWrH5P2ngK8IQ==} + /turbo-windows-arm64@1.11.3: + resolution: {integrity: sha512-ZR5z5Zpc7cASwfdRAV5yNScCZBsgGSbcwiA/u3farCacbPiXsfoWUkz28iyrx21/TRW0bi6dbsB2v17swa8bjw==} cpu: [arm64] os: [win32] requiresBuild: true dev: false optional: true - /turbo@1.11.2: - resolution: {integrity: sha512-jPC7LVQJzebs5gWf8FmEvsvXGNyKbN+O9qpvv98xpNaM59aS0/Irhd0H0KbcqnXfsz7ETlzOC3R+xFWthC4Z8A==} + /turbo@1.11.3: + resolution: {integrity: sha512-RCJOUFcFMQNIGKSjC9YmA5yVP1qtDiBA0Lv9VIgrXraI5Da1liVvl3VJPsoDNIR9eFMyA/aagx1iyj6UWem5hA==} hasBin: true optionalDependencies: - turbo-darwin-64: 1.11.2 - turbo-darwin-arm64: 1.11.2 - turbo-linux-64: 1.11.2 - turbo-linux-arm64: 1.11.2 - turbo-windows-64: 1.11.2 - turbo-windows-arm64: 1.11.2 + turbo-darwin-64: 1.11.3 + turbo-darwin-arm64: 1.11.3 + turbo-linux-64: 1.11.3 + turbo-linux-arm64: 1.11.3 + turbo-windows-64: 1.11.3 + turbo-windows-arm64: 1.11.3 dev: false /type-check@0.4.0: