permissionless 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js +11 -11
- package/_cjs/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/index.js +16 -16
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/kernel/toEcdsaKernelSmartAccount.js +30 -30
- package/_cjs/accounts/kernel/toEcdsaKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/encodeCallData.js +7 -7
- package/_cjs/accounts/kernel/utils/encodeCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/getNonceKey.js +5 -5
- package/_cjs/accounts/kernel/utils/getNonceKey.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signMessage.js +4 -4
- package/_cjs/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_cjs/accounts/kernel/utils/signTypedData.js +4 -4
- package/_cjs/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_cjs/accounts/light/toLightSmartAccount.js +6 -6
- package/_cjs/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_cjs/accounts/nexus/toNexusSmartAccount.js +6 -6
- package/_cjs/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_cjs/accounts/safe/toSafeSmartAccount.js +9 -8
- package/_cjs/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/simple/toSimpleSmartAccount.js +6 -6
- package/_cjs/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/thirdweb/toThirdwebSmartAccount.js +14 -14
- package/_cjs/accounts/thirdweb/toThirdwebSmartAccount.js.map +1 -1
- package/_cjs/accounts/trust/toTrustSmartAccount.js +10 -10
- package/_cjs/accounts/trust/toTrustSmartAccount.js.map +1 -1
- package/_cjs/actions/erc7579/accountId.js +2 -2
- package/_cjs/actions/erc7579/accountId.js.map +1 -1
- package/_cjs/actions/erc7579/installModule.js +4 -4
- package/_cjs/actions/erc7579/installModule.js.map +1 -1
- package/_cjs/actions/erc7579/installModules.js +4 -4
- package/_cjs/actions/erc7579/installModules.js.map +1 -1
- package/_cjs/actions/erc7579/isModuleInstalled.js +5 -5
- package/_cjs/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_cjs/actions/erc7579/supportsExecutionMode.js +2 -2
- package/_cjs/actions/erc7579/supportsExecutionMode.js.map +1 -1
- package/_cjs/actions/erc7579/supportsModule.js +2 -2
- package/_cjs/actions/erc7579/supportsModule.js.map +1 -1
- package/_cjs/actions/erc7579/uninstallModule.js +4 -4
- package/_cjs/actions/erc7579/uninstallModule.js.map +1 -1
- package/_cjs/actions/erc7579/uninstallModules.js +4 -4
- package/_cjs/actions/erc7579/uninstallModules.js.map +1 -1
- package/_cjs/actions/erc7579.js +24 -24
- package/_cjs/actions/erc7579.js.map +1 -1
- package/_cjs/actions/index.js +5 -5
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/pimlico/sponsorUserOperation.js +3 -3
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js +2 -2
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_cjs/actions/pimlico.js +14 -14
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/actions/public/getSenderAddress.js +30 -137
- package/_cjs/actions/public/getSenderAddress.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransaction.js +2 -2
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_cjs/actions/smartAccount/signMessage.js +2 -2
- package/_cjs/actions/smartAccount/signMessage.js.map +1 -1
- package/_cjs/actions/smartAccount/signTypedData.js +2 -2
- package/_cjs/actions/smartAccount/signTypedData.js.map +1 -1
- package/_cjs/actions/smartAccount/writeContract.js +2 -2
- package/_cjs/actions/smartAccount/writeContract.js.map +1 -1
- package/_cjs/actions/smartAccount.js +8 -8
- package/_cjs/actions/smartAccount.js.map +1 -1
- package/_cjs/clients/createSmartAccountClient.js +3 -3
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js +10 -10
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/decorators/smartAccount.js +11 -11
- package/_cjs/clients/decorators/smartAccount.js.map +1 -1
- package/_cjs/clients/index.js.map +1 -1
- package/_cjs/clients/pimlico.js +2 -2
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/experimental/pimlico/index.js +2 -2
- package/_cjs/experimental/pimlico/index.js.map +1 -1
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +6 -5
- package/_cjs/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/encode7579Calls.js +3 -3
- package/_cjs/utils/encode7579Calls.js.map +1 -1
- package/_cjs/utils/encodeInstallModule.js +4 -4
- package/_cjs/utils/encodeInstallModule.js.map +1 -1
- package/_cjs/utils/encodeUninstallModule.js +4 -4
- package/_cjs/utils/encodeUninstallModule.js.map +1 -1
- package/_cjs/utils/index.js +25 -25
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/toOwner.js.map +1 -1
- package/_esm/accounts/biconomy/toBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/kernel/toEcdsaKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/encodeCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/getNonceKey.js.map +1 -1
- package/_esm/accounts/kernel/utils/signMessage.js.map +1 -1
- package/_esm/accounts/kernel/utils/signTypedData.js.map +1 -1
- package/_esm/accounts/light/toLightSmartAccount.js.map +1 -1
- package/_esm/accounts/nexus/toNexusSmartAccount.js +1 -1
- package/_esm/accounts/nexus/toNexusSmartAccount.js.map +1 -1
- package/_esm/accounts/safe/toSafeSmartAccount.js +2 -1
- package/_esm/accounts/safe/toSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/simple/toSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/thirdweb/toThirdwebSmartAccount.js.map +1 -1
- package/_esm/accounts/trust/toTrustSmartAccount.js.map +1 -1
- package/_esm/actions/erc7579/accountId.js.map +1 -1
- package/_esm/actions/erc7579/installModule.js +1 -1
- package/_esm/actions/erc7579/installModule.js.map +1 -1
- package/_esm/actions/erc7579/installModules.js.map +1 -1
- package/_esm/actions/erc7579/isModuleInstalled.js.map +1 -1
- package/_esm/actions/erc7579/supportsExecutionMode.js.map +1 -1
- package/_esm/actions/erc7579/supportsModule.js.map +1 -1
- package/_esm/actions/erc7579/uninstallModule.js.map +1 -1
- package/_esm/actions/erc7579/uninstallModules.js.map +1 -1
- package/_esm/actions/erc7579.js.map +1 -1
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_esm/actions/pimlico.js.map +1 -1
- package/_esm/actions/public/getSenderAddress.js +33 -142
- package/_esm/actions/public/getSenderAddress.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_esm/actions/smartAccount/signMessage.js.map +1 -1
- package/_esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/_esm/actions/smartAccount/writeContract.js.map +1 -1
- package/_esm/actions/smartAccount.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js +2 -2
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/decorators/smartAccount.js +3 -3
- package/_esm/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/clients/index.js.map +1 -1
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/experimental/pimlico/index.js.map +1 -1
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js +2 -1
- package/_esm/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.js.map +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/utils/encode7579Calls.js.map +1 -1
- package/_esm/utils/encodeInstallModule.js.map +1 -1
- package/_esm/utils/encodeUninstallModule.js.map +1 -1
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/toOwner.js.map +1 -1
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts +3 -2
- package/_types/accounts/biconomy/toBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/index.d.ts +8 -8
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/kernel/toEcdsaKernelSmartAccount.d.ts +3 -2
- package/_types/accounts/kernel/toEcdsaKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/encodeCallData.d.ts +1 -1
- package/_types/accounts/kernel/utils/encodeCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/getNonceKey.d.ts +1 -1
- package/_types/accounts/kernel/utils/getNonceKey.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/isKernelV2.d.ts +1 -1
- package/_types/accounts/kernel/utils/isKernelV2.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/signMessage.d.ts +1 -1
- package/_types/accounts/kernel/utils/signMessage.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/signTypedData.d.ts +1 -1
- package/_types/accounts/kernel/utils/signTypedData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts +1 -1
- package/_types/accounts/kernel/utils/wrapMessageHash.d.ts.map +1 -1
- package/_types/accounts/light/toLightSmartAccount.d.ts +3 -2
- package/_types/accounts/light/toLightSmartAccount.d.ts.map +1 -1
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts +3 -2
- package/_types/accounts/nexus/toNexusSmartAccount.d.ts.map +1 -1
- package/_types/accounts/safe/toSafeSmartAccount.d.ts +3 -2
- package/_types/accounts/safe/toSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts +3 -2
- package/_types/accounts/simple/toSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/thirdweb/toThirdwebSmartAccount.d.ts +3 -2
- package/_types/accounts/thirdweb/toThirdwebSmartAccount.d.ts.map +1 -1
- package/_types/accounts/trust/toTrustSmartAccount.d.ts +3 -2
- package/_types/accounts/trust/toTrustSmartAccount.d.ts.map +1 -1
- package/_types/actions/erc7579/installModule.d.ts +1 -1
- package/_types/actions/erc7579/installModule.d.ts.map +1 -1
- package/_types/actions/erc7579/installModules.d.ts +1 -1
- package/_types/actions/erc7579/installModules.d.ts.map +1 -1
- package/_types/actions/erc7579/isModuleInstalled.d.ts +1 -1
- package/_types/actions/erc7579/isModuleInstalled.d.ts.map +1 -1
- package/_types/actions/erc7579/uninstallModule.d.ts +1 -1
- package/_types/actions/erc7579/uninstallModule.d.ts.map +1 -1
- package/_types/actions/erc7579/uninstallModules.d.ts +1 -1
- package/_types/actions/erc7579/uninstallModules.d.ts.map +1 -1
- package/_types/actions/erc7579.d.ts +10 -10
- package/_types/actions/erc7579.d.ts.map +1 -1
- package/_types/actions/index.d.ts +4 -4
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/pimlico/getTokenQuotes.d.ts +1 -1
- package/_types/actions/pimlico/getTokenQuotes.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -1
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts +1 -1
- package/_types/actions/pimlico/sendCompressedUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -1
- package/_types/actions/pimlico.d.ts +8 -8
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -1
- package/_types/actions/smartAccount.d.ts +4 -4
- package/_types/actions/smartAccount.d.ts.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +1 -1
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +4 -4
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/decorators/smartAccount.d.ts +5 -51
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
- package/_types/clients/index.d.ts +2 -2
- package/_types/clients/index.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +2 -2
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/experimental/pimlico/index.d.ts +1 -1
- package/_types/experimental/pimlico/index.d.ts.map +1 -1
- package/_types/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.d.ts.map +1 -1
- package/_types/index.d.ts +3 -3
- package/_types/index.d.ts.map +1 -1
- package/_types/utils/encode7579Calls.d.ts +1 -1
- package/_types/utils/encode7579Calls.d.ts.map +1 -1
- package/_types/utils/encodeInstallModule.d.ts +1 -1
- package/_types/utils/encodeInstallModule.d.ts.map +1 -1
- package/_types/utils/encodeUninstallModule.d.ts +1 -1
- package/_types/utils/encodeUninstallModule.d.ts.map +1 -1
- package/_types/utils/index.d.ts +12 -12
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/toOwner.d.ts +6 -3
- package/_types/utils/toOwner.d.ts.map +1 -1
- package/accounts/biconomy/toBiconomySmartAccount.ts +4 -5
- package/accounts/index.ts +8 -8
- package/accounts/kernel/toEcdsaKernelSmartAccount.ts +16 -14
- package/accounts/kernel/utils/encodeCallData.ts +4 -4
- package/accounts/kernel/utils/getNonceKey.ts +3 -3
- package/accounts/kernel/utils/isKernelV2.ts +1 -1
- package/accounts/kernel/utils/signMessage.ts +5 -2
- package/accounts/kernel/utils/signTypedData.ts +5 -2
- package/accounts/kernel/utils/wrapMessageHash.ts +1 -1
- package/accounts/light/toLightSmartAccount.ts +4 -5
- package/accounts/nexus/toNexusSmartAccount.ts +4 -5
- package/accounts/safe/toSafeSmartAccount.ts +5 -5
- package/accounts/simple/toSimpleSmartAccount.ts +4 -5
- package/accounts/thirdweb/toThirdwebSmartAccount.ts +8 -9
- package/accounts/trust/toTrustSmartAccount.ts +6 -7
- package/actions/erc7579/accountId.ts +1 -1
- package/actions/erc7579/installModule.ts +3 -3
- package/actions/erc7579/installModules.ts +2 -2
- package/actions/erc7579/isModuleInstalled.ts +2 -2
- package/actions/erc7579/supportsExecutionMode.ts +1 -1
- package/actions/erc7579/supportsModule.ts +1 -1
- package/actions/erc7579/uninstallModule.ts +3 -3
- package/actions/erc7579/uninstallModules.ts +2 -2
- package/actions/erc7579.ts +13 -10
- package/actions/index.ts +4 -4
- package/actions/pimlico/getTokenQuotes.ts +1 -1
- package/actions/pimlico/getUserOperationGasPrice.ts +1 -1
- package/actions/pimlico/getUserOperationStatus.ts +1 -1
- package/actions/pimlico/sendCompressedUserOperation.ts +1 -1
- package/actions/pimlico/sponsorUserOperation.ts +2 -2
- package/actions/pimlico/validateSponsorshipPolicies.ts +2 -2
- package/actions/pimlico.ts +8 -8
- package/actions/public/getSenderAddress.test.ts +1 -1
- package/actions/public/getSenderAddress.ts +42 -186
- package/actions/smartAccount/sendTransaction.ts +1 -1
- package/actions/smartAccount/signMessage.ts +1 -1
- package/actions/smartAccount/signTypedData.ts +1 -1
- package/actions/smartAccount/writeContract.ts +1 -1
- package/actions/smartAccount.ts +4 -4
- package/clients/createSmartAccountClient.ts +3 -3
- package/clients/decorators/pimlico.ts +4 -4
- package/clients/decorators/smartAccount.ts +12 -14
- package/clients/index.ts +2 -2
- package/clients/pimlico.ts +2 -2
- package/experimental/pimlico/index.ts +1 -1
- package/experimental/pimlico/utils/prepareUserOperationForErc20Paymaster.ts +3 -2
- package/index.ts +3 -3
- package/package.json +1 -1
- package/utils/encode7579Calls.ts +1 -1
- package/utils/encodeInstallModule.ts +2 -2
- package/utils/encodeUninstallModule.ts +2 -2
- package/utils/index.ts +15 -12
- package/utils/toOwner.ts +7 -12
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "viem"
|
|
14
14
|
import type { SmartAccount } from "viem/account-abstraction"
|
|
15
15
|
import { getAction } from "viem/utils"
|
|
16
|
-
import { sendTransaction } from "./sendTransaction"
|
|
16
|
+
import { sendTransaction } from "./sendTransaction.js"
|
|
17
17
|
|
|
18
18
|
export async function writeContract<
|
|
19
19
|
TChain extends Chain | undefined,
|
package/actions/smartAccount.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { sendTransaction } from "./smartAccount/sendTransaction"
|
|
1
|
+
import { sendTransaction } from "./smartAccount/sendTransaction.js"
|
|
2
2
|
|
|
3
|
-
import { signMessage } from "./smartAccount/signMessage"
|
|
3
|
+
import { signMessage } from "./smartAccount/signMessage.js"
|
|
4
4
|
|
|
5
|
-
import { signTypedData } from "./smartAccount/signTypedData"
|
|
5
|
+
import { signTypedData } from "./smartAccount/signTypedData.js"
|
|
6
6
|
|
|
7
|
-
import { writeContract } from "./smartAccount/writeContract"
|
|
7
|
+
import { writeContract } from "./smartAccount/writeContract.js"
|
|
8
8
|
|
|
9
9
|
export { sendTransaction, signMessage, signTypedData, writeContract }
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
type SmartAccountActions,
|
|
24
24
|
smartAccountActions
|
|
25
|
-
} from "./decorators/smartAccount"
|
|
25
|
+
} from "./decorators/smartAccount.js"
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* TODO:
|
|
@@ -172,10 +172,10 @@ export function createSmartAccountClient(
|
|
|
172
172
|
return customPrepareUserOp(client, args)
|
|
173
173
|
}
|
|
174
174
|
}))
|
|
175
|
-
.extend(smartAccountActions
|
|
175
|
+
.extend(smartAccountActions) as SmartAccountClient
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
return client
|
|
179
179
|
.extend(bundlerActions)
|
|
180
|
-
.extend(smartAccountActions
|
|
180
|
+
.extend(smartAccountActions) as SmartAccountClient
|
|
181
181
|
}
|
|
@@ -8,21 +8,21 @@ import {
|
|
|
8
8
|
getTokenQuotes,
|
|
9
9
|
sendCompressedUserOperation,
|
|
10
10
|
validateSponsorshipPolicies
|
|
11
|
-
} from "../../actions/pimlico"
|
|
11
|
+
} from "../../actions/pimlico.js"
|
|
12
12
|
import {
|
|
13
13
|
type GetUserOperationGasPriceReturnType,
|
|
14
14
|
getUserOperationGasPrice
|
|
15
|
-
} from "../../actions/pimlico/getUserOperationGasPrice"
|
|
15
|
+
} from "../../actions/pimlico/getUserOperationGasPrice.js"
|
|
16
16
|
import {
|
|
17
17
|
type GetUserOperationStatusParameters,
|
|
18
18
|
type GetUserOperationStatusReturnType,
|
|
19
19
|
getUserOperationStatus
|
|
20
|
-
} from "../../actions/pimlico/getUserOperationStatus"
|
|
20
|
+
} from "../../actions/pimlico/getUserOperationStatus.js"
|
|
21
21
|
import {
|
|
22
22
|
type PimlicoSponsorUserOperationParameters,
|
|
23
23
|
type SponsorUserOperationReturnType,
|
|
24
24
|
sponsorUserOperation
|
|
25
|
-
} from "../../actions/pimlico/sponsorUserOperation"
|
|
25
|
+
} from "../../actions/pimlico/sponsorUserOperation.js"
|
|
26
26
|
|
|
27
27
|
export type PimlicoActions<
|
|
28
28
|
TChain extends Chain | undefined,
|
|
@@ -11,10 +11,10 @@ import type {
|
|
|
11
11
|
WriteContractParameters
|
|
12
12
|
} from "viem"
|
|
13
13
|
import type { SmartAccount } from "viem/account-abstraction"
|
|
14
|
-
import { sendTransaction } from "../../actions/smartAccount/sendTransaction"
|
|
15
|
-
import { signMessage } from "../../actions/smartAccount/signMessage"
|
|
16
|
-
import { signTypedData } from "../../actions/smartAccount/signTypedData"
|
|
17
|
-
import { writeContract } from "../../actions/smartAccount/writeContract"
|
|
14
|
+
import { sendTransaction } from "../../actions/smartAccount/sendTransaction.js"
|
|
15
|
+
import { signMessage } from "../../actions/smartAccount/signMessage.js"
|
|
16
|
+
import { signTypedData } from "../../actions/smartAccount/signTypedData.js"
|
|
17
|
+
import { writeContract } from "../../actions/smartAccount/writeContract.js"
|
|
18
18
|
|
|
19
19
|
export type SmartAccountActions<
|
|
20
20
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -311,18 +311,16 @@ export type SmartAccountActions<
|
|
|
311
311
|
>
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
export function smartAccountActions
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
client: Client<Transport, TChain, TSmartAccount>
|
|
322
|
-
): SmartAccountActions<TChain, TSmartAccount> => ({
|
|
314
|
+
export function smartAccountActions<
|
|
315
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
316
|
+
TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined
|
|
317
|
+
>(
|
|
318
|
+
client: Client<Transport, TChain, TSmartAccount>
|
|
319
|
+
): SmartAccountActions<TChain, TSmartAccount> {
|
|
320
|
+
return {
|
|
323
321
|
sendTransaction: (args) => sendTransaction(client, args as any),
|
|
324
322
|
signMessage: (args) => signMessage(client, args),
|
|
325
323
|
signTypedData: (args) => signTypedData(client, args),
|
|
326
324
|
writeContract: (args) => writeContract(client, args)
|
|
327
|
-
}
|
|
325
|
+
}
|
|
328
326
|
}
|
package/clients/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./createSmartAccountClient"
|
|
2
|
-
export * from "./decorators/smartAccount"
|
|
1
|
+
export * from "./createSmartAccountClient.js"
|
|
2
|
+
export * from "./decorators/smartAccount.js"
|
package/clients/pimlico.ts
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
entryPoint07Address,
|
|
18
18
|
paymasterActions
|
|
19
19
|
} from "viem/account-abstraction"
|
|
20
|
-
import type { PimlicoRpcSchema } from "../types/pimlico"
|
|
21
|
-
import { type PimlicoActions, pimlicoActions } from "./decorators/pimlico"
|
|
20
|
+
import type { PimlicoRpcSchema } from "../types/pimlico.js"
|
|
21
|
+
import { type PimlicoActions, pimlicoActions } from "./decorators/pimlico.js"
|
|
22
22
|
|
|
23
23
|
export type PimlicoClient<
|
|
24
24
|
entryPointVersion extends "0.6" | "0.7" = "0.7" | "0.6",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { prepareUserOperationForErc20Paymaster } from "./utils/prepareUserOperationForErc20Paymaster"
|
|
1
|
+
import { prepareUserOperationForErc20Paymaster } from "./utils/prepareUserOperationForErc20Paymaster.js"
|
|
2
2
|
export { prepareUserOperationForErc20Paymaster }
|
|
@@ -24,8 +24,9 @@ import {
|
|
|
24
24
|
import { getChainId as getChainId_ } from "viem/actions"
|
|
25
25
|
import { readContract } from "viem/actions"
|
|
26
26
|
import { getAction, parseAccount } from "viem/utils"
|
|
27
|
-
import { getTokenQuotes } from "../../../actions/pimlico"
|
|
28
|
-
import { erc20AllowanceOverride
|
|
27
|
+
import { getTokenQuotes } from "../../../actions/pimlico.js"
|
|
28
|
+
import { erc20AllowanceOverride } from "../../../utils/erc20AllowanceOverride.js"
|
|
29
|
+
import { erc20BalanceOverride } from "../../../utils/erc20BalanceOverride.js"
|
|
29
30
|
|
|
30
31
|
export const prepareUserOperationForErc20Paymaster =
|
|
31
32
|
(
|
package/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./utils/"
|
|
2
|
-
export * from "./errors/"
|
|
3
|
-
export * from "./clients/"
|
|
1
|
+
export * from "./utils/index.js"
|
|
2
|
+
export * from "./errors/index.js"
|
|
3
|
+
export * from "./clients/index.js"
|
package/package.json
CHANGED
package/utils/encode7579Calls.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type CallType,
|
|
11
11
|
type ExecutionMode,
|
|
12
12
|
encodeExecutionMode
|
|
13
|
-
} from "../actions/erc7579/supportsExecutionMode"
|
|
13
|
+
} from "../actions/erc7579/supportsExecutionMode.js"
|
|
14
14
|
|
|
15
15
|
export type EncodeCallDataParams<callType extends CallType> = {
|
|
16
16
|
mode: ExecutionMode<callType>
|
|
@@ -12,8 +12,8 @@ import type {
|
|
|
12
12
|
import {
|
|
13
13
|
type ModuleType,
|
|
14
14
|
parseModuleTypeId
|
|
15
|
-
} from "../actions/erc7579/supportsModule"
|
|
16
|
-
import { AccountNotFoundError } from "../errors"
|
|
15
|
+
} from "../actions/erc7579/supportsModule.js"
|
|
16
|
+
import { AccountNotFoundError } from "../errors/index.js"
|
|
17
17
|
|
|
18
18
|
export type EncodeInstallModuleParameter = {
|
|
19
19
|
type: ModuleType
|
|
@@ -12,8 +12,8 @@ import type {
|
|
|
12
12
|
import {
|
|
13
13
|
type ModuleType,
|
|
14
14
|
parseModuleTypeId
|
|
15
|
-
} from "../actions/erc7579/supportsModule"
|
|
16
|
-
import { AccountNotFoundError } from "../errors"
|
|
15
|
+
} from "../actions/erc7579/supportsModule.js"
|
|
16
|
+
import { AccountNotFoundError } from "../errors/index.js"
|
|
17
17
|
|
|
18
18
|
export type EncodeUninstallModuleParameter = {
|
|
19
19
|
type: ModuleType
|
package/utils/index.ts
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { deepHexlify, transactionReceiptStatus } from "./deepHexlify"
|
|
2
|
-
import { getAddressFromInitCodeOrPaymasterAndData } from "./getAddressFromInitCodeOrPaymasterAndData"
|
|
1
|
+
import { deepHexlify, transactionReceiptStatus } from "./deepHexlify.js"
|
|
2
|
+
import { getAddressFromInitCodeOrPaymasterAndData } from "./getAddressFromInitCodeOrPaymasterAndData.js"
|
|
3
3
|
import {
|
|
4
4
|
type GetRequiredPrefundReturnType,
|
|
5
5
|
getRequiredPrefund
|
|
6
|
-
} from "./getRequiredPrefund"
|
|
7
|
-
import { isSmartAccountDeployed } from "./isSmartAccountDeployed"
|
|
8
|
-
import { toOwner } from "./toOwner"
|
|
6
|
+
} from "./getRequiredPrefund.js"
|
|
7
|
+
import { isSmartAccountDeployed } from "./isSmartAccountDeployed.js"
|
|
8
|
+
import { toOwner } from "./toOwner.js"
|
|
9
9
|
|
|
10
|
-
import { decodeNonce } from "./decodeNonce"
|
|
11
|
-
import { encodeNonce } from "./encodeNonce"
|
|
10
|
+
import { decodeNonce } from "./decodeNonce.js"
|
|
11
|
+
import { encodeNonce } from "./encodeNonce.js"
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
type EncodeInstallModuleParameters,
|
|
15
15
|
encodeInstallModule
|
|
16
|
-
} from "./encodeInstallModule"
|
|
17
|
-
import { getPackedUserOperation } from "./getPackedUserOperation"
|
|
16
|
+
} from "./encodeInstallModule.js"
|
|
17
|
+
import { getPackedUserOperation } from "./getPackedUserOperation.js"
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
type EncodeCallDataParams,
|
|
21
|
+
encode7579Calls
|
|
22
|
+
} from "./encode7579Calls.js"
|
|
20
23
|
import {
|
|
21
24
|
type Erc20AllowanceOverrideParameters,
|
|
22
25
|
erc20AllowanceOverride
|
|
23
|
-
} from "./erc20AllowanceOverride"
|
|
26
|
+
} from "./erc20AllowanceOverride.js"
|
|
24
27
|
import {
|
|
25
28
|
type Erc20BalanceOverrideParameters,
|
|
26
29
|
erc20BalanceOverride
|
|
27
|
-
} from "./erc20BalanceOverride"
|
|
30
|
+
} from "./erc20BalanceOverride.js"
|
|
28
31
|
|
|
29
32
|
export {
|
|
30
33
|
transactionReceiptStatus,
|
package/utils/toOwner.ts
CHANGED
|
@@ -2,9 +2,6 @@ import {
|
|
|
2
2
|
type Account,
|
|
3
3
|
type Address,
|
|
4
4
|
type Chain,
|
|
5
|
-
type EIP1193Provider,
|
|
6
|
-
type EIP1193RequestFn,
|
|
7
|
-
type EIP1474Methods,
|
|
8
5
|
type LocalAccount,
|
|
9
6
|
type OneOf,
|
|
10
7
|
type Transport,
|
|
@@ -17,12 +14,14 @@ import { toAccount } from "viem/accounts"
|
|
|
17
14
|
import { signTypedData } from "viem/actions"
|
|
18
15
|
import { getAction } from "viem/utils"
|
|
19
16
|
|
|
20
|
-
export
|
|
17
|
+
export type EthereumProvider = { request(...args: any): Promise<any> }
|
|
18
|
+
|
|
19
|
+
export async function toOwner<provider extends EthereumProvider>({
|
|
21
20
|
owner,
|
|
22
21
|
address
|
|
23
22
|
}: {
|
|
24
23
|
owner: OneOf<
|
|
25
|
-
|
|
|
24
|
+
| provider
|
|
26
25
|
| WalletClient<Transport, Chain | undefined, Account>
|
|
27
26
|
| LocalAccount
|
|
28
27
|
>
|
|
@@ -39,15 +38,11 @@ export async function toOwner({
|
|
|
39
38
|
if ("request" in owner) {
|
|
40
39
|
if (!address) {
|
|
41
40
|
try {
|
|
42
|
-
;[address] = await (
|
|
43
|
-
owner.request as EIP1193RequestFn<EIP1474Methods>
|
|
44
|
-
)({
|
|
41
|
+
;[address] = await (owner as EthereumProvider).request({
|
|
45
42
|
method: "eth_requestAccounts"
|
|
46
43
|
})
|
|
47
44
|
} catch {
|
|
48
|
-
;[address] = await (
|
|
49
|
-
owner.request as EIP1193RequestFn<EIP1474Methods>
|
|
50
|
-
)({
|
|
45
|
+
;[address] = await (owner as EthereumProvider).request({
|
|
51
46
|
method: "eth_accounts"
|
|
52
47
|
})
|
|
53
48
|
}
|
|
@@ -58,7 +53,7 @@ export async function toOwner({
|
|
|
58
53
|
}
|
|
59
54
|
walletClient = createWalletClient({
|
|
60
55
|
account: address,
|
|
61
|
-
transport: custom(owner as
|
|
56
|
+
transport: custom(owner as EthereumProvider)
|
|
62
57
|
})
|
|
63
58
|
}
|
|
64
59
|
|