Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing extensions on imports #344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import {
toSmartAccount
} from "viem/account-abstraction"
import { signMessage } from "viem/actions"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { BiconomyAbi, FactoryAbi } from "./abi/BiconomySmartAccountAbi.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"
import { BiconomyAbi, FactoryAbi } from "./abi/BiconomySmartAccountAbi"

const BICONOMY_PROXY_CREATION_CODE =
"0x6080346100aa57601f61012038819003918201601f19168301916001600160401b038311848410176100af578084926020946040528339810103126100aa57516001600160a01b0381168082036100aa5715610065573055604051605a90816100c68239f35b60405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420696d706c656d656e746174696f6e206164647265737300006044820152606490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe608060405230546000808092368280378136915af43d82803e156020573d90f35b3d90fdfea2646970667358221220a03b18dce0be0b4c9afe58a9eb85c35205e2cf087da098bbf1d23945bf89496064736f6c63430008110033"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import {
} from "viem/account-abstraction"
import { getChainId } from "viem/actions"
import { getAction } from "viem/utils"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { getSenderAddress } from "../../actions/public/getSenderAddress.js"
import { encode7579Calls } from "../../utils/encode7579Calls.js"
import { toOwner } from "../../utils/index.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"
import { getSenderAddress } from "../../actions/public/getSenderAddress"
import { encode7579Calls } from "../../utils/encode7579Calls"
import { toOwner } from "../../utils/index"
import {
DEFAULT_CONTRACT_ADDRESS,
DUMMY_ECDSA_SIGNATURE,
type NetworkAddresses
} from "./constants.js"
import { getInitMSAData } from "./utils/getInitMSAData.js"
import { getNonceKeyWithEncoding } from "./utils/getNonceKey.js"
} from "./constants"
import { getInitMSAData } from "./utils/getInitMSAData"
import { getNonceKeyWithEncoding } from "./utils/getNonceKey"

/**
* The account creation ABI for a modular etherspot smart account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Address, encodeFunctionData, zeroAddress } from "viem"
import {
EtherspotBootstrapAbi,
EtherspotOnInstallAbi
} from "../abi/EtherspotBootstrapAbi.js"
} from "../abi/EtherspotBootstrapAbi"

export const getInitMSAData = (ecdsaValidatorAddress: Address) => {
const validators = makeBootstrapConfig(ecdsaValidatorAddress, "0x")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Address, concatHex, pad, toHex } from "viem"
import { VALIDATOR_MODE, VALIDATOR_TYPE } from "../constants.js"
import { VALIDATOR_MODE, VALIDATOR_TYPE } from "../constants"

export const getNonceKeyWithEncoding = (
validatorAddress: Address,
Expand Down
20 changes: 10 additions & 10 deletions packages/permissionless/accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,73 @@ import {
type ToSimpleSmartAccountParameters,
type ToSimpleSmartAccountReturnType,
toSimpleSmartAccount
} from "./simple/toSimpleSmartAccount.js"
} from "./simple/toSimpleSmartAccount"

import {
type LightAccountVersion,
type LightSmartAccountImplementation,
type ToLightSmartAccountParameters,
type ToLightSmartAccountReturnType,
toLightSmartAccount
} from "./light/toLightSmartAccount.js"
} from "./light/toLightSmartAccount"

import {
type ToTrustSmartAccountParameters,
type ToTrustSmartAccountReturnType,
type TrustSmartAccountImplementation,
toTrustSmartAccount
} from "./trust/toTrustSmartAccount.js"
} from "./trust/toTrustSmartAccount"

import {
type EtherspotSmartAccountImplementation,
type ToEtherspotSmartAccountParameters,
type ToEtherspotSmartAccountReturnType,
toEtherspotSmartAccount
} from "./etherspot/toEtherspotSmartAccount.js"
} from "./etherspot/toEtherspotSmartAccount"

import {
type SafeSmartAccountImplementation,
type SafeVersion,
type ToSafeSmartAccountParameters,
type ToSafeSmartAccountReturnType,
toSafeSmartAccount
} from "./safe/toSafeSmartAccount.js"
} from "./safe/toSafeSmartAccount"

import {
type EcdsaKernelSmartAccountImplementation,
type ToEcdsaKernelSmartAccountParameters,
type ToEcdsaKernelSmartAccountReturnType,
toEcdsaKernelSmartAccount
} from "./kernel/toEcdsaKernelSmartAccount.js"
} from "./kernel/toEcdsaKernelSmartAccount"

import {
type KernelSmartAccountImplementation,
type KernelVersion,
type ToKernelSmartAccountParameters,
type ToKernelSmartAccountReturnType,
toKernelSmartAccount
} from "./kernel/toKernelSmartAccount.js"
} from "./kernel/toKernelSmartAccount"

import {
type BiconomySmartAccountImplementation,
type ToBiconomySmartAccountParameters,
type ToBiconomySmartAccountReturnType,
toBiconomySmartAccount
} from "./biconomy/toBiconomySmartAccount.js"
} from "./biconomy/toBiconomySmartAccount"

import {
type NexusSmartAccountImplementation,
type ToNexusSmartAccountParameters,
type ToNexusSmartAccountReturnType,
toNexusSmartAccount
} from "./nexus/toNexusSmartAccount.js"
} from "./nexus/toNexusSmartAccount"

import {
type ThirdwebSmartAccountImplementation,
type ToThirdwebSmartAccountParameters,
type ToThirdwebSmartAccountReturnType,
toThirdwebSmartAccount
} from "./thirdweb/toThirdwebSmartAccount.js"
} from "./thirdweb/toThirdwebSmartAccount"

export {
type ToSimpleSmartAccountParameters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import type {
Transport,
WalletClient
} from "viem"
import type { EthereumProvider } from "../../utils/toOwner.js"
import type { EthereumProvider } from "../../utils/toOwner"
import {
type KernelSmartAccountImplementation,
type KernelVersion,
type ToKernelSmartAccountParameters,
type ToKernelSmartAccountReturnType,
toKernelSmartAccount
} from "./toKernelSmartAccount.js"
} from "./toKernelSmartAccount"

export type ToEcdsaKernelSmartAccountParameters<
entryPointVersion extends "0.6" | "0.7",
Expand Down
26 changes: 13 additions & 13 deletions packages/permissionless/accounts/kernel/toKernelSmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@ import {
import { signMessage as _signMessage, getChainId } from "viem/actions"
import { getAction } from "viem/utils"
import { base64UrlToBytes, bytesToHex, parsePublicKey } from "webauthn-p256"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { getSenderAddress } from "../../actions/public/getSenderAddress.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { KernelInitAbi } from "./abi/KernelAccountAbi.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"
import { getSenderAddress } from "../../actions/public/getSenderAddress"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"
import { KernelInitAbi } from "./abi/KernelAccountAbi"
import {
KernelV3InitAbi,
KernelV3_1AccountAbi
} from "./abi/KernelV3AccountAbi.js"
import { KernelV3MetaFactoryDeployWithFactoryAbi } from "./abi/KernelV3MetaFactoryAbi.js"
} from "./abi/KernelV3AccountAbi"
import { KernelV3MetaFactoryDeployWithFactoryAbi } from "./abi/KernelV3MetaFactoryAbi"
import {
DUMMY_ECDSA_SIGNATURE,
ROOT_MODE_KERNEL_V2,
VALIDATOR_TYPE
} from "./constants.js"
import { encodeCallData } from "./utils/encodeCallData.js"
import { getNonceKeyWithEncoding } from "./utils/getNonceKey.js"
import { isKernelV2 } from "./utils/isKernelV2.js"
import { isWebAuthnAccount } from "./utils/isWebAuthnAccount.js"
import { signMessage } from "./utils/signMessage.js"
import { signTypedData } from "./utils/signTypedData.js"
} from "./constants"
import { encodeCallData } from "./utils/encodeCallData"
import { getNonceKeyWithEncoding } from "./utils/getNonceKey"
import { isKernelV2 } from "./utils/isKernelV2"
import { isWebAuthnAccount } from "./utils/isWebAuthnAccount"
import { signMessage } from "./utils/signMessage"
import { signTypedData } from "./utils/signTypedData"

/**
* The account creation ABI for a kernel smart account (from the KernelFactory)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type Address, type Hex, encodeFunctionData } from "viem"
import { encode7579Calls } from "../../../utils/encode7579Calls.js"
import { KernelExecuteAbi } from "../abi/KernelAccountAbi.js"
import type { KernelVersion } from "../toKernelSmartAccount.js"
import { isKernelV2 } from "./isKernelV2.js"
import { encode7579Calls } from "../../../utils/encode7579Calls"
import { KernelExecuteAbi } from "../abi/KernelAccountAbi"
import type { KernelVersion } from "../toKernelSmartAccount"
import { isKernelV2 } from "./isKernelV2"

export const encodeCallData = ({
kernelVersion,
Expand Down
6 changes: 3 additions & 3 deletions packages/permissionless/accounts/kernel/utils/getNonceKey.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Address, concatHex, maxUint16, pad, toHex } from "viem"
import { VALIDATOR_MODE, VALIDATOR_TYPE } from "../constants.js"
import type { KernelVersion } from "../toKernelSmartAccount.js"
import { isKernelV2 } from "./isKernelV2.js"
import { VALIDATOR_MODE, VALIDATOR_TYPE } from "../constants"
import type { KernelVersion } from "../toKernelSmartAccount"
import { isKernelV2 } from "./isKernelV2"

export const getNonceKeyWithEncoding = (
kernelVersion: KernelVersion<"0.6" | "0.7">,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { KernelVersion } from "../toKernelSmartAccount.js"
import type { KernelVersion } from "../toKernelSmartAccount"

export const isKernelV2 = (version: KernelVersion<"0.6" | "0.7">): boolean => {
const regex = /0\.2\.\d+/
Expand Down
4 changes: 2 additions & 2 deletions packages/permissionless/accounts/kernel/utils/signMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import {
import type { WebAuthnAccount } from "viem/account-abstraction"
import { signMessage as _signMessage } from "viem/actions"
import { parseSignature } from "webauthn-p256"
import { isWebAuthnAccount } from "./isWebAuthnAccount.js"
import { isWebAuthnAccount } from "./isWebAuthnAccount"
import {
type WrapMessageHashParams,
wrapMessageHash
} from "./wrapMessageHash.js"
} from "./wrapMessageHash"

export async function signMessage({
message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
validateTypedData
} from "viem"
import type { WebAuthnAccount } from "viem/account-abstraction"
import { isWebAuthnAccount } from "./isWebAuthnAccount.js"
import { signMessage } from "./signMessage.js"
import { isWebAuthnAccount } from "./isWebAuthnAccount"
import { signMessage } from "./signMessage"
import {
type WrapMessageHashParams,
wrapMessageHash
} from "./wrapMessageHash.js"
} from "./wrapMessageHash"

export async function signTypedData(
parameters: TypedDataDefinition &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
stringToHex
} from "viem"
import { type Address, domainSeparator } from "viem"
import type { KernelVersion } from "../toKernelSmartAccount.js"
import { isKernelV2 } from "./isKernelV2.js"
import type { KernelVersion } from "../toKernelSmartAccount"
import { isKernelV2 } from "./isKernelV2"

export type WrapMessageHashParams = {
kernelVersion: KernelVersion<"0.6" | "0.7">
Expand Down
6 changes: 3 additions & 3 deletions packages/permissionless/accounts/light/toLightSmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import {
} from "viem/account-abstraction"
import { getChainId, signMessage } from "viem/actions"
import { getAction } from "viem/utils"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { getSenderAddress } from "../../actions/public/getSenderAddress.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"
import { getSenderAddress } from "../../actions/public/getSenderAddress"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"

const getAccountInitCode = async (
owner: Address,
Expand Down
6 changes: 3 additions & 3 deletions packages/permissionless/accounts/nexus/toNexusSmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import {
} from "viem/account-abstraction"
import { getChainId, readContract } from "viem/actions"
import { getAction } from "viem/utils"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { encode7579Calls } from "../../utils/encode7579Calls.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"
import { encode7579Calls } from "../../utils/encode7579Calls"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"

const wrapMessageHash = (
messageHash: Hex,
Expand Down
8 changes: 4 additions & 4 deletions packages/permissionless/accounts/safe/toSafeSmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import {
} from "viem/account-abstraction"
import { getChainId, readContract, signTypedData } from "viem/actions"
import { getAction } from "viem/utils"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { encode7579Calls } from "../../utils/encode7579Calls.js"
import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"
import { encode7579Calls } from "../../utils/encode7579Calls"
import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"

export type SafeVersion = "1.4.1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import {
} from "viem/account-abstraction"
import { getChainId, signMessage } from "viem/actions"
import { getAction } from "viem/utils"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { getSenderAddress } from "../../actions/public/getSenderAddress.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"
import { getSenderAddress } from "../../actions/public/getSenderAddress"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"

const getAccountInitCode = async (
owner: Address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
WalletClient
} from "viem"
import { getChainId } from "viem/actions"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"

import {
type SmartAccount,
Expand All @@ -24,12 +24,12 @@ import {
toSmartAccount
} from "viem/account-abstraction"
import { getAction, toHex } from "viem/utils"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { encodeCallData } from "./utils/encodeCallData.js"
import { getAccountAddress } from "./utils/getAccountAddress.js"
import { getFactoryData } from "./utils/getFactoryData.js"
import { signMessage } from "./utils/signMessage.js"
import { signTypedData } from "./utils/signTypedData.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"
import { encodeCallData } from "./utils/encodeCallData"
import { getAccountAddress } from "./utils/getAccountAddress"
import { getFactoryData } from "./utils/getFactoryData"
import { signMessage } from "./utils/signMessage"
import { signTypedData } from "./utils/signTypedData"

/**
* Default addresses for Thirdweb Smart Account
Expand Down
10 changes: 5 additions & 5 deletions packages/permissionless/accounts/trust/toTrustSmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
hashTypedData
} from "viem"
import { getChainId, signMessage } from "viem/actions"
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
import { getAccountNonce } from "../../actions/public/getAccountNonce"

import {
type SmartAccount,
Expand All @@ -25,10 +25,10 @@ import {
toSmartAccount
} from "viem/account-abstraction"
import { getAction } from "viem/utils"
import { getSenderAddress } from "../../actions/public/getSenderAddress.js"
import { type EthereumProvider, toOwner } from "../../utils/toOwner.js"
import { encodeCallData } from "./utils/encodeCallData.js"
import { getFactoryData } from "./utils/getFactoryData.js"
import { getSenderAddress } from "../../actions/public/getSenderAddress"
import { type EthereumProvider, toOwner } from "../../utils/toOwner"
import { encodeCallData } from "./utils/encodeCallData"
import { getFactoryData } from "./utils/getFactoryData"

async function _signTypedData(
signer: LocalAccount,
Expand Down
Loading