Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/delegation-deployments/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Address } from 'viem';
import {
deployments_1_3_0,
deployments_1_1_0,
Expand Down Expand Up @@ -39,7 +40,7 @@ export const CHAIN_ID = {

type DeployedContracts = Record<
string,
Record<number, Record<string, `0x${string}`>>
Record<number, Record<string, Address>>
>;

export const DELEGATOR_CONTRACTS: DeployedContracts = {
Expand Down
3 changes: 2 additions & 1 deletion packages/delegation-toolkit/src/actions/signDelegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
Address,
Chain,
Client,
Hex,
Transport,
WalletClient,
} from 'viem';
Expand All @@ -29,7 +30,7 @@ export type SignDelegationParameters = {
allowInsecureUnrestrictedDelegation?: boolean;
};

export type SignDelegationReturnType = `0x${string}`;
export type SignDelegationReturnType = Hex;

/**
* Signs a delegation using a wallet client.
Expand Down
3 changes: 2 additions & 1 deletion packages/delegation-toolkit/src/actions/signUserOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
Address,
Chain,
Client,
Hex,
Transport,
WalletClient,
} from 'viem';
Expand All @@ -29,7 +30,7 @@ export type SignUserOperationParameters = {
version?: string;
};

export type SignUserOperationReturnType = `0x${string}`;
export type SignUserOperationReturnType = Hex;

/**
* Signs a user operation using a wallet client.
Expand Down
2 changes: 1 addition & 1 deletion packages/delegation-toolkit/src/userOp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export const signUserOperation = async ({
address,
version = '1',
}: {
privateKey: `0x${string}`;
privateKey: Hex;
userOperation: Omit<UserOperationV07, 'signature'>;
entryPoint: { address: Address };
chainId: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Account, Address } from 'viem';
import type { Account, Address, Hex } from 'viem';
import { createWalletClient, custom, isHex } from 'viem';
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';
import { sepolia } from 'viem/chains';
Expand Down Expand Up @@ -51,7 +51,7 @@ describe('signUserOperation Action', () => {
userOperation = {
sender: randomAddress(),
nonce: 0n,
callData: '0x',
callData: '0x' as Hex,
callGasLimit: 1000000n,
verificationGasLimit: 1000000n,
preVerificationGas: 21000n,
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('signUserOperation Action', () => {
paymaster: randomAddress(),
paymasterVerificationGasLimit: 50000n,
paymasterPostOpGasLimit: 50000n,
paymasterData: '0x1234' as `0x${string}`,
paymasterData: '0x1234' as Hex,
};

const parameters: SignUserOperationParameters = {
Expand All @@ -196,7 +196,7 @@ describe('signUserOperation Action', () => {
const userOpWithFactory = {
...userOperation,
factory: randomAddress(),
factoryData: '0x5678' as `0x${string}`,
factoryData: '0x5678' as Hex,
};

const parameters: SignUserOperationParameters = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('exactExecutionBatchBuilder()', () => {
});

it('should fail with an invalid target address', () => {
const invalidAddress = 'invalid-address' as Address;
const invalidAddress = 'invalid-address' as any;
expect(() =>
buildWithParams([
{
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('exactExecutionBatchBuilder()', () => {
{
target: randomAddress(),
value: 0n,
callData: 'invalid' as Hex,
callData: 'invalid' as any,
},
]),
).to.throw('Invalid calldata: must be a hex string starting with 0x');
Expand Down
Loading
Loading