Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jul 24, 2024
1 parent 67960ea commit 6884221
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 21 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"build:trustedSetups:start": "mv src/node/trustedSetups.ts src/node/trustedSetups_esm.ts && mv src/node/trustedSetups_cjs.ts src/node/trustedSetups.ts",
"build:trustedSetups:end": "mv src/node/trustedSetups.ts src/node/trustedSetups_cjs.ts && mv src/node/trustedSetups_esm.ts src/node/trustedSetups.ts",
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./src/_types --emitDeclarationOnly --declaration --declarationMap",
"changeset:prepublish": "pnpm version:update && bun .scripts/prepublishOnly.ts && pnpm build",
"changeset:prepublish": "pnpm version:update && bun scripts/prepublishOnly.ts && pnpm build",
"changeset:publish": "pnpm changeset:prepublish && changeset publish",
"changeset:version": "changeset version && pnpm install --lockfile-only && pnpm version:update && pnpm format",
"clean": "rm -rf *.tsbuildinfo src/*.tsbuildinfo src/_esm src/_cjs src/_types",
"contracts:build": "forge build --config-path ./contracts/foundry.toml && bun .scripts/generateTypedArtifacts.ts",
"contracts:build": "forge build --config-path ./contracts/foundry.toml && bun scripts/generateTypedArtifacts.ts",
"deps": "pnpx taze -r",
"docs:dev": "pnpm --filter site dev",
"docs:build": "pnpm --filter site build",
Expand All @@ -23,10 +23,10 @@
"lint:repo": "sherif",
"lint:unused": "pnpm clean && knip",
"postinstall": "git submodule update --init --recursive && pnpm contracts:build",
"preconstruct": "bun .scripts/preconstruct.ts",
"preconstruct": "bun scripts/preconstruct.ts",
"preinstall": "pnpx only-allow pnpm",
"prepare": "pnpm simple-git-hooks",
"prepublishOnly": "bun .scripts/prepublishOnly.ts",
"prepublishOnly": "bun scripts/prepublishOnly.ts",
"size": "size-limit",
"test": "vitest -c ./test/vitest.config.ts dev",
"test:build": "publint --strict ./src && attw --pack ./src --ignore-rules false-esm",
Expand All @@ -44,7 +44,7 @@
"typecheck": "tsc --noEmit",
"vectors": "bun test vectors/**/*.test.ts",
"vectors:generate": "bun vectors/generate.ts",
"version:update": "bun .scripts/updateVersion.ts"
"version:update": "bun scripts/updateVersion.ts"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
Expand Down Expand Up @@ -91,7 +91,7 @@
},
"workspaces": {
".": {
"project": ".scripts/*.ts"
"project": "scripts/*.ts"
},
"src": {
"entry": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 9 additions & 3 deletions src/account-abstraction/types/userOperation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Address } from 'abitype'
import type { AbiStateMutability, Address } from 'abitype'
import type { ContractFunctionParameters } from '../../types/contract.js'
import type { Log } from '../../types/log.js'
import type { Hash, Hex } from '../../types/misc.js'
Expand Down Expand Up @@ -210,7 +210,10 @@ export type UserOperationCalls<
...result,
Prettify<
OneOf<
| (Omit<GetMulticallContractParameters<call>, 'address'> & {
| (Omit<
GetMulticallContractParameters<call, AbiStateMutability>,
'address'
> & {
to: Address
value?: bigint | undefined
})
Expand All @@ -225,7 +228,10 @@ export type UserOperationCalls<
...result,
Prettify<
OneOf<
| (Omit<GetMulticallContractParameters<call>, 'address'> & {
| (Omit<
GetMulticallContractParameters<call, AbiStateMutability>,
'address'
> & {
to: Address
value?: bigint | undefined
})
Expand Down
17 changes: 7 additions & 10 deletions src/accounts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
TransactionSerialized,
} from '../types/transaction.js'
import type { TypedDataDefinition } from '../types/typedData.js'
import type { Assign, IsNarrowable, OneOf } from '../types/utils.js'
import type { IsNarrowable, OneOf, Prettify } from '../types/utils.js'
import type { NonceManager } from '../utils/nonceManager.js'
import type { GetTransactionType } from '../utils/transaction/getTransactionType.js'
import type { SerializeTransactionFn } from '../utils/transaction/serializeTransaction.js'
Expand Down Expand Up @@ -67,19 +67,17 @@ export type JsonRpcAccount<address extends Address = Address> = {
export type LocalAccount<
source extends string = string,
address extends Address = Address,
> = Assign<
CustomSource,
{
> = Prettify<
CustomSource & {
address: address
publicKey: Hex
source: source
type: 'local'
}
>

export type HDAccount = Assign<
LocalAccount<'hd'>,
{
export type HDAccount = Prettify<
LocalAccount<'hd'> & {
getHdKey(): HDKey
// TODO(v3): This will be redundant.
sign: NonNullable<CustomSource['sign']>
Expand All @@ -104,9 +102,8 @@ export type HDOptions =
path: `m/44'/60'/${string}`
}

export type PrivateKeyAccount = Assign<
LocalAccount<'privateKey'>,
{
export type PrivateKeyAccount = Prettify<
LocalAccount<'privateKey'> & {
// TODO(v3): This will be redundant.
sign: NonNullable<CustomSource['sign']>
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export type MulticallResponse<
// infer contract parameters from `unknown`
export type GetMulticallContractParameters<
contract,
mutability extends AbiStateMutability = AbiStateMutability,
mutability extends AbiStateMutability,
> = contract extends { abi: infer abi extends Abi } // 1. Check if `abi` is const-asserted or defined inline
? // 1a. Check if `functionName` is valid for `abi`
contract extends {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": "./tsconfig.base.json",
"include": ["src", "test/src"],
"exclude": [],
"references": [{ "path": "./.scripts/tsconfig.json" }],
"references": [{ "path": "./scripts/tsconfig.json" }],
"compilerOptions": {
"baseUrl": ".",
"paths": {
Expand Down

0 comments on commit 6884221

Please sign in to comment.