@account-kit/smart-contracts 4.0.0-alpha.0 → 4.0.0-alpha.10
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/dist/cjs/plugindefs/multi-owner/config.js +16 -17
- package/dist/cjs/plugindefs/multi-owner/config.js.map +1 -1
- package/dist/cjs/plugindefs/multisig/config.js +15 -15
- package/dist/cjs/plugindefs/multisig/config.js.map +1 -1
- package/dist/cjs/plugindefs/session-key/config.js +17 -17
- package/dist/cjs/plugindefs/session-key/config.js.map +1 -1
- package/dist/cjs/src/index.d.ts +4 -4
- package/dist/cjs/src/index.js +17 -17
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/account.d.ts +5 -6
- package/dist/cjs/src/light-account/accounts/account.js +4 -3
- package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/base.d.ts +7 -6
- package/dist/cjs/src/light-account/accounts/base.js +8 -8
- package/dist/cjs/src/light-account/accounts/base.js.map +1 -1
- package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/cjs/src/light-account/accounts/multiOwner.js +5 -6
- package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/cjs/src/light-account/actions/transferOwnership.d.ts +1 -1
- package/dist/cjs/src/light-account/actions/transferOwnership.js +2 -1
- package/dist/cjs/src/light-account/actions/transferOwnership.js.map +1 -1
- package/dist/cjs/src/light-account/actions/updateOwners.js.map +1 -1
- package/dist/cjs/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/clients/client.js +2 -1
- package/dist/cjs/src/light-account/clients/client.js.map +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js +2 -1
- package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
- package/dist/cjs/src/light-account/types.d.ts +23 -31
- package/dist/cjs/src/light-account/types.js.map +1 -1
- package/dist/cjs/src/light-account/utils.d.ts +7 -9
- package/dist/cjs/src/light-account/utils.js +63 -82
- package/dist/cjs/src/light-account/utils.js.map +1 -1
- package/dist/cjs/src/msca/account/multiOwnerAccount.js +2 -1
- package/dist/cjs/src/msca/account/multiOwnerAccount.js.map +1 -1
- package/dist/cjs/src/msca/account/multisigAccount.js +4 -3
- package/dist/cjs/src/msca/account/multisigAccount.js.map +1 -1
- package/dist/cjs/src/msca/account-loupe/decorator.js.map +1 -1
- package/dist/cjs/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/client/client.js.map +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.js +1 -1
- package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/cjs/src/msca/errors.js.map +1 -1
- package/dist/cjs/src/msca/plugin-manager/decorator.d.ts +1 -1
- package/dist/cjs/src/msca/plugin-manager/decorator.js +6 -4
- package/dist/cjs/src/msca/plugin-manager/decorator.js.map +1 -1
- package/dist/cjs/src/msca/plugin-manager/installPlugin.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multi-owner/extension.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multi-owner/index.d.ts +1 -1
- package/dist/cjs/src/msca/plugins/multi-owner/index.js +2 -1
- package/dist/cjs/src/msca/plugins/multi-owner/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js +2 -2
- package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +1 -1
- package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/extension.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/index.d.ts +1 -8
- package/dist/cjs/src/msca/plugins/multisig/index.js +1 -16
- package/dist/cjs/src/msca/plugins/multisig/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.d.ts +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.js +1 -1
- package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/index.d.ts +4 -0
- package/dist/cjs/src/msca/plugins/multisig/utils/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
- package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/extension.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/index.d.ts +1 -1
- package/dist/cjs/src/msca/plugins/session-key/index.js +3 -1
- package/dist/cjs/src/msca/plugins/session-key/index.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/cjs/src/msca/plugins/session-key/utils.d.ts +4 -2
- package/dist/cjs/src/msca/plugins/session-key/utils.js +3 -2
- package/dist/cjs/src/msca/plugins/session-key/utils.js.map +1 -1
- package/dist/cjs/src/msca/utils.d.ts +6 -4
- package/dist/cjs/src/msca/utils.js +11 -10
- package/dist/cjs/src/msca/utils.js.map +1 -1
- package/dist/esm/plugindefs/multi-owner/config.js +1 -2
- package/dist/esm/plugindefs/multi-owner/config.js.map +1 -1
- package/dist/esm/plugindefs/multisig/config.js +1 -1
- package/dist/esm/plugindefs/multisig/config.js.map +1 -1
- package/dist/esm/plugindefs/session-key/config.js +1 -1
- package/dist/esm/plugindefs/session-key/config.js.map +1 -1
- package/dist/esm/src/index.d.ts +4 -4
- package/dist/esm/src/index.js +3 -3
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
- package/dist/esm/src/light-account/accounts/account.js +5 -4
- package/dist/esm/src/light-account/accounts/account.js.map +1 -1
- package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
- package/dist/esm/src/light-account/accounts/base.js +8 -8
- package/dist/esm/src/light-account/accounts/base.js.map +1 -1
- package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/esm/src/light-account/accounts/multiOwner.js +6 -7
- package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
- package/dist/esm/src/light-account/actions/transferOwnership.d.ts +1 -1
- package/dist/esm/src/light-account/actions/transferOwnership.js +2 -1
- package/dist/esm/src/light-account/actions/transferOwnership.js.map +1 -1
- package/dist/esm/src/light-account/actions/updateOwners.js.map +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/client.js +2 -1
- package/dist/esm/src/light-account/clients/client.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
- package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +2 -1
- package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
- package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
- package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
- package/dist/esm/src/light-account/types.d.ts +23 -31
- package/dist/esm/src/light-account/types.js.map +1 -1
- package/dist/esm/src/light-account/utils.d.ts +7 -9
- package/dist/esm/src/light-account/utils.js +60 -79
- package/dist/esm/src/light-account/utils.js.map +1 -1
- package/dist/esm/src/msca/account/multiOwnerAccount.js +2 -1
- package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
- package/dist/esm/src/msca/account/multisigAccount.js +4 -3
- package/dist/esm/src/msca/account/multisigAccount.js.map +1 -1
- package/dist/esm/src/msca/account-loupe/decorator.js.map +1 -1
- package/dist/esm/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
- package/dist/esm/src/msca/client/client.js.map +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js +1 -1
- package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
- package/dist/esm/src/msca/errors.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/decorator.d.ts +1 -1
- package/dist/esm/src/msca/plugin-manager/decorator.js +6 -4
- package/dist/esm/src/msca/plugin-manager/decorator.js.map +1 -1
- package/dist/esm/src/msca/plugin-manager/installPlugin.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/index.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/index.js +1 -1
- package/dist/esm/src/msca/plugins/multi-owner/index.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +1 -1
- package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/index.d.ts +1 -8
- package/dist/esm/src/msca/plugins/multisig/index.js +0 -7
- package/dist/esm/src/msca/plugins/multisig/index.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.d.ts +1 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js +2 -1
- package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
- package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
- package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
- package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/index.d.ts +4 -0
- package/dist/esm/src/msca/plugins/multisig/utils/index.js.map +1 -1
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
- package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/extension.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/index.d.ts +1 -1
- package/dist/esm/src/msca/plugins/session-key/index.js +1 -1
- package/dist/esm/src/msca/plugins/session-key/index.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
- package/dist/esm/src/msca/plugins/session-key/utils.d.ts +4 -2
- package/dist/esm/src/msca/plugins/session-key/utils.js +3 -2
- package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
- package/dist/esm/src/msca/utils.d.ts +6 -4
- package/dist/esm/src/msca/utils.js +2 -1
- package/dist/esm/src/msca/utils.js.map +1 -1
- package/dist/types/plugindefs/multi-owner/config.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/account.d.ts +5 -6
- package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/base.d.ts +7 -6
- package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
- package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
- package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
- package/dist/types/src/light-account/actions/transferOwnership.d.ts +26 -1
- package/dist/types/src/light-account/actions/transferOwnership.d.ts.map +1 -1
- package/dist/types/src/light-account/actions/updateOwners.d.ts +24 -0
- package/dist/types/src/light-account/actions/updateOwners.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts +1 -1
- package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
- package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/light-account/decorators/lightAccount.d.ts +19 -0
- package/dist/types/src/light-account/decorators/lightAccount.d.ts.map +1 -1
- package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +19 -0
- package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts.map +1 -1
- package/dist/types/src/light-account/types.d.ts +23 -118
- package/dist/types/src/light-account/types.d.ts.map +1 -1
- package/dist/types/src/light-account/utils.d.ts +22 -44
- package/dist/types/src/light-account/utils.d.ts.map +1 -1
- package/dist/types/src/msca/account/multisigAccount.d.ts.map +1 -1
- package/dist/types/src/msca/account-loupe/decorator.d.ts +15 -0
- package/dist/types/src/msca/account-loupe/decorator.d.ts.map +1 -1
- package/dist/types/src/msca/client/alchemyClient.d.ts +1 -1
- package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/client/client.d.ts.map +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
- package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
- package/dist/types/src/msca/errors.d.ts +12 -0
- package/dist/types/src/msca/errors.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/decorator.d.ts +16 -1
- package/dist/types/src/msca/plugin-manager/decorator.d.ts.map +1 -1
- package/dist/types/src/msca/plugin-manager/installPlugin.d.ts +21 -0
- package/dist/types/src/msca/plugin-manager/installPlugin.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/extension.d.ts +15 -0
- package/dist/types/src/msca/plugins/multi-owner/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multi-owner/index.d.ts +1 -1
- package/dist/types/src/msca/plugins/multi-owner/index.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/actions/proposeUserOperation.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/actions/signMultisigUserOperation.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/extension.d.ts +13 -0
- package/dist/types/src/msca/plugins/multisig/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/index.d.ts +1 -8
- package/dist/types/src/msca/plugins/multisig/index.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/middleware.d.ts +7 -7
- package/dist/types/src/msca/plugins/multisig/middleware.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts +28 -2
- package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts +21 -2
- package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/index.d.ts +4 -0
- package/dist/types/src/msca/plugins/multisig/utils/index.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
- package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/extension.d.ts +13 -0
- package/dist/types/src/msca/plugins/session-key/extension.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/index.d.ts +1 -1
- package/dist/types/src/msca/plugins/session-key/index.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts +150 -1
- package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/signer.d.ts +72 -2
- package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
- package/dist/types/src/msca/plugins/session-key/utils.d.ts +22 -2
- package/dist/types/src/msca/plugins/session-key/utils.d.ts.map +1 -1
- package/dist/types/src/msca/utils.d.ts +48 -10
- package/dist/types/src/msca/utils.d.ts.map +1 -1
- package/package.json +7 -6
- package/plugindefs/multi-owner/config.ts +1 -2
- package/plugindefs/multisig/config.ts +1 -1
- package/plugindefs/session-key/config.ts +1 -1
- package/src/index.ts +3 -4
- package/src/light-account/accounts/account.ts +46 -48
- package/src/light-account/accounts/base.ts +39 -68
- package/src/light-account/accounts/multiOwner.ts +55 -48
- package/src/light-account/actions/transferOwnership.ts +28 -5
- package/src/light-account/actions/updateOwners.ts +24 -0
- package/src/light-account/clients/alchemyClient.ts +21 -1
- package/src/light-account/clients/client.ts +27 -6
- package/src/light-account/clients/multiOwnerAlchemyClient.ts +22 -2
- package/src/light-account/clients/multiOwnerLightAccount.ts +27 -6
- package/src/light-account/decorators/lightAccount.ts +19 -0
- package/src/light-account/decorators/multiOwnerLightAccount.ts +19 -0
- package/src/light-account/types.ts +31 -188
- package/src/light-account/utils.ts +99 -231
- package/src/msca/account/multiOwnerAccount.ts +36 -11
- package/src/msca/account/multisigAccount.ts +40 -14
- package/src/msca/account-loupe/decorator.ts +15 -0
- package/src/msca/client/alchemyClient.ts +21 -1
- package/src/msca/client/client.ts +46 -0
- package/src/msca/client/multiSigAlchemyClient.ts +26 -4
- package/src/msca/errors.ts +12 -0
- package/src/msca/plugin-manager/decorator.ts +22 -5
- package/src/msca/plugin-manager/installPlugin.ts +21 -0
- package/src/msca/plugins/multi-owner/extension.ts +15 -0
- package/src/msca/plugins/multi-owner/index.ts +3 -0
- package/src/msca/plugins/multisig/actions/proposeUserOperation.ts +1 -1
- package/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts +1 -1
- package/src/msca/plugins/multisig/extension.ts +13 -0
- package/src/msca/plugins/multisig/index.ts +1 -12
- package/src/msca/plugins/multisig/middleware.ts +8 -8
- package/src/msca/plugins/multisig/utils/combineSignatures.ts +36 -9
- package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
- package/src/msca/plugins/multisig/utils/getSignerType.ts +23 -4
- package/src/msca/plugins/multisig/utils/index.ts +4 -0
- package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
- package/src/msca/plugins/session-key/extension.ts +13 -0
- package/src/msca/plugins/session-key/index.ts +7 -1
- package/src/msca/plugins/session-key/permissions.ts +150 -1
- package/src/msca/plugins/session-key/signer.ts +72 -3
- package/src/msca/plugins/session-key/utils.ts +33 -12
- package/src/msca/utils.ts +78 -21
- package/dist/cjs/src/light-account/schema.d.ts +0 -21
- package/dist/cjs/src/light-account/schema.js +0 -30
- package/dist/cjs/src/light-account/schema.js.map +0 -1
- package/dist/esm/src/light-account/schema.d.ts +0 -21
- package/dist/esm/src/light-account/schema.js +0 -27
- package/dist/esm/src/light-account/schema.js.map +0 -1
- package/dist/types/src/light-account/schema.d.ts +0 -22
- package/dist/types/src/light-account/schema.d.ts.map +0 -1
- package/src/light-account/schema.ts +0 -39
|
@@ -62,17 +62,42 @@ export async function createMultiOwnerModularAccount<
|
|
|
62
62
|
config: CreateMultiOwnerModularAccountParams<TTransport, TSigner>
|
|
63
63
|
): Promise<MultiOwnerModularAccount<TSigner>>;
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Creates a multi-owner modular account with the given parameters, including transport, chain, signer, account address, initialization code, entry point, factory address, owners, and salt.
|
|
67
|
+
* Ensures that the owners are unique, ordered, and non-zero.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* import { createMultiOwnerModularAccount } from "@account-kit/smart-contracts";
|
|
72
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
73
|
+
* import { sepolia } from "viem/chains";
|
|
74
|
+
* import { http, generatePrivateKey } from "viem"
|
|
75
|
+
*
|
|
76
|
+
* const account = await createMultiOwnerModularAccount({
|
|
77
|
+
* chain: sepolia,
|
|
78
|
+
* transport: http("RPC_URL"),
|
|
79
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @param {CreateMultiOwnerModularAccountParams} config Configuration parameters for creating a multi-owner modular account
|
|
84
|
+
* @returns {Promise<MultiOwnerModularAccount>} A promise that resolves to a `MultiOwnerModularAccount` object containing the created account information and methods
|
|
85
|
+
*/
|
|
86
|
+
export async function createMultiOwnerModularAccount(
|
|
87
|
+
config: CreateMultiOwnerModularAccountParams
|
|
88
|
+
): Promise<MultiOwnerModularAccount> {
|
|
89
|
+
const {
|
|
90
|
+
transport,
|
|
91
|
+
chain,
|
|
92
|
+
signer,
|
|
93
|
+
accountAddress,
|
|
94
|
+
initCode,
|
|
95
|
+
entryPoint = getEntryPoint(chain, { version: "0.6.0" }),
|
|
96
|
+
factoryAddress = getDefaultMultiOwnerModularAccountFactoryAddress(chain),
|
|
97
|
+
owners = [],
|
|
98
|
+
salt = 0n,
|
|
99
|
+
} = config;
|
|
100
|
+
|
|
76
101
|
const client = createBundlerClient({
|
|
77
102
|
transport,
|
|
78
103
|
chain,
|
|
@@ -64,18 +64,44 @@ export async function createMultisigModularAccount<
|
|
|
64
64
|
config: CreateMultisigModularAccountParams<TTransport, TSigner>
|
|
65
65
|
): Promise<MultisigModularAccount<TSigner>>;
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Creates a multisig modular account using the provided parameters, including transport, chain, signer, account address, and other account settings. It configures the account with multiple owners and the specified threshold.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* import { createMultisigModularAccount } from "@account-kit/smart-contracts";
|
|
73
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
74
|
+
* import { sepolia } from "viem/chains";
|
|
75
|
+
* import { http, generatePrivateKey } from "viem"
|
|
76
|
+
*
|
|
77
|
+
* const account = await createMultisigModularAccount({
|
|
78
|
+
* chain: sepolia,
|
|
79
|
+
* transport: http("RPC_URL"),
|
|
80
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
|
|
81
|
+
* owners: [...], // other owners on the account
|
|
82
|
+
* threshold: 2, // 2 of N signatures
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @param {CreateMultisigModularAccountParams} config The parameters for creating a multisig modular account.
|
|
87
|
+
* @returns {Promise<MultisigModularAccount>} A promise that resolves to a `MultisigModularAccount` object containing the created account information and methods.
|
|
88
|
+
*/
|
|
89
|
+
export async function createMultisigModularAccount(
|
|
90
|
+
config: CreateMultisigModularAccountParams
|
|
91
|
+
): Promise<MultisigModularAccount> {
|
|
92
|
+
const {
|
|
93
|
+
transport,
|
|
94
|
+
chain,
|
|
95
|
+
signer,
|
|
96
|
+
accountAddress: accountAddress_,
|
|
97
|
+
initCode,
|
|
98
|
+
entryPoint = getEntryPoint(chain, { version: "0.6.0" }),
|
|
99
|
+
factoryAddress = getDefaultMultisigModularAccountFactoryAddress(chain),
|
|
100
|
+
owners = [],
|
|
101
|
+
salt = 0n,
|
|
102
|
+
threshold,
|
|
103
|
+
} = config;
|
|
104
|
+
|
|
79
105
|
const client = createBundlerClient({
|
|
80
106
|
transport,
|
|
81
107
|
chain,
|
|
@@ -108,10 +134,10 @@ export async function createMultisigModularAccount({
|
|
|
108
134
|
]);
|
|
109
135
|
};
|
|
110
136
|
|
|
111
|
-
accountAddress = await getAccountAddress({
|
|
137
|
+
const accountAddress = await getAccountAddress({
|
|
112
138
|
client,
|
|
113
139
|
entryPoint,
|
|
114
|
-
accountAddress:
|
|
140
|
+
accountAddress: accountAddress_,
|
|
115
141
|
getAccountInitCode,
|
|
116
142
|
});
|
|
117
143
|
|
|
@@ -51,6 +51,21 @@ export type AccountLoupeActions<
|
|
|
51
51
|
): Promise<ReadonlyArray<Address>>;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Provides a set of actions for account loupe operations using the specified client.
|
|
56
|
+
* NOTE: this is already added to the client when using any of the Modular Account Clients.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { accountLoupeActions } from "@account-kit/smart-contracts";
|
|
61
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
62
|
+
*
|
|
63
|
+
* const client = createSmartAccountClient(...).extend(accountLoupeActions);
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @param {Client<TTransport, TChain, TAccount>} client the client to be used for executing the account loupe actions
|
|
67
|
+
* @returns {AccountLoupeActions<TAccount>} an object containing account loupe actions like `getExecutionFunctionConfig`, `getExecutionHooks`, `getPreValidationHooks`, and `getInstalledPlugins`
|
|
68
|
+
*/
|
|
54
69
|
export const accountLoupeActions: <
|
|
55
70
|
TTransport extends Transport = Transport,
|
|
56
71
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
1
2
|
import {
|
|
2
3
|
AlchemyProviderConfigSchema,
|
|
3
4
|
createAlchemyPublicRpcClient,
|
|
@@ -17,7 +18,6 @@ import {
|
|
|
17
18
|
type MultiOwnerPluginActions,
|
|
18
19
|
type PluginManagerActions,
|
|
19
20
|
} from "@account-kit/smart-contracts";
|
|
20
|
-
import type { SmartAccountSigner } from "@aa-sdk/core";
|
|
21
21
|
import {
|
|
22
22
|
custom,
|
|
23
23
|
type Chain,
|
|
@@ -52,6 +52,26 @@ export function createModularAccountAlchemyClient<
|
|
|
52
52
|
>
|
|
53
53
|
>;
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Creates a modular account Alchemy client with the provided configuration.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { createModularAccountAlchemyClient } from "@account-kit/smart-contracts";
|
|
61
|
+
* import { sepolia } from "@account-kit/infra";
|
|
62
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
63
|
+
* import { generatePrivateKey } from "viem"
|
|
64
|
+
*
|
|
65
|
+
* const alchemyAccountClient = await createModularAccountAlchemyClient({
|
|
66
|
+
* apiKey: "your-api-key",
|
|
67
|
+
* chain: sepolia,
|
|
68
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param {AlchemyModularAccountClientConfig} config The configuration for creating the Alchemy client
|
|
73
|
+
* @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` configured with the desired plugins and actions
|
|
74
|
+
*/
|
|
55
75
|
export async function createModularAccountAlchemyClient(
|
|
56
76
|
config: AlchemyModularAccountClientConfig
|
|
57
77
|
): Promise<AlchemySmartAccountClient> {
|
|
@@ -80,6 +80,28 @@ export function createMultiOwnerModularAccountClient<
|
|
|
80
80
|
>
|
|
81
81
|
>;
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Creates a multi-owner modular account client with the provided parameters including account, transport, chain, and additional client configuration. This function uses a modular account and extends it with various plugin actions.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { createMultiOwnerModularAccountClient } from "@account-kit/smart-contracts";
|
|
89
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
90
|
+
* import { sepolia } from "viem/chains";
|
|
91
|
+
* import { http, generatePrivateKey } from "viem"
|
|
92
|
+
*
|
|
93
|
+
* const accountClient = await createMultiOwnerModularAccountClient({
|
|
94
|
+
* chain: sepolia,
|
|
95
|
+
* transport: http("RPC_URL"),
|
|
96
|
+
* account: {
|
|
97
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
|
|
98
|
+
* }
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @param {CreateMultiOwnerModularAccountClientParams} config The parameters for creating the multi-owner modular account client
|
|
103
|
+
* @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` instance with extended plugin actions
|
|
104
|
+
*/
|
|
83
105
|
export async function createMultiOwnerModularAccountClient({
|
|
84
106
|
account,
|
|
85
107
|
transport,
|
|
@@ -121,6 +143,30 @@ export function createMultisigModularAccountClient<
|
|
|
121
143
|
>
|
|
122
144
|
>;
|
|
123
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Creates a multisig modular account client using the provided parameters including account details, transport, chain, and additional client configuration. This function constructs the multisig modular account and extends it with various actions to create a comprehensive client.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* import { createMultisigModularAccountClient } from "@account-kit/smart-contracts";
|
|
152
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
153
|
+
* import { sepolia } from "viem/chains";
|
|
154
|
+
* import { http, generatePrivateKey } from "viem"
|
|
155
|
+
*
|
|
156
|
+
* const accountClient = await createMultisigModularAccountClient({
|
|
157
|
+
* chain: sepolia,
|
|
158
|
+
* transport: http("RPC_URL"),
|
|
159
|
+
* account: {
|
|
160
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
|
|
161
|
+
* owners: [...], // other owners on the account
|
|
162
|
+
* threshold: 2, // 2 of N signatures
|
|
163
|
+
* }
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* @param {CreateMultisigModularAccountClientParams} config the parameters for configuring the multisig modular account client
|
|
168
|
+
* @returns {Promise<SmartAccountClient<Transport, Chain, MultisigModularAccount<SmartAccountSigner>, {}, SmartAccountClientRpcSchema, MultisigUserOperationContext>>} a promise that resolves to a `SmartAccountClient` object extended with the multisig modular account and additional actions
|
|
169
|
+
*/
|
|
124
170
|
export async function createMultisigModularAccountClient({
|
|
125
171
|
account,
|
|
126
172
|
transport,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
smartAccountClientActions,
|
|
3
|
+
type SmartAccountSigner,
|
|
4
|
+
} from "@aa-sdk/core";
|
|
1
5
|
import {
|
|
2
6
|
AlchemyProviderConfigSchema,
|
|
3
7
|
createAlchemyPublicRpcClient,
|
|
@@ -19,10 +23,6 @@ import {
|
|
|
19
23
|
type MultisigUserOperationContext,
|
|
20
24
|
type PluginManagerActions,
|
|
21
25
|
} from "@account-kit/smart-contracts";
|
|
22
|
-
import {
|
|
23
|
-
smartAccountClientActions,
|
|
24
|
-
type SmartAccountSigner,
|
|
25
|
-
} from "@aa-sdk/core";
|
|
26
26
|
import {
|
|
27
27
|
custom,
|
|
28
28
|
type Chain,
|
|
@@ -65,6 +65,28 @@ export function createMultisigAccountAlchemyClient<
|
|
|
65
65
|
>
|
|
66
66
|
>;
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Creates an Alchemy client for a multisig account using the provided configuration.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { createMultisigAccountAlchemyClient } from "@account-kit/smart-contracts";
|
|
74
|
+
* import { sepolia } from "@account-kit/infra";
|
|
75
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
76
|
+
* import { generatePrivateKey } from "viem"
|
|
77
|
+
*
|
|
78
|
+
* const alchemyAccountClient = await createMultisigAccountAlchemyClient({
|
|
79
|
+
* apiKey: "your-api-key",
|
|
80
|
+
* chain: sepolia,
|
|
81
|
+
* signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
|
|
82
|
+
* owners: [...], // other owners on the account
|
|
83
|
+
* threshold: 2, // 2 of N signatures
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @param {AlchemyMultisigAccountClientConfig} config The configuration for the Alchemy multisig account client
|
|
88
|
+
* @returns {Promise<AlchemySmartAccountClient<Transport, Chain | undefined, MultisigModularAccount<SmartAccountSigner>, MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> & PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> & AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>, MultisigUserOperationContext>>} A promise that resolves to an Alchemy Smart Account Client for multisig accounts with extended functionalities.
|
|
89
|
+
*/
|
|
68
90
|
export async function createMultisigAccountAlchemyClient(
|
|
69
91
|
config: AlchemyMultisigAccountClientConfig
|
|
70
92
|
): Promise<
|
package/src/msca/errors.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BaseError } from "@aa-sdk/core";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when the aggregated signature is invalid
|
|
5
|
+
*/
|
|
3
6
|
export class InvalidAggregatedSignatureError extends BaseError {
|
|
4
7
|
override name = "InvalidAggregatedSignatureError";
|
|
5
8
|
constructor() {
|
|
@@ -7,6 +10,9 @@ export class InvalidAggregatedSignatureError extends BaseError {
|
|
|
7
10
|
}
|
|
8
11
|
}
|
|
9
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Error thrown when the context signature is invalid
|
|
15
|
+
*/
|
|
10
16
|
export class InvalidContextSignatureError extends BaseError {
|
|
11
17
|
override name = "InvalidContextSignatureError";
|
|
12
18
|
constructor() {
|
|
@@ -14,6 +20,9 @@ export class InvalidContextSignatureError extends BaseError {
|
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown when the expected account is not a multisig modular account
|
|
25
|
+
*/
|
|
17
26
|
export class MultisigAccountExpectedError extends BaseError {
|
|
18
27
|
override name = "MultisigAccountExpectedError";
|
|
19
28
|
constructor() {
|
|
@@ -21,6 +30,9 @@ export class MultisigAccountExpectedError extends BaseError {
|
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Error thrown when a multisig user op is missing a signature
|
|
35
|
+
*/
|
|
24
36
|
export class MultisigMissingSignatureError extends BaseError {
|
|
25
37
|
override name = "MultisigMissingSignatureError";
|
|
26
38
|
constructor() {
|
|
@@ -27,7 +27,22 @@ export type PluginManagerActions<
|
|
|
27
27
|
) => Promise<SendUserOperationResult<TEntryPointVersion>>;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Provides actions for managing plugins on a given client, including installing and uninstalling plugins.
|
|
32
|
+
* NOTE: this is provided by default when using a modular account client
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { pluginManagerActions } from "@account-kit/smart-contracts";
|
|
37
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
38
|
+
*
|
|
39
|
+
* const client = createSmartAccountClient(...).extend(pluginManagerActions);
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance on which to manage plugins
|
|
43
|
+
* @returns {PluginManagerActions<TAccount>} An object containing functions to install and uninstall plugins
|
|
44
|
+
*/
|
|
45
|
+
export function pluginManagerActions<
|
|
31
46
|
TTransport extends Transport = Transport,
|
|
32
47
|
TChain extends Chain | undefined = Chain | undefined,
|
|
33
48
|
TAccount extends SmartContractAccount | undefined =
|
|
@@ -35,7 +50,9 @@ export const pluginManagerActions: <
|
|
|
35
50
|
| undefined
|
|
36
51
|
>(
|
|
37
52
|
client: Client<TTransport, TChain, TAccount>
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
): PluginManagerActions<TAccount> {
|
|
54
|
+
return {
|
|
55
|
+
installPlugin: async (params) => installPlugin(client, params),
|
|
56
|
+
uninstallPlugin: async (params) => uninstallPlugin(client, params),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -40,6 +40,27 @@ export type InstallPluginParams<
|
|
|
40
40
|
GetAccountParameter<TAccount> &
|
|
41
41
|
GetContextParameter<TContext>;
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Installs a plugin on a smart account via the client, sending the user operation with the appropriate parameters.
|
|
45
|
+
* NOTE: it's recommended to just use the installPlugin action returned from generated plugins
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { installPlugin, createModularAccountAlchemyClient } from "@account-kit/smart-contracts";
|
|
50
|
+
*
|
|
51
|
+
* const client = createModularAccountAlchemyClient(...);
|
|
52
|
+
*
|
|
53
|
+
* const hash = await installPlugin(client, {
|
|
54
|
+
* pluginAddress: "0x...",
|
|
55
|
+
* manifestHash: "0x...",
|
|
56
|
+
* dependencies: [], // this is defined by the plugin you're installing
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client configured to the smart account on which the plugin will be installed
|
|
61
|
+
* @param {InstallPluginParams<TAccount, TContext>} params The parameters required to install the plugin, including overrides, context, and account information
|
|
62
|
+
* @returns {Promise<any>} A promise that resolves once the plugin installation operation is sent
|
|
63
|
+
*/
|
|
43
64
|
export async function installPlugin<
|
|
44
65
|
TTransport extends Transport = Transport,
|
|
45
66
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -33,6 +33,21 @@ export type MultiOwnerPluginActions<
|
|
|
33
33
|
}
|
|
34
34
|
: {});
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Creates actions for the MultiOwner plugin, including reading owners and checking ownership.
|
|
38
|
+
* NOTE: this is already added to the client returned from createMultiOwnerModularAccountClient
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { multiOwnerPluginActions } from "@account-kit/smart-contracts";
|
|
43
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
44
|
+
*
|
|
45
|
+
* const client = createSmartAccountClient(...).extend(multiOwnerPluginActions);
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param {Client<TTransport, TChain, TAccount>} client the client instance containing the transport, chain, and account information
|
|
49
|
+
* @returns {MultiOwnerPluginActions<TAccount>} an object containing the actions for the MultiOwner plugin, such as `readOwners` and `isOwnerOf`
|
|
50
|
+
*/
|
|
36
51
|
export const multiOwnerPluginActions: <
|
|
37
52
|
TTransport extends Transport = Transport,
|
|
38
53
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
type UserOperationOverrides,
|
|
11
11
|
} from "@aa-sdk/core";
|
|
12
12
|
import { type Chain, type Client, type Transport } from "viem";
|
|
13
|
-
import { splitAggregatedSignature } from "../index.js";
|
|
14
13
|
import { type ProposeUserOperationResult } from "../types.js";
|
|
14
|
+
import { splitAggregatedSignature } from "../utils/splitAggregatedSignature.js";
|
|
15
15
|
|
|
16
16
|
export async function proposeUserOperation<
|
|
17
17
|
TTransport extends Transport = Transport,
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
} from "@aa-sdk/core";
|
|
9
9
|
import { type Chain, type Client, type Transport } from "viem";
|
|
10
10
|
import { MultisigMissingSignatureError } from "../../../errors.js";
|
|
11
|
-
import { combineSignatures, splitAggregatedSignature } from "../index.js";
|
|
12
11
|
import {
|
|
13
12
|
type SignMultisigUserOperationParams,
|
|
14
13
|
type SignMultisigUserOperationResult,
|
|
15
14
|
} from "../types.js";
|
|
15
|
+
import { combineSignatures, splitAggregatedSignature } from "../utils/index.js";
|
|
16
16
|
|
|
17
17
|
export async function signMultisigUserOperation<
|
|
18
18
|
TTransport extends Transport = Transport,
|
|
@@ -58,6 +58,19 @@ export type MultisigPluginActions<
|
|
|
58
58
|
}
|
|
59
59
|
: {});
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Provides actions for managing a multisig plugin within the specified client, including reading owners, checking ownership, getting the threshold, proposing user operations, and signing multisig user operations.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { createModularAccountAlchemyClient, multisigPluginActions } from "@account-kit/smart-contracts";
|
|
67
|
+
*
|
|
68
|
+
* const client = createModularAccountAlchemyClient(...).extend(multisigPluginActions);
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance configured with transport, chain, and account information
|
|
72
|
+
* @returns {MultisigPluginActions<TAccount>} An object containing methods to perform actions related to the multisig plugin
|
|
73
|
+
*/
|
|
61
74
|
export const multisigPluginActions: <
|
|
62
75
|
TTransport extends Transport = Transport,
|
|
63
76
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export { getThreshold } from "./actions/getThreshold.js";
|
|
2
|
-
export { isOwnerOf } from "./actions/isOwnerOf.js";
|
|
3
|
-
export { proposeUserOperation } from "./actions/proposeUserOperation.js";
|
|
4
|
-
export { readOwners } from "./actions/readOwners.js";
|
|
5
|
-
export { signMultisigUserOperation } from "./actions/signMultisigUserOperation.js";
|
|
6
1
|
export type * from "./extension.js";
|
|
7
2
|
export { multisigPluginActions } from "./extension.js";
|
|
8
3
|
export { multisigSignatureMiddleware } from "./middleware.js";
|
|
@@ -10,12 +5,6 @@ export {
|
|
|
10
5
|
MultisigPlugin,
|
|
11
6
|
MultisigPluginAbi,
|
|
12
7
|
MultisigPluginExecutionFunctionAbi,
|
|
8
|
+
type InstallMultisigPluginParams,
|
|
13
9
|
} from "./plugin.js";
|
|
14
10
|
export type * from "./types.js";
|
|
15
|
-
export { type SignerType } from "./types.js";
|
|
16
|
-
export {
|
|
17
|
-
combineSignatures,
|
|
18
|
-
formatSignatures,
|
|
19
|
-
getSignerType,
|
|
20
|
-
splitAggregatedSignature,
|
|
21
|
-
} from "./utils/index.js";
|
|
@@ -15,24 +15,24 @@ import {
|
|
|
15
15
|
InvalidContextSignatureError,
|
|
16
16
|
MultisigAccountExpectedError,
|
|
17
17
|
} from "../../errors.js";
|
|
18
|
+
import { type MultisigUserOperationContext } from "./types.js";
|
|
18
19
|
import {
|
|
19
20
|
combineSignatures,
|
|
20
21
|
getSignerType,
|
|
21
22
|
splitAggregatedSignature,
|
|
22
|
-
|
|
23
|
-
} from "./index.js";
|
|
23
|
+
} from "./utils/index.js";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* A signer middleware to be used with Multisig Account Clients.
|
|
27
27
|
* This middleware handles correctly aggregating signatures passed through
|
|
28
28
|
* as context when sending UserOperations, proposing UserOperations, or adding signatures to a UserOperation.
|
|
29
29
|
*
|
|
30
|
-
* @param struct the user operation struct to be signed
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @returns a Promise containing a UserOperation with an aggregated signature in the `signature` field
|
|
30
|
+
* @param {Deferrable<UserOperationStruct<TEntryPointVersion>>} struct the user operation struct to be signed
|
|
31
|
+
* @param {ClientMiddlewareArgs<TAccount, C, TContext, TEntryPointVersion>} args the parameters to be passed to the middleware
|
|
32
|
+
* @param {UserOperationOverrides<TEntryPointVersion>} args.account the account to be used for signing
|
|
33
|
+
* @param {MiddlewareClient} args.client the smart account client that will be used for RPC requests
|
|
34
|
+
* @param {MultisigUserOperationContext} args.context the context object containing the signatures to be aggregated MultisigUserOperationContext
|
|
35
|
+
* @returns {Promise<Deferrable<UserOperationStruct<TEntryPointVersion>>>} a Promise containing a UserOperation with an aggregated signature in the `signature` field
|
|
36
36
|
*/
|
|
37
37
|
export const multisigSignatureMiddleware: ClientMiddlewareFn<
|
|
38
38
|
MultisigUserOperationContext
|
|
@@ -2,23 +2,50 @@ import { type Hex, concat, pad } from "viem";
|
|
|
2
2
|
import type { Signature } from "../types.js";
|
|
3
3
|
import { formatSignatures } from "./formatSignatures.js";
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
signatures,
|
|
7
|
-
upperLimitMaxFeePerGas,
|
|
8
|
-
upperLimitMaxPriorityFeePerGas,
|
|
9
|
-
upperLimitPvg,
|
|
10
|
-
usingMaxValues,
|
|
11
|
-
}: {
|
|
5
|
+
export type CombineSignaturesParams = {
|
|
12
6
|
upperLimitPvg: Hex;
|
|
13
7
|
upperLimitMaxFeePerGas: Hex;
|
|
14
8
|
upperLimitMaxPriorityFeePerGas: Hex;
|
|
15
9
|
signatures: Signature[];
|
|
16
10
|
usingMaxValues: boolean;
|
|
17
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Combines multiple signatures with provided upper limit values for gas fees and returns the concatenated result.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { combineSignatures } from "@account-kit/smart-contracts";
|
|
19
|
+
*
|
|
20
|
+
* const combinedSignature = combineSignatures({
|
|
21
|
+
* // this is the upper limit pre-verification gas
|
|
22
|
+
* upperLimitPvg: "0x01",
|
|
23
|
+
* upperLimitMaxFeePerGas: "0x02",
|
|
24
|
+
* upperLimitMaxPriorityFeePerGas: "0x03",
|
|
25
|
+
* signatures: [{
|
|
26
|
+
* signerType: "EOA",
|
|
27
|
+
* userOpSigType: "UPPERLIMIT",
|
|
28
|
+
* signer: `0x...`,
|
|
29
|
+
* signature: `0x...`,
|
|
30
|
+
* }]
|
|
31
|
+
* usingMaxValues: false,
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param {CombineSignaturesParams} params The function parameters
|
|
36
|
+
* @returns {Hex} The concatenated result of padding and formatting the provided values and signatures
|
|
37
|
+
*/
|
|
38
|
+
export function combineSignatures({
|
|
39
|
+
signatures,
|
|
40
|
+
upperLimitMaxFeePerGas,
|
|
41
|
+
upperLimitMaxPriorityFeePerGas,
|
|
42
|
+
upperLimitPvg,
|
|
43
|
+
usingMaxValues,
|
|
44
|
+
}: CombineSignaturesParams): Hex {
|
|
18
45
|
return concat([
|
|
19
46
|
pad(upperLimitPvg),
|
|
20
47
|
pad(upperLimitMaxFeePerGas),
|
|
21
48
|
pad(upperLimitMaxPriorityFeePerGas),
|
|
22
49
|
formatSignatures(signatures, usingMaxValues),
|
|
23
50
|
]);
|
|
24
|
-
}
|
|
51
|
+
}
|
|
@@ -8,9 +8,9 @@ import type { Signature } from "../types";
|
|
|
8
8
|
* by signer address. The EOA SIGS contain the 65 signautre data for EOA signers and 65 bytes containing SIGNER | OFFSET | V for contract signers.
|
|
9
9
|
* The OFFSET is used to fetch the signature data from the CONTRACT_SIG_DATAS.
|
|
10
10
|
*
|
|
11
|
-
* @param signatures the array of
|
|
12
|
-
* @param usingMaxValues a boolean indicating wether or not the UserOperation is using the UPPER_LIMIT for the gas and fee values
|
|
13
|
-
* @returns the Hex representation of the signature
|
|
11
|
+
* @param {Signature[]} signatures the array of Signature objects to combine into the correct aggregated signature format excluding the upper limits
|
|
12
|
+
* @param {boolean} usingMaxValues a boolean indicating wether or not the UserOperation is using the UPPER_LIMIT for the gas and fee values
|
|
13
|
+
* @returns {Hex} the Hex representation of the signature
|
|
14
14
|
*/
|
|
15
15
|
export const formatSignatures = (
|
|
16
16
|
signatures: Signature[],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SmartAccountSigner, SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import {
|
|
3
|
-
type Transport,
|
|
4
3
|
type Chain,
|
|
5
4
|
type Client,
|
|
6
|
-
type PublicRpcSchema,
|
|
7
|
-
type PublicActions,
|
|
8
5
|
type Hex,
|
|
6
|
+
type PublicActions,
|
|
7
|
+
type PublicRpcSchema,
|
|
9
8
|
size,
|
|
9
|
+
type Transport,
|
|
10
10
|
} from "viem";
|
|
11
11
|
import type { SignerType } from "../types";
|
|
12
12
|
|
|
@@ -29,6 +29,25 @@ type GetSignerTypeParams<
|
|
|
29
29
|
client: TClient;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Determines the type of signer (Externally Owned Account (EOA) or CONTRACT) based on the provided client, signature, and signer.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { getSignerType } from "@account-kit/smart-contracts";
|
|
38
|
+
* import { LocalAccountSigner } from "@aa-sdk/core";
|
|
39
|
+
* import { createPublicClient, generatePrivateKey } from "viem";
|
|
40
|
+
*
|
|
41
|
+
* const signer = LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey());
|
|
42
|
+
* const client = createPublicClient(...);
|
|
43
|
+
* const signature = signer.signMessage("Hello World");
|
|
44
|
+
*
|
|
45
|
+
* const signerType = await getSignerType({ client, signature, signer }); // EOA
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param {GetSignerTypeParams<TTransport, TChain>} params the parameters including the client, signature, and signer
|
|
49
|
+
* @returns {Promise<SignerType>} A promise that resolves to the signer type, which is either "EOA" or "CONTRACT"
|
|
50
|
+
*/
|
|
32
51
|
export const getSignerType = async <
|
|
33
52
|
TTransport extends Transport = Transport,
|
|
34
53
|
TChain extends Chain | undefined = Chain | undefined
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export type * from "./combineSignatures.js";
|
|
1
2
|
export { combineSignatures } from "./combineSignatures.js";
|
|
3
|
+
export type * from "./formatSignatures.js";
|
|
2
4
|
export { formatSignatures } from "./formatSignatures.js";
|
|
5
|
+
export type * from "./getSignerType.js";
|
|
3
6
|
export { getSignerType } from "./getSignerType.js";
|
|
7
|
+
export type * from "./splitAggregatedSignature.js";
|
|
4
8
|
export { splitAggregatedSignature } from "./splitAggregatedSignature.js";
|