Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
sembrestels committed Jun 23, 2024
1 parent 056ca4d commit a26c6c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/evmcrispr-terminal/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
],
"plugins": ["react"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"react/react-in-jsx-scope": "off"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/evmcrispr-terminal/src/overrides/safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import type { SafeAppProvider } from '@safe-global/safe-apps-provider';
import type { Opts } from '@safe-global/safe-apps-sdk';
// @ts-ignore
import type { type Connector } from '@wagmi/core';
import { ProviderNotFoundError, createConnector } from '@wagmi/core';
import type { Evaluate } from '@wagmi/core/internal';
Expand Down Expand Up @@ -92,12 +93,16 @@ export function safe(parameters: SafeParameters = {}) {
const { default: SafeAppsSDK } = await import(
'@safe-global/safe-apps-sdk'
);
// @ts-ignore
let SDK: typeof SafeAppsSDK.default;
if (
typeof SafeAppsSDK !== 'function' &&
// @ts-ignore
typeof SafeAppsSDK.default === 'function'
)
// @ts-ignore
SDK = SafeAppsSDK.default;
// @ts-ignore
else SDK = SafeAppsSDK as unknown as typeof SafeAppsSDK.default;
const sdk = new SDK(parameters);

Expand All @@ -110,11 +115,13 @@ export function safe(parameters: SafeParameters = {}) {
const { SafeAppProvider } = await import(
'@safe-global/safe-apps-provider/dist'
);
// @ts-ignore
provider_ = new SafeAppProvider(safe, sdk);
}
return provider_;
},
async getChainId() {
// @ts-ignore
const provider = await this.getProvider();
if (!provider) throw new ProviderNotFoundError();
return Number(provider.chainId);
Expand Down
3 changes: 2 additions & 1 deletion packages/evmcrispr-terminal/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"moduleResolution": "node",
"resolveJsonModule": true
},
"include": ["src", "**/*.tsx"],
"include": ["src", "**/*.tsx", "src/overrides"],
"exclude": ["node_modules"],
"references": [{ "path": "./tsconfig.node.json" }]
}

0 comments on commit a26c6c4

Please sign in to comment.