Skip to content

Commit 6dce7aa

Browse files
authored
chore: add global adapter to fix sdk-tools (#6753)
* chore: add global adapter to fix sdk-tools * fix: fix build * fix: add vercel to deploy
1 parent c35a88e commit 6dce7aa

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

apps/sdk-tools/src/main.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
import { StrictMode } from 'react'
22

33
import 'inter-ui'
4+
import { getRpcProvider } from '@cowprotocol/common-const'
5+
import { setGlobalAdapter, SupportedChainId } from '@cowprotocol/cow-sdk'
6+
import { EthersV5Adapter } from '@cowprotocol/sdk-ethers-v5-adapter'
7+
48
import { createRoot } from 'react-dom/client'
59

610
import { SdkTools } from './SdkTools'
711

12+
// Initialize the global adapter for the CoW SDK
13+
const adapter = new EthersV5Adapter({
14+
provider: getRpcProvider(SupportedChainId.MAINNET)!,
15+
})
16+
setGlobalAdapter(adapter)
17+
818
// TODO: Add proper return type annotation
919
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1020
function Root() {

apps/sdk-tools/tsconfig.app.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
5-
"types": ["node", "vite/client"],
6-
"composite": true,
7-
"declaration": true
5+
"types": ["node", "vite/client"]
86
},
97
"files": ["../../node_modules/@nx/react/typings/cssmodule.d.ts", "../../node_modules/@nx/react/typings/image.d.ts"],
108
"exclude": [

apps/sdk-tools/vercel.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"rewrites": [
3+
{
4+
"source": "/(.*)",
5+
"destination": "/index.html"
6+
}
7+
],
8+
"buildCommand": "cd ../../ && yarn build:sdk-tools",
9+
"outputDirectory": "../../build/sdk-tools",
10+
"installCommand": "cd ../../ && yarn run install:ci"
11+
}

0 commit comments

Comments
 (0)