Skip to content

Commit fc10b91

Browse files
committed
cli: fix type errors
1 parent 1c753df commit fc10b91

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

cli/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.2.0",
44
"module": "src/index.ts",
55
"type": "module",
6+
"scripts": {
7+
"typecheck": "tsc --noEmit"
8+
},
69
"devDependencies": {
710
"@types/bun": "latest",
811
"@types/yargs": "^17.0.32"

cli/src/diff.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function diffObjects<T extends Record<string, any>>(obj1: T, obj2: T): Pa
4343
// prune empty objects
4444
for (const key in result) {
4545
if (isObject(result[key])) {
46-
if (Object.keys(result[key]).length === 0) {
46+
if (result[key] && Object.keys(result[key] as object).length === 0) {
4747
delete result[key];
4848
}
4949
}

cli/src/evmsigner.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,12 @@ export class EvmNativeSigner<N extends Network, C extends EvmChains = EvmChains>
136136
feeData.maxPriorityFeePerGas ?? maxPriorityFeePerGas;
137137
}
138138

139-
// Oasis throws malformed errors unless we
140-
// set it to use legacy transaction parameters
141-
const gasOpts =
142-
chain === 'Oasis'
143-
? {
144-
gasLimit,
145-
gasPrice: gasPrice,
146-
// Hardcode type
147-
type: 0,
148-
}
149-
: {
150-
gasPrice,
151-
maxFeePerGas,
152-
maxPriorityFeePerGas,
153-
gasLimit,
154-
};
139+
const gasOpts = {
140+
gasPrice,
141+
maxFeePerGas,
142+
maxPriorityFeePerGas,
143+
gasLimit,
144+
};
155145

156146
// TODO: DIFF ENDS HERE
157147

cli/src/getSigner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export async function getSigner<N extends Network, C extends Chain>(
6262
}
6363
privateKey = privateKeySource;
6464
}
65+
source = privateKey;
6566
signer = await solana.getSigner(
6667
await chain.getRpc(),
6768
privateKey,

cli/src/types.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Type declarations for Bun-specific imports
2+
3+
declare module "*.sol" {
4+
const content: string;
5+
export default content;
6+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"rebuild": "npm run rebuild --workspaces --if-present",
99
"build:solana": "npm run build --workspace=sdk/definitions --workspace=solana",
1010
"build:evm": "npm run build --workspace=sdk/definitions --workspace=sdk/evm",
11+
"typecheck:cli": "npm run typecheck --workspace=cli",
1112
"generate": "npm run generate --workspaces --if-present",
1213
"test": "npm run test --workspaces --if-present",
1314
"test:ci": "CI=true jest --config ./jest.config.ts",
@@ -36,4 +37,4 @@
3637
"sdk/examples",
3738
"cli"
3839
]
39-
}
40+
}

0 commit comments

Comments
 (0)