@vlayer/sdk 0.1.0-nightly-20241021-1eb6b14 → 0.1.0-nightly-20241023-a7e98bb

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@vlayer/sdk",
3
3
  "type": "module",
4
4
  "exports": "./src/index.ts",
5
- "version": "0.1.0-nightly-20241021-1eb6b14",
5
+ "version": "0.1.0-nightly-20241023-a7e98bb",
6
6
  "types": "src/index.ts",
7
7
  "scripts": {
8
8
  "build": "npm run gen:types",
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  type Abi,
3
3
  type Address,
4
+ type Chain,
4
5
  type ContractFunctionArgs,
5
6
  type ContractFunctionName,
6
7
  createTestClient,
@@ -132,20 +133,19 @@ export async function writeContract<
132
133
  functionName: F,
133
134
  args: ContractFunctionArgs<T, "payable" | "nonpayable", F>,
134
135
  sender?: Address,
135
- chainId: number = foundry.id,
136
+ chain: Chain = foundry,
136
137
  ) {
137
- const ethClient = createAnvilClient(chainId);
138
+ const ethClient = createAnvilClient(chain.id);
138
139
  const selectedSender = sender || (await ethClient.getAddresses())[0];
139
140
 
140
141
  const txHash = await ethClient.writeContract({
141
- abi,
142
+ abi: abi as Abi,
142
143
  address,
143
144
  functionName,
144
- args,
145
+ args: args as readonly unknown[],
146
+ chain,
145
147
  account: selectedSender,
146
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
147
- } as any);
148
- // TODO: fix any to viem type
148
+ });
149
149
 
150
150
  const txReceipt = await ethClient.waitForTransactionReceipt({ hash: txHash });
151
151
 
package/tsconfig.json CHANGED
@@ -1,22 +1,17 @@
1
1
  {
2
+ "extends": "../tsconfig.base.json",
2
3
  "compilerOptions": {
3
4
  "lib": [
4
5
  "ESNext"
5
6
  ],
6
- "module": "esnext",
7
- "target": "esnext",
8
7
  "moduleResolution": "bundler",
9
8
  "moduleDetection": "force",
10
9
  "allowImportingTsExtensions": true,
11
- "strict": true,
12
10
  "downlevelIteration": true,
13
- "skipLibCheck": true,
14
11
  "jsx": "preserve",
15
12
  "allowSyntheticDefaultImports": true,
16
13
  "forceConsistentCasingInFileNames": true,
17
14
  "allowJs": true,
18
- "noEmit": true,
19
- "composite": true,
20
15
  "types": [
21
16
  "bun" // add Bun global
22
17
  ],