@startale/app-sdk 1.0.0
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/LICENSE +13 -0
- package/README.md +116 -0
- package/dist/app-sdk.js +36226 -0
- package/dist/app-sdk.js.map +1 -0
- package/dist/app-sdk.min.js +15 -0
- package/dist/app-sdk.min.js.map +1 -0
- package/dist/browser-entry.d.ts +15 -0
- package/dist/browser-entry.d.ts.map +1 -0
- package/dist/browser-entry.js +19 -0
- package/dist/browser-entry.js.map +1 -0
- package/dist/core/communicator/Communicator.d.ts +47 -0
- package/dist/core/communicator/Communicator.d.ts.map +1 -0
- package/dist/core/communicator/Communicator.js +107 -0
- package/dist/core/communicator/Communicator.js.map +1 -0
- package/dist/core/constants.d.ts +5 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +6 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/error/constants.d.ts +96 -0
- package/dist/core/error/constants.d.ts.map +1 -0
- package/dist/core/error/constants.js +94 -0
- package/dist/core/error/constants.js.map +1 -0
- package/dist/core/error/errors.d.ts +74 -0
- package/dist/core/error/errors.d.ts.map +1 -0
- package/dist/core/error/errors.js +138 -0
- package/dist/core/error/errors.js.map +1 -0
- package/dist/core/error/serialize.d.ts +13 -0
- package/dist/core/error/serialize.d.ts.map +1 -0
- package/dist/core/error/serialize.js +43 -0
- package/dist/core/error/serialize.js.map +1 -0
- package/dist/core/error/utils.d.ts +31 -0
- package/dist/core/error/utils.d.ts.map +1 -0
- package/dist/core/error/utils.js +109 -0
- package/dist/core/error/utils.js.map +1 -0
- package/dist/core/message/ConfigMessage.d.ts +6 -0
- package/dist/core/message/ConfigMessage.d.ts.map +1 -0
- package/dist/core/message/ConfigMessage.js +2 -0
- package/dist/core/message/ConfigMessage.js.map +1 -0
- package/dist/core/message/Message.d.ts +8 -0
- package/dist/core/message/Message.d.ts.map +1 -0
- package/dist/core/message/Message.js +2 -0
- package/dist/core/message/Message.js.map +1 -0
- package/dist/core/message/RPCMessage.d.ts +31 -0
- package/dist/core/message/RPCMessage.d.ts.map +1 -0
- package/dist/core/message/RPCMessage.js +2 -0
- package/dist/core/message/RPCMessage.js.map +1 -0
- package/dist/core/message/RPCRequest.d.ts +6 -0
- package/dist/core/message/RPCRequest.d.ts.map +1 -0
- package/dist/core/message/RPCRequest.js +2 -0
- package/dist/core/message/RPCRequest.js.map +1 -0
- package/dist/core/message/RPCResponse.d.ts +23 -0
- package/dist/core/message/RPCResponse.d.ts.map +1 -0
- package/dist/core/message/RPCResponse.js +2 -0
- package/dist/core/message/RPCResponse.js.map +1 -0
- package/dist/core/provider/interface.d.ts +94 -0
- package/dist/core/provider/interface.d.ts.map +1 -0
- package/dist/core/provider/interface.js +4 -0
- package/dist/core/provider/interface.js.map +1 -0
- package/dist/core/rpc/coinbase_fetchSpendPermissions.d.ts +50 -0
- package/dist/core/rpc/coinbase_fetchSpendPermissions.d.ts.map +1 -0
- package/dist/core/rpc/coinbase_fetchSpendPermissions.js +2 -0
- package/dist/core/rpc/coinbase_fetchSpendPermissions.js.map +1 -0
- package/dist/core/rpc/wallet_addSubAccount.d.ts +37 -0
- package/dist/core/rpc/wallet_addSubAccount.d.ts.map +1 -0
- package/dist/core/rpc/wallet_addSubAccount.js +2 -0
- package/dist/core/rpc/wallet_addSubAccount.js.map +1 -0
- package/dist/core/rpc/wallet_connect.d.ts +64 -0
- package/dist/core/rpc/wallet_connect.d.ts.map +1 -0
- package/dist/core/rpc/wallet_connect.js +2 -0
- package/dist/core/rpc/wallet_connect.js.map +1 -0
- package/dist/core/rpc/wallet_getSubAccount.d.ts +14 -0
- package/dist/core/rpc/wallet_getSubAccount.d.ts.map +1 -0
- package/dist/core/rpc/wallet_getSubAccount.js +2 -0
- package/dist/core/rpc/wallet_getSubAccount.js.map +1 -0
- package/dist/core/rpc/wallet_prepareCalls.d.ts +28 -0
- package/dist/core/rpc/wallet_prepareCalls.d.ts.map +1 -0
- package/dist/core/rpc/wallet_prepareCalls.js +2 -0
- package/dist/core/rpc/wallet_prepareCalls.js.map +1 -0
- package/dist/core/rpc/wallet_sendPreparedCalls.d.ts +47 -0
- package/dist/core/rpc/wallet_sendPreparedCalls.d.ts.map +1 -0
- package/dist/core/rpc/wallet_sendPreparedCalls.js +2 -0
- package/dist/core/rpc/wallet_sendPreparedCalls.js.map +1 -0
- package/dist/core/telemetry/events/communicator.d.ts +4 -0
- package/dist/core/telemetry/events/communicator.d.ts.map +1 -0
- package/dist/core/telemetry/events/communicator.js +20 -0
- package/dist/core/telemetry/events/communicator.js.map +1 -0
- package/dist/core/telemetry/events/dialog.d.ts +15 -0
- package/dist/core/telemetry/events/dialog.d.ts.map +1 -0
- package/dist/core/telemetry/events/dialog.js +24 -0
- package/dist/core/telemetry/events/dialog.js.map +1 -0
- package/dist/core/telemetry/events/payment.d.ts +31 -0
- package/dist/core/telemetry/events/payment.d.ts.map +1 -0
- package/dist/core/telemetry/events/payment.js +68 -0
- package/dist/core/telemetry/events/payment.js.map +1 -0
- package/dist/core/telemetry/events/provider.d.ts +14 -0
- package/dist/core/telemetry/events/provider.d.ts.map +1 -0
- package/dist/core/telemetry/events/provider.js +30 -0
- package/dist/core/telemetry/events/provider.js.map +1 -0
- package/dist/core/telemetry/events/scw-signer.d.ts +27 -0
- package/dist/core/telemetry/events/scw-signer.d.ts.map +1 -0
- package/dist/core/telemetry/events/scw-signer.js +65 -0
- package/dist/core/telemetry/events/scw-signer.js.map +1 -0
- package/dist/core/telemetry/events/scw-sub-account.d.ts +40 -0
- package/dist/core/telemetry/events/scw-sub-account.d.ts.map +1 -0
- package/dist/core/telemetry/events/scw-sub-account.js +96 -0
- package/dist/core/telemetry/events/scw-sub-account.js.map +1 -0
- package/dist/core/telemetry/events/spend-permission.d.ts +6 -0
- package/dist/core/telemetry/events/spend-permission.d.ts.map +1 -0
- package/dist/core/telemetry/events/spend-permission.js +21 -0
- package/dist/core/telemetry/events/spend-permission.js.map +1 -0
- package/dist/core/telemetry/initCCA.d.ts +2 -0
- package/dist/core/telemetry/initCCA.d.ts.map +1 -0
- package/dist/core/telemetry/initCCA.js +43 -0
- package/dist/core/telemetry/initCCA.js.map +1 -0
- package/dist/core/telemetry/logEvent.d.ts +72 -0
- package/dist/core/telemetry/logEvent.d.ts.map +1 -0
- package/dist/core/telemetry/logEvent.js +62 -0
- package/dist/core/telemetry/logEvent.js.map +1 -0
- package/dist/core/telemetry/telemetry-content.d.ts +2 -0
- package/dist/core/telemetry/telemetry-content.d.ts.map +1 -0
- package/dist/core/telemetry/telemetry-content.js +5526 -0
- package/dist/core/telemetry/telemetry-content.js.map +1 -0
- package/dist/core/telemetry/utils.d.ts +2 -0
- package/dist/core/telemetry/utils.d.ts.map +1 -0
- package/dist/core/telemetry/utils.js +7 -0
- package/dist/core/telemetry/utils.js.map +1 -0
- package/dist/core/type/index.d.ts +21 -0
- package/dist/core/type/index.d.ts.map +1 -0
- package/dist/core/type/index.js +10 -0
- package/dist/core/type/index.js.map +1 -0
- package/dist/core/type/util.d.ts +28 -0
- package/dist/core/type/util.d.ts.map +1 -0
- package/dist/core/type/util.js +158 -0
- package/dist/core/type/util.js.map +1 -0
- package/dist/core/username/getDisplayableUsername.d.ts +3 -0
- package/dist/core/username/getDisplayableUsername.d.ts.map +1 -0
- package/dist/core/username/getDisplayableUsername.js +7 -0
- package/dist/core/username/getDisplayableUsername.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/interface/builder/core/BaseAccountProvider.d.ts +11 -0
- package/dist/interface/builder/core/BaseAccountProvider.d.ts.map +1 -0
- package/dist/interface/builder/core/BaseAccountProvider.js +141 -0
- package/dist/interface/builder/core/BaseAccountProvider.js.map +1 -0
- package/dist/interface/builder/core/createBaseAccountSDK.d.ts +27 -0
- package/dist/interface/builder/core/createBaseAccountSDK.d.ts.map +1 -0
- package/dist/interface/builder/core/createBaseAccountSDK.js +149 -0
- package/dist/interface/builder/core/createBaseAccountSDK.js.map +1 -0
- package/dist/interface/builder/core/getInjectedProvider.d.ts +13 -0
- package/dist/interface/builder/core/getInjectedProvider.d.ts.map +1 -0
- package/dist/interface/builder/core/getInjectedProvider.js +10 -0
- package/dist/interface/builder/core/getInjectedProvider.js.map +1 -0
- package/dist/interface/payment/base.d.ts +32 -0
- package/dist/interface/payment/base.d.ts.map +1 -0
- package/dist/interface/payment/base.js +16 -0
- package/dist/interface/payment/base.js.map +1 -0
- package/dist/interface/payment/constants.d.ts +56 -0
- package/dist/interface/payment/constants.d.ts.map +1 -0
- package/dist/interface/payment/constants.js +45 -0
- package/dist/interface/payment/constants.js.map +1 -0
- package/dist/interface/payment/getPaymentStatus.d.ts +28 -0
- package/dist/interface/payment/getPaymentStatus.d.ts.map +1 -0
- package/dist/interface/payment/getPaymentStatus.js +243 -0
- package/dist/interface/payment/getPaymentStatus.js.map +1 -0
- package/dist/interface/payment/index.d.ts +9 -0
- package/dist/interface/payment/index.d.ts.map +1 -0
- package/dist/interface/payment/index.js +9 -0
- package/dist/interface/payment/index.js.map +1 -0
- package/dist/interface/payment/pay.d.ts +29 -0
- package/dist/interface/payment/pay.d.ts.map +1 -0
- package/dist/interface/payment/pay.js +90 -0
- package/dist/interface/payment/pay.js.map +1 -0
- package/dist/interface/payment/types.d.ts +123 -0
- package/dist/interface/payment/types.d.ts.map +1 -0
- package/dist/interface/payment/types.js +5 -0
- package/dist/interface/payment/types.js.map +1 -0
- package/dist/interface/payment/utils/sdkManager.d.ts +61 -0
- package/dist/interface/payment/utils/sdkManager.d.ts.map +1 -0
- package/dist/interface/payment/utils/sdkManager.js +84 -0
- package/dist/interface/payment/utils/sdkManager.js.map +1 -0
- package/dist/interface/payment/utils/translatePayment.d.ts +45 -0
- package/dist/interface/payment/utils/translatePayment.d.ts.map +1 -0
- package/dist/interface/payment/utils/translatePayment.js +70 -0
- package/dist/interface/payment/utils/translatePayment.js.map +1 -0
- package/dist/interface/payment/utils/validation.d.ts +16 -0
- package/dist/interface/payment/utils/validation.d.ts.map +1 -0
- package/dist/interface/payment/utils/validation.js +47 -0
- package/dist/interface/payment/utils/validation.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/index.d.ts +8 -0
- package/dist/interface/public-utilities/spend-permission/index.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/index.js +8 -0
- package/dist/interface/public-utilities/spend-permission/index.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/fetchPermissions.d.ts +14 -0
- package/dist/interface/public-utilities/spend-permission/methods/fetchPermissions.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/fetchPermissions.js +52 -0
- package/dist/interface/public-utilities/spend-permission/methods/fetchPermissions.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/getHash.d.ts +9 -0
- package/dist/interface/public-utilities/spend-permission/methods/getHash.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/getHash.js +54 -0
- package/dist/interface/public-utilities/spend-permission/methods/getHash.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/getPermissionStatus.d.ts +8 -0
- package/dist/interface/public-utilities/spend-permission/methods/getPermissionStatus.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/getPermissionStatus.js +85 -0
- package/dist/interface/public-utilities/spend-permission/methods/getPermissionStatus.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareRevokeCallData.d.ts +10 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareRevokeCallData.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareRevokeCallData.js +51 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareRevokeCallData.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareSpendCallData.d.ts +11 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareSpendCallData.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareSpendCallData.js +104 -0
- package/dist/interface/public-utilities/spend-permission/methods/prepareSpendCallData.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestRevoke.d.ts +11 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestRevoke.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestRevoke.js +64 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestRevoke.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestSpendPermission.d.ts +20 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestSpendPermission.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestSpendPermission.js +67 -0
- package/dist/interface/public-utilities/spend-permission/methods/requestSpendPermission.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/utils.d.ts +81 -0
- package/dist/interface/public-utilities/spend-permission/utils.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/utils.js +130 -0
- package/dist/interface/public-utilities/spend-permission/utils.js.map +1 -0
- package/dist/interface/public-utilities/spend-permission/withTelemetry.d.ts +2 -0
- package/dist/interface/public-utilities/spend-permission/withTelemetry.d.ts.map +1 -0
- package/dist/interface/public-utilities/spend-permission/withTelemetry.js +30 -0
- package/dist/interface/public-utilities/spend-permission/withTelemetry.js.map +1 -0
- package/dist/kms/crypto-key/index.d.ts +18 -0
- package/dist/kms/crypto-key/index.d.ts.map +1 -0
- package/dist/kms/crypto-key/index.js +97 -0
- package/dist/kms/crypto-key/index.js.map +1 -0
- package/dist/kms/crypto-key/storage.d.ts +7 -0
- package/dist/kms/crypto-key/storage.d.ts.map +1 -0
- package/dist/kms/crypto-key/storage.js +20 -0
- package/dist/kms/crypto-key/storage.js.map +1 -0
- package/dist/sign/app-sdk/SCWKeyManager.d.ts +15 -0
- package/dist/sign/app-sdk/SCWKeyManager.d.ts.map +1 -0
- package/dist/sign/app-sdk/SCWKeyManager.js +82 -0
- package/dist/sign/app-sdk/SCWKeyManager.js.map +1 -0
- package/dist/sign/app-sdk/Signer.d.ts +38 -0
- package/dist/sign/app-sdk/Signer.d.ts.map +1 -0
- package/dist/sign/app-sdk/Signer.js +659 -0
- package/dist/sign/app-sdk/Signer.js.map +1 -0
- package/dist/sign/app-sdk/utils/constants.d.ts +1945 -0
- package/dist/sign/app-sdk/utils/constants.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/constants.js +1321 -0
- package/dist/sign/app-sdk/utils/constants.js.map +1 -0
- package/dist/sign/app-sdk/utils/createSmartAccount.d.ts +63 -0
- package/dist/sign/app-sdk/utils/createSmartAccount.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/createSmartAccount.js +291 -0
- package/dist/sign/app-sdk/utils/createSmartAccount.js.map +1 -0
- package/dist/sign/app-sdk/utils/createSubAccountSigner.d.ts +23 -0
- package/dist/sign/app-sdk/utils/createSubAccountSigner.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/createSubAccountSigner.js +233 -0
- package/dist/sign/app-sdk/utils/createSubAccountSigner.js.map +1 -0
- package/dist/sign/app-sdk/utils/findOwnerIndex.d.ts +32 -0
- package/dist/sign/app-sdk/utils/findOwnerIndex.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/findOwnerIndex.js +56 -0
- package/dist/sign/app-sdk/utils/findOwnerIndex.js.map +1 -0
- package/dist/sign/app-sdk/utils/handleAddSubAccountOwner.d.ts +8 -0
- package/dist/sign/app-sdk/utils/handleAddSubAccountOwner.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/handleAddSubAccountOwner.js +78 -0
- package/dist/sign/app-sdk/utils/handleAddSubAccountOwner.js.map +1 -0
- package/dist/sign/app-sdk/utils/handleInsufficientBalance.d.ts +18 -0
- package/dist/sign/app-sdk/utils/handleInsufficientBalance.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/handleInsufficientBalance.js +27 -0
- package/dist/sign/app-sdk/utils/handleInsufficientBalance.js.map +1 -0
- package/dist/sign/app-sdk/utils/presentAddOwnerDialog.d.ts +2 -0
- package/dist/sign/app-sdk/utils/presentAddOwnerDialog.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/presentAddOwnerDialog.js +46 -0
- package/dist/sign/app-sdk/utils/presentAddOwnerDialog.js.map +1 -0
- package/dist/sign/app-sdk/utils/routeThroughGlobalAccount.d.ts +33 -0
- package/dist/sign/app-sdk/utils/routeThroughGlobalAccount.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils/routeThroughGlobalAccount.js +76 -0
- package/dist/sign/app-sdk/utils/routeThroughGlobalAccount.js.map +1 -0
- package/dist/sign/app-sdk/utils.d.ts +220 -0
- package/dist/sign/app-sdk/utils.d.ts.map +1 -0
- package/dist/sign/app-sdk/utils.js +439 -0
- package/dist/sign/app-sdk/utils.js.map +1 -0
- package/dist/store/chain-clients/store.d.ts +10 -0
- package/dist/store/chain-clients/store.d.ts.map +1 -0
- package/dist/store/chain-clients/store.js +3 -0
- package/dist/store/chain-clients/store.js.map +1 -0
- package/dist/store/chain-clients/utils.d.ts +13 -0
- package/dist/store/chain-clients/utils.d.ts.map +1 -0
- package/dist/store/chain-clients/utils.js +77 -0
- package/dist/store/chain-clients/utils.js.map +1 -0
- package/dist/store/correlation-ids/store.d.ts +7 -0
- package/dist/store/correlation-ids/store.d.ts.map +1 -0
- package/dist/store/correlation-ids/store.js +32 -0
- package/dist/store/correlation-ids/store.js.map +1 -0
- package/dist/store/store.d.ts +186 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +167 -0
- package/dist/store/store.js.map +1 -0
- package/dist/ui/Dialog/Dialog-css.d.ts +3 -0
- package/dist/ui/Dialog/Dialog-css.d.ts.map +1 -0
- package/dist/ui/Dialog/Dialog-css.js +2 -0
- package/dist/ui/Dialog/Dialog-css.js.map +1 -0
- package/dist/ui/Dialog/Dialog.d.ts +28 -0
- package/dist/ui/Dialog/Dialog.d.ts.map +1 -0
- package/dist/ui/Dialog/Dialog.js +150 -0
- package/dist/ui/Dialog/Dialog.js.map +1 -0
- package/dist/ui/Dialog/index.d.ts +3 -0
- package/dist/ui/Dialog/index.d.ts.map +1 -0
- package/dist/ui/Dialog/index.js +15 -0
- package/dist/ui/Dialog/index.js.map +1 -0
- package/dist/ui/assets/BaseLogo.d.ts +4 -0
- package/dist/ui/assets/BaseLogo.d.ts.map +1 -0
- package/dist/ui/assets/BaseLogo.js +7 -0
- package/dist/ui/assets/BaseLogo.js.map +1 -0
- package/dist/ui/assets/BasePayLogo.d.ts +3 -0
- package/dist/ui/assets/BasePayLogo.d.ts.map +1 -0
- package/dist/ui/assets/BasePayLogo.js +4 -0
- package/dist/ui/assets/BasePayLogo.js.map +1 -0
- package/dist/ui/assets/colors.d.ts +18 -0
- package/dist/ui/assets/colors.d.ts.map +1 -0
- package/dist/ui/assets/colors.js +19 -0
- package/dist/ui/assets/colors.js.map +1 -0
- package/dist/ui/assets/fontFaceCSS.d.ts +2 -0
- package/dist/ui/assets/fontFaceCSS.d.ts.map +1 -0
- package/dist/ui/assets/fontFaceCSS.js +11 -0
- package/dist/ui/assets/fontFaceCSS.js.map +1 -0
- package/dist/ui/assets/index.d.ts +6 -0
- package/dist/ui/assets/index.d.ts.map +1 -0
- package/dist/ui/assets/index.js +6 -0
- package/dist/ui/assets/index.js.map +1 -0
- package/dist/ui/assets/injectFontStyle.d.ts +2 -0
- package/dist/ui/assets/injectFontStyle.d.ts.map +1 -0
- package/dist/ui/assets/injectFontStyle.js +12 -0
- package/dist/ui/assets/injectFontStyle.js.map +1 -0
- package/dist/util/assertPresence.d.ts +3 -0
- package/dist/util/assertPresence.d.ts.map +1 -0
- package/dist/util/assertPresence.js +18 -0
- package/dist/util/assertPresence.js.map +1 -0
- package/dist/util/assertSubAccount.d.ts +3 -0
- package/dist/util/assertSubAccount.d.ts.map +1 -0
- package/dist/util/assertSubAccount.js +26 -0
- package/dist/util/assertSubAccount.js.map +1 -0
- package/dist/util/checkCrossOriginOpenerPolicy.d.ts +2 -0
- package/dist/util/checkCrossOriginOpenerPolicy.d.ts.map +1 -0
- package/dist/util/checkCrossOriginOpenerPolicy.js +56 -0
- package/dist/util/checkCrossOriginOpenerPolicy.js.map +1 -0
- package/dist/util/cipher.d.ts +12 -0
- package/dist/util/cipher.d.ts.map +1 -0
- package/dist/util/cipher.js +65 -0
- package/dist/util/cipher.js.map +1 -0
- package/dist/util/encoding.d.ts +20 -0
- package/dist/util/encoding.d.ts.map +1 -0
- package/dist/util/encoding.js +48 -0
- package/dist/util/encoding.js.map +1 -0
- package/dist/util/get.d.ts +2 -0
- package/dist/util/get.d.ts.map +1 -0
- package/dist/util/get.js +14 -0
- package/dist/util/get.js.map +1 -0
- package/dist/util/provider.d.ts +10 -0
- package/dist/util/provider.d.ts.map +1 -0
- package/dist/util/provider.js +56 -0
- package/dist/util/provider.js.map +1 -0
- package/dist/util/validatePreferences.d.ts +13 -0
- package/dist/util/validatePreferences.d.ts.map +1 -0
- package/dist/util/validatePreferences.js +30 -0
- package/dist/util/validatePreferences.js.map +1 -0
- package/dist/util/web.d.ts +3 -0
- package/dist/util/web.d.ts.map +1 -0
- package/dist/util/web.js +100 -0
- package/dist/util/web.js.map +1 -0
- package/dist/vendor-js/CCA/ca.d.ts +2 -0
- package/dist/vendor-js/CCA/ca.d.ts.map +1 -0
- package/dist/vendor-js/CCA/ca.js +4608 -0
- package/dist/vendor-js/CCA/ca.js.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-sdk.min.js","sources":["../src/core/constants.ts","../../../node_modules/.pnpm/zustand@5.0.3_@types+react@18.2.15_react@18.3.1/node_modules/zustand/esm/middleware.mjs","../../../node_modules/.pnpm/zustand@5.0.3_@types+react@18.2.15_react@18.3.1/node_modules/zustand/esm/vanilla.mjs","../src/store/store.ts","../src/core/telemetry/initCCA.ts","../src/sign/app-sdk/utils/constants.ts","../src/core/error/constants.ts","../src/core/error/utils.ts","../src/core/error/errors.ts","../src/util/assertPresence.ts","../src/util/checkCrossOriginOpenerPolicy.ts","../src/util/validatePreferences.ts","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/errors.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/regex.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/signature.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/struct.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/cache.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/utils.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/structs.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/parseAbi.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/getAction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/formatAbiItem.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/data/isHex.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/data/size.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/version.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/base.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/abi.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/log.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/data.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/data/pad.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/encoding.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/data/trim.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/encoding/fromHex.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toHex.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toBytes.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/crypto.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/keccak256.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/hashSignature.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/toSignature.js","../../../node_modules/.pnpm/abitype@1.1.0_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/normalizeSignature.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/toSignatureHash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/toEventSelector.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/address.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/lru.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/address/getAddress.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/address/isAddress.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/data/concat.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/data/slice.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/regex.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/toFunctionSelector.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/getAbiItem.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/encodeEventTopics.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/filters/createFilterRequestScope.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/createContractEventFilter.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/accounts/utils/parseAccount.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/encodeFunctionData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/solidity.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/cursor.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/cursor.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/encoding/fromBytes.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/decodeErrorResult.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/stringify.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/unit.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/unit/formatUnits.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/unit/formatEther.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/unit/formatGwei.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/stateOverride.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/transaction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/contract.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/request.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/rpc.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/errors/getContractError.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/recoverPublicKey.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/recoverAddress.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toRlp.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/authorization/hashAuthorization.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/authorization/recoverAuthorizationAddress.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/estimateGas.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/node.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/errors/getNodeError.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/extract.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/formatter.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/transactionRequest.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/stateOverride.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/number.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/transaction/assertRequest.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/fee.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/block.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/transaction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/block.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getBlock.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getGasPrice.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/estimateMaxPriorityFeePerGas.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/estimateFeesPerGas.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getTransactionCount.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/blob/blobsToCommitments.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/blob/blobsToProofs.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/hash/sha256.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/blob.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/blob.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/blob/toBlobSidecars.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/blob/toBlobs.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/transaction/getTransactionType.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getChainId.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/wallet/prepareTransactionRequest.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/estimateGas.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/errors/getEstimateGasError.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/address/isAddressEqual.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/decodeEventLog.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/parseEventLogs.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/log.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getLogs.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getContractEvents.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/abstract/utils.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Errors.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/internal/bytes.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/internal/hex.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Json.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Bytes.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Hex.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Withdrawal.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/BlockOverrides.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/abis.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/contract.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/contracts.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/chain.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/encodeDeployData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/chain/getChainContractAddress.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/errors/getCallError.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/promise/withResolvers.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/promise/createBatchScheduler.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/call.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/readContract.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/observe.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/wait.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/poll.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/promise/withCache.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getBlockNumber.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getFilterChanges.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/uninstallFilter.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/account.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/calls.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/promise/withRetry.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/transactionReceipt.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/wallet/sendCalls.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/wallet/getCallsStatus.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/wallet/waitForCallsStatus.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/uid.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/clients/createClient.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/errors.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/decodeFunctionData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/encodeErrorResult.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/encodedLabelToLabelhash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/namehash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/encodeLabelhash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/labelhash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/packetToBytes.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/ens.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/avatar/utils.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ens/avatar/parseAvatarRecord.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/ens/getEnsText.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/createAccessList.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/createEventFilter.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/createPendingTransactionFilter.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getCode.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/eip712.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getEip712Domain.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getFeeHistory.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/feeHistory.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/abi/encodePacked.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/transaction/assertTransaction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/transaction/serializeAccessList.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/transaction/serializeTransaction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/kzg.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/promise/withDedupe.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/buildRequest.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/ccip.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/ccip.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/chain/defineChain.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/nonceManager.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/rpc/id.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/rpc/http.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/promise/withTimeout.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/hashMessage.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/typedData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/typedData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/hashTypedData.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/errors.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/regex.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/signature.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/struct.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/cache.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/utils.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/runtime/structs.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/parseAbiItem.js","../../../node_modules/.pnpm/abitype@1.1.1_typescript@5.9.3_zod@3.25.76/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/internal/lru.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Caches.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Hash.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/PublicKey.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Address.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Solidity.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/internal/abiParameters.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/internal/cursor.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/AbiParameters.js","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/hmac.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/abstract/modular.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/abstract/curve.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/abstract/weierstrass.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/_shortw_utils.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/secp256k1.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Signature.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Authorization.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/erc8010/SignatureErc8010.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/serializeErc6492Signature.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/bytes.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/unit.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getProof.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/formatters/proof.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getTransaction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getTransactionReceipt.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/simulateBlocks.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/internal/abiItem.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/AbiItem.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/AbiConstructor.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/AbiFunction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/constants/address.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/simulateCalls.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/erc6492/SignatureErc6492.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/verifyHash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/serializeSignature.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/authorization/verifyAuthorization.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/watchBlockNumber.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/siwe/parseSiweMessage.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/siwe/verifySiweMessage.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/siwe/validateSiweMessage.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/clients/decorators/public.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/createBlockFilter.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/estimateContractGas.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getBalance.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getBlobBaseFee.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getBlockTransactionCount.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/ens/getEnsAddress.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/ens/getEnsAvatar.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/ens/getEnsName.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/ens/getEnsResolver.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getFilterLogs.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getStorageAt.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/getTransactionConfirmations.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/multicall.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/wallet/sendRawTransaction.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/wallet/sendRawTransactionSync.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/simulateContract.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/verifyMessage.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/verifyTypedData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/waitForTransactionReceipt.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/watchBlocks.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/watchContractEvent.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/watchEvent.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/public/watchPendingTransactions.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/errors/transport.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/clients/transports/http.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/clients/transports/createTransport.js","../../../node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@4.52.4_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js","../src/core/telemetry/logEvent.ts","../src/core/telemetry/events/communicator.ts","../src/core/telemetry/events/dialog.ts","../src/ui/assets/injectFontStyle.ts","../../../node_modules/.pnpm/preact@10.24.2/node_modules/preact/dist/preact.module.js","../../../node_modules/.pnpm/preact@10.24.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js","../../../node_modules/.pnpm/clsx@1.2.1/node_modules/clsx/dist/clsx.m.js","../src/ui/assets/colors.ts","../src/ui/assets/BaseLogo.tsx","../../../node_modules/.pnpm/preact@10.24.2/node_modules/preact/hooks/dist/hooks.module.js","../src/ui/Dialog/Dialog.tsx","../src/ui/Dialog/Dialog-css.ts","../src/core/username/getDisplayableUsername.ts","../src/ui/Dialog/index.ts","../src/ui/assets/fontFaceCSS.ts","../src/util/web.ts","../src/core/communicator/Communicator.ts","../src/core/error/serialize.ts","../../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js","../src/core/provider/interface.ts","../src/core/telemetry/events/provider.ts","../src/core/telemetry/utils.ts","../src/core/type/index.ts","../src/core/type/util.ts","../src/core/telemetry/events/scw-signer.ts","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/Base64.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/nist.js","../../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/p256.js","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/WebAuthnP256.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/constants/abis.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/userOperation/getInitCode.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/userOperation/getUserOperationTypedData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/errors/bundler.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/errors/userOperation.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/errors/getBundlerError.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/errors/getUserOperationError.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/formatters/userOperationRequest.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/paymaster/getPaymasterData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/paymaster/getPaymasterStubData.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/bundler/prepareUserOperation.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/actions/wallet/prepareAuthorization.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/formatters/userOperationGas.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/formatters/userOperation.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/bundler/getUserOperationReceipt.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/utils/formatters/userOperationReceipt.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/clients/decorators/bundler.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/bundler/getSupportedEntryPoints.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/bundler/getUserOperation.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/bundler/sendUserOperation.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/actions/bundler/waitForUserOperationReceipt.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/op-stack/serializers.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/op-stack/chainConfig.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/op-stack/contracts.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/op-stack/formatters.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/chains/definitions/base.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/chains/definitions/baseSepolia.js","../src/store/chain-clients/store.ts","../src/store/chain-clients/utils.ts","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/clients/createPublicClient.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/clients/createBundlerClient.js","../src/store/correlation-ids/store.ts","../src/util/assertSubAccount.ts","../src/util/cipher.ts","../src/util/provider.ts","../../../node_modules/.pnpm/idb-keyval@6.2.1/node_modules/idb-keyval/dist/index.js","../src/kms/crypto-key/index.ts","../src/kms/crypto-key/storage.ts","../../../node_modules/.pnpm/ox@0.9.6_typescript@5.9.3_zod@3.25.76/node_modules/ox/_esm/core/WebCryptoP256.js","../src/sign/app-sdk/SCWKeyManager.ts","../src/util/get.ts","../src/sign/app-sdk/utils.ts","../src/util/encoding.ts","../src/sign/app-sdk/utils/createSmartAccount.ts","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/constants/address.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/account-abstraction/accounts/toSmartAccount.js","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/signature/parseSignature.js","../src/sign/app-sdk/utils/createSubAccountSigner.ts","../src/sign/app-sdk/utils/findOwnerIndex.ts","../src/sign/app-sdk/utils/handleAddSubAccountOwner.ts","../src/sign/app-sdk/utils/presentAddOwnerDialog.ts","../src/sign/app-sdk/utils/routeThroughGlobalAccount.ts","../src/sign/app-sdk/utils/handleInsufficientBalance.ts","../src/sign/app-sdk/Signer.ts","../src/core/telemetry/events/scw-sub-account.ts","../src/interface/builder/core/BaseAccountProvider.ts","../src/interface/builder/core/createBaseAccountSDK.ts","../src/core/telemetry/telemetry-content.ts","../src/interface/builder/core/getInjectedProvider.ts","../src/interface/payment/constants.ts","../src/core/telemetry/events/payment.ts","../src/interface/payment/getPaymentStatus.ts","../src/interface/payment/utils/sdkManager.ts","../src/interface/payment/utils/translatePayment.ts","../../../node_modules/.pnpm/viem@2.38.3_typescript@5.9.3_zod@3.25.76/node_modules/viem/_esm/utils/unit/parseUnits.js","../src/interface/payment/pay.ts","../src/interface/payment/utils/validation.ts","../src/interface/payment/base.ts","../src/browser-entry.ts"],"sourcesContent":[null,"const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...a) => api.dispatch(...a), ...initial };\n};\nconst redux = reduxImpl;\n\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === undefined) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = (state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === undefined ? { type: anonymousActionType || \"anonymous\" } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === undefined) {\n connection == null ? undefined : connection.send(action, get());\n return r;\n }\n connection == null ? undefined : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? undefined : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? undefined : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (api.dispatchFromDevtools && typeof api.dispatch === \"function\") {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...a) => {\n if ((import.meta.env ? import.meta.env.MODE : undefined) !== \"production\" && a[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...a);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === undefined) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === undefined || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (!api.dispatchFromDevtools) return;\n if (typeof api.dispatch !== \"function\") return;\n api.dispatch(action);\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === undefined) {\n return connection == null ? undefined : connection.init(api.getState());\n }\n return connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === undefined) {\n connection == null ? undefined : connection.init(api.getState());\n return;\n }\n return connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === undefined) {\n setStateFromDevtools(state);\n connection == null ? undefined : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? undefined : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === undefined) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? undefined : _a.state;\n if (!lastComputedState) return;\n if (store === undefined) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? undefined : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, f) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== undefined) f(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = (selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? undefined : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? undefined : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n };\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nconst combine = (initialState, create) => (...a) => Object.assign({}, initialState, create(...a));\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? undefined : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(\n name,\n JSON.stringify(newValue, options == null ? undefined : options.replacer)\n ),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n void setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n void setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? undefined : _b.call(options, (_a = get()) != null ? _a : configResult)) || undefined;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, undefined];\n }).then((migrationResult) => {\n var _a2;\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n postRehydrationCallback == null ? undefined : postRehydrationCallback(stateFromStorage, undefined);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n postRehydrationCallback == null ? undefined : postRehydrationCallback(undefined, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? undefined : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };\n","const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;\n\nexport { createStore };\n",null,null,null,null,null,null,null,null,null,"import { version } from './version.js';\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n const details = args.cause instanceof BaseError\n ? args.cause.details\n : args.cause?.message\n ? args.cause.message\n : args.details;\n const docsPath = args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsPath ? [`Docs: https://abitype.dev${docsPath}`] : []),\n ...(details ? [`Details: ${details}`] : []),\n `Version: abitype@${version}`,\n ].join('\\n');\n super(message);\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiTypeError'\n });\n if (args.cause)\n this.cause = args.cause;\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.shortMessage = shortMessage;\n }\n}\n//# sourceMappingURL=errors.js.map","// TODO: This looks cool. Need to check the performance of `new RegExp` versus defined inline though.\n// https://twitter.com/GabrielVergnaud/status/1622906834343366657\nexport function execTyped(regex, string) {\n const match = regex.exec(string);\n return match?.groups;\n}\n// `bytes<M>`: binary type of `M` bytes, `0 < M <= 32`\n// https://regexr.com/6va55\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\n// `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n// https://regexr.com/6v8hp\nexport const integerRegex = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\nexport const isTupleRegex = /^\\(.+?\\).*?$/;\n//# sourceMappingURL=regex.js.map","import { execTyped } from '../regex.js';\n// https://regexr.com/7f7rv\nconst tupleRegex = /^tuple(?<array>(\\[(\\d*)\\])*)$/;\n/**\n * Formats {@link AbiParameter} to human-readable ABI parameter.\n *\n * @param abiParameter - ABI parameter\n * @returns Human-readable ABI parameter\n *\n * @example\n * const result = formatAbiParameter({ type: 'address', name: 'from' })\n * // ^? const result: 'address from'\n */\nexport function formatAbiParameter(abiParameter) {\n let type = abiParameter.type;\n if (tupleRegex.test(abiParameter.type) && 'components' in abiParameter) {\n type = '(';\n const length = abiParameter.components.length;\n for (let i = 0; i < length; i++) {\n const component = abiParameter.components[i];\n type += formatAbiParameter(component);\n if (i < length - 1)\n type += ', ';\n }\n const result = execTyped(tupleRegex, abiParameter.type);\n type += `)${result?.array ?? ''}`;\n return formatAbiParameter({\n ...abiParameter,\n type,\n });\n }\n // Add `indexed` to type if in `abiParameter`\n if ('indexed' in abiParameter && abiParameter.indexed)\n type = `${type} indexed`;\n // Return human-readable ABI parameter\n if (abiParameter.name)\n return `${type} ${abiParameter.name}`;\n return type;\n}\n//# sourceMappingURL=formatAbiParameter.js.map","import { formatAbiParameter, } from './formatAbiParameter.js';\n/**\n * Formats {@link AbiParameter}s to human-readable ABI parameters.\n *\n * @param abiParameters - ABI parameters\n * @returns Human-readable ABI parameters\n *\n * @example\n * const result = formatAbiParameters([\n * // ^? const result: 'address from, uint256 tokenId'\n * { type: 'address', name: 'from' },\n * { type: 'uint256', name: 'tokenId' },\n * ])\n */\nexport function formatAbiParameters(abiParameters) {\n let params = '';\n const length = abiParameters.length;\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i];\n params += formatAbiParameter(abiParameter);\n if (i !== length - 1)\n params += ', ';\n }\n return params;\n}\n//# sourceMappingURL=formatAbiParameters.js.map","import { execTyped } from '../../regex.js';\n// https://regexr.com/7gmok\nconst errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)$/;\nexport function isErrorSignature(signature) {\n return errorSignatureRegex.test(signature);\n}\nexport function execErrorSignature(signature) {\n return execTyped(errorSignatureRegex, signature);\n}\n// https://regexr.com/7gmoq\nconst eventSignatureRegex = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)$/;\nexport function isEventSignature(signature) {\n return eventSignatureRegex.test(signature);\n}\nexport function execEventSignature(signature) {\n return execTyped(eventSignatureRegex, signature);\n}\n// https://regexr.com/7gmot\nconst functionSignatureRegex = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\\s?\\((?<returns>.*?)\\))?$/;\nexport function isFunctionSignature(signature) {\n return functionSignatureRegex.test(signature);\n}\nexport function execFunctionSignature(signature) {\n return execTyped(functionSignatureRegex, signature);\n}\n// https://regexr.com/7gmp3\nconst structSignatureRegex = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \\{(?<properties>.*?)\\}$/;\nexport function isStructSignature(signature) {\n return structSignatureRegex.test(signature);\n}\nexport function execStructSignature(signature) {\n return execTyped(structSignatureRegex, signature);\n}\n// https://regexr.com/78u01\nconst constructorSignatureRegex = /^constructor\\((?<parameters>.*?)\\)(?:\\s(?<stateMutability>payable{1}))?$/;\nexport function isConstructorSignature(signature) {\n return constructorSignatureRegex.test(signature);\n}\nexport function execConstructorSignature(signature) {\n return execTyped(constructorSignatureRegex, signature);\n}\n// https://regexr.com/7srtn\nconst fallbackSignatureRegex = /^fallback\\(\\) external(?:\\s(?<stateMutability>payable{1}))?$/;\nexport function isFallbackSignature(signature) {\n return fallbackSignatureRegex.test(signature);\n}\nexport function execFallbackSignature(signature) {\n return execTyped(fallbackSignatureRegex, signature);\n}\n// https://regexr.com/78u1k\nconst receiveSignatureRegex = /^receive\\(\\) external payable$/;\nexport function isReceiveSignature(signature) {\n return receiveSignatureRegex.test(signature);\n}\nexport const modifiers = new Set([\n 'memory',\n 'indexed',\n 'storage',\n 'calldata',\n]);\nexport const eventModifiers = new Set(['indexed']);\nexport const functionModifiers = new Set([\n 'calldata',\n 'memory',\n 'storage',\n]);\n//# sourceMappingURL=signatures.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiItemError extends BaseError {\n constructor({ signature }) {\n super('Failed to parse ABI item.', {\n details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,\n docsPath: '/api/human#parseabiitem-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiItemError'\n });\n }\n}\nexport class UnknownTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [\n `Type \"${type}\" is not a valid ABI type. Perhaps you forgot to include a struct signature?`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownTypeError'\n });\n }\n}\nexport class UnknownSolidityTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [`Type \"${type}\" is not a valid ABI type.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSolidityTypeError'\n });\n }\n}\n//# sourceMappingURL=abiItem.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiParameterError extends BaseError {\n constructor({ param }) {\n super('Failed to parse ABI parameter.', {\n details: `parseAbiParameter(${JSON.stringify(param, null, 2)})`,\n docsPath: '/api/human#parseabiparameter-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParameterError'\n });\n }\n}\nexport class InvalidAbiParametersError extends BaseError {\n constructor({ params }) {\n super('Failed to parse ABI parameters.', {\n details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,\n docsPath: '/api/human#parseabiparameters-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParametersError'\n });\n }\n}\nexport class InvalidParameterError extends BaseError {\n constructor({ param }) {\n super('Invalid ABI parameter.', {\n details: param,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParameterError'\n });\n }\n}\nexport class SolidityProtectedKeywordError extends BaseError {\n constructor({ param, name }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `\"${name}\" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SolidityProtectedKeywordError'\n });\n }\n}\nexport class InvalidModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidModifierError'\n });\n }\n}\nexport class InvalidFunctionModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n `Data location can only be specified for array, struct, or mapping types, but \"${modifier}\" was given.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidFunctionModifierError'\n });\n }\n}\nexport class InvalidAbiTypeParameterError extends BaseError {\n constructor({ abiParameter, }) {\n super('Invalid ABI parameter.', {\n details: JSON.stringify(abiParameter, null, 2),\n metaMessages: ['ABI parameter type is invalid.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiTypeParameterError'\n });\n }\n}\n//# sourceMappingURL=abiParameter.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidSignatureError extends BaseError {\n constructor({ signature, type, }) {\n super(`Invalid ${type} signature.`, {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSignatureError'\n });\n }\n}\nexport class UnknownSignatureError extends BaseError {\n constructor({ signature }) {\n super('Unknown signature.', {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSignatureError'\n });\n }\n}\nexport class InvalidStructSignatureError extends BaseError {\n constructor({ signature }) {\n super('Invalid struct signature.', {\n details: signature,\n metaMessages: ['No properties exist.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidStructSignatureError'\n });\n }\n}\n//# sourceMappingURL=signature.js.map","import { BaseError } from '../../errors.js';\nexport class CircularReferenceError extends BaseError {\n constructor({ type }) {\n super('Circular reference detected.', {\n metaMessages: [`Struct \"${type}\" is a circular reference.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'CircularReferenceError'\n });\n }\n}\n//# sourceMappingURL=struct.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidParenthesisError extends BaseError {\n constructor({ current, depth }) {\n super('Unbalanced parentheses.', {\n metaMessages: [\n `\"${current.trim()}\" has too many ${depth > 0 ? 'opening' : 'closing'} parentheses.`,\n ],\n details: `Depth \"${depth}\"`,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParenthesisError'\n });\n }\n}\n//# sourceMappingURL=splitParameters.js.map","/**\n * Gets {@link parameterCache} cache key namespaced by {@link type}. This prevents parameters from being accessible to types that don't allow them (e.g. `string indexed foo` not allowed outside of `type: 'event'`).\n * @param param ABI parameter string\n * @param type ABI parameter type\n * @returns Cache key for {@link parameterCache}\n */\nexport function getParameterCacheKey(param, type, structs) {\n let structKey = '';\n if (structs)\n for (const struct of Object.entries(structs)) {\n if (!struct)\n continue;\n let propertyKey = '';\n for (const property of struct[1]) {\n propertyKey += `[${property.type}${property.name ? `:${property.name}` : ''}]`;\n }\n structKey += `(${struct[0]}{${propertyKey}})`;\n }\n if (type)\n return `${type}:${param}${structKey}`;\n return param;\n}\n/**\n * Basic cache seeded with common ABI parameter strings.\n *\n * **Note: When seeding more parameters, make sure you benchmark performance. The current number is the ideal balance between performance and having an already existing cache.**\n */\nexport const parameterCache = new Map([\n // Unnamed\n ['address', { type: 'address' }],\n ['bool', { type: 'bool' }],\n ['bytes', { type: 'bytes' }],\n ['bytes32', { type: 'bytes32' }],\n ['int', { type: 'int256' }],\n ['int256', { type: 'int256' }],\n ['string', { type: 'string' }],\n ['uint', { type: 'uint256' }],\n ['uint8', { type: 'uint8' }],\n ['uint16', { type: 'uint16' }],\n ['uint24', { type: 'uint24' }],\n ['uint32', { type: 'uint32' }],\n ['uint64', { type: 'uint64' }],\n ['uint96', { type: 'uint96' }],\n ['uint112', { type: 'uint112' }],\n ['uint160', { type: 'uint160' }],\n ['uint192', { type: 'uint192' }],\n ['uint256', { type: 'uint256' }],\n // Named\n ['address owner', { type: 'address', name: 'owner' }],\n ['address to', { type: 'address', name: 'to' }],\n ['bool approved', { type: 'bool', name: 'approved' }],\n ['bytes _data', { type: 'bytes', name: '_data' }],\n ['bytes data', { type: 'bytes', name: 'data' }],\n ['bytes signature', { type: 'bytes', name: 'signature' }],\n ['bytes32 hash', { type: 'bytes32', name: 'hash' }],\n ['bytes32 r', { type: 'bytes32', name: 'r' }],\n ['bytes32 root', { type: 'bytes32', name: 'root' }],\n ['bytes32 s', { type: 'bytes32', name: 's' }],\n ['string name', { type: 'string', name: 'name' }],\n ['string symbol', { type: 'string', name: 'symbol' }],\n ['string tokenURI', { type: 'string', name: 'tokenURI' }],\n ['uint tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint8 v', { type: 'uint8', name: 'v' }],\n ['uint256 balance', { type: 'uint256', name: 'balance' }],\n ['uint256 tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint256 value', { type: 'uint256', name: 'value' }],\n // Indexed\n [\n 'event:address indexed from',\n { type: 'address', name: 'from', indexed: true },\n ],\n ['event:address indexed to', { type: 'address', name: 'to', indexed: true }],\n [\n 'event:uint indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n [\n 'event:uint256 indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n]);\n//# sourceMappingURL=cache.js.map","import { bytesRegex, execTyped, integerRegex, isTupleRegex, } from '../../regex.js';\nimport { UnknownSolidityTypeError } from '../errors/abiItem.js';\nimport { InvalidFunctionModifierError, InvalidModifierError, InvalidParameterError, SolidityProtectedKeywordError, } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, UnknownSignatureError, } from '../errors/signature.js';\nimport { InvalidParenthesisError } from '../errors/splitParameters.js';\nimport { getParameterCacheKey, parameterCache } from './cache.js';\nimport { eventModifiers, execConstructorSignature, execErrorSignature, execEventSignature, execFallbackSignature, execFunctionSignature, functionModifiers, isConstructorSignature, isErrorSignature, isEventSignature, isFallbackSignature, isFunctionSignature, isReceiveSignature, } from './signatures.js';\nexport function parseSignature(signature, structs = {}) {\n if (isFunctionSignature(signature))\n return parseFunctionSignature(signature, structs);\n if (isEventSignature(signature))\n return parseEventSignature(signature, structs);\n if (isErrorSignature(signature))\n return parseErrorSignature(signature, structs);\n if (isConstructorSignature(signature))\n return parseConstructorSignature(signature, structs);\n if (isFallbackSignature(signature))\n return parseFallbackSignature(signature);\n if (isReceiveSignature(signature))\n return {\n type: 'receive',\n stateMutability: 'payable',\n };\n throw new UnknownSignatureError({ signature });\n}\nexport function parseFunctionSignature(signature, structs = {}) {\n const match = execFunctionSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'function' });\n const inputParams = splitParameters(match.parameters);\n const inputs = [];\n const inputLength = inputParams.length;\n for (let i = 0; i < inputLength; i++) {\n inputs.push(parseAbiParameter(inputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n const outputs = [];\n if (match.returns) {\n const outputParams = splitParameters(match.returns);\n const outputLength = outputParams.length;\n for (let i = 0; i < outputLength; i++) {\n outputs.push(parseAbiParameter(outputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n }\n return {\n name: match.name,\n type: 'function',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs,\n outputs,\n };\n}\nexport function parseEventSignature(signature, structs = {}) {\n const match = execEventSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'event' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++)\n abiParameters.push(parseAbiParameter(params[i], {\n modifiers: eventModifiers,\n structs,\n type: 'event',\n }));\n return { name: match.name, type: 'event', inputs: abiParameters };\n}\nexport function parseErrorSignature(signature, structs = {}) {\n const match = execErrorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'error' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++)\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'error' }));\n return { name: match.name, type: 'error', inputs: abiParameters };\n}\nexport function parseConstructorSignature(signature, structs = {}) {\n const match = execConstructorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'constructor' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++)\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'constructor' }));\n return {\n type: 'constructor',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs: abiParameters,\n };\n}\nexport function parseFallbackSignature(signature) {\n const match = execFallbackSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'fallback' });\n return {\n type: 'fallback',\n stateMutability: match.stateMutability ?? 'nonpayable',\n };\n}\nconst abiParameterWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\\spayable)?)(?<array>(?:\\[\\d*?\\])+?)?(?:\\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst abiParameterWithTupleRegex = /^\\((?<type>.+?)\\)(?<array>(?:\\[\\d*?\\])+?)?(?:\\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst dynamicIntegerRegex = /^u?int$/;\nexport function parseAbiParameter(param, options) {\n // optional namespace cache by `type`\n const parameterCacheKey = getParameterCacheKey(param, options?.type, options?.structs);\n if (parameterCache.has(parameterCacheKey))\n return parameterCache.get(parameterCacheKey);\n const isTuple = isTupleRegex.test(param);\n const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);\n if (!match)\n throw new InvalidParameterError({ param });\n if (match.name && isSolidityKeyword(match.name))\n throw new SolidityProtectedKeywordError({ param, name: match.name });\n const name = match.name ? { name: match.name } : {};\n const indexed = match.modifier === 'indexed' ? { indexed: true } : {};\n const structs = options?.structs ?? {};\n let type;\n let components = {};\n if (isTuple) {\n type = 'tuple';\n const params = splitParameters(match.type);\n const components_ = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n // remove `modifiers` from `options` to prevent from being added to tuple components\n components_.push(parseAbiParameter(params[i], { structs }));\n }\n components = { components: components_ };\n }\n else if (match.type in structs) {\n type = 'tuple';\n components = { components: structs[match.type] };\n }\n else if (dynamicIntegerRegex.test(match.type)) {\n type = `${match.type}256`;\n }\n else if (match.type === 'address payable') {\n type = 'address';\n }\n else {\n type = match.type;\n if (!(options?.type === 'struct') && !isSolidityType(type))\n throw new UnknownSolidityTypeError({ type });\n }\n if (match.modifier) {\n // Check if modifier exists, but is not allowed (e.g. `indexed` in `functionModifiers`)\n if (!options?.modifiers?.has?.(match.modifier))\n throw new InvalidModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n // Check if resolved `type` is valid if there is a function modifier\n if (functionModifiers.has(match.modifier) &&\n !isValidDataLocation(type, !!match.array))\n throw new InvalidFunctionModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n }\n const abiParameter = {\n type: `${type}${match.array ?? ''}`,\n ...name,\n ...indexed,\n ...components,\n };\n parameterCache.set(parameterCacheKey, abiParameter);\n return abiParameter;\n}\n// s/o latika for this\nexport function splitParameters(params, result = [], current = '', depth = 0) {\n const length = params.trim().length;\n // biome-ignore lint/correctness/noUnreachable: recursive\n for (let i = 0; i < length; i++) {\n const char = params[i];\n const tail = params.slice(i + 1);\n switch (char) {\n case ',':\n return depth === 0\n ? splitParameters(tail, [...result, current.trim()])\n : splitParameters(tail, result, `${current}${char}`, depth);\n case '(':\n return splitParameters(tail, result, `${current}${char}`, depth + 1);\n case ')':\n return splitParameters(tail, result, `${current}${char}`, depth - 1);\n default:\n return splitParameters(tail, result, `${current}${char}`, depth);\n }\n }\n if (current === '')\n return result;\n if (depth !== 0)\n throw new InvalidParenthesisError({ current, depth });\n result.push(current.trim());\n return result;\n}\nexport function isSolidityType(type) {\n return (type === 'address' ||\n type === 'bool' ||\n type === 'function' ||\n type === 'string' ||\n bytesRegex.test(type) ||\n integerRegex.test(type));\n}\nconst protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;\n/** @internal */\nexport function isSolidityKeyword(name) {\n return (name === 'address' ||\n name === 'bool' ||\n name === 'function' ||\n name === 'string' ||\n name === 'tuple' ||\n bytesRegex.test(name) ||\n integerRegex.test(name) ||\n protectedKeywordsRegex.test(name));\n}\n/** @internal */\nexport function isValidDataLocation(type, isArray) {\n return isArray || type === 'bytes' || type === 'string' || type === 'tuple';\n}\n//# sourceMappingURL=utils.js.map","import { execTyped, isTupleRegex } from '../../regex.js';\nimport { UnknownTypeError } from '../errors/abiItem.js';\nimport { InvalidAbiTypeParameterError } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, InvalidStructSignatureError, } from '../errors/signature.js';\nimport { CircularReferenceError } from '../errors/struct.js';\nimport { execStructSignature, isStructSignature } from './signatures.js';\nimport { isSolidityType, parseAbiParameter } from './utils.js';\nexport function parseStructs(signatures) {\n // Create \"shallow\" version of each struct (and filter out non-structs or invalid structs)\n const shallowStructs = {};\n const signaturesLength = signatures.length;\n for (let i = 0; i < signaturesLength; i++) {\n const signature = signatures[i];\n if (!isStructSignature(signature))\n continue;\n const match = execStructSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'struct' });\n const properties = match.properties.split(';');\n const components = [];\n const propertiesLength = properties.length;\n for (let k = 0; k < propertiesLength; k++) {\n const property = properties[k];\n const trimmed = property.trim();\n if (!trimmed)\n continue;\n const abiParameter = parseAbiParameter(trimmed, {\n type: 'struct',\n });\n components.push(abiParameter);\n }\n if (!components.length)\n throw new InvalidStructSignatureError({ signature });\n shallowStructs[match.name] = components;\n }\n // Resolve nested structs inside each parameter\n const resolvedStructs = {};\n const entries = Object.entries(shallowStructs);\n const entriesLength = entries.length;\n for (let i = 0; i < entriesLength; i++) {\n const [name, parameters] = entries[i];\n resolvedStructs[name] = resolveStructs(parameters, shallowStructs);\n }\n return resolvedStructs;\n}\nconst typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\\[\\d*?\\])+?)?$/;\nfunction resolveStructs(abiParameters, structs, ancestors = new Set()) {\n const components = [];\n const length = abiParameters.length;\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i];\n const isTuple = isTupleRegex.test(abiParameter.type);\n if (isTuple)\n components.push(abiParameter);\n else {\n const match = execTyped(typeWithoutTupleRegex, abiParameter.type);\n if (!match?.type)\n throw new InvalidAbiTypeParameterError({ abiParameter });\n const { array, type } = match;\n if (type in structs) {\n if (ancestors.has(type))\n throw new CircularReferenceError({ type });\n components.push({\n ...abiParameter,\n type: `tuple${array ?? ''}`,\n components: resolveStructs(structs[type] ?? [], structs, new Set([...ancestors, type])),\n });\n }\n else {\n if (isSolidityType(type))\n components.push(abiParameter);\n else\n throw new UnknownTypeError({ type });\n }\n }\n }\n return components;\n}\n//# sourceMappingURL=structs.js.map","import { isStructSignature } from './runtime/signatures.js';\nimport { parseStructs } from './runtime/structs.js';\nimport { parseSignature } from './runtime/utils.js';\n/**\n * Parses human-readable ABI into JSON {@link Abi}\n *\n * @param signatures - Human-Readable ABI\n * @returns Parsed {@link Abi}\n *\n * @example\n * const abi = parseAbi([\n * // ^? const abi: readonly [{ name: \"balanceOf\"; type: \"function\"; stateMutability:...\n * 'function balanceOf(address owner) view returns (uint256)',\n * 'event Transfer(address indexed from, address indexed to, uint256 amount)',\n * ])\n */\nexport function parseAbi(signatures) {\n const structs = parseStructs(signatures);\n const abi = [];\n const length = signatures.length;\n for (let i = 0; i < length; i++) {\n const signature = signatures[i];\n if (isStructSignature(signature))\n continue;\n abi.push(parseSignature(signature, structs));\n }\n return abi;\n}\n//# sourceMappingURL=parseAbi.js.map","/**\n * Retrieves and returns an action from the client (if exists), and falls\n * back to the tree-shakable action.\n *\n * Useful for extracting overridden actions from a client (ie. if a consumer\n * wants to override the `sendTransaction` implementation).\n */\nexport function getAction(client, actionFn, \n// Some minifiers drop `Function.prototype.name`, or replace it with short letters,\n// meaning that `actionFn.name` will not always work. For that case, the consumer\n// needs to pass the name explicitly.\nname) {\n const action_implicit = client[actionFn.name];\n if (typeof action_implicit === 'function')\n return action_implicit;\n const action_explicit = client[name];\n if (typeof action_explicit === 'function')\n return action_explicit;\n return (params) => actionFn(client, params);\n}\n//# sourceMappingURL=getAction.js.map","import { InvalidDefinitionTypeError, } from '../../errors/abi.js';\nexport function formatAbiItem(abiItem, { includeName = false } = {}) {\n if (abiItem.type !== 'function' &&\n abiItem.type !== 'event' &&\n abiItem.type !== 'error')\n throw new InvalidDefinitionTypeError(abiItem.type);\n return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;\n}\nexport function formatAbiParams(params, { includeName = false } = {}) {\n if (!params)\n return '';\n return params\n .map((param) => formatAbiParam(param, { includeName }))\n .join(includeName ? ', ' : ',');\n}\nfunction formatAbiParam(param, { includeName }) {\n if (param.type.startsWith('tuple')) {\n return `(${formatAbiParams(param.components, { includeName })})${param.type.slice('tuple'.length)}`;\n }\n return param.type + (includeName && param.name ? ` ${param.name}` : '');\n}\n//# sourceMappingURL=formatAbiItem.js.map","export function isHex(value, { strict = true } = {}) {\n if (!value)\n return false;\n if (typeof value !== 'string')\n return false;\n return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith('0x');\n}\n//# sourceMappingURL=isHex.js.map","import { isHex } from './isHex.js';\n/**\n * @description Retrieves the size of the value (in bytes).\n *\n * @param value The value (hex or byte array) to retrieve the size of.\n * @returns The size of the value (in bytes).\n */\nexport function size(value) {\n if (isHex(value, { strict: false }))\n return Math.ceil((value.length - 2) / 2);\n return value.length;\n}\n//# sourceMappingURL=size.js.map","export const version = '2.38.3';\n//# sourceMappingURL=version.js.map","import { version } from './version.js';\nlet errorConfig = {\n getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath\n ? `${docsBaseUrl ?? 'https://viem.sh'}${docsPath}${docsSlug ? `#${docsSlug}` : ''}`\n : undefined,\n version: `viem@${version}`,\n};\nexport function setErrorConfig(config) {\n errorConfig = config;\n}\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n const details = (() => {\n if (args.cause instanceof BaseError)\n return args.cause.details;\n if (args.cause?.message)\n return args.cause.message;\n return args.details;\n })();\n const docsPath = (() => {\n if (args.cause instanceof BaseError)\n return args.cause.docsPath || args.docsPath;\n return args.docsPath;\n })();\n const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath });\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsUrl ? [`Docs: ${docsUrl}`] : []),\n ...(details ? [`Details: ${details}`] : []),\n ...(errorConfig.version ? [`Version: ${errorConfig.version}`] : []),\n ].join('\\n');\n super(message, args.cause ? { cause: args.cause } : undefined);\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'BaseError'\n });\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.name = args.name ?? this.name;\n this.shortMessage = shortMessage;\n this.version = version;\n }\n walk(fn) {\n return walk(this, fn);\n }\n}\nfunction walk(err, fn) {\n if (fn?.(err))\n return err;\n if (err &&\n typeof err === 'object' &&\n 'cause' in err &&\n err.cause !== undefined)\n return walk(err.cause, fn);\n return fn ? null : err;\n}\n//# sourceMappingURL=base.js.map","import { formatAbiItem, formatAbiParams } from '../utils/abi/formatAbiItem.js';\nimport { size } from '../utils/data/size.js';\nimport { BaseError } from './base.js';\nexport class AbiConstructorNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'A constructor was not found on the ABI.',\n 'Make sure you are using the correct ABI and that the constructor exists on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiConstructorNotFoundError',\n });\n }\n}\nexport class AbiConstructorParamsNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.',\n 'Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiConstructorParamsNotFoundError',\n });\n }\n}\nexport class AbiDecodingDataSizeInvalidError extends BaseError {\n constructor({ data, size }) {\n super([\n `Data size of ${size} bytes is invalid.`,\n 'Size must be in increments of 32 bytes (size % 32 === 0).',\n ].join('\\n'), {\n metaMessages: [`Data: ${data} (${size} bytes)`],\n name: 'AbiDecodingDataSizeInvalidError',\n });\n }\n}\nexport class AbiDecodingDataSizeTooSmallError extends BaseError {\n constructor({ data, params, size, }) {\n super([`Data size of ${size} bytes is too small for given parameters.`].join('\\n'), {\n metaMessages: [\n `Params: (${formatAbiParams(params, { includeName: true })})`,\n `Data: ${data} (${size} bytes)`,\n ],\n name: 'AbiDecodingDataSizeTooSmallError',\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"params\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"size\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n this.params = params;\n this.size = size;\n }\n}\nexport class AbiDecodingZeroDataError extends BaseError {\n constructor() {\n super('Cannot decode zero data (\"0x\") with ABI parameters.', {\n name: 'AbiDecodingZeroDataError',\n });\n }\n}\nexport class AbiEncodingArrayLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, type, }) {\n super([\n `ABI encoding array length mismatch for type ${type}.`,\n `Expected length: ${expectedLength}`,\n `Given length: ${givenLength}`,\n ].join('\\n'), { name: 'AbiEncodingArrayLengthMismatchError' });\n }\n}\nexport class AbiEncodingBytesSizeMismatchError extends BaseError {\n constructor({ expectedSize, value }) {\n super(`Size of bytes \"${value}\" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`, { name: 'AbiEncodingBytesSizeMismatchError' });\n }\n}\nexport class AbiEncodingLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, }) {\n super([\n 'ABI encoding params/values length mismatch.',\n `Expected length (params): ${expectedLength}`,\n `Given length (values): ${givenLength}`,\n ].join('\\n'), { name: 'AbiEncodingLengthMismatchError' });\n }\n}\nexport class AbiErrorInputsNotFoundError extends BaseError {\n constructor(errorName, { docsPath }) {\n super([\n `Arguments (\\`args\\`) were provided to \"${errorName}\", but \"${errorName}\" on the ABI does not contain any parameters (\\`inputs\\`).`,\n 'Cannot encode error result without knowing what the parameter types are.',\n 'Make sure you are using the correct ABI and that the inputs exist on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiErrorInputsNotFoundError',\n });\n }\n}\nexport class AbiErrorNotFoundError extends BaseError {\n constructor(errorName, { docsPath } = {}) {\n super([\n `Error ${errorName ? `\"${errorName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiErrorNotFoundError',\n });\n }\n}\nexport class AbiErrorSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded error signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n name: 'AbiErrorSignatureNotFoundError',\n });\n Object.defineProperty(this, \"signature\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.signature = signature;\n }\n}\nexport class AbiEventSignatureEmptyTopicsError extends BaseError {\n constructor({ docsPath }) {\n super('Cannot extract event signature from empty topics.', {\n docsPath,\n name: 'AbiEventSignatureEmptyTopicsError',\n });\n }\n}\nexport class AbiEventSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded event signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the event exists on it.',\n `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n name: 'AbiEventSignatureNotFoundError',\n });\n }\n}\nexport class AbiEventNotFoundError extends BaseError {\n constructor(eventName, { docsPath } = {}) {\n super([\n `Event ${eventName ? `\"${eventName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the event exists on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiEventNotFoundError',\n });\n }\n}\nexport class AbiFunctionNotFoundError extends BaseError {\n constructor(functionName, { docsPath } = {}) {\n super([\n `Function ${functionName ? `\"${functionName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the function exists on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiFunctionNotFoundError',\n });\n }\n}\nexport class AbiFunctionOutputsNotFoundError extends BaseError {\n constructor(functionName, { docsPath }) {\n super([\n `Function \"${functionName}\" does not contain any \\`outputs\\` on ABI.`,\n 'Cannot decode function result without knowing what the parameter types are.',\n 'Make sure you are using the correct ABI and that the function exists on it.',\n ].join('\\n'), {\n docsPath,\n name: 'AbiFunctionOutputsNotFoundError',\n });\n }\n}\nexport class AbiFunctionSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded function signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the function exists on it.',\n `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n name: 'AbiFunctionSignatureNotFoundError',\n });\n }\n}\nexport class AbiItemAmbiguityError extends BaseError {\n constructor(x, y) {\n super('Found ambiguous types in overloaded ABI items.', {\n metaMessages: [\n `\\`${x.type}\\` in \\`${formatAbiItem(x.abiItem)}\\`, and`,\n `\\`${y.type}\\` in \\`${formatAbiItem(y.abiItem)}\\``,\n '',\n 'These types encode differently and cannot be distinguished at runtime.',\n 'Remove one of the ambiguous items in the ABI.',\n ],\n name: 'AbiItemAmbiguityError',\n });\n }\n}\nexport class BytesSizeMismatchError extends BaseError {\n constructor({ expectedSize, givenSize, }) {\n super(`Expected bytes${expectedSize}, got bytes${givenSize}.`, {\n name: 'BytesSizeMismatchError',\n });\n }\n}\nexport class DecodeLogDataMismatch extends BaseError {\n constructor({ abiItem, data, params, size, }) {\n super([\n `Data size of ${size} bytes is too small for non-indexed event parameters.`,\n ].join('\\n'), {\n metaMessages: [\n `Params: (${formatAbiParams(params, { includeName: true })})`,\n `Data: ${data} (${size} bytes)`,\n ],\n name: 'DecodeLogDataMismatch',\n });\n Object.defineProperty(this, \"abiItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"params\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"size\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.abiItem = abiItem;\n this.data = data;\n this.params = params;\n this.size = size;\n }\n}\nexport class DecodeLogTopicsMismatch extends BaseError {\n constructor({ abiItem, param, }) {\n super([\n `Expected a topic for indexed event parameter${param.name ? ` \"${param.name}\"` : ''} on event \"${formatAbiItem(abiItem, { includeName: true })}\".`,\n ].join('\\n'), { name: 'DecodeLogTopicsMismatch' });\n Object.defineProperty(this, \"abiItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.abiItem = abiItem;\n }\n}\nexport class InvalidAbiEncodingTypeError extends BaseError {\n constructor(type, { docsPath }) {\n super([\n `Type \"${type}\" is not a valid encoding type.`,\n 'Please provide a valid ABI type.',\n ].join('\\n'), { docsPath, name: 'InvalidAbiEncodingType' });\n }\n}\nexport class InvalidAbiDecodingTypeError extends BaseError {\n constructor(type, { docsPath }) {\n super([\n `Type \"${type}\" is not a valid decoding type.`,\n 'Please provide a valid ABI type.',\n ].join('\\n'), { docsPath, name: 'InvalidAbiDecodingType' });\n }\n}\nexport class InvalidArrayError extends BaseError {\n constructor(value) {\n super([`Value \"${value}\" is not a valid array.`].join('\\n'), {\n name: 'InvalidArrayError',\n });\n }\n}\nexport class InvalidDefinitionTypeError extends BaseError {\n constructor(type) {\n super([\n `\"${type}\" is not a valid definition type.`,\n 'Valid types: \"function\", \"event\", \"error\"',\n ].join('\\n'), { name: 'InvalidDefinitionTypeError' });\n }\n}\nexport class UnsupportedPackedAbiType extends BaseError {\n constructor(type) {\n super(`Type \"${type}\" is not supported for packed encoding.`, {\n name: 'UnsupportedPackedAbiType',\n });\n }\n}\n//# sourceMappingURL=abi.js.map","import { BaseError } from './base.js';\nexport class FilterTypeNotSupportedError extends BaseError {\n constructor(type) {\n super(`Filter type \"${type}\" is not supported.`, {\n name: 'FilterTypeNotSupportedError',\n });\n }\n}\n//# sourceMappingURL=log.js.map","import { BaseError } from './base.js';\nexport class SliceOffsetOutOfBoundsError extends BaseError {\n constructor({ offset, position, size, }) {\n super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \"${offset}\" is out-of-bounds (size: ${size}).`, { name: 'SliceOffsetOutOfBoundsError' });\n }\n}\nexport class SizeExceedsPaddingSizeError extends BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} size (${size}) exceeds padding size (${targetSize}).`, { name: 'SizeExceedsPaddingSizeError' });\n }\n}\nexport class InvalidBytesLengthError extends BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size} ${type} long.`, { name: 'InvalidBytesLengthError' });\n }\n}\n//# sourceMappingURL=data.js.map","import { SizeExceedsPaddingSizeError, } from '../../errors/data.js';\nexport function pad(hexOrBytes, { dir, size = 32 } = {}) {\n if (typeof hexOrBytes === 'string')\n return padHex(hexOrBytes, { dir, size });\n return padBytes(hexOrBytes, { dir, size });\n}\nexport function padHex(hex_, { dir, size = 32 } = {}) {\n if (size === null)\n return hex_;\n const hex = hex_.replace('0x', '');\n if (hex.length > size * 2)\n throw new SizeExceedsPaddingSizeError({\n size: Math.ceil(hex.length / 2),\n targetSize: size,\n type: 'hex',\n });\n return `0x${hex[dir === 'right' ? 'padEnd' : 'padStart'](size * 2, '0')}`;\n}\nexport function padBytes(bytes, { dir, size = 32 } = {}) {\n if (size === null)\n return bytes;\n if (bytes.length > size)\n throw new SizeExceedsPaddingSizeError({\n size: bytes.length,\n targetSize: size,\n type: 'bytes',\n });\n const paddedBytes = new Uint8Array(size);\n for (let i = 0; i < size; i++) {\n const padEnd = dir === 'right';\n paddedBytes[padEnd ? i : size - i - 1] =\n bytes[padEnd ? i : bytes.length - i - 1];\n }\n return paddedBytes;\n}\n//# sourceMappingURL=pad.js.map","import { BaseError } from './base.js';\nexport class IntegerOutOfRangeError extends BaseError {\n constructor({ max, min, signed, size, value, }) {\n super(`Number \"${value}\" is not in safe ${size ? `${size * 8}-bit ${signed ? 'signed' : 'unsigned'} ` : ''}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: 'IntegerOutOfRangeError' });\n }\n}\nexport class InvalidBytesBooleanError extends BaseError {\n constructor(bytes) {\n super(`Bytes value \"${bytes}\" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {\n name: 'InvalidBytesBooleanError',\n });\n }\n}\nexport class InvalidHexBooleanError extends BaseError {\n constructor(hex) {\n super(`Hex value \"${hex}\" is not a valid boolean. The hex value must be \"0x0\" (false) or \"0x1\" (true).`, { name: 'InvalidHexBooleanError' });\n }\n}\nexport class InvalidHexValueError extends BaseError {\n constructor(value) {\n super(`Hex value \"${value}\" is an odd length (${value.length}). It must be an even length.`, { name: 'InvalidHexValueError' });\n }\n}\nexport class SizeOverflowError extends BaseError {\n constructor({ givenSize, maxSize }) {\n super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: 'SizeOverflowError' });\n }\n}\n//# sourceMappingURL=encoding.js.map","export function trim(hexOrBytes, { dir = 'left' } = {}) {\n let data = typeof hexOrBytes === 'string' ? hexOrBytes.replace('0x', '') : hexOrBytes;\n let sliceLength = 0;\n for (let i = 0; i < data.length - 1; i++) {\n if (data[dir === 'left' ? i : data.length - i - 1].toString() === '0')\n sliceLength++;\n else\n break;\n }\n data =\n dir === 'left'\n ? data.slice(sliceLength)\n : data.slice(0, data.length - sliceLength);\n if (typeof hexOrBytes === 'string') {\n if (data.length === 1 && dir === 'right')\n data = `${data}0`;\n return `0x${data.length % 2 === 1 ? `0${data}` : data}`;\n }\n return data;\n}\n//# sourceMappingURL=trim.js.map","import { InvalidHexBooleanError, SizeOverflowError, } from '../../errors/encoding.js';\nimport { size as size_ } from '../data/size.js';\nimport { trim } from '../data/trim.js';\nimport { hexToBytes } from './toBytes.js';\nexport function assertSize(hexOrBytes, { size }) {\n if (size_(hexOrBytes) > size)\n throw new SizeOverflowError({\n givenSize: size_(hexOrBytes),\n maxSize: size,\n });\n}\n/**\n * Decodes a hex string into a string, number, bigint, boolean, or byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex\n * - Example: https://viem.sh/docs/utilities/fromHex#usage\n *\n * @param hex Hex string to decode.\n * @param toOrOpts Type to convert to or options.\n * @returns Decoded value.\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x1a4', 'number')\n * // 420\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c6421', 'string')\n * // 'Hello world'\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * to: 'string'\n * })\n * // 'Hello world'\n */\nexport function fromHex(hex, toOrOpts) {\n const opts = typeof toOrOpts === 'string' ? { to: toOrOpts } : toOrOpts;\n const to = opts.to;\n if (to === 'number')\n return hexToNumber(hex, opts);\n if (to === 'bigint')\n return hexToBigInt(hex, opts);\n if (to === 'string')\n return hexToString(hex, opts);\n if (to === 'boolean')\n return hexToBool(hex, opts);\n return hexToBytes(hex, opts);\n}\n/**\n * Decodes a hex value into a bigint.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextobigint\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns BigInt value.\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x1a4', { signed: true })\n * // 420n\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420n\n */\nexport function hexToBigInt(hex, opts = {}) {\n const { signed } = opts;\n if (opts.size)\n assertSize(hex, { size: opts.size });\n const value = BigInt(hex);\n if (!signed)\n return value;\n const size = (hex.length - 2) / 2;\n const max = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n if (value <= max)\n return value;\n return value - BigInt(`0x${'f'.padStart(size * 2, 'f')}`) - 1n;\n}\n/**\n * Decodes a hex value into a boolean.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextobool\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Boolean value.\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x01')\n * // true\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x0000000000000000000000000000000000000000000000000000000000000001', { size: 32 })\n * // true\n */\nexport function hexToBool(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = trim(hex);\n }\n if (trim(hex) === '0x00')\n return false;\n if (trim(hex) === '0x01')\n return true;\n throw new InvalidHexBooleanError(hex);\n}\n/**\n * Decodes a hex string into a number.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextonumber\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Number value.\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToNumber('0x1a4')\n * // 420\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420\n */\nexport function hexToNumber(hex, opts = {}) {\n return Number(hexToBigInt(hex, opts));\n}\n/**\n * Decodes a hex value into a UTF-8 string.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex#hextostring\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns String value.\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c6421')\n * // 'Hello world!'\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * })\n * // 'Hello world'\n */\nexport function hexToString(hex, opts = {}) {\n let bytes = hexToBytes(hex);\n if (opts.size) {\n assertSize(bytes, { size: opts.size });\n bytes = trim(bytes, { dir: 'right' });\n }\n return new TextDecoder().decode(bytes);\n}\n//# sourceMappingURL=fromHex.js.map","import { IntegerOutOfRangeError, } from '../../errors/encoding.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nconst hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, '0'));\n/**\n * Encodes a string, number, bigint, or ByteArray into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex\n * - Example: https://viem.sh/docs/utilities/toHex#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world')\n * // '0x48656c6c6f20776f726c6421'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex(420)\n * // '0x1a4'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world', { size: 32 })\n * // '0x48656c6c6f20776f726c64210000000000000000000000000000000000000000'\n */\nexport function toHex(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToHex(value, opts);\n if (typeof value === 'string') {\n return stringToHex(value, opts);\n }\n if (typeof value === 'boolean')\n return boolToHex(value, opts);\n return bytesToHex(value, opts);\n}\n/**\n * Encodes a boolean into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#booltohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true)\n * // '0x1'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(false)\n * // '0x0'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true, { size: 32 })\n * // '0x0000000000000000000000000000000000000000000000000000000000000001'\n */\nexport function boolToHex(value, opts = {}) {\n const hex = `0x${Number(value)}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a bytes array into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#bytestohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]), { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function bytesToHex(value, opts = {}) {\n let string = '';\n for (let i = 0; i < value.length; i++) {\n string += hexes[value[i]];\n }\n const hex = `0x${string}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { dir: 'right', size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a number or bigint into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#numbertohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420)\n * // '0x1a4'\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420, { size: 32 })\n * // '0x00000000000000000000000000000000000000000000000000000000000001a4'\n */\nexport function numberToHex(value_, opts = {}) {\n const { signed, size } = opts;\n const value = BigInt(value_);\n let maxValue;\n if (size) {\n if (signed)\n maxValue = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n else\n maxValue = 2n ** (BigInt(size) * 8n) - 1n;\n }\n else if (typeof value_ === 'number') {\n maxValue = BigInt(Number.MAX_SAFE_INTEGER);\n }\n const minValue = typeof maxValue === 'bigint' && signed ? -maxValue - 1n : 0;\n if ((maxValue && value > maxValue) || value < minValue) {\n const suffix = typeof value_ === 'bigint' ? 'n' : '';\n throw new IntegerOutOfRangeError({\n max: maxValue ? `${maxValue}${suffix}` : undefined,\n min: `${minValue}${suffix}`,\n signed,\n size,\n value: `${value_}${suffix}`,\n });\n }\n const hex = `0x${(signed && value < 0 ? (1n << BigInt(size * 8)) + BigInt(value) : value).toString(16)}`;\n if (size)\n return pad(hex, { size });\n return hex;\n}\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex#stringtohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!')\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!', { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function stringToHex(value_, opts = {}) {\n const value = encoder.encode(value_);\n return bytesToHex(value, opts);\n}\n//# sourceMappingURL=toHex.js.map","import { BaseError } from '../../errors/base.js';\nimport { isHex } from '../data/isHex.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nimport { numberToHex, } from './toHex.js';\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes\n * - Example: https://viem.sh/docs/utilities/toBytes#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes('Hello world')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function toBytes(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToBytes(value, opts);\n if (typeof value === 'boolean')\n return boolToBytes(value, opts);\n if (isHex(value))\n return hexToBytes(value, opts);\n return stringToBytes(value, opts);\n}\n/**\n * Encodes a boolean into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#booltobytes\n *\n * @param value Boolean value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true)\n * // Uint8Array([1])\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true, { size: 32 })\n * // Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])\n */\nexport function boolToBytes(value, opts = {}) {\n const bytes = new Uint8Array(1);\n bytes[0] = Number(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { size: opts.size });\n }\n return bytes;\n}\n// We use very optimized technique to convert hex string to byte array\nconst charCodeMap = {\n zero: 48,\n nine: 57,\n A: 65,\n F: 70,\n a: 97,\n f: 102,\n};\nfunction charCodeToBase16(char) {\n if (char >= charCodeMap.zero && char <= charCodeMap.nine)\n return char - charCodeMap.zero;\n if (char >= charCodeMap.A && char <= charCodeMap.F)\n return char - (charCodeMap.A - 10);\n if (char >= charCodeMap.a && char <= charCodeMap.f)\n return char - (charCodeMap.a - 10);\n return undefined;\n}\n/**\n * Encodes a hex string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#hextobytes\n *\n * @param hex Hex string to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function hexToBytes(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = pad(hex, { dir: 'right', size: opts.size });\n }\n let hexString = hex.slice(2);\n if (hexString.length % 2)\n hexString = `0${hexString}`;\n const length = hexString.length / 2;\n const bytes = new Uint8Array(length);\n for (let index = 0, j = 0; index < length; index++) {\n const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));\n const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));\n if (nibbleLeft === undefined || nibbleRight === undefined) {\n throw new BaseError(`Invalid byte sequence (\"${hexString[j - 2]}${hexString[j - 1]}\" in \"${hexString}\").`);\n }\n bytes[index] = nibbleLeft * 16 + nibbleRight;\n }\n return bytes;\n}\n/**\n * Encodes a number into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#numbertobytes\n *\n * @param value Number to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function numberToBytes(value, opts) {\n const hex = numberToHex(value, opts);\n return hexToBytes(hex);\n}\n/**\n * Encodes a UTF-8 string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes#stringtobytes\n *\n * @param value String to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33])\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function stringToBytes(value, opts = {}) {\n const bytes = encoder.encode(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { dir: 'right', size: opts.size });\n }\n return bytes;\n}\n//# sourceMappingURL=toBytes.js.map","/**\n * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.\n * @todo re-check https://issues.chromium.org/issues/42212588\n * @module\n */\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is positive integer. */\nexport function anumber(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error('positive integer expected, got ' + n);\n}\n/** Asserts something is Uint8Array. */\nexport function abytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n/** Asserts something is hash */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out, instance) {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/** The byte swap operation for uint32 */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n);\n/** @deprecated */\nexport const byteSwapIfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin)\n return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async () => { };\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes) {\n return new TextDecoder().decode(bytes);\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new Error('options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\n/** For runtime check if class implements interface */\nexport class Hash {\n}\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function createOptHasher(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function createXOFer(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport const wrapConstructor = createHasher;\nexport const wrapConstructorWithOpts = createOptHasher;\nexport const wrapXOFConstructorWithOpts = createXOFer;\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n // Legacy Node.js compatibility\n if (crypto && typeof crypto.randomBytes === 'function') {\n return Uint8Array.from(crypto.randomBytes(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf),\n * [Website](https://keccak.team/keccak.html),\n * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub).\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from \"./_u64.js\";\n// prettier-ignore\nimport { abytes, aexists, anumber, aoutput, clean, createHasher, createXOFer, Hash, swap32IfBE, toBytes, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = [];\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n/** `keccakf1600` internal function, additionally allows to adjust round count. */\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/** Keccak sponge function. */\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n this.enableXOF = false;\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n // 0 < blockLen < 200\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('only keccak-f1600 function is supported');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { blockLen, state } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));\n/** SHA3-224 hash function. */\nexport const sha3_224 = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))();\n/** SHA3-256 hash function. Different from keccak-256. */\nexport const sha3_256 = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))();\n/** SHA3-384 hash function. */\nexport const sha3_384 = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))();\n/** SHA3-512 hash function. */\nexport const sha3_512 = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))();\n/** keccak-224 hash function. */\nexport const keccak_224 = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))();\n/** keccak-256 hash function. Different from SHA3-256. */\nexport const keccak_256 = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))();\n/** keccak-384 hash function. */\nexport const keccak_384 = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))();\n/** keccak-512 hash function. */\nexport const keccak_512 = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))();\nconst genShake = (suffix, blockLen, outputLen) => createXOFer((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\n/** SHAKE128 XOF with 128-bit security. */\nexport const shake128 = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))();\n/** SHAKE256 XOF with 256-bit security. */\nexport const shake256 = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))();\n//# sourceMappingURL=sha3.js.map","import { keccak_256 } from '@noble/hashes/sha3';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function keccak256(value, to_) {\n const to = to_ || 'hex';\n const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=keccak256.js.map","import { toBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from './keccak256.js';\nconst hash = (value) => keccak256(toBytes(value));\nexport function hashSignature(sig) {\n return hash(sig);\n}\n//# sourceMappingURL=hashSignature.js.map","import { formatAbiItem } from 'abitype';\nimport { normalizeSignature, } from './normalizeSignature.js';\n/**\n * Returns the signature for a given function or event definition.\n *\n * @example\n * const signature = toSignature('function ownerOf(uint256 tokenId)')\n * // 'ownerOf(uint256)'\n *\n * @example\n * const signature_3 = toSignature({\n * name: 'ownerOf',\n * type: 'function',\n * inputs: [{ name: 'tokenId', type: 'uint256' }],\n * outputs: [],\n * stateMutability: 'view',\n * })\n * // 'ownerOf(uint256)'\n */\nexport const toSignature = (def) => {\n const def_ = (() => {\n if (typeof def === 'string')\n return def;\n return formatAbiItem(def);\n })();\n return normalizeSignature(def_);\n};\n//# sourceMappingURL=toSignature.js.map","import { formatAbiParameters, } from './formatAbiParameters.js';\n/**\n * Formats ABI item (e.g. error, event, function) into human-readable ABI item\n *\n * @param abiItem - ABI item\n * @returns Human-readable ABI item\n */\nexport function formatAbiItem(abiItem) {\n if (abiItem.type === 'function')\n return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== 'nonpayable'\n ? ` ${abiItem.stateMutability}`\n : ''}${abiItem.outputs?.length\n ? ` returns (${formatAbiParameters(abiItem.outputs)})`\n : ''}`;\n if (abiItem.type === 'event')\n return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;\n if (abiItem.type === 'error')\n return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;\n if (abiItem.type === 'constructor')\n return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === 'payable' ? ' payable' : ''}`;\n if (abiItem.type === 'fallback')\n return `fallback() external${abiItem.stateMutability === 'payable' ? ' payable' : ''}`;\n return 'receive() external payable';\n}\n//# sourceMappingURL=formatAbiItem.js.map","import { BaseError } from '../../errors/base.js';\nexport function normalizeSignature(signature) {\n let active = true;\n let current = '';\n let level = 0;\n let result = '';\n let valid = false;\n for (let i = 0; i < signature.length; i++) {\n const char = signature[i];\n // If the character is a separator, we want to reactivate.\n if (['(', ')', ','].includes(char))\n active = true;\n // If the character is a \"level\" token, we want to increment/decrement.\n if (char === '(')\n level++;\n if (char === ')')\n level--;\n // If we aren't active, we don't want to mutate the result.\n if (!active)\n continue;\n // If level === 0, we are at the definition level.\n if (level === 0) {\n if (char === ' ' && ['event', 'function', ''].includes(result))\n result = '';\n else {\n result += char;\n // If we are at the end of the definition, we must be finished.\n if (char === ')') {\n valid = true;\n break;\n }\n }\n continue;\n }\n // Ignore spaces\n if (char === ' ') {\n // If the previous character is a separator, and the current section isn't empty, we want to deactivate.\n if (signature[i - 1] !== ',' && current !== ',' && current !== ',(') {\n current = '';\n active = false;\n }\n continue;\n }\n result += char;\n current += char;\n }\n if (!valid)\n throw new BaseError('Unable to normalize signature.');\n return result;\n}\n//# sourceMappingURL=normalizeSignature.js.map","import { hashSignature } from './hashSignature.js';\nimport { toSignature } from './toSignature.js';\n/**\n * Returns the hash (of the function/event signature) for a given event or function definition.\n */\nexport function toSignatureHash(fn) {\n return hashSignature(toSignature(fn));\n}\n//# sourceMappingURL=toSignatureHash.js.map","import { toSignatureHash, } from './toSignatureHash.js';\n/**\n * Returns the event selector for a given event definition.\n *\n * @example\n * const selector = toEventSelector('Transfer(address indexed from, address indexed to, uint256 amount)')\n * // 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\n */\nexport const toEventSelector = toSignatureHash;\n//# sourceMappingURL=toEventSelector.js.map","import { BaseError } from './base.js';\nexport class InvalidAddressError extends BaseError {\n constructor({ address }) {\n super(`Address \"${address}\" is invalid.`, {\n metaMessages: [\n '- Address must be a hex value of 20 bytes (40 hex characters).',\n '- Address must match its checksum counterpart.',\n ],\n name: 'InvalidAddressError',\n });\n }\n}\n//# sourceMappingURL=address.js.map","/**\n * Map with a LRU (Least recently used) policy.\n *\n * @link https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU\n */\nexport class LruMap extends Map {\n constructor(size) {\n super();\n Object.defineProperty(this, \"maxSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.maxSize = size;\n }\n get(key) {\n const value = super.get(key);\n if (super.has(key) && value !== undefined) {\n this.delete(key);\n super.set(key, value);\n }\n return value;\n }\n set(key, value) {\n super.set(key, value);\n if (this.maxSize && this.size > this.maxSize) {\n const firstKey = this.keys().next().value;\n if (firstKey)\n this.delete(firstKey);\n }\n return this;\n }\n}\n//# sourceMappingURL=lru.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { stringToBytes, } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { LruMap } from '../lru.js';\nimport { isAddress } from './isAddress.js';\nconst checksumAddressCache = /*#__PURE__*/ new LruMap(8192);\nexport function checksumAddress(address_, \n/**\n * Warning: EIP-1191 checksum addresses are generally not backwards compatible with the\n * wider Ethereum ecosystem, meaning it will break when validated against an application/tool\n * that relies on EIP-55 checksum encoding (checksum without chainId).\n *\n * It is highly recommended to not use this feature unless you\n * know what you are doing.\n *\n * See more: https://github.com/ethereum/EIPs/issues/1121\n */\nchainId) {\n if (checksumAddressCache.has(`${address_}.${chainId}`))\n return checksumAddressCache.get(`${address_}.${chainId}`);\n const hexAddress = chainId\n ? `${chainId}${address_.toLowerCase()}`\n : address_.substring(2).toLowerCase();\n const hash = keccak256(stringToBytes(hexAddress), 'bytes');\n const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split('');\n for (let i = 0; i < 40; i += 2) {\n if (hash[i >> 1] >> 4 >= 8 && address[i]) {\n address[i] = address[i].toUpperCase();\n }\n if ((hash[i >> 1] & 0x0f) >= 8 && address[i + 1]) {\n address[i + 1] = address[i + 1].toUpperCase();\n }\n }\n const result = `0x${address.join('')}`;\n checksumAddressCache.set(`${address_}.${chainId}`, result);\n return result;\n}\nexport function getAddress(address, \n/**\n * Warning: EIP-1191 checksum addresses are generally not backwards compatible with the\n * wider Ethereum ecosystem, meaning it will break when validated against an application/tool\n * that relies on EIP-55 checksum encoding (checksum without chainId).\n *\n * It is highly recommended to not use this feature unless you\n * know what you are doing.\n *\n * See more: https://github.com/ethereum/EIPs/issues/1121\n */\nchainId) {\n if (!isAddress(address, { strict: false }))\n throw new InvalidAddressError({ address });\n return checksumAddress(address, chainId);\n}\n//# sourceMappingURL=getAddress.js.map","import { LruMap } from '../lru.js';\nimport { checksumAddress } from './getAddress.js';\nconst addressRegex = /^0x[a-fA-F0-9]{40}$/;\n/** @internal */\nexport const isAddressCache = /*#__PURE__*/ new LruMap(8192);\nexport function isAddress(address, options) {\n const { strict = true } = options ?? {};\n const cacheKey = `${address}.${strict}`;\n if (isAddressCache.has(cacheKey))\n return isAddressCache.get(cacheKey);\n const result = (() => {\n if (!addressRegex.test(address))\n return false;\n if (address.toLowerCase() === address)\n return true;\n if (strict)\n return checksumAddress(address) === address;\n return true;\n })();\n isAddressCache.set(cacheKey, result);\n return result;\n}\n//# sourceMappingURL=isAddress.js.map","export function concat(values) {\n if (typeof values[0] === 'string')\n return concatHex(values);\n return concatBytes(values);\n}\nexport function concatBytes(values) {\n let length = 0;\n for (const arr of values) {\n length += arr.length;\n }\n const result = new Uint8Array(length);\n let offset = 0;\n for (const arr of values) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n}\nexport function concatHex(values) {\n return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}`;\n}\n//# sourceMappingURL=concat.js.map","import { SliceOffsetOutOfBoundsError, } from '../../errors/data.js';\nimport { isHex } from './isHex.js';\nimport { size } from './size.js';\n/**\n * @description Returns a section of the hex or byte array given a start/end bytes offset.\n *\n * @param value The hex or byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function slice(value, start, end, { strict } = {}) {\n if (isHex(value, { strict: false }))\n return sliceHex(value, start, end, {\n strict,\n });\n return sliceBytes(value, start, end, {\n strict,\n });\n}\nfunction assertStartOffset(value, start) {\n if (typeof start === 'number' && start > 0 && start > size(value) - 1)\n throw new SliceOffsetOutOfBoundsError({\n offset: start,\n position: 'start',\n size: size(value),\n });\n}\nfunction assertEndOffset(value, start, end) {\n if (typeof start === 'number' &&\n typeof end === 'number' &&\n size(value) !== end - start) {\n throw new SliceOffsetOutOfBoundsError({\n offset: end,\n position: 'end',\n size: size(value),\n });\n }\n}\n/**\n * @description Returns a section of the byte array given a start/end bytes offset.\n *\n * @param value The byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceBytes(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = value_.slice(start, end);\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n/**\n * @description Returns a section of the hex value given a start/end bytes offset.\n *\n * @param value The hex value to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceHex(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = `0x${value_\n .replace('0x', '')\n .slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n//# sourceMappingURL=slice.js.map","export const arrayRegex = /^(.*)\\[([0-9]*)\\]$/;\n// `bytes<M>`: binary type of `M` bytes, `0 < M <= 32`\n// https://regexr.com/6va55\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\n// `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n// https://regexr.com/6v8hp\nexport const integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\n//# sourceMappingURL=regex.js.map","import { AbiEncodingArrayLengthMismatchError, AbiEncodingBytesSizeMismatchError, AbiEncodingLengthMismatchError, InvalidAbiEncodingTypeError, InvalidArrayError, } from '../../errors/abi.js';\nimport { InvalidAddressError, } from '../../errors/address.js';\nimport { BaseError } from '../../errors/base.js';\nimport { IntegerOutOfRangeError } from '../../errors/encoding.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { concat } from '../data/concat.js';\nimport { padHex } from '../data/pad.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { boolToHex, numberToHex, stringToHex, } from '../encoding/toHex.js';\nimport { integerRegex } from '../regex.js';\n/**\n * @description Encodes a list of primitive values into an ABI-encoded hex value.\n *\n * - Docs: https://viem.sh/docs/abi/encodeAbiParameters#encodeabiparameters\n *\n * Generates ABI encoded data using the [ABI specification](https://docs.soliditylang.org/en/latest/abi-spec), given a set of ABI parameters (inputs/outputs) and their corresponding values.\n *\n * @param params - a set of ABI Parameters (params), that can be in the shape of the inputs or outputs attribute of an ABI Item.\n * @param values - a set of values (values) that correspond to the given params.\n * @example\n * ```typescript\n * import { encodeAbiParameters } from 'viem'\n *\n * const encodedData = encodeAbiParameters(\n * [\n * { name: 'x', type: 'string' },\n * { name: 'y', type: 'uint' },\n * { name: 'z', type: 'bool' }\n * ],\n * ['wagmi', 420n, true]\n * )\n * ```\n *\n * You can also pass in Human Readable parameters with the parseAbiParameters utility.\n *\n * @example\n * ```typescript\n * import { encodeAbiParameters, parseAbiParameters } from 'viem'\n *\n * const encodedData = encodeAbiParameters(\n * parseAbiParameters('string x, uint y, bool z'),\n * ['wagmi', 420n, true]\n * )\n * ```\n */\nexport function encodeAbiParameters(params, values) {\n if (params.length !== values.length)\n throw new AbiEncodingLengthMismatchError({\n expectedLength: params.length,\n givenLength: values.length,\n });\n // Prepare the parameters to determine dynamic types to encode.\n const preparedParams = prepareParams({\n params: params,\n values: values,\n });\n const data = encodeParams(preparedParams);\n if (data.length === 0)\n return '0x';\n return data;\n}\nfunction prepareParams({ params, values, }) {\n const preparedParams = [];\n for (let i = 0; i < params.length; i++) {\n preparedParams.push(prepareParam({ param: params[i], value: values[i] }));\n }\n return preparedParams;\n}\nfunction prepareParam({ param, value, }) {\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return encodeArray(value, { length, param: { ...param, type } });\n }\n if (param.type === 'tuple') {\n return encodeTuple(value, {\n param: param,\n });\n }\n if (param.type === 'address') {\n return encodeAddress(value);\n }\n if (param.type === 'bool') {\n return encodeBool(value);\n }\n if (param.type.startsWith('uint') || param.type.startsWith('int')) {\n const signed = param.type.startsWith('int');\n const [, , size = '256'] = integerRegex.exec(param.type) ?? [];\n return encodeNumber(value, {\n signed,\n size: Number(size),\n });\n }\n if (param.type.startsWith('bytes')) {\n return encodeBytes(value, { param });\n }\n if (param.type === 'string') {\n return encodeString(value);\n }\n throw new InvalidAbiEncodingTypeError(param.type, {\n docsPath: '/docs/contract/encodeAbiParameters',\n });\n}\nfunction encodeParams(preparedParams) {\n // 1. Compute the size of the static part of the parameters.\n let staticSize = 0;\n for (let i = 0; i < preparedParams.length; i++) {\n const { dynamic, encoded } = preparedParams[i];\n if (dynamic)\n staticSize += 32;\n else\n staticSize += size(encoded);\n }\n // 2. Split the parameters into static and dynamic parts.\n const staticParams = [];\n const dynamicParams = [];\n let dynamicSize = 0;\n for (let i = 0; i < preparedParams.length; i++) {\n const { dynamic, encoded } = preparedParams[i];\n if (dynamic) {\n staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));\n dynamicParams.push(encoded);\n dynamicSize += size(encoded);\n }\n else {\n staticParams.push(encoded);\n }\n }\n // 3. Concatenate static and dynamic parts.\n return concat([...staticParams, ...dynamicParams]);\n}\nfunction encodeAddress(value) {\n if (!isAddress(value))\n throw new InvalidAddressError({ address: value });\n return { dynamic: false, encoded: padHex(value.toLowerCase()) };\n}\nfunction encodeArray(value, { length, param, }) {\n const dynamic = length === null;\n if (!Array.isArray(value))\n throw new InvalidArrayError(value);\n if (!dynamic && value.length !== length)\n throw new AbiEncodingArrayLengthMismatchError({\n expectedLength: length,\n givenLength: value.length,\n type: `${param.type}[${length}]`,\n });\n let dynamicChild = false;\n const preparedParams = [];\n for (let i = 0; i < value.length; i++) {\n const preparedParam = prepareParam({ param, value: value[i] });\n if (preparedParam.dynamic)\n dynamicChild = true;\n preparedParams.push(preparedParam);\n }\n if (dynamic || dynamicChild) {\n const data = encodeParams(preparedParams);\n if (dynamic) {\n const length = numberToHex(preparedParams.length, { size: 32 });\n return {\n dynamic: true,\n encoded: preparedParams.length > 0 ? concat([length, data]) : length,\n };\n }\n if (dynamicChild)\n return { dynamic: true, encoded: data };\n }\n return {\n dynamic: false,\n encoded: concat(preparedParams.map(({ encoded }) => encoded)),\n };\n}\nfunction encodeBytes(value, { param }) {\n const [, paramSize] = param.type.split('bytes');\n const bytesSize = size(value);\n if (!paramSize) {\n let value_ = value;\n // If the size is not divisible by 32 bytes, pad the end\n // with empty bytes to the ceiling 32 bytes.\n if (bytesSize % 32 !== 0)\n value_ = padHex(value_, {\n dir: 'right',\n size: Math.ceil((value.length - 2) / 2 / 32) * 32,\n });\n return {\n dynamic: true,\n encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_]),\n };\n }\n if (bytesSize !== Number.parseInt(paramSize, 10))\n throw new AbiEncodingBytesSizeMismatchError({\n expectedSize: Number.parseInt(paramSize, 10),\n value,\n });\n return { dynamic: false, encoded: padHex(value, { dir: 'right' }) };\n}\nfunction encodeBool(value) {\n if (typeof value !== 'boolean')\n throw new BaseError(`Invalid boolean value: \"${value}\" (type: ${typeof value}). Expected: \\`true\\` or \\`false\\`.`);\n return { dynamic: false, encoded: padHex(boolToHex(value)) };\n}\nfunction encodeNumber(value, { signed, size = 256 }) {\n if (typeof size === 'number') {\n const max = 2n ** (BigInt(size) - (signed ? 1n : 0n)) - 1n;\n const min = signed ? -max - 1n : 0n;\n if (value > max || value < min)\n throw new IntegerOutOfRangeError({\n max: max.toString(),\n min: min.toString(),\n signed,\n size: size / 8,\n value: value.toString(),\n });\n }\n return {\n dynamic: false,\n encoded: numberToHex(value, {\n size: 32,\n signed,\n }),\n };\n}\nfunction encodeString(value) {\n const hexValue = stringToHex(value);\n const partsLength = Math.ceil(size(hexValue) / 32);\n const parts = [];\n for (let i = 0; i < partsLength; i++) {\n parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {\n dir: 'right',\n }));\n }\n return {\n dynamic: true,\n encoded: concat([\n padHex(numberToHex(size(hexValue), { size: 32 })),\n ...parts,\n ]),\n };\n}\nfunction encodeTuple(value, { param }) {\n let dynamic = false;\n const preparedParams = [];\n for (let i = 0; i < param.components.length; i++) {\n const param_ = param.components[i];\n const index = Array.isArray(value) ? i : param_.name;\n const preparedParam = prepareParam({\n param: param_,\n value: value[index],\n });\n preparedParams.push(preparedParam);\n if (preparedParam.dynamic)\n dynamic = true;\n }\n return {\n dynamic,\n encoded: dynamic\n ? encodeParams(preparedParams)\n : concat(preparedParams.map(({ encoded }) => encoded)),\n };\n}\nexport function getArrayComponents(type) {\n const matches = type.match(/^(.*)\\[(\\d+)?\\]$/);\n return matches\n ? // Return `null` if the array is dynamic.\n [matches[2] ? Number(matches[2]) : null, matches[1]]\n : undefined;\n}\n//# sourceMappingURL=encodeAbiParameters.js.map","import { slice } from '../data/slice.js';\nimport { toSignatureHash, } from './toSignatureHash.js';\n/**\n * Returns the function selector for a given function definition.\n *\n * @example\n * const selector = toFunctionSelector('function ownerOf(uint256 tokenId)')\n * // 0x6352211e\n */\nexport const toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);\n//# sourceMappingURL=toFunctionSelector.js.map","import { AbiItemAmbiguityError, } from '../../errors/abi.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { toEventSelector } from '../hash/toEventSelector.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nexport function getAbiItem(parameters) {\n const { abi, args = [], name } = parameters;\n const isSelector = isHex(name, { strict: false });\n const abiItems = abi.filter((abiItem) => {\n if (isSelector) {\n if (abiItem.type === 'function')\n return toFunctionSelector(abiItem) === name;\n if (abiItem.type === 'event')\n return toEventSelector(abiItem) === name;\n return false;\n }\n return 'name' in abiItem && abiItem.name === name;\n });\n if (abiItems.length === 0)\n return undefined;\n if (abiItems.length === 1)\n return abiItems[0];\n let matchedAbiItem;\n for (const abiItem of abiItems) {\n if (!('inputs' in abiItem))\n continue;\n if (!args || args.length === 0) {\n if (!abiItem.inputs || abiItem.inputs.length === 0)\n return abiItem;\n continue;\n }\n if (!abiItem.inputs)\n continue;\n if (abiItem.inputs.length === 0)\n continue;\n if (abiItem.inputs.length !== args.length)\n continue;\n const matched = args.every((arg, index) => {\n const abiParameter = 'inputs' in abiItem && abiItem.inputs[index];\n if (!abiParameter)\n return false;\n return isArgOfType(arg, abiParameter);\n });\n if (matched) {\n // Check for ambiguity against already matched parameters (e.g. `address` vs `bytes20`).\n if (matchedAbiItem &&\n 'inputs' in matchedAbiItem &&\n matchedAbiItem.inputs) {\n const ambiguousTypes = getAmbiguousTypes(abiItem.inputs, matchedAbiItem.inputs, args);\n if (ambiguousTypes)\n throw new AbiItemAmbiguityError({\n abiItem,\n type: ambiguousTypes[0],\n }, {\n abiItem: matchedAbiItem,\n type: ambiguousTypes[1],\n });\n }\n matchedAbiItem = abiItem;\n }\n }\n if (matchedAbiItem)\n return matchedAbiItem;\n return abiItems[0];\n}\n/** @internal */\nexport function isArgOfType(arg, abiParameter) {\n const argType = typeof arg;\n const abiParameterType = abiParameter.type;\n switch (abiParameterType) {\n case 'address':\n return isAddress(arg, { strict: false });\n case 'bool':\n return argType === 'boolean';\n case 'function':\n return argType === 'string';\n case 'string':\n return argType === 'string';\n default: {\n if (abiParameterType === 'tuple' && 'components' in abiParameter)\n return Object.values(abiParameter.components).every((component, index) => {\n return isArgOfType(Object.values(arg)[index], component);\n });\n // `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n // https://regexr.com/6v8hp\n if (/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(abiParameterType))\n return argType === 'number' || argType === 'bigint';\n // `bytes<M>`: binary type of `M` bytes, `0 < M <= 32`\n // https://regexr.com/6va55\n if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType))\n return argType === 'string' || arg instanceof Uint8Array;\n // fixed-length (`<type>[M]`) and dynamic (`<type>[]`) arrays\n // https://regexr.com/6va6i\n if (/[a-z]+[1-9]{0,3}(\\[[0-9]{0,}\\])+$/.test(abiParameterType)) {\n return (Array.isArray(arg) &&\n arg.every((x) => isArgOfType(x, {\n ...abiParameter,\n // Pop off `[]` or `[M]` from end of type\n type: abiParameterType.replace(/(\\[[0-9]{0,}\\])$/, ''),\n })));\n }\n return false;\n }\n }\n}\n/** @internal */\nexport function getAmbiguousTypes(sourceParameters, targetParameters, args) {\n for (const parameterIndex in sourceParameters) {\n const sourceParameter = sourceParameters[parameterIndex];\n const targetParameter = targetParameters[parameterIndex];\n if (sourceParameter.type === 'tuple' &&\n targetParameter.type === 'tuple' &&\n 'components' in sourceParameter &&\n 'components' in targetParameter)\n return getAmbiguousTypes(sourceParameter.components, targetParameter.components, args[parameterIndex]);\n const types = [sourceParameter.type, targetParameter.type];\n const ambiguous = (() => {\n if (types.includes('address') && types.includes('bytes20'))\n return true;\n if (types.includes('address') && types.includes('string'))\n return isAddress(args[parameterIndex], { strict: false });\n if (types.includes('address') && types.includes('bytes'))\n return isAddress(args[parameterIndex], { strict: false });\n return false;\n })();\n if (ambiguous)\n return types;\n }\n return;\n}\n//# sourceMappingURL=getAbiItem.js.map","import { AbiEventNotFoundError, } from '../../errors/abi.js';\nimport { FilterTypeNotSupportedError, } from '../../errors/log.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { toEventSelector, } from '../hash/toEventSelector.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeEventTopics';\nexport function encodeEventTopics(parameters) {\n const { abi, eventName, args } = parameters;\n let abiItem = abi[0];\n if (eventName) {\n const item = getAbiItem({ abi, name: eventName });\n if (!item)\n throw new AbiEventNotFoundError(eventName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'event')\n throw new AbiEventNotFoundError(undefined, { docsPath });\n const definition = formatAbiItem(abiItem);\n const signature = toEventSelector(definition);\n let topics = [];\n if (args && 'inputs' in abiItem) {\n const indexedInputs = abiItem.inputs?.filter((param) => 'indexed' in param && param.indexed);\n const args_ = Array.isArray(args)\n ? args\n : Object.values(args).length > 0\n ? (indexedInputs?.map((x) => args[x.name]) ?? [])\n : [];\n if (args_.length > 0) {\n topics =\n indexedInputs?.map((param, i) => {\n if (Array.isArray(args_[i]))\n return args_[i].map((_, j) => encodeArg({ param, value: args_[i][j] }));\n return typeof args_[i] !== 'undefined' && args_[i] !== null\n ? encodeArg({ param, value: args_[i] })\n : null;\n }) ?? [];\n }\n }\n return [signature, ...topics];\n}\nfunction encodeArg({ param, value, }) {\n if (param.type === 'string' || param.type === 'bytes')\n return keccak256(toBytes(value));\n if (param.type === 'tuple' || param.type.match(/^(.*)\\[(\\d+)?\\]$/))\n throw new FilterTypeNotSupportedError(param.type);\n return encodeAbiParameters([param], [value]);\n}\n//# sourceMappingURL=encodeEventTopics.js.map","/**\n * Scopes `request` to the filter ID. If the client is a fallback, it will\n * listen for responses and scope the child transport `request` function\n * to the successful filter ID.\n */\nexport function createFilterRequestScope(client, { method }) {\n const requestMap = {};\n if (client.transport.type === 'fallback')\n client.transport.onResponse?.(({ method: method_, response: id, status, transport, }) => {\n if (status === 'success' && method === method_)\n requestMap[id] = transport.request;\n });\n return ((id) => requestMap[id] || client.request);\n}\n//# sourceMappingURL=createFilterRequestScope.js.map","import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs).\n *\n * - Docs: https://viem.sh/docs/contract/createContractEventFilter\n *\n * @param client - Client to use\n * @param parameters - {@link CreateContractEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateContractEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * })\n */\nexport async function createContractEventFilter(client, parameters) {\n const { address, abi, args, eventName, fromBlock, strict, toBlock } = parameters;\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n const topics = eventName\n ? encodeEventTopics({\n abi,\n args,\n eventName,\n })\n : undefined;\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n topics,\n },\n ],\n });\n return {\n abi,\n args,\n eventName,\n id,\n request: getRequest(id),\n strict: Boolean(strict),\n type: 'event',\n };\n}\n//# sourceMappingURL=createContractEventFilter.js.map","export function parseAccount(account) {\n if (typeof account === 'string')\n return { address: account, type: 'json-rpc' };\n return account;\n}\n//# sourceMappingURL=parseAccount.js.map","import { AbiFunctionNotFoundError, } from '../../errors/abi.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeFunctionData';\nexport function prepareEncodeFunctionData(parameters) {\n const { abi, args, functionName } = parameters;\n let abiItem = abi[0];\n if (functionName) {\n const item = getAbiItem({\n abi,\n args,\n name: functionName,\n });\n if (!item)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n return {\n abi: [abiItem],\n functionName: toFunctionSelector(formatAbiItem(abiItem)),\n };\n}\n//# sourceMappingURL=prepareEncodeFunctionData.js.map","import { concatHex } from '../data/concat.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { prepareEncodeFunctionData } from './prepareEncodeFunctionData.js';\nexport function encodeFunctionData(parameters) {\n const { args } = parameters;\n const { abi, functionName } = (() => {\n if (parameters.abi.length === 1 &&\n parameters.functionName?.startsWith('0x'))\n return parameters;\n return prepareEncodeFunctionData(parameters);\n })();\n const abiItem = abi[0];\n const signature = functionName;\n const data = 'inputs' in abiItem && abiItem.inputs\n ? encodeAbiParameters(abiItem.inputs, args ?? [])\n : undefined;\n return concatHex([signature, data ?? '0x']);\n}\n//# sourceMappingURL=encodeFunctionData.js.map","// https://docs.soliditylang.org/en/v0.8.16/control-structures.html#panic-via-assert-and-error-via-require\nexport const panicReasons = {\n 1: 'An `assert` condition failed.',\n 17: 'Arithmetic operation resulted in underflow or overflow.',\n 18: 'Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).',\n 33: 'Attempted to convert to an invalid type.',\n 34: 'Attempted to access a storage byte array that is incorrectly encoded.',\n 49: 'Performed `.pop()` on an empty array',\n 50: 'Array index is out of bounds.',\n 65: 'Allocated too much memory or created an array which is too large.',\n 81: 'Attempted to call a zero-initialized variable of internal function type.',\n};\nexport const solidityError = {\n inputs: [\n {\n name: 'message',\n type: 'string',\n },\n ],\n name: 'Error',\n type: 'error',\n};\nexport const solidityPanic = {\n inputs: [\n {\n name: 'reason',\n type: 'uint256',\n },\n ],\n name: 'Panic',\n type: 'error',\n};\n//# sourceMappingURL=solidity.js.map","import { BaseError } from './base.js';\nexport class NegativeOffsetError extends BaseError {\n constructor({ offset }) {\n super(`Offset \\`${offset}\\` cannot be negative.`, {\n name: 'NegativeOffsetError',\n });\n }\n}\nexport class PositionOutOfBoundsError extends BaseError {\n constructor({ length, position }) {\n super(`Position \\`${position}\\` is out of bounds (\\`0 < position < ${length}\\`).`, { name: 'PositionOutOfBoundsError' });\n }\n}\nexport class RecursiveReadLimitExceededError extends BaseError {\n constructor({ count, limit }) {\n super(`Recursive read limit of \\`${limit}\\` exceeded (recursive read count: \\`${count}\\`).`, { name: 'RecursiveReadLimitExceededError' });\n }\n}\n//# sourceMappingURL=cursor.js.map","import { NegativeOffsetError, PositionOutOfBoundsError, RecursiveReadLimitExceededError, } from '../errors/cursor.js';\nconst staticCursor = {\n bytes: new Uint8Array(),\n dataView: new DataView(new ArrayBuffer(0)),\n position: 0,\n positionReadCount: new Map(),\n recursiveReadCount: 0,\n recursiveReadLimit: Number.POSITIVE_INFINITY,\n assertReadLimit() {\n if (this.recursiveReadCount >= this.recursiveReadLimit)\n throw new RecursiveReadLimitExceededError({\n count: this.recursiveReadCount + 1,\n limit: this.recursiveReadLimit,\n });\n },\n assertPosition(position) {\n if (position < 0 || position > this.bytes.length - 1)\n throw new PositionOutOfBoundsError({\n length: this.bytes.length,\n position,\n });\n },\n decrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position - offset;\n this.assertPosition(position);\n this.position = position;\n },\n getReadCount(position) {\n return this.positionReadCount.get(position || this.position) || 0;\n },\n incrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position + offset;\n this.assertPosition(position);\n this.position = position;\n },\n inspectByte(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectBytes(length, position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + length - 1);\n return this.bytes.subarray(position, position + length);\n },\n inspectUint8(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectUint16(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 1);\n return this.dataView.getUint16(position);\n },\n inspectUint24(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 2);\n return ((this.dataView.getUint16(position) << 8) +\n this.dataView.getUint8(position + 2));\n },\n inspectUint32(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 3);\n return this.dataView.getUint32(position);\n },\n pushByte(byte) {\n this.assertPosition(this.position);\n this.bytes[this.position] = byte;\n this.position++;\n },\n pushBytes(bytes) {\n this.assertPosition(this.position + bytes.length - 1);\n this.bytes.set(bytes, this.position);\n this.position += bytes.length;\n },\n pushUint8(value) {\n this.assertPosition(this.position);\n this.bytes[this.position] = value;\n this.position++;\n },\n pushUint16(value) {\n this.assertPosition(this.position + 1);\n this.dataView.setUint16(this.position, value);\n this.position += 2;\n },\n pushUint24(value) {\n this.assertPosition(this.position + 2);\n this.dataView.setUint16(this.position, value >> 8);\n this.dataView.setUint8(this.position + 2, value & ~4294967040);\n this.position += 3;\n },\n pushUint32(value) {\n this.assertPosition(this.position + 3);\n this.dataView.setUint32(this.position, value);\n this.position += 4;\n },\n readByte() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectByte();\n this.position++;\n return value;\n },\n readBytes(length, size) {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectBytes(length);\n this.position += size ?? length;\n return value;\n },\n readUint8() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint8();\n this.position += 1;\n return value;\n },\n readUint16() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint16();\n this.position += 2;\n return value;\n },\n readUint24() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint24();\n this.position += 3;\n return value;\n },\n readUint32() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint32();\n this.position += 4;\n return value;\n },\n get remaining() {\n return this.bytes.length - this.position;\n },\n setPosition(position) {\n const oldPosition = this.position;\n this.assertPosition(position);\n this.position = position;\n return () => (this.position = oldPosition);\n },\n _touch() {\n if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)\n return;\n const count = this.getReadCount();\n this.positionReadCount.set(this.position, count + 1);\n if (count > 0)\n this.recursiveReadCount++;\n },\n};\nexport function createCursor(bytes, { recursiveReadLimit = 8_192 } = {}) {\n const cursor = Object.create(staticCursor);\n cursor.bytes = bytes;\n cursor.dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n cursor.positionReadCount = new Map();\n cursor.recursiveReadLimit = recursiveReadLimit;\n return cursor;\n}\n//# sourceMappingURL=cursor.js.map","import { InvalidBytesBooleanError } from '../../errors/encoding.js';\nimport { trim } from '../data/trim.js';\nimport { assertSize, hexToBigInt, hexToNumber, } from './fromHex.js';\nimport { bytesToHex } from './toHex.js';\n/**\n * Decodes a byte array into a UTF-8 string, hex value, number, bigint or boolean.\n *\n * - Docs: https://viem.sh/docs/utilities/fromBytes\n * - Example: https://viem.sh/docs/utilities/fromBytes#usage\n *\n * @param bytes Byte array to decode.\n * @param toOrOpts Type to convert to or options.\n * @returns Decoded value.\n *\n * @example\n * import { fromBytes } from 'viem'\n * const data = fromBytes(new Uint8Array([1, 164]), 'number')\n * // 420\n *\n * @example\n * import { fromBytes } from 'viem'\n * const data = fromBytes(\n * new Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]),\n * 'string'\n * )\n * // 'Hello world'\n */\nexport function fromBytes(bytes, toOrOpts) {\n const opts = typeof toOrOpts === 'string' ? { to: toOrOpts } : toOrOpts;\n const to = opts.to;\n if (to === 'number')\n return bytesToNumber(bytes, opts);\n if (to === 'bigint')\n return bytesToBigInt(bytes, opts);\n if (to === 'boolean')\n return bytesToBool(bytes, opts);\n if (to === 'string')\n return bytesToString(bytes, opts);\n return bytesToHex(bytes, opts);\n}\n/**\n * Decodes a byte array into a bigint.\n *\n * - Docs: https://viem.sh/docs/utilities/fromBytes#bytestobigint\n *\n * @param bytes Byte array to decode.\n * @param opts Options.\n * @returns BigInt value.\n *\n * @example\n * import { bytesToBigInt } from 'viem'\n * const data = bytesToBigInt(new Uint8Array([1, 164]))\n * // 420n\n */\nexport function bytesToBigInt(bytes, opts = {}) {\n if (typeof opts.size !== 'undefined')\n assertSize(bytes, { size: opts.size });\n const hex = bytesToHex(bytes, opts);\n return hexToBigInt(hex, opts);\n}\n/**\n * Decodes a byte array into a boolean.\n *\n * - Docs: https://viem.sh/docs/utilities/fromBytes#bytestobool\n *\n * @param bytes Byte array to decode.\n * @param opts Options.\n * @returns Boolean value.\n *\n * @example\n * import { bytesToBool } from 'viem'\n * const data = bytesToBool(new Uint8Array([1]))\n * // true\n */\nexport function bytesToBool(bytes_, opts = {}) {\n let bytes = bytes_;\n if (typeof opts.size !== 'undefined') {\n assertSize(bytes, { size: opts.size });\n bytes = trim(bytes);\n }\n if (bytes.length > 1 || bytes[0] > 1)\n throw new InvalidBytesBooleanError(bytes);\n return Boolean(bytes[0]);\n}\n/**\n * Decodes a byte array into a number.\n *\n * - Docs: https://viem.sh/docs/utilities/fromBytes#bytestonumber\n *\n * @param bytes Byte array to decode.\n * @param opts Options.\n * @returns Number value.\n *\n * @example\n * import { bytesToNumber } from 'viem'\n * const data = bytesToNumber(new Uint8Array([1, 164]))\n * // 420\n */\nexport function bytesToNumber(bytes, opts = {}) {\n if (typeof opts.size !== 'undefined')\n assertSize(bytes, { size: opts.size });\n const hex = bytesToHex(bytes, opts);\n return hexToNumber(hex, opts);\n}\n/**\n * Decodes a byte array into a UTF-8 string.\n *\n * - Docs: https://viem.sh/docs/utilities/fromBytes#bytestostring\n *\n * @param bytes Byte array to decode.\n * @param opts Options.\n * @returns String value.\n *\n * @example\n * import { bytesToString } from 'viem'\n * const data = bytesToString(new Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]))\n * // 'Hello world'\n */\nexport function bytesToString(bytes_, opts = {}) {\n let bytes = bytes_;\n if (typeof opts.size !== 'undefined') {\n assertSize(bytes, { size: opts.size });\n bytes = trim(bytes, { dir: 'right' });\n }\n return new TextDecoder().decode(bytes);\n}\n//# sourceMappingURL=fromBytes.js.map","import { AbiDecodingDataSizeTooSmallError, AbiDecodingZeroDataError, InvalidAbiDecodingTypeError, } from '../../errors/abi.js';\nimport { checksumAddress, } from '../address/getAddress.js';\nimport { createCursor, } from '../cursor.js';\nimport { size } from '../data/size.js';\nimport { sliceBytes } from '../data/slice.js';\nimport { trim } from '../data/trim.js';\nimport { bytesToBigInt, bytesToBool, bytesToNumber, bytesToString, } from '../encoding/fromBytes.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\nimport { getArrayComponents } from './encodeAbiParameters.js';\nexport function decodeAbiParameters(params, data) {\n const bytes = typeof data === 'string' ? hexToBytes(data) : data;\n const cursor = createCursor(bytes);\n if (size(bytes) === 0 && params.length > 0)\n throw new AbiDecodingZeroDataError();\n if (size(data) && size(data) < 32)\n throw new AbiDecodingDataSizeTooSmallError({\n data: typeof data === 'string' ? data : bytesToHex(data),\n params: params,\n size: size(data),\n });\n let consumed = 0;\n const values = [];\n for (let i = 0; i < params.length; ++i) {\n const param = params[i];\n cursor.setPosition(consumed);\n const [data, consumed_] = decodeParameter(cursor, param, {\n staticPosition: 0,\n });\n consumed += consumed_;\n values.push(data);\n }\n return values;\n}\nfunction decodeParameter(cursor, param, { staticPosition }) {\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return decodeArray(cursor, { ...param, type }, { length, staticPosition });\n }\n if (param.type === 'tuple')\n return decodeTuple(cursor, param, { staticPosition });\n if (param.type === 'address')\n return decodeAddress(cursor);\n if (param.type === 'bool')\n return decodeBool(cursor);\n if (param.type.startsWith('bytes'))\n return decodeBytes(cursor, param, { staticPosition });\n if (param.type.startsWith('uint') || param.type.startsWith('int'))\n return decodeNumber(cursor, param);\n if (param.type === 'string')\n return decodeString(cursor, { staticPosition });\n throw new InvalidAbiDecodingTypeError(param.type, {\n docsPath: '/docs/contract/decodeAbiParameters',\n });\n}\n////////////////////////////////////////////////////////////////////\n// Type Decoders\nconst sizeOfLength = 32;\nconst sizeOfOffset = 32;\nfunction decodeAddress(cursor) {\n const value = cursor.readBytes(32);\n return [checksumAddress(bytesToHex(sliceBytes(value, -20))), 32];\n}\nfunction decodeArray(cursor, param, { length, staticPosition }) {\n // If the length of the array is not known in advance (dynamic array),\n // this means we will need to wonder off to the pointer and decode.\n if (!length) {\n // Dealing with a dynamic type, so get the offset of the array data.\n const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));\n // Start is the static position of current slot + offset.\n const start = staticPosition + offset;\n const startOfData = start + sizeOfLength;\n // Get the length of the array from the offset.\n cursor.setPosition(start);\n const length = bytesToNumber(cursor.readBytes(sizeOfLength));\n // Check if the array has any dynamic children.\n const dynamicChild = hasDynamicChild(param);\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n // If any of the children is dynamic, then all elements will be offset pointer, thus size of one slot (32 bytes).\n // Otherwise, elements will be the size of their encoding (consumed bytes).\n cursor.setPosition(startOfData + (dynamicChild ? i * 32 : consumed));\n const [data, consumed_] = decodeParameter(cursor, param, {\n staticPosition: startOfData,\n });\n consumed += consumed_;\n value.push(data);\n }\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n }\n // If the length of the array is known in advance,\n // and the length of an element deeply nested in the array is not known,\n // we need to decode the offset of the array data.\n if (hasDynamicChild(param)) {\n // Dealing with dynamic types, so get the offset of the array data.\n const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));\n // Start is the static position of current slot + offset.\n const start = staticPosition + offset;\n const value = [];\n for (let i = 0; i < length; ++i) {\n // Move cursor along to the next slot (next offset pointer).\n cursor.setPosition(start + i * 32);\n const [data] = decodeParameter(cursor, param, {\n staticPosition: start,\n });\n value.push(data);\n }\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n }\n // If the length of the array is known in advance and the array is deeply static,\n // then we can just decode each element in sequence.\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const [data, consumed_] = decodeParameter(cursor, param, {\n staticPosition: staticPosition + consumed,\n });\n consumed += consumed_;\n value.push(data);\n }\n return [value, consumed];\n}\nfunction decodeBool(cursor) {\n return [bytesToBool(cursor.readBytes(32), { size: 32 }), 32];\n}\nfunction decodeBytes(cursor, param, { staticPosition }) {\n const [_, size] = param.type.split('bytes');\n if (!size) {\n // Dealing with dynamic types, so get the offset of the bytes data.\n const offset = bytesToNumber(cursor.readBytes(32));\n // Set position of the cursor to start of bytes data.\n cursor.setPosition(staticPosition + offset);\n const length = bytesToNumber(cursor.readBytes(32));\n // If there is no length, we have zero data.\n if (length === 0) {\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return ['0x', 32];\n }\n const data = cursor.readBytes(length);\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [bytesToHex(data), 32];\n }\n const value = bytesToHex(cursor.readBytes(Number.parseInt(size, 10), 32));\n return [value, 32];\n}\nfunction decodeNumber(cursor, param) {\n const signed = param.type.startsWith('int');\n const size = Number.parseInt(param.type.split('int')[1] || '256', 10);\n const value = cursor.readBytes(32);\n return [\n size > 48\n ? bytesToBigInt(value, { signed })\n : bytesToNumber(value, { signed }),\n 32,\n ];\n}\nfunction decodeTuple(cursor, param, { staticPosition }) {\n // Tuples can have unnamed components (i.e. they are arrays), so we must\n // determine whether the tuple is named or unnamed. In the case of a named\n // tuple, the value will be an object where each property is the name of the\n // component. In the case of an unnamed tuple, the value will be an array.\n const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);\n // Initialize the value to an object or an array, depending on whether the\n // tuple is named or unnamed.\n const value = hasUnnamedChild ? [] : {};\n let consumed = 0;\n // If the tuple has a dynamic child, we must first decode the offset to the\n // tuple data.\n if (hasDynamicChild(param)) {\n // Dealing with dynamic types, so get the offset of the tuple data.\n const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));\n // Start is the static position of referencing slot + offset.\n const start = staticPosition + offset;\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n cursor.setPosition(start + consumed);\n const [data, consumed_] = decodeParameter(cursor, component, {\n staticPosition: start,\n });\n consumed += consumed_;\n value[hasUnnamedChild ? i : component?.name] = data;\n }\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n }\n // If the tuple has static children, we can just decode each component\n // in sequence.\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n const [data, consumed_] = decodeParameter(cursor, component, {\n staticPosition,\n });\n value[hasUnnamedChild ? i : component?.name] = data;\n consumed += consumed_;\n }\n return [value, consumed];\n}\nfunction decodeString(cursor, { staticPosition }) {\n // Get offset to start of string data.\n const offset = bytesToNumber(cursor.readBytes(32));\n // Start is the static position of current slot + offset.\n const start = staticPosition + offset;\n cursor.setPosition(start);\n const length = bytesToNumber(cursor.readBytes(32));\n // If there is no length, we have zero data (empty string).\n if (length === 0) {\n cursor.setPosition(staticPosition + 32);\n return ['', 32];\n }\n const data = cursor.readBytes(length, 32);\n const value = bytesToString(trim(data));\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n}\nfunction hasDynamicChild(param) {\n const { type } = param;\n if (type === 'string')\n return true;\n if (type === 'bytes')\n return true;\n if (type.endsWith('[]'))\n return true;\n if (type === 'tuple')\n return param.components?.some(hasDynamicChild);\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents &&\n hasDynamicChild({ ...param, type: arrayComponents[1] }))\n return true;\n return false;\n}\n//# sourceMappingURL=decodeAbiParameters.js.map","import { solidityError, solidityPanic } from '../../constants/solidity.js';\nimport { AbiDecodingZeroDataError, AbiErrorSignatureNotFoundError, } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeErrorResult(parameters) {\n const { abi, data } = parameters;\n const signature = slice(data, 0, 4);\n if (signature === '0x')\n throw new AbiDecodingZeroDataError();\n const abi_ = [...(abi || []), solidityError, solidityPanic];\n const abiItem = abi_.find((x) => x.type === 'error' && signature === toFunctionSelector(formatAbiItem(x)));\n if (!abiItem)\n throw new AbiErrorSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeErrorResult',\n });\n return {\n abiItem,\n args: 'inputs' in abiItem && abiItem.inputs && abiItem.inputs.length > 0\n ? decodeAbiParameters(abiItem.inputs, slice(data, 4))\n : undefined,\n errorName: abiItem.name,\n };\n}\n//# sourceMappingURL=decodeErrorResult.js.map","export const stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {\n const value = typeof value_ === 'bigint' ? value_.toString() : value_;\n return typeof replacer === 'function' ? replacer(key, value) : value;\n}, space);\n//# sourceMappingURL=stringify.js.map","import { stringify } from '../stringify.js';\nexport function formatAbiItemWithArgs({ abiItem, args, includeFunctionName = true, includeName = false, }) {\n if (!('name' in abiItem))\n return;\n if (!('inputs' in abiItem))\n return;\n if (!abiItem.inputs)\n return;\n return `${includeFunctionName ? abiItem.name : ''}(${abiItem.inputs\n .map((input, i) => `${includeName && input.name ? `${input.name}: ` : ''}${typeof args[i] === 'object' ? stringify(args[i]) : args[i]}`)\n .join(', ')})`;\n}\n//# sourceMappingURL=formatAbiItemWithArgs.js.map","export const etherUnits = {\n gwei: 9,\n wei: 18,\n};\nexport const gweiUnits = {\n ether: -9,\n wei: 9,\n};\nexport const weiUnits = {\n ether: -18,\n gwei: -9,\n};\n//# sourceMappingURL=unit.js.map","/**\n * Divides a number by a given exponent of base 10 (10exponent), and formats it into a string representation of the number..\n *\n * - Docs: https://viem.sh/docs/utilities/formatUnits\n *\n * @example\n * import { formatUnits } from 'viem'\n *\n * formatUnits(420000000000n, 9)\n * // '420'\n */\nexport function formatUnits(value, decimals) {\n let display = value.toString();\n const negative = display.startsWith('-');\n if (negative)\n display = display.slice(1);\n display = display.padStart(decimals, '0');\n let [integer, fraction] = [\n display.slice(0, display.length - decimals),\n display.slice(display.length - decimals),\n ];\n fraction = fraction.replace(/(0+)$/, '');\n return `${negative ? '-' : ''}${integer || '0'}${fraction ? `.${fraction}` : ''}`;\n}\n//# sourceMappingURL=formatUnits.js.map","import { etherUnits } from '../../constants/unit.js';\nimport { formatUnits } from './formatUnits.js';\n/**\n * Converts numerical wei to a string representation of ether.\n *\n * - Docs: https://viem.sh/docs/utilities/formatEther\n *\n * @example\n * import { formatEther } from 'viem'\n *\n * formatEther(1000000000000000000n)\n * // '1'\n */\nexport function formatEther(wei, unit = 'wei') {\n return formatUnits(wei, etherUnits[unit]);\n}\n//# sourceMappingURL=formatEther.js.map","import { gweiUnits } from '../../constants/unit.js';\nimport { formatUnits } from './formatUnits.js';\n/**\n * Converts numerical wei to a string representation of gwei.\n *\n * - Docs: https://viem.sh/docs/utilities/formatGwei\n *\n * @example\n * import { formatGwei } from 'viem'\n *\n * formatGwei(1000000000n)\n * // '1'\n */\nexport function formatGwei(wei, unit = 'wei') {\n return formatUnits(wei, gweiUnits[unit]);\n}\n//# sourceMappingURL=formatGwei.js.map","import { BaseError } from './base.js';\nexport class AccountStateConflictError extends BaseError {\n constructor({ address }) {\n super(`State for account \"${address}\" is set multiple times.`, {\n name: 'AccountStateConflictError',\n });\n }\n}\nexport class StateAssignmentConflictError extends BaseError {\n constructor() {\n super('state and stateDiff are set on the same account.', {\n name: 'StateAssignmentConflictError',\n });\n }\n}\n/** @internal */\nexport function prettyStateMapping(stateMapping) {\n return stateMapping.reduce((pretty, { slot, value }) => {\n return `${pretty} ${slot}: ${value}\\n`;\n }, '');\n}\nexport function prettyStateOverride(stateOverride) {\n return stateOverride\n .reduce((pretty, { address, ...state }) => {\n let val = `${pretty} ${address}:\\n`;\n if (state.nonce)\n val += ` nonce: ${state.nonce}\\n`;\n if (state.balance)\n val += ` balance: ${state.balance}\\n`;\n if (state.code)\n val += ` code: ${state.code}\\n`;\n if (state.state) {\n val += ' state:\\n';\n val += prettyStateMapping(state.state);\n }\n if (state.stateDiff) {\n val += ' stateDiff:\\n';\n val += prettyStateMapping(state.stateDiff);\n }\n return val;\n }, ' State Override:\\n')\n .slice(0, -1);\n}\n//# sourceMappingURL=stateOverride.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport function prettyPrint(args) {\n const entries = Object.entries(args)\n .map(([key, value]) => {\n if (value === undefined || value === false)\n return null;\n return [key, value];\n })\n .filter(Boolean);\n const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);\n return entries\n .map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`)\n .join('\\n');\n}\nexport class FeeConflictError extends BaseError {\n constructor() {\n super([\n 'Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.',\n 'Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others.',\n ].join('\\n'), { name: 'FeeConflictError' });\n }\n}\nexport class InvalidLegacyVError extends BaseError {\n constructor({ v }) {\n super(`Invalid \\`v\\` value \"${v}\". Expected 27 or 28.`, {\n name: 'InvalidLegacyVError',\n });\n }\n}\nexport class InvalidSerializableTransactionError extends BaseError {\n constructor({ transaction }) {\n super('Cannot infer a transaction type from provided transaction.', {\n metaMessages: [\n 'Provided Transaction:',\n '{',\n prettyPrint(transaction),\n '}',\n '',\n 'To infer the type, either provide:',\n '- a `type` to the Transaction, or',\n '- an EIP-1559 Transaction with `maxFeePerGas`, or',\n '- an EIP-2930 Transaction with `gasPrice` & `accessList`, or',\n '- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or',\n '- an EIP-7702 Transaction with `authorizationList`, or',\n '- a Legacy Transaction with `gasPrice`',\n ],\n name: 'InvalidSerializableTransactionError',\n });\n }\n}\nexport class InvalidSerializedTransactionTypeError extends BaseError {\n constructor({ serializedType }) {\n super(`Serialized transaction type \"${serializedType}\" is invalid.`, {\n name: 'InvalidSerializedTransactionType',\n });\n Object.defineProperty(this, \"serializedType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedType = serializedType;\n }\n}\nexport class InvalidSerializedTransactionError extends BaseError {\n constructor({ attributes, serializedTransaction, type, }) {\n const missing = Object.entries(attributes)\n .map(([key, value]) => (typeof value === 'undefined' ? key : undefined))\n .filter(Boolean);\n super(`Invalid serialized transaction of type \"${type}\" was provided.`, {\n metaMessages: [\n `Serialized Transaction: \"${serializedTransaction}\"`,\n missing.length > 0 ? `Missing Attributes: ${missing.join(', ')}` : '',\n ].filter(Boolean),\n name: 'InvalidSerializedTransactionError',\n });\n Object.defineProperty(this, \"serializedTransaction\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"type\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedTransaction = serializedTransaction;\n this.type = type;\n }\n}\nexport class InvalidStorageKeySizeError extends BaseError {\n constructor({ storageKey }) {\n super(`Size for storage key \"${storageKey}\" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: 'InvalidStorageKeySizeError' });\n }\n}\nexport class TransactionExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n chain: chain && `${chain?.name} (id: ${chain?.id})`,\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency?.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Request Arguments:',\n prettyArgs,\n ].filter(Boolean),\n name: 'TransactionExecutionError',\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.cause = cause;\n }\n}\nexport class TransactionNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, blockTag, hash, index, }) {\n let identifier = 'Transaction';\n if (blockTag && index !== undefined)\n identifier = `Transaction at block time \"${blockTag}\" at index \"${index}\"`;\n if (blockHash && index !== undefined)\n identifier = `Transaction at block hash \"${blockHash}\" at index \"${index}\"`;\n if (blockNumber && index !== undefined)\n identifier = `Transaction at block number \"${blockNumber}\" at index \"${index}\"`;\n if (hash)\n identifier = `Transaction with hash \"${hash}\"`;\n super(`${identifier} could not be found.`, {\n name: 'TransactionNotFoundError',\n });\n }\n}\nexport class TransactionReceiptNotFoundError extends BaseError {\n constructor({ hash }) {\n super(`Transaction receipt with hash \"${hash}\" could not be found. The Transaction may not be processed on a block yet.`, {\n name: 'TransactionReceiptNotFoundError',\n });\n }\n}\nexport class TransactionReceiptRevertedError extends BaseError {\n constructor({ receipt }) {\n super(`Transaction with hash \"${receipt.transactionHash}\" reverted.`, {\n metaMessages: [\n 'The receipt marked the transaction as \"reverted\". This could mean that the function on the contract you are trying to call threw an error.',\n ' ',\n 'You can attempt to extract the revert reason by:',\n '- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract',\n '- using the `call` Action with raw `data`',\n ],\n name: 'TransactionReceiptRevertedError',\n });\n Object.defineProperty(this, \"receipt\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.receipt = receipt;\n }\n}\nexport class WaitForTransactionReceiptTimeoutError extends BaseError {\n constructor({ hash }) {\n super(`Timed out while waiting for transaction with hash \"${hash}\" to be confirmed.`, { name: 'WaitForTransactionReceiptTimeoutError' });\n }\n}\n//# sourceMappingURL=transaction.js.map","import { parseAccount } from '../accounts/utils/parseAccount.js';\nimport { panicReasons } from '../constants/solidity.js';\nimport { decodeErrorResult, } from '../utils/abi/decodeErrorResult.js';\nimport { formatAbiItem } from '../utils/abi/formatAbiItem.js';\nimport { formatAbiItemWithArgs } from '../utils/abi/formatAbiItemWithArgs.js';\nimport { getAbiItem } from '../utils/abi/getAbiItem.js';\nimport { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { AbiErrorSignatureNotFoundError } from './abi.js';\nimport { BaseError } from './base.js';\nimport { prettyStateOverride } from './stateOverride.js';\nimport { prettyPrint } from './transaction.js';\nimport { getContractAddress } from './utils.js';\nexport class CallExecutionError extends BaseError {\n constructor(cause, { account: account_, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride, }) {\n const account = account_ ? parseAccount(account_) : undefined;\n let prettyArgs = prettyPrint({\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency?.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n if (stateOverride) {\n prettyArgs += `\\n${prettyStateOverride(stateOverride)}`;\n }\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Raw Call Arguments:',\n prettyArgs,\n ].filter(Boolean),\n name: 'CallExecutionError',\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.cause = cause;\n }\n}\nexport class ContractFunctionExecutionError extends BaseError {\n constructor(cause, { abi, args, contractAddress, docsPath, functionName, sender, }) {\n const abiItem = getAbiItem({ abi, args, name: functionName });\n const formattedArgs = abiItem\n ? formatAbiItemWithArgs({\n abiItem,\n args,\n includeFunctionName: false,\n includeName: false,\n })\n : undefined;\n const functionWithParams = abiItem\n ? formatAbiItem(abiItem, { includeName: true })\n : undefined;\n const prettyArgs = prettyPrint({\n address: contractAddress && getContractAddress(contractAddress),\n function: functionWithParams,\n args: formattedArgs &&\n formattedArgs !== '()' &&\n `${[...Array(functionName?.length ?? 0).keys()]\n .map(() => ' ')\n .join('')}${formattedArgs}`,\n sender,\n });\n super(cause.shortMessage ||\n `An unknown error occurred while executing the contract function \"${functionName}\".`, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n prettyArgs && 'Contract Call:',\n prettyArgs,\n ].filter(Boolean),\n name: 'ContractFunctionExecutionError',\n });\n Object.defineProperty(this, \"abi\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"args\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"contractAddress\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"formattedArgs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"functionName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"sender\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.abi = abi;\n this.args = args;\n this.cause = cause;\n this.contractAddress = contractAddress;\n this.functionName = functionName;\n this.sender = sender;\n }\n}\nexport class ContractFunctionRevertedError extends BaseError {\n constructor({ abi, data, functionName, message, }) {\n let cause;\n let decodedData;\n let metaMessages;\n let reason;\n if (data && data !== '0x') {\n try {\n decodedData = decodeErrorResult({ abi, data });\n const { abiItem, errorName, args: errorArgs } = decodedData;\n if (errorName === 'Error') {\n reason = errorArgs[0];\n }\n else if (errorName === 'Panic') {\n const [firstArg] = errorArgs;\n reason = panicReasons[firstArg];\n }\n else {\n const errorWithParams = abiItem\n ? formatAbiItem(abiItem, { includeName: true })\n : undefined;\n const formattedArgs = abiItem && errorArgs\n ? formatAbiItemWithArgs({\n abiItem,\n args: errorArgs,\n includeFunctionName: false,\n includeName: false,\n })\n : undefined;\n metaMessages = [\n errorWithParams ? `Error: ${errorWithParams}` : '',\n formattedArgs && formattedArgs !== '()'\n ? ` ${[...Array(errorName?.length ?? 0).keys()]\n .map(() => ' ')\n .join('')}${formattedArgs}`\n : '',\n ];\n }\n }\n catch (err) {\n cause = err;\n }\n }\n else if (message)\n reason = message;\n let signature;\n if (cause instanceof AbiErrorSignatureNotFoundError) {\n signature = cause.signature;\n metaMessages = [\n `Unable to decode signature \"${signature}\" as it was not found on the provided ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ];\n }\n super((reason && reason !== 'execution reverted') || signature\n ? [\n `The contract function \"${functionName}\" reverted with the following ${signature ? 'signature' : 'reason'}:`,\n reason || signature,\n ].join('\\n')\n : `The contract function \"${functionName}\" reverted.`, {\n cause,\n metaMessages,\n name: 'ContractFunctionRevertedError',\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"raw\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"reason\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"signature\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = decodedData;\n this.raw = data;\n this.reason = reason;\n this.signature = signature;\n }\n}\nexport class ContractFunctionZeroDataError extends BaseError {\n constructor({ functionName }) {\n super(`The contract function \"${functionName}\" returned no data (\"0x\").`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ` - The contract does not have the function \"${functionName}\",`,\n ' - The parameters passed to the contract function may be invalid, or',\n ' - The address is not a contract.',\n ],\n name: 'ContractFunctionZeroDataError',\n });\n }\n}\nexport class CounterfactualDeploymentFailedError extends BaseError {\n constructor({ factory }) {\n super(`Deployment for counterfactual contract call failed${factory ? ` for factory \"${factory}\".` : ''}`, {\n metaMessages: [\n 'Please ensure:',\n '- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).',\n '- The `factoryData` is a valid encoded function call for contract deployment function on the factory.',\n ],\n name: 'CounterfactualDeploymentFailedError',\n });\n }\n}\nexport class RawContractError extends BaseError {\n constructor({ data, message, }) {\n super(message || '', { name: 'RawContractError' });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n }\n}\n//# sourceMappingURL=contract.js.map","import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class HttpRequestError extends BaseError {\n constructor({ body, cause, details, headers, status, url, }) {\n super('HTTP request failed.', {\n cause,\n details,\n metaMessages: [\n status && `Status: ${status}`,\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean),\n name: 'HttpRequestError',\n });\n Object.defineProperty(this, \"body\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"headers\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"status\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"url\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.body = body;\n this.headers = headers;\n this.status = status;\n this.url = url;\n }\n}\nexport class WebSocketRequestError extends BaseError {\n constructor({ body, cause, details, url, }) {\n super('WebSocket request failed.', {\n cause,\n details,\n metaMessages: [\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean),\n name: 'WebSocketRequestError',\n });\n }\n}\nexport class RpcRequestError extends BaseError {\n constructor({ body, error, url, }) {\n super('RPC Request failed.', {\n cause: error,\n details: error.message,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n name: 'RpcRequestError',\n });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.code = error.code;\n this.data = error.data;\n }\n}\nexport class SocketClosedError extends BaseError {\n constructor({ url, } = {}) {\n super('The socket has been closed.', {\n metaMessages: [url && `URL: ${getUrl(url)}`].filter(Boolean),\n name: 'SocketClosedError',\n });\n }\n}\nexport class TimeoutError extends BaseError {\n constructor({ body, url, }) {\n super('The request took too long to respond.', {\n details: 'The request timed out.',\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n name: 'TimeoutError',\n });\n }\n}\n//# sourceMappingURL=request.js.map","import { BaseError } from './base.js';\nimport { RpcRequestError } from './request.js';\nconst unknownErrorCode = -1;\nexport class RpcError extends BaseError {\n constructor(cause, { code, docsPath, metaMessages, name, shortMessage, }) {\n super(shortMessage, {\n cause,\n docsPath,\n metaMessages: metaMessages || cause?.metaMessages,\n name: name || 'RpcError',\n });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.name = name || cause.name;\n this.code = (cause instanceof RpcRequestError ? cause.code : (code ?? unknownErrorCode));\n }\n}\nexport class ProviderRpcError extends RpcError {\n constructor(cause, options) {\n super(cause, options);\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = options.data;\n }\n}\nexport class ParseRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ParseRpcError.code,\n name: 'ParseRpcError',\n shortMessage: 'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.',\n });\n }\n}\nObject.defineProperty(ParseRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32700\n});\nexport class InvalidRequestRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidRequestRpcError.code,\n name: 'InvalidRequestRpcError',\n shortMessage: 'JSON is not a valid request object.',\n });\n }\n}\nObject.defineProperty(InvalidRequestRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32600\n});\nexport class MethodNotFoundRpcError extends RpcError {\n constructor(cause, { method } = {}) {\n super(cause, {\n code: MethodNotFoundRpcError.code,\n name: 'MethodNotFoundRpcError',\n shortMessage: `The method${method ? ` \"${method}\"` : ''} does not exist / is not available.`,\n });\n }\n}\nObject.defineProperty(MethodNotFoundRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32601\n});\nexport class InvalidParamsRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidParamsRpcError.code,\n name: 'InvalidParamsRpcError',\n shortMessage: [\n 'Invalid parameters were provided to the RPC method.',\n 'Double check you have provided the correct parameters.',\n ].join('\\n'),\n });\n }\n}\nObject.defineProperty(InvalidParamsRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32602\n});\nexport class InternalRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InternalRpcError.code,\n name: 'InternalRpcError',\n shortMessage: 'An internal error was received.',\n });\n }\n}\nObject.defineProperty(InternalRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32603\n});\nexport class InvalidInputRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidInputRpcError.code,\n name: 'InvalidInputRpcError',\n shortMessage: [\n 'Missing or invalid parameters.',\n 'Double check you have provided the correct parameters.',\n ].join('\\n'),\n });\n }\n}\nObject.defineProperty(InvalidInputRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32000\n});\nexport class ResourceNotFoundRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ResourceNotFoundRpcError.code,\n name: 'ResourceNotFoundRpcError',\n shortMessage: 'Requested resource not found.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ResourceNotFoundRpcError'\n });\n }\n}\nObject.defineProperty(ResourceNotFoundRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32001\n});\nexport class ResourceUnavailableRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ResourceUnavailableRpcError.code,\n name: 'ResourceUnavailableRpcError',\n shortMessage: 'Requested resource not available.',\n });\n }\n}\nObject.defineProperty(ResourceUnavailableRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32002\n});\nexport class TransactionRejectedRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: TransactionRejectedRpcError.code,\n name: 'TransactionRejectedRpcError',\n shortMessage: 'Transaction creation failed.',\n });\n }\n}\nObject.defineProperty(TransactionRejectedRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32003\n});\nexport class MethodNotSupportedRpcError extends RpcError {\n constructor(cause, { method } = {}) {\n super(cause, {\n code: MethodNotSupportedRpcError.code,\n name: 'MethodNotSupportedRpcError',\n shortMessage: `Method${method ? ` \"${method}\"` : ''} is not supported.`,\n });\n }\n}\nObject.defineProperty(MethodNotSupportedRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32004\n});\nexport class LimitExceededRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: LimitExceededRpcError.code,\n name: 'LimitExceededRpcError',\n shortMessage: 'Request exceeds defined limit.',\n });\n }\n}\nObject.defineProperty(LimitExceededRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32005\n});\nexport class JsonRpcVersionUnsupportedError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: JsonRpcVersionUnsupportedError.code,\n name: 'JsonRpcVersionUnsupportedError',\n shortMessage: 'Version of JSON-RPC protocol is not supported.',\n });\n }\n}\nObject.defineProperty(JsonRpcVersionUnsupportedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32006\n});\nexport class UserRejectedRequestError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UserRejectedRequestError.code,\n name: 'UserRejectedRequestError',\n shortMessage: 'User rejected the request.',\n });\n }\n}\nObject.defineProperty(UserRejectedRequestError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4001\n});\nexport class UnauthorizedProviderError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnauthorizedProviderError.code,\n name: 'UnauthorizedProviderError',\n shortMessage: 'The requested method and/or account has not been authorized by the user.',\n });\n }\n}\nObject.defineProperty(UnauthorizedProviderError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4100\n});\nexport class UnsupportedProviderMethodError extends ProviderRpcError {\n constructor(cause, { method } = {}) {\n super(cause, {\n code: UnsupportedProviderMethodError.code,\n name: 'UnsupportedProviderMethodError',\n shortMessage: `The Provider does not support the requested method${method ? ` \" ${method}\"` : ''}.`,\n });\n }\n}\nObject.defineProperty(UnsupportedProviderMethodError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4200\n});\nexport class ProviderDisconnectedError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: ProviderDisconnectedError.code,\n name: 'ProviderDisconnectedError',\n shortMessage: 'The Provider is disconnected from all chains.',\n });\n }\n}\nObject.defineProperty(ProviderDisconnectedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4900\n});\nexport class ChainDisconnectedError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: ChainDisconnectedError.code,\n name: 'ChainDisconnectedError',\n shortMessage: 'The Provider is not connected to the requested chain.',\n });\n }\n}\nObject.defineProperty(ChainDisconnectedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4901\n});\nexport class SwitchChainError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: SwitchChainError.code,\n name: 'SwitchChainError',\n shortMessage: 'An error occurred when attempting to switch chain.',\n });\n }\n}\nObject.defineProperty(SwitchChainError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4902\n});\nexport class UnsupportedNonOptionalCapabilityError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnsupportedNonOptionalCapabilityError.code,\n name: 'UnsupportedNonOptionalCapabilityError',\n shortMessage: 'This Wallet does not support a capability that was not marked as optional.',\n });\n }\n}\nObject.defineProperty(UnsupportedNonOptionalCapabilityError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 5700\n});\nexport class UnsupportedChainIdError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnsupportedChainIdError.code,\n name: 'UnsupportedChainIdError',\n shortMessage: 'This Wallet does not support the requested chain ID.',\n });\n }\n}\nObject.defineProperty(UnsupportedChainIdError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 5710\n});\nexport class DuplicateIdError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: DuplicateIdError.code,\n name: 'DuplicateIdError',\n shortMessage: 'There is already a bundle submitted with this ID.',\n });\n }\n}\nObject.defineProperty(DuplicateIdError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 5720\n});\nexport class UnknownBundleIdError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnknownBundleIdError.code,\n name: 'UnknownBundleIdError',\n shortMessage: 'This bundle id is unknown / has not been submitted',\n });\n }\n}\nObject.defineProperty(UnknownBundleIdError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 5730\n});\nexport class BundleTooLargeError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: BundleTooLargeError.code,\n name: 'BundleTooLargeError',\n shortMessage: 'The call bundle is too large for the Wallet to process.',\n });\n }\n}\nObject.defineProperty(BundleTooLargeError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 5740\n});\nexport class AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: AtomicReadyWalletRejectedUpgradeError.code,\n name: 'AtomicReadyWalletRejectedUpgradeError',\n shortMessage: 'The Wallet can support atomicity after an upgrade, but the user rejected the upgrade.',\n });\n }\n}\nObject.defineProperty(AtomicReadyWalletRejectedUpgradeError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 5750\n});\nexport class AtomicityNotSupportedError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: AtomicityNotSupportedError.code,\n name: 'AtomicityNotSupportedError',\n shortMessage: 'The wallet does not support atomic execution but the request requires it.',\n });\n }\n}\nObject.defineProperty(AtomicityNotSupportedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 5760\n});\nexport class UnknownRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n name: 'UnknownRpcError',\n shortMessage: 'An unknown RPC error occurred.',\n });\n }\n}\n//# sourceMappingURL=rpc.js.map","import { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ContractFunctionExecutionError, ContractFunctionRevertedError, ContractFunctionZeroDataError, RawContractError, } from '../../errors/contract.js';\nimport { RpcRequestError } from '../../errors/request.js';\nimport { InternalRpcError } from '../../errors/rpc.js';\nconst EXECUTION_REVERTED_ERROR_CODE = 3;\nexport function getContractError(err, { abi, address, args, docsPath, functionName, sender, }) {\n const error = (err instanceof RawContractError\n ? err\n : err instanceof BaseError\n ? err.walk((err) => 'data' in err) || err.walk()\n : {});\n const { code, data, details, message, shortMessage } = error;\n const cause = (() => {\n if (err instanceof AbiDecodingZeroDataError)\n return new ContractFunctionZeroDataError({ functionName });\n if ([EXECUTION_REVERTED_ERROR_CODE, InternalRpcError.code].includes(code) &&\n (data || details || message || shortMessage)) {\n return new ContractFunctionRevertedError({\n abi,\n data: typeof data === 'object' ? data.data : data,\n functionName,\n message: error instanceof RpcRequestError\n ? details\n : (shortMessage ?? message),\n });\n }\n return err;\n })();\n return new ContractFunctionExecutionError(cause, {\n abi,\n args,\n contractAddress: address,\n docsPath,\n functionName,\n sender,\n });\n}\n//# sourceMappingURL=getContractError.js.map","import { isHex } from '../data/isHex.js';\nimport { size } from '../data/size.js';\nimport { hexToBigInt, hexToNumber, } from '../encoding/fromHex.js';\nimport { toHex } from '../encoding/toHex.js';\nexport async function recoverPublicKey({ hash, signature, }) {\n const hashHex = isHex(hash) ? hash : toHex(hash);\n const { secp256k1 } = await import('@noble/curves/secp256k1');\n const signature_ = (() => {\n // typeof signature: `Signature`\n if (typeof signature === 'object' && 'r' in signature && 's' in signature) {\n const { r, s, v, yParity } = signature;\n const yParityOrV = Number(yParity ?? v);\n const recoveryBit = toRecoveryBit(yParityOrV);\n return new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).addRecoveryBit(recoveryBit);\n }\n // typeof signature: `Hex | ByteArray`\n const signatureHex = isHex(signature) ? signature : toHex(signature);\n if (size(signatureHex) !== 65)\n throw new Error('invalid signature length');\n const yParityOrV = hexToNumber(`0x${signatureHex.slice(130)}`);\n const recoveryBit = toRecoveryBit(yParityOrV);\n return secp256k1.Signature.fromCompact(signatureHex.substring(2, 130)).addRecoveryBit(recoveryBit);\n })();\n const publicKey = signature_\n .recoverPublicKey(hashHex.substring(2))\n .toHex(false);\n return `0x${publicKey}`;\n}\nfunction toRecoveryBit(yParityOrV) {\n if (yParityOrV === 0 || yParityOrV === 1)\n return yParityOrV;\n if (yParityOrV === 27)\n return 0;\n if (yParityOrV === 28)\n return 1;\n throw new Error('Invalid yParityOrV value');\n}\n//# sourceMappingURL=recoverPublicKey.js.map","import { publicKeyToAddress } from '../../accounts/utils/publicKeyToAddress.js';\nimport { recoverPublicKey } from './recoverPublicKey.js';\nexport async function recoverAddress({ hash, signature, }) {\n return publicKeyToAddress(await recoverPublicKey({ hash, signature }));\n}\n//# sourceMappingURL=recoverAddress.js.map","import { checksumAddress, } from '../../utils/address/getAddress.js';\nimport { keccak256, } from '../../utils/hash/keccak256.js';\n/**\n * @description Converts an ECDSA public key to an address.\n *\n * @param publicKey The public key to convert.\n *\n * @returns The address.\n */\nexport function publicKeyToAddress(publicKey) {\n const address = keccak256(`0x${publicKey.substring(4)}`).substring(26);\n return checksumAddress(`0x${address}`);\n}\n//# sourceMappingURL=publicKeyToAddress.js.map","import { BaseError } from '../../errors/base.js';\nimport { createCursor, } from '../cursor.js';\nimport { hexToBytes } from './toBytes.js';\nimport { bytesToHex } from './toHex.js';\nexport function toRlp(bytes, to = 'hex') {\n const encodable = getEncodable(bytes);\n const cursor = createCursor(new Uint8Array(encodable.length));\n encodable.encode(cursor);\n if (to === 'hex')\n return bytesToHex(cursor.bytes);\n return cursor.bytes;\n}\nexport function bytesToRlp(bytes, to = 'bytes') {\n return toRlp(bytes, to);\n}\nexport function hexToRlp(hex, to = 'hex') {\n return toRlp(hex, to);\n}\nfunction getEncodable(bytes) {\n if (Array.isArray(bytes))\n return getEncodableList(bytes.map((x) => getEncodable(x)));\n return getEncodableBytes(bytes);\n}\nfunction getEncodableList(list) {\n const bodyLength = list.reduce((acc, x) => acc + x.length, 0);\n const sizeOfBodyLength = getSizeOfLength(bodyLength);\n const length = (() => {\n if (bodyLength <= 55)\n return 1 + bodyLength;\n return 1 + sizeOfBodyLength + bodyLength;\n })();\n return {\n length,\n encode(cursor) {\n if (bodyLength <= 55) {\n cursor.pushByte(0xc0 + bodyLength);\n }\n else {\n cursor.pushByte(0xc0 + 55 + sizeOfBodyLength);\n if (sizeOfBodyLength === 1)\n cursor.pushUint8(bodyLength);\n else if (sizeOfBodyLength === 2)\n cursor.pushUint16(bodyLength);\n else if (sizeOfBodyLength === 3)\n cursor.pushUint24(bodyLength);\n else\n cursor.pushUint32(bodyLength);\n }\n for (const { encode } of list) {\n encode(cursor);\n }\n },\n };\n}\nfunction getEncodableBytes(bytesOrHex) {\n const bytes = typeof bytesOrHex === 'string' ? hexToBytes(bytesOrHex) : bytesOrHex;\n const sizeOfBytesLength = getSizeOfLength(bytes.length);\n const length = (() => {\n if (bytes.length === 1 && bytes[0] < 0x80)\n return 1;\n if (bytes.length <= 55)\n return 1 + bytes.length;\n return 1 + sizeOfBytesLength + bytes.length;\n })();\n return {\n length,\n encode(cursor) {\n if (bytes.length === 1 && bytes[0] < 0x80) {\n cursor.pushBytes(bytes);\n }\n else if (bytes.length <= 55) {\n cursor.pushByte(0x80 + bytes.length);\n cursor.pushBytes(bytes);\n }\n else {\n cursor.pushByte(0x80 + 55 + sizeOfBytesLength);\n if (sizeOfBytesLength === 1)\n cursor.pushUint8(bytes.length);\n else if (sizeOfBytesLength === 2)\n cursor.pushUint16(bytes.length);\n else if (sizeOfBytesLength === 3)\n cursor.pushUint24(bytes.length);\n else\n cursor.pushUint32(bytes.length);\n cursor.pushBytes(bytes);\n }\n },\n };\n}\nfunction getSizeOfLength(length) {\n if (length < 2 ** 8)\n return 1;\n if (length < 2 ** 16)\n return 2;\n if (length < 2 ** 24)\n return 3;\n if (length < 2 ** 32)\n return 4;\n throw new BaseError('Length is too large.');\n}\n//# sourceMappingURL=toRlp.js.map","import { concatHex } from '../data/concat.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\nimport { numberToHex } from '../encoding/toHex.js';\nimport { toRlp } from '../encoding/toRlp.js';\nimport { keccak256 } from '../hash/keccak256.js';\n/**\n * Computes an Authorization hash in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.\n */\nexport function hashAuthorization(parameters) {\n const { chainId, nonce, to } = parameters;\n const address = parameters.contractAddress ?? parameters.address;\n const hash = keccak256(concatHex([\n '0x05',\n toRlp([\n chainId ? numberToHex(chainId) : '0x',\n address,\n nonce ? numberToHex(nonce) : '0x',\n ]),\n ]));\n if (to === 'bytes')\n return hexToBytes(hash);\n return hash;\n}\n//# sourceMappingURL=hashAuthorization.js.map","import { recoverAddress, } from '../signature/recoverAddress.js';\nimport { hashAuthorization, } from './hashAuthorization.js';\nexport async function recoverAuthorizationAddress(parameters) {\n const { authorization, signature } = parameters;\n return recoverAddress({\n hash: hashAuthorization(authorization),\n signature: (signature ?? authorization),\n });\n}\n//# sourceMappingURL=recoverAuthorizationAddress.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nimport { prettyPrint } from './transaction.js';\nexport class EstimateGasExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency?.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Estimate Gas Arguments:',\n prettyArgs,\n ].filter(Boolean),\n name: 'EstimateGasExecutionError',\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.cause = cause;\n }\n}\n//# sourceMappingURL=estimateGas.js.map","import { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport class ExecutionRevertedError extends BaseError {\n constructor({ cause, message, } = {}) {\n const reason = message\n ?.replace('execution reverted: ', '')\n ?.replace('execution reverted', '');\n super(`Execution reverted ${reason ? `with reason: ${reason}` : 'for an unknown reason'}.`, {\n cause,\n name: 'ExecutionRevertedError',\n });\n }\n}\nObject.defineProperty(ExecutionRevertedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n});\nObject.defineProperty(ExecutionRevertedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /execution reverted/\n});\nexport class FeeCapTooHighError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}) cannot be higher than the maximum allowed value (2^256-1).`, {\n cause,\n name: 'FeeCapTooHighError',\n });\n }\n}\nObject.defineProperty(FeeCapTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas higher than 2\\^256-1|fee cap higher than 2\\^256-1/\n});\nexport class FeeCapTooLowError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ''} gwei) cannot be lower than the block base fee.`, {\n cause,\n name: 'FeeCapTooLowError',\n });\n }\n}\nObject.defineProperty(FeeCapTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/\n});\nexport class NonceTooHighError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is higher than the next one expected.`, { cause, name: 'NonceTooHighError' });\n }\n}\nObject.defineProperty(NonceTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too high/\n});\nexport class NonceTooLowError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super([\n `Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is lower than the current nonce of the account.`,\n 'Try increasing the nonce or find the latest nonce with `getTransactionCount`.',\n ].join('\\n'), { cause, name: 'NonceTooLowError' });\n }\n}\nObject.defineProperty(NonceTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too low|transaction already imported|already known/\n});\nexport class NonceMaxValueError extends BaseError {\n constructor({ cause, nonce, } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}exceeds the maximum allowed nonce.`, { cause, name: 'NonceMaxValueError' });\n }\n}\nObject.defineProperty(NonceMaxValueError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce has max value/\n});\nexport class InsufficientFundsError extends BaseError {\n constructor({ cause } = {}) {\n super([\n 'The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.',\n ].join('\\n'), {\n cause,\n metaMessages: [\n 'This error could arise when the account does not have enough funds to:',\n ' - pay for the total gas fee,',\n ' - pay for the value to send.',\n ' ',\n 'The cost of the transaction is calculated as `gas * gas fee + value`, where:',\n ' - `gas` is the amount of gas needed for transaction to execute,',\n ' - `gas fee` is the gas fee,',\n ' - `value` is the amount of ether to send to the recipient.',\n ],\n name: 'InsufficientFundsError',\n });\n }\n}\nObject.defineProperty(InsufficientFundsError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /insufficient funds|exceeds transaction sender account balance/\n});\nexport class IntrinsicGasTooHighError extends BaseError {\n constructor({ cause, gas, } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction exceeds the limit allowed for the block.`, {\n cause,\n name: 'IntrinsicGasTooHighError',\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too high|gas limit reached/\n});\nexport class IntrinsicGasTooLowError extends BaseError {\n constructor({ cause, gas, } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction is too low.`, {\n cause,\n name: 'IntrinsicGasTooLowError',\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too low/\n});\nexport class TransactionTypeNotSupportedError extends BaseError {\n constructor({ cause }) {\n super('The transaction type is not supported for this chain.', {\n cause,\n name: 'TransactionTypeNotSupportedError',\n });\n }\n}\nObject.defineProperty(TransactionTypeNotSupportedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /transaction type not valid/\n});\nexport class TipAboveFeeCapError extends BaseError {\n constructor({ cause, maxPriorityFeePerGas, maxFeePerGas, } = {}) {\n super([\n `The provided tip (\\`maxPriorityFeePerGas\\`${maxPriorityFeePerGas\n ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei`\n : ''}) cannot be higher than the fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}).`,\n ].join('\\n'), {\n cause,\n name: 'TipAboveFeeCapError',\n });\n }\n}\nObject.defineProperty(TipAboveFeeCapError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/\n});\nexport class UnknownNodeError extends BaseError {\n constructor({ cause }) {\n super(`An error occurred while executing: ${cause?.shortMessage}`, {\n cause,\n name: 'UnknownNodeError',\n });\n }\n}\n//# sourceMappingURL=node.js.map","import { BaseError } from '../../errors/base.js';\nimport { ExecutionRevertedError, FeeCapTooHighError, FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooHighError, IntrinsicGasTooLowError, NonceMaxValueError, NonceTooHighError, NonceTooLowError, TipAboveFeeCapError, TransactionTypeNotSupportedError, UnknownNodeError, } from '../../errors/node.js';\nimport { RpcRequestError } from '../../errors/request.js';\nimport { InvalidInputRpcError, TransactionRejectedRpcError, } from '../../errors/rpc.js';\nexport function containsNodeError(err) {\n return (err instanceof TransactionRejectedRpcError ||\n err instanceof InvalidInputRpcError ||\n (err instanceof RpcRequestError && err.code === ExecutionRevertedError.code));\n}\nexport function getNodeError(err, args) {\n const message = (err.details || '').toLowerCase();\n const executionRevertedError = err instanceof BaseError\n ? err.walk((e) => e?.code ===\n ExecutionRevertedError.code)\n : err;\n if (executionRevertedError instanceof BaseError)\n return new ExecutionRevertedError({\n cause: err,\n message: executionRevertedError.details,\n });\n if (ExecutionRevertedError.nodeMessage.test(message))\n return new ExecutionRevertedError({\n cause: err,\n message: err.details,\n });\n if (FeeCapTooHighError.nodeMessage.test(message))\n return new FeeCapTooHighError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n });\n if (FeeCapTooLowError.nodeMessage.test(message))\n return new FeeCapTooLowError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n });\n if (NonceTooHighError.nodeMessage.test(message))\n return new NonceTooHighError({ cause: err, nonce: args?.nonce });\n if (NonceTooLowError.nodeMessage.test(message))\n return new NonceTooLowError({ cause: err, nonce: args?.nonce });\n if (NonceMaxValueError.nodeMessage.test(message))\n return new NonceMaxValueError({ cause: err, nonce: args?.nonce });\n if (InsufficientFundsError.nodeMessage.test(message))\n return new InsufficientFundsError({ cause: err });\n if (IntrinsicGasTooHighError.nodeMessage.test(message))\n return new IntrinsicGasTooHighError({ cause: err, gas: args?.gas });\n if (IntrinsicGasTooLowError.nodeMessage.test(message))\n return new IntrinsicGasTooLowError({ cause: err, gas: args?.gas });\n if (TransactionTypeNotSupportedError.nodeMessage.test(message))\n return new TransactionTypeNotSupportedError({ cause: err });\n if (TipAboveFeeCapError.nodeMessage.test(message))\n return new TipAboveFeeCapError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n maxPriorityFeePerGas: args?.maxPriorityFeePerGas,\n });\n return new UnknownNodeError({\n cause: err,\n });\n}\n//# sourceMappingURL=getNodeError.js.map","/**\n * @description Picks out the keys from `value` that exist in the formatter..\n */\nexport function extract(value_, { format }) {\n if (!format)\n return {};\n const value = {};\n function extract_(formatted) {\n const keys = Object.keys(formatted);\n for (const key of keys) {\n if (key in value_)\n value[key] = value_[key];\n if (formatted[key] &&\n typeof formatted[key] === 'object' &&\n !Array.isArray(formatted[key]))\n extract_(formatted[key]);\n }\n }\n const formatted = format(value_ || {});\n extract_(formatted);\n return value;\n}\n//# sourceMappingURL=extract.js.map","export function defineFormatter(type, format) {\n return ({ exclude, format: overrides, }) => {\n return {\n exclude,\n format: (args, action) => {\n const formatted = format(args, action);\n if (exclude) {\n for (const key of exclude) {\n delete formatted[key];\n }\n }\n return {\n ...formatted,\n ...overrides(args, action),\n };\n },\n type,\n };\n };\n}\n//# sourceMappingURL=formatter.js.map","import { bytesToHex, numberToHex } from '../encoding/toHex.js';\nimport { defineFormatter } from './formatter.js';\nexport const rpcTransactionType = {\n legacy: '0x0',\n eip2930: '0x1',\n eip1559: '0x2',\n eip4844: '0x3',\n eip7702: '0x4',\n};\nexport function formatTransactionRequest(request, _) {\n const rpcRequest = {};\n if (typeof request.authorizationList !== 'undefined')\n rpcRequest.authorizationList = formatAuthorizationList(request.authorizationList);\n if (typeof request.accessList !== 'undefined')\n rpcRequest.accessList = request.accessList;\n if (typeof request.blobVersionedHashes !== 'undefined')\n rpcRequest.blobVersionedHashes = request.blobVersionedHashes;\n if (typeof request.blobs !== 'undefined') {\n if (typeof request.blobs[0] !== 'string')\n rpcRequest.blobs = request.blobs.map((x) => bytesToHex(x));\n else\n rpcRequest.blobs = request.blobs;\n }\n if (typeof request.data !== 'undefined')\n rpcRequest.data = request.data;\n if (typeof request.from !== 'undefined')\n rpcRequest.from = request.from;\n if (typeof request.gas !== 'undefined')\n rpcRequest.gas = numberToHex(request.gas);\n if (typeof request.gasPrice !== 'undefined')\n rpcRequest.gasPrice = numberToHex(request.gasPrice);\n if (typeof request.maxFeePerBlobGas !== 'undefined')\n rpcRequest.maxFeePerBlobGas = numberToHex(request.maxFeePerBlobGas);\n if (typeof request.maxFeePerGas !== 'undefined')\n rpcRequest.maxFeePerGas = numberToHex(request.maxFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n rpcRequest.maxPriorityFeePerGas = numberToHex(request.maxPriorityFeePerGas);\n if (typeof request.nonce !== 'undefined')\n rpcRequest.nonce = numberToHex(request.nonce);\n if (typeof request.to !== 'undefined')\n rpcRequest.to = request.to;\n if (typeof request.type !== 'undefined')\n rpcRequest.type = rpcTransactionType[request.type];\n if (typeof request.value !== 'undefined')\n rpcRequest.value = numberToHex(request.value);\n return rpcRequest;\n}\nexport const defineTransactionRequest = /*#__PURE__*/ defineFormatter('transactionRequest', formatTransactionRequest);\n//////////////////////////////////////////////////////////////////////////////\nfunction formatAuthorizationList(authorizationList) {\n return authorizationList.map((authorization) => ({\n address: authorization.address,\n r: authorization.r\n ? numberToHex(BigInt(authorization.r))\n : authorization.r,\n s: authorization.s\n ? numberToHex(BigInt(authorization.s))\n : authorization.s,\n chainId: numberToHex(authorization.chainId),\n nonce: numberToHex(authorization.nonce),\n ...(typeof authorization.yParity !== 'undefined'\n ? { yParity: numberToHex(authorization.yParity) }\n : {}),\n ...(typeof authorization.v !== 'undefined' &&\n typeof authorization.yParity === 'undefined'\n ? { v: numberToHex(authorization.v) }\n : {}),\n }));\n}\n//# sourceMappingURL=transactionRequest.js.map","import { InvalidAddressError, } from '../errors/address.js';\nimport { InvalidBytesLengthError, } from '../errors/data.js';\nimport { AccountStateConflictError, StateAssignmentConflictError, } from '../errors/stateOverride.js';\nimport { isAddress } from './address/isAddress.js';\nimport { numberToHex } from './encoding/toHex.js';\n/** @internal */\nexport function serializeStateMapping(stateMapping) {\n if (!stateMapping || stateMapping.length === 0)\n return undefined;\n return stateMapping.reduce((acc, { slot, value }) => {\n if (slot.length !== 66)\n throw new InvalidBytesLengthError({\n size: slot.length,\n targetSize: 66,\n type: 'hex',\n });\n if (value.length !== 66)\n throw new InvalidBytesLengthError({\n size: value.length,\n targetSize: 66,\n type: 'hex',\n });\n acc[slot] = value;\n return acc;\n }, {});\n}\n/** @internal */\nexport function serializeAccountStateOverride(parameters) {\n const { balance, nonce, state, stateDiff, code } = parameters;\n const rpcAccountStateOverride = {};\n if (code !== undefined)\n rpcAccountStateOverride.code = code;\n if (balance !== undefined)\n rpcAccountStateOverride.balance = numberToHex(balance);\n if (nonce !== undefined)\n rpcAccountStateOverride.nonce = numberToHex(nonce);\n if (state !== undefined)\n rpcAccountStateOverride.state = serializeStateMapping(state);\n if (stateDiff !== undefined) {\n if (rpcAccountStateOverride.state)\n throw new StateAssignmentConflictError();\n rpcAccountStateOverride.stateDiff = serializeStateMapping(stateDiff);\n }\n return rpcAccountStateOverride;\n}\n/** @internal */\nexport function serializeStateOverride(parameters) {\n if (!parameters)\n return undefined;\n const rpcStateOverride = {};\n for (const { address, ...accountState } of parameters) {\n if (!isAddress(address, { strict: false }))\n throw new InvalidAddressError({ address });\n if (rpcStateOverride[address])\n throw new AccountStateConflictError({ address: address });\n rpcStateOverride[address] = serializeAccountStateOverride(accountState);\n }\n return rpcStateOverride;\n}\n//# sourceMappingURL=stateOverride.js.map","export const maxInt8 = 2n ** (8n - 1n) - 1n;\nexport const maxInt16 = 2n ** (16n - 1n) - 1n;\nexport const maxInt24 = 2n ** (24n - 1n) - 1n;\nexport const maxInt32 = 2n ** (32n - 1n) - 1n;\nexport const maxInt40 = 2n ** (40n - 1n) - 1n;\nexport const maxInt48 = 2n ** (48n - 1n) - 1n;\nexport const maxInt56 = 2n ** (56n - 1n) - 1n;\nexport const maxInt64 = 2n ** (64n - 1n) - 1n;\nexport const maxInt72 = 2n ** (72n - 1n) - 1n;\nexport const maxInt80 = 2n ** (80n - 1n) - 1n;\nexport const maxInt88 = 2n ** (88n - 1n) - 1n;\nexport const maxInt96 = 2n ** (96n - 1n) - 1n;\nexport const maxInt104 = 2n ** (104n - 1n) - 1n;\nexport const maxInt112 = 2n ** (112n - 1n) - 1n;\nexport const maxInt120 = 2n ** (120n - 1n) - 1n;\nexport const maxInt128 = 2n ** (128n - 1n) - 1n;\nexport const maxInt136 = 2n ** (136n - 1n) - 1n;\nexport const maxInt144 = 2n ** (144n - 1n) - 1n;\nexport const maxInt152 = 2n ** (152n - 1n) - 1n;\nexport const maxInt160 = 2n ** (160n - 1n) - 1n;\nexport const maxInt168 = 2n ** (168n - 1n) - 1n;\nexport const maxInt176 = 2n ** (176n - 1n) - 1n;\nexport const maxInt184 = 2n ** (184n - 1n) - 1n;\nexport const maxInt192 = 2n ** (192n - 1n) - 1n;\nexport const maxInt200 = 2n ** (200n - 1n) - 1n;\nexport const maxInt208 = 2n ** (208n - 1n) - 1n;\nexport const maxInt216 = 2n ** (216n - 1n) - 1n;\nexport const maxInt224 = 2n ** (224n - 1n) - 1n;\nexport const maxInt232 = 2n ** (232n - 1n) - 1n;\nexport const maxInt240 = 2n ** (240n - 1n) - 1n;\nexport const maxInt248 = 2n ** (248n - 1n) - 1n;\nexport const maxInt256 = 2n ** (256n - 1n) - 1n;\nexport const minInt8 = -(2n ** (8n - 1n));\nexport const minInt16 = -(2n ** (16n - 1n));\nexport const minInt24 = -(2n ** (24n - 1n));\nexport const minInt32 = -(2n ** (32n - 1n));\nexport const minInt40 = -(2n ** (40n - 1n));\nexport const minInt48 = -(2n ** (48n - 1n));\nexport const minInt56 = -(2n ** (56n - 1n));\nexport const minInt64 = -(2n ** (64n - 1n));\nexport const minInt72 = -(2n ** (72n - 1n));\nexport const minInt80 = -(2n ** (80n - 1n));\nexport const minInt88 = -(2n ** (88n - 1n));\nexport const minInt96 = -(2n ** (96n - 1n));\nexport const minInt104 = -(2n ** (104n - 1n));\nexport const minInt112 = -(2n ** (112n - 1n));\nexport const minInt120 = -(2n ** (120n - 1n));\nexport const minInt128 = -(2n ** (128n - 1n));\nexport const minInt136 = -(2n ** (136n - 1n));\nexport const minInt144 = -(2n ** (144n - 1n));\nexport const minInt152 = -(2n ** (152n - 1n));\nexport const minInt160 = -(2n ** (160n - 1n));\nexport const minInt168 = -(2n ** (168n - 1n));\nexport const minInt176 = -(2n ** (176n - 1n));\nexport const minInt184 = -(2n ** (184n - 1n));\nexport const minInt192 = -(2n ** (192n - 1n));\nexport const minInt200 = -(2n ** (200n - 1n));\nexport const minInt208 = -(2n ** (208n - 1n));\nexport const minInt216 = -(2n ** (216n - 1n));\nexport const minInt224 = -(2n ** (224n - 1n));\nexport const minInt232 = -(2n ** (232n - 1n));\nexport const minInt240 = -(2n ** (240n - 1n));\nexport const minInt248 = -(2n ** (248n - 1n));\nexport const minInt256 = -(2n ** (256n - 1n));\nexport const maxUint8 = 2n ** 8n - 1n;\nexport const maxUint16 = 2n ** 16n - 1n;\nexport const maxUint24 = 2n ** 24n - 1n;\nexport const maxUint32 = 2n ** 32n - 1n;\nexport const maxUint40 = 2n ** 40n - 1n;\nexport const maxUint48 = 2n ** 48n - 1n;\nexport const maxUint56 = 2n ** 56n - 1n;\nexport const maxUint64 = 2n ** 64n - 1n;\nexport const maxUint72 = 2n ** 72n - 1n;\nexport const maxUint80 = 2n ** 80n - 1n;\nexport const maxUint88 = 2n ** 88n - 1n;\nexport const maxUint96 = 2n ** 96n - 1n;\nexport const maxUint104 = 2n ** 104n - 1n;\nexport const maxUint112 = 2n ** 112n - 1n;\nexport const maxUint120 = 2n ** 120n - 1n;\nexport const maxUint128 = 2n ** 128n - 1n;\nexport const maxUint136 = 2n ** 136n - 1n;\nexport const maxUint144 = 2n ** 144n - 1n;\nexport const maxUint152 = 2n ** 152n - 1n;\nexport const maxUint160 = 2n ** 160n - 1n;\nexport const maxUint168 = 2n ** 168n - 1n;\nexport const maxUint176 = 2n ** 176n - 1n;\nexport const maxUint184 = 2n ** 184n - 1n;\nexport const maxUint192 = 2n ** 192n - 1n;\nexport const maxUint200 = 2n ** 200n - 1n;\nexport const maxUint208 = 2n ** 208n - 1n;\nexport const maxUint216 = 2n ** 216n - 1n;\nexport const maxUint224 = 2n ** 224n - 1n;\nexport const maxUint232 = 2n ** 232n - 1n;\nexport const maxUint240 = 2n ** 240n - 1n;\nexport const maxUint248 = 2n ** 248n - 1n;\nexport const maxUint256 = 2n ** 256n - 1n;\n//# sourceMappingURL=number.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { maxUint256 } from '../../constants/number.js';\nimport { InvalidAddressError, } from '../../errors/address.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError, } from '../../errors/node.js';\nimport { FeeConflictError, } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\nexport function assertRequest(args) {\n const { account: account_, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n if (account && !isAddress(account.address))\n throw new InvalidAddressError({ address: account.address });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof gasPrice !== 'undefined' &&\n (typeof maxFeePerGas !== 'undefined' ||\n typeof maxPriorityFeePerGas !== 'undefined'))\n throw new FeeConflictError();\n if (maxFeePerGas && maxFeePerGas > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\n//# sourceMappingURL=assertRequest.js.map","import { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport class BaseFeeScalarError extends BaseError {\n constructor() {\n super('`baseFeeMultiplier` must be greater than 1.', {\n name: 'BaseFeeScalarError',\n });\n }\n}\nexport class Eip1559FeesNotSupportedError extends BaseError {\n constructor() {\n super('Chain does not support EIP-1559 fees.', {\n name: 'Eip1559FeesNotSupportedError',\n });\n }\n}\nexport class MaxFeePerGasTooLowError extends BaseError {\n constructor({ maxPriorityFeePerGas }) {\n super(`\\`maxFeePerGas\\` cannot be less than the \\`maxPriorityFeePerGas\\` (${formatGwei(maxPriorityFeePerGas)} gwei).`, { name: 'MaxFeePerGasTooLowError' });\n }\n}\n//# sourceMappingURL=fee.js.map","import { BaseError } from './base.js';\nexport class BlockNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, }) {\n let identifier = 'Block';\n if (blockHash)\n identifier = `Block at hash \"${blockHash}\"`;\n if (blockNumber)\n identifier = `Block at number \"${blockNumber}\"`;\n super(`${identifier} could not be found.`, { name: 'BlockNotFoundError' });\n }\n}\n//# sourceMappingURL=block.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nexport const transactionType = {\n '0x0': 'legacy',\n '0x1': 'eip2930',\n '0x2': 'eip1559',\n '0x3': 'eip4844',\n '0x4': 'eip7702',\n};\nexport function formatTransaction(transaction, _) {\n const transaction_ = {\n ...transaction,\n blockHash: transaction.blockHash ? transaction.blockHash : null,\n blockNumber: transaction.blockNumber\n ? BigInt(transaction.blockNumber)\n : null,\n chainId: transaction.chainId ? hexToNumber(transaction.chainId) : undefined,\n gas: transaction.gas ? BigInt(transaction.gas) : undefined,\n gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : undefined,\n maxFeePerBlobGas: transaction.maxFeePerBlobGas\n ? BigInt(transaction.maxFeePerBlobGas)\n : undefined,\n maxFeePerGas: transaction.maxFeePerGas\n ? BigInt(transaction.maxFeePerGas)\n : undefined,\n maxPriorityFeePerGas: transaction.maxPriorityFeePerGas\n ? BigInt(transaction.maxPriorityFeePerGas)\n : undefined,\n nonce: transaction.nonce ? hexToNumber(transaction.nonce) : undefined,\n to: transaction.to ? transaction.to : null,\n transactionIndex: transaction.transactionIndex\n ? Number(transaction.transactionIndex)\n : null,\n type: transaction.type\n ? transactionType[transaction.type]\n : undefined,\n typeHex: transaction.type ? transaction.type : undefined,\n value: transaction.value ? BigInt(transaction.value) : undefined,\n v: transaction.v ? BigInt(transaction.v) : undefined,\n };\n if (transaction.authorizationList)\n transaction_.authorizationList = formatAuthorizationList(transaction.authorizationList);\n transaction_.yParity = (() => {\n // If `yParity` is provided, we will use it.\n if (transaction.yParity)\n return Number(transaction.yParity);\n // If no `yParity` provided, try derive from `v`.\n if (typeof transaction_.v === 'bigint') {\n if (transaction_.v === 0n || transaction_.v === 27n)\n return 0;\n if (transaction_.v === 1n || transaction_.v === 28n)\n return 1;\n if (transaction_.v >= 35n)\n return transaction_.v % 2n === 0n ? 1 : 0;\n }\n return undefined;\n })();\n if (transaction_.type === 'legacy') {\n delete transaction_.accessList;\n delete transaction_.maxFeePerBlobGas;\n delete transaction_.maxFeePerGas;\n delete transaction_.maxPriorityFeePerGas;\n delete transaction_.yParity;\n }\n if (transaction_.type === 'eip2930') {\n delete transaction_.maxFeePerBlobGas;\n delete transaction_.maxFeePerGas;\n delete transaction_.maxPriorityFeePerGas;\n }\n if (transaction_.type === 'eip1559') {\n delete transaction_.maxFeePerBlobGas;\n }\n return transaction_;\n}\nexport const defineTransaction = /*#__PURE__*/ defineFormatter('transaction', formatTransaction);\n//////////////////////////////////////////////////////////////////////////////\nfunction formatAuthorizationList(authorizationList) {\n return authorizationList.map((authorization) => ({\n address: authorization.address,\n chainId: Number(authorization.chainId),\n nonce: Number(authorization.nonce),\n r: authorization.r,\n s: authorization.s,\n yParity: Number(authorization.yParity),\n }));\n}\n//# sourceMappingURL=transaction.js.map","import { defineFormatter } from './formatter.js';\nimport { formatTransaction } from './transaction.js';\nexport function formatBlock(block, _) {\n const transactions = (block.transactions ?? []).map((transaction) => {\n if (typeof transaction === 'string')\n return transaction;\n return formatTransaction(transaction);\n });\n return {\n ...block,\n baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,\n blobGasUsed: block.blobGasUsed ? BigInt(block.blobGasUsed) : undefined,\n difficulty: block.difficulty ? BigInt(block.difficulty) : undefined,\n excessBlobGas: block.excessBlobGas\n ? BigInt(block.excessBlobGas)\n : undefined,\n gasLimit: block.gasLimit ? BigInt(block.gasLimit) : undefined,\n gasUsed: block.gasUsed ? BigInt(block.gasUsed) : undefined,\n hash: block.hash ? block.hash : null,\n logsBloom: block.logsBloom ? block.logsBloom : null,\n nonce: block.nonce ? block.nonce : null,\n number: block.number ? BigInt(block.number) : null,\n size: block.size ? BigInt(block.size) : undefined,\n timestamp: block.timestamp ? BigInt(block.timestamp) : undefined,\n transactions,\n totalDifficulty: block.totalDifficulty\n ? BigInt(block.totalDifficulty)\n : null,\n };\n}\nexport const defineBlock = /*#__PURE__*/ defineFormatter('block', formatBlock);\n//# sourceMappingURL=block.js.map","import { BlockNotFoundError, } from '../../errors/block.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatBlock, } from '../../utils/formatters/block.js';\n/**\n * Returns information about a block at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlock\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockParameters}\n * @returns Information about the block. {@link GetBlockReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlock } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const block = await getBlock(client)\n */\nexport async function getBlock(client, { blockHash, blockNumber, blockTag = client.experimental_blockTag ?? 'latest', includeTransactions: includeTransactions_, } = {}) {\n const includeTransactions = includeTransactions_ ?? false;\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let block = null;\n if (blockHash) {\n block = await client.request({\n method: 'eth_getBlockByHash',\n params: [blockHash, includeTransactions],\n }, { dedupe: true });\n }\n else {\n block = await client.request({\n method: 'eth_getBlockByNumber',\n params: [blockNumberHex || blockTag, includeTransactions],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n if (!block)\n throw new BlockNotFoundError({ blockHash, blockNumber });\n const format = client.chain?.formatters?.block?.format || formatBlock;\n return format(block, 'getBlock');\n}\n//# sourceMappingURL=getBlock.js.map","/**\n * Returns the current price of gas (in wei).\n *\n * - Docs: https://viem.sh/docs/actions/public/getGasPrice\n * - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)\n *\n * @param client - Client to use\n * @returns The gas price (in wei). {@link GetGasPriceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getGasPrice } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasPrice = await getGasPrice(client)\n */\nexport async function getGasPrice(client) {\n const gasPrice = await client.request({\n method: 'eth_gasPrice',\n });\n return BigInt(gasPrice);\n}\n//# sourceMappingURL=getGasPrice.js.map","import { Eip1559FeesNotSupportedError, } from '../../errors/fee.js';\nimport { hexToBigInt, } from '../../utils/encoding/fromHex.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { getBlock } from './getBlock.js';\nimport { getGasPrice } from './getGasPrice.js';\n/**\n * Returns an estimate for the max priority fee per gas (in wei) for a\n * transaction to be likely included in the next block.\n * Defaults to [`chain.fees.defaultPriorityFee`](/docs/clients/chains#fees-defaultpriorityfee) if set.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas\n *\n * @param client - Client to use\n * @returns An estimate (in wei) for the max priority fee per gas. {@link EstimateMaxPriorityFeePerGasReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateMaxPriorityFeePerGas } from 'viem/actions'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const maxPriorityFeePerGas = await estimateMaxPriorityFeePerGas(client)\n * // 10000000n\n */\nexport async function estimateMaxPriorityFeePerGas(client, args) {\n return internal_estimateMaxPriorityFeePerGas(client, args);\n}\nexport async function internal_estimateMaxPriorityFeePerGas(client, args) {\n const { block: block_, chain = client.chain, request } = args || {};\n try {\n const maxPriorityFeePerGas = chain?.fees?.maxPriorityFeePerGas ?? chain?.fees?.defaultPriorityFee;\n if (typeof maxPriorityFeePerGas === 'function') {\n const block = block_ || (await getAction(client, getBlock, 'getBlock')({}));\n const maxPriorityFeePerGas_ = await maxPriorityFeePerGas({\n block,\n client,\n request,\n });\n if (maxPriorityFeePerGas_ === null)\n throw new Error();\n return maxPriorityFeePerGas_;\n }\n if (typeof maxPriorityFeePerGas !== 'undefined')\n return maxPriorityFeePerGas;\n const maxPriorityFeePerGasHex = await client.request({\n method: 'eth_maxPriorityFeePerGas',\n });\n return hexToBigInt(maxPriorityFeePerGasHex);\n }\n catch {\n // If the RPC Provider does not support `eth_maxPriorityFeePerGas`\n // fall back to calculating it manually via `gasPrice - baseFeePerGas`.\n // See: https://github.com/ethereum/pm/issues/328#:~:text=eth_maxPriorityFeePerGas%20after%20London%20will%20effectively%20return%20eth_gasPrice%20%2D%20baseFee\n const [block, gasPrice] = await Promise.all([\n block_\n ? Promise.resolve(block_)\n : getAction(client, getBlock, 'getBlock')({}),\n getAction(client, getGasPrice, 'getGasPrice')({}),\n ]);\n if (typeof block.baseFeePerGas !== 'bigint')\n throw new Eip1559FeesNotSupportedError();\n const maxPriorityFeePerGas = gasPrice - block.baseFeePerGas;\n if (maxPriorityFeePerGas < 0n)\n return 0n;\n return maxPriorityFeePerGas;\n }\n}\n//# sourceMappingURL=estimateMaxPriorityFeePerGas.js.map","import { BaseFeeScalarError, Eip1559FeesNotSupportedError, } from '../../errors/fee.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { internal_estimateMaxPriorityFeePerGas, } from './estimateMaxPriorityFeePerGas.js';\nimport { getBlock } from './getBlock.js';\nimport { getGasPrice } from './getGasPrice.js';\n/**\n * Returns an estimate for the fees per gas (in wei) for a\n * transaction to be likely included in the next block.\n * Defaults to [`chain.fees.estimateFeesPerGas`](/docs/clients/chains#fees-estimatefeespergas) if set.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateFeesPerGasParameters}\n * @returns An estimate (in wei) for the fees per gas. {@link EstimateFeesPerGasReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateFeesPerGas } from 'viem/actions'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const maxPriorityFeePerGas = await estimateFeesPerGas(client)\n * // { maxFeePerGas: ..., maxPriorityFeePerGas: ... }\n */\nexport async function estimateFeesPerGas(client, args) {\n return internal_estimateFeesPerGas(client, args);\n}\nexport async function internal_estimateFeesPerGas(client, args) {\n const { block: block_, chain = client.chain, request, type = 'eip1559', } = args || {};\n const baseFeeMultiplier = await (async () => {\n if (typeof chain?.fees?.baseFeeMultiplier === 'function')\n return chain.fees.baseFeeMultiplier({\n block: block_,\n client,\n request,\n });\n return chain?.fees?.baseFeeMultiplier ?? 1.2;\n })();\n if (baseFeeMultiplier < 1)\n throw new BaseFeeScalarError();\n const decimals = baseFeeMultiplier.toString().split('.')[1]?.length ?? 0;\n const denominator = 10 ** decimals;\n const multiply = (base) => (base * BigInt(Math.ceil(baseFeeMultiplier * denominator))) /\n BigInt(denominator);\n const block = block_\n ? block_\n : await getAction(client, getBlock, 'getBlock')({});\n if (typeof chain?.fees?.estimateFeesPerGas === 'function') {\n const fees = (await chain.fees.estimateFeesPerGas({\n block: block_,\n client,\n multiply,\n request,\n type,\n }));\n if (fees !== null)\n return fees;\n }\n if (type === 'eip1559') {\n if (typeof block.baseFeePerGas !== 'bigint')\n throw new Eip1559FeesNotSupportedError();\n const maxPriorityFeePerGas = typeof request?.maxPriorityFeePerGas === 'bigint'\n ? request.maxPriorityFeePerGas\n : await internal_estimateMaxPriorityFeePerGas(client, {\n block: block,\n chain,\n request,\n });\n const baseFeePerGas = multiply(block.baseFeePerGas);\n const maxFeePerGas = request?.maxFeePerGas ?? baseFeePerGas + maxPriorityFeePerGas;\n return {\n maxFeePerGas,\n maxPriorityFeePerGas,\n };\n }\n const gasPrice = request?.gasPrice ??\n multiply(await getAction(client, getGasPrice, 'getGasPrice')({}));\n return {\n gasPrice,\n };\n}\n//# sourceMappingURL=estimateFeesPerGas.js.map","import { hexToNumber, } from '../../utils/encoding/fromHex.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has sent.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionCount\n * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionCountParameters}\n * @returns The number of transactions an account has sent. {@link GetTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionCount = await getTransactionCount(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function getTransactionCount(client, { address, blockTag = 'latest', blockNumber }) {\n const count = await client.request({\n method: 'eth_getTransactionCount',\n params: [\n address,\n typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : blockTag,\n ],\n }, {\n dedupe: Boolean(blockNumber),\n });\n return hexToNumber(count);\n}\n//# sourceMappingURL=getTransactionCount.js.map","import { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Compute commitments from a list of blobs.\n *\n * @example\n * ```ts\n * import { blobsToCommitments, toBlobs } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * ```\n */\nexport function blobsToCommitments(parameters) {\n const { kzg } = parameters;\n const to = parameters.to ?? (typeof parameters.blobs[0] === 'string' ? 'hex' : 'bytes');\n const blobs = (typeof parameters.blobs[0] === 'string'\n ? parameters.blobs.map((x) => hexToBytes(x))\n : parameters.blobs);\n const commitments = [];\n for (const blob of blobs)\n commitments.push(Uint8Array.from(kzg.blobToKzgCommitment(blob)));\n return (to === 'bytes'\n ? commitments\n : commitments.map((x) => bytesToHex(x)));\n}\n//# sourceMappingURL=blobsToCommitments.js.map","import { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Compute the proofs for a list of blobs and their commitments.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const proofs = blobsToProofs({ blobs, commitments, kzg })\n * ```\n */\nexport function blobsToProofs(parameters) {\n const { kzg } = parameters;\n const to = parameters.to ?? (typeof parameters.blobs[0] === 'string' ? 'hex' : 'bytes');\n const blobs = (typeof parameters.blobs[0] === 'string'\n ? parameters.blobs.map((x) => hexToBytes(x))\n : parameters.blobs);\n const commitments = (typeof parameters.commitments[0] === 'string'\n ? parameters.commitments.map((x) => hexToBytes(x))\n : parameters.commitments);\n const proofs = [];\n for (let i = 0; i < blobs.length; i++) {\n const blob = blobs[i];\n const commitment = commitments[i];\n proofs.push(Uint8Array.from(kzg.computeBlobKzgProof(blob, commitment)));\n }\n return (to === 'bytes'\n ? proofs\n : proofs.map((x) => bytesToHex(x)));\n}\n//# sourceMappingURL=blobsToProofs.js.map","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { Hash, abytes, aexists, aoutput, clean, createView, toBytes } from \"./utils.js\";\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nexport function setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n/** Choice: a ? b : c */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport class HashMD extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n//# sourceMappingURL=_md.js.map","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, rotr } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD {\n constructor(outputLen = 32) {\n super(64, outputLen, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = SHA256_IV[0] | 0;\n this.B = SHA256_IV[1] | 0;\n this.C = SHA256_IV[2] | 0;\n this.D = SHA256_IV[3] | 0;\n this.E = SHA256_IV[4] | 0;\n this.F = SHA256_IV[5] | 0;\n this.G = SHA256_IV[6] | 0;\n this.H = SHA256_IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\nexport class SHA224 extends SHA256 {\n constructor() {\n super(28);\n this.A = SHA224_IV[0] | 0;\n this.B = SHA224_IV[1] | 0;\n this.C = SHA224_IV[2] | 0;\n this.D = SHA224_IV[3] | 0;\n this.E = SHA224_IV[4] | 0;\n this.F = SHA224_IV[5] | 0;\n this.G = SHA224_IV[6] | 0;\n this.H = SHA224_IV[7] | 0;\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends HashMD {\n constructor(outputLen = 64) {\n super(128, outputLen, 16, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = SHA512_IV[0] | 0;\n this.Al = SHA512_IV[1] | 0;\n this.Bh = SHA512_IV[2] | 0;\n this.Bl = SHA512_IV[3] | 0;\n this.Ch = SHA512_IV[4] | 0;\n this.Cl = SHA512_IV[5] | 0;\n this.Dh = SHA512_IV[6] | 0;\n this.Dl = SHA512_IV[7] | 0;\n this.Eh = SHA512_IV[8] | 0;\n this.El = SHA512_IV[9] | 0;\n this.Fh = SHA512_IV[10] | 0;\n this.Fl = SHA512_IV[11] | 0;\n this.Gh = SHA512_IV[12] | 0;\n this.Gl = SHA512_IV[13] | 0;\n this.Hh = SHA512_IV[14] | 0;\n this.Hl = SHA512_IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nexport class SHA384 extends SHA512 {\n constructor() {\n super(48);\n this.Ah = SHA384_IV[0] | 0;\n this.Al = SHA384_IV[1] | 0;\n this.Bh = SHA384_IV[2] | 0;\n this.Bl = SHA384_IV[3] | 0;\n this.Ch = SHA384_IV[4] | 0;\n this.Cl = SHA384_IV[5] | 0;\n this.Dh = SHA384_IV[6] | 0;\n this.Dl = SHA384_IV[7] | 0;\n this.Eh = SHA384_IV[8] | 0;\n this.El = SHA384_IV[9] | 0;\n this.Fh = SHA384_IV[10] | 0;\n this.Fl = SHA384_IV[11] | 0;\n this.Gh = SHA384_IV[12] | 0;\n this.Gl = SHA384_IV[13] | 0;\n this.Hh = SHA384_IV[14] | 0;\n this.Hl = SHA384_IV[15] | 0;\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\nexport class SHA512_224 extends SHA512 {\n constructor() {\n super(28);\n this.Ah = T224_IV[0] | 0;\n this.Al = T224_IV[1] | 0;\n this.Bh = T224_IV[2] | 0;\n this.Bl = T224_IV[3] | 0;\n this.Ch = T224_IV[4] | 0;\n this.Cl = T224_IV[5] | 0;\n this.Dh = T224_IV[6] | 0;\n this.Dl = T224_IV[7] | 0;\n this.Eh = T224_IV[8] | 0;\n this.El = T224_IV[9] | 0;\n this.Fh = T224_IV[10] | 0;\n this.Fl = T224_IV[11] | 0;\n this.Gh = T224_IV[12] | 0;\n this.Gl = T224_IV[13] | 0;\n this.Hh = T224_IV[14] | 0;\n this.Hl = T224_IV[15] | 0;\n }\n}\nexport class SHA512_256 extends SHA512 {\n constructor() {\n super(32);\n this.Ah = T256_IV[0] | 0;\n this.Al = T256_IV[1] | 0;\n this.Bh = T256_IV[2] | 0;\n this.Bl = T256_IV[3] | 0;\n this.Ch = T256_IV[4] | 0;\n this.Cl = T256_IV[5] | 0;\n this.Dh = T256_IV[6] | 0;\n this.Dl = T256_IV[7] | 0;\n this.Eh = T256_IV[8] | 0;\n this.El = T256_IV[9] | 0;\n this.Fh = T256_IV[10] | 0;\n this.Fl = T256_IV[11] | 0;\n this.Gh = T256_IV[12] | 0;\n this.Gl = T256_IV[13] | 0;\n this.Hh = T256_IV[14] | 0;\n this.Hl = T256_IV[15] | 0;\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new SHA224());\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new SHA384());\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new SHA512_224());\n//# sourceMappingURL=sha2.js.map","/**\n * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.\n *\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n *\n * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n * @deprecated\n */\nimport { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n, } from \"./sha2.js\";\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA256 = SHA256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha256 = sha256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA224 = SHA224n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha224 = sha224n;\n//# sourceMappingURL=sha256.js.map","import { bytesToHex } from '../encoding/toHex.js';\nimport { sha256 } from '../hash/sha256.js';\n/**\n * Transform a commitment to it's versioned hash.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * commitmentToVersionedHash,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const [commitment] = blobsToCommitments({ blobs, kzg })\n * const versionedHash = commitmentToVersionedHash({ commitment })\n * ```\n */\nexport function commitmentToVersionedHash(parameters) {\n const { commitment, version = 1 } = parameters;\n const to = parameters.to ?? (typeof commitment === 'string' ? 'hex' : 'bytes');\n const versionedHash = sha256(commitment, 'bytes');\n versionedHash.set([version], 0);\n return (to === 'bytes' ? versionedHash : bytesToHex(versionedHash));\n}\n//# sourceMappingURL=commitmentToVersionedHash.js.map","import { sha256 as noble_sha256 } from '@noble/hashes/sha256';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function sha256(value, to_) {\n const to = to_ || 'hex';\n const bytes = noble_sha256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=sha256.js.map","import { commitmentToVersionedHash, } from './commitmentToVersionedHash.js';\n/**\n * Transform a list of commitments to their versioned hashes.\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * commitmentsToVersionedHashes,\n * toBlobs\n * } from 'viem'\n * import { kzg } from './kzg'\n *\n * const blobs = toBlobs({ data: '0x1234' })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const versionedHashes = commitmentsToVersionedHashes({ commitments })\n * ```\n */\nexport function commitmentsToVersionedHashes(parameters) {\n const { commitments, version } = parameters;\n const to = parameters.to ?? (typeof commitments[0] === 'string' ? 'hex' : 'bytes');\n const hashes = [];\n for (const commitment of commitments) {\n hashes.push(commitmentToVersionedHash({\n commitment,\n to,\n version,\n }));\n }\n return hashes;\n}\n//# sourceMappingURL=commitmentsToVersionedHashes.js.map","// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md#parameters\n/** Blob limit per transaction. */\nconst blobsPerTransaction = 6;\n/** The number of bytes in a BLS scalar field element. */\nexport const bytesPerFieldElement = 32;\n/** The number of field elements in a blob. */\nexport const fieldElementsPerBlob = 4096;\n/** The number of bytes in a blob. */\nexport const bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;\n/** Blob bytes limit per transaction. */\nexport const maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction -\n // terminator byte (0x80).\n 1 -\n // zero byte (0x00) appended to each field element.\n 1 * fieldElementsPerBlob * blobsPerTransaction;\n//# sourceMappingURL=blob.js.map","import { versionedHashVersionKzg } from '../constants/kzg.js';\nimport { BaseError } from './base.js';\nexport class BlobSizeTooLargeError extends BaseError {\n constructor({ maxSize, size }) {\n super('Blob size is too large.', {\n metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size} bytes`],\n name: 'BlobSizeTooLargeError',\n });\n }\n}\nexport class EmptyBlobError extends BaseError {\n constructor() {\n super('Blob data must not be empty.', { name: 'EmptyBlobError' });\n }\n}\nexport class InvalidVersionedHashSizeError extends BaseError {\n constructor({ hash, size, }) {\n super(`Versioned hash \"${hash}\" size is invalid.`, {\n metaMessages: ['Expected: 32', `Received: ${size}`],\n name: 'InvalidVersionedHashSizeError',\n });\n }\n}\nexport class InvalidVersionedHashVersionError extends BaseError {\n constructor({ hash, version, }) {\n super(`Versioned hash \"${hash}\" version is invalid.`, {\n metaMessages: [\n `Expected: ${versionedHashVersionKzg}`,\n `Received: ${version}`,\n ],\n name: 'InvalidVersionedHashVersionError',\n });\n }\n}\n//# sourceMappingURL=blob.js.map","import { blobsToCommitments, } from './blobsToCommitments.js';\nimport { blobsToProofs } from './blobsToProofs.js';\nimport { toBlobs } from './toBlobs.js';\n/**\n * Transforms arbitrary data (or blobs, commitments, & proofs) into a sidecar array.\n *\n * @example\n * ```ts\n * import { toBlobSidecars, stringToHex } from 'viem'\n *\n * const sidecars = toBlobSidecars({ data: stringToHex('hello world') })\n * ```\n *\n * @example\n * ```ts\n * import {\n * blobsToCommitments,\n * toBlobs,\n * blobsToProofs,\n * toBlobSidecars,\n * stringToHex\n * } from 'viem'\n *\n * const blobs = toBlobs({ data: stringToHex('hello world') })\n * const commitments = blobsToCommitments({ blobs, kzg })\n * const proofs = blobsToProofs({ blobs, commitments, kzg })\n *\n * const sidecars = toBlobSidecars({ blobs, commitments, proofs })\n * ```\n */\nexport function toBlobSidecars(parameters) {\n const { data, kzg, to } = parameters;\n const blobs = parameters.blobs ?? toBlobs({ data: data, to });\n const commitments = parameters.commitments ?? blobsToCommitments({ blobs, kzg: kzg, to });\n const proofs = parameters.proofs ?? blobsToProofs({ blobs, commitments, kzg: kzg, to });\n const sidecars = [];\n for (let i = 0; i < blobs.length; i++)\n sidecars.push({\n blob: blobs[i],\n commitment: commitments[i],\n proof: proofs[i],\n });\n return sidecars;\n}\n//# sourceMappingURL=toBlobSidecars.js.map","import { bytesPerBlob, bytesPerFieldElement, fieldElementsPerBlob, maxBytesPerTransaction, } from '../../constants/blob.js';\nimport { BlobSizeTooLargeError, EmptyBlobError, } from '../../errors/blob.js';\nimport { createCursor } from '../cursor.js';\nimport { size } from '../data/size.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\n/**\n * Transforms arbitrary data to blobs.\n *\n * @example\n * ```ts\n * import { toBlobs, stringToHex } from 'viem'\n *\n * const blobs = toBlobs({ data: stringToHex('hello world') })\n * ```\n */\nexport function toBlobs(parameters) {\n const to = parameters.to ?? (typeof parameters.data === 'string' ? 'hex' : 'bytes');\n const data = (typeof parameters.data === 'string'\n ? hexToBytes(parameters.data)\n : parameters.data);\n const size_ = size(data);\n if (!size_)\n throw new EmptyBlobError();\n if (size_ > maxBytesPerTransaction)\n throw new BlobSizeTooLargeError({\n maxSize: maxBytesPerTransaction,\n size: size_,\n });\n const blobs = [];\n let active = true;\n let position = 0;\n while (active) {\n const blob = createCursor(new Uint8Array(bytesPerBlob));\n let size = 0;\n while (size < fieldElementsPerBlob) {\n const bytes = data.slice(position, position + (bytesPerFieldElement - 1));\n // Push a zero byte so the field element doesn't overflow the BLS modulus.\n blob.pushByte(0x00);\n // Push the current segment of data bytes.\n blob.pushBytes(bytes);\n // If we detect that the current segment of data bytes is less than 31 bytes,\n // we can stop processing and push a terminator byte to indicate the end of the blob.\n if (bytes.length < 31) {\n blob.pushByte(0x80);\n active = false;\n break;\n }\n size++;\n position += 31;\n }\n blobs.push(blob);\n }\n return (to === 'bytes'\n ? blobs.map((x) => x.bytes)\n : blobs.map((x) => bytesToHex(x.bytes)));\n}\n//# sourceMappingURL=toBlobs.js.map","import { InvalidSerializableTransactionError, } from '../../errors/transaction.js';\nexport function getTransactionType(transaction) {\n if (transaction.type)\n return transaction.type;\n if (typeof transaction.authorizationList !== 'undefined')\n return 'eip7702';\n if (typeof transaction.blobs !== 'undefined' ||\n typeof transaction.blobVersionedHashes !== 'undefined' ||\n typeof transaction.maxFeePerBlobGas !== 'undefined' ||\n typeof transaction.sidecars !== 'undefined')\n return 'eip4844';\n if (typeof transaction.maxFeePerGas !== 'undefined' ||\n typeof transaction.maxPriorityFeePerGas !== 'undefined') {\n return 'eip1559';\n }\n if (typeof transaction.gasPrice !== 'undefined') {\n if (typeof transaction.accessList !== 'undefined')\n return 'eip2930';\n return 'legacy';\n }\n throw new InvalidSerializableTransactionError({ transaction });\n}\n//# sourceMappingURL=getTransactionType.js.map","import { hexToNumber, } from '../../utils/encoding/fromHex.js';\n/**\n * Returns the chain ID associated with the current network.\n *\n * - Docs: https://viem.sh/docs/actions/public/getChainId\n * - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)\n *\n * @param client - Client to use\n * @returns The current chain ID. {@link GetChainIdReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getChainId } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const chainId = await getChainId(client)\n * // 1\n */\nexport async function getChainId(client) {\n const chainIdHex = await client.request({\n method: 'eth_chainId',\n }, { dedupe: true });\n return hexToNumber(chainIdHex);\n}\n//# sourceMappingURL=getChainId.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { internal_estimateFeesPerGas, } from '../../actions/public/estimateFeesPerGas.js';\nimport { estimateGas, } from '../../actions/public/estimateGas.js';\nimport { getBlock as getBlock_, } from '../../actions/public/getBlock.js';\nimport { getTransactionCount, } from '../../actions/public/getTransactionCount.js';\nimport { Eip1559FeesNotSupportedError, MaxFeePerGasTooLowError, } from '../../errors/fee.js';\nimport { blobsToCommitments } from '../../utils/blob/blobsToCommitments.js';\nimport { blobsToProofs } from '../../utils/blob/blobsToProofs.js';\nimport { commitmentsToVersionedHashes } from '../../utils/blob/commitmentsToVersionedHashes.js';\nimport { toBlobSidecars } from '../../utils/blob/toBlobSidecars.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { getTransactionType, } from '../../utils/transaction/getTransactionType.js';\nimport { getChainId as getChainId_ } from '../public/getChainId.js';\nexport const defaultParameters = [\n 'blobVersionedHashes',\n 'chainId',\n 'fees',\n 'gas',\n 'nonce',\n 'type',\n];\n/** @internal */\nexport const eip1559NetworkCache = /*#__PURE__*/ new Map();\n/**\n * Prepares a transaction request for signing.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest\n *\n * @param args - {@link PrepareTransactionRequestParameters}\n * @returns The transaction request. {@link PrepareTransactionRequestReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { prepareTransactionRequest } from 'viem/actions'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const request = await prepareTransactionRequest(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * to: '0x0000000000000000000000000000000000000000',\n * value: 1n,\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { prepareTransactionRequest } from 'viem/actions'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const request = await prepareTransactionRequest(client, {\n * to: '0x0000000000000000000000000000000000000000',\n * value: 1n,\n * })\n */\nexport async function prepareTransactionRequest(client, args) {\n const { account: account_ = client.account, blobs, chain, gas, kzg, nonce, nonceManager, parameters = defaultParameters, type, } = args;\n const account = account_ ? parseAccount(account_) : account_;\n const request = { ...args, ...(account ? { from: account?.address } : {}) };\n let block;\n async function getBlock() {\n if (block)\n return block;\n block = await getAction(client, getBlock_, 'getBlock')({ blockTag: 'latest' });\n return block;\n }\n let chainId;\n async function getChainId() {\n if (chainId)\n return chainId;\n if (chain)\n return chain.id;\n if (typeof args.chainId !== 'undefined')\n return args.chainId;\n const chainId_ = await getAction(client, getChainId_, 'getChainId')({});\n chainId = chainId_;\n return chainId;\n }\n if (parameters.includes('nonce') && typeof nonce === 'undefined' && account) {\n if (nonceManager) {\n const chainId = await getChainId();\n request.nonce = await nonceManager.consume({\n address: account.address,\n chainId,\n client,\n });\n }\n else {\n request.nonce = await getAction(client, getTransactionCount, 'getTransactionCount')({\n address: account.address,\n blockTag: 'pending',\n });\n }\n }\n if ((parameters.includes('blobVersionedHashes') ||\n parameters.includes('sidecars')) &&\n blobs &&\n kzg) {\n const commitments = blobsToCommitments({ blobs, kzg });\n if (parameters.includes('blobVersionedHashes')) {\n const versionedHashes = commitmentsToVersionedHashes({\n commitments,\n to: 'hex',\n });\n request.blobVersionedHashes = versionedHashes;\n }\n if (parameters.includes('sidecars')) {\n const proofs = blobsToProofs({ blobs, commitments, kzg });\n const sidecars = toBlobSidecars({\n blobs,\n commitments,\n proofs,\n to: 'hex',\n });\n request.sidecars = sidecars;\n }\n }\n if (parameters.includes('chainId'))\n request.chainId = await getChainId();\n if ((parameters.includes('fees') || parameters.includes('type')) &&\n typeof type === 'undefined') {\n try {\n request.type = getTransactionType(request);\n }\n catch {\n let isEip1559Network = eip1559NetworkCache.get(client.uid);\n if (typeof isEip1559Network === 'undefined') {\n const block = await getBlock();\n isEip1559Network = typeof block?.baseFeePerGas === 'bigint';\n eip1559NetworkCache.set(client.uid, isEip1559Network);\n }\n request.type = isEip1559Network ? 'eip1559' : 'legacy';\n }\n }\n if (parameters.includes('fees')) {\n // TODO(4844): derive blob base fees once https://github.com/ethereum/execution-apis/pull/486 is merged.\n if (request.type !== 'legacy' && request.type !== 'eip2930') {\n // EIP-1559 fees\n if (typeof request.maxFeePerGas === 'undefined' ||\n typeof request.maxPriorityFeePerGas === 'undefined') {\n const block = await getBlock();\n const { maxFeePerGas, maxPriorityFeePerGas } = await internal_estimateFeesPerGas(client, {\n block: block,\n chain,\n request: request,\n });\n if (typeof args.maxPriorityFeePerGas === 'undefined' &&\n args.maxFeePerGas &&\n args.maxFeePerGas < maxPriorityFeePerGas)\n throw new MaxFeePerGasTooLowError({\n maxPriorityFeePerGas,\n });\n request.maxPriorityFeePerGas = maxPriorityFeePerGas;\n request.maxFeePerGas = maxFeePerGas;\n }\n }\n else {\n // Legacy fees\n if (typeof args.maxFeePerGas !== 'undefined' ||\n typeof args.maxPriorityFeePerGas !== 'undefined')\n throw new Eip1559FeesNotSupportedError();\n if (typeof args.gasPrice === 'undefined') {\n const block = await getBlock();\n const { gasPrice: gasPrice_ } = await internal_estimateFeesPerGas(client, {\n block: block,\n chain,\n request: request,\n type: 'legacy',\n });\n request.gasPrice = gasPrice_;\n }\n }\n }\n if (parameters.includes('gas') && typeof gas === 'undefined')\n request.gas = await getAction(client, estimateGas, 'estimateGas')({\n ...request,\n account: account\n ? { address: account.address, type: 'json-rpc' }\n : account,\n });\n assertRequest(request);\n delete request.parameters;\n return request;\n}\n//# sourceMappingURL=prepareTransactionRequest.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { BaseError } from '../../errors/base.js';\nimport { recoverAuthorizationAddress, } from '../../utils/authorization/recoverAuthorizationAddress.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getEstimateGasError, } from '../../utils/errors/getEstimateGasError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { serializeStateOverride } from '../../utils/stateOverride.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { prepareTransactionRequest, } from '../wallet/prepareTransactionRequest.js';\n/**\n * Estimates the gas necessary to complete a transaction without submitting it to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateGas\n * - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateGasParameters}\n * @returns The gas estimate (in gas units). {@link EstimateGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseEther } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateGas } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasEstimate = await estimateGas(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: parseEther('1'),\n * })\n */\nexport async function estimateGas(client, args) {\n const { account: account_ = client.account } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n try {\n const { accessList, authorizationList, blobs, blobVersionedHashes, blockNumber, blockTag, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, value, stateOverride, ...rest } = (await prepareTransactionRequest(client, {\n ...args,\n parameters: \n // Some RPC Providers do not compute versioned hashes from blobs. We will need\n // to compute them.\n account?.type === 'local' ? undefined : ['blobVersionedHashes'],\n }));\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const rpcStateOverride = serializeStateOverride(stateOverride);\n const to = await (async () => {\n // If `to` exists on the parameters, use that.\n if (rest.to)\n return rest.to;\n // If no `to` exists, and we are sending a EIP-7702 transaction, use the\n // address of the first authorization in the list.\n if (authorizationList && authorizationList.length > 0)\n return await recoverAuthorizationAddress({\n authorization: authorizationList[0],\n }).catch(() => {\n throw new BaseError('`to` is required. Could not infer from `authorizationList`');\n });\n // Otherwise, we are sending a deployment transaction.\n return undefined;\n })();\n assertRequest(args);\n const chainFormat = client.chain?.formatters?.transactionRequest?.format;\n const format = chainFormat || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format: chainFormat }),\n from: account?.address,\n accessList,\n authorizationList,\n blobs,\n blobVersionedHashes,\n data,\n gas,\n gasPrice,\n maxFeePerBlobGas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n }, 'estimateGas');\n return BigInt(await client.request({\n method: 'eth_estimateGas',\n params: rpcStateOverride\n ? [\n request,\n block ?? client.experimental_blockTag ?? 'latest',\n rpcStateOverride,\n ]\n : block\n ? [request, block]\n : [request],\n }));\n }\n catch (err) {\n throw getEstimateGasError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n//# sourceMappingURL=estimateGas.js.map","import { EstimateGasExecutionError, } from '../../errors/estimateGas.js';\nimport { UnknownNodeError } from '../../errors/node.js';\nimport { getNodeError, } from './getNodeError.js';\nexport function getEstimateGasError(err, { docsPath, ...args }) {\n const cause = (() => {\n const cause = getNodeError(err, args);\n if (cause instanceof UnknownNodeError)\n return err;\n return cause;\n })();\n return new EstimateGasExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getEstimateGasError.js.map","import { InvalidAddressError, } from '../../errors/address.js';\nimport { isAddress } from './isAddress.js';\nexport function isAddressEqual(a, b) {\n if (!isAddress(a, { strict: false }))\n throw new InvalidAddressError({ address: a });\n if (!isAddress(b, { strict: false }))\n throw new InvalidAddressError({ address: b });\n return a.toLowerCase() === b.toLowerCase();\n}\n//# sourceMappingURL=isAddressEqual.js.map","import { AbiDecodingDataSizeTooSmallError, AbiEventSignatureEmptyTopicsError, AbiEventSignatureNotFoundError, DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { PositionOutOfBoundsError } from '../../errors/cursor.js';\nimport { size } from '../data/size.js';\nimport { toEventSelector, } from '../hash/toEventSelector.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nconst docsPath = '/docs/contract/decodeEventLog';\nexport function decodeEventLog(parameters) {\n const { abi, data, strict: strict_, topics, } = parameters;\n const strict = strict_ ?? true;\n const [signature, ...argTopics] = topics;\n if (!signature)\n throw new AbiEventSignatureEmptyTopicsError({ docsPath });\n const abiItem = abi.find((x) => x.type === 'event' &&\n signature === toEventSelector(formatAbiItem(x)));\n if (!(abiItem && 'name' in abiItem) || abiItem.type !== 'event')\n throw new AbiEventSignatureNotFoundError(signature, { docsPath });\n const { name, inputs } = abiItem;\n const isUnnamed = inputs?.some((x) => !('name' in x && x.name));\n const args = isUnnamed ? [] : {};\n // Decode topics (indexed args).\n const indexedInputs = inputs\n .map((x, i) => [x, i])\n .filter(([x]) => 'indexed' in x && x.indexed);\n for (let i = 0; i < indexedInputs.length; i++) {\n const [param, argIndex] = indexedInputs[i];\n const topic = argTopics[i];\n if (!topic)\n throw new DecodeLogTopicsMismatch({\n abiItem,\n param: param,\n });\n args[isUnnamed ? argIndex : param.name || argIndex] = decodeTopic({\n param,\n value: topic,\n });\n }\n // Decode data (non-indexed args).\n const nonIndexedInputs = inputs.filter((x) => !('indexed' in x && x.indexed));\n if (nonIndexedInputs.length > 0) {\n if (data && data !== '0x') {\n try {\n const decodedData = decodeAbiParameters(nonIndexedInputs, data);\n if (decodedData) {\n if (isUnnamed)\n for (let i = 0; i < inputs.length; i++)\n args[i] = args[i] ?? decodedData.shift();\n else\n for (let i = 0; i < nonIndexedInputs.length; i++)\n args[nonIndexedInputs[i].name] = decodedData[i];\n }\n }\n catch (err) {\n if (strict) {\n if (err instanceof AbiDecodingDataSizeTooSmallError ||\n err instanceof PositionOutOfBoundsError)\n throw new DecodeLogDataMismatch({\n abiItem,\n data: data,\n params: nonIndexedInputs,\n size: size(data),\n });\n throw err;\n }\n }\n }\n else if (strict) {\n throw new DecodeLogDataMismatch({\n abiItem,\n data: '0x',\n params: nonIndexedInputs,\n size: 0,\n });\n }\n }\n return {\n eventName: name,\n args: Object.values(args).length > 0 ? args : undefined,\n };\n}\nfunction decodeTopic({ param, value }) {\n if (param.type === 'string' ||\n param.type === 'bytes' ||\n param.type === 'tuple' ||\n param.type.match(/^(.*)\\[(\\d+)?\\]$/))\n return value;\n const decodedArg = decodeAbiParameters([param], value) || [];\n return decodedArg[0];\n}\n//# sourceMappingURL=decodeEventLog.js.map","// TODO(v3): checksum address.\nimport { AbiEventSignatureNotFoundError, DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { isAddressEqual } from '../address/isAddressEqual.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { toEventSelector } from '../hash/toEventSelector.js';\nimport { decodeEventLog, } from './decodeEventLog.js';\n/**\n * Extracts & decodes logs matching the provided signature(s) (`abi` + optional `eventName`)\n * from a set of opaque logs.\n *\n * @param parameters - {@link ParseEventLogsParameters}\n * @returns The logs. {@link ParseEventLogsReturnType}\n *\n * @example\n * import { createClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { parseEventLogs } from 'viem/op-stack'\n *\n * const client = createClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const receipt = await getTransactionReceipt(client, {\n * hash: '0xec23b2ba4bc59ba61554507c1b1bc91649e6586eb2dd00c728e8ed0db8bb37ea',\n * })\n *\n * const logs = parseEventLogs({ logs: receipt.logs })\n * // [{ args: { ... }, eventName: 'TransactionDeposited', ... }, ...]\n */\nexport function parseEventLogs(parameters) {\n const { abi, args, logs, strict = true } = parameters;\n const eventName = (() => {\n if (!parameters.eventName)\n return undefined;\n if (Array.isArray(parameters.eventName))\n return parameters.eventName;\n return [parameters.eventName];\n })();\n return logs\n .map((log) => {\n try {\n const abiItem = abi.find((abiItem) => abiItem.type === 'event' &&\n log.topics[0] === toEventSelector(abiItem));\n if (!abiItem)\n return null;\n const event = decodeEventLog({\n ...log,\n abi: [abiItem],\n strict,\n });\n // Check that the decoded event name matches the provided event name.\n if (eventName && !eventName.includes(event.eventName))\n return null;\n // Check that the decoded event args match the provided args.\n if (!includesArgs({\n args: event.args,\n inputs: abiItem.inputs,\n matchArgs: args,\n }))\n return null;\n return { ...event, ...log };\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof AbiEventSignatureNotFoundError)\n return null;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict)\n return null;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n return { ...log, args: isUnnamed ? [] : {}, eventName };\n }\n })\n .filter(Boolean);\n}\nfunction includesArgs(parameters) {\n const { args, inputs, matchArgs } = parameters;\n if (!matchArgs)\n return true;\n if (!args)\n return false;\n function isEqual(input, value, arg) {\n try {\n if (input.type === 'address')\n return isAddressEqual(value, arg);\n if (input.type === 'string' || input.type === 'bytes')\n return keccak256(toBytes(value)) === arg;\n return value === arg;\n }\n catch {\n return false;\n }\n }\n if (Array.isArray(args) && Array.isArray(matchArgs)) {\n return matchArgs.every((value, index) => {\n if (value === null || value === undefined)\n return true;\n const input = inputs[index];\n if (!input)\n return false;\n const value_ = Array.isArray(value) ? value : [value];\n return value_.some((value) => isEqual(input, value, args[index]));\n });\n }\n if (typeof args === 'object' &&\n !Array.isArray(args) &&\n typeof matchArgs === 'object' &&\n !Array.isArray(matchArgs))\n return Object.entries(matchArgs).every(([key, value]) => {\n if (value === null || value === undefined)\n return true;\n const input = inputs.find((input) => input.name === key);\n if (!input)\n return false;\n const value_ = Array.isArray(value) ? value : [value];\n return value_.some((value) => isEqual(input, value, args[key]));\n });\n return false;\n}\n//# sourceMappingURL=parseEventLogs.js.map","export function formatLog(log, { args, eventName, } = {}) {\n return {\n ...log,\n blockHash: log.blockHash ? log.blockHash : null,\n blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,\n logIndex: log.logIndex ? Number(log.logIndex) : null,\n transactionHash: log.transactionHash ? log.transactionHash : null,\n transactionIndex: log.transactionIndex\n ? Number(log.transactionIndex)\n : null,\n ...(eventName ? { args, eventName } : {}),\n };\n}\n//# sourceMappingURL=log.js.map","import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatLog, } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs matching the provided parameters.\n *\n * - Docs: https://viem.sh/docs/actions/public/getLogs\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/logs_event-logs\n * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)\n *\n * @param client - Client to use\n * @param parameters - {@link GetLogsParameters}\n * @returns A list of event logs. {@link GetLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const logs = await getLogs(client)\n */\nexport async function getLogs(client, { address, blockHash, fromBlock, toBlock, event, events: events_, args, strict: strict_, } = {}) {\n const strict = strict_ ?? false;\n const events = events_ ?? (event ? [event] : undefined);\n let topics = [];\n if (events) {\n const encoded = events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args: events_ ? undefined : args,\n }));\n // TODO: Clean up type casting\n topics = [encoded];\n if (event)\n topics = topics[0];\n }\n let logs;\n if (blockHash) {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [{ address, topics, blockHash }],\n });\n }\n else {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [\n {\n address,\n topics,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n },\n ],\n });\n }\n const formattedLogs = logs.map((log) => formatLog(log));\n if (!events)\n return formattedLogs;\n return parseEventLogs({\n abi: events,\n args: args,\n logs: formattedLogs,\n strict,\n });\n}\n//# sourceMappingURL=getLogs.js.map","import { getAbiItem, } from '../../utils/abi/getAbiItem.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { getLogs, } from './getLogs.js';\n/**\n * Returns a list of event logs emitted by a contract.\n *\n * - Docs: https://viem.sh/docs/contract/getContractEvents#getcontractevents\n * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)\n *\n * @param client - Client to use\n * @param parameters - {@link GetContractEventsParameters}\n * @returns A list of event logs. {@link GetContractEventsReturnType}\n *\n * @example\n * import { createClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getContractEvents } from 'viem/public'\n * import { wagmiAbi } from './abi'\n *\n * const client = createClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const logs = await getContractEvents(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: wagmiAbi,\n * eventName: 'Transfer'\n * })\n */\nexport async function getContractEvents(client, parameters) {\n const { abi, address, args, blockHash, eventName, fromBlock, toBlock, strict, } = parameters;\n const event = eventName\n ? getAbiItem({ abi, name: eventName })\n : undefined;\n const events = !event\n ? abi.filter((x) => x.type === 'event')\n : undefined;\n return getAction(client, getLogs, 'getLogs')({\n address,\n args,\n blockHash,\n event,\n events,\n fromBlock,\n toBlock,\n strict,\n });\n}\n//# sourceMappingURL=getContractEvents.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, } from '../../errors/abi.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/decodeFunctionResult';\nexport function decodeFunctionResult(parameters) {\n const { abi, args, functionName, data } = parameters;\n let abiItem = abi[0];\n if (functionName) {\n const item = getAbiItem({ abi, args, name: functionName });\n if (!item)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = decodeAbiParameters(abiItem.outputs, data);\n if (values && values.length > 1)\n return values;\n if (values && values.length === 1)\n return values[0];\n return undefined;\n}\n//# sourceMappingURL=decodeFunctionResult.js.map","/**\n * Hex, bytes and number utilities.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nexport function isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\nexport function abytes(item) {\n if (!isBytes(item))\n throw new Error('Uint8Array expected');\n}\nexport function abool(title, value) {\n if (typeof value !== 'boolean')\n throw new Error(title + ' boolean expected, got ' + value);\n}\n// Used in weierstrass, der\nexport function numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? '0' + hex : hex;\n}\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian\n}\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function';\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin)\n return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n abytes(bytes);\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n let res;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n }\n catch (e) {\n throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e);\n }\n }\n else if (isBytes(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n }\n else {\n throw new Error(title + ' must be hex string or Uint8Array');\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len);\n return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n// Compares 2 u8a-s in kinda constant time\nexport function equalBytes(a, b) {\n if (a.length !== b.length)\n return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++)\n diff |= a[i] ^ b[i];\n return diff === 0;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Is positive bigint\nconst isPosBig = (n) => typeof n === 'bigint' && _0n <= n;\nexport function inRange(n, min, max) {\n return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;\n}\n/**\n * Asserts min <= n < max. NOTE: It's < max and not <= max.\n * @example\n * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n)\n */\nexport function aInRange(title, n, min, max) {\n // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)?\n // consider P=256n, min=0n, max=P\n // - a for min=0 would require -1: `inRange('x', x, -1n, P)`\n // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)`\n // - our way is the cleanest: `inRange('x', x, 0n, P)\n if (!inRange(n, min, max))\n throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n);\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n * TODO: merge with nLength in modular\n */\nexport function bitLen(n) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1)\n ;\n return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport function bitSet(n, pos, value) {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n}\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_1n << BigInt(n)) - _1n;\n// DRBG\nconst u8n = (len) => new Uint8Array(len); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG<Key>(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n if (typeof hashLen !== 'number' || hashLen < 2)\n throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2)\n throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function')\n throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n(0)) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000)\n throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen())))\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n bigint: (val) => typeof val === 'bigint',\n function: (val) => typeof val === 'function',\n boolean: (val) => typeof val === 'boolean',\n string: (val) => typeof val === 'string',\n stringOrUint8Array: (val) => typeof val === 'string' || isBytes(val),\n isSafeInteger: (val) => Number.isSafeInteger(val),\n array: (val) => Array.isArray(val),\n field: (val, object) => object.Fp.isValid(val),\n hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record<K extends string | number | symbol, T> = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n const checkField = (fieldName, type, isOptional) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error('invalid validator function');\n const val = object[fieldName];\n if (isOptional && val === undefined)\n return;\n if (!checkVal(val, object)) {\n throw new Error('param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val);\n }\n };\n for (const [fieldName, type] of Object.entries(validators))\n checkField(fieldName, type, false);\n for (const [fieldName, type] of Object.entries(optValidators))\n checkField(fieldName, type, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n/**\n * throws not implemented error\n */\nexport const notImplemented = () => {\n throw new Error('not implemented');\n};\n/**\n * Memoizes (caches) computation result.\n * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed.\n */\nexport function memoized(fn) {\n const map = new WeakMap();\n return (arg, ...args) => {\n const val = map.get(arg);\n if (val !== undefined)\n return val;\n const computed = fn(arg, ...args);\n map.set(arg, computed);\n return computed;\n };\n}\n//# sourceMappingURL=utils.js.map","import { getVersion } from './internal/errors.js';\n/**\n * Base error class inherited by all errors thrown by ox.\n *\n * @example\n * ```ts\n * import { Errors } from 'ox'\n * throw new Errors.BaseError('An error occurred')\n * ```\n */\nexport class BaseError extends Error {\n constructor(shortMessage, options = {}) {\n const details = (() => {\n if (options.cause instanceof BaseError) {\n if (options.cause.details)\n return options.cause.details;\n if (options.cause.shortMessage)\n return options.cause.shortMessage;\n }\n if (options.cause &&\n 'details' in options.cause &&\n typeof options.cause.details === 'string')\n return options.cause.details;\n if (options.cause?.message)\n return options.cause.message;\n return options.details;\n })();\n const docsPath = (() => {\n if (options.cause instanceof BaseError)\n return options.cause.docsPath || options.docsPath;\n return options.docsPath;\n })();\n const docsBaseUrl = 'https://oxlib.sh';\n const docs = `${docsBaseUrl}${docsPath ?? ''}`;\n const message = [\n shortMessage || 'An error occurred.',\n ...(options.metaMessages ? ['', ...options.metaMessages] : []),\n ...(details || docsPath\n ? [\n '',\n details ? `Details: ${details}` : undefined,\n docsPath ? `See: ${docs}` : undefined,\n ]\n : []),\n ]\n .filter((x) => typeof x === 'string')\n .join('\\n');\n super(message, options.cause ? { cause: options.cause } : undefined);\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'BaseError'\n });\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: `ox@${getVersion()}`\n });\n this.cause = options.cause;\n this.details = details;\n this.docs = docs;\n this.docsPath = docsPath;\n this.shortMessage = shortMessage;\n }\n walk(fn) {\n return walk(this, fn);\n }\n}\n/** @internal */\nfunction walk(err, fn) {\n if (fn?.(err))\n return err;\n if (err && typeof err === 'object' && 'cause' in err && err.cause)\n return walk(err.cause, fn);\n return fn ? null : err;\n}\n//# sourceMappingURL=Errors.js.map","import * as Bytes from '../Bytes.js';\n/** @internal */\nexport function assertSize(bytes, size_) {\n if (Bytes.size(bytes) > size_)\n throw new Bytes.SizeOverflowError({\n givenSize: Bytes.size(bytes),\n maxSize: size_,\n });\n}\n/** @internal */\nexport function assertStartOffset(value, start) {\n if (typeof start === 'number' && start > 0 && start > Bytes.size(value) - 1)\n throw new Bytes.SliceOffsetOutOfBoundsError({\n offset: start,\n position: 'start',\n size: Bytes.size(value),\n });\n}\n/** @internal */\nexport function assertEndOffset(value, start, end) {\n if (typeof start === 'number' &&\n typeof end === 'number' &&\n Bytes.size(value) !== end - start) {\n throw new Bytes.SliceOffsetOutOfBoundsError({\n offset: end,\n position: 'end',\n size: Bytes.size(value),\n });\n }\n}\n/** @internal */\nexport const charCodeMap = {\n zero: 48,\n nine: 57,\n A: 65,\n F: 70,\n a: 97,\n f: 102,\n};\n/** @internal */\nexport function charCodeToBase16(char) {\n if (char >= charCodeMap.zero && char <= charCodeMap.nine)\n return char - charCodeMap.zero;\n if (char >= charCodeMap.A && char <= charCodeMap.F)\n return char - (charCodeMap.A - 10);\n if (char >= charCodeMap.a && char <= charCodeMap.f)\n return char - (charCodeMap.a - 10);\n return undefined;\n}\n/** @internal */\nexport function pad(bytes, options = {}) {\n const { dir, size = 32 } = options;\n if (size === 0)\n return bytes;\n if (bytes.length > size)\n throw new Bytes.SizeExceedsPaddingSizeError({\n size: bytes.length,\n targetSize: size,\n type: 'Bytes',\n });\n const paddedBytes = new Uint8Array(size);\n for (let i = 0; i < size; i++) {\n const padEnd = dir === 'right';\n paddedBytes[padEnd ? i : size - i - 1] =\n bytes[padEnd ? i : bytes.length - i - 1];\n }\n return paddedBytes;\n}\n/** @internal */\nexport function trim(value, options = {}) {\n const { dir = 'left' } = options;\n let data = value;\n let sliceLength = 0;\n for (let i = 0; i < data.length - 1; i++) {\n if (data[dir === 'left' ? i : data.length - i - 1].toString() === '0')\n sliceLength++;\n else\n break;\n }\n data =\n dir === 'left'\n ? data.slice(sliceLength)\n : data.slice(0, data.length - sliceLength);\n return data;\n}\n//# sourceMappingURL=bytes.js.map","import * as Hex from '../Hex.js';\n/** @internal */\nexport function assertSize(hex, size_) {\n if (Hex.size(hex) > size_)\n throw new Hex.SizeOverflowError({\n givenSize: Hex.size(hex),\n maxSize: size_,\n });\n}\n/** @internal */\nexport function assertStartOffset(value, start) {\n if (typeof start === 'number' && start > 0 && start > Hex.size(value) - 1)\n throw new Hex.SliceOffsetOutOfBoundsError({\n offset: start,\n position: 'start',\n size: Hex.size(value),\n });\n}\n/** @internal */\nexport function assertEndOffset(value, start, end) {\n if (typeof start === 'number' &&\n typeof end === 'number' &&\n Hex.size(value) !== end - start) {\n throw new Hex.SliceOffsetOutOfBoundsError({\n offset: end,\n position: 'end',\n size: Hex.size(value),\n });\n }\n}\n/** @internal */\nexport function pad(hex_, options = {}) {\n const { dir, size = 32 } = options;\n if (size === 0)\n return hex_;\n const hex = hex_.replace('0x', '');\n if (hex.length > size * 2)\n throw new Hex.SizeExceedsPaddingSizeError({\n size: Math.ceil(hex.length / 2),\n targetSize: size,\n type: 'Hex',\n });\n return `0x${hex[dir === 'right' ? 'padEnd' : 'padStart'](size * 2, '0')}`;\n}\n/** @internal */\nexport function trim(value, options = {}) {\n const { dir = 'left' } = options;\n let data = value.replace('0x', '');\n let sliceLength = 0;\n for (let i = 0; i < data.length - 1; i++) {\n if (data[dir === 'left' ? i : data.length - i - 1].toString() === '0')\n sliceLength++;\n else\n break;\n }\n data =\n dir === 'left'\n ? data.slice(sliceLength)\n : data.slice(0, data.length - sliceLength);\n if (data === '0')\n return '0x';\n if (dir === 'right' && data.length % 2 === 1)\n return `0x${data}0`;\n return `0x${data}`;\n}\n//# sourceMappingURL=hex.js.map","const bigIntSuffix = '#__bigint';\n/**\n * Parses a JSON string, with support for `bigint`.\n *\n * @example\n * ```ts twoslash\n * import { Json } from 'ox'\n *\n * const json = Json.parse('{\"foo\":\"bar\",\"baz\":\"69420694206942069420694206942069420694206942069420#__bigint\"}')\n * // @log: {\n * // @log: foo: 'bar',\n * // @log: baz: 69420694206942069420694206942069420694206942069420n\n * // @log: }\n * ```\n *\n * @param string - The value to parse.\n * @param reviver - A function that transforms the results.\n * @returns The parsed value.\n */\nexport function parse(string, reviver) {\n return JSON.parse(string, (key, value_) => {\n const value = value_;\n if (typeof value === 'string' && value.endsWith(bigIntSuffix))\n return BigInt(value.slice(0, -bigIntSuffix.length));\n return typeof reviver === 'function' ? reviver(key, value) : value;\n });\n}\n/**\n * Stringifies a value to its JSON representation, with support for `bigint`.\n *\n * @example\n * ```ts twoslash\n * import { Json } from 'ox'\n *\n * const json = Json.stringify({\n * foo: 'bar',\n * baz: 69420694206942069420694206942069420694206942069420n,\n * })\n * // @log: '{\"foo\":\"bar\",\"baz\":\"69420694206942069420694206942069420694206942069420#__bigint\"}'\n * ```\n *\n * @param value - The value to stringify.\n * @param replacer - A function that transforms the results. It is passed the key and value of the property, and must return the value to be used in the JSON string. If this function returns `undefined`, the property is not included in the resulting JSON string.\n * @param space - A string or number that determines the indentation of the JSON string. If it is a number, it indicates the number of spaces to use as indentation; if it is a string (e.g. `'\\t'`), it uses the string as the indentation character.\n * @returns The JSON string.\n */\nexport function stringify(value, replacer, space) {\n return JSON.stringify(value, (key, value) => {\n if (typeof replacer === 'function')\n return replacer(key, value);\n if (typeof value === 'bigint')\n return value.toString() + bigIntSuffix;\n return value;\n }, space);\n}\n//# sourceMappingURL=Json.js.map","import { equalBytes } from '@noble/curves/abstract/utils';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport * as internal from './internal/bytes.js';\nimport * as internal_hex from './internal/hex.js';\nimport * as Json from './Json.js';\nconst decoder = /*#__PURE__*/ new TextDecoder();\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Asserts if the given value is {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.assert('abc')\n * // @error: Bytes.InvalidBytesTypeError:\n * // @error: Value `\"abc\"` of type `string` is an invalid Bytes value.\n * // @error: Bytes values must be of type `Uint8Array`.\n * ```\n *\n * @param value - Value to assert.\n */\nexport function assert(value) {\n if (value instanceof Uint8Array)\n return;\n if (!value)\n throw new InvalidBytesTypeError(value);\n if (typeof value !== 'object')\n throw new InvalidBytesTypeError(value);\n if (!('BYTES_PER_ELEMENT' in value))\n throw new InvalidBytesTypeError(value);\n if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== 'Uint8Array')\n throw new InvalidBytesTypeError(value);\n}\n/**\n * Concatenates two or more {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const bytes = Bytes.concat(\n * Bytes.from([1]),\n * Bytes.from([69]),\n * Bytes.from([420, 69]),\n * )\n * // @log: Uint8Array [ 1, 69, 420, 69 ]\n * ```\n *\n * @param values - Values to concatenate.\n * @returns Concatenated {@link ox#Bytes.Bytes}.\n */\nexport function concat(...values) {\n let length = 0;\n for (const arr of values) {\n length += arr.length;\n }\n const result = new Uint8Array(length);\n for (let i = 0, index = 0; i < values.length; i++) {\n const arr = values[i];\n result.set(arr, index);\n index += arr.length;\n }\n return result;\n}\n/**\n * Instantiates a {@link ox#Bytes.Bytes} value from a `Uint8Array`, a hex string, or an array of unsigned 8-bit integers.\n *\n * :::tip\n *\n * To instantiate from a **Boolean**, **String**, or **Number**, use one of the following:\n *\n * - `Bytes.fromBoolean`\n *\n * - `Bytes.fromString`\n *\n * - `Bytes.fromNumber`\n *\n * :::\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.from([255, 124, 5, 4])\n * // @log: Uint8Array([255, 124, 5, 4])\n *\n * const data = Bytes.from('0xdeadbeef')\n * // @log: Uint8Array([222, 173, 190, 239])\n * ```\n *\n * @param value - Value to convert.\n * @returns A {@link ox#Bytes.Bytes} instance.\n */\nexport function from(value) {\n if (value instanceof Uint8Array)\n return value;\n if (typeof value === 'string')\n return fromHex(value);\n return fromArray(value);\n}\n/**\n * Converts an array of unsigned 8-bit integers into {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromArray([255, 124, 5, 4])\n * // @log: Uint8Array([255, 124, 5, 4])\n * ```\n *\n * @param value - Value to convert.\n * @returns A {@link ox#Bytes.Bytes} instance.\n */\nexport function fromArray(value) {\n return value instanceof Uint8Array ? value : new Uint8Array(value);\n}\n/**\n * Encodes a boolean value into {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromBoolean(true)\n * // @log: Uint8Array([1])\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromBoolean(true, { size: 32 })\n * // @log: Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])\n * ```\n *\n * @param value - Boolean value to encode.\n * @param options - Encoding options.\n * @returns Encoded {@link ox#Bytes.Bytes}.\n */\nexport function fromBoolean(value, options = {}) {\n const { size } = options;\n const bytes = new Uint8Array(1);\n bytes[0] = Number(value);\n if (typeof size === 'number') {\n internal.assertSize(bytes, size);\n return padLeft(bytes, size);\n }\n return bytes;\n}\n/**\n * Encodes a {@link ox#Hex.Hex} value into {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromHex('0x48656c6c6f20776f726c6421')\n * // @log: Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromHex('0x48656c6c6f20776f726c6421', { size: 32 })\n * // @log: Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n * ```\n *\n * @param value - {@link ox#Hex.Hex} value to encode.\n * @param options - Encoding options.\n * @returns Encoded {@link ox#Bytes.Bytes}.\n */\nexport function fromHex(value, options = {}) {\n const { size } = options;\n let hex = value;\n if (size) {\n internal_hex.assertSize(value, size);\n hex = Hex.padRight(value, size);\n }\n let hexString = hex.slice(2);\n if (hexString.length % 2)\n hexString = `0${hexString}`;\n const length = hexString.length / 2;\n const bytes = new Uint8Array(length);\n for (let index = 0, j = 0; index < length; index++) {\n const nibbleLeft = internal.charCodeToBase16(hexString.charCodeAt(j++));\n const nibbleRight = internal.charCodeToBase16(hexString.charCodeAt(j++));\n if (nibbleLeft === undefined || nibbleRight === undefined) {\n throw new Errors.BaseError(`Invalid byte sequence (\"${hexString[j - 2]}${hexString[j - 1]}\" in \"${hexString}\").`);\n }\n bytes[index] = nibbleLeft * 16 + nibbleRight;\n }\n return bytes;\n}\n/**\n * Encodes a number value into {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromNumber(420)\n * // @log: Uint8Array([1, 164])\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromNumber(420, { size: 4 })\n * // @log: Uint8Array([0, 0, 1, 164])\n * ```\n *\n * @param value - Number value to encode.\n * @param options - Encoding options.\n * @returns Encoded {@link ox#Bytes.Bytes}.\n */\nexport function fromNumber(value, options) {\n const hex = Hex.fromNumber(value, options);\n return fromHex(hex);\n}\n/**\n * Encodes a string into {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromString('Hello world!')\n * // @log: Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33])\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.fromString('Hello world!', { size: 32 })\n * // @log: Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n * ```\n *\n * @param value - String to encode.\n * @param options - Encoding options.\n * @returns Encoded {@link ox#Bytes.Bytes}.\n */\nexport function fromString(value, options = {}) {\n const { size } = options;\n const bytes = encoder.encode(value);\n if (typeof size === 'number') {\n internal.assertSize(bytes, size);\n return padRight(bytes, size);\n }\n return bytes;\n}\n/**\n * Checks if two {@link ox#Bytes.Bytes} values are equal.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.isEqual(Bytes.from([1]), Bytes.from([1]))\n * // @log: true\n *\n * Bytes.isEqual(Bytes.from([1]), Bytes.from([2]))\n * // @log: false\n * ```\n *\n * @param bytesA - First {@link ox#Bytes.Bytes} value.\n * @param bytesB - Second {@link ox#Bytes.Bytes} value.\n * @returns `true` if the two values are equal, otherwise `false`.\n */\nexport function isEqual(bytesA, bytesB) {\n return equalBytes(bytesA, bytesB);\n}\n/**\n * Pads a {@link ox#Bytes.Bytes} value to the left with zero bytes until it reaches the given `size` (default: 32 bytes).\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.padLeft(Bytes.from([1]), 4)\n * // @log: Uint8Array([0, 0, 0, 1])\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} value to pad.\n * @param size - Size to pad the {@link ox#Bytes.Bytes} value to.\n * @returns Padded {@link ox#Bytes.Bytes} value.\n */\nexport function padLeft(value, size) {\n return internal.pad(value, { dir: 'left', size });\n}\n/**\n * Pads a {@link ox#Bytes.Bytes} value to the right with zero bytes until it reaches the given `size` (default: 32 bytes).\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.padRight(Bytes.from([1]), 4)\n * // @log: Uint8Array([1, 0, 0, 0])\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} value to pad.\n * @param size - Size to pad the {@link ox#Bytes.Bytes} value to.\n * @returns Padded {@link ox#Bytes.Bytes} value.\n */\nexport function padRight(value, size) {\n return internal.pad(value, { dir: 'right', size });\n}\n/**\n * Generates random {@link ox#Bytes.Bytes} of the specified length.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const bytes = Bytes.random(32)\n * // @log: Uint8Array([... x32])\n * ```\n *\n * @param length - Length of the random {@link ox#Bytes.Bytes} to generate.\n * @returns Random {@link ox#Bytes.Bytes} of the specified length.\n */\nexport function random(length) {\n return crypto.getRandomValues(new Uint8Array(length));\n}\n/**\n * Retrieves the size of a {@link ox#Bytes.Bytes} value.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.size(Bytes.from([1, 2, 3, 4]))\n * // @log: 4\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} value.\n * @returns Size of the {@link ox#Bytes.Bytes} value.\n */\nexport function size(value) {\n return value.length;\n}\n/**\n * Returns a section of a {@link ox#Bytes.Bytes} value given a start/end bytes offset.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.slice(\n * Bytes.from([1, 2, 3, 4, 5, 6, 7, 8, 9]),\n * 1,\n * 4,\n * )\n * // @log: Uint8Array([2, 3, 4])\n * ```\n *\n * @param value - The {@link ox#Bytes.Bytes} value.\n * @param start - Start offset.\n * @param end - End offset.\n * @param options - Slice options.\n * @returns Sliced {@link ox#Bytes.Bytes} value.\n */\nexport function slice(value, start, end, options = {}) {\n const { strict } = options;\n internal.assertStartOffset(value, start);\n const value_ = value.slice(start, end);\n if (strict)\n internal.assertEndOffset(value_, start, end);\n return value_;\n}\n/**\n * Decodes a {@link ox#Bytes.Bytes} into a bigint.\n *\n * @example\n * ```ts\n * import { Bytes } from 'ox'\n *\n * Bytes.toBigInt(Bytes.from([1, 164]))\n * // @log: 420n\n * ```\n *\n * @param bytes - The {@link ox#Bytes.Bytes} to decode.\n * @param options - Decoding options.\n * @returns Decoded bigint.\n */\nexport function toBigInt(bytes, options = {}) {\n const { size } = options;\n if (typeof size !== 'undefined')\n internal.assertSize(bytes, size);\n const hex = Hex.fromBytes(bytes, options);\n return Hex.toBigInt(hex, options);\n}\n/**\n * Decodes a {@link ox#Bytes.Bytes} into a boolean.\n *\n * @example\n * ```ts\n * import { Bytes } from 'ox'\n *\n * Bytes.toBoolean(Bytes.from([1]))\n * // @log: true\n * ```\n *\n * @param bytes - The {@link ox#Bytes.Bytes} to decode.\n * @param options - Decoding options.\n * @returns Decoded boolean.\n */\nexport function toBoolean(bytes, options = {}) {\n const { size } = options;\n let bytes_ = bytes;\n if (typeof size !== 'undefined') {\n internal.assertSize(bytes_, size);\n bytes_ = trimLeft(bytes_);\n }\n if (bytes_.length > 1 || bytes_[0] > 1)\n throw new InvalidBytesBooleanError(bytes_);\n return Boolean(bytes_[0]);\n}\n/**\n * Encodes a {@link ox#Bytes.Bytes} value into a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.toHex(Bytes.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]))\n * // '0x48656c6c6f20576f726c6421'\n * ```\n *\n * @param value - The {@link ox#Bytes.Bytes} to decode.\n * @param options - Options.\n * @returns Decoded {@link ox#Hex.Hex} value.\n */\nexport function toHex(value, options = {}) {\n return Hex.fromBytes(value, options);\n}\n/**\n * Decodes a {@link ox#Bytes.Bytes} into a number.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.toNumber(Bytes.from([1, 164]))\n * // @log: 420\n * ```\n */\nexport function toNumber(bytes, options = {}) {\n const { size } = options;\n if (typeof size !== 'undefined')\n internal.assertSize(bytes, size);\n const hex = Hex.fromBytes(bytes, options);\n return Hex.toNumber(hex, options);\n}\n/**\n * Decodes a {@link ox#Bytes.Bytes} into a string.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * const data = Bytes.toString(Bytes.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]))\n * // @log: 'Hello world'\n * ```\n *\n * @param bytes - The {@link ox#Bytes.Bytes} to decode.\n * @param options - Options.\n * @returns Decoded string.\n */\nexport function toString(bytes, options = {}) {\n const { size } = options;\n let bytes_ = bytes;\n if (typeof size !== 'undefined') {\n internal.assertSize(bytes_, size);\n bytes_ = trimRight(bytes_);\n }\n return decoder.decode(bytes_);\n}\n/**\n * Trims leading zeros from a {@link ox#Bytes.Bytes} value.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.trimLeft(Bytes.from([0, 0, 0, 0, 1, 2, 3]))\n * // @log: Uint8Array([1, 2, 3])\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} value.\n * @returns Trimmed {@link ox#Bytes.Bytes} value.\n */\nexport function trimLeft(value) {\n return internal.trim(value, { dir: 'left' });\n}\n/**\n * Trims trailing zeros from a {@link ox#Bytes.Bytes} value.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.trimRight(Bytes.from([1, 2, 3, 0, 0, 0, 0]))\n * // @log: Uint8Array([1, 2, 3])\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} value.\n * @returns Trimmed {@link ox#Bytes.Bytes} value.\n */\nexport function trimRight(value) {\n return internal.trim(value, { dir: 'right' });\n}\n/**\n * Checks if the given value is {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.validate('0x')\n * // @log: false\n *\n * Bytes.validate(Bytes.from([1, 2, 3]))\n * // @log: true\n * ```\n *\n * @param value - Value to check.\n * @returns `true` if the value is {@link ox#Bytes.Bytes}, otherwise `false`.\n */\nexport function validate(value) {\n try {\n assert(value);\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * Thrown when the bytes value cannot be represented as a boolean.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.toBoolean(Bytes.from([5]))\n * // @error: Bytes.InvalidBytesBooleanError: Bytes value `[5]` is not a valid boolean.\n * // @error: The bytes array must contain a single byte of either a `0` or `1` value.\n * ```\n */\nexport class InvalidBytesBooleanError extends Errors.BaseError {\n constructor(bytes) {\n super(`Bytes value \\`${bytes}\\` is not a valid boolean.`, {\n metaMessages: [\n 'The bytes array must contain a single byte of either a `0` or `1` value.',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Bytes.InvalidBytesBooleanError'\n });\n }\n}\n/**\n * Thrown when a value cannot be converted to bytes.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Bytes } from 'ox'\n *\n * Bytes.from('foo')\n * // @error: Bytes.InvalidBytesTypeError: Value `foo` of type `string` is an invalid Bytes value.\n * ```\n */\nexport class InvalidBytesTypeError extends Errors.BaseError {\n constructor(value) {\n super(`Value \\`${typeof value === 'object' ? Json.stringify(value) : value}\\` of type \\`${typeof value}\\` is an invalid Bytes value.`, {\n metaMessages: ['Bytes values must be of type `Bytes`.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Bytes.InvalidBytesTypeError'\n });\n }\n}\n/**\n * Thrown when a size exceeds the maximum allowed size.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.fromString('Hello World!', { size: 8 })\n * // @error: Bytes.SizeOverflowError: Size cannot exceed `8` bytes. Given size: `12` bytes.\n * ```\n */\nexport class SizeOverflowError extends Errors.BaseError {\n constructor({ givenSize, maxSize }) {\n super(`Size cannot exceed \\`${maxSize}\\` bytes. Given size: \\`${givenSize}\\` bytes.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Bytes.SizeOverflowError'\n });\n }\n}\n/**\n * Thrown when a slice offset is out-of-bounds.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.slice(Bytes.from([1, 2, 3]), 4)\n * // @error: Bytes.SliceOffsetOutOfBoundsError: Slice starting at offset `4` is out-of-bounds (size: `3`).\n * ```\n */\nexport class SliceOffsetOutOfBoundsError extends Errors.BaseError {\n constructor({ offset, position, size, }) {\n super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \\`${offset}\\` is out-of-bounds (size: \\`${size}\\`).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Bytes.SliceOffsetOutOfBoundsError'\n });\n }\n}\n/**\n * Thrown when a the padding size exceeds the maximum allowed size.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.padLeft(Bytes.fromString('Hello World!'), 8)\n * // @error: [Bytes.SizeExceedsPaddingSizeError: Bytes size (`12`) exceeds padding size (`8`).\n * ```\n */\nexport class SizeExceedsPaddingSizeError extends Errors.BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} size (\\`${size}\\`) exceeds padding size (\\`${targetSize}\\`).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Bytes.SizeExceedsPaddingSizeError'\n });\n }\n}\n//# sourceMappingURL=Bytes.js.map","import { equalBytes } from '@noble/curves/abstract/utils';\nimport * as Bytes from './Bytes.js';\nimport * as Errors from './Errors.js';\nimport * as internal_bytes from './internal/bytes.js';\nimport * as internal from './internal/hex.js';\nimport * as Json from './Json.js';\nconst encoder = /*#__PURE__*/ new TextEncoder();\nconst hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, '0'));\n/**\n * Asserts if the given value is {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.assert('abc')\n * // @error: InvalidHexValueTypeError:\n * // @error: Value `\"abc\"` of type `string` is an invalid hex type.\n * // @error: Hex types must be represented as `\"0x\\${string}\"`.\n * ```\n *\n * @param value - The value to assert.\n * @param options - Options.\n */\nexport function assert(value, options = {}) {\n const { strict = false } = options;\n if (!value)\n throw new InvalidHexTypeError(value);\n if (typeof value !== 'string')\n throw new InvalidHexTypeError(value);\n if (strict) {\n if (!/^0x[0-9a-fA-F]*$/.test(value))\n throw new InvalidHexValueError(value);\n }\n if (!value.startsWith('0x'))\n throw new InvalidHexValueError(value);\n}\n/**\n * Concatenates two or more {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.concat('0x123', '0x456')\n * // @log: '0x123456'\n * ```\n *\n * @param values - The {@link ox#Hex.Hex} values to concatenate.\n * @returns The concatenated {@link ox#Hex.Hex} value.\n */\nexport function concat(...values) {\n return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}`;\n}\n/**\n * Instantiates a {@link ox#Hex.Hex} value from a hex string or {@link ox#Bytes.Bytes} value.\n *\n * :::tip\n *\n * To instantiate from a **Boolean**, **String**, or **Number**, use one of the following:\n *\n * - `Hex.fromBoolean`\n *\n * - `Hex.fromString`\n *\n * - `Hex.fromNumber`\n *\n * :::\n *\n * @example\n * ```ts twoslash\n * import { Bytes, Hex } from 'ox'\n *\n * Hex.from('0x48656c6c6f20576f726c6421')\n * // @log: '0x48656c6c6f20576f726c6421'\n *\n * Hex.from(Bytes.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]))\n * // @log: '0x48656c6c6f20576f726c6421'\n * ```\n *\n * @param value - The {@link ox#Bytes.Bytes} value to encode.\n * @returns The encoded {@link ox#Hex.Hex} value.\n */\nexport function from(value) {\n if (value instanceof Uint8Array)\n return fromBytes(value);\n if (Array.isArray(value))\n return fromBytes(new Uint8Array(value));\n return value;\n}\n/**\n * Encodes a boolean into a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.fromBoolean(true)\n * // @log: '0x1'\n *\n * Hex.fromBoolean(false)\n * // @log: '0x0'\n *\n * Hex.fromBoolean(true, { size: 32 })\n * // @log: '0x0000000000000000000000000000000000000000000000000000000000000001'\n * ```\n *\n * @param value - The boolean value to encode.\n * @param options - Options.\n * @returns The encoded {@link ox#Hex.Hex} value.\n */\nexport function fromBoolean(value, options = {}) {\n const hex = `0x${Number(value)}`;\n if (typeof options.size === 'number') {\n internal.assertSize(hex, options.size);\n return padLeft(hex, options.size);\n }\n return hex;\n}\n/**\n * Encodes a {@link ox#Bytes.Bytes} value into a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { Bytes, Hex } from 'ox'\n *\n * Hex.fromBytes(Bytes.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]))\n * // @log: '0x48656c6c6f20576f726c6421'\n * ```\n *\n * @param value - The {@link ox#Bytes.Bytes} value to encode.\n * @param options - Options.\n * @returns The encoded {@link ox#Hex.Hex} value.\n */\nexport function fromBytes(value, options = {}) {\n let string = '';\n for (let i = 0; i < value.length; i++)\n string += hexes[value[i]];\n const hex = `0x${string}`;\n if (typeof options.size === 'number') {\n internal.assertSize(hex, options.size);\n return padRight(hex, options.size);\n }\n return hex;\n}\n/**\n * Encodes a number or bigint into a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.fromNumber(420)\n * // @log: '0x1a4'\n *\n * Hex.fromNumber(420, { size: 32 })\n * // @log: '0x00000000000000000000000000000000000000000000000000000000000001a4'\n * ```\n *\n * @param value - The number or bigint value to encode.\n * @param options - Options.\n * @returns The encoded {@link ox#Hex.Hex} value.\n */\nexport function fromNumber(value, options = {}) {\n const { signed, size } = options;\n const value_ = BigInt(value);\n let maxValue;\n if (size) {\n if (signed)\n maxValue = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n else\n maxValue = 2n ** (BigInt(size) * 8n) - 1n;\n }\n else if (typeof value === 'number') {\n maxValue = BigInt(Number.MAX_SAFE_INTEGER);\n }\n const minValue = typeof maxValue === 'bigint' && signed ? -maxValue - 1n : 0;\n if ((maxValue && value_ > maxValue) || value_ < minValue) {\n const suffix = typeof value === 'bigint' ? 'n' : '';\n throw new IntegerOutOfRangeError({\n max: maxValue ? `${maxValue}${suffix}` : undefined,\n min: `${minValue}${suffix}`,\n signed,\n size,\n value: `${value}${suffix}`,\n });\n }\n const stringValue = (signed && value_ < 0 ? (1n << BigInt(size * 8)) + BigInt(value_) : value_).toString(16);\n const hex = `0x${stringValue}`;\n if (size)\n return padLeft(hex, size);\n return hex;\n}\n/**\n * Encodes a string into a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n * Hex.fromString('Hello World!')\n * // '0x48656c6c6f20576f726c6421'\n *\n * Hex.fromString('Hello World!', { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n * ```\n *\n * @param value - The string value to encode.\n * @param options - Options.\n * @returns The encoded {@link ox#Hex.Hex} value.\n */\nexport function fromString(value, options = {}) {\n return fromBytes(encoder.encode(value), options);\n}\n/**\n * Checks if two {@link ox#Hex.Hex} values are equal.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.isEqual('0xdeadbeef', '0xdeadbeef')\n * // @log: true\n *\n * Hex.isEqual('0xda', '0xba')\n * // @log: false\n * ```\n *\n * @param hexA - The first {@link ox#Hex.Hex} value.\n * @param hexB - The second {@link ox#Hex.Hex} value.\n * @returns `true` if the two {@link ox#Hex.Hex} values are equal, `false` otherwise.\n */\nexport function isEqual(hexA, hexB) {\n return equalBytes(Bytes.fromHex(hexA), Bytes.fromHex(hexB));\n}\n/**\n * Pads a {@link ox#Hex.Hex} value to the left with zero bytes until it reaches the given `size` (default: 32 bytes).\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.padLeft('0x1234', 4)\n * // @log: '0x00001234'\n * ```\n *\n * @param value - The {@link ox#Hex.Hex} value to pad.\n * @param size - The size (in bytes) of the output hex value.\n * @returns The padded {@link ox#Hex.Hex} value.\n */\nexport function padLeft(value, size) {\n return internal.pad(value, { dir: 'left', size });\n}\n/**\n * Pads a {@link ox#Hex.Hex} value to the right with zero bytes until it reaches the given `size` (default: 32 bytes).\n *\n * @example\n * ```ts\n * import { Hex } from 'ox'\n *\n * Hex.padRight('0x1234', 4)\n * // @log: '0x12340000'\n * ```\n *\n * @param value - The {@link ox#Hex.Hex} value to pad.\n * @param size - The size (in bytes) of the output hex value.\n * @returns The padded {@link ox#Hex.Hex} value.\n */\nexport function padRight(value, size) {\n return internal.pad(value, { dir: 'right', size });\n}\n/**\n * Generates a random {@link ox#Hex.Hex} value of the specified length.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * const hex = Hex.random(32)\n * // @log: '0x...'\n * ```\n *\n * @returns Random {@link ox#Hex.Hex} value.\n */\nexport function random(length) {\n return fromBytes(Bytes.random(length));\n}\n/**\n * Returns a section of a {@link ox#Bytes.Bytes} value given a start/end bytes offset.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.slice('0x0123456789', 1, 4)\n * // @log: '0x234567'\n * ```\n *\n * @param value - The {@link ox#Hex.Hex} value to slice.\n * @param start - The start offset (in bytes).\n * @param end - The end offset (in bytes).\n * @param options - Options.\n * @returns The sliced {@link ox#Hex.Hex} value.\n */\nexport function slice(value, start, end, options = {}) {\n const { strict } = options;\n internal.assertStartOffset(value, start);\n const value_ = `0x${value\n .replace('0x', '')\n .slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;\n if (strict)\n internal.assertEndOffset(value_, start, end);\n return value_;\n}\n/**\n * Retrieves the size of a {@link ox#Hex.Hex} value (in bytes).\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.size('0xdeadbeef')\n * // @log: 4\n * ```\n *\n * @param value - The {@link ox#Hex.Hex} value to get the size of.\n * @returns The size of the {@link ox#Hex.Hex} value (in bytes).\n */\nexport function size(value) {\n return Math.ceil((value.length - 2) / 2);\n}\n/**\n * Trims leading zeros from a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.trimLeft('0x00000000deadbeef')\n * // @log: '0xdeadbeef'\n * ```\n *\n * @param value - The {@link ox#Hex.Hex} value to trim.\n * @returns The trimmed {@link ox#Hex.Hex} value.\n */\nexport function trimLeft(value) {\n return internal.trim(value, { dir: 'left' });\n}\n/**\n * Trims trailing zeros from a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.trimRight('0xdeadbeef00000000')\n * // @log: '0xdeadbeef'\n * ```\n *\n * @param value - The {@link ox#Hex.Hex} value to trim.\n * @returns The trimmed {@link ox#Hex.Hex} value.\n */\nexport function trimRight(value) {\n return internal.trim(value, { dir: 'right' });\n}\n/**\n * Decodes a {@link ox#Hex.Hex} value into a BigInt.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.toBigInt('0x1a4')\n * // @log: 420n\n *\n * Hex.toBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // @log: 420n\n * ```\n *\n * @param hex - The {@link ox#Hex.Hex} value to decode.\n * @param options - Options.\n * @returns The decoded BigInt.\n */\nexport function toBigInt(hex, options = {}) {\n const { signed } = options;\n if (options.size)\n internal.assertSize(hex, options.size);\n const value = BigInt(hex);\n if (!signed)\n return value;\n const size = (hex.length - 2) / 2;\n const max_unsigned = (1n << (BigInt(size) * 8n)) - 1n;\n const max_signed = max_unsigned >> 1n;\n if (value <= max_signed)\n return value;\n return value - max_unsigned - 1n;\n}\n/**\n * Decodes a {@link ox#Hex.Hex} value into a boolean.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.toBoolean('0x01')\n * // @log: true\n *\n * Hex.toBoolean('0x0000000000000000000000000000000000000000000000000000000000000001', { size: 32 })\n * // @log: true\n * ```\n *\n * @param hex - The {@link ox#Hex.Hex} value to decode.\n * @param options - Options.\n * @returns The decoded boolean.\n */\nexport function toBoolean(hex, options = {}) {\n if (options.size)\n internal.assertSize(hex, options.size);\n const hex_ = trimLeft(hex);\n if (hex_ === '0x')\n return false;\n if (hex_ === '0x1')\n return true;\n throw new InvalidHexBooleanError(hex);\n}\n/**\n * Decodes a {@link ox#Hex.Hex} value into a {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * const data = Hex.toBytes('0x48656c6c6f20776f726c6421')\n * // @log: Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n * ```\n *\n * @param hex - The {@link ox#Hex.Hex} value to decode.\n * @param options - Options.\n * @returns The decoded {@link ox#Bytes.Bytes}.\n */\nexport function toBytes(hex, options = {}) {\n return Bytes.fromHex(hex, options);\n}\n/**\n * Decodes a {@link ox#Hex.Hex} value into a number.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.toNumber('0x1a4')\n * // @log: 420\n *\n * Hex.toNumber('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // @log: 420\n * ```\n *\n * @param hex - The {@link ox#Hex.Hex} value to decode.\n * @param options - Options.\n * @returns The decoded number.\n */\nexport function toNumber(hex, options = {}) {\n const { signed, size } = options;\n if (!signed && !size)\n return Number(hex);\n return Number(toBigInt(hex, options));\n}\n/**\n * Decodes a {@link ox#Hex.Hex} value into a string.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.toString('0x48656c6c6f20576f726c6421')\n * // @log: 'Hello world!'\n *\n * Hex.toString('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * })\n * // @log: 'Hello world'\n * ```\n *\n * @param hex - The {@link ox#Hex.Hex} value to decode.\n * @param options - Options.\n * @returns The decoded string.\n */\nexport function toString(hex, options = {}) {\n const { size } = options;\n let bytes = Bytes.fromHex(hex);\n if (size) {\n internal_bytes.assertSize(bytes, size);\n bytes = Bytes.trimRight(bytes);\n }\n return new TextDecoder().decode(bytes);\n}\n/**\n * Checks if the given value is {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { Bytes, Hex } from 'ox'\n *\n * Hex.validate('0xdeadbeef')\n * // @log: true\n *\n * Hex.validate(Bytes.from([1, 2, 3]))\n * // @log: false\n * ```\n *\n * @param value - The value to check.\n * @param options - Options.\n * @returns `true` if the value is a {@link ox#Hex.Hex}, `false` otherwise.\n */\nexport function validate(value, options = {}) {\n const { strict = false } = options;\n try {\n assert(value, { strict });\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * Thrown when the provided integer is out of range, and cannot be represented as a hex value.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.fromNumber(420182738912731283712937129)\n * // @error: Hex.IntegerOutOfRangeError: Number \\`4.2018273891273126e+26\\` is not in safe unsigned integer range (`0` to `9007199254740991`)\n * ```\n */\nexport class IntegerOutOfRangeError extends Errors.BaseError {\n constructor({ max, min, signed, size, value, }) {\n super(`Number \\`${value}\\` is not in safe${size ? ` ${size * 8}-bit` : ''}${signed ? ' signed' : ' unsigned'} integer range ${max ? `(\\`${min}\\` to \\`${max}\\`)` : `(above \\`${min}\\`)`}`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.IntegerOutOfRangeError'\n });\n }\n}\n/**\n * Thrown when the provided hex value cannot be represented as a boolean.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.toBoolean('0xa')\n * // @error: Hex.InvalidHexBooleanError: Hex value `\"0xa\"` is not a valid boolean.\n * // @error: The hex value must be `\"0x0\"` (false) or `\"0x1\"` (true).\n * ```\n */\nexport class InvalidHexBooleanError extends Errors.BaseError {\n constructor(hex) {\n super(`Hex value \\`\"${hex}\"\\` is not a valid boolean.`, {\n metaMessages: [\n 'The hex value must be `\"0x0\"` (false) or `\"0x1\"` (true).',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.InvalidHexBooleanError'\n });\n }\n}\n/**\n * Thrown when the provided value is not a valid hex type.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.assert(1)\n * // @error: Hex.InvalidHexTypeError: Value `1` of type `number` is an invalid hex type.\n * ```\n */\nexport class InvalidHexTypeError extends Errors.BaseError {\n constructor(value) {\n super(`Value \\`${typeof value === 'object' ? Json.stringify(value) : value}\\` of type \\`${typeof value}\\` is an invalid hex type.`, {\n metaMessages: ['Hex types must be represented as `\"0x${string}\"`.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.InvalidHexTypeError'\n });\n }\n}\n/**\n * Thrown when the provided hex value is invalid.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.assert('0x0123456789abcdefg')\n * // @error: Hex.InvalidHexValueError: Value `0x0123456789abcdefg` is an invalid hex value.\n * // @error: Hex values must start with `\"0x\"` and contain only hexadecimal characters (0-9, a-f, A-F).\n * ```\n */\nexport class InvalidHexValueError extends Errors.BaseError {\n constructor(value) {\n super(`Value \\`${value}\\` is an invalid hex value.`, {\n metaMessages: [\n 'Hex values must start with `\"0x\"` and contain only hexadecimal characters (0-9, a-f, A-F).',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.InvalidHexValueError'\n });\n }\n}\n/**\n * Thrown when the provided hex value is an odd length.\n *\n * @example\n * ```ts twoslash\n * import { Bytes } from 'ox'\n *\n * Bytes.fromHex('0xabcde')\n * // @error: Hex.InvalidLengthError: Hex value `\"0xabcde\"` is an odd length (5 nibbles).\n * ```\n */\nexport class InvalidLengthError extends Errors.BaseError {\n constructor(value) {\n super(`Hex value \\`\"${value}\"\\` is an odd length (${value.length - 2} nibbles).`, {\n metaMessages: ['It must be an even length.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.InvalidLengthError'\n });\n }\n}\n/**\n * Thrown when the size of the value exceeds the expected max size.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.fromString('Hello World!', { size: 8 })\n * // @error: Hex.SizeOverflowError: Size cannot exceed `8` bytes. Given size: `12` bytes.\n * ```\n */\nexport class SizeOverflowError extends Errors.BaseError {\n constructor({ givenSize, maxSize }) {\n super(`Size cannot exceed \\`${maxSize}\\` bytes. Given size: \\`${givenSize}\\` bytes.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.SizeOverflowError'\n });\n }\n}\n/**\n * Thrown when the slice offset exceeds the bounds of the value.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.slice('0x0123456789', 6)\n * // @error: Hex.SliceOffsetOutOfBoundsError: Slice starting at offset `6` is out-of-bounds (size: `5`).\n * ```\n */\nexport class SliceOffsetOutOfBoundsError extends Errors.BaseError {\n constructor({ offset, position, size, }) {\n super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \\`${offset}\\` is out-of-bounds (size: \\`${size}\\`).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.SliceOffsetOutOfBoundsError'\n });\n }\n}\n/**\n * Thrown when the size of the value exceeds the pad size.\n *\n * @example\n * ```ts twoslash\n * import { Hex } from 'ox'\n *\n * Hex.padLeft('0x1a4e12a45a21323123aaa87a897a897a898a6567a578a867a98778a667a85a875a87a6a787a65a675a6a9', 32)\n * // @error: Hex.SizeExceedsPaddingSizeError: Hex size (`43`) exceeds padding size (`32`).\n * ```\n */\nexport class SizeExceedsPaddingSizeError extends Errors.BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} size (\\`${size}\\`) exceeds padding size (\\`${targetSize}\\`).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Hex.SizeExceedsPaddingSizeError'\n });\n }\n}\n//# sourceMappingURL=Hex.js.map","import * as Hex from './Hex.js';\n/**\n * Converts a {@link ox#Withdrawal.Rpc} to an {@link ox#Withdrawal.Withdrawal}.\n *\n * @example\n * ```ts twoslash\n * import { Withdrawal } from 'ox'\n *\n * const withdrawal = Withdrawal.fromRpc({\n * address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',\n * amount: '0x620323',\n * index: '0x0',\n * validatorIndex: '0x1',\n * })\n * // @log: {\n * // @log: address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',\n * // @log: amount: 6423331n,\n * // @log: index: 0,\n * // @log: validatorIndex: 1\n * // @log: }\n * ```\n *\n * @param withdrawal - The RPC withdrawal to convert.\n * @returns An instantiated {@link ox#Withdrawal.Withdrawal}.\n */\nexport function fromRpc(withdrawal) {\n return {\n ...withdrawal,\n amount: BigInt(withdrawal.amount),\n index: Number(withdrawal.index),\n validatorIndex: Number(withdrawal.validatorIndex),\n };\n}\n/**\n * Converts a {@link ox#Withdrawal.Withdrawal} to an {@link ox#Withdrawal.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Withdrawal } from 'ox'\n *\n * const withdrawal = Withdrawal.toRpc({\n * address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',\n * amount: 6423331n,\n * index: 0,\n * validatorIndex: 1,\n * })\n * // @log: {\n * // @log: address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',\n * // @log: amount: '0x620323',\n * // @log: index: '0x0',\n * // @log: validatorIndex: '0x1',\n * // @log: }\n * ```\n *\n * @param withdrawal - The Withdrawal to convert.\n * @returns An RPC Withdrawal.\n */\nexport function toRpc(withdrawal) {\n return {\n address: withdrawal.address,\n amount: Hex.fromNumber(withdrawal.amount),\n index: Hex.fromNumber(withdrawal.index),\n validatorIndex: Hex.fromNumber(withdrawal.validatorIndex),\n };\n}\n//# sourceMappingURL=Withdrawal.js.map","import * as Hex from './Hex.js';\nimport * as Withdrawal from './Withdrawal.js';\n/**\n * Converts an {@link ox#BlockOverrides.Rpc} to an {@link ox#BlockOverrides.BlockOverrides}.\n *\n * @example\n * ```ts twoslash\n * import { BlockOverrides } from 'ox'\n *\n * const blockOverrides = BlockOverrides.fromRpc({\n * baseFeePerGas: '0x1',\n * blobBaseFee: '0x2',\n * feeRecipient: '0x0000000000000000000000000000000000000000',\n * gasLimit: '0x4',\n * number: '0x5',\n * prevRandao: '0x6',\n * time: '0x1234567890',\n * withdrawals: [\n * {\n * address: '0x0000000000000000000000000000000000000000',\n * amount: '0x1',\n * index: '0x0',\n * validatorIndex: '0x1',\n * },\n * ],\n * })\n * ```\n *\n * @param rpcBlockOverrides - The RPC block overrides to convert.\n * @returns An instantiated {@link ox#BlockOverrides.BlockOverrides}.\n */\nexport function fromRpc(rpcBlockOverrides) {\n return {\n ...(rpcBlockOverrides.baseFeePerGas && {\n baseFeePerGas: BigInt(rpcBlockOverrides.baseFeePerGas),\n }),\n ...(rpcBlockOverrides.blobBaseFee && {\n blobBaseFee: BigInt(rpcBlockOverrides.blobBaseFee),\n }),\n ...(rpcBlockOverrides.feeRecipient && {\n feeRecipient: rpcBlockOverrides.feeRecipient,\n }),\n ...(rpcBlockOverrides.gasLimit && {\n gasLimit: BigInt(rpcBlockOverrides.gasLimit),\n }),\n ...(rpcBlockOverrides.number && {\n number: BigInt(rpcBlockOverrides.number),\n }),\n ...(rpcBlockOverrides.prevRandao && {\n prevRandao: BigInt(rpcBlockOverrides.prevRandao),\n }),\n ...(rpcBlockOverrides.time && {\n time: BigInt(rpcBlockOverrides.time),\n }),\n ...(rpcBlockOverrides.withdrawals && {\n withdrawals: rpcBlockOverrides.withdrawals.map(Withdrawal.fromRpc),\n }),\n };\n}\n/**\n * Converts an {@link ox#BlockOverrides.BlockOverrides} to an {@link ox#BlockOverrides.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { BlockOverrides } from 'ox'\n *\n * const blockOverrides = BlockOverrides.toRpc({\n * baseFeePerGas: 1n,\n * blobBaseFee: 2n,\n * feeRecipient: '0x0000000000000000000000000000000000000000',\n * gasLimit: 4n,\n * number: 5n,\n * prevRandao: 6n,\n * time: 78187493520n,\n * withdrawals: [\n * {\n * address: '0x0000000000000000000000000000000000000000',\n * amount: 1n,\n * index: 0,\n * validatorIndex: 1,\n * },\n * ],\n * })\n * ```\n *\n * @param blockOverrides - The block overrides to convert.\n * @returns An instantiated {@link ox#BlockOverrides.Rpc}.\n */\nexport function toRpc(blockOverrides) {\n return {\n ...(typeof blockOverrides.baseFeePerGas === 'bigint' && {\n baseFeePerGas: Hex.fromNumber(blockOverrides.baseFeePerGas),\n }),\n ...(typeof blockOverrides.blobBaseFee === 'bigint' && {\n blobBaseFee: Hex.fromNumber(blockOverrides.blobBaseFee),\n }),\n ...(typeof blockOverrides.feeRecipient === 'string' && {\n feeRecipient: blockOverrides.feeRecipient,\n }),\n ...(typeof blockOverrides.gasLimit === 'bigint' && {\n gasLimit: Hex.fromNumber(blockOverrides.gasLimit),\n }),\n ...(typeof blockOverrides.number === 'bigint' && {\n number: Hex.fromNumber(blockOverrides.number),\n }),\n ...(typeof blockOverrides.prevRandao === 'bigint' && {\n prevRandao: Hex.fromNumber(blockOverrides.prevRandao),\n }),\n ...(typeof blockOverrides.time === 'bigint' && {\n time: Hex.fromNumber(blockOverrides.time),\n }),\n ...(blockOverrides.withdrawals && {\n withdrawals: blockOverrides.withdrawals.map(Withdrawal.toRpc),\n }),\n };\n}\n//# sourceMappingURL=BlockOverrides.js.map","/* [Multicall3](https://github.com/mds1/multicall) */\nexport const multicall3Abi = [\n {\n inputs: [\n {\n components: [\n {\n name: 'target',\n type: 'address',\n },\n {\n name: 'allowFailure',\n type: 'bool',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n ],\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3',\n outputs: [\n {\n components: [\n {\n name: 'success',\n type: 'bool',\n },\n {\n name: 'returnData',\n type: 'bytes',\n },\n ],\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockTimestamp',\n outputs: [\n {\n internalType: 'uint256',\n name: 'timestamp',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\nexport const batchGatewayAbi = [\n {\n name: 'query',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n {\n type: 'tuple[]',\n name: 'queries',\n components: [\n {\n type: 'address',\n name: 'sender',\n },\n {\n type: 'string[]',\n name: 'urls',\n },\n {\n type: 'bytes',\n name: 'data',\n },\n ],\n },\n ],\n outputs: [\n {\n type: 'bool[]',\n name: 'failures',\n },\n {\n type: 'bytes[]',\n name: 'responses',\n },\n ],\n },\n {\n name: 'HttpError',\n type: 'error',\n inputs: [\n {\n type: 'uint16',\n name: 'status',\n },\n {\n type: 'string',\n name: 'message',\n },\n ],\n },\n];\nconst universalResolverErrors = [\n {\n inputs: [\n {\n name: 'dns',\n type: 'bytes',\n },\n ],\n name: 'DNSDecodingFailed',\n type: 'error',\n },\n {\n inputs: [\n {\n name: 'ens',\n type: 'string',\n },\n ],\n name: 'DNSEncodingFailed',\n type: 'error',\n },\n {\n inputs: [],\n name: 'EmptyAddress',\n type: 'error',\n },\n {\n inputs: [\n {\n name: 'status',\n type: 'uint16',\n },\n {\n name: 'message',\n type: 'string',\n },\n ],\n name: 'HttpError',\n type: 'error',\n },\n {\n inputs: [],\n name: 'InvalidBatchGatewayResponse',\n type: 'error',\n },\n {\n inputs: [\n {\n name: 'errorData',\n type: 'bytes',\n },\n ],\n name: 'ResolverError',\n type: 'error',\n },\n {\n inputs: [\n {\n name: 'name',\n type: 'bytes',\n },\n {\n name: 'resolver',\n type: 'address',\n },\n ],\n name: 'ResolverNotContract',\n type: 'error',\n },\n {\n inputs: [\n {\n name: 'name',\n type: 'bytes',\n },\n ],\n name: 'ResolverNotFound',\n type: 'error',\n },\n {\n inputs: [\n {\n name: 'primary',\n type: 'string',\n },\n {\n name: 'primaryAddress',\n type: 'bytes',\n },\n ],\n name: 'ReverseAddressMismatch',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'bytes4',\n name: 'selector',\n type: 'bytes4',\n },\n ],\n name: 'UnsupportedResolverProfile',\n type: 'error',\n },\n];\nexport const universalResolverResolveAbi = [\n ...universalResolverErrors,\n {\n name: 'resolveWithGateways',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes' },\n { name: 'data', type: 'bytes' },\n { name: 'gateways', type: 'string[]' },\n ],\n outputs: [\n { name: '', type: 'bytes' },\n { name: 'address', type: 'address' },\n ],\n },\n];\nexport const universalResolverReverseAbi = [\n ...universalResolverErrors,\n {\n name: 'reverseWithGateways',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { type: 'bytes', name: 'reverseName' },\n { type: 'uint256', name: 'coinType' },\n { type: 'string[]', name: 'gateways' },\n ],\n outputs: [\n { type: 'string', name: 'resolvedName' },\n { type: 'address', name: 'resolver' },\n { type: 'address', name: 'reverseResolver' },\n ],\n },\n];\nexport const textResolverAbi = [\n {\n name: 'text',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes32' },\n { name: 'key', type: 'string' },\n ],\n outputs: [{ name: '', type: 'string' }],\n },\n];\nexport const addressResolverAbi = [\n {\n name: 'addr',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: 'name', type: 'bytes32' }],\n outputs: [{ name: '', type: 'address' }],\n },\n {\n name: 'addr',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes32' },\n { name: 'coinType', type: 'uint256' },\n ],\n outputs: [{ name: '', type: 'bytes' }],\n },\n];\n// ERC-1271\n// isValidSignature(bytes32 hash, bytes signature) → bytes4 magicValue\n/** @internal */\nexport const erc1271Abi = [\n {\n name: 'isValidSignature',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'hash', type: 'bytes32' },\n { name: 'signature', type: 'bytes' },\n ],\n outputs: [{ name: '', type: 'bytes4' }],\n },\n];\n// ERC-6492 - universal deployless signature validator contract\n// constructor(address _signer, bytes32 _hash, bytes _signature) → bytes4 returnValue\n// returnValue is either 0x1 (valid) or 0x0 (invalid)\nexport const erc6492SignatureValidatorAbi = [\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n name: 'isValidSig',\n },\n];\n/** [ERC-20 Token Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20) */\nexport const erc20Abi = [\n {\n type: 'event',\n name: 'Approval',\n inputs: [\n {\n indexed: true,\n name: 'owner',\n type: 'address',\n },\n {\n indexed: true,\n name: 'spender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'value',\n type: 'uint256',\n },\n ],\n },\n {\n type: 'event',\n name: 'Transfer',\n inputs: [\n {\n indexed: true,\n name: 'from',\n type: 'address',\n },\n {\n indexed: true,\n name: 'to',\n type: 'address',\n },\n {\n indexed: false,\n name: 'value',\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'allowance',\n stateMutability: 'view',\n inputs: [\n {\n name: 'owner',\n type: 'address',\n },\n {\n name: 'spender',\n type: 'address',\n },\n ],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'approve',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'spender',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n },\n {\n type: 'function',\n name: 'balanceOf',\n stateMutability: 'view',\n inputs: [\n {\n name: 'account',\n type: 'address',\n },\n ],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'decimals',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'uint8',\n },\n ],\n },\n {\n type: 'function',\n name: 'name',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'string',\n },\n ],\n },\n {\n type: 'function',\n name: 'symbol',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'string',\n },\n ],\n },\n {\n type: 'function',\n name: 'totalSupply',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'transfer',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'recipient',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n },\n {\n type: 'function',\n name: 'transferFrom',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'recipient',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n },\n];\n/**\n * [bytes32-flavored ERC-20](https://docs.makerdao.com/smart-contract-modules/mkr-module#4.-gotchas-potential-source-of-user-error)\n * for tokens (ie. Maker) that use bytes32 instead of string.\n */\nexport const erc20Abi_bytes32 = [\n {\n type: 'event',\n name: 'Approval',\n inputs: [\n {\n indexed: true,\n name: 'owner',\n type: 'address',\n },\n {\n indexed: true,\n name: 'spender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'value',\n type: 'uint256',\n },\n ],\n },\n {\n type: 'event',\n name: 'Transfer',\n inputs: [\n {\n indexed: true,\n name: 'from',\n type: 'address',\n },\n {\n indexed: true,\n name: 'to',\n type: 'address',\n },\n {\n indexed: false,\n name: 'value',\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'allowance',\n stateMutability: 'view',\n inputs: [\n {\n name: 'owner',\n type: 'address',\n },\n {\n name: 'spender',\n type: 'address',\n },\n ],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'approve',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'spender',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n },\n {\n type: 'function',\n name: 'balanceOf',\n stateMutability: 'view',\n inputs: [\n {\n name: 'account',\n type: 'address',\n },\n ],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'decimals',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'uint8',\n },\n ],\n },\n {\n type: 'function',\n name: 'name',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'bytes32',\n },\n ],\n },\n {\n type: 'function',\n name: 'symbol',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'bytes32',\n },\n ],\n },\n {\n type: 'function',\n name: 'totalSupply',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'transfer',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'recipient',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n },\n {\n type: 'function',\n name: 'transferFrom',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'recipient',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n },\n];\n/** [ERC-1155 Multi Token Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-1155) */\nexport const erc1155Abi = [\n {\n inputs: [\n {\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n internalType: 'uint256',\n name: 'balance',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'needed',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n name: 'ERC1155InsufficientBalance',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'approver',\n type: 'address',\n },\n ],\n name: 'ERC1155InvalidApprover',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'uint256',\n name: 'idsLength',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'valuesLength',\n type: 'uint256',\n },\n ],\n name: 'ERC1155InvalidArrayLength',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'operator',\n type: 'address',\n },\n ],\n name: 'ERC1155InvalidOperator',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'receiver',\n type: 'address',\n },\n ],\n name: 'ERC1155InvalidReceiver',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n ],\n name: 'ERC1155InvalidSender',\n type: 'error',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'operator',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n ],\n name: 'ERC1155MissingApprovalForAll',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'operator',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'bool',\n name: 'approved',\n type: 'bool',\n },\n ],\n name: 'ApprovalForAll',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'operator',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'from',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'to',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256[]',\n name: 'ids',\n type: 'uint256[]',\n },\n {\n indexed: false,\n internalType: 'uint256[]',\n name: 'values',\n type: 'uint256[]',\n },\n ],\n name: 'TransferBatch',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'operator',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'from',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'to',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'id',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'value',\n type: 'uint256',\n },\n ],\n name: 'TransferSingle',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: 'string',\n name: 'value',\n type: 'string',\n },\n {\n indexed: true,\n internalType: 'uint256',\n name: 'id',\n type: 'uint256',\n },\n ],\n name: 'URI',\n type: 'event',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n internalType: 'uint256',\n name: 'id',\n type: 'uint256',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n internalType: 'uint256',\n name: '',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address[]',\n name: 'accounts',\n type: 'address[]',\n },\n {\n internalType: 'uint256[]',\n name: 'ids',\n type: 'uint256[]',\n },\n ],\n name: 'balanceOfBatch',\n outputs: [\n {\n internalType: 'uint256[]',\n name: '',\n type: 'uint256[]',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'operator',\n type: 'address',\n },\n ],\n name: 'isApprovedForAll',\n outputs: [\n {\n internalType: 'bool',\n name: '',\n type: 'bool',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'from',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'to',\n type: 'address',\n },\n {\n internalType: 'uint256[]',\n name: 'ids',\n type: 'uint256[]',\n },\n {\n internalType: 'uint256[]',\n name: 'values',\n type: 'uint256[]',\n },\n {\n internalType: 'bytes',\n name: 'data',\n type: 'bytes',\n },\n ],\n name: 'safeBatchTransferFrom',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'from',\n type: 'address',\n },\n {\n internalType: 'address',\n name: 'to',\n type: 'address',\n },\n {\n internalType: 'uint256',\n name: 'id',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'value',\n type: 'uint256',\n },\n {\n internalType: 'bytes',\n name: 'data',\n type: 'bytes',\n },\n ],\n name: 'safeTransferFrom',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'operator',\n type: 'address',\n },\n {\n internalType: 'bool',\n name: 'approved',\n type: 'bool',\n },\n ],\n name: 'setApprovalForAll',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'bytes4',\n name: 'interfaceId',\n type: 'bytes4',\n },\n ],\n name: 'supportsInterface',\n outputs: [\n {\n internalType: 'bool',\n name: '',\n type: 'bool',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'uint256',\n name: '',\n type: 'uint256',\n },\n ],\n name: 'uri',\n outputs: [\n {\n internalType: 'string',\n name: '',\n type: 'string',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\n/** [ERC-721 Non-Fungible Token Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-721) */\nexport const erc721Abi = [\n {\n type: 'event',\n name: 'Approval',\n inputs: [\n {\n indexed: true,\n name: 'owner',\n type: 'address',\n },\n {\n indexed: true,\n name: 'spender',\n type: 'address',\n },\n {\n indexed: true,\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n },\n {\n type: 'event',\n name: 'ApprovalForAll',\n inputs: [\n {\n indexed: true,\n name: 'owner',\n type: 'address',\n },\n {\n indexed: true,\n name: 'operator',\n type: 'address',\n },\n {\n indexed: false,\n name: 'approved',\n type: 'bool',\n },\n ],\n },\n {\n type: 'event',\n name: 'Transfer',\n inputs: [\n {\n indexed: true,\n name: 'from',\n type: 'address',\n },\n {\n indexed: true,\n name: 'to',\n type: 'address',\n },\n {\n indexed: true,\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'approve',\n stateMutability: 'payable',\n inputs: [\n {\n name: 'spender',\n type: 'address',\n },\n {\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n outputs: [],\n },\n {\n type: 'function',\n name: 'balanceOf',\n stateMutability: 'view',\n inputs: [\n {\n name: 'account',\n type: 'address',\n },\n ],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'getApproved',\n stateMutability: 'view',\n inputs: [\n {\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'address',\n },\n ],\n },\n {\n type: 'function',\n name: 'isApprovedForAll',\n stateMutability: 'view',\n inputs: [\n {\n name: 'owner',\n type: 'address',\n },\n {\n name: 'operator',\n type: 'address',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n },\n {\n type: 'function',\n name: 'name',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'string',\n },\n ],\n },\n {\n type: 'function',\n name: 'ownerOf',\n stateMutability: 'view',\n inputs: [\n {\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n name: 'owner',\n type: 'address',\n },\n ],\n },\n {\n type: 'function',\n name: 'safeTransferFrom',\n stateMutability: 'payable',\n inputs: [\n {\n name: 'from',\n type: 'address',\n },\n {\n name: 'to',\n type: 'address',\n },\n {\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n outputs: [],\n },\n {\n type: 'function',\n name: 'safeTransferFrom',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'from',\n type: 'address',\n },\n {\n name: 'to',\n type: 'address',\n },\n {\n name: 'id',\n type: 'uint256',\n },\n {\n name: 'data',\n type: 'bytes',\n },\n ],\n outputs: [],\n },\n {\n type: 'function',\n name: 'setApprovalForAll',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'operator',\n type: 'address',\n },\n {\n name: 'approved',\n type: 'bool',\n },\n ],\n outputs: [],\n },\n {\n type: 'function',\n name: 'symbol',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'string',\n },\n ],\n },\n {\n type: 'function',\n name: 'tokenByIndex',\n stateMutability: 'view',\n inputs: [\n {\n name: 'index',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'tokenByIndex',\n stateMutability: 'view',\n inputs: [\n {\n name: 'owner',\n type: 'address',\n },\n {\n name: 'index',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'tokenURI',\n stateMutability: 'view',\n inputs: [\n {\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n outputs: [\n {\n type: 'string',\n },\n ],\n },\n {\n type: 'function',\n name: 'totalSupply',\n stateMutability: 'view',\n inputs: [],\n outputs: [\n {\n type: 'uint256',\n },\n ],\n },\n {\n type: 'function',\n name: 'transferFrom',\n stateMutability: 'payable',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'recipient',\n type: 'address',\n },\n {\n name: 'tokenId',\n type: 'uint256',\n },\n ],\n outputs: [],\n },\n];\n/** [ERC-4626 Tokenized Vaults Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-4626) */\nexport const erc4626Abi = [\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'owner',\n type: 'address',\n },\n {\n indexed: true,\n name: 'spender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'value',\n type: 'uint256',\n },\n ],\n name: 'Approval',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: true,\n name: 'receiver',\n type: 'address',\n },\n {\n indexed: false,\n name: 'assets',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'shares',\n type: 'uint256',\n },\n ],\n name: 'Deposit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'from',\n type: 'address',\n },\n {\n indexed: true,\n name: 'to',\n type: 'address',\n },\n {\n indexed: false,\n name: 'value',\n type: 'uint256',\n },\n ],\n name: 'Transfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: true,\n name: 'receiver',\n type: 'address',\n },\n {\n indexed: true,\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n name: 'assets',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'shares',\n type: 'uint256',\n },\n ],\n name: 'Withdraw',\n type: 'event',\n },\n {\n inputs: [\n {\n name: 'owner',\n type: 'address',\n },\n {\n name: 'spender',\n type: 'address',\n },\n ],\n name: 'allowance',\n outputs: [\n {\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'spender',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'approve',\n outputs: [\n {\n type: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'asset',\n outputs: [\n {\n name: 'assetTokenAddress',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'account',\n type: 'address',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n name: 'convertToAssets',\n outputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n name: 'convertToShares',\n outputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n {\n name: 'receiver',\n type: 'address',\n },\n ],\n name: 'deposit',\n outputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'caller',\n type: 'address',\n },\n ],\n name: 'maxDeposit',\n outputs: [\n {\n name: 'maxAssets',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'caller',\n type: 'address',\n },\n ],\n name: 'maxMint',\n outputs: [\n {\n name: 'maxShares',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'owner',\n type: 'address',\n },\n ],\n name: 'maxRedeem',\n outputs: [\n {\n name: 'maxShares',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'owner',\n type: 'address',\n },\n ],\n name: 'maxWithdraw',\n outputs: [\n {\n name: 'maxAssets',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n {\n name: 'receiver',\n type: 'address',\n },\n ],\n name: 'mint',\n outputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n name: 'previewDeposit',\n outputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n name: 'previewMint',\n outputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n name: 'previewRedeem',\n outputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n name: 'previewWithdraw',\n outputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n {\n name: 'receiver',\n type: 'address',\n },\n {\n name: 'owner',\n type: 'address',\n },\n ],\n name: 'redeem',\n outputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'totalAssets',\n outputs: [\n {\n name: 'totalManagedAssets',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'totalSupply',\n outputs: [\n {\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'to',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'transfer',\n outputs: [\n {\n type: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'from',\n type: 'address',\n },\n {\n name: 'to',\n type: 'address',\n },\n {\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'transferFrom',\n outputs: [\n {\n type: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'assets',\n type: 'uint256',\n },\n {\n name: 'receiver',\n type: 'address',\n },\n {\n name: 'owner',\n type: 'address',\n },\n ],\n name: 'withdraw',\n outputs: [\n {\n name: 'shares',\n type: 'uint256',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n];\n//# sourceMappingURL=abis.js.map","export const aggregate3Signature = '0x82ad56cb';\n//# sourceMappingURL=contract.js.map","export const deploylessCallViaBytecodeBytecode = '0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe';\nexport const deploylessCallViaFactoryBytecode = '0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe';\nexport const erc6492SignatureValidatorByteCode = '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';\nexport const multicall3Bytecode = '0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033';\n//# sourceMappingURL=contracts.js.map","import { BaseError } from './base.js';\nexport class ChainDoesNotSupportContract extends BaseError {\n constructor({ blockNumber, chain, contract, }) {\n super(`Chain \"${chain.name}\" does not support contract \"${contract.name}\".`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ...(blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber\n ? [\n `- The contract \"${contract.name}\" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`,\n ]\n : [\n `- The chain does not have the contract \"${contract.name}\" configured.`,\n ]),\n ],\n name: 'ChainDoesNotSupportContract',\n });\n }\n}\nexport class ChainMismatchError extends BaseError {\n constructor({ chain, currentChainId, }) {\n super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} – ${chain.name}).`, {\n metaMessages: [\n `Current Chain ID: ${currentChainId}`,\n `Expected Chain ID: ${chain.id} – ${chain.name}`,\n ],\n name: 'ChainMismatchError',\n });\n }\n}\nexport class ChainNotFoundError extends BaseError {\n constructor() {\n super([\n 'No chain was provided to the request.',\n 'Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.',\n ].join('\\n'), {\n name: 'ChainNotFoundError',\n });\n }\n}\nexport class ClientChainNotConfiguredError extends BaseError {\n constructor() {\n super('No chain was provided to the Client.', {\n name: 'ClientChainNotConfiguredError',\n });\n }\n}\nexport class InvalidChainIdError extends BaseError {\n constructor({ chainId }) {\n super(typeof chainId === 'number'\n ? `Chain ID \"${chainId}\" is invalid.`\n : 'Chain ID is invalid.', { name: 'InvalidChainIdError' });\n }\n}\n//# sourceMappingURL=chain.js.map","import { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nconst docsPath = '/docs/contract/encodeDeployData';\nexport function encodeDeployData(parameters) {\n const { abi, args, bytecode } = parameters;\n if (!args || args.length === 0)\n return bytecode;\n const description = abi.find((x) => 'type' in x && x.type === 'constructor');\n if (!description)\n throw new AbiConstructorNotFoundError({ docsPath });\n if (!('inputs' in description))\n throw new AbiConstructorParamsNotFoundError({ docsPath });\n if (!description.inputs || description.inputs.length === 0)\n throw new AbiConstructorParamsNotFoundError({ docsPath });\n const data = encodeAbiParameters(description.inputs, args);\n return concatHex([bytecode, data]);\n}\n//# sourceMappingURL=encodeDeployData.js.map","import { ChainDoesNotSupportContract, } from '../../errors/chain.js';\nexport function getChainContractAddress({ blockNumber, chain, contract: name, }) {\n const contract = chain?.contracts?.[name];\n if (!contract)\n throw new ChainDoesNotSupportContract({\n chain,\n contract: { name },\n });\n if (blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber)\n throw new ChainDoesNotSupportContract({\n blockNumber,\n chain,\n contract: {\n name,\n blockCreated: contract.blockCreated,\n },\n });\n return contract.address;\n}\n//# sourceMappingURL=getChainContractAddress.js.map","import { CallExecutionError, } from '../../errors/contract.js';\nimport { UnknownNodeError } from '../../errors/node.js';\nimport { getNodeError, } from './getNodeError.js';\nexport function getCallError(err, { docsPath, ...args }) {\n const cause = (() => {\n const cause = getNodeError(err, args);\n if (cause instanceof UnknownNodeError)\n return err;\n return cause;\n })();\n return new CallExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getCallError.js.map","/** @internal */\nexport function withResolvers() {\n let resolve = () => undefined;\n let reject = () => undefined;\n const promise = new Promise((resolve_, reject_) => {\n resolve = resolve_;\n reject = reject_;\n });\n return { promise, resolve, reject };\n}\n//# sourceMappingURL=withResolvers.js.map","import { withResolvers } from './withResolvers.js';\nconst schedulerCache = /*#__PURE__*/ new Map();\n/** @internal */\nexport function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort, }) {\n const exec = async () => {\n const scheduler = getScheduler();\n flush();\n const args = scheduler.map(({ args }) => args);\n if (args.length === 0)\n return;\n fn(args)\n .then((data) => {\n if (sort && Array.isArray(data))\n data.sort(sort);\n for (let i = 0; i < scheduler.length; i++) {\n const { resolve } = scheduler[i];\n resolve?.([data[i], data]);\n }\n })\n .catch((err) => {\n for (let i = 0; i < scheduler.length; i++) {\n const { reject } = scheduler[i];\n reject?.(err);\n }\n });\n };\n const flush = () => schedulerCache.delete(id);\n const getBatchedArgs = () => getScheduler().map(({ args }) => args);\n const getScheduler = () => schedulerCache.get(id) || [];\n const setScheduler = (item) => schedulerCache.set(id, [...getScheduler(), item]);\n return {\n flush,\n async schedule(args) {\n const { promise, resolve, reject } = withResolvers();\n const split = shouldSplitBatch?.([...getBatchedArgs(), args]);\n if (split)\n exec();\n const hasActiveScheduler = getScheduler().length > 0;\n if (hasActiveScheduler) {\n setScheduler({ args, resolve, reject });\n return promise;\n }\n setScheduler({ args, resolve, reject });\n setTimeout(exec, wait);\n return promise;\n },\n };\n}\n//# sourceMappingURL=createBatchScheduler.js.map","import { parseAbi } from 'abitype';\nimport * as BlockOverrides from 'ox/BlockOverrides';\nimport { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { multicall3Abi } from '../../constants/abis.js';\nimport { aggregate3Signature } from '../../constants/contract.js';\nimport { deploylessCallViaBytecodeBytecode, deploylessCallViaFactoryBytecode, multicall3Bytecode, } from '../../constants/contracts.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ChainDoesNotSupportContract, ClientChainNotConfiguredError, } from '../../errors/chain.js';\nimport { CounterfactualDeploymentFailedError, RawContractError, } from '../../errors/contract.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeDeployData, } from '../../utils/abi/encodeDeployData.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getCallError, } from '../../utils/errors/getCallError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { createBatchScheduler, } from '../../utils/promise/createBatchScheduler.js';\nimport { serializeStateOverride, } from '../../utils/stateOverride.js';\nimport { assertRequest } from '../../utils/transaction/assertRequest.js';\n/**\n * Executes a new message call immediately without submitting a transaction to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/call\n * - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)\n *\n * @param client - Client to use\n * @param parameters - {@link CallParameters}\n * @returns The call data. {@link CallReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { call } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const data = await call(client, {\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * })\n */\nexport async function call(client, args) {\n const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = client.experimental_blockTag ?? 'latest', accessList, blobs, blockOverrides, code, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride, ...rest } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n if (code && (factory || factoryData))\n throw new BaseError('Cannot provide both `code` & `factory`/`factoryData` as parameters.');\n if (code && to)\n throw new BaseError('Cannot provide both `code` & `to` as parameters.');\n // Check if the call is deployless via bytecode.\n const deploylessCallViaBytecode = code && data_;\n // Check if the call is deployless via a factory.\n const deploylessCallViaFactory = factory && factoryData && to && data_;\n const deploylessCall = deploylessCallViaBytecode || deploylessCallViaFactory;\n const data = (() => {\n if (deploylessCallViaBytecode)\n return toDeploylessCallViaBytecodeData({\n code,\n data: data_,\n });\n if (deploylessCallViaFactory)\n return toDeploylessCallViaFactoryData({\n data: data_,\n factory,\n factoryData,\n to,\n });\n return data_;\n })();\n try {\n assertRequest(args);\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const rpcBlockOverrides = blockOverrides\n ? BlockOverrides.toRpc(blockOverrides)\n : undefined;\n const rpcStateOverride = serializeStateOverride(stateOverride);\n const chainFormat = client.chain?.formatters?.transactionRequest?.format;\n const format = chainFormat || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format: chainFormat }),\n from: account?.address,\n accessList,\n authorizationList,\n blobs,\n data,\n gas,\n gasPrice,\n maxFeePerBlobGas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to: deploylessCall ? undefined : to,\n value,\n }, 'call');\n if (batch &&\n shouldPerformMulticall({ request }) &&\n !rpcStateOverride &&\n !rpcBlockOverrides) {\n try {\n return await scheduleMulticall(client, {\n ...request,\n blockNumber,\n blockTag,\n });\n }\n catch (err) {\n if (!(err instanceof ClientChainNotConfiguredError) &&\n !(err instanceof ChainDoesNotSupportContract))\n throw err;\n }\n }\n const params = (() => {\n const base = [\n request,\n block,\n ];\n if (rpcStateOverride && rpcBlockOverrides)\n return [...base, rpcStateOverride, rpcBlockOverrides];\n if (rpcStateOverride)\n return [...base, rpcStateOverride];\n if (rpcBlockOverrides)\n return [...base, {}, rpcBlockOverrides];\n return base;\n })();\n const response = await client.request({\n method: 'eth_call',\n params,\n });\n if (response === '0x')\n return { data: undefined };\n return { data: response };\n }\n catch (err) {\n const data = getRevertErrorData(err);\n // Check for CCIP-Read offchain lookup signature.\n const { offchainLookup, offchainLookupSignature } = await import('../../utils/ccip.js');\n if (client.ccipRead !== false &&\n data?.slice(0, 10) === offchainLookupSignature &&\n to)\n return { data: await offchainLookup(client, { data, to }) };\n // Check for counterfactual deployment error.\n if (deploylessCall && data?.slice(0, 10) === '0x101bb98d')\n throw new CounterfactualDeploymentFailedError({ factory });\n throw getCallError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n// We only want to perform a scheduled multicall if:\n// - The request has calldata,\n// - The request has a target address,\n// - The target address is not already the aggregate3 signature,\n// - The request has no other properties (`nonce`, `gas`, etc cannot be sent with a multicall).\nfunction shouldPerformMulticall({ request }) {\n const { data, to, ...request_ } = request;\n if (!data)\n return false;\n if (data.startsWith(aggregate3Signature))\n return false;\n if (!to)\n return false;\n if (Object.values(request_).filter((x) => typeof x !== 'undefined').length > 0)\n return false;\n return true;\n}\nasync function scheduleMulticall(client, args) {\n const { batchSize = 1024, deployless = false, wait = 0, } = typeof client.batch?.multicall === 'object' ? client.batch.multicall : {};\n const { blockNumber, blockTag = client.experimental_blockTag ?? 'latest', data, to, } = args;\n const multicallAddress = (() => {\n if (deployless)\n return null;\n if (args.multicallAddress)\n return args.multicallAddress;\n if (client.chain) {\n return getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n throw new ClientChainNotConfiguredError();\n })();\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const { schedule } = createBatchScheduler({\n id: `${client.uid}.${block}`,\n wait,\n shouldSplitBatch(args) {\n const size = args.reduce((size, { data }) => size + (data.length - 2), 0);\n return size > batchSize * 2;\n },\n fn: async (requests) => {\n const calls = requests.map((request) => ({\n allowFailure: true,\n callData: request.data,\n target: request.to,\n }));\n const calldata = encodeFunctionData({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n });\n const data = await client.request({\n method: 'eth_call',\n params: [\n {\n ...(multicallAddress === null\n ? {\n data: toDeploylessCallViaBytecodeData({\n code: multicall3Bytecode,\n data: calldata,\n }),\n }\n : { to: multicallAddress, data: calldata }),\n },\n block,\n ],\n });\n return decodeFunctionResult({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n data: data || '0x',\n });\n },\n });\n const [{ returnData, success }] = await schedule({ data, to });\n if (!success)\n throw new RawContractError({ data: returnData });\n if (returnData === '0x')\n return { data: undefined };\n return { data: returnData };\n}\nfunction toDeploylessCallViaBytecodeData(parameters) {\n const { code, data } = parameters;\n return encodeDeployData({\n abi: parseAbi(['constructor(bytes, bytes)']),\n bytecode: deploylessCallViaBytecodeBytecode,\n args: [code, data],\n });\n}\nfunction toDeploylessCallViaFactoryData(parameters) {\n const { data, factory, factoryData, to } = parameters;\n return encodeDeployData({\n abi: parseAbi(['constructor(address, bytes, address, bytes)']),\n bytecode: deploylessCallViaFactoryBytecode,\n args: [to, data, factory, factoryData],\n });\n}\n/** @internal */\nexport function getRevertErrorData(err) {\n if (!(err instanceof BaseError))\n return undefined;\n const error = err.walk();\n return typeof error?.data === 'object' ? error.data?.data : error.data;\n}\n//# sourceMappingURL=call.js.map","import { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError, } from '../../utils/errors/getContractError.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { call } from './call.js';\n/**\n * Calls a read-only function on a contract, and returns the response.\n *\n * - Docs: https://viem.sh/docs/contract/readContract\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_reading-contracts\n *\n * A \"read-only\" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).\n *\n * @param client - Client to use\n * @param parameters - {@link ReadContractParameters}\n * @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { readContract } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const result = await readContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function balanceOf(address) view returns (uint256)']),\n * functionName: 'balanceOf',\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * })\n * // 424122n\n */\nexport async function readContract(client, parameters) {\n const { abi, address, args, functionName, ...rest } = parameters;\n const calldata = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const { data } = await getAction(client, call, 'call')({\n ...rest,\n data: calldata,\n to: address,\n });\n return decodeFunctionResult({\n abi,\n args,\n functionName,\n data: data || '0x',\n });\n }\n catch (error) {\n throw getContractError(error, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/readContract',\n functionName,\n });\n }\n}\n//# sourceMappingURL=readContract.js.map","/** @internal */\nexport const listenersCache = /*#__PURE__*/ new Map();\n/** @internal */\nexport const cleanupCache = /*#__PURE__*/ new Map();\nlet callbackCount = 0;\n/**\n * @description Sets up an observer for a given function. If another function\n * is set up under the same observer id, the function will only be called once\n * for both instances of the observer.\n */\nexport function observe(observerId, callbacks, fn) {\n const callbackId = ++callbackCount;\n const getListeners = () => listenersCache.get(observerId) || [];\n const unsubscribe = () => {\n const listeners = getListeners();\n listenersCache.set(observerId, listeners.filter((cb) => cb.id !== callbackId));\n };\n const unwatch = () => {\n const listeners = getListeners();\n if (!listeners.some((cb) => cb.id === callbackId))\n return;\n const cleanup = cleanupCache.get(observerId);\n if (listeners.length === 1 && cleanup) {\n const p = cleanup();\n if (p instanceof Promise)\n p.catch(() => { });\n }\n unsubscribe();\n };\n const listeners = getListeners();\n listenersCache.set(observerId, [\n ...listeners,\n { id: callbackId, fns: callbacks },\n ]);\n if (listeners && listeners.length > 0)\n return unwatch;\n const emit = {};\n for (const key in callbacks) {\n emit[key] = ((...args) => {\n const listeners = getListeners();\n if (listeners.length === 0)\n return;\n for (const listener of listeners)\n listener.fns[key]?.(...args);\n });\n }\n const cleanup = fn(emit);\n if (typeof cleanup === 'function')\n cleanupCache.set(observerId, cleanup);\n return unwatch;\n}\n//# sourceMappingURL=observe.js.map","export async function wait(time) {\n return new Promise((res) => setTimeout(res, time));\n}\n//# sourceMappingURL=wait.js.map","import { wait } from './wait.js';\n/**\n * @description Polls a function at a specified interval.\n */\nexport function poll(fn, { emitOnBegin, initialWaitTime, interval }) {\n let active = true;\n const unwatch = () => (active = false);\n const watch = async () => {\n let data;\n if (emitOnBegin)\n data = await fn({ unpoll: unwatch });\n const initialWait = (await initialWaitTime?.(data)) ?? interval;\n await wait(initialWait);\n const poll = async () => {\n if (!active)\n return;\n await fn({ unpoll: unwatch });\n await wait(interval);\n poll();\n };\n poll();\n };\n watch();\n return unwatch;\n}\n//# sourceMappingURL=poll.js.map","/** @internal */\nexport const promiseCache = /*#__PURE__*/ new Map();\n/** @internal */\nexport const responseCache = /*#__PURE__*/ new Map();\nexport function getCache(cacheKey) {\n const buildCache = (cacheKey, cache) => ({\n clear: () => cache.delete(cacheKey),\n get: () => cache.get(cacheKey),\n set: (data) => cache.set(cacheKey, data),\n });\n const promise = buildCache(cacheKey, promiseCache);\n const response = buildCache(cacheKey, responseCache);\n return {\n clear: () => {\n promise.clear();\n response.clear();\n },\n promise,\n response,\n };\n}\n/**\n * @description Returns the result of a given promise, and caches the result for\n * subsequent invocations against a provided cache key.\n */\nexport async function withCache(fn, { cacheKey, cacheTime = Number.POSITIVE_INFINITY }) {\n const cache = getCache(cacheKey);\n // If a response exists in the cache, and it's not expired, return it\n // and do not invoke the promise.\n // If the max age is 0, the cache is disabled.\n const response = cache.response.get();\n if (response && cacheTime > 0) {\n const age = Date.now() - response.created.getTime();\n if (age < cacheTime)\n return response.data;\n }\n let promise = cache.promise.get();\n if (!promise) {\n promise = fn();\n // Store the promise in the cache so that subsequent invocations\n // will wait for the same promise to resolve (deduping).\n cache.promise.set(promise);\n }\n try {\n const data = await promise;\n // Store the response in the cache so that subsequent invocations\n // will return the same response.\n cache.response.set({ created: new Date(), data });\n return data;\n }\n finally {\n // Clear the promise cache so that subsequent invocations will\n // invoke the promise again.\n cache.promise.clear();\n }\n}\n//# sourceMappingURL=withCache.js.map","import { getCache, withCache, } from '../../utils/promise/withCache.js';\nconst cacheKey = (id) => `blockNumber.${id}`;\n/** @internal */\nexport function getBlockNumberCache(id) {\n return getCache(cacheKey(id));\n}\n/**\n * Returns the number of the most recent block seen.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockNumber\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_fetching-blocks\n * - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockNumberParameters}\n * @returns The number of the block. {@link GetBlockNumberReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockNumber } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const blockNumber = await getBlockNumber(client)\n * // 69420n\n */\nexport async function getBlockNumber(client, { cacheTime = client.cacheTime } = {}) {\n const blockNumberHex = await withCache(() => client.request({\n method: 'eth_blockNumber',\n }), { cacheKey: cacheKey(client.uid), cacheTime });\n return BigInt(blockNumberHex);\n}\n//# sourceMappingURL=getBlockNumber.js.map","import { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport { formatLog, } from '../../utils/formatters/log.js';\n/**\n * Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterChanges\n * - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)\n *\n * A Filter can be created from the following actions:\n *\n * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)\n * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)\n * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)\n * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)\n *\n * Depending on the type of filter, the return value will be different:\n *\n * - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.\n * - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.\n * - If the filter was created with `createBlockFilter`, it returns a list of block hashes.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterChangesParameters}\n * @returns Logs or hashes. {@link GetFilterChangesReturnType}\n *\n * @example\n * // Blocks\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n *\n * @example\n * // Contract Events\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * eventName: 'Transfer',\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Raw Events\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Transactions\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n */\nexport async function getFilterChanges(_client, { filter, }) {\n const strict = 'strict' in filter && filter.strict;\n const logs = await filter.request({\n method: 'eth_getFilterChanges',\n params: [filter.id],\n });\n if (typeof logs[0] === 'string')\n return logs;\n const formattedLogs = logs.map((log) => formatLog(log));\n if (!('abi' in filter) || !filter.abi)\n return formattedLogs;\n return parseEventLogs({\n abi: filter.abi,\n logs: formattedLogs,\n strict,\n });\n}\n//# sourceMappingURL=getFilterChanges.js.map","/**\n * Destroys a [`Filter`](https://viem.sh/docs/glossary/types#filter).\n *\n * - Docs: https://viem.sh/docs/actions/public/uninstallFilter\n * - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)\n *\n * Destroys a Filter that was created from one of the following Actions:\n * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)\n * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)\n * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)\n *\n * @param client - Client to use\n * @param parameters - {@link UninstallFilterParameters}\n * @returns A boolean indicating if the Filter was successfully uninstalled. {@link UninstallFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter, uninstallFilter } from 'viem/public'\n *\n * const filter = await createPendingTransactionFilter(client)\n * const uninstalled = await uninstallFilter(client, { filter })\n * // true\n */\nexport async function uninstallFilter(_client, { filter }) {\n return filter.request({\n method: 'eth_uninstallFilter',\n params: [filter.id],\n });\n}\n//# sourceMappingURL=uninstallFilter.js.map","import { BaseError } from './base.js';\nexport class AccountNotFoundError extends BaseError {\n constructor({ docsPath } = {}) {\n super([\n 'Could not find an Account to execute with this Action.',\n 'Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client.',\n ].join('\\n'), {\n docsPath,\n docsSlug: 'account',\n name: 'AccountNotFoundError',\n });\n }\n}\nexport class AccountTypeNotSupportedError extends BaseError {\n constructor({ docsPath, metaMessages, type, }) {\n super(`Account type \"${type}\" is not supported.`, {\n docsPath,\n metaMessages,\n name: 'AccountTypeNotSupportedError',\n });\n }\n}\n//# sourceMappingURL=account.js.map","import { BaseError } from './base.js';\nexport class BundleFailedError extends BaseError {\n constructor(result) {\n super(`Call bundle failed with status: ${result.statusCode}`, {\n name: 'BundleFailedError',\n });\n Object.defineProperty(this, \"result\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.result = result;\n }\n}\n//# sourceMappingURL=calls.js.map","import { wait } from '../wait.js';\nexport function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry = () => true, } = {}) {\n return new Promise((resolve, reject) => {\n const attemptRetry = async ({ count = 0 } = {}) => {\n const retry = async ({ error }) => {\n const delay = typeof delay_ === 'function' ? delay_({ count, error }) : delay_;\n if (delay)\n await wait(delay);\n attemptRetry({ count: count + 1 });\n };\n try {\n const data = await fn();\n resolve(data);\n }\n catch (err) {\n if (count < retryCount &&\n (await shouldRetry({ count, error: err })))\n return retry({ error: err });\n reject(err);\n }\n };\n attemptRetry();\n });\n}\n//# sourceMappingURL=withRetry.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nimport { formatLog } from './log.js';\nimport { transactionType } from './transaction.js';\nexport const receiptStatuses = {\n '0x0': 'reverted',\n '0x1': 'success',\n};\nexport function formatTransactionReceipt(transactionReceipt, _) {\n const receipt = {\n ...transactionReceipt,\n blockNumber: transactionReceipt.blockNumber\n ? BigInt(transactionReceipt.blockNumber)\n : null,\n contractAddress: transactionReceipt.contractAddress\n ? transactionReceipt.contractAddress\n : null,\n cumulativeGasUsed: transactionReceipt.cumulativeGasUsed\n ? BigInt(transactionReceipt.cumulativeGasUsed)\n : null,\n effectiveGasPrice: transactionReceipt.effectiveGasPrice\n ? BigInt(transactionReceipt.effectiveGasPrice)\n : null,\n gasUsed: transactionReceipt.gasUsed\n ? BigInt(transactionReceipt.gasUsed)\n : null,\n logs: transactionReceipt.logs\n ? transactionReceipt.logs.map((log) => formatLog(log))\n : null,\n to: transactionReceipt.to ? transactionReceipt.to : null,\n transactionIndex: transactionReceipt.transactionIndex\n ? hexToNumber(transactionReceipt.transactionIndex)\n : null,\n status: transactionReceipt.status\n ? receiptStatuses[transactionReceipt.status]\n : null,\n type: transactionReceipt.type\n ? transactionType[transactionReceipt.type] || transactionReceipt.type\n : null,\n };\n if (transactionReceipt.blobGasPrice)\n receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);\n if (transactionReceipt.blobGasUsed)\n receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);\n return receipt;\n}\nexport const defineTransactionReceipt = /*#__PURE__*/ defineFormatter('transactionReceipt', formatTransactionReceipt);\n//# sourceMappingURL=transactionReceipt.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { BaseError } from '../../errors/base.js';\nimport { AtomicityNotSupportedError, UnsupportedNonOptionalCapabilityError, } from '../../errors/rpc.js';\nimport { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js';\nimport { concat } from '../../utils/data/concat.js';\nimport { hexToBigInt } from '../../utils/encoding/fromHex.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { getTransactionError } from '../../utils/errors/getTransactionError.js';\nimport { sendTransaction } from './sendTransaction.js';\nexport const fallbackMagicIdentifier = '0x5792579257925792579257925792579257925792579257925792579257925792';\nexport const fallbackTransactionErrorMagicIdentifier = numberToHex(0, {\n size: 32,\n});\n/**\n * Requests the connected wallet to send a batch of calls.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/sendCalls\n * - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792)\n *\n * @param client - Client to use\n * @returns Transaction identifier. {@link SendCallsReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { sendCalls } from 'viem/actions'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const id = await sendCalls(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * calls: [\n * {\n * data: '0xdeadbeef',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * },\n * {\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: 69420n,\n * },\n * ],\n * })\n */\nexport async function sendCalls(client, parameters) {\n const { account: account_ = client.account, capabilities, chain = client.chain, experimental_fallback, experimental_fallbackDelay = 32, forceAtomic = false, id, version = '2.0.0', } = parameters;\n const account = account_ ? parseAccount(account_) : null;\n const calls = parameters.calls.map((call_) => {\n const call = call_;\n const data = call.abi\n ? encodeFunctionData({\n abi: call.abi,\n functionName: call.functionName,\n args: call.args,\n })\n : call.data;\n return {\n data: call.dataSuffix && data ? concat([data, call.dataSuffix]) : data,\n to: call.to,\n value: call.value ? numberToHex(call.value) : undefined,\n };\n });\n try {\n const response = await client.request({\n method: 'wallet_sendCalls',\n params: [\n {\n atomicRequired: forceAtomic,\n calls,\n capabilities,\n chainId: numberToHex(chain.id),\n from: account?.address,\n id,\n version,\n },\n ],\n }, { retryCount: 0 });\n if (typeof response === 'string')\n return { id: response };\n return response;\n }\n catch (err) {\n const error = err;\n // If the transport does not support EIP-5792, fall back to\n // `eth_sendTransaction`.\n if (experimental_fallback &&\n (error.name === 'MethodNotFoundRpcError' ||\n error.name === 'MethodNotSupportedRpcError' ||\n error.name === 'UnknownRpcError' ||\n error.details\n .toLowerCase()\n .includes('does not exist / is not available') ||\n error.details.toLowerCase().includes('missing or invalid. request()') ||\n error.details\n .toLowerCase()\n .includes('did not match any variant of untagged enum') ||\n error.details\n .toLowerCase()\n .includes('account upgraded to unsupported contract') ||\n error.details.toLowerCase().includes('eip-7702 not supported') ||\n error.details.toLowerCase().includes('unsupported wc_ method') ||\n // magic.link\n error.details\n .toLowerCase()\n .includes('feature toggled misconfigured') ||\n // Trust Wallet\n error.details\n .toLowerCase()\n .includes('jsonrpcengine: response has no error or result for request'))) {\n if (capabilities) {\n const hasNonOptionalCapability = Object.values(capabilities).some((capability) => !capability.optional);\n if (hasNonOptionalCapability) {\n const message = 'non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.';\n throw new UnsupportedNonOptionalCapabilityError(new BaseError(message, {\n details: message,\n }));\n }\n }\n if (forceAtomic && calls.length > 1) {\n const message = '`forceAtomic` is not supported on fallback to `eth_sendTransaction`.';\n throw new AtomicityNotSupportedError(new BaseError(message, {\n details: message,\n }));\n }\n const promises = [];\n for (const call of calls) {\n const promise = sendTransaction(client, {\n account,\n chain,\n data: call.data,\n to: call.to,\n value: call.value ? hexToBigInt(call.value) : undefined,\n });\n promises.push(promise);\n // Note: some browser wallets require a small delay between transactions\n // to prevent duplicate JSON-RPC requests.\n if (experimental_fallbackDelay > 0)\n await new Promise((resolve) => setTimeout(resolve, experimental_fallbackDelay));\n }\n const results = await Promise.allSettled(promises);\n if (results.every((r) => r.status === 'rejected'))\n throw results[0].reason;\n const hashes = results.map((result) => {\n if (result.status === 'fulfilled')\n return result.value;\n return fallbackTransactionErrorMagicIdentifier;\n });\n return {\n id: concat([\n ...hashes,\n numberToHex(chain.id, { size: 32 }),\n fallbackMagicIdentifier,\n ]),\n };\n }\n throw getTransactionError(err, {\n ...parameters,\n account,\n chain: parameters.chain,\n });\n }\n}\n//# sourceMappingURL=sendCalls.js.map","import { sliceHex } from '../../utils/data/slice.js';\nimport { trim } from '../../utils/data/trim.js';\nimport { hexToBigInt, hexToNumber } from '../../utils/encoding/fromHex.js';\nimport { receiptStatuses } from '../../utils/formatters/transactionReceipt.js';\nimport { fallbackMagicIdentifier, fallbackTransactionErrorMagicIdentifier, } from './sendCalls.js';\n/**\n * Returns the status of a call batch that was sent via `sendCalls`.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus\n * - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)\n *\n * @param client - Client to use\n * @returns Status of the calls. {@link GetCallsStatusReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getCallsStatus } from 'viem/actions'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const { receipts, status } = await getCallsStatus(client, { id: '0xdeadbeef' })\n */\nexport async function getCallsStatus(client, parameters) {\n async function getStatus(id) {\n const isTransactions = id.endsWith(fallbackMagicIdentifier.slice(2));\n if (isTransactions) {\n const chainId = trim(sliceHex(id, -64, -32));\n const hashes = sliceHex(id, 0, -64)\n .slice(2)\n .match(/.{1,64}/g);\n const receipts = await Promise.all(hashes.map((hash) => fallbackTransactionErrorMagicIdentifier.slice(2) !== hash\n ? client.request({\n method: 'eth_getTransactionReceipt',\n params: [`0x${hash}`],\n }, { dedupe: true })\n : undefined));\n const status = (() => {\n if (receipts.some((r) => r === null))\n return 100; // pending\n if (receipts.every((r) => r?.status === '0x1'))\n return 200; // success\n if (receipts.every((r) => r?.status === '0x0'))\n return 500; // complete failure\n return 600; // partial failure\n })();\n return {\n atomic: false,\n chainId: hexToNumber(chainId),\n receipts: receipts.filter(Boolean),\n status,\n version: '2.0.0',\n };\n }\n return client.request({\n method: 'wallet_getCallsStatus',\n params: [id],\n });\n }\n const { atomic = false, chainId, receipts, version = '2.0.0', ...response } = await getStatus(parameters.id);\n const [status, statusCode] = (() => {\n const statusCode = response.status;\n if (statusCode >= 100 && statusCode < 200)\n return ['pending', statusCode];\n if (statusCode >= 200 && statusCode < 300)\n return ['success', statusCode];\n if (statusCode >= 300 && statusCode < 700)\n return ['failure', statusCode];\n // @ts-expect-error: for backwards compatibility\n if (statusCode === 'CONFIRMED')\n return ['success', 200];\n // @ts-expect-error: for backwards compatibility\n if (statusCode === 'PENDING')\n return ['pending', 100];\n return [undefined, statusCode];\n })();\n return {\n ...response,\n atomic,\n // @ts-expect-error: for backwards compatibility\n chainId: chainId ? hexToNumber(chainId) : undefined,\n receipts: receipts?.map((receipt) => ({\n ...receipt,\n blockNumber: hexToBigInt(receipt.blockNumber),\n gasUsed: hexToBigInt(receipt.gasUsed),\n status: receiptStatuses[receipt.status],\n })) ?? [],\n statusCode,\n status,\n version,\n };\n}\n//# sourceMappingURL=getCallsStatus.js.map","import { BaseError } from '../../errors/base.js';\nimport { BundleFailedError } from '../../errors/calls.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { withResolvers } from '../../utils/promise/withResolvers.js';\nimport { withRetry, } from '../../utils/promise/withRetry.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getCallsStatus, } from './getCallsStatus.js';\n/**\n * Waits for the status & receipts of a call bundle that was sent via `sendCalls`.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus\n * - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792)\n *\n * @param client - Client to use\n * @param parameters - {@link WaitForCallsStatusParameters}\n * @returns Status & receipts of the call bundle. {@link WaitForCallsStatusReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { waitForCallsStatus } from 'viem/actions'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n *\n * const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })\n */\nexport async function waitForCallsStatus(client, parameters) {\n const { id, pollingInterval = client.pollingInterval, status = ({ statusCode }) => statusCode === 200 || statusCode >= 300, retryCount = 4, retryDelay = ({ count }) => ~~(1 << count) * 200, // exponential backoff\n timeout = 60_000, throwOnFailure = false, } = parameters;\n const observerId = stringify(['waitForCallsStatus', client.uid, id]);\n const { promise, resolve, reject } = withResolvers();\n let timer;\n const unobserve = observe(observerId, { resolve, reject }, (emit) => {\n const unpoll = poll(async () => {\n const done = (fn) => {\n clearTimeout(timer);\n unpoll();\n fn();\n unobserve();\n };\n try {\n const result = await withRetry(async () => {\n const result = await getAction(client, getCallsStatus, 'getCallsStatus')({ id });\n if (throwOnFailure && result.status === 'failure')\n throw new BundleFailedError(result);\n return result;\n }, {\n retryCount,\n delay: retryDelay,\n });\n if (!status(result))\n return;\n done(() => emit.resolve(result));\n }\n catch (error) {\n done(() => emit.reject(error));\n }\n }, {\n interval: pollingInterval,\n emitOnBegin: true,\n });\n return unpoll;\n });\n timer = timeout\n ? setTimeout(() => {\n unobserve();\n clearTimeout(timer);\n reject(new WaitForCallsStatusTimeoutError({ id }));\n }, timeout)\n : undefined;\n return await promise;\n}\nexport class WaitForCallsStatusTimeoutError extends BaseError {\n constructor({ id }) {\n super(`Timed out while waiting for call bundle with id \"${id}\" to be confirmed.`, { name: 'WaitForCallsStatusTimeoutError' });\n }\n}\n//# sourceMappingURL=waitForCallsStatus.js.map","const size = 256;\nlet index = size;\nlet buffer;\nexport function uid(length = 11) {\n if (!buffer || index + length > size * 2) {\n buffer = '';\n index = 0;\n for (let i = 0; i < size; i++) {\n buffer += ((256 + Math.random() * 256) | 0).toString(16).substring(1);\n }\n }\n return buffer.substring(index, index++ + length);\n}\n//# sourceMappingURL=uid.js.map","import { parseAccount, } from '../accounts/utils/parseAccount.js';\nimport { uid } from '../utils/uid.js';\nexport function createClient(parameters) {\n const { batch, chain, ccipRead, key = 'base', name = 'Base Client', type = 'base', } = parameters;\n const experimental_blockTag = parameters.experimental_blockTag ??\n (typeof chain?.experimental_preconfirmationTime === 'number'\n ? 'pending'\n : undefined);\n const blockTime = chain?.blockTime ?? 12_000;\n const defaultPollingInterval = Math.min(Math.max(Math.floor(blockTime / 2), 500), 4_000);\n const pollingInterval = parameters.pollingInterval ?? defaultPollingInterval;\n const cacheTime = parameters.cacheTime ?? pollingInterval;\n const account = parameters.account\n ? parseAccount(parameters.account)\n : undefined;\n const { config, request, value } = parameters.transport({\n chain,\n pollingInterval,\n });\n const transport = { ...config, ...value };\n const client = {\n account,\n batch,\n cacheTime,\n ccipRead,\n chain,\n key,\n name,\n pollingInterval,\n request,\n transport,\n type,\n uid: uid(),\n ...(experimental_blockTag ? { experimental_blockTag } : {}),\n };\n function extend(base) {\n return (extendFn) => {\n const extended = extendFn(base);\n for (const key in client)\n delete extended[key];\n const combined = { ...base, ...extended };\n return Object.assign(combined, { extend: extend(combined) });\n };\n }\n return Object.assign(client, { extend: extend(client) });\n}\n/**\n * Defines a typed JSON-RPC schema for the client.\n * Note: This is a runtime noop function.\n */\nexport function rpcSchema() {\n return null;\n}\n//# sourceMappingURL=createClient.js.map","import { BaseError } from '../../errors/base.js';\nimport { ContractFunctionRevertedError } from '../../errors/contract.js';\n/*\n * @description Checks if error is a valid null result UniversalResolver error\n */\nexport function isNullUniversalResolverError(err) {\n if (!(err instanceof BaseError))\n return false;\n const cause = err.walk((e) => e instanceof ContractFunctionRevertedError);\n if (!(cause instanceof ContractFunctionRevertedError))\n return false;\n if (cause.data?.errorName === 'HttpError')\n return true;\n if (cause.data?.errorName === 'ResolverError')\n return true;\n if (cause.data?.errorName === 'ResolverNotContract')\n return true;\n if (cause.data?.errorName === 'ResolverNotFound')\n return true;\n if (cause.data?.errorName === 'ReverseAddressMismatch')\n return true;\n if (cause.data?.errorName === 'UnsupportedResolverProfile')\n return true;\n return false;\n}\n//# sourceMappingURL=errors.js.map","import { AbiFunctionSignatureNotFoundError } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeFunctionData(parameters) {\n const { abi, data } = parameters;\n const signature = slice(data, 0, 4);\n const description = abi.find((x) => x.type === 'function' &&\n signature === toFunctionSelector(formatAbiItem(x)));\n if (!description)\n throw new AbiFunctionSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeFunctionData',\n });\n return {\n functionName: description.name,\n args: ('inputs' in description &&\n description.inputs &&\n description.inputs.length > 0\n ? decodeAbiParameters(description.inputs, slice(data, 4))\n : undefined),\n };\n}\n//# sourceMappingURL=decodeFunctionData.js.map","import { AbiErrorInputsNotFoundError, AbiErrorNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeErrorResult';\nexport function encodeErrorResult(parameters) {\n const { abi, errorName, args } = parameters;\n let abiItem = abi[0];\n if (errorName) {\n const item = getAbiItem({ abi, args, name: errorName });\n if (!item)\n throw new AbiErrorNotFoundError(errorName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'error')\n throw new AbiErrorNotFoundError(undefined, { docsPath });\n const definition = formatAbiItem(abiItem);\n const signature = toFunctionSelector(definition);\n let data = '0x';\n if (args && args.length > 0) {\n if (!abiItem.inputs)\n throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath });\n data = encodeAbiParameters(abiItem.inputs, args);\n }\n return concatHex([signature, data]);\n}\n//# sourceMappingURL=encodeErrorResult.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, InvalidArrayError, } from '../../errors/abi.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeFunctionResult';\nexport function encodeFunctionResult(parameters) {\n const { abi, functionName, result } = parameters;\n let abiItem = abi[0];\n if (functionName) {\n const item = getAbiItem({ abi, name: functionName });\n if (!item)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = (() => {\n if (abiItem.outputs.length === 0)\n return [];\n if (abiItem.outputs.length === 1)\n return [result];\n if (Array.isArray(result))\n return result;\n throw new InvalidArrayError(result);\n })();\n return encodeAbiParameters(abiItem.outputs, values);\n}\n//# sourceMappingURL=encodeFunctionResult.js.map","import { batchGatewayAbi } from '../../constants/abis.js';\nimport { solidityError } from '../../constants/solidity.js';\nimport { decodeFunctionData } from '../abi/decodeFunctionData.js';\nimport { encodeErrorResult } from '../abi/encodeErrorResult.js';\nimport { encodeFunctionResult } from '../abi/encodeFunctionResult.js';\nexport const localBatchGatewayUrl = 'x-batch-gateway:true';\nexport async function localBatchGatewayRequest(parameters) {\n const { data, ccipRequest } = parameters;\n const { args: [queries], } = decodeFunctionData({ abi: batchGatewayAbi, data });\n const failures = [];\n const responses = [];\n await Promise.all(queries.map(async (query, i) => {\n try {\n responses[i] = query.urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({ data: query.data, ccipRequest })\n : await ccipRequest(query);\n failures[i] = false;\n }\n catch (err) {\n failures[i] = true;\n responses[i] = encodeError(err);\n }\n }));\n return encodeFunctionResult({\n abi: batchGatewayAbi,\n functionName: 'query',\n result: [failures, responses],\n });\n}\nfunction encodeError(error) {\n if (error.name === 'HttpRequestError' && error.status)\n return encodeErrorResult({\n abi: batchGatewayAbi,\n errorName: 'HttpError',\n args: [error.status, error.shortMessage],\n });\n return encodeErrorResult({\n abi: [solidityError],\n errorName: 'Error',\n args: ['shortMessage' in error ? error.shortMessage : error.message],\n });\n}\n//# sourceMappingURL=localBatchGatewayRequest.js.map","import { isHex } from '../data/isHex.js';\nexport function encodedLabelToLabelhash(label) {\n if (label.length !== 66)\n return null;\n if (label.indexOf('[') !== 0)\n return null;\n if (label.indexOf(']') !== 65)\n return null;\n const hash = `0x${label.slice(1, 65)}`;\n if (!isHex(hash))\n return null;\n return hash;\n}\n//# sourceMappingURL=encodedLabelToLabelhash.js.map","import { concat } from '../data/concat.js';\nimport { stringToBytes, toBytes, } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodedLabelToLabelhash, } from './encodedLabelToLabelhash.js';\n/**\n * @description Hashes ENS name\n *\n * - Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `namehash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.\n *\n * @example\n * namehash('wevm.eth')\n * '0x08c85f2f4059e930c45a6aeff9dcd3bd95dc3c5c1cddef6a0626b31152248560'\n *\n * @link https://eips.ethereum.org/EIPS/eip-137\n */\nexport function namehash(name) {\n let result = new Uint8Array(32).fill(0);\n if (!name)\n return bytesToHex(result);\n const labels = name.split('.');\n // Iterate in reverse order building up hash\n for (let i = labels.length - 1; i >= 0; i -= 1) {\n const hashFromEncodedLabel = encodedLabelToLabelhash(labels[i]);\n const hashed = hashFromEncodedLabel\n ? toBytes(hashFromEncodedLabel)\n : keccak256(stringToBytes(labels[i]), 'bytes');\n result = keccak256(concat([result, hashed]), 'bytes');\n }\n return bytesToHex(result);\n}\n//# sourceMappingURL=namehash.js.map","export function encodeLabelhash(hash) {\n return `[${hash.slice(2)}]`;\n}\n//# sourceMappingURL=encodeLabelhash.js.map","import { stringToBytes, } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodedLabelToLabelhash, } from './encodedLabelToLabelhash.js';\n/**\n * @description Hashes ENS label\n *\n * - Since ENS labels prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS labels](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `labelhash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.\n *\n * @example\n * labelhash('eth')\n * '0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0'\n */\nexport function labelhash(label) {\n const result = new Uint8Array(32).fill(0);\n if (!label)\n return bytesToHex(result);\n return encodedLabelToLabelhash(label) || keccak256(stringToBytes(label));\n}\n//# sourceMappingURL=labelhash.js.map","import { stringToBytes, } from '../encoding/toBytes.js';\nimport { encodeLabelhash, } from './encodeLabelhash.js';\nimport { labelhash } from './labelhash.js';\n/*\n * @description Encodes a DNS packet into a ByteArray containing a UDP payload.\n *\n * @example\n * packetToBytes('awkweb.eth')\n * '0x0661776b7765620365746800'\n *\n * @see https://docs.ens.domains/resolution/names#dns\n *\n */\nexport function packetToBytes(packet) {\n // strip leading and trailing `.`\n const value = packet.replace(/^\\.|\\.$/gm, '');\n if (value.length === 0)\n return new Uint8Array(1);\n const bytes = new Uint8Array(stringToBytes(value).byteLength + 2);\n let offset = 0;\n const list = value.split('.');\n for (let i = 0; i < list.length; i++) {\n let encoded = stringToBytes(list[i]);\n // if the length is > 255, make the encoded label value a labelhash\n // this is compatible with the universal resolver\n if (encoded.byteLength > 255)\n encoded = stringToBytes(encodeLabelhash(labelhash(list[i])));\n bytes[offset] = encoded.length;\n bytes.set(encoded, offset + 1);\n offset += encoded.length + 1;\n }\n if (bytes.byteLength !== offset + 1)\n return bytes.slice(0, offset + 1);\n return bytes;\n}\n//# sourceMappingURL=packetToBytes.js.map","import { BaseError } from './base.js';\nexport class EnsAvatarInvalidMetadataError extends BaseError {\n constructor({ data }) {\n super('Unable to extract image from metadata. The metadata may be malformed or invalid.', {\n metaMessages: [\n '- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.',\n '',\n `Provided data: ${JSON.stringify(data)}`,\n ],\n name: 'EnsAvatarInvalidMetadataError',\n });\n }\n}\nexport class EnsAvatarInvalidNftUriError extends BaseError {\n constructor({ reason }) {\n super(`ENS NFT avatar URI is invalid. ${reason}`, {\n name: 'EnsAvatarInvalidNftUriError',\n });\n }\n}\nexport class EnsAvatarUriResolutionError extends BaseError {\n constructor({ uri }) {\n super(`Unable to resolve ENS avatar URI \"${uri}\". The URI may be malformed, invalid, or does not respond with a valid image.`, { name: 'EnsAvatarUriResolutionError' });\n }\n}\nexport class EnsAvatarUnsupportedNamespaceError extends BaseError {\n constructor({ namespace }) {\n super(`ENS NFT avatar namespace \"${namespace}\" is not supported. Must be \"erc721\" or \"erc1155\".`, { name: 'EnsAvatarUnsupportedNamespaceError' });\n }\n}\nexport class EnsInvalidChainIdError extends BaseError {\n constructor({ chainId }) {\n super(`Invalid ENSIP-11 chainId: ${chainId}. Must be between 0 and 0x7fffffff, or 1.`, {\n name: 'EnsInvalidChainIdError',\n });\n }\n}\n//# sourceMappingURL=ens.js.map","import { readContract, } from '../../../actions/public/readContract.js';\nimport { EnsAvatarInvalidMetadataError, EnsAvatarInvalidNftUriError, EnsAvatarUnsupportedNamespaceError, EnsAvatarUriResolutionError, } from '../../../errors/ens.js';\nconst networkRegex = /(?<protocol>https?:\\/\\/[^/]*|ipfs:\\/|ipns:\\/|ar:\\/)?(?<root>\\/)?(?<subpath>ipfs\\/|ipns\\/)?(?<target>[\\w\\-.]+)(?<subtarget>\\/.*)?/;\nconst ipfsHashRegex = /^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\\/(?<target>[\\w\\-.]+))?(?<subtarget>\\/.*)?$/;\nconst base64Regex = /^data:([a-zA-Z\\-/+]*);base64,([^\"].*)/;\nconst dataURIRegex = /^data:([a-zA-Z\\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;\n/** @internal */\nexport async function isImageUri(uri) {\n try {\n const res = await fetch(uri, { method: 'HEAD' });\n // retrieve content type header to check if content is image\n if (res.status === 200) {\n const contentType = res.headers.get('content-type');\n return contentType?.startsWith('image/');\n }\n return false;\n }\n catch (error) {\n // if error is not cors related then fail\n if (typeof error === 'object' && typeof error.response !== 'undefined') {\n return false;\n }\n // fail in NodeJS, since the error is not cors but any other network issue\n if (!Object.hasOwn(globalThis, 'Image'))\n return false;\n // in case of cors, use image api to validate if given url is an actual image\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n resolve(true);\n };\n img.onerror = () => {\n resolve(false);\n };\n img.src = uri;\n });\n }\n}\n/** @internal */\nexport function getGateway(custom, defaultGateway) {\n if (!custom)\n return defaultGateway;\n if (custom.endsWith('/'))\n return custom.slice(0, -1);\n return custom;\n}\nexport function resolveAvatarUri({ uri, gatewayUrls, }) {\n const isEncoded = base64Regex.test(uri);\n if (isEncoded)\n return { uri, isOnChain: true, isEncoded };\n const ipfsGateway = getGateway(gatewayUrls?.ipfs, 'https://ipfs.io');\n const arweaveGateway = getGateway(gatewayUrls?.arweave, 'https://arweave.net');\n const networkRegexMatch = uri.match(networkRegex);\n const { protocol, subpath, target, subtarget = '', } = networkRegexMatch?.groups || {};\n const isIPNS = protocol === 'ipns:/' || subpath === 'ipns/';\n const isIPFS = protocol === 'ipfs:/' || subpath === 'ipfs/' || ipfsHashRegex.test(uri);\n if (uri.startsWith('http') && !isIPNS && !isIPFS) {\n let replacedUri = uri;\n if (gatewayUrls?.arweave)\n replacedUri = uri.replace(/https:\\/\\/arweave.net/g, gatewayUrls?.arweave);\n return { uri: replacedUri, isOnChain: false, isEncoded: false };\n }\n if ((isIPNS || isIPFS) && target) {\n return {\n uri: `${ipfsGateway}/${isIPNS ? 'ipns' : 'ipfs'}/${target}${subtarget}`,\n isOnChain: false,\n isEncoded: false,\n };\n }\n if (protocol === 'ar:/' && target) {\n return {\n uri: `${arweaveGateway}/${target}${subtarget || ''}`,\n isOnChain: false,\n isEncoded: false,\n };\n }\n let parsedUri = uri.replace(dataURIRegex, '');\n if (parsedUri.startsWith('<svg')) {\n // if svg, base64 encode\n parsedUri = `data:image/svg+xml;base64,${btoa(parsedUri)}`;\n }\n if (parsedUri.startsWith('data:') || parsedUri.startsWith('{')) {\n return {\n uri: parsedUri,\n isOnChain: true,\n isEncoded: false,\n };\n }\n throw new EnsAvatarUriResolutionError({ uri });\n}\nexport function getJsonImage(data) {\n // validation check for json data, must include one of theses properties\n if (typeof data !== 'object' ||\n (!('image' in data) && !('image_url' in data) && !('image_data' in data))) {\n throw new EnsAvatarInvalidMetadataError({ data });\n }\n return data.image || data.image_url || data.image_data;\n}\nexport async function getMetadataAvatarUri({ gatewayUrls, uri, }) {\n try {\n const res = await fetch(uri).then((res) => res.json());\n const image = await parseAvatarUri({\n gatewayUrls,\n uri: getJsonImage(res),\n });\n return image;\n }\n catch {\n throw new EnsAvatarUriResolutionError({ uri });\n }\n}\nexport async function parseAvatarUri({ gatewayUrls, uri, }) {\n const { uri: resolvedURI, isOnChain } = resolveAvatarUri({ uri, gatewayUrls });\n if (isOnChain)\n return resolvedURI;\n // check if resolvedURI is an image, if it is return the url\n const isImage = await isImageUri(resolvedURI);\n if (isImage)\n return resolvedURI;\n throw new EnsAvatarUriResolutionError({ uri });\n}\nexport function parseNftUri(uri_) {\n let uri = uri_;\n // parse valid nft spec (CAIP-22/CAIP-29)\n // @see: https://github.com/ChainAgnostic/CAIPs/tree/master/CAIPs\n if (uri.startsWith('did:nft:')) {\n // convert DID to CAIP\n uri = uri.replace('did:nft:', '').replace(/_/g, '/');\n }\n const [reference, asset_namespace, tokenID] = uri.split('/');\n const [eip_namespace, chainID] = reference.split(':');\n const [erc_namespace, contractAddress] = asset_namespace.split(':');\n if (!eip_namespace || eip_namespace.toLowerCase() !== 'eip155')\n throw new EnsAvatarInvalidNftUriError({ reason: 'Only EIP-155 supported' });\n if (!chainID)\n throw new EnsAvatarInvalidNftUriError({ reason: 'Chain ID not found' });\n if (!contractAddress)\n throw new EnsAvatarInvalidNftUriError({\n reason: 'Contract address not found',\n });\n if (!tokenID)\n throw new EnsAvatarInvalidNftUriError({ reason: 'Token ID not found' });\n if (!erc_namespace)\n throw new EnsAvatarInvalidNftUriError({ reason: 'ERC namespace not found' });\n return {\n chainID: Number.parseInt(chainID, 10),\n namespace: erc_namespace.toLowerCase(),\n contractAddress: contractAddress,\n tokenID,\n };\n}\nexport async function getNftTokenUri(client, { nft }) {\n if (nft.namespace === 'erc721') {\n return readContract(client, {\n address: nft.contractAddress,\n abi: [\n {\n name: 'tokenURI',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: 'tokenId', type: 'uint256' }],\n outputs: [{ name: '', type: 'string' }],\n },\n ],\n functionName: 'tokenURI',\n args: [BigInt(nft.tokenID)],\n });\n }\n if (nft.namespace === 'erc1155') {\n return readContract(client, {\n address: nft.contractAddress,\n abi: [\n {\n name: 'uri',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: '_id', type: 'uint256' }],\n outputs: [{ name: '', type: 'string' }],\n },\n ],\n functionName: 'uri',\n args: [BigInt(nft.tokenID)],\n });\n }\n throw new EnsAvatarUnsupportedNamespaceError({ namespace: nft.namespace });\n}\n//# sourceMappingURL=utils.js.map","import { getJsonImage, getMetadataAvatarUri, getNftTokenUri, parseAvatarUri, parseNftUri, resolveAvatarUri, } from './utils.js';\n/*\n * @description Parses an ENS avatar record.\n *\n * @example\n * parseAvatarRecord('eip155:1/erc1155:0xb32979486938aa9694bfc898f35dbed459f44424/10063')\n * 'https://ipfs.io/ipfs/QmSP4nq9fnN9dAiCj42ug9Wa79rqmQerZXZch82VqpiH7U/image.gif'\n *\n * @see https://docs.ens.domains/web/avatars\n *\n */\nexport async function parseAvatarRecord(client, { gatewayUrls, record, }) {\n if (/eip155:/i.test(record))\n return parseNftAvatarUri(client, { gatewayUrls, record });\n return parseAvatarUri({ uri: record, gatewayUrls });\n}\nasync function parseNftAvatarUri(client, { gatewayUrls, record, }) {\n // parse NFT URI into properties\n const nft = parseNftUri(record);\n // fetch tokenURI from the NFT contract\n const nftUri = await getNftTokenUri(client, { nft });\n // resolve the URI from the fetched tokenURI\n const { uri: resolvedNftUri, isOnChain, isEncoded, } = resolveAvatarUri({ uri: nftUri, gatewayUrls });\n // if the resolved URI is on chain, return the data\n if (isOnChain &&\n (resolvedNftUri.includes('data:application/json;base64,') ||\n resolvedNftUri.startsWith('{'))) {\n const encodedJson = isEncoded\n ? // if it is encoded, decode it\n atob(resolvedNftUri.replace('data:application/json;base64,', ''))\n : // if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is)\n resolvedNftUri;\n const decoded = JSON.parse(encodedJson);\n return parseAvatarUri({ uri: getJsonImage(decoded), gatewayUrls });\n }\n let uriTokenId = nft.tokenID;\n if (nft.namespace === 'erc1155')\n uriTokenId = uriTokenId.replace('0x', '').padStart(64, '0');\n return getMetadataAvatarUri({\n gatewayUrls,\n uri: resolvedNftUri.replace(/(?:0x)?{id}/, uriTokenId),\n });\n}\n//# sourceMappingURL=parseAvatarRecord.js.map","import { textResolverAbi, universalResolverResolveAbi, } from '../../constants/abis.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { localBatchGatewayUrl } from '../../utils/ens/localBatchGatewayRequest.js';\nimport { namehash } from '../../utils/ens/namehash.js';\nimport { packetToBytes, } from '../../utils/ens/packetToBytes.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets a text record for specified ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens\n *\n * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsTextParameters}\n * @returns Address for ENS resolver. {@link GetEnsTextReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsText, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const twitterRecord = await getEnsText(client, {\n * name: normalize('wevm.eth'),\n * key: 'com.twitter',\n * })\n * // 'wevm_dev'\n */\nexport async function getEnsText(client, parameters) {\n const { blockNumber, blockTag, key, name, gatewayUrls, strict } = parameters;\n const { chain } = client;\n const universalResolverAddress = (() => {\n if (parameters.universalResolverAddress)\n return parameters.universalResolverAddress;\n if (!chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n return getChainContractAddress({\n blockNumber,\n chain,\n contract: 'ensUniversalResolver',\n });\n })();\n const tlds = chain?.ensTlds;\n if (tlds && !tlds.some((tld) => name.endsWith(tld)))\n return null;\n try {\n const readContractParameters = {\n address: universalResolverAddress,\n abi: universalResolverResolveAbi,\n args: [\n toHex(packetToBytes(name)),\n encodeFunctionData({\n abi: textResolverAbi,\n functionName: 'text',\n args: [namehash(name), key],\n }),\n gatewayUrls ?? [localBatchGatewayUrl],\n ],\n functionName: 'resolveWithGateways',\n blockNumber,\n blockTag,\n };\n const readContractAction = getAction(client, readContract, 'readContract');\n const res = await readContractAction(readContractParameters);\n if (res[0] === '0x')\n return null;\n const record = decodeFunctionResult({\n abi: textResolverAbi,\n functionName: 'text',\n data: res[0],\n });\n return record === '' ? null : record;\n }\n catch (err) {\n if (strict)\n throw err;\n if (isNullUniversalResolverError(err))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsText.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getCallError, } from '../../utils/errors/getCallError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { assertRequest } from '../../utils/transaction/assertRequest.js';\n/**\n * Creates an EIP-2930 access list.\n *\n * - Docs: https://viem.sh/docs/actions/public/createAccessList\n * - JSON-RPC Methods: `eth_createAccessList`\n *\n * @param client - Client to use\n * @param parameters - {@link CreateAccessListParameters}\n * @returns The access list. {@link CreateAccessListReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createAccessList } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const data = await createAccessList(client, {\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * })\n */\nexport async function createAccessList(client, args) {\n const { account: account_ = client.account, blockNumber, blockTag = 'latest', blobs, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, to, value, ...rest } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n try {\n assertRequest(args);\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const chainFormat = client.chain?.formatters?.transactionRequest?.format;\n const format = chainFormat || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format: chainFormat }),\n from: account?.address,\n blobs,\n data,\n gas,\n gasPrice,\n maxFeePerBlobGas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n to,\n value,\n }, 'createAccessList');\n const response = await client.request({\n method: 'eth_createAccessList',\n params: [request, block],\n });\n return {\n accessList: response.accessList,\n gasUsed: BigInt(response.gasUsed),\n };\n }\n catch (err) {\n throw getCallError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n//# sourceMappingURL=createAccessList.js.map","import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).\n *\n * - Docs: https://viem.sh/docs/actions/public/createEventFilter\n * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)\n *\n * @param client - Client to use\n * @param parameters - {@link CreateEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',\n * })\n */\nexport async function createEventFilter(client, { address, args, event, events: events_, fromBlock, strict, toBlock, } = {}) {\n const events = events_ ?? (event ? [event] : undefined);\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n let topics = [];\n if (events) {\n const encoded = events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n }));\n // TODO: Clean up type casting\n topics = [encoded];\n if (event)\n topics = topics[0];\n }\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n ...(topics.length ? { topics } : {}),\n },\n ],\n });\n return {\n abi: events,\n args,\n eventName: event ? event.name : undefined,\n fromBlock,\n id,\n request: getRequest(id),\n strict: Boolean(strict),\n toBlock,\n type: 'event',\n };\n}\n//# sourceMappingURL=createEventFilter.js.map","import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).\n *\n * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter\n * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'transaction' }\n */\nexport async function createPendingTransactionFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newPendingTransactionFilter',\n });\n const id = await client.request({\n method: 'eth_newPendingTransactionFilter',\n });\n return { id, request: getRequest(id), type: 'transaction' };\n}\n//# sourceMappingURL=createPendingTransactionFilter.js.map","import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Retrieves the bytecode at an address.\n *\n * - Docs: https://viem.sh/docs/contract/getCode\n * - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)\n *\n * @param client - Client to use\n * @param parameters - {@link GetCodeParameters}\n * @returns The contract's bytecode. {@link GetCodeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getCode } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getCode(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * })\n */\nexport async function getCode(client, { address, blockNumber, blockTag = 'latest' }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const hex = await client.request({\n method: 'eth_getCode',\n params: [address, blockNumberHex || blockTag],\n }, { dedupe: Boolean(blockNumberHex) });\n if (hex === '0x')\n return undefined;\n return hex;\n}\n//# sourceMappingURL=getCode.js.map","import { BaseError } from './base.js';\nexport class Eip712DomainNotFoundError extends BaseError {\n constructor({ address }) {\n super(`No EIP-712 domain found on contract \"${address}\".`, {\n metaMessages: [\n 'Ensure that:',\n `- The contract is deployed at the address \"${address}\".`,\n '- `eip712Domain()` function exists on the contract.',\n '- `eip712Domain()` function matches signature to ERC-5267 specification.',\n ],\n name: 'Eip712DomainNotFoundError',\n });\n }\n}\n//# sourceMappingURL=eip712.js.map","import { Eip712DomainNotFoundError, } from '../../errors/eip712.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract, } from './readContract.js';\n/**\n * Reads the EIP-712 domain from a contract, based on the ERC-5267 specification.\n *\n * @param client - A {@link Client} instance.\n * @param parameters - The parameters of the action. {@link GetEip712DomainParameters}\n * @returns The EIP-712 domain, fields, and extensions. {@link GetEip712DomainReturnType}\n *\n * @example\n * ```ts\n * import { createPublicClient, http, getEip712Domain } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const domain = await getEip712Domain(client, {\n * address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n * })\n * // {\n * // domain: {\n * // name: 'ExampleContract',\n * // version: '1',\n * // chainId: 1,\n * // verifyingContract: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\n * // },\n * // fields: '0x0f',\n * // extensions: [],\n * // }\n * ```\n */\nexport async function getEip712Domain(client, parameters) {\n const { address, factory, factoryData } = parameters;\n try {\n const [fields, name, version, chainId, verifyingContract, salt, extensions,] = await getAction(client, readContract, 'readContract')({\n abi,\n address,\n functionName: 'eip712Domain',\n factory,\n factoryData,\n });\n return {\n domain: {\n name,\n version,\n chainId: Number(chainId),\n verifyingContract,\n salt,\n },\n extensions,\n fields,\n };\n }\n catch (e) {\n const error = e;\n if (error.name === 'ContractFunctionExecutionError' &&\n error.cause.name === 'ContractFunctionZeroDataError') {\n throw new Eip712DomainNotFoundError({ address });\n }\n throw error;\n }\n}\nconst abi = [\n {\n inputs: [],\n name: 'eip712Domain',\n outputs: [\n { name: 'fields', type: 'bytes1' },\n { name: 'name', type: 'string' },\n { name: 'version', type: 'string' },\n { name: 'chainId', type: 'uint256' },\n { name: 'verifyingContract', type: 'address' },\n { name: 'salt', type: 'bytes32' },\n { name: 'extensions', type: 'uint256[]' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\n//# sourceMappingURL=getEip712Domain.js.map","import { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatFeeHistory, } from '../../utils/formatters/feeHistory.js';\n/**\n * Returns a collection of historical gas information.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFeeHistory\n * - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)\n *\n * @param client - Client to use\n * @param parameters - {@link GetFeeHistoryParameters}\n * @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getFeeHistory } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const feeHistory = await getFeeHistory(client, {\n * blockCount: 4,\n * rewardPercentiles: [25, 75],\n * })\n */\nexport async function getFeeHistory(client, { blockCount, blockNumber, blockTag = 'latest', rewardPercentiles, }) {\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const feeHistory = await client.request({\n method: 'eth_feeHistory',\n params: [\n numberToHex(blockCount),\n blockNumberHex || blockTag,\n rewardPercentiles,\n ],\n }, { dedupe: Boolean(blockNumberHex) });\n return formatFeeHistory(feeHistory);\n}\n//# sourceMappingURL=getFeeHistory.js.map","export function formatFeeHistory(feeHistory) {\n return {\n baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),\n gasUsedRatio: feeHistory.gasUsedRatio,\n oldestBlock: BigInt(feeHistory.oldestBlock),\n reward: feeHistory.reward?.map((reward) => reward.map((value) => BigInt(value))),\n };\n}\n//# sourceMappingURL=feeHistory.js.map","import { AbiEncodingLengthMismatchError, BytesSizeMismatchError, UnsupportedPackedAbiType, } from '../../errors/abi.js';\nimport { InvalidAddressError, } from '../../errors/address.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { concatHex } from '../data/concat.js';\nimport { pad } from '../data/pad.js';\nimport { boolToHex, numberToHex, stringToHex, } from '../encoding/toHex.js';\nimport { arrayRegex, bytesRegex, integerRegex } from '../regex.js';\nexport function encodePacked(types, values) {\n if (types.length !== values.length)\n throw new AbiEncodingLengthMismatchError({\n expectedLength: types.length,\n givenLength: values.length,\n });\n const data = [];\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n const value = values[i];\n data.push(encode(type, value));\n }\n return concatHex(data);\n}\nfunction encode(type, value, isArray = false) {\n if (type === 'address') {\n const address = value;\n if (!isAddress(address))\n throw new InvalidAddressError({ address });\n return pad(address.toLowerCase(), {\n size: isArray ? 32 : null,\n });\n }\n if (type === 'string')\n return stringToHex(value);\n if (type === 'bytes')\n return value;\n if (type === 'bool')\n return pad(boolToHex(value), { size: isArray ? 32 : 1 });\n const intMatch = type.match(integerRegex);\n if (intMatch) {\n const [_type, baseType, bits = '256'] = intMatch;\n const size = Number.parseInt(bits, 10) / 8;\n return numberToHex(value, {\n size: isArray ? 32 : size,\n signed: baseType === 'int',\n });\n }\n const bytesMatch = type.match(bytesRegex);\n if (bytesMatch) {\n const [_type, size] = bytesMatch;\n if (Number.parseInt(size, 10) !== (value.length - 2) / 2)\n throw new BytesSizeMismatchError({\n expectedSize: Number.parseInt(size, 10),\n givenSize: (value.length - 2) / 2,\n });\n return pad(value, { dir: 'right', size: isArray ? 32 : null });\n }\n const arrayMatch = type.match(arrayRegex);\n if (arrayMatch && Array.isArray(value)) {\n const [_type, childType] = arrayMatch;\n const data = [];\n for (let i = 0; i < value.length; i++) {\n data.push(encode(childType, value[i], true));\n }\n if (data.length === 0)\n return '0x';\n return concatHex(data);\n }\n throw new UnsupportedPackedAbiType(type);\n}\n//# sourceMappingURL=encodePacked.js.map","import { versionedHashVersionKzg } from '../../constants/kzg.js';\nimport { maxUint256 } from '../../constants/number.js';\nimport { InvalidAddressError, } from '../../errors/address.js';\nimport { BaseError } from '../../errors/base.js';\nimport { EmptyBlobError, InvalidVersionedHashSizeError, InvalidVersionedHashVersionError, } from '../../errors/blob.js';\nimport { InvalidChainIdError, } from '../../errors/chain.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError, } from '../../errors/node.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { hexToNumber } from '../encoding/fromHex.js';\nexport function assertTransactionEIP7702(transaction) {\n const { authorizationList } = transaction;\n if (authorizationList) {\n for (const authorization of authorizationList) {\n const { chainId } = authorization;\n const address = authorization.address;\n if (!isAddress(address))\n throw new InvalidAddressError({ address });\n if (chainId < 0)\n throw new InvalidChainIdError({ chainId });\n }\n }\n assertTransactionEIP1559(transaction);\n}\nexport function assertTransactionEIP4844(transaction) {\n const { blobVersionedHashes } = transaction;\n if (blobVersionedHashes) {\n if (blobVersionedHashes.length === 0)\n throw new EmptyBlobError();\n for (const hash of blobVersionedHashes) {\n const size_ = size(hash);\n const version = hexToNumber(slice(hash, 0, 1));\n if (size_ !== 32)\n throw new InvalidVersionedHashSizeError({ hash, size: size_ });\n if (version !== versionedHashVersionKzg)\n throw new InvalidVersionedHashVersionError({\n hash,\n version,\n });\n }\n }\n assertTransactionEIP1559(transaction);\n}\nexport function assertTransactionEIP1559(transaction) {\n const { chainId, maxPriorityFeePerGas, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxFeePerGas && maxFeePerGas > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\nexport function assertTransactionEIP2930(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.');\n if (gasPrice && gasPrice > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\nexport function assertTransactionLegacy(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof chainId !== 'undefined' && chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.');\n if (gasPrice && gasPrice > maxUint256)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\n//# sourceMappingURL=assertTransaction.js.map","import { InvalidAddressError, } from '../../errors/address.js';\nimport { InvalidStorageKeySizeError, } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\n/*\n * Serialize an EIP-2930 access list\n * @remarks\n * Use to create a transaction serializer with support for EIP-2930 access lists\n *\n * @param accessList - Array of objects of address and arrays of Storage Keys\n * @throws InvalidAddressError, InvalidStorageKeySizeError\n * @returns Array of hex strings\n */\nexport function serializeAccessList(accessList) {\n if (!accessList || accessList.length === 0)\n return [];\n const serializedAccessList = [];\n for (let i = 0; i < accessList.length; i++) {\n const { address, storageKeys } = accessList[i];\n for (let j = 0; j < storageKeys.length; j++) {\n if (storageKeys[j].length - 2 !== 64) {\n throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });\n }\n }\n if (!isAddress(address, { strict: false })) {\n throw new InvalidAddressError({ address });\n }\n serializedAccessList.push([address, storageKeys]);\n }\n return serializedAccessList;\n}\n//# sourceMappingURL=serializeAccessList.js.map","import { InvalidLegacyVError, } from '../../errors/transaction.js';\nimport { serializeAuthorizationList, } from '../authorization/serializeAuthorizationList.js';\nimport { blobsToCommitments, } from '../blob/blobsToCommitments.js';\nimport { blobsToProofs, } from '../blob/blobsToProofs.js';\nimport { commitmentsToVersionedHashes, } from '../blob/commitmentsToVersionedHashes.js';\nimport { toBlobSidecars, } from '../blob/toBlobSidecars.js';\nimport { concatHex } from '../data/concat.js';\nimport { trim } from '../data/trim.js';\nimport { bytesToHex, numberToHex, } from '../encoding/toHex.js';\nimport { toRlp } from '../encoding/toRlp.js';\nimport { assertTransactionEIP1559, assertTransactionEIP2930, assertTransactionEIP4844, assertTransactionEIP7702, assertTransactionLegacy, } from './assertTransaction.js';\nimport { getTransactionType, } from './getTransactionType.js';\nimport { serializeAccessList, } from './serializeAccessList.js';\nexport function serializeTransaction(transaction, signature) {\n const type = getTransactionType(transaction);\n if (type === 'eip1559')\n return serializeTransactionEIP1559(transaction, signature);\n if (type === 'eip2930')\n return serializeTransactionEIP2930(transaction, signature);\n if (type === 'eip4844')\n return serializeTransactionEIP4844(transaction, signature);\n if (type === 'eip7702')\n return serializeTransactionEIP7702(transaction, signature);\n return serializeTransactionLegacy(transaction, signature);\n}\nfunction serializeTransactionEIP7702(transaction, signature) {\n const { authorizationList, chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP7702(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedAuthorizationList = serializeAuthorizationList(authorizationList);\n return concatHex([\n '0x04',\n toRlp([\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n serializedAuthorizationList,\n ...toYParitySignatureArray(transaction, signature),\n ]),\n ]);\n}\nfunction serializeTransactionEIP4844(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP4844(transaction);\n let blobVersionedHashes = transaction.blobVersionedHashes;\n let sidecars = transaction.sidecars;\n // If `blobs` are passed, we will need to compute the KZG commitments & proofs.\n if (transaction.blobs &&\n (typeof blobVersionedHashes === 'undefined' ||\n typeof sidecars === 'undefined')) {\n const blobs = (typeof transaction.blobs[0] === 'string'\n ? transaction.blobs\n : transaction.blobs.map((x) => bytesToHex(x)));\n const kzg = transaction.kzg;\n const commitments = blobsToCommitments({\n blobs,\n kzg,\n });\n if (typeof blobVersionedHashes === 'undefined')\n blobVersionedHashes = commitmentsToVersionedHashes({\n commitments,\n });\n if (typeof sidecars === 'undefined') {\n const proofs = blobsToProofs({ blobs, commitments, kzg });\n sidecars = toBlobSidecars({ blobs, commitments, proofs });\n }\n }\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n maxFeePerBlobGas ? numberToHex(maxFeePerBlobGas) : '0x',\n blobVersionedHashes ?? [],\n ...toYParitySignatureArray(transaction, signature),\n ];\n const blobs = [];\n const commitments = [];\n const proofs = [];\n if (sidecars)\n for (let i = 0; i < sidecars.length; i++) {\n const { blob, commitment, proof } = sidecars[i];\n blobs.push(blob);\n commitments.push(commitment);\n proofs.push(proof);\n }\n return concatHex([\n '0x03',\n sidecars\n ? // If sidecars are enabled, envelope turns into a \"wrapper\":\n toRlp([serializedTransaction, blobs, commitments, proofs])\n : // If sidecars are disabled, standard envelope is used:\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP1559(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP1559(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? numberToHex(maxFeePerGas) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ...toYParitySignatureArray(transaction, signature),\n ];\n return concatHex([\n '0x02',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP2930(transaction, signature) {\n const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;\n assertTransactionEIP2930(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n numberToHex(chainId),\n nonce ? numberToHex(nonce) : '0x',\n gasPrice ? numberToHex(gasPrice) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ...toYParitySignatureArray(transaction, signature),\n ];\n return concatHex([\n '0x01',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionLegacy(transaction, signature) {\n const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;\n assertTransactionLegacy(transaction);\n let serializedTransaction = [\n nonce ? numberToHex(nonce) : '0x',\n gasPrice ? numberToHex(gasPrice) : '0x',\n gas ? numberToHex(gas) : '0x',\n to ?? '0x',\n value ? numberToHex(value) : '0x',\n data ?? '0x',\n ];\n if (signature) {\n const v = (() => {\n // EIP-155 (inferred chainId)\n if (signature.v >= 35n) {\n const inferredChainId = (signature.v - 35n) / 2n;\n if (inferredChainId > 0)\n return signature.v;\n return 27n + (signature.v === 35n ? 0n : 1n);\n }\n // EIP-155 (explicit chainId)\n if (chainId > 0)\n return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);\n // Pre-EIP-155 (no chainId)\n const v = 27n + (signature.v === 27n ? 0n : 1n);\n if (signature.v !== v)\n throw new InvalidLegacyVError({ v: signature.v });\n return v;\n })();\n const r = trim(signature.r);\n const s = trim(signature.s);\n serializedTransaction = [\n ...serializedTransaction,\n numberToHex(v),\n r === '0x00' ? '0x' : r,\n s === '0x00' ? '0x' : s,\n ];\n }\n else if (chainId > 0) {\n serializedTransaction = [\n ...serializedTransaction,\n numberToHex(chainId),\n '0x',\n '0x',\n ];\n }\n return toRlp(serializedTransaction);\n}\nexport function toYParitySignatureArray(transaction, signature_) {\n const signature = signature_ ?? transaction;\n const { v, yParity } = signature;\n if (typeof signature.r === 'undefined')\n return [];\n if (typeof signature.s === 'undefined')\n return [];\n if (typeof v === 'undefined' && typeof yParity === 'undefined')\n return [];\n const r = trim(signature.r);\n const s = trim(signature.s);\n const yParity_ = (() => {\n if (typeof yParity === 'number')\n return yParity ? numberToHex(1) : '0x';\n if (v === 0n)\n return '0x';\n if (v === 1n)\n return numberToHex(1);\n return v === 27n ? '0x' : numberToHex(1);\n })();\n return [yParity_, r === '0x00' ? '0x' : r, s === '0x00' ? '0x' : s];\n}\n//# sourceMappingURL=serializeTransaction.js.map","// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md#parameters\nexport const versionedHashVersionKzg = 1;\n//# sourceMappingURL=kzg.js.map","import { toHex } from '../encoding/toHex.js';\nimport { toYParitySignatureArray } from '../transaction/serializeTransaction.js';\n/*\n * Serializes an EIP-7702 authorization list.\n */\nexport function serializeAuthorizationList(authorizationList) {\n if (!authorizationList || authorizationList.length === 0)\n return [];\n const serializedAuthorizationList = [];\n for (const authorization of authorizationList) {\n const { chainId, nonce, ...signature } = authorization;\n const contractAddress = authorization.address;\n serializedAuthorizationList.push([\n chainId ? toHex(chainId) : '0x',\n contractAddress,\n nonce ? toHex(nonce) : '0x',\n ...toYParitySignatureArray({}, signature),\n ]);\n }\n return serializedAuthorizationList;\n}\n//# sourceMappingURL=serializeAuthorizationList.js.map","import { LruMap } from '../lru.js';\n/** @internal */\nexport const promiseCache = /*#__PURE__*/ new LruMap(8192);\n/** Deduplicates in-flight promises. */\nexport function withDedupe(fn, { enabled = true, id }) {\n if (!enabled || !id)\n return fn();\n if (promiseCache.get(id))\n return promiseCache.get(id);\n const promise = fn().finally(() => promiseCache.delete(id));\n promiseCache.set(id, promise);\n return promise;\n}\n//# sourceMappingURL=withDedupe.js.map","import { BaseError } from '../errors/base.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { AtomicityNotSupportedError, AtomicReadyWalletRejectedUpgradeError, BundleTooLargeError, ChainDisconnectedError, DuplicateIdError, InternalRpcError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, ParseRpcError, ProviderDisconnectedError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, SwitchChainError, TransactionRejectedRpcError, UnauthorizedProviderError, UnknownBundleIdError, UnknownRpcError, UnsupportedChainIdError, UnsupportedNonOptionalCapabilityError, UnsupportedProviderMethodError, UserRejectedRequestError, } from '../errors/rpc.js';\nimport { stringToHex } from './encoding/toHex.js';\nimport { withDedupe } from './promise/withDedupe.js';\nimport { withRetry } from './promise/withRetry.js';\nimport { stringify } from './stringify.js';\nexport function buildRequest(request, options = {}) {\n return async (args, overrideOptions = {}) => {\n const { dedupe = false, methods, retryDelay = 150, retryCount = 3, uid, } = {\n ...options,\n ...overrideOptions,\n };\n const { method } = args;\n if (methods?.exclude?.includes(method))\n throw new MethodNotSupportedRpcError(new Error('method not supported'), {\n method,\n });\n if (methods?.include && !methods.include.includes(method))\n throw new MethodNotSupportedRpcError(new Error('method not supported'), {\n method,\n });\n const requestId = dedupe\n ? stringToHex(`${uid}.${stringify(args)}`)\n : undefined;\n return withDedupe(() => withRetry(async () => {\n try {\n return await request(args);\n }\n catch (err_) {\n const err = err_;\n switch (err.code) {\n // -32700\n case ParseRpcError.code:\n throw new ParseRpcError(err);\n // -32600\n case InvalidRequestRpcError.code:\n throw new InvalidRequestRpcError(err);\n // -32601\n case MethodNotFoundRpcError.code:\n throw new MethodNotFoundRpcError(err, { method: args.method });\n // -32602\n case InvalidParamsRpcError.code:\n throw new InvalidParamsRpcError(err);\n // -32603\n case InternalRpcError.code:\n throw new InternalRpcError(err);\n // -32000\n case InvalidInputRpcError.code:\n throw new InvalidInputRpcError(err);\n // -32001\n case ResourceNotFoundRpcError.code:\n throw new ResourceNotFoundRpcError(err);\n // -32002\n case ResourceUnavailableRpcError.code:\n throw new ResourceUnavailableRpcError(err);\n // -32003\n case TransactionRejectedRpcError.code:\n throw new TransactionRejectedRpcError(err);\n // -32004\n case MethodNotSupportedRpcError.code:\n throw new MethodNotSupportedRpcError(err, {\n method: args.method,\n });\n // -32005\n case LimitExceededRpcError.code:\n throw new LimitExceededRpcError(err);\n // -32006\n case JsonRpcVersionUnsupportedError.code:\n throw new JsonRpcVersionUnsupportedError(err);\n // 4001\n case UserRejectedRequestError.code:\n throw new UserRejectedRequestError(err);\n // 4100\n case UnauthorizedProviderError.code:\n throw new UnauthorizedProviderError(err);\n // 4200\n case UnsupportedProviderMethodError.code:\n throw new UnsupportedProviderMethodError(err);\n // 4900\n case ProviderDisconnectedError.code:\n throw new ProviderDisconnectedError(err);\n // 4901\n case ChainDisconnectedError.code:\n throw new ChainDisconnectedError(err);\n // 4902\n case SwitchChainError.code:\n throw new SwitchChainError(err);\n // 5700\n case UnsupportedNonOptionalCapabilityError.code:\n throw new UnsupportedNonOptionalCapabilityError(err);\n // 5710\n case UnsupportedChainIdError.code:\n throw new UnsupportedChainIdError(err);\n // 5720\n case DuplicateIdError.code:\n throw new DuplicateIdError(err);\n // 5730\n case UnknownBundleIdError.code:\n throw new UnknownBundleIdError(err);\n // 5740\n case BundleTooLargeError.code:\n throw new BundleTooLargeError(err);\n // 5750\n case AtomicReadyWalletRejectedUpgradeError.code:\n throw new AtomicReadyWalletRejectedUpgradeError(err);\n // 5760\n case AtomicityNotSupportedError.code:\n throw new AtomicityNotSupportedError(err);\n // CAIP-25: User Rejected Error\n // https://docs.walletconnect.com/2.0/specs/clients/sign/error-codes#rejected-caip-25\n case 5000:\n throw new UserRejectedRequestError(err);\n default:\n if (err_ instanceof BaseError)\n throw err_;\n throw new UnknownRpcError(err);\n }\n }\n }, {\n delay: ({ count, error }) => {\n // If we find a Retry-After header, let's retry after the given time.\n if (error && error instanceof HttpRequestError) {\n const retryAfter = error?.headers?.get('Retry-After');\n if (retryAfter?.match(/\\d/))\n return Number.parseInt(retryAfter, 10) * 1000;\n }\n // Otherwise, let's retry with an exponential backoff.\n return ~~(1 << count) * retryDelay;\n },\n retryCount,\n shouldRetry: ({ error }) => shouldRetry(error),\n }), { enabled: dedupe, id: requestId });\n };\n}\n/** @internal */\nexport function shouldRetry(error) {\n if ('code' in error && typeof error.code === 'number') {\n if (error.code === -1)\n return true; // Unknown error\n if (error.code === LimitExceededRpcError.code)\n return true;\n if (error.code === InternalRpcError.code)\n return true;\n return false;\n }\n if (error instanceof HttpRequestError && error.status) {\n // Forbidden\n if (error.status === 403)\n return true;\n // Request Timeout\n if (error.status === 408)\n return true;\n // Request Entity Too Large\n if (error.status === 413)\n return true;\n // Too Many Requests\n if (error.status === 429)\n return true;\n // Internal Server Error\n if (error.status === 500)\n return true;\n // Bad Gateway\n if (error.status === 502)\n return true;\n // Service Unavailable\n if (error.status === 503)\n return true;\n // Gateway Timeout\n if (error.status === 504)\n return true;\n return false;\n }\n return true;\n}\n//# sourceMappingURL=buildRequest.js.map","import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n name: 'OffchainLookupError',\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n name: 'OffchainLookupResponseMalformedError',\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n name: 'OffchainLookupSenderMismatchError',\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { localBatchGatewayRequest, localBatchGatewayUrl, } from './ens/localBatchGatewayRequest.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({\n data: callData,\n ccipRequest: ccipRequest_,\n })\n : await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n const headers = method === 'POST' ? { 'Content-Type': 'application/json' } : {};\n try {\n const response = await fetch(url.replace('{sender}', sender.toLowerCase()).replace('{data}', data), {\n body: JSON.stringify(body),\n headers,\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map","export function defineChain(chain) {\n return {\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n };\n}\n//# sourceMappingURL=defineChain.js.map","import { getTransactionCount } from '../actions/public/getTransactionCount.js';\nimport { LruMap } from './lru.js';\n/**\n * Creates a nonce manager for auto-incrementing transaction nonces.\n *\n * - Docs: https://viem.sh/docs/accounts/createNonceManager\n *\n * @example\n * ```ts\n * const nonceManager = createNonceManager({\n * source: jsonRpc(),\n * })\n * ```\n */\nexport function createNonceManager(parameters) {\n const { source } = parameters;\n const deltaMap = new Map();\n const nonceMap = new LruMap(8192);\n const promiseMap = new Map();\n const getKey = ({ address, chainId }) => `${address}.${chainId}`;\n return {\n async consume({ address, chainId, client }) {\n const key = getKey({ address, chainId });\n const promise = this.get({ address, chainId, client });\n this.increment({ address, chainId });\n const nonce = await promise;\n await source.set({ address, chainId }, nonce);\n nonceMap.set(key, nonce);\n return nonce;\n },\n async increment({ address, chainId }) {\n const key = getKey({ address, chainId });\n const delta = deltaMap.get(key) ?? 0;\n deltaMap.set(key, delta + 1);\n },\n async get({ address, chainId, client }) {\n const key = getKey({ address, chainId });\n let promise = promiseMap.get(key);\n if (!promise) {\n promise = (async () => {\n try {\n const nonce = await source.get({ address, chainId, client });\n const previousNonce = nonceMap.get(key) ?? 0;\n if (previousNonce > 0 && nonce <= previousNonce)\n return previousNonce + 1;\n nonceMap.delete(key);\n return nonce;\n }\n finally {\n this.reset({ address, chainId });\n }\n })();\n promiseMap.set(key, promise);\n }\n const delta = deltaMap.get(key) ?? 0;\n return delta + (await promise);\n },\n reset({ address, chainId }) {\n const key = getKey({ address, chainId });\n deltaMap.delete(key);\n promiseMap.delete(key);\n },\n };\n}\n/** JSON-RPC source for a nonce manager. */\nexport function jsonRpc() {\n return {\n async get(parameters) {\n const { address, client } = parameters;\n return getTransactionCount(client, {\n address,\n blockTag: 'pending',\n });\n },\n set() { },\n };\n}\n////////////////////////////////////////////////////////////////////////////////////////////\n// Default\n/** Default Nonce Manager with a JSON-RPC source. */\nexport const nonceManager = /*#__PURE__*/ createNonceManager({\n source: jsonRpc(),\n});\n//# sourceMappingURL=nonceManager.js.map","function createIdStore() {\n return {\n current: 0,\n take() {\n return this.current++;\n },\n reset() {\n this.current = 0;\n },\n };\n}\nexport const idCache = /*#__PURE__*/ createIdStore();\n//# sourceMappingURL=id.js.map","import { HttpRequestError, TimeoutError, } from '../../errors/request.js';\nimport { withTimeout, } from '../promise/withTimeout.js';\nimport { stringify } from '../stringify.js';\nimport { idCache } from './id.js';\nexport function getHttpRpcClient(url, options = {}) {\n return {\n async request(params) {\n const { body, fetchFn = options.fetchFn ?? fetch, onRequest = options.onRequest, onResponse = options.onResponse, timeout = options.timeout ?? 10_000, } = params;\n const fetchOptions = {\n ...(options.fetchOptions ?? {}),\n ...(params.fetchOptions ?? {}),\n };\n const { headers, method, signal: signal_ } = fetchOptions;\n try {\n const response = await withTimeout(async ({ signal }) => {\n const init = {\n ...fetchOptions,\n body: Array.isArray(body)\n ? stringify(body.map((body) => ({\n jsonrpc: '2.0',\n id: body.id ?? idCache.take(),\n ...body,\n })))\n : stringify({\n jsonrpc: '2.0',\n id: body.id ?? idCache.take(),\n ...body,\n }),\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n },\n method: method || 'POST',\n signal: signal_ || (timeout > 0 ? signal : null),\n };\n const request = new Request(url, init);\n const args = (await onRequest?.(request, init)) ?? { ...init, url };\n const response = await fetchFn(args.url ?? url, args);\n return response;\n }, {\n errorInstance: new TimeoutError({ body, url }),\n timeout,\n signal: true,\n });\n if (onResponse)\n await onResponse(response);\n let data;\n if (response.headers.get('Content-Type')?.startsWith('application/json'))\n data = await response.json();\n else {\n data = await response.text();\n try {\n data = JSON.parse(data || '{}');\n }\n catch (err) {\n if (response.ok)\n throw err;\n data = { error: data };\n }\n }\n if (!response.ok) {\n throw new HttpRequestError({\n body,\n details: stringify(data.error) || response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n }\n return data;\n }\n catch (err) {\n if (err instanceof HttpRequestError)\n throw err;\n if (err instanceof TimeoutError)\n throw err;\n throw new HttpRequestError({\n body,\n cause: err,\n url,\n });\n }\n },\n };\n}\n//# sourceMappingURL=http.js.map","export function withTimeout(fn, { errorInstance = new Error('timed out'), timeout, signal, }) {\n return new Promise((resolve, reject) => {\n ;\n (async () => {\n let timeoutId;\n try {\n const controller = new AbortController();\n if (timeout > 0) {\n timeoutId = setTimeout(() => {\n if (signal) {\n controller.abort();\n }\n else {\n reject(errorInstance);\n }\n }, timeout); // need to cast because bun globals.d.ts overrides @types/node\n }\n resolve(await fn({ signal: controller?.signal || null }));\n }\n catch (err) {\n if (err?.name === 'AbortError')\n reject(errorInstance);\n reject(err);\n }\n finally {\n clearTimeout(timeoutId);\n }\n })();\n });\n}\n//# sourceMappingURL=withTimeout.js.map","import { keccak256 } from '../hash/keccak256.js';\nimport { toPrefixedMessage } from './toPrefixedMessage.js';\nexport function hashMessage(message, to_) {\n return keccak256(toPrefixedMessage(message), to_);\n}\n//# sourceMappingURL=hashMessage.js.map","import { presignMessagePrefix } from '../../constants/strings.js';\nimport { concat } from '../data/concat.js';\nimport { size } from '../data/size.js';\nimport { bytesToHex, stringToHex, } from '../encoding/toHex.js';\nexport function toPrefixedMessage(message_) {\n const message = (() => {\n if (typeof message_ === 'string')\n return stringToHex(message_);\n if (typeof message_.raw === 'string')\n return message_.raw;\n return bytesToHex(message_.raw);\n })();\n const prefix = stringToHex(`${presignMessagePrefix}${size(message)}`);\n return concat([prefix, message]);\n}\n//# sourceMappingURL=toPrefixedMessage.js.map","import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nexport class InvalidDomainError extends BaseError {\n constructor({ domain }) {\n super(`Invalid domain \"${stringify(domain)}\".`, {\n metaMessages: ['Must be a valid EIP-712 domain.'],\n });\n }\n}\nexport class InvalidPrimaryTypeError extends BaseError {\n constructor({ primaryType, types, }) {\n super(`Invalid primary type \\`${primaryType}\\` must be one of \\`${JSON.stringify(Object.keys(types))}\\`.`, {\n docsPath: '/api/glossary/Errors#typeddatainvalidprimarytypeerror',\n metaMessages: ['Check that the primary type is a key in `types`.'],\n });\n }\n}\nexport class InvalidStructTypeError extends BaseError {\n constructor({ type }) {\n super(`Struct type \"${type}\" is invalid.`, {\n metaMessages: ['Struct type must not be a Solidity type.'],\n name: 'InvalidStructTypeError',\n });\n }\n}\n//# sourceMappingURL=typedData.js.map","import { BytesSizeMismatchError } from '../errors/abi.js';\nimport { InvalidAddressError } from '../errors/address.js';\nimport { InvalidDomainError, InvalidPrimaryTypeError, InvalidStructTypeError, } from '../errors/typedData.js';\nimport { isAddress } from './address/isAddress.js';\nimport { size } from './data/size.js';\nimport { numberToHex } from './encoding/toHex.js';\nimport { bytesRegex, integerRegex } from './regex.js';\nimport { hashDomain, } from './signature/hashTypedData.js';\nimport { stringify } from './stringify.js';\nexport function serializeTypedData(parameters) {\n const { domain: domain_, message: message_, primaryType, types, } = parameters;\n const normalizeData = (struct, data_) => {\n const data = { ...data_ };\n for (const param of struct) {\n const { name, type } = param;\n if (type === 'address')\n data[name] = data[name].toLowerCase();\n }\n return data;\n };\n const domain = (() => {\n if (!types.EIP712Domain)\n return {};\n if (!domain_)\n return {};\n return normalizeData(types.EIP712Domain, domain_);\n })();\n const message = (() => {\n if (primaryType === 'EIP712Domain')\n return undefined;\n return normalizeData(types[primaryType], message_);\n })();\n return stringify({ domain, message, primaryType, types });\n}\nexport function validateTypedData(parameters) {\n const { domain, message, primaryType, types } = parameters;\n const validateData = (struct, data) => {\n for (const param of struct) {\n const { name, type } = param;\n const value = data[name];\n const integerMatch = type.match(integerRegex);\n if (integerMatch &&\n (typeof value === 'number' || typeof value === 'bigint')) {\n const [_type, base, size_] = integerMatch;\n // If number cannot be cast to a sized hex value, it is out of range\n // and will throw.\n numberToHex(value, {\n signed: base === 'int',\n size: Number.parseInt(size_, 10) / 8,\n });\n }\n if (type === 'address' && typeof value === 'string' && !isAddress(value))\n throw new InvalidAddressError({ address: value });\n const bytesMatch = type.match(bytesRegex);\n if (bytesMatch) {\n const [_type, size_] = bytesMatch;\n if (size_ && size(value) !== Number.parseInt(size_, 10))\n throw new BytesSizeMismatchError({\n expectedSize: Number.parseInt(size_, 10),\n givenSize: size(value),\n });\n }\n const struct = types[type];\n if (struct) {\n validateReference(type);\n validateData(struct, value);\n }\n }\n };\n // Validate domain types.\n if (types.EIP712Domain && domain) {\n if (typeof domain !== 'object')\n throw new InvalidDomainError({ domain });\n validateData(types.EIP712Domain, domain);\n }\n // Validate message types.\n if (primaryType !== 'EIP712Domain') {\n if (types[primaryType])\n validateData(types[primaryType], message);\n else\n throw new InvalidPrimaryTypeError({ primaryType, types });\n }\n}\nexport function getTypesForEIP712Domain({ domain, }) {\n return [\n typeof domain?.name === 'string' && { name: 'name', type: 'string' },\n domain?.version && { name: 'version', type: 'string' },\n (typeof domain?.chainId === 'number' ||\n typeof domain?.chainId === 'bigint') && {\n name: 'chainId',\n type: 'uint256',\n },\n domain?.verifyingContract && {\n name: 'verifyingContract',\n type: 'address',\n },\n domain?.salt && { name: 'salt', type: 'bytes32' },\n ].filter(Boolean);\n}\nexport function domainSeparator({ domain }) {\n return hashDomain({\n domain,\n types: {\n EIP712Domain: getTypesForEIP712Domain({ domain }),\n },\n });\n}\n/** @internal */\nfunction validateReference(type) {\n // Struct type must not be a Solidity type.\n if (type === 'address' ||\n type === 'bool' ||\n type === 'string' ||\n type.startsWith('bytes') ||\n type.startsWith('uint') ||\n type.startsWith('int'))\n throw new InvalidStructTypeError({ type });\n}\n//# sourceMappingURL=typedData.js.map","// Implementation forked and adapted from https://github.com/MetaMask/eth-sig-util/blob/main/src/sign-typed-data.ts\nimport { encodeAbiParameters, } from '../abi/encodeAbiParameters.js';\nimport { concat } from '../data/concat.js';\nimport { toHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { getTypesForEIP712Domain, validateTypedData, } from '../typedData.js';\nexport function hashTypedData(parameters) {\n const { domain = {}, message, primaryType, } = parameters;\n const types = {\n EIP712Domain: getTypesForEIP712Domain({ domain }),\n ...parameters.types,\n };\n // Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc\n // as we can't statically check this with TypeScript.\n validateTypedData({\n domain,\n message,\n primaryType,\n types,\n });\n const parts = ['0x1901'];\n if (domain)\n parts.push(hashDomain({\n domain,\n types: types,\n }));\n if (primaryType !== 'EIP712Domain')\n parts.push(hashStruct({\n data: message,\n primaryType,\n types: types,\n }));\n return keccak256(concat(parts));\n}\nexport function hashDomain({ domain, types, }) {\n return hashStruct({\n data: domain,\n primaryType: 'EIP712Domain',\n types,\n });\n}\nexport function hashStruct({ data, primaryType, types, }) {\n const encoded = encodeData({\n data,\n primaryType,\n types,\n });\n return keccak256(encoded);\n}\nfunction encodeData({ data, primaryType, types, }) {\n const encodedTypes = [{ type: 'bytes32' }];\n const encodedValues = [hashType({ primaryType, types })];\n for (const field of types[primaryType]) {\n const [type, value] = encodeField({\n types,\n name: field.name,\n type: field.type,\n value: data[field.name],\n });\n encodedTypes.push(type);\n encodedValues.push(value);\n }\n return encodeAbiParameters(encodedTypes, encodedValues);\n}\nfunction hashType({ primaryType, types, }) {\n const encodedHashType = toHex(encodeType({ primaryType, types }));\n return keccak256(encodedHashType);\n}\nexport function encodeType({ primaryType, types, }) {\n let result = '';\n const unsortedDeps = findTypeDependencies({ primaryType, types });\n unsortedDeps.delete(primaryType);\n const deps = [primaryType, ...Array.from(unsortedDeps).sort()];\n for (const type of deps) {\n result += `${type}(${types[type]\n .map(({ name, type: t }) => `${t} ${name}`)\n .join(',')})`;\n }\n return result;\n}\nfunction findTypeDependencies({ primaryType: primaryType_, types, }, results = new Set()) {\n const match = primaryType_.match(/^\\w*/u);\n const primaryType = match?.[0];\n if (results.has(primaryType) || types[primaryType] === undefined) {\n return results;\n }\n results.add(primaryType);\n for (const field of types[primaryType]) {\n findTypeDependencies({ primaryType: field.type, types }, results);\n }\n return results;\n}\nfunction encodeField({ types, name, type, value, }) {\n if (types[type] !== undefined) {\n return [\n { type: 'bytes32' },\n keccak256(encodeData({ data: value, primaryType: type, types })),\n ];\n }\n if (type === 'bytes') {\n const prepend = value.length % 2 ? '0' : '';\n value = `0x${prepend + value.slice(2)}`;\n return [{ type: 'bytes32' }, keccak256(value)];\n }\n if (type === 'string')\n return [{ type: 'bytes32' }, keccak256(toHex(value))];\n if (type.lastIndexOf(']') === type.length - 1) {\n const parsedType = type.slice(0, type.lastIndexOf('['));\n const typeValuePairs = value.map((item) => encodeField({\n name,\n type: parsedType,\n types,\n value: item,\n }));\n return [\n { type: 'bytes32' },\n keccak256(encodeAbiParameters(typeValuePairs.map(([t]) => t), typeValuePairs.map(([, v]) => v))),\n ];\n }\n return [{ type }, value];\n}\n//# sourceMappingURL=hashTypedData.js.map","import { version } from './version.js';\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n const details = args.cause instanceof BaseError\n ? args.cause.details\n : args.cause?.message\n ? args.cause.message\n : args.details;\n const docsPath = args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsPath ? [`Docs: https://abitype.dev${docsPath}`] : []),\n ...(details ? [`Details: ${details}`] : []),\n `Version: abitype@${version}`,\n ].join('\\n');\n super(message);\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiTypeError'\n });\n if (args.cause)\n this.cause = args.cause;\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.shortMessage = shortMessage;\n }\n}\n//# sourceMappingURL=errors.js.map","// TODO: This looks cool. Need to check the performance of `new RegExp` versus defined inline though.\n// https://twitter.com/GabrielVergnaud/status/1622906834343366657\nexport function execTyped(regex, string) {\n const match = regex.exec(string);\n return match?.groups;\n}\n// `bytes<M>`: binary type of `M` bytes, `0 < M <= 32`\n// https://regexr.com/6va55\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\n// `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n// https://regexr.com/6v8hp\nexport const integerRegex = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\nexport const isTupleRegex = /^\\(.+?\\).*?$/;\n//# sourceMappingURL=regex.js.map","import { execTyped } from '../regex.js';\n// https://regexr.com/7f7rv\nconst tupleRegex = /^tuple(?<array>(\\[(\\d*)\\])*)$/;\n/**\n * Formats {@link AbiParameter} to human-readable ABI parameter.\n *\n * @param abiParameter - ABI parameter\n * @returns Human-readable ABI parameter\n *\n * @example\n * const result = formatAbiParameter({ type: 'address', name: 'from' })\n * // ^? const result: 'address from'\n */\nexport function formatAbiParameter(abiParameter) {\n let type = abiParameter.type;\n if (tupleRegex.test(abiParameter.type) && 'components' in abiParameter) {\n type = '(';\n const length = abiParameter.components.length;\n for (let i = 0; i < length; i++) {\n const component = abiParameter.components[i];\n type += formatAbiParameter(component);\n if (i < length - 1)\n type += ', ';\n }\n const result = execTyped(tupleRegex, abiParameter.type);\n type += `)${result?.array ?? ''}`;\n return formatAbiParameter({\n ...abiParameter,\n type,\n });\n }\n // Add `indexed` to type if in `abiParameter`\n if ('indexed' in abiParameter && abiParameter.indexed)\n type = `${type} indexed`;\n // Return human-readable ABI parameter\n if (abiParameter.name)\n return `${type} ${abiParameter.name}`;\n return type;\n}\n//# sourceMappingURL=formatAbiParameter.js.map","import { formatAbiParameter, } from './formatAbiParameter.js';\n/**\n * Formats {@link AbiParameter}s to human-readable ABI parameters.\n *\n * @param abiParameters - ABI parameters\n * @returns Human-readable ABI parameters\n *\n * @example\n * const result = formatAbiParameters([\n * // ^? const result: 'address from, uint256 tokenId'\n * { type: 'address', name: 'from' },\n * { type: 'uint256', name: 'tokenId' },\n * ])\n */\nexport function formatAbiParameters(abiParameters) {\n let params = '';\n const length = abiParameters.length;\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i];\n params += formatAbiParameter(abiParameter);\n if (i !== length - 1)\n params += ', ';\n }\n return params;\n}\n//# sourceMappingURL=formatAbiParameters.js.map","import { formatAbiParameters, } from './formatAbiParameters.js';\n/**\n * Formats ABI item (e.g. error, event, function) into human-readable ABI item\n *\n * @param abiItem - ABI item\n * @returns Human-readable ABI item\n */\nexport function formatAbiItem(abiItem) {\n if (abiItem.type === 'function')\n return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== 'nonpayable'\n ? ` ${abiItem.stateMutability}`\n : ''}${abiItem.outputs?.length\n ? ` returns (${formatAbiParameters(abiItem.outputs)})`\n : ''}`;\n if (abiItem.type === 'event')\n return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;\n if (abiItem.type === 'error')\n return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;\n if (abiItem.type === 'constructor')\n return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === 'payable' ? ' payable' : ''}`;\n if (abiItem.type === 'fallback')\n return `fallback() external${abiItem.stateMutability === 'payable' ? ' payable' : ''}`;\n return 'receive() external payable';\n}\n//# sourceMappingURL=formatAbiItem.js.map","import { execTyped } from '../../regex.js';\n// https://regexr.com/7gmok\nconst errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)$/;\nexport function isErrorSignature(signature) {\n return errorSignatureRegex.test(signature);\n}\nexport function execErrorSignature(signature) {\n return execTyped(errorSignatureRegex, signature);\n}\n// https://regexr.com/7gmoq\nconst eventSignatureRegex = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)$/;\nexport function isEventSignature(signature) {\n return eventSignatureRegex.test(signature);\n}\nexport function execEventSignature(signature) {\n return execTyped(eventSignatureRegex, signature);\n}\n// https://regexr.com/7gmot\nconst functionSignatureRegex = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\\s?\\((?<returns>.*?)\\))?$/;\nexport function isFunctionSignature(signature) {\n return functionSignatureRegex.test(signature);\n}\nexport function execFunctionSignature(signature) {\n return execTyped(functionSignatureRegex, signature);\n}\n// https://regexr.com/7gmp3\nconst structSignatureRegex = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \\{(?<properties>.*?)\\}$/;\nexport function isStructSignature(signature) {\n return structSignatureRegex.test(signature);\n}\nexport function execStructSignature(signature) {\n return execTyped(structSignatureRegex, signature);\n}\n// https://regexr.com/78u01\nconst constructorSignatureRegex = /^constructor\\((?<parameters>.*?)\\)(?:\\s(?<stateMutability>payable{1}))?$/;\nexport function isConstructorSignature(signature) {\n return constructorSignatureRegex.test(signature);\n}\nexport function execConstructorSignature(signature) {\n return execTyped(constructorSignatureRegex, signature);\n}\n// https://regexr.com/7srtn\nconst fallbackSignatureRegex = /^fallback\\(\\) external(?:\\s(?<stateMutability>payable{1}))?$/;\nexport function isFallbackSignature(signature) {\n return fallbackSignatureRegex.test(signature);\n}\nexport function execFallbackSignature(signature) {\n return execTyped(fallbackSignatureRegex, signature);\n}\n// https://regexr.com/78u1k\nconst receiveSignatureRegex = /^receive\\(\\) external payable$/;\nexport function isReceiveSignature(signature) {\n return receiveSignatureRegex.test(signature);\n}\nexport const modifiers = new Set([\n 'memory',\n 'indexed',\n 'storage',\n 'calldata',\n]);\nexport const eventModifiers = new Set(['indexed']);\nexport const functionModifiers = new Set([\n 'calldata',\n 'memory',\n 'storage',\n]);\n//# sourceMappingURL=signatures.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiItemError extends BaseError {\n constructor({ signature }) {\n super('Failed to parse ABI item.', {\n details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,\n docsPath: '/api/human#parseabiitem-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiItemError'\n });\n }\n}\nexport class UnknownTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [\n `Type \"${type}\" is not a valid ABI type. Perhaps you forgot to include a struct signature?`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownTypeError'\n });\n }\n}\nexport class UnknownSolidityTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [`Type \"${type}\" is not a valid ABI type.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSolidityTypeError'\n });\n }\n}\n//# sourceMappingURL=abiItem.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiParameterError extends BaseError {\n constructor({ param }) {\n super('Failed to parse ABI parameter.', {\n details: `parseAbiParameter(${JSON.stringify(param, null, 2)})`,\n docsPath: '/api/human#parseabiparameter-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParameterError'\n });\n }\n}\nexport class InvalidAbiParametersError extends BaseError {\n constructor({ params }) {\n super('Failed to parse ABI parameters.', {\n details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,\n docsPath: '/api/human#parseabiparameters-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParametersError'\n });\n }\n}\nexport class InvalidParameterError extends BaseError {\n constructor({ param }) {\n super('Invalid ABI parameter.', {\n details: param,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParameterError'\n });\n }\n}\nexport class SolidityProtectedKeywordError extends BaseError {\n constructor({ param, name }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `\"${name}\" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SolidityProtectedKeywordError'\n });\n }\n}\nexport class InvalidModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidModifierError'\n });\n }\n}\nexport class InvalidFunctionModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n `Data location can only be specified for array, struct, or mapping types, but \"${modifier}\" was given.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidFunctionModifierError'\n });\n }\n}\nexport class InvalidAbiTypeParameterError extends BaseError {\n constructor({ abiParameter, }) {\n super('Invalid ABI parameter.', {\n details: JSON.stringify(abiParameter, null, 2),\n metaMessages: ['ABI parameter type is invalid.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiTypeParameterError'\n });\n }\n}\n//# sourceMappingURL=abiParameter.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidSignatureError extends BaseError {\n constructor({ signature, type, }) {\n super(`Invalid ${type} signature.`, {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSignatureError'\n });\n }\n}\nexport class UnknownSignatureError extends BaseError {\n constructor({ signature }) {\n super('Unknown signature.', {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSignatureError'\n });\n }\n}\nexport class InvalidStructSignatureError extends BaseError {\n constructor({ signature }) {\n super('Invalid struct signature.', {\n details: signature,\n metaMessages: ['No properties exist.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidStructSignatureError'\n });\n }\n}\n//# sourceMappingURL=signature.js.map","import { BaseError } from '../../errors.js';\nexport class CircularReferenceError extends BaseError {\n constructor({ type }) {\n super('Circular reference detected.', {\n metaMessages: [`Struct \"${type}\" is a circular reference.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'CircularReferenceError'\n });\n }\n}\n//# sourceMappingURL=struct.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidParenthesisError extends BaseError {\n constructor({ current, depth }) {\n super('Unbalanced parentheses.', {\n metaMessages: [\n `\"${current.trim()}\" has too many ${depth > 0 ? 'opening' : 'closing'} parentheses.`,\n ],\n details: `Depth \"${depth}\"`,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParenthesisError'\n });\n }\n}\n//# sourceMappingURL=splitParameters.js.map","/**\n * Gets {@link parameterCache} cache key namespaced by {@link type}. This prevents parameters from being accessible to types that don't allow them (e.g. `string indexed foo` not allowed outside of `type: 'event'`).\n * @param param ABI parameter string\n * @param type ABI parameter type\n * @returns Cache key for {@link parameterCache}\n */\nexport function getParameterCacheKey(param, type, structs) {\n let structKey = '';\n if (structs)\n for (const struct of Object.entries(structs)) {\n if (!struct)\n continue;\n let propertyKey = '';\n for (const property of struct[1]) {\n propertyKey += `[${property.type}${property.name ? `:${property.name}` : ''}]`;\n }\n structKey += `(${struct[0]}{${propertyKey}})`;\n }\n if (type)\n return `${type}:${param}${structKey}`;\n return param;\n}\n/**\n * Basic cache seeded with common ABI parameter strings.\n *\n * **Note: When seeding more parameters, make sure you benchmark performance. The current number is the ideal balance between performance and having an already existing cache.**\n */\nexport const parameterCache = new Map([\n // Unnamed\n ['address', { type: 'address' }],\n ['bool', { type: 'bool' }],\n ['bytes', { type: 'bytes' }],\n ['bytes32', { type: 'bytes32' }],\n ['int', { type: 'int256' }],\n ['int256', { type: 'int256' }],\n ['string', { type: 'string' }],\n ['uint', { type: 'uint256' }],\n ['uint8', { type: 'uint8' }],\n ['uint16', { type: 'uint16' }],\n ['uint24', { type: 'uint24' }],\n ['uint32', { type: 'uint32' }],\n ['uint64', { type: 'uint64' }],\n ['uint96', { type: 'uint96' }],\n ['uint112', { type: 'uint112' }],\n ['uint160', { type: 'uint160' }],\n ['uint192', { type: 'uint192' }],\n ['uint256', { type: 'uint256' }],\n // Named\n ['address owner', { type: 'address', name: 'owner' }],\n ['address to', { type: 'address', name: 'to' }],\n ['bool approved', { type: 'bool', name: 'approved' }],\n ['bytes _data', { type: 'bytes', name: '_data' }],\n ['bytes data', { type: 'bytes', name: 'data' }],\n ['bytes signature', { type: 'bytes', name: 'signature' }],\n ['bytes32 hash', { type: 'bytes32', name: 'hash' }],\n ['bytes32 r', { type: 'bytes32', name: 'r' }],\n ['bytes32 root', { type: 'bytes32', name: 'root' }],\n ['bytes32 s', { type: 'bytes32', name: 's' }],\n ['string name', { type: 'string', name: 'name' }],\n ['string symbol', { type: 'string', name: 'symbol' }],\n ['string tokenURI', { type: 'string', name: 'tokenURI' }],\n ['uint tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint8 v', { type: 'uint8', name: 'v' }],\n ['uint256 balance', { type: 'uint256', name: 'balance' }],\n ['uint256 tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint256 value', { type: 'uint256', name: 'value' }],\n // Indexed\n [\n 'event:address indexed from',\n { type: 'address', name: 'from', indexed: true },\n ],\n ['event:address indexed to', { type: 'address', name: 'to', indexed: true }],\n [\n 'event:uint indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n [\n 'event:uint256 indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n]);\n//# sourceMappingURL=cache.js.map","import { bytesRegex, execTyped, integerRegex, isTupleRegex, } from '../../regex.js';\nimport { UnknownSolidityTypeError } from '../errors/abiItem.js';\nimport { InvalidFunctionModifierError, InvalidModifierError, InvalidParameterError, SolidityProtectedKeywordError, } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, UnknownSignatureError, } from '../errors/signature.js';\nimport { InvalidParenthesisError } from '../errors/splitParameters.js';\nimport { getParameterCacheKey, parameterCache } from './cache.js';\nimport { eventModifiers, execConstructorSignature, execErrorSignature, execEventSignature, execFallbackSignature, execFunctionSignature, functionModifiers, isConstructorSignature, isErrorSignature, isEventSignature, isFallbackSignature, isFunctionSignature, isReceiveSignature, } from './signatures.js';\nexport function parseSignature(signature, structs = {}) {\n if (isFunctionSignature(signature))\n return parseFunctionSignature(signature, structs);\n if (isEventSignature(signature))\n return parseEventSignature(signature, structs);\n if (isErrorSignature(signature))\n return parseErrorSignature(signature, structs);\n if (isConstructorSignature(signature))\n return parseConstructorSignature(signature, structs);\n if (isFallbackSignature(signature))\n return parseFallbackSignature(signature);\n if (isReceiveSignature(signature))\n return {\n type: 'receive',\n stateMutability: 'payable',\n };\n throw new UnknownSignatureError({ signature });\n}\nexport function parseFunctionSignature(signature, structs = {}) {\n const match = execFunctionSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'function' });\n const inputParams = splitParameters(match.parameters);\n const inputs = [];\n const inputLength = inputParams.length;\n for (let i = 0; i < inputLength; i++) {\n inputs.push(parseAbiParameter(inputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n const outputs = [];\n if (match.returns) {\n const outputParams = splitParameters(match.returns);\n const outputLength = outputParams.length;\n for (let i = 0; i < outputLength; i++) {\n outputs.push(parseAbiParameter(outputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n }\n return {\n name: match.name,\n type: 'function',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs,\n outputs,\n };\n}\nexport function parseEventSignature(signature, structs = {}) {\n const match = execEventSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'event' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++)\n abiParameters.push(parseAbiParameter(params[i], {\n modifiers: eventModifiers,\n structs,\n type: 'event',\n }));\n return { name: match.name, type: 'event', inputs: abiParameters };\n}\nexport function parseErrorSignature(signature, structs = {}) {\n const match = execErrorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'error' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++)\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'error' }));\n return { name: match.name, type: 'error', inputs: abiParameters };\n}\nexport function parseConstructorSignature(signature, structs = {}) {\n const match = execConstructorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'constructor' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++)\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'constructor' }));\n return {\n type: 'constructor',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs: abiParameters,\n };\n}\nexport function parseFallbackSignature(signature) {\n const match = execFallbackSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'fallback' });\n return {\n type: 'fallback',\n stateMutability: match.stateMutability ?? 'nonpayable',\n };\n}\nconst abiParameterWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\\spayable)?)(?<array>(?:\\[\\d*?\\])+?)?(?:\\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst abiParameterWithTupleRegex = /^\\((?<type>.+?)\\)(?<array>(?:\\[\\d*?\\])+?)?(?:\\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst dynamicIntegerRegex = /^u?int$/;\nexport function parseAbiParameter(param, options) {\n // optional namespace cache by `type`\n const parameterCacheKey = getParameterCacheKey(param, options?.type, options?.structs);\n if (parameterCache.has(parameterCacheKey))\n return parameterCache.get(parameterCacheKey);\n const isTuple = isTupleRegex.test(param);\n const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);\n if (!match)\n throw new InvalidParameterError({ param });\n if (match.name && isSolidityKeyword(match.name))\n throw new SolidityProtectedKeywordError({ param, name: match.name });\n const name = match.name ? { name: match.name } : {};\n const indexed = match.modifier === 'indexed' ? { indexed: true } : {};\n const structs = options?.structs ?? {};\n let type;\n let components = {};\n if (isTuple) {\n type = 'tuple';\n const params = splitParameters(match.type);\n const components_ = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n // remove `modifiers` from `options` to prevent from being added to tuple components\n components_.push(parseAbiParameter(params[i], { structs }));\n }\n components = { components: components_ };\n }\n else if (match.type in structs) {\n type = 'tuple';\n components = { components: structs[match.type] };\n }\n else if (dynamicIntegerRegex.test(match.type)) {\n type = `${match.type}256`;\n }\n else if (match.type === 'address payable') {\n type = 'address';\n }\n else {\n type = match.type;\n if (!(options?.type === 'struct') && !isSolidityType(type))\n throw new UnknownSolidityTypeError({ type });\n }\n if (match.modifier) {\n // Check if modifier exists, but is not allowed (e.g. `indexed` in `functionModifiers`)\n if (!options?.modifiers?.has?.(match.modifier))\n throw new InvalidModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n // Check if resolved `type` is valid if there is a function modifier\n if (functionModifiers.has(match.modifier) &&\n !isValidDataLocation(type, !!match.array))\n throw new InvalidFunctionModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n }\n const abiParameter = {\n type: `${type}${match.array ?? ''}`,\n ...name,\n ...indexed,\n ...components,\n };\n parameterCache.set(parameterCacheKey, abiParameter);\n return abiParameter;\n}\n// s/o latika for this\nexport function splitParameters(params, result = [], current = '', depth = 0) {\n const length = params.trim().length;\n // biome-ignore lint/correctness/noUnreachable: recursive\n for (let i = 0; i < length; i++) {\n const char = params[i];\n const tail = params.slice(i + 1);\n switch (char) {\n case ',':\n return depth === 0\n ? splitParameters(tail, [...result, current.trim()])\n : splitParameters(tail, result, `${current}${char}`, depth);\n case '(':\n return splitParameters(tail, result, `${current}${char}`, depth + 1);\n case ')':\n return splitParameters(tail, result, `${current}${char}`, depth - 1);\n default:\n return splitParameters(tail, result, `${current}${char}`, depth);\n }\n }\n if (current === '')\n return result;\n if (depth !== 0)\n throw new InvalidParenthesisError({ current, depth });\n result.push(current.trim());\n return result;\n}\nexport function isSolidityType(type) {\n return (type === 'address' ||\n type === 'bool' ||\n type === 'function' ||\n type === 'string' ||\n bytesRegex.test(type) ||\n integerRegex.test(type));\n}\nconst protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;\n/** @internal */\nexport function isSolidityKeyword(name) {\n return (name === 'address' ||\n name === 'bool' ||\n name === 'function' ||\n name === 'string' ||\n name === 'tuple' ||\n bytesRegex.test(name) ||\n integerRegex.test(name) ||\n protectedKeywordsRegex.test(name));\n}\n/** @internal */\nexport function isValidDataLocation(type, isArray) {\n return isArray || type === 'bytes' || type === 'string' || type === 'tuple';\n}\n//# sourceMappingURL=utils.js.map","import { execTyped, isTupleRegex } from '../../regex.js';\nimport { UnknownTypeError } from '../errors/abiItem.js';\nimport { InvalidAbiTypeParameterError } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, InvalidStructSignatureError, } from '../errors/signature.js';\nimport { CircularReferenceError } from '../errors/struct.js';\nimport { execStructSignature, isStructSignature } from './signatures.js';\nimport { isSolidityType, parseAbiParameter } from './utils.js';\nexport function parseStructs(signatures) {\n // Create \"shallow\" version of each struct (and filter out non-structs or invalid structs)\n const shallowStructs = {};\n const signaturesLength = signatures.length;\n for (let i = 0; i < signaturesLength; i++) {\n const signature = signatures[i];\n if (!isStructSignature(signature))\n continue;\n const match = execStructSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'struct' });\n const properties = match.properties.split(';');\n const components = [];\n const propertiesLength = properties.length;\n for (let k = 0; k < propertiesLength; k++) {\n const property = properties[k];\n const trimmed = property.trim();\n if (!trimmed)\n continue;\n const abiParameter = parseAbiParameter(trimmed, {\n type: 'struct',\n });\n components.push(abiParameter);\n }\n if (!components.length)\n throw new InvalidStructSignatureError({ signature });\n shallowStructs[match.name] = components;\n }\n // Resolve nested structs inside each parameter\n const resolvedStructs = {};\n const entries = Object.entries(shallowStructs);\n const entriesLength = entries.length;\n for (let i = 0; i < entriesLength; i++) {\n const [name, parameters] = entries[i];\n resolvedStructs[name] = resolveStructs(parameters, shallowStructs);\n }\n return resolvedStructs;\n}\nconst typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\\[\\d*?\\])+?)?$/;\nfunction resolveStructs(abiParameters, structs, ancestors = new Set()) {\n const components = [];\n const length = abiParameters.length;\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i];\n const isTuple = isTupleRegex.test(abiParameter.type);\n if (isTuple)\n components.push(abiParameter);\n else {\n const match = execTyped(typeWithoutTupleRegex, abiParameter.type);\n if (!match?.type)\n throw new InvalidAbiTypeParameterError({ abiParameter });\n const { array, type } = match;\n if (type in structs) {\n if (ancestors.has(type))\n throw new CircularReferenceError({ type });\n components.push({\n ...abiParameter,\n type: `tuple${array ?? ''}`,\n components: resolveStructs(structs[type] ?? [], structs, new Set([...ancestors, type])),\n });\n }\n else {\n if (isSolidityType(type))\n components.push(abiParameter);\n else\n throw new UnknownTypeError({ type });\n }\n }\n }\n return components;\n}\n//# sourceMappingURL=structs.js.map","import { InvalidAbiItemError } from './errors/abiItem.js';\nimport { isStructSignature } from './runtime/signatures.js';\nimport { parseStructs } from './runtime/structs.js';\nimport { parseSignature } from './runtime/utils.js';\n/**\n * Parses human-readable ABI item (e.g. error, event, function) into {@link Abi} item\n *\n * @param signature - Human-readable ABI item\n * @returns Parsed {@link Abi} item\n *\n * @example\n * const abiItem = parseAbiItem('function balanceOf(address owner) view returns (uint256)')\n * // ^? const abiItem: { name: \"balanceOf\"; type: \"function\"; stateMutability: \"view\";...\n *\n * @example\n * const abiItem = parseAbiItem([\n * // ^? const abiItem: { name: \"foo\"; type: \"function\"; stateMutability: \"view\"; inputs:...\n * 'function foo(Baz bar) view returns (string)',\n * 'struct Baz { string name; }',\n * ])\n */\nexport function parseAbiItem(signature) {\n let abiItem;\n if (typeof signature === 'string')\n abiItem = parseSignature(signature);\n else {\n const structs = parseStructs(signature);\n const length = signature.length;\n for (let i = 0; i < length; i++) {\n const signature_ = signature[i];\n if (isStructSignature(signature_))\n continue;\n abiItem = parseSignature(signature_, structs);\n break;\n }\n }\n if (!abiItem)\n throw new InvalidAbiItemError({ signature });\n return abiItem;\n}\n//# sourceMappingURL=parseAbiItem.js.map","import { InvalidAbiParametersError } from './errors/abiParameter.js';\nimport { isStructSignature, modifiers } from './runtime/signatures.js';\nimport { parseStructs } from './runtime/structs.js';\nimport { splitParameters } from './runtime/utils.js';\nimport { parseAbiParameter as parseAbiParameter_ } from './runtime/utils.js';\n/**\n * Parses human-readable ABI parameters into {@link AbiParameter}s\n *\n * @param params - Human-readable ABI parameters\n * @returns Parsed {@link AbiParameter}s\n *\n * @example\n * const abiParameters = parseAbiParameters('address from, address to, uint256 amount')\n * // ^? const abiParameters: [{ type: \"address\"; name: \"from\"; }, { type: \"address\";...\n *\n * @example\n * const abiParameters = parseAbiParameters([\n * // ^? const abiParameters: [{ type: \"tuple\"; components: [{ type: \"string\"; name:...\n * 'Baz bar',\n * 'struct Baz { string name; }',\n * ])\n */\nexport function parseAbiParameters(params) {\n const abiParameters = [];\n if (typeof params === 'string') {\n const parameters = splitParameters(params);\n const length = parameters.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter_(parameters[i], { modifiers }));\n }\n }\n else {\n const structs = parseStructs(params);\n const length = params.length;\n for (let i = 0; i < length; i++) {\n const signature = params[i];\n if (isStructSignature(signature))\n continue;\n const parameters = splitParameters(signature);\n const length = parameters.length;\n for (let k = 0; k < length; k++) {\n abiParameters.push(parseAbiParameter_(parameters[k], { modifiers, structs }));\n }\n }\n }\n if (abiParameters.length === 0)\n throw new InvalidAbiParametersError({ params });\n return abiParameters;\n}\n//# sourceMappingURL=parseAbiParameters.js.map","/**\n * @internal\n *\n * Map with a LRU (Least recently used) policy.\n * @see https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU\n */\nexport class LruMap extends Map {\n constructor(size) {\n super();\n Object.defineProperty(this, \"maxSize\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.maxSize = size;\n }\n get(key) {\n const value = super.get(key);\n if (super.has(key) && value !== undefined) {\n this.delete(key);\n super.set(key, value);\n }\n return value;\n }\n set(key, value) {\n super.set(key, value);\n if (this.maxSize && this.size > this.maxSize) {\n const firstKey = this.keys().next().value;\n if (firstKey)\n this.delete(firstKey);\n }\n return this;\n }\n}\n//# sourceMappingURL=lru.js.map","import { LruMap } from './internal/lru.js';\nconst caches = {\n checksum: /*#__PURE__*/ new LruMap(8192),\n};\nexport const checksum = caches.checksum;\n/**\n * Clears all global caches.\n *\n * @example\n * ```ts\n * import { Caches } from 'ox'\n * Caches.clear()\n * ```\n */\nexport function clear() {\n for (const cache of Object.values(caches))\n cache.clear();\n}\n//# sourceMappingURL=Caches.js.map","import { ripemd160 as noble_ripemd160 } from '@noble/hashes/ripemd160';\nimport { keccak_256 as noble_keccak256 } from '@noble/hashes/sha3';\nimport { sha256 as noble_sha256 } from '@noble/hashes/sha256';\nimport * as Bytes from './Bytes.js';\nimport * as Hex from './Hex.js';\n/**\n * Calculates the [Keccak256](https://en.wikipedia.org/wiki/SHA-3) hash of a {@link ox#Bytes.Bytes} or {@link ox#Hex.Hex} value.\n *\n * This function is a re-export of `keccak_256` from [`@noble/hashes`](https://github.com/paulmillr/noble-hashes), an audited & minimal JS hashing library.\n *\n * @example\n * ```ts twoslash\n * import { Hash } from 'ox'\n *\n * Hash.keccak256('0xdeadbeef')\n * // @log: '0xd4fd4e189132273036449fc9e11198c739161b4c0116a9a2dccdfa1c492006f1'\n * ```\n *\n * @example\n * ### Calculate Hash of a String\n *\n * ```ts twoslash\n * import { Hash, Hex } from 'ox'\n *\n * Hash.keccak256(Hex.fromString('hello world'))\n * // @log: '0x3ea2f1d0abf3fc66cf29eebb70cbd4e7fe762ef8a09bcc06c8edf641230afec0'\n * ```\n *\n * @example\n * ### Configure Return Type\n *\n * ```ts twoslash\n * import { Hash } from 'ox'\n *\n * Hash.keccak256('0xdeadbeef', { as: 'Bytes' })\n * // @log: Uint8Array [...]\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} or {@link ox#Hex.Hex} value.\n * @param options - Options.\n * @returns Keccak256 hash.\n */\nexport function keccak256(value, options = {}) {\n const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;\n const bytes = noble_keccak256(Bytes.from(value));\n if (as === 'Bytes')\n return bytes;\n return Hex.fromBytes(bytes);\n}\n/**\n * Calculates the [Ripemd160](https://en.wikipedia.org/wiki/RIPEMD) hash of a {@link ox#Bytes.Bytes} or {@link ox#Hex.Hex} value.\n *\n * This function is a re-export of `ripemd160` from [`@noble/hashes`](https://github.com/paulmillr/noble-hashes), an audited & minimal JS hashing library.\n *\n * @example\n * ```ts twoslash\n * import { Hash } from 'ox'\n *\n * Hash.ripemd160('0xdeadbeef')\n * // '0x226821c2f5423e11fe9af68bd285c249db2e4b5a'\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} or {@link ox#Hex.Hex} value.\n * @param options - Options.\n * @returns Ripemd160 hash.\n */\nexport function ripemd160(value, options = {}) {\n const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;\n const bytes = noble_ripemd160(Bytes.from(value));\n if (as === 'Bytes')\n return bytes;\n return Hex.fromBytes(bytes);\n}\n/**\n * Calculates the [Sha256](https://en.wikipedia.org/wiki/SHA-256) hash of a {@link ox#Bytes.Bytes} or {@link ox#Hex.Hex} value.\n *\n * This function is a re-export of `sha256` from [`@noble/hashes`](https://github.com/paulmillr/noble-hashes), an audited & minimal JS hashing library.\n *\n * @example\n * ```ts twoslash\n * import { Hash } from 'ox'\n *\n * Hash.sha256('0xdeadbeef')\n * // '0x5f78c33274e43fa9de5659265c1d917e25c03722dcb0b8d27db8d5feaa813953'\n * ```\n *\n * @param value - {@link ox#Bytes.Bytes} or {@link ox#Hex.Hex} value.\n * @param options - Options.\n * @returns Sha256 hash.\n */\nexport function sha256(value, options = {}) {\n const { as = typeof value === 'string' ? 'Hex' : 'Bytes' } = options;\n const bytes = noble_sha256(Bytes.from(value));\n if (as === 'Bytes')\n return bytes;\n return Hex.fromBytes(bytes);\n}\n/**\n * Checks if a string is a valid hash value.\n *\n * @example\n * ```ts twoslash\n * import { Hash } from 'ox'\n *\n * Hash.validate('0x')\n * // @log: false\n *\n * Hash.validate('0x3ea2f1d0abf3fc66cf29eebb70cbd4e7fe762ef8a09bcc06c8edf641230afec0')\n * // @log: true\n * ```\n *\n * @param value - Value to check.\n * @returns Whether the value is a valid hash.\n */\nexport function validate(value) {\n return Hex.validate(value) && Hex.size(value) === 32;\n}\n//# sourceMappingURL=Hash.js.map","import * as Bytes from './Bytes.js';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport * as Json from './Json.js';\n/**\n * Asserts that a {@link ox#PublicKey.PublicKey} is valid.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * PublicKey.assert({\n * prefix: 4,\n * y: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * })\n * // @error: PublicKey.InvalidError: Value \\`{\"y\":\"1\"}\\` is not a valid public key.\n * // @error: Public key must contain:\n * // @error: - an `x` and `prefix` value (compressed)\n * // @error: - an `x`, `y`, and `prefix` value (uncompressed)\n * ```\n *\n * @param publicKey - The public key object to assert.\n */\nexport function assert(publicKey, options = {}) {\n const { compressed } = options;\n const { prefix, x, y } = publicKey;\n // Uncompressed\n if (compressed === false ||\n (typeof x === 'bigint' && typeof y === 'bigint')) {\n if (prefix !== 4)\n throw new InvalidPrefixError({\n prefix,\n cause: new InvalidUncompressedPrefixError(),\n });\n return;\n }\n // Compressed\n if (compressed === true ||\n (typeof x === 'bigint' && typeof y === 'undefined')) {\n if (prefix !== 3 && prefix !== 2)\n throw new InvalidPrefixError({\n prefix,\n cause: new InvalidCompressedPrefixError(),\n });\n return;\n }\n // Unknown/invalid\n throw new InvalidError({ publicKey });\n}\n/**\n * Compresses a {@link ox#PublicKey.PublicKey}.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.from({\n * prefix: 4,\n * x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * })\n *\n * const compressed = PublicKey.compress(publicKey) // [!code focus]\n * // @log: {\n * // @log: prefix: 3,\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: }\n * ```\n *\n * @param publicKey - The public key to compress.\n * @returns The compressed public key.\n */\nexport function compress(publicKey) {\n const { x, y } = publicKey;\n return {\n prefix: y % 2n === 0n ? 2 : 3,\n x,\n };\n}\n/**\n * Instantiates a typed {@link ox#PublicKey.PublicKey} object from a {@link ox#PublicKey.PublicKey}, {@link ox#Bytes.Bytes}, or {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.from({\n * prefix: 4,\n * x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * })\n * // @log: {\n * // @log: prefix: 4,\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * // @log: }\n * ```\n *\n * @example\n * ### From Serialized\n *\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.from('0x048318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5')\n * // @log: {\n * // @log: prefix: 4,\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * // @log: }\n * ```\n *\n * @param value - The public key value to instantiate.\n * @returns The instantiated {@link ox#PublicKey.PublicKey}.\n */\nexport function from(value) {\n const publicKey = (() => {\n if (Hex.validate(value))\n return fromHex(value);\n if (Bytes.validate(value))\n return fromBytes(value);\n const { prefix, x, y } = value;\n if (typeof x === 'bigint' && typeof y === 'bigint')\n return { prefix: prefix ?? 0x04, x, y };\n return { prefix, x };\n })();\n assert(publicKey);\n return publicKey;\n}\n/**\n * Deserializes a {@link ox#PublicKey.PublicKey} from a {@link ox#Bytes.Bytes} value.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.fromBytes(new Uint8Array([128, 3, 131, ...]))\n * // @log: {\n * // @log: prefix: 4,\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * // @log: }\n * ```\n *\n * @param publicKey - The serialized public key.\n * @returns The deserialized public key.\n */\nexport function fromBytes(publicKey) {\n return fromHex(Hex.fromBytes(publicKey));\n}\n/**\n * Deserializes a {@link ox#PublicKey.PublicKey} from a {@link ox#Hex.Hex} value.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.fromHex('0x8318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5')\n * // @log: {\n * // @log: prefix: 4,\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * // @log: }\n * ```\n *\n * @example\n * ### Deserializing a Compressed Public Key\n *\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.fromHex('0x038318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed75')\n * // @log: {\n * // @log: prefix: 3,\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: }\n * ```\n *\n * @param publicKey - The serialized public key.\n * @returns The deserialized public key.\n */\nexport function fromHex(publicKey) {\n if (publicKey.length !== 132 &&\n publicKey.length !== 130 &&\n publicKey.length !== 68)\n throw new InvalidSerializedSizeError({ publicKey });\n if (publicKey.length === 130) {\n const x = BigInt(Hex.slice(publicKey, 0, 32));\n const y = BigInt(Hex.slice(publicKey, 32, 64));\n return {\n prefix: 4,\n x,\n y,\n };\n }\n if (publicKey.length === 132) {\n const prefix = Number(Hex.slice(publicKey, 0, 1));\n const x = BigInt(Hex.slice(publicKey, 1, 33));\n const y = BigInt(Hex.slice(publicKey, 33, 65));\n return {\n prefix,\n x,\n y,\n };\n }\n const prefix = Number(Hex.slice(publicKey, 0, 1));\n const x = BigInt(Hex.slice(publicKey, 1, 33));\n return {\n prefix,\n x,\n };\n}\n/**\n * Serializes a {@link ox#PublicKey.PublicKey} to {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.from({\n * prefix: 4,\n * x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * })\n *\n * const bytes = PublicKey.toBytes(publicKey) // [!code focus]\n * // @log: Uint8Array [128, 3, 131, ...]\n * ```\n *\n * @param publicKey - The public key to serialize.\n * @returns The serialized public key.\n */\nexport function toBytes(publicKey, options = {}) {\n return Bytes.fromHex(toHex(publicKey, options));\n}\n/**\n * Serializes a {@link ox#PublicKey.PublicKey} to {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.from({\n * prefix: 4,\n * x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * })\n *\n * const hex = PublicKey.toHex(publicKey) // [!code focus]\n * // @log: '0x048318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5'\n * ```\n *\n * @param publicKey - The public key to serialize.\n * @returns The serialized public key.\n */\nexport function toHex(publicKey, options = {}) {\n assert(publicKey);\n const { prefix, x, y } = publicKey;\n const { includePrefix = true } = options;\n const publicKey_ = Hex.concat(includePrefix ? Hex.fromNumber(prefix, { size: 1 }) : '0x', Hex.fromNumber(x, { size: 32 }), \n // If the public key is not compressed, add the y coordinate.\n typeof y === 'bigint' ? Hex.fromNumber(y, { size: 32 }) : '0x');\n return publicKey_;\n}\n/**\n * Validates a {@link ox#PublicKey.PublicKey}. Returns `true` if valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * const valid = PublicKey.validate({\n * prefix: 4,\n * y: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * })\n * // @log: false\n * ```\n *\n * @param publicKey - The public key object to assert.\n */\nexport function validate(publicKey, options = {}) {\n try {\n assert(publicKey, options);\n return true;\n }\n catch (_error) {\n return false;\n }\n}\n/**\n * Thrown when a public key is invalid.\n *\n * @example\n * ```ts twoslash\n * import { PublicKey } from 'ox'\n *\n * PublicKey.assert({ y: 1n })\n * // @error: PublicKey.InvalidError: Value `{\"y\":1n}` is not a valid public key.\n * // @error: Public key must contain:\n * // @error: - an `x` and `prefix` value (compressed)\n * // @error: - an `x`, `y`, and `prefix` value (uncompressed)\n * ```\n */\nexport class InvalidError extends Errors.BaseError {\n constructor({ publicKey }) {\n super(`Value \\`${Json.stringify(publicKey)}\\` is not a valid public key.`, {\n metaMessages: [\n 'Public key must contain:',\n '- an `x` and `prefix` value (compressed)',\n '- an `x`, `y`, and `prefix` value (uncompressed)',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'PublicKey.InvalidError'\n });\n }\n}\n/** Thrown when a public key has an invalid prefix. */\nexport class InvalidPrefixError extends Errors.BaseError {\n constructor({ prefix, cause }) {\n super(`Prefix \"${prefix}\" is invalid.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'PublicKey.InvalidPrefixError'\n });\n }\n}\n/** Thrown when the public key has an invalid prefix for a compressed public key. */\nexport class InvalidCompressedPrefixError extends Errors.BaseError {\n constructor() {\n super('Prefix must be 2 or 3 for compressed public keys.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'PublicKey.InvalidCompressedPrefixError'\n });\n }\n}\n/** Thrown when the public key has an invalid prefix for an uncompressed public key. */\nexport class InvalidUncompressedPrefixError extends Errors.BaseError {\n constructor() {\n super('Prefix must be 4 for uncompressed public keys.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'PublicKey.InvalidUncompressedPrefixError'\n });\n }\n}\n/** Thrown when the public key has an invalid serialized size. */\nexport class InvalidSerializedSizeError extends Errors.BaseError {\n constructor({ publicKey }) {\n super(`Value \\`${publicKey}\\` is an invalid public key size.`, {\n metaMessages: [\n 'Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).',\n `Received ${Hex.size(Hex.from(publicKey))} bytes.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'PublicKey.InvalidSerializedSizeError'\n });\n }\n}\n//# sourceMappingURL=PublicKey.js.map","import * as Bytes from './Bytes.js';\nimport * as Caches from './Caches.js';\nimport * as Errors from './Errors.js';\nimport * as Hash from './Hash.js';\nimport * as PublicKey from './PublicKey.js';\nconst addressRegex = /^0x[a-fA-F0-9]{40}$/;\n/**\n * Asserts that the given value is a valid {@link ox#Address.Address}.\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.assert('0xA0Cf798816D4b9b9866b5330EEa46a18382f251e')\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.assert('0xdeadbeef')\n * // @error: InvalidAddressError: Address \"0xdeadbeef\" is invalid.\n * ```\n *\n * @param value - Value to assert if it is a valid address.\n * @param options - Assertion options.\n */\nexport function assert(value, options = {}) {\n const { strict = true } = options;\n if (!addressRegex.test(value))\n throw new InvalidAddressError({\n address: value,\n cause: new InvalidInputError(),\n });\n if (strict) {\n if (value.toLowerCase() === value)\n return;\n if (checksum(value) !== value)\n throw new InvalidAddressError({\n address: value,\n cause: new InvalidChecksumError(),\n });\n }\n}\n/**\n * Computes the checksum address for the given {@link ox#Address.Address}.\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.checksum('0xa0cf798816d4b9b9866b5330eea46a18382f251e')\n * // @log: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'\n * ```\n *\n * @param address - The address to compute the checksum for.\n * @returns The checksummed address.\n */\nexport function checksum(address) {\n if (Caches.checksum.has(address))\n return Caches.checksum.get(address);\n assert(address, { strict: false });\n const hexAddress = address.substring(2).toLowerCase();\n const hash = Hash.keccak256(Bytes.fromString(hexAddress), { as: 'Bytes' });\n const characters = hexAddress.split('');\n for (let i = 0; i < 40; i += 2) {\n if (hash[i >> 1] >> 4 >= 8 && characters[i]) {\n characters[i] = characters[i].toUpperCase();\n }\n if ((hash[i >> 1] & 0x0f) >= 8 && characters[i + 1]) {\n characters[i + 1] = characters[i + 1].toUpperCase();\n }\n }\n const result = `0x${characters.join('')}`;\n Caches.checksum.set(address, result);\n return result;\n}\n/**\n * Converts a stringified address to a typed (checksummed) {@link ox#Address.Address}.\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.from('0xa0cf798816d4b9b9866b5330eea46a18382f251e')\n * // @log: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.from('0xa0cf798816d4b9b9866b5330eea46a18382f251e', {\n * checksum: false\n * })\n * // @log: '0xa0cf798816d4b9b9866b5330eea46a18382f251e'\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.from('hello')\n * // @error: InvalidAddressError: Address \"0xa\" is invalid.\n * ```\n *\n * @param address - An address string to convert to a typed Address.\n * @param options - Conversion options.\n * @returns The typed Address.\n */\nexport function from(address, options = {}) {\n const { checksum: checksumVal = false } = options;\n assert(address);\n if (checksumVal)\n return checksum(address);\n return address;\n}\n/**\n * Converts an ECDSA public key to an {@link ox#Address.Address}.\n *\n * @example\n * ```ts twoslash\n * import { Address, PublicKey } from 'ox'\n *\n * const publicKey = PublicKey.from(\n * '0x048318535b54105d4a7aae60c08fc45f9687181b4fdfc625bd1a753fa7397fed753547f11ca8696646f2f3acb08e31016afac23e630c5d11f59f61fef57b0d2aa5',\n * )\n * const address = Address.fromPublicKey(publicKey)\n * // @log: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'\n * ```\n *\n * @param publicKey - The ECDSA public key to convert to an {@link ox#Address.Address}.\n * @param options - Conversion options.\n * @returns The {@link ox#Address.Address} corresponding to the public key.\n */\nexport function fromPublicKey(publicKey, options = {}) {\n const address = Hash.keccak256(`0x${PublicKey.toHex(publicKey).slice(4)}`).substring(26);\n return from(`0x${address}`, options);\n}\n/**\n * Checks if two {@link ox#Address.Address} are equal.\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.isEqual(\n * '0xa0cf798816d4b9b9866b5330eea46a18382f251e',\n * '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'\n * )\n * // @log: true\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.isEqual(\n * '0xa0cf798816d4b9b9866b5330eea46a18382f251e',\n * '0xA0Cf798816D4b9b9866b5330EEa46a18382f251f'\n * )\n * // @log: false\n * ```\n *\n * @param addressA - The first address to compare.\n * @param addressB - The second address to compare.\n * @returns Whether the addresses are equal.\n */\nexport function isEqual(addressA, addressB) {\n assert(addressA, { strict: false });\n assert(addressB, { strict: false });\n return addressA.toLowerCase() === addressB.toLowerCase();\n}\n/**\n * Checks if the given address is a valid {@link ox#Address.Address}.\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.validate('0xA0Cf798816D4b9b9866b5330EEa46a18382f251e')\n * // @log: true\n * ```\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.validate('0xdeadbeef')\n * // @log: false\n * ```\n *\n * @param address - Value to check if it is a valid address.\n * @param options - Check options.\n * @returns Whether the address is a valid address.\n */\nexport function validate(address, options = {}) {\n const { strict = true } = options ?? {};\n try {\n assert(address, { strict });\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * Thrown when an address is invalid.\n *\n * @example\n * ```ts twoslash\n * import { Address } from 'ox'\n *\n * Address.from('0x123')\n * // @error: Address.InvalidAddressError: Address `0x123` is invalid.\n * ```\n */\nexport class InvalidAddressError extends Errors.BaseError {\n constructor({ address, cause }) {\n super(`Address \"${address}\" is invalid.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Address.InvalidAddressError'\n });\n }\n}\n/** Thrown when an address is not a 20 byte (40 hexadecimal character) value. */\nexport class InvalidInputError extends Errors.BaseError {\n constructor() {\n super('Address is not a 20 byte (40 hexadecimal character) value.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Address.InvalidInputError'\n });\n }\n}\n/** Thrown when an address does not match its checksum counterpart. */\nexport class InvalidChecksumError extends Errors.BaseError {\n constructor() {\n super('Address does not match its checksum counterpart.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Address.InvalidChecksumError'\n });\n }\n}\n//# sourceMappingURL=Address.js.map","export const arrayRegex = /^(.*)\\[([0-9]*)\\]$/;\n// `bytes<M>`: binary type of `M` bytes, `0 < M <= 32`\n// https://regexr.com/6va55\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\n// `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n// https://regexr.com/6v8hp\nexport const integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\nexport const maxInt8 = 2n ** (8n - 1n) - 1n;\nexport const maxInt16 = 2n ** (16n - 1n) - 1n;\nexport const maxInt24 = 2n ** (24n - 1n) - 1n;\nexport const maxInt32 = 2n ** (32n - 1n) - 1n;\nexport const maxInt40 = 2n ** (40n - 1n) - 1n;\nexport const maxInt48 = 2n ** (48n - 1n) - 1n;\nexport const maxInt56 = 2n ** (56n - 1n) - 1n;\nexport const maxInt64 = 2n ** (64n - 1n) - 1n;\nexport const maxInt72 = 2n ** (72n - 1n) - 1n;\nexport const maxInt80 = 2n ** (80n - 1n) - 1n;\nexport const maxInt88 = 2n ** (88n - 1n) - 1n;\nexport const maxInt96 = 2n ** (96n - 1n) - 1n;\nexport const maxInt104 = 2n ** (104n - 1n) - 1n;\nexport const maxInt112 = 2n ** (112n - 1n) - 1n;\nexport const maxInt120 = 2n ** (120n - 1n) - 1n;\nexport const maxInt128 = 2n ** (128n - 1n) - 1n;\nexport const maxInt136 = 2n ** (136n - 1n) - 1n;\nexport const maxInt144 = 2n ** (144n - 1n) - 1n;\nexport const maxInt152 = 2n ** (152n - 1n) - 1n;\nexport const maxInt160 = 2n ** (160n - 1n) - 1n;\nexport const maxInt168 = 2n ** (168n - 1n) - 1n;\nexport const maxInt176 = 2n ** (176n - 1n) - 1n;\nexport const maxInt184 = 2n ** (184n - 1n) - 1n;\nexport const maxInt192 = 2n ** (192n - 1n) - 1n;\nexport const maxInt200 = 2n ** (200n - 1n) - 1n;\nexport const maxInt208 = 2n ** (208n - 1n) - 1n;\nexport const maxInt216 = 2n ** (216n - 1n) - 1n;\nexport const maxInt224 = 2n ** (224n - 1n) - 1n;\nexport const maxInt232 = 2n ** (232n - 1n) - 1n;\nexport const maxInt240 = 2n ** (240n - 1n) - 1n;\nexport const maxInt248 = 2n ** (248n - 1n) - 1n;\nexport const maxInt256 = 2n ** (256n - 1n) - 1n;\nexport const minInt8 = -(2n ** (8n - 1n));\nexport const minInt16 = -(2n ** (16n - 1n));\nexport const minInt24 = -(2n ** (24n - 1n));\nexport const minInt32 = -(2n ** (32n - 1n));\nexport const minInt40 = -(2n ** (40n - 1n));\nexport const minInt48 = -(2n ** (48n - 1n));\nexport const minInt56 = -(2n ** (56n - 1n));\nexport const minInt64 = -(2n ** (64n - 1n));\nexport const minInt72 = -(2n ** (72n - 1n));\nexport const minInt80 = -(2n ** (80n - 1n));\nexport const minInt88 = -(2n ** (88n - 1n));\nexport const minInt96 = -(2n ** (96n - 1n));\nexport const minInt104 = -(2n ** (104n - 1n));\nexport const minInt112 = -(2n ** (112n - 1n));\nexport const minInt120 = -(2n ** (120n - 1n));\nexport const minInt128 = -(2n ** (128n - 1n));\nexport const minInt136 = -(2n ** (136n - 1n));\nexport const minInt144 = -(2n ** (144n - 1n));\nexport const minInt152 = -(2n ** (152n - 1n));\nexport const minInt160 = -(2n ** (160n - 1n));\nexport const minInt168 = -(2n ** (168n - 1n));\nexport const minInt176 = -(2n ** (176n - 1n));\nexport const minInt184 = -(2n ** (184n - 1n));\nexport const minInt192 = -(2n ** (192n - 1n));\nexport const minInt200 = -(2n ** (200n - 1n));\nexport const minInt208 = -(2n ** (208n - 1n));\nexport const minInt216 = -(2n ** (216n - 1n));\nexport const minInt224 = -(2n ** (224n - 1n));\nexport const minInt232 = -(2n ** (232n - 1n));\nexport const minInt240 = -(2n ** (240n - 1n));\nexport const minInt248 = -(2n ** (248n - 1n));\nexport const minInt256 = -(2n ** (256n - 1n));\nexport const maxUint8 = 2n ** 8n - 1n;\nexport const maxUint16 = 2n ** 16n - 1n;\nexport const maxUint24 = 2n ** 24n - 1n;\nexport const maxUint32 = 2n ** 32n - 1n;\nexport const maxUint40 = 2n ** 40n - 1n;\nexport const maxUint48 = 2n ** 48n - 1n;\nexport const maxUint56 = 2n ** 56n - 1n;\nexport const maxUint64 = 2n ** 64n - 1n;\nexport const maxUint72 = 2n ** 72n - 1n;\nexport const maxUint80 = 2n ** 80n - 1n;\nexport const maxUint88 = 2n ** 88n - 1n;\nexport const maxUint96 = 2n ** 96n - 1n;\nexport const maxUint104 = 2n ** 104n - 1n;\nexport const maxUint112 = 2n ** 112n - 1n;\nexport const maxUint120 = 2n ** 120n - 1n;\nexport const maxUint128 = 2n ** 128n - 1n;\nexport const maxUint136 = 2n ** 136n - 1n;\nexport const maxUint144 = 2n ** 144n - 1n;\nexport const maxUint152 = 2n ** 152n - 1n;\nexport const maxUint160 = 2n ** 160n - 1n;\nexport const maxUint168 = 2n ** 168n - 1n;\nexport const maxUint176 = 2n ** 176n - 1n;\nexport const maxUint184 = 2n ** 184n - 1n;\nexport const maxUint192 = 2n ** 192n - 1n;\nexport const maxUint200 = 2n ** 200n - 1n;\nexport const maxUint208 = 2n ** 208n - 1n;\nexport const maxUint216 = 2n ** 216n - 1n;\nexport const maxUint224 = 2n ** 224n - 1n;\nexport const maxUint232 = 2n ** 232n - 1n;\nexport const maxUint240 = 2n ** 240n - 1n;\nexport const maxUint248 = 2n ** 248n - 1n;\nexport const maxUint256 = 2n ** 256n - 1n;\n//# sourceMappingURL=Solidity.js.map","import * as AbiParameters from '../AbiParameters.js';\nimport * as Address from '../Address.js';\nimport * as Bytes from '../Bytes.js';\nimport * as Errors from '../Errors.js';\nimport * as Hex from '../Hex.js';\nimport { integerRegex } from '../Solidity.js';\n/** @internal */\nexport function decodeParameter(cursor, param, options) {\n const { checksumAddress, staticPosition } = options;\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return decodeArray(cursor, { ...param, type }, { checksumAddress, length, staticPosition });\n }\n if (param.type === 'tuple')\n return decodeTuple(cursor, param, {\n checksumAddress,\n staticPosition,\n });\n if (param.type === 'address')\n return decodeAddress(cursor, { checksum: checksumAddress });\n if (param.type === 'bool')\n return decodeBool(cursor);\n if (param.type.startsWith('bytes'))\n return decodeBytes(cursor, param, { staticPosition });\n if (param.type.startsWith('uint') || param.type.startsWith('int'))\n return decodeNumber(cursor, param);\n if (param.type === 'string')\n return decodeString(cursor, { staticPosition });\n throw new AbiParameters.InvalidTypeError(param.type);\n}\nconst sizeOfLength = 32;\nconst sizeOfOffset = 32;\n/** @internal */\nexport function decodeAddress(cursor, options = {}) {\n const { checksum = false } = options;\n const value = cursor.readBytes(32);\n const wrap = (address) => checksum ? Address.checksum(address) : address;\n return [wrap(Hex.fromBytes(Bytes.slice(value, -20))), 32];\n}\n/** @internal */\nexport function decodeArray(cursor, param, options) {\n const { checksumAddress, length, staticPosition } = options;\n // If the length of the array is not known in advance (dynamic array),\n // this means we will need to wonder off to the pointer and decode.\n if (!length) {\n // Dealing with a dynamic type, so get the offset of the array data.\n const offset = Bytes.toNumber(cursor.readBytes(sizeOfOffset));\n // Start is the static position of current slot + offset.\n const start = staticPosition + offset;\n const startOfData = start + sizeOfLength;\n // Get the length of the array from the offset.\n cursor.setPosition(start);\n const length = Bytes.toNumber(cursor.readBytes(sizeOfLength));\n // Check if the array has any dynamic children.\n const dynamicChild = hasDynamicChild(param);\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n // If any of the children is dynamic, then all elements will be offset pointer, thus size of one slot (32 bytes).\n // Otherwise, elements will be the size of their encoding (consumed bytes).\n cursor.setPosition(startOfData + (dynamicChild ? i * 32 : consumed));\n const [data, consumed_] = decodeParameter(cursor, param, {\n checksumAddress,\n staticPosition: startOfData,\n });\n consumed += consumed_;\n value.push(data);\n }\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n }\n // If the length of the array is known in advance,\n // and the length of an element deeply nested in the array is not known,\n // we need to decode the offset of the array data.\n if (hasDynamicChild(param)) {\n // Dealing with dynamic types, so get the offset of the array data.\n const offset = Bytes.toNumber(cursor.readBytes(sizeOfOffset));\n // Start is the static position of current slot + offset.\n const start = staticPosition + offset;\n const value = [];\n for (let i = 0; i < length; ++i) {\n // Move cursor along to the next slot (next offset pointer).\n cursor.setPosition(start + i * 32);\n const [data] = decodeParameter(cursor, param, {\n checksumAddress,\n staticPosition: start,\n });\n value.push(data);\n }\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n }\n // If the length of the array is known in advance and the array is deeply static,\n // then we can just decode each element in sequence.\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const [data, consumed_] = decodeParameter(cursor, param, {\n checksumAddress,\n staticPosition: staticPosition + consumed,\n });\n consumed += consumed_;\n value.push(data);\n }\n return [value, consumed];\n}\n/** @internal */\nexport function decodeBool(cursor) {\n return [Bytes.toBoolean(cursor.readBytes(32), { size: 32 }), 32];\n}\n/** @internal */\nexport function decodeBytes(cursor, param, { staticPosition }) {\n const [_, size] = param.type.split('bytes');\n if (!size) {\n // Dealing with dynamic types, so get the offset of the bytes data.\n const offset = Bytes.toNumber(cursor.readBytes(32));\n // Set position of the cursor to start of bytes data.\n cursor.setPosition(staticPosition + offset);\n const length = Bytes.toNumber(cursor.readBytes(32));\n // If there is no length, we have zero data.\n if (length === 0) {\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return ['0x', 32];\n }\n const data = cursor.readBytes(length);\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [Hex.fromBytes(data), 32];\n }\n const value = Hex.fromBytes(cursor.readBytes(Number.parseInt(size, 10), 32));\n return [value, 32];\n}\n/** @internal */\nexport function decodeNumber(cursor, param) {\n const signed = param.type.startsWith('int');\n const size = Number.parseInt(param.type.split('int')[1] || '256', 10);\n const value = cursor.readBytes(32);\n return [\n size > 48\n ? Bytes.toBigInt(value, { signed })\n : Bytes.toNumber(value, { signed }),\n 32,\n ];\n}\n/** @internal */\nexport function decodeTuple(cursor, param, options) {\n const { checksumAddress, staticPosition } = options;\n // Tuples can have unnamed components (i.e. they are arrays), so we must\n // determine whether the tuple is named or unnamed. In the case of a named\n // tuple, the value will be an object where each property is the name of the\n // component. In the case of an unnamed tuple, the value will be an array.\n const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);\n // Initialize the value to an object or an array, depending on whether the\n // tuple is named or unnamed.\n const value = hasUnnamedChild ? [] : {};\n let consumed = 0;\n // If the tuple has a dynamic child, we must first decode the offset to the\n // tuple data.\n if (hasDynamicChild(param)) {\n // Dealing with dynamic types, so get the offset of the tuple data.\n const offset = Bytes.toNumber(cursor.readBytes(sizeOfOffset));\n // Start is the static position of referencing slot + offset.\n const start = staticPosition + offset;\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n cursor.setPosition(start + consumed);\n const [data, consumed_] = decodeParameter(cursor, component, {\n checksumAddress,\n staticPosition: start,\n });\n consumed += consumed_;\n value[hasUnnamedChild ? i : component?.name] = data;\n }\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n }\n // If the tuple has static children, we can just decode each component\n // in sequence.\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n const [data, consumed_] = decodeParameter(cursor, component, {\n checksumAddress,\n staticPosition,\n });\n value[hasUnnamedChild ? i : component?.name] = data;\n consumed += consumed_;\n }\n return [value, consumed];\n}\n/** @internal */\nexport function decodeString(cursor, { staticPosition }) {\n // Get offset to start of string data.\n const offset = Bytes.toNumber(cursor.readBytes(32));\n // Start is the static position of current slot + offset.\n const start = staticPosition + offset;\n cursor.setPosition(start);\n const length = Bytes.toNumber(cursor.readBytes(32));\n // If there is no length, we have zero data (empty string).\n if (length === 0) {\n cursor.setPosition(staticPosition + 32);\n return ['', 32];\n }\n const data = cursor.readBytes(length, 32);\n const value = Bytes.toString(Bytes.trimLeft(data));\n // As we have gone wondering, restore to the original position + next slot.\n cursor.setPosition(staticPosition + 32);\n return [value, 32];\n}\n/** @internal */\nexport function prepareParameters({ checksumAddress, parameters, values, }) {\n const preparedParameters = [];\n for (let i = 0; i < parameters.length; i++) {\n preparedParameters.push(prepareParameter({\n checksumAddress,\n parameter: parameters[i],\n value: values[i],\n }));\n }\n return preparedParameters;\n}\n/** @internal */\nexport function prepareParameter({ checksumAddress = false, parameter: parameter_, value, }) {\n const parameter = parameter_;\n const arrayComponents = getArrayComponents(parameter.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return encodeArray(value, {\n checksumAddress,\n length,\n parameter: {\n ...parameter,\n type,\n },\n });\n }\n if (parameter.type === 'tuple') {\n return encodeTuple(value, {\n checksumAddress,\n parameter: parameter,\n });\n }\n if (parameter.type === 'address') {\n return encodeAddress(value, {\n checksum: checksumAddress,\n });\n }\n if (parameter.type === 'bool') {\n return encodeBoolean(value);\n }\n if (parameter.type.startsWith('uint') || parameter.type.startsWith('int')) {\n const signed = parameter.type.startsWith('int');\n const [, , size = '256'] = integerRegex.exec(parameter.type) ?? [];\n return encodeNumber(value, {\n signed,\n size: Number(size),\n });\n }\n if (parameter.type.startsWith('bytes')) {\n return encodeBytes(value, { type: parameter.type });\n }\n if (parameter.type === 'string') {\n return encodeString(value);\n }\n throw new AbiParameters.InvalidTypeError(parameter.type);\n}\n/** @internal */\nexport function encode(preparedParameters) {\n // 1. Compute the size of the static part of the parameters.\n let staticSize = 0;\n for (let i = 0; i < preparedParameters.length; i++) {\n const { dynamic, encoded } = preparedParameters[i];\n if (dynamic)\n staticSize += 32;\n else\n staticSize += Hex.size(encoded);\n }\n // 2. Split the parameters into static and dynamic parts.\n const staticParameters = [];\n const dynamicParameters = [];\n let dynamicSize = 0;\n for (let i = 0; i < preparedParameters.length; i++) {\n const { dynamic, encoded } = preparedParameters[i];\n if (dynamic) {\n staticParameters.push(Hex.fromNumber(staticSize + dynamicSize, { size: 32 }));\n dynamicParameters.push(encoded);\n dynamicSize += Hex.size(encoded);\n }\n else {\n staticParameters.push(encoded);\n }\n }\n // 3. Concatenate static and dynamic parts.\n return Hex.concat(...staticParameters, ...dynamicParameters);\n}\n/** @internal */\nexport function encodeAddress(value, options) {\n const { checksum = false } = options;\n Address.assert(value, { strict: checksum });\n return {\n dynamic: false,\n encoded: Hex.padLeft(value.toLowerCase()),\n };\n}\n/** @internal */\nexport function encodeArray(value, options) {\n const { checksumAddress, length, parameter } = options;\n const dynamic = length === null;\n if (!Array.isArray(value))\n throw new AbiParameters.InvalidArrayError(value);\n if (!dynamic && value.length !== length)\n throw new AbiParameters.ArrayLengthMismatchError({\n expectedLength: length,\n givenLength: value.length,\n type: `${parameter.type}[${length}]`,\n });\n let dynamicChild = false;\n const preparedParameters = [];\n for (let i = 0; i < value.length; i++) {\n const preparedParam = prepareParameter({\n checksumAddress,\n parameter,\n value: value[i],\n });\n if (preparedParam.dynamic)\n dynamicChild = true;\n preparedParameters.push(preparedParam);\n }\n if (dynamic || dynamicChild) {\n const data = encode(preparedParameters);\n if (dynamic) {\n const length = Hex.fromNumber(preparedParameters.length, { size: 32 });\n return {\n dynamic: true,\n encoded: preparedParameters.length > 0 ? Hex.concat(length, data) : length,\n };\n }\n if (dynamicChild)\n return { dynamic: true, encoded: data };\n }\n return {\n dynamic: false,\n encoded: Hex.concat(...preparedParameters.map(({ encoded }) => encoded)),\n };\n}\n/** @internal */\nexport function encodeBytes(value, { type }) {\n const [, parametersize] = type.split('bytes');\n const bytesSize = Hex.size(value);\n if (!parametersize) {\n let value_ = value;\n // If the size is not divisible by 32 bytes, pad the end\n // with empty bytes to the ceiling 32 bytes.\n if (bytesSize % 32 !== 0)\n value_ = Hex.padRight(value_, Math.ceil((value.length - 2) / 2 / 32) * 32);\n return {\n dynamic: true,\n encoded: Hex.concat(Hex.padLeft(Hex.fromNumber(bytesSize, { size: 32 })), value_),\n };\n }\n if (bytesSize !== Number.parseInt(parametersize, 10))\n throw new AbiParameters.BytesSizeMismatchError({\n expectedSize: Number.parseInt(parametersize, 10),\n value,\n });\n return { dynamic: false, encoded: Hex.padRight(value) };\n}\n/** @internal */\nexport function encodeBoolean(value) {\n if (typeof value !== 'boolean')\n throw new Errors.BaseError(`Invalid boolean value: \"${value}\" (type: ${typeof value}). Expected: \\`true\\` or \\`false\\`.`);\n return { dynamic: false, encoded: Hex.padLeft(Hex.fromBoolean(value)) };\n}\n/** @internal */\nexport function encodeNumber(value, { signed, size }) {\n if (typeof size === 'number') {\n const max = 2n ** (BigInt(size) - (signed ? 1n : 0n)) - 1n;\n const min = signed ? -max - 1n : 0n;\n if (value > max || value < min)\n throw new Hex.IntegerOutOfRangeError({\n max: max.toString(),\n min: min.toString(),\n signed,\n size: size / 8,\n value: value.toString(),\n });\n }\n return {\n dynamic: false,\n encoded: Hex.fromNumber(value, {\n size: 32,\n signed,\n }),\n };\n}\n/** @internal */\nexport function encodeString(value) {\n const hexValue = Hex.fromString(value);\n const partsLength = Math.ceil(Hex.size(hexValue) / 32);\n const parts = [];\n for (let i = 0; i < partsLength; i++) {\n parts.push(Hex.padRight(Hex.slice(hexValue, i * 32, (i + 1) * 32)));\n }\n return {\n dynamic: true,\n encoded: Hex.concat(Hex.padRight(Hex.fromNumber(Hex.size(hexValue), { size: 32 })), ...parts),\n };\n}\n/** @internal */\nexport function encodeTuple(value, options) {\n const { checksumAddress, parameter } = options;\n let dynamic = false;\n const preparedParameters = [];\n for (let i = 0; i < parameter.components.length; i++) {\n const param_ = parameter.components[i];\n const index = Array.isArray(value) ? i : param_.name;\n const preparedParam = prepareParameter({\n checksumAddress,\n parameter: param_,\n value: value[index],\n });\n preparedParameters.push(preparedParam);\n if (preparedParam.dynamic)\n dynamic = true;\n }\n return {\n dynamic,\n encoded: dynamic\n ? encode(preparedParameters)\n : Hex.concat(...preparedParameters.map(({ encoded }) => encoded)),\n };\n}\n/** @internal */\nexport function getArrayComponents(type) {\n const matches = type.match(/^(.*)\\[(\\d+)?\\]$/);\n return matches\n ? // Return `null` if the array is dynamic.\n [matches[2] ? Number(matches[2]) : null, matches[1]]\n : undefined;\n}\n/** @internal */\nexport function hasDynamicChild(param) {\n const { type } = param;\n if (type === 'string')\n return true;\n if (type === 'bytes')\n return true;\n if (type.endsWith('[]'))\n return true;\n if (type === 'tuple')\n return param.components?.some(hasDynamicChild);\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents &&\n hasDynamicChild({\n ...param,\n type: arrayComponents[1],\n }))\n return true;\n return false;\n}\n//# sourceMappingURL=abiParameters.js.map","import * as Errors from '../Errors.js';\nconst staticCursor = {\n bytes: new Uint8Array(),\n dataView: new DataView(new ArrayBuffer(0)),\n position: 0,\n positionReadCount: new Map(),\n recursiveReadCount: 0,\n recursiveReadLimit: Number.POSITIVE_INFINITY,\n assertReadLimit() {\n if (this.recursiveReadCount >= this.recursiveReadLimit)\n throw new RecursiveReadLimitExceededError({\n count: this.recursiveReadCount + 1,\n limit: this.recursiveReadLimit,\n });\n },\n assertPosition(position) {\n if (position < 0 || position > this.bytes.length - 1)\n throw new PositionOutOfBoundsError({\n length: this.bytes.length,\n position,\n });\n },\n decrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position - offset;\n this.assertPosition(position);\n this.position = position;\n },\n getReadCount(position) {\n return this.positionReadCount.get(position || this.position) || 0;\n },\n incrementPosition(offset) {\n if (offset < 0)\n throw new NegativeOffsetError({ offset });\n const position = this.position + offset;\n this.assertPosition(position);\n this.position = position;\n },\n inspectByte(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectBytes(length, position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + length - 1);\n return this.bytes.subarray(position, position + length);\n },\n inspectUint8(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position);\n return this.bytes[position];\n },\n inspectUint16(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 1);\n return this.dataView.getUint16(position);\n },\n inspectUint24(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 2);\n return ((this.dataView.getUint16(position) << 8) +\n this.dataView.getUint8(position + 2));\n },\n inspectUint32(position_) {\n const position = position_ ?? this.position;\n this.assertPosition(position + 3);\n return this.dataView.getUint32(position);\n },\n pushByte(byte) {\n this.assertPosition(this.position);\n this.bytes[this.position] = byte;\n this.position++;\n },\n pushBytes(bytes) {\n this.assertPosition(this.position + bytes.length - 1);\n this.bytes.set(bytes, this.position);\n this.position += bytes.length;\n },\n pushUint8(value) {\n this.assertPosition(this.position);\n this.bytes[this.position] = value;\n this.position++;\n },\n pushUint16(value) {\n this.assertPosition(this.position + 1);\n this.dataView.setUint16(this.position, value);\n this.position += 2;\n },\n pushUint24(value) {\n this.assertPosition(this.position + 2);\n this.dataView.setUint16(this.position, value >> 8);\n this.dataView.setUint8(this.position + 2, value & ~4294967040);\n this.position += 3;\n },\n pushUint32(value) {\n this.assertPosition(this.position + 3);\n this.dataView.setUint32(this.position, value);\n this.position += 4;\n },\n readByte() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectByte();\n this.position++;\n return value;\n },\n readBytes(length, size) {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectBytes(length);\n this.position += size ?? length;\n return value;\n },\n readUint8() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint8();\n this.position += 1;\n return value;\n },\n readUint16() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint16();\n this.position += 2;\n return value;\n },\n readUint24() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint24();\n this.position += 3;\n return value;\n },\n readUint32() {\n this.assertReadLimit();\n this._touch();\n const value = this.inspectUint32();\n this.position += 4;\n return value;\n },\n get remaining() {\n return this.bytes.length - this.position;\n },\n setPosition(position) {\n const oldPosition = this.position;\n this.assertPosition(position);\n this.position = position;\n return () => (this.position = oldPosition);\n },\n _touch() {\n if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)\n return;\n const count = this.getReadCount();\n this.positionReadCount.set(this.position, count + 1);\n if (count > 0)\n this.recursiveReadCount++;\n },\n};\n/** @internal */\nexport function create(bytes, { recursiveReadLimit = 8_192 } = {}) {\n const cursor = Object.create(staticCursor);\n cursor.bytes = bytes;\n cursor.dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n cursor.positionReadCount = new Map();\n cursor.recursiveReadLimit = recursiveReadLimit;\n return cursor;\n}\n/** @internal */\nexport class NegativeOffsetError extends Errors.BaseError {\n constructor({ offset }) {\n super(`Offset \\`${offset}\\` cannot be negative.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Cursor.NegativeOffsetError'\n });\n }\n}\n/** @internal */\nexport class PositionOutOfBoundsError extends Errors.BaseError {\n constructor({ length, position }) {\n super(`Position \\`${position}\\` is out of bounds (\\`0 < position < ${length}\\`).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Cursor.PositionOutOfBoundsError'\n });\n }\n}\n/** @internal */\nexport class RecursiveReadLimitExceededError extends Errors.BaseError {\n constructor({ count, limit }) {\n super(`Recursive read limit of \\`${limit}\\` exceeded (recursive read count: \\`${count}\\`).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Cursor.RecursiveReadLimitExceededError'\n });\n }\n}\n//# sourceMappingURL=cursor.js.map","import * as abitype from 'abitype';\nimport * as Address from './Address.js';\nimport * as Bytes from './Bytes.js';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport * as internal from './internal/abiParameters.js';\nimport * as Cursor from './internal/cursor.js';\nimport * as Solidity from './Solidity.js';\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function decode(parameters, data, options = {}) {\n const { as = 'Array', checksumAddress = false } = options;\n const bytes = typeof data === 'string' ? Bytes.fromHex(data) : data;\n const cursor = Cursor.create(bytes);\n if (Bytes.size(bytes) === 0 && parameters.length > 0)\n throw new ZeroDataError();\n if (Bytes.size(bytes) && Bytes.size(bytes) < 32)\n throw new DataSizeTooSmallError({\n data: typeof data === 'string' ? data : Hex.fromBytes(data),\n parameters: parameters,\n size: Bytes.size(bytes),\n });\n let consumed = 0;\n const values = as === 'Array' ? [] : {};\n for (let i = 0; i < parameters.length; ++i) {\n const param = parameters[i];\n cursor.setPosition(consumed);\n const [data, consumed_] = internal.decodeParameter(cursor, param, {\n checksumAddress,\n staticPosition: 0,\n });\n consumed += consumed_;\n if (as === 'Array')\n values.push(data);\n else\n values[param.name ?? i] = data;\n }\n return values;\n}\n/**\n * Encodes primitive values into ABI encoded data as per the [Application Binary Interface (ABI) Specification](https://docs.soliditylang.org/en/latest/abi-spec).\n *\n * @example\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * const data = AbiParameters.encode(\n * AbiParameters.from(['string', 'uint', 'bool']),\n * ['wagmi', 420n, true],\n * )\n * ```\n *\n * @example\n * ### JSON Parameters\n *\n * Specify **JSON ABI** Parameters as schema:\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * const data = AbiParameters.encode(\n * [\n * { type: 'string', name: 'name' },\n * { type: 'uint', name: 'age' },\n * { type: 'bool', name: 'isOwner' },\n * ],\n * ['wagmi', 420n, true],\n * )\n * ```\n *\n * @param parameters - The set of ABI parameters to encode, in the shape of the `inputs` or `outputs` attribute of an ABI Item. These parameters must include valid [ABI types](https://docs.soliditylang.org/en/latest/types.html).\n * @param values - The set of primitive values that correspond to the ABI types defined in `parameters`.\n * @returns ABI encoded data.\n */\nexport function encode(parameters, values, options) {\n const { checksumAddress = false } = options ?? {};\n if (parameters.length !== values.length)\n throw new LengthMismatchError({\n expectedLength: parameters.length,\n givenLength: values.length,\n });\n // Prepare the parameters to determine dynamic types to encode.\n const preparedParameters = internal.prepareParameters({\n checksumAddress,\n parameters: parameters,\n values: values,\n });\n const data = internal.encode(preparedParameters);\n if (data.length === 0)\n return '0x';\n return data;\n}\n/**\n * Encodes an array of primitive values to a [packed ABI encoding](https://docs.soliditylang.org/en/latest/abi-spec.html#non-standard-packed-mode).\n *\n * @example\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * const encoded = AbiParameters.encodePacked(\n * ['address', 'string'],\n * ['0xd8da6bf26964af9d7eed9e03e53415d37aa96045', 'hello world'],\n * )\n * // @log: '0xd8da6bf26964af9d7eed9e03e53415d37aa9604568656c6c6f20776f726c64'\n * ```\n *\n * @param types - Set of ABI types to pack encode.\n * @param values - The set of primitive values that correspond to the ABI types defined in `types`.\n * @returns The encoded packed data.\n */\nexport function encodePacked(types, values) {\n if (types.length !== values.length)\n throw new LengthMismatchError({\n expectedLength: types.length,\n givenLength: values.length,\n });\n const data = [];\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n const value = values[i];\n data.push(encodePacked.encode(type, value));\n }\n return Hex.concat(...data);\n}\n(function (encodePacked) {\n // eslint-disable-next-line jsdoc/require-jsdoc\n function encode(type, value, isArray = false) {\n if (type === 'address') {\n const address = value;\n Address.assert(address);\n return Hex.padLeft(address.toLowerCase(), isArray ? 32 : 0);\n }\n if (type === 'string')\n return Hex.fromString(value);\n if (type === 'bytes')\n return value;\n if (type === 'bool')\n return Hex.padLeft(Hex.fromBoolean(value), isArray ? 32 : 1);\n const intMatch = type.match(Solidity.integerRegex);\n if (intMatch) {\n const [_type, baseType, bits = '256'] = intMatch;\n const size = Number.parseInt(bits, 10) / 8;\n return Hex.fromNumber(value, {\n size: isArray ? 32 : size,\n signed: baseType === 'int',\n });\n }\n const bytesMatch = type.match(Solidity.bytesRegex);\n if (bytesMatch) {\n const [_type, size] = bytesMatch;\n if (Number.parseInt(size, 10) !== (value.length - 2) / 2)\n throw new BytesSizeMismatchError({\n expectedSize: Number.parseInt(size, 10),\n value: value,\n });\n return Hex.padRight(value, isArray ? 32 : 0);\n }\n const arrayMatch = type.match(Solidity.arrayRegex);\n if (arrayMatch && Array.isArray(value)) {\n const [_type, childType] = arrayMatch;\n const data = [];\n for (let i = 0; i < value.length; i++) {\n data.push(encode(childType, value[i], true));\n }\n if (data.length === 0)\n return '0x';\n return Hex.concat(...data);\n }\n throw new InvalidTypeError(type);\n }\n encodePacked.encode = encode;\n})(encodePacked || (encodePacked = {}));\n/**\n * Formats {@link ox#AbiParameters.AbiParameters} into **Human Readable ABI Parameters**.\n *\n * @example\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * const formatted = AbiParameters.format([\n * {\n * name: 'spender',\n * type: 'address',\n * },\n * {\n * name: 'amount',\n * type: 'uint256',\n * },\n * ])\n *\n * formatted\n * // ^?\n *\n *\n * ```\n *\n * @param parameters - The ABI Parameters to format.\n * @returns The formatted ABI Parameters .\n */\nexport function format(parameters) {\n return abitype.formatAbiParameters(parameters);\n}\n/**\n * Parses arbitrary **JSON ABI Parameters** or **Human Readable ABI Parameters** into typed {@link ox#AbiParameters.AbiParameters}.\n *\n * @example\n * ### JSON Parameters\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * const parameters = AbiParameters.from([\n * {\n * name: 'spender',\n * type: 'address',\n * },\n * {\n * name: 'amount',\n * type: 'uint256',\n * },\n * ])\n *\n * parameters\n * //^?\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * ### Human Readable Parameters\n *\n * Human Readable ABI Parameters can be parsed into a typed {@link ox#AbiParameters.AbiParameters}:\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * const parameters = AbiParameters.from('address spender, uint256 amount')\n *\n * parameters\n * //^?\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * It is possible to specify `struct`s along with your definitions:\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * const parameters = AbiParameters.from([\n * 'struct Foo { address spender; uint256 amount; }', // [!code hl]\n * 'Foo foo, address bar',\n * ])\n *\n * parameters\n * //^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n *\n *\n * @param parameters - The ABI Parameters to parse.\n * @returns The typed ABI Parameters.\n */\nexport function from(parameters) {\n if (Array.isArray(parameters) && typeof parameters[0] === 'string')\n return abitype.parseAbiParameters(parameters);\n if (typeof parameters === 'string')\n return abitype.parseAbiParameters(parameters);\n return parameters;\n}\n/**\n * Throws when the data size is too small for the given parameters.\n *\n * @example\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * AbiParameters.decode([{ type: 'uint256' }], '0x010f')\n * // ↑ ❌ 2 bytes\n * // @error: AbiParameters.DataSizeTooSmallError: Data size of 2 bytes is too small for given parameters.\n * // @error: Params: (uint256)\n * // @error: Data: 0x010f (2 bytes)\n * ```\n *\n * ### Solution\n *\n * Pass a valid data size.\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * AbiParameters.decode([{ type: 'uint256' }], '0x00000000000000000000000000000000000000000000000000000000000010f')\n * // ↑ ✅ 32 bytes\n * ```\n */\nexport class DataSizeTooSmallError extends Errors.BaseError {\n constructor({ data, parameters, size, }) {\n super(`Data size of ${size} bytes is too small for given parameters.`, {\n metaMessages: [\n `Params: (${abitype.formatAbiParameters(parameters)})`,\n `Data: ${data} (${size} bytes)`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiParameters.DataSizeTooSmallError'\n });\n }\n}\n/**\n * Throws when zero data is provided, but data is expected.\n *\n * @example\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * AbiParameters.decode([{ type: 'uint256' }], '0x')\n * // ↑ ❌ zero data\n * // @error: AbiParameters.DataSizeTooSmallError: Data size of 2 bytes is too small for given parameters.\n * // @error: Params: (uint256)\n * // @error: Data: 0x010f (2 bytes)\n * ```\n *\n * ### Solution\n *\n * Pass valid data.\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * AbiParameters.decode([{ type: 'uint256' }], '0x00000000000000000000000000000000000000000000000000000000000010f')\n * // ↑ ✅ 32 bytes\n * ```\n */\nexport class ZeroDataError extends Errors.BaseError {\n constructor() {\n super('Cannot decode zero data (\"0x\") with ABI parameters.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiParameters.ZeroDataError'\n });\n }\n}\n/**\n * The length of the array value does not match the length specified in the corresponding ABI parameter.\n *\n * ### Example\n *\n * ```ts twoslash\n * // @noErrors\n * import { AbiParameters } from 'ox'\n * // ---cut---\n * AbiParameters.encode(AbiParameters.from('uint256[3]'), [[69n, 420n]])\n * // ↑ expected: 3 ↑ ❌ length: 2\n * // @error: AbiParameters.ArrayLengthMismatchError: ABI encoding array length mismatch\n * // @error: for type `uint256[3]`. Expected: `3`. Given: `2`.\n * ```\n *\n * ### Solution\n *\n * Pass an array of the correct length.\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n * // ---cut---\n * AbiParameters.encode(AbiParameters.from(['uint256[3]']), [[69n, 420n, 69n]])\n * // ↑ ✅ length: 3\n * ```\n */\nexport class ArrayLengthMismatchError extends Errors.BaseError {\n constructor({ expectedLength, givenLength, type, }) {\n super(`Array length mismatch for type \\`${type}\\`. Expected: \\`${expectedLength}\\`. Given: \\`${givenLength}\\`.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiParameters.ArrayLengthMismatchError'\n });\n }\n}\n/**\n * The size of the bytes value does not match the size specified in the corresponding ABI parameter.\n *\n * ### Example\n *\n * ```ts twoslash\n * // @noErrors\n * import { AbiParameters } from 'ox'\n * // ---cut---\n * AbiParameters.encode(AbiParameters.from('bytes8'), [['0xdeadbeefdeadbeefdeadbeef']])\n * // ↑ expected: 8 bytes ↑ ❌ size: 12 bytes\n * // @error: BytesSizeMismatchError: Size of bytes \"0xdeadbeefdeadbeefdeadbeef\"\n * // @error: (bytes12) does not match expected size (bytes8).\n * ```\n *\n * ### Solution\n *\n * Pass a bytes value of the correct size.\n *\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n * // ---cut---\n * AbiParameters.encode(AbiParameters.from(['bytes8']), ['0xdeadbeefdeadbeef'])\n * // ↑ ✅ size: 8 bytes\n * ```\n */\nexport class BytesSizeMismatchError extends Errors.BaseError {\n constructor({ expectedSize, value, }) {\n super(`Size of bytes \"${value}\" (bytes${Hex.size(value)}) does not match expected size (bytes${expectedSize}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiParameters.BytesSizeMismatchError'\n });\n }\n}\n/**\n * The length of the values to encode does not match the length of the ABI parameters.\n *\n * ### Example\n *\n * ```ts twoslash\n * // @noErrors\n * import { AbiParameters } from 'ox'\n * // ---cut---\n * AbiParameters.encode(AbiParameters.from(['string', 'uint256']), ['hello'])\n * // @error: LengthMismatchError: ABI encoding params/values length mismatch.\n * // @error: Expected length (params): 2\n * // @error: Given length (values): 1\n * ```\n *\n * ### Solution\n *\n * Pass the correct number of values to encode.\n *\n * ### Solution\n *\n * Pass a [valid ABI type](https://docs.soliditylang.org/en/develop/abi-spec.html#types).\n */\nexport class LengthMismatchError extends Errors.BaseError {\n constructor({ expectedLength, givenLength, }) {\n super([\n 'ABI encoding parameters/values length mismatch.',\n `Expected length (parameters): ${expectedLength}`,\n `Given length (values): ${givenLength}`,\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiParameters.LengthMismatchError'\n });\n }\n}\n/**\n * The value provided is not a valid array as specified in the corresponding ABI parameter.\n *\n * ### Example\n *\n * ```ts twoslash\n * // @noErrors\n * import { AbiParameters } from 'ox'\n * // ---cut---\n * AbiParameters.encode(AbiParameters.from(['uint256[3]']), [69])\n * ```\n *\n * ### Solution\n *\n * Pass an array value.\n */\nexport class InvalidArrayError extends Errors.BaseError {\n constructor(value) {\n super(`Value \\`${value}\\` is not a valid array.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiParameters.InvalidArrayError'\n });\n }\n}\n/**\n * Throws when the ABI parameter type is invalid.\n *\n * @example\n * ```ts twoslash\n * import { AbiParameters } from 'ox'\n *\n * AbiParameters.decode([{ type: 'lol' }], '0x00000000000000000000000000000000000000000000000000000000000010f')\n * // ↑ ❌ invalid type\n * // @error: AbiParameters.InvalidTypeError: Type `lol` is not a valid ABI Type.\n * ```\n */\nexport class InvalidTypeError extends Errors.BaseError {\n constructor(type) {\n super(`Type \\`${type}\\` is not a valid ABI Type.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiParameters.InvalidTypeError'\n });\n }\n}\n//# sourceMappingURL=AbiParameters.js.map","/**\n * HMAC: RFC2104 message authentication code.\n * @module\n */\nimport { abytes, aexists, ahash, clean, Hash, toBytes } from \"./utils.js\";\nexport class HMAC extends Hash {\n constructor(hash, _key) {\n super();\n this.finished = false;\n this.destroyed = false;\n ahash(hash);\n const key = toBytes(_key);\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('Expected instance of class which extends utils.Hash');\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create();\n // Undo internal XOR && apply outer XOR\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n clean(pad);\n }\n update(buf) {\n aexists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n aexists(this);\n abytes(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to) {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to || (to = Object.create(Object.getPrototypeOf(this), {}));\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n * @example\n * import { hmac } from '@noble/hashes/hmac';\n * import { sha256 } from '@noble/hashes/sha2';\n * const mac1 = hmac(sha256, 'key', 'message');\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map","/**\n * Utils for modular division and finite fields.\n * A finite field over 11 is integer number operations `mod 11`.\n * There is no division: it is replaced by modular multiplicative inverse.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { anumber } from '@noble/hashes/utils';\nimport { bitMask, bytesToNumberBE, bytesToNumberLE, ensureBytes, numberToBytesBE, numberToBytesLE, validateObject, } from \"./utils.js\";\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3);\n// prettier-ignore\nconst _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5), _8n = /* @__PURE__ */ BigInt(8);\n// Calculates a modulo b\nexport function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * TODO: remove.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\nexport function pow(num, power, modulo) {\n return FpPow(Field(modulo), num, power);\n}\n/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */\nexport function pow2(x, power, modulo) {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n/**\n * Inverses number over modulo.\n * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/).\n */\nexport function invert(number, modulo) {\n if (number === _0n)\n throw new Error('invert: expected non-zero number');\n if (modulo <= _0n)\n throw new Error('invert: expected positive modulus, got ' + modulo);\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n// Not all roots are possible! Example which will throw:\n// const NUM =\n// n = 72057594037927816n;\n// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'));\nfunction sqrt3mod4(Fp, n) {\n const p1div4 = (Fp.ORDER + _1n) / _4n;\n const root = Fp.pow(n, p1div4);\n // Throw if root^2 != n\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n}\nfunction sqrt5mod8(Fp, n) {\n const p5div8 = (Fp.ORDER - _5n) / _8n;\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, p5div8);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n}\n// TODO: Commented-out for now. Provide test vectors.\n// Tonelli is too slow for extension fields Fp2.\n// That means we can't use sqrt (c1, c2...) even for initialization constants.\n// if (P % _16n === _9n) return sqrt9mod16;\n// // prettier-ignore\n// function sqrt9mod16<T>(Fp: IField<T>, n: T, p7div16?: bigint) {\n// if (p7div16 === undefined) p7div16 = (Fp.ORDER + BigInt(7)) / _16n;\n// const c1 = Fp.sqrt(Fp.neg(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n// const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n// const c3 = Fp.sqrt(Fp.neg(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n// const c4 = p7div16; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n// let tv1 = Fp.pow(n, c4); // 1. tv1 = x^c4\n// let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n// const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n// let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n// const e1 = Fp.eql(Fp.sqr(tv2), n); // 5. e1 = (tv2^2) == x\n// const e2 = Fp.eql(Fp.sqr(tv3), n); // 6. e2 = (tv3^2) == x\n// tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n// tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n// const e3 = Fp.eql(Fp.sqr(tv2), n); // 9. e3 = (tv2^2) == x\n// return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n// }\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * @param P field order\n * @returns function that takes field Fp (created from P) and number n\n */\nexport function tonelliShanks(P) {\n // Initialization (precomputation).\n if (P < BigInt(3))\n throw new Error('sqrt is not defined for small field');\n // Factor P - 1 = Q * 2^S, where Q is odd\n let Q = P - _1n;\n let S = 0;\n while (Q % _2n === _0n) {\n Q /= _2n;\n S++;\n }\n // Find the first quadratic non-residue Z >= 2\n let Z = _2n;\n const _Fp = Field(P);\n while (FpLegendre(_Fp, Z) === 1) {\n // Basic primality test for P. After x iterations, chance of\n // not finding quadratic non-residue is 2^x, so 2^1000.\n if (Z++ > 1000)\n throw new Error('Cannot find square root: probably non-prime P');\n }\n // Fast-path; usually done before Z, but we do \"primality test\".\n if (S === 1)\n return sqrt3mod4;\n // Slow-path\n // TODO: test on Fp2 and others\n let cc = _Fp.pow(Z, Q); // c = z^Q\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n if (Fp.is0(n))\n return n;\n // Check if n is a quadratic residue using Legendre symbol\n if (FpLegendre(Fp, n) !== 1)\n throw new Error('Cannot find square root');\n // Initialize variables for the main loop\n let M = S;\n let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp\n let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor\n let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root\n // Main loop\n // while t != 1\n while (!Fp.eql(t, Fp.ONE)) {\n if (Fp.is0(t))\n return Fp.ZERO; // if t=0 return R=0\n let i = 1;\n // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P)\n let t_tmp = Fp.sqr(t); // t^(2^1)\n while (!Fp.eql(t_tmp, Fp.ONE)) {\n i++;\n t_tmp = Fp.sqr(t_tmp); // t^(2^2)...\n if (i === M)\n throw new Error('Cannot find square root');\n }\n // Calculate the exponent for b: 2^(M - i - 1)\n const exponent = _1n << BigInt(M - i - 1); // bigint is important\n const b = Fp.pow(c, exponent); // b = 2^(M - i - 1)\n // Update variables\n M = i;\n c = Fp.sqr(b); // c = b^2\n t = Fp.mul(t, c); // t = (t * b^2)\n R = Fp.mul(R, b); // R = R*b\n }\n return R;\n };\n}\n/**\n * Square root for a finite field. Will try optimized versions first:\n *\n * 1. P ≡ 3 (mod 4)\n * 2. P ≡ 5 (mod 8)\n * 3. Tonelli-Shanks algorithm\n *\n * Different algorithms can give different roots, it is up to user to decide which one they want.\n * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n */\nexport function FpSqrt(P) {\n // P ≡ 3 (mod 4) => √n = n^((P+1)/4)\n if (P % _4n === _3n)\n return sqrt3mod4;\n // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf\n if (P % _8n === _5n)\n return sqrt5mod8;\n // P ≡ 9 (mod 16) not implemented, see above\n // Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n };\n const opts = FIELD_FIELDS.reduce((map, val) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n */\nexport function FpPow(Fp, num, power) {\n if (power < _0n)\n throw new Error('invalid exponent, negatives unsupported');\n if (power === _0n)\n return Fp.ONE;\n if (power === _1n)\n return num;\n let p = Fp.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = Fp.mul(p, d);\n d = Fp.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n/**\n * Efficiently invert an array of Field elements.\n * Exception-free. Will return `undefined` for 0 elements.\n * @param passZero map 0 to 0 (instead of undefined)\n */\nexport function FpInvertBatch(Fp, nums, passZero = false) {\n const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined);\n // Walk from first to last, multiply them by each other MOD p\n const multipliedAcc = nums.reduce((acc, num, i) => {\n if (Fp.is0(num))\n return acc;\n inverted[i] = acc;\n return Fp.mul(acc, num);\n }, Fp.ONE);\n // Invert last element\n const invertedAcc = Fp.inv(multipliedAcc);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (Fp.is0(num))\n return acc;\n inverted[i] = Fp.mul(acc, inverted[i]);\n return Fp.mul(acc, num);\n }, invertedAcc);\n return inverted;\n}\n// TODO: remove\nexport function FpDiv(Fp, lhs, rhs) {\n return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs));\n}\n/**\n * Legendre symbol.\n * Legendre constant is used to calculate Legendre symbol (a | p)\n * which denotes the value of a^((p-1)/2) (mod p).\n *\n * * (a | p) ≡ 1 if a is a square (mod p), quadratic residue\n * * (a | p) ≡ -1 if a is not a square (mod p), quadratic non residue\n * * (a | p) ≡ 0 if a ≡ 0 (mod p)\n */\nexport function FpLegendre(Fp, n) {\n // We can use 3rd argument as optional cache of this value\n // but seems unneeded for now. The operation is very fast.\n const p1mod2 = (Fp.ORDER - _1n) / _2n;\n const powered = Fp.pow(n, p1mod2);\n const yes = Fp.eql(powered, Fp.ONE);\n const zero = Fp.eql(powered, Fp.ZERO);\n const no = Fp.eql(powered, Fp.neg(Fp.ONE));\n if (!yes && !zero && !no)\n throw new Error('invalid Legendre symbol result');\n return yes ? 1 : zero ? 0 : -1;\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(Fp, n) {\n const l = FpLegendre(Fp, n);\n return l === 1;\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n if (nBitLength !== undefined)\n anumber(nBitLength);\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a finite field over prime.\n * Major performance optimizations:\n * * a) denormalized operations like mulN instead of mul\n * * b) same object shape: never add or remove keys\n * * c) Object.freeze\n * Fragile: always run a benchmark on a change.\n * Security note: operations don't check 'isValid' for all elements for performance reasons,\n * it is caller responsibility to check this.\n * This is low-level code, please make sure you know what you're doing.\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n if (ORDER <= _0n)\n throw new Error('invalid field: expected ORDER > 0, got ' + ORDER);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048)\n throw new Error('invalid field: expected ORDER of <= 2048 bytes');\n let sqrtP; // cached sqrtP\n const f = Object.freeze({\n ORDER,\n isLE,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error('invalid field element: expected bigint, got ' + typeof num);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt ||\n ((n) => {\n if (!sqrtP)\n sqrtP = FpSqrt(ORDER);\n return sqrtP(f, n);\n }),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n // TODO: we don't need it here, move out to separate fn\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // We can't move this out because Fp6, Fp12 implement it\n // and it's unclear what to return in there.\n cmov: (a, b, c) => (c ? b : a),\n });\n return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(\"Field doesn't have isOdd\");\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(\"Field doesn't have isOdd\");\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field).\n * Which makes it slightly more biased, less secure.\n * @deprecated use `mapKeyToField` instead\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error('hashToPrivateScalar: expected ' + minLen + '-1024 bytes of input, got ' + hashLen);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of field\n */\nexport function getFieldBytesLength(fieldOrder) {\n if (typeof fieldOrder !== 'bigint')\n throw new Error('field order must be bigint');\n const bitLength = fieldOrder.toString(2).length;\n return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of target hash\n */\nexport function getMinHashLength(fieldOrder) {\n const length = getFieldBytesLength(fieldOrder);\n return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final\n * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function mapHashToField(key, fieldOrder, isLE = false) {\n const len = key.length;\n const fieldLen = getFieldBytesLength(fieldOrder);\n const minLen = getMinHashLength(fieldOrder);\n // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings.\n if (len < 16 || len < minLen || len > 1024)\n throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len);\n const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key);\n // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n const reduced = mod(num, fieldOrder - _1n) + _1n;\n return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);\n}\n//# sourceMappingURL=modular.js.map","/**\n * Methods for elliptic curve multiplication by scalars.\n * Contains wNAF, pippenger\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { nLength, validateField } from \"./modular.js\";\nimport { bitLen, bitMask, validateObject } from \"./utils.js\";\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nfunction constTimeNegate(condition, item) {\n const neg = item.negate();\n return condition ? neg : item;\n}\nfunction validateW(W, bits) {\n if (!Number.isSafeInteger(W) || W <= 0 || W > bits)\n throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W);\n}\nfunction calcWOpts(W, scalarBits) {\n validateW(W, scalarBits);\n const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero\n const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero\n const maxNumber = 2 ** W; // W=8 256\n const mask = bitMask(W); // W=8 255 == mask 0b11111111\n const shiftBy = BigInt(W); // W=8 8\n return { windows, windowSize, mask, maxNumber, shiftBy };\n}\nfunction calcOffsets(n, window, wOpts) {\n const { windowSize, mask, maxNumber, shiftBy } = wOpts;\n let wbits = Number(n & mask); // extract W bits.\n let nextN = n >> shiftBy; // shift number by W bits.\n // What actually happens here:\n // const highestBit = Number(mask ^ (mask >> 1n));\n // let wbits2 = wbits - 1; // skip zero\n // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~);\n // split if bits > max: +224 => 256-32\n if (wbits > windowSize) {\n // we skip zero, which means instead of `>= size-1`, we do `> size`\n wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here.\n nextN += _1n; // +256 (carry)\n }\n const offsetStart = window * windowSize;\n const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero\n const isZero = wbits === 0; // is current window slice a 0?\n const isNeg = wbits < 0; // is current window slice negative?\n const isNegF = window % 2 !== 0; // fake random statement for noise\n const offsetF = offsetStart; // fake offset for noise\n return { nextN, offset, isZero, isNeg, isNegF, offsetF };\n}\nfunction validateMSMPoints(points, c) {\n if (!Array.isArray(points))\n throw new Error('array expected');\n points.forEach((p, i) => {\n if (!(p instanceof c))\n throw new Error('invalid point at index ' + i);\n });\n}\nfunction validateMSMScalars(scalars, field) {\n if (!Array.isArray(scalars))\n throw new Error('array of scalars expected');\n scalars.forEach((s, i) => {\n if (!field.isValid(s))\n throw new Error('invalid scalar at index ' + i);\n });\n}\n// Since points in different groups cannot be equal (different object constructor),\n// we can have single place to store precomputes.\n// Allows to make points frozen / immutable.\nconst pointPrecomputes = new WeakMap();\nconst pointWindowSizes = new WeakMap();\nfunction getW(P) {\n return pointWindowSizes.get(P) || 1;\n}\n/**\n * Elliptic curve multiplication of Point by scalar. Fragile.\n * Scalars should always be less than curve order: this should be checked inside of a curve itself.\n * Creates precomputation tables for fast multiplication:\n * - private scalar is split by fixed size windows of W bits\n * - every window point is collected from window's table & added to accumulator\n * - since windows are different, same point inside tables won't be accessed more than once per calc\n * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n * - +1 window is neccessary for wNAF\n * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n *\n * @todo Research returning 2d JS array of windows, instead of a single window.\n * This would allow windows to be in different memory locations\n */\nexport function wNAF(c, bits) {\n return {\n constTimeNegate,\n hasPrecomputes(elm) {\n return getW(elm) !== 1;\n },\n // non-const time multiplication ladder\n unsafeLadder(elm, n, p = c.ZERO) {\n let d = elm;\n while (n > _0n) {\n if (n & _1n)\n p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @param elm Point instance\n * @param W window size\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm, W) {\n const { windows, windowSize } = calcWOpts(W, bits);\n const points = [];\n let p = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // i=1, bc we skip 0\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W, precomputes, n) {\n // Smaller version:\n // https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541\n // TODO: check the scalar is less than group order?\n // wNAF behavior is undefined otherwise. But have to carefully remove\n // other checks before wNAF. ORDER == bits here.\n // Accumulators\n let p = c.ZERO;\n let f = c.BASE;\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n const wo = calcWOpts(W, bits);\n for (let window = 0; window < wo.windows; window++) {\n // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise\n const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo);\n n = nextN;\n if (isZero) {\n // bits are 0: add garbage to fake point\n // Important part for const-time getPublicKey: add random \"noise\" point to f.\n f = f.add(constTimeNegate(isNegF, precomputes[offsetF]));\n }\n else {\n // bits are 1: add to result point\n p = p.add(constTimeNegate(isNeg, precomputes[offset]));\n }\n }\n // Return both real and fake points: JIT won't eliminate f.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n /**\n * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @param acc accumulator point to add result of multiplication\n * @returns point\n */\n wNAFUnsafe(W, precomputes, n, acc = c.ZERO) {\n const wo = calcWOpts(W, bits);\n for (let window = 0; window < wo.windows; window++) {\n if (n === _0n)\n break; // Early-exit, skip 0 value\n const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo);\n n = nextN;\n if (isZero) {\n // Window bits are 0: skip processing.\n // Move to next window.\n continue;\n }\n else {\n const item = precomputes[offset];\n acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM\n }\n }\n return acc;\n },\n getPrecomputes(W, P, transform) {\n // Calculate precomputes on a first run, reuse them after\n let comp = pointPrecomputes.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W);\n if (W !== 1)\n pointPrecomputes.set(P, transform(comp));\n }\n return comp;\n },\n wNAFCached(P, n, transform) {\n const W = getW(P);\n return this.wNAF(W, this.getPrecomputes(W, P, transform), n);\n },\n wNAFCachedUnsafe(P, n, transform, prev) {\n const W = getW(P);\n if (W === 1)\n return this.unsafeLadder(P, n, prev); // For W=1 ladder is ~x2 faster\n return this.wNAFUnsafe(W, this.getPrecomputes(W, P, transform), n, prev);\n },\n // We calculate precomputes for elliptic curve point multiplication\n // using windowed method. This specifies window size and\n // stores precomputed values. Usually only base point would be precomputed.\n setWindowSize(P, W) {\n validateW(W, bits);\n pointWindowSizes.set(P, W);\n pointPrecomputes.delete(P);\n },\n };\n}\n/**\n * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n * 30x faster vs naive addition on L=4096, 10x faster than precomputes.\n * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL.\n * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0.\n * @param c Curve Point constructor\n * @param fieldN field over CURVE.N - important that it's not over CURVE.P\n * @param points array of L curve points\n * @param scalars array of L scalars (aka private keys / bigints)\n */\nexport function pippenger(c, fieldN, points, scalars) {\n // If we split scalars by some window (let's say 8 bits), every chunk will only\n // take 256 buckets even if there are 4096 scalars, also re-uses double.\n // TODO:\n // - https://eprint.iacr.org/2024/750.pdf\n // - https://tches.iacr.org/index.php/TCHES/article/view/10287\n // 0 is accepted in scalars\n validateMSMPoints(points, c);\n validateMSMScalars(scalars, fieldN);\n const plength = points.length;\n const slength = scalars.length;\n if (plength !== slength)\n throw new Error('arrays of points and scalars must have equal length');\n // if (plength === 0) throw new Error('array must be of length >= 2');\n const zero = c.ZERO;\n const wbits = bitLen(BigInt(plength));\n let windowSize = 1; // bits\n if (wbits > 12)\n windowSize = wbits - 3;\n else if (wbits > 4)\n windowSize = wbits - 2;\n else if (wbits > 0)\n windowSize = 2;\n const MASK = bitMask(windowSize);\n const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array\n const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;\n let sum = zero;\n for (let i = lastBits; i >= 0; i -= windowSize) {\n buckets.fill(zero);\n for (let j = 0; j < slength; j++) {\n const scalar = scalars[j];\n const wbits = Number((scalar >> BigInt(i)) & MASK);\n buckets[wbits] = buckets[wbits].add(points[j]);\n }\n let resI = zero; // not using this will do small speed-up, but will lose ct\n // Skip first bucket, because it is zero\n for (let j = buckets.length - 1, sumI = zero; j > 0; j--) {\n sumI = sumI.add(buckets[j]);\n resI = resI.add(sumI);\n }\n sum = sum.add(resI);\n if (i !== 0)\n for (let j = 0; j < windowSize; j++)\n sum = sum.double();\n }\n return sum;\n}\n/**\n * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n * @param c Curve Point constructor\n * @param fieldN field over CURVE.N - important that it's not over CURVE.P\n * @param points array of L curve points\n * @returns function which multiplies points with scaars\n */\nexport function precomputeMSMUnsafe(c, fieldN, points, windowSize) {\n /**\n * Performance Analysis of Window-based Precomputation\n *\n * Base Case (256-bit scalar, 8-bit window):\n * - Standard precomputation requires:\n * - 31 additions per scalar × 256 scalars = 7,936 ops\n * - Plus 255 summary additions = 8,191 total ops\n * Note: Summary additions can be optimized via accumulator\n *\n * Chunked Precomputation Analysis:\n * - Using 32 chunks requires:\n * - 255 additions per chunk\n * - 256 doublings\n * - Total: (255 × 32) + 256 = 8,416 ops\n *\n * Memory Usage Comparison:\n * Window Size | Standard Points | Chunked Points\n * ------------|-----------------|---------------\n * 4-bit | 520 | 15\n * 8-bit | 4,224 | 255\n * 10-bit | 13,824 | 1,023\n * 16-bit | 557,056 | 65,535\n *\n * Key Advantages:\n * 1. Enables larger window sizes due to reduced memory overhead\n * 2. More efficient for smaller scalar counts:\n * - 16 chunks: (16 × 255) + 256 = 4,336 ops\n * - ~2x faster than standard 8,191 ops\n *\n * Limitations:\n * - Not suitable for plain precomputes (requires 256 constant doublings)\n * - Performance degrades with larger scalar counts:\n * - Optimal for ~256 scalars\n * - Less efficient for 4096+ scalars (Pippenger preferred)\n */\n validateW(windowSize, fieldN.BITS);\n validateMSMPoints(points, c);\n const zero = c.ZERO;\n const tableSize = 2 ** windowSize - 1; // table size (without zero)\n const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item\n const MASK = bitMask(windowSize);\n const tables = points.map((p) => {\n const res = [];\n for (let i = 0, acc = p; i < tableSize; i++) {\n res.push(acc);\n acc = acc.add(p);\n }\n return res;\n });\n return (scalars) => {\n validateMSMScalars(scalars, fieldN);\n if (scalars.length > points.length)\n throw new Error('array of scalars must be smaller than array of points');\n let res = zero;\n for (let i = 0; i < chunks; i++) {\n // No need to double if accumulator is still zero.\n if (res !== zero)\n for (let j = 0; j < windowSize; j++)\n res = res.double();\n const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize);\n for (let j = 0; j < scalars.length; j++) {\n const n = scalars[j];\n const curr = Number((n >> shiftBy) & MASK);\n if (!curr)\n continue; // skip zero scalars chunks\n res = res.add(tables[j][curr - 1]);\n }\n }\n return res;\n };\n}\nexport function validateBasic(curve) {\n validateField(curve.Fp);\n validateObject(curve, {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n }, {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n });\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n });\n}\n//# sourceMappingURL=curve.js.map","/**\n * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b.\n *\n * ### Parameters\n *\n * To initialize a weierstrass curve, one needs to pass following params:\n *\n * * a: formula param\n * * b: formula param\n * * Fp: finite field of prime characteristic P; may be complex (Fp2). Arithmetics is done in field\n * * n: order of prime subgroup a.k.a total amount of valid curve points\n * * Gx: Base point (x, y) aka generator point. Gx = x coordinate\n * * Gy: ...y coordinate\n * * h: cofactor, usually 1. h*n = curve group order (n is only subgroup order)\n * * lowS: whether to enable (default) or disable \"low-s\" non-malleable signatures\n *\n * ### Design rationale for types\n *\n * * Interaction between classes from different curves should fail:\n * `k256.Point.BASE.add(p256.Point.BASE)`\n * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime\n * * Different calls of `curve()` would return different classes -\n * `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve,\n * it won't affect others\n *\n * TypeScript can't infer types for classes created inside a function. Classes is one instance\n * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create\n * unique type for every function call.\n *\n * We can use generic types via some param, like curve opts, but that would:\n * 1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params)\n * which is hard to debug.\n * 2. Params can be generic and we can't enforce them to be constant value:\n * if somebody creates curve from non-constant params,\n * it would be allowed to interact with other curves with non-constant params\n *\n * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// prettier-ignore\nimport { pippenger, validateBasic, wNAF } from \"./curve.js\";\n// prettier-ignore\nimport { Field, FpInvertBatch, getMinHashLength, invert, mapHashToField, mod, validateField } from \"./modular.js\";\n// prettier-ignore\nimport { aInRange, abool, bitMask, bytesToHex, bytesToNumberBE, concatBytes, createHmacDrbg, ensureBytes, hexToBytes, inRange, isBytes, memoized, numberToBytesBE, numberToHexUnpadded, validateObject } from \"./utils.js\";\nfunction validateSigVerOpts(opts) {\n if (opts.lowS !== undefined)\n abool('lowS', opts.lowS);\n if (opts.prehash !== undefined)\n abool('prehash', opts.prehash);\n}\nfunction validatePointOpts(curve) {\n const opts = validateBasic(curve);\n validateObject(opts, {\n a: 'field',\n b: 'field',\n }, {\n allowInfinityPoint: 'boolean',\n allowedPrivateKeyLengths: 'array',\n clearCofactor: 'function',\n fromBytes: 'function',\n isTorsionFree: 'function',\n toBytes: 'function',\n wrapPrivateKey: 'boolean',\n });\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error('invalid endo: CURVE.a must be 0');\n }\n if (typeof endo !== 'object' ||\n typeof endo.beta !== 'bigint' ||\n typeof endo.splitScalar !== 'function') {\n throw new Error('invalid endo: expected \"beta\": bigint and \"splitScalar\": function');\n }\n }\n return Object.freeze({ ...opts });\n}\nexport class DERErr extends Error {\n constructor(m = '') {\n super(m);\n }\n}\n/**\n * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:\n *\n * [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]\n *\n * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html\n */\nexport const DER = {\n // asn.1 DER encoding utils\n Err: DERErr,\n // Basic building block is TLV (Tag-Length-Value)\n _tlv: {\n encode: (tag, data) => {\n const { Err: E } = DER;\n if (tag < 0 || tag > 256)\n throw new E('tlv.encode: wrong tag');\n if (data.length & 1)\n throw new E('tlv.encode: unpadded data');\n const dataLen = data.length / 2;\n const len = numberToHexUnpadded(dataLen);\n if ((len.length / 2) & 128)\n throw new E('tlv.encode: long form length too big');\n // length of length with long form flag\n const lenLen = dataLen > 127 ? numberToHexUnpadded((len.length / 2) | 128) : '';\n const t = numberToHexUnpadded(tag);\n return t + lenLen + len + data;\n },\n // v - value, l - left bytes (unparsed)\n decode(tag, data) {\n const { Err: E } = DER;\n let pos = 0;\n if (tag < 0 || tag > 256)\n throw new E('tlv.encode: wrong tag');\n if (data.length < 2 || data[pos++] !== tag)\n throw new E('tlv.decode: wrong tlv');\n const first = data[pos++];\n const isLong = !!(first & 128); // First bit of first length byte is flag for short/long form\n let length = 0;\n if (!isLong)\n length = first;\n else {\n // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)]\n const lenLen = first & 127;\n if (!lenLen)\n throw new E('tlv.decode(long): indefinite length not supported');\n if (lenLen > 4)\n throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js\n const lengthBytes = data.subarray(pos, pos + lenLen);\n if (lengthBytes.length !== lenLen)\n throw new E('tlv.decode: length bytes not complete');\n if (lengthBytes[0] === 0)\n throw new E('tlv.decode(long): zero leftmost byte');\n for (const b of lengthBytes)\n length = (length << 8) | b;\n pos += lenLen;\n if (length < 128)\n throw new E('tlv.decode(long): not minimal encoding');\n }\n const v = data.subarray(pos, pos + length);\n if (v.length !== length)\n throw new E('tlv.decode: wrong value length');\n return { v, l: data.subarray(pos + length) };\n },\n },\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n _int: {\n encode(num) {\n const { Err: E } = DER;\n if (num < _0n)\n throw new E('integer: negative integers are not allowed');\n let hex = numberToHexUnpadded(num);\n // Pad with zero byte if negative flag is present\n if (Number.parseInt(hex[0], 16) & 0b1000)\n hex = '00' + hex;\n if (hex.length & 1)\n throw new E('unexpected DER parsing assertion: unpadded hex');\n return hex;\n },\n decode(data) {\n const { Err: E } = DER;\n if (data[0] & 128)\n throw new E('invalid signature integer: negative');\n if (data[0] === 0x00 && !(data[1] & 128))\n throw new E('invalid signature integer: unnecessary leading zero');\n return bytesToNumberBE(data);\n },\n },\n toSig(hex) {\n // parse DER signature\n const { Err: E, _int: int, _tlv: tlv } = DER;\n const data = ensureBytes('signature', hex);\n const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data);\n if (seqLeftBytes.length)\n throw new E('invalid signature: left bytes after parsing');\n const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes);\n const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes);\n if (sLeftBytes.length)\n throw new E('invalid signature: left bytes after parsing');\n return { r: int.decode(rBytes), s: int.decode(sBytes) };\n },\n hexFromSig(sig) {\n const { _tlv: tlv, _int: int } = DER;\n const rs = tlv.encode(0x02, int.encode(sig.r));\n const ss = tlv.encode(0x02, int.encode(sig.s));\n const seq = rs + ss;\n return tlv.encode(0x30, seq);\n },\n};\nfunction numToSizedHex(num, size) {\n return bytesToHex(numberToBytesBE(num, size));\n}\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nexport function weierstrassPoints(opts) {\n const CURVE = validatePointOpts(opts);\n const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n const Fn = Field(CURVE.n, CURVE.nBitLength);\n const toBytes = CURVE.toBytes ||\n ((_c, point, _isCompressed) => {\n const a = point.toAffine();\n return concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n });\n const fromBytes = CURVE.fromBytes ||\n ((bytes) => {\n // const head = bytes[0];\n const tail = bytes.subarray(1);\n // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n });\n /**\n * y² = x³ + ax + b: Short weierstrass curve formula. Takes x, returns y².\n * @returns y²\n */\n function weierstrassEquation(x) {\n const { a, b } = CURVE;\n const x2 = Fp.sqr(x); // x * x\n const x3 = Fp.mul(x2, x); // x² * x\n return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x³ + a * x + b\n }\n function isValidXY(x, y) {\n const left = Fp.sqr(y); // y²\n const right = weierstrassEquation(x); // x³ + ax + b\n return Fp.eql(left, right);\n }\n // Validate whether the passed curve params are valid.\n // Test 1: equation y² = x³ + ax + b should work for generator point.\n if (!isValidXY(CURVE.Gx, CURVE.Gy))\n throw new Error('bad curve params: generator point');\n // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0.\n // Guarantees curve is genus-1, smooth (non-singular).\n const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n);\n const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27));\n if (Fp.is0(Fp.add(_4a3, _27b2)))\n throw new Error('bad curve params: a or b');\n // Valid group elements reside in range 1..n-1\n function isWithinCurveOrder(num) {\n return inRange(num, _1n, CURVE.n);\n }\n // Validates if priv key is valid and converts it to bigint.\n // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n function normPrivateKeyToScalar(key) {\n const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n: N } = CURVE;\n if (lengths && typeof key !== 'bigint') {\n if (isBytes(key))\n key = bytesToHex(key);\n // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n if (typeof key !== 'string' || !lengths.includes(key.length))\n throw new Error('invalid private key');\n key = key.padStart(nByteLength * 2, '0');\n }\n let num;\n try {\n num =\n typeof key === 'bigint'\n ? key\n : bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n }\n catch (error) {\n throw new Error('invalid private key, expected hex or ' + nByteLength + ' bytes, got ' + typeof key);\n }\n if (wrapPrivateKey)\n num = mod(num, N); // disabled by default, enabled for BLS\n aInRange('private key', num, _1n, N); // num in range [1..N-1]\n return num;\n }\n function aprjpoint(other) {\n if (!(other instanceof Point))\n throw new Error('ProjectivePoint expected');\n }\n // Memoized toAffine / validity check. They are heavy. Points are immutable.\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (X, Y, Z) ∋ (x=X/Z, y=Y/Z)\n const toAffineMemo = memoized((p, iz) => {\n const { px: x, py: y, pz: z } = p;\n // Fast-path for normalized points\n if (Fp.eql(z, Fp.ONE))\n return { x, y };\n const is0 = p.is0();\n // If invZ was 0, we return zero point. However we still want to execute\n // all operations, so we replace invZ with a random number, 1.\n if (iz == null)\n iz = is0 ? Fp.ONE : Fp.inv(z);\n const ax = Fp.mul(x, iz);\n const ay = Fp.mul(y, iz);\n const zz = Fp.mul(z, iz);\n if (is0)\n return { x: Fp.ZERO, y: Fp.ZERO };\n if (!Fp.eql(zz, Fp.ONE))\n throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n });\n // NOTE: on exception this will crash 'cached' and no value will be set.\n // Otherwise true will be return\n const assertValidMemo = memoized((p) => {\n if (p.is0()) {\n // (0, 1, 0) aka ZERO is invalid in most contexts.\n // In BLS, ZERO can be serialized, so we allow it.\n // (0, 0, 0) is invalid representation of ZERO.\n if (CURVE.allowInfinityPoint && !Fp.is0(p.py))\n return;\n throw new Error('bad point: ZERO');\n }\n // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n const { x, y } = p.toAffine();\n // Check if x, y are valid field elements\n if (!Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('bad point: x or y not FE');\n if (!isValidXY(x, y))\n throw new Error('bad point: equation left != right');\n if (!p.isTorsionFree())\n throw new Error('bad point: not in prime-order subgroup');\n return true;\n });\n /**\n * Projective Point works in 3d / projective (homogeneous) coordinates: (X, Y, Z) ∋ (x=X/Z, y=Y/Z)\n * Default Point works in 2d / affine coordinates: (x, y)\n * We're doing calculations in projective, because its operations don't require costly inversion.\n */\n class Point {\n constructor(px, py, pz) {\n if (px == null || !Fp.isValid(px))\n throw new Error('x required');\n if (py == null || !Fp.isValid(py) || Fp.is0(py))\n throw new Error('y required');\n if (pz == null || !Fp.isValid(pz))\n throw new Error('z required');\n this.px = px;\n this.py = py;\n this.pz = pz;\n Object.freeze(this);\n }\n // Does not validate if the point is on-curve.\n // Use fromHex instead, or call assertValidity() later.\n static fromAffine(p) {\n const { x, y } = p || {};\n if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('invalid affine point');\n if (p instanceof Point)\n throw new Error('projective point not allowed');\n const is0 = (i) => Fp.eql(i, Fp.ZERO);\n // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n if (is0(x) && is0(y))\n return Point.ZERO;\n return new Point(x, y, Fp.ONE);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n /**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\n static normalizeZ(points) {\n const toInv = FpInvertBatch(Fp, points.map((p) => p.pz));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n /**\n * Converts hash string or Uint8Array to Point.\n * @param hex short/long ECDSA hex\n */\n static fromHex(hex) {\n const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n P.assertValidity();\n return P;\n }\n // Multiplies generator point by privateKey.\n static fromPrivateKey(privateKey) {\n return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n }\n // Multiscalar Multiplication\n static msm(points, scalars) {\n return pippenger(Point, Fn, points, scalars);\n }\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize) {\n wnaf.setWindowSize(this, windowSize);\n }\n // A point on curve is valid if it conforms to equation.\n assertValidity() {\n assertValidMemo(this);\n }\n hasEvenY() {\n const { y } = this.toAffine();\n if (Fp.isOdd)\n return !Fp.isOdd(y);\n throw new Error(\"Field doesn't support isOdd\");\n }\n /**\n * Compare one point to another.\n */\n equals(other) {\n aprjpoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n return U1 && U2;\n }\n /**\n * Flips point to one corresponding to (x, -y) in Affine coordinates.\n */\n negate() {\n return new Point(this.px, Fp.neg(this.py), this.pz);\n }\n // Renes-Costello-Batina exception-free doubling formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 3\n // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n double() {\n const { a, b } = CURVE;\n const b3 = Fp.mul(b, _3n);\n const { px: X1, py: Y1, pz: Z1 } = this;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n let t0 = Fp.mul(X1, X1); // step 1\n let t1 = Fp.mul(Y1, Y1);\n let t2 = Fp.mul(Z1, Z1);\n let t3 = Fp.mul(X1, Y1);\n t3 = Fp.add(t3, t3); // step 5\n Z3 = Fp.mul(X1, Z1);\n Z3 = Fp.add(Z3, Z3);\n X3 = Fp.mul(a, Z3);\n Y3 = Fp.mul(b3, t2);\n Y3 = Fp.add(X3, Y3); // step 10\n X3 = Fp.sub(t1, Y3);\n Y3 = Fp.add(t1, Y3);\n Y3 = Fp.mul(X3, Y3);\n X3 = Fp.mul(t3, X3);\n Z3 = Fp.mul(b3, Z3); // step 15\n t2 = Fp.mul(a, t2);\n t3 = Fp.sub(t0, t2);\n t3 = Fp.mul(a, t3);\n t3 = Fp.add(t3, Z3);\n Z3 = Fp.add(t0, t0); // step 20\n t0 = Fp.add(Z3, t0);\n t0 = Fp.add(t0, t2);\n t0 = Fp.mul(t0, t3);\n Y3 = Fp.add(Y3, t0);\n t2 = Fp.mul(Y1, Z1); // step 25\n t2 = Fp.add(t2, t2);\n t0 = Fp.mul(t2, t3);\n X3 = Fp.sub(X3, t0);\n Z3 = Fp.mul(t2, t1);\n Z3 = Fp.add(Z3, Z3); // step 30\n Z3 = Fp.add(Z3, Z3);\n return new Point(X3, Y3, Z3);\n }\n // Renes-Costello-Batina exception-free addition formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 1\n // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n add(other) {\n aprjpoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n const a = CURVE.a;\n const b3 = Fp.mul(CURVE.b, _3n);\n let t0 = Fp.mul(X1, X2); // step 1\n let t1 = Fp.mul(Y1, Y2);\n let t2 = Fp.mul(Z1, Z2);\n let t3 = Fp.add(X1, Y1);\n let t4 = Fp.add(X2, Y2); // step 5\n t3 = Fp.mul(t3, t4);\n t4 = Fp.add(t0, t1);\n t3 = Fp.sub(t3, t4);\n t4 = Fp.add(X1, Z1);\n let t5 = Fp.add(X2, Z2); // step 10\n t4 = Fp.mul(t4, t5);\n t5 = Fp.add(t0, t2);\n t4 = Fp.sub(t4, t5);\n t5 = Fp.add(Y1, Z1);\n X3 = Fp.add(Y2, Z2); // step 15\n t5 = Fp.mul(t5, X3);\n X3 = Fp.add(t1, t2);\n t5 = Fp.sub(t5, X3);\n Z3 = Fp.mul(a, t4);\n X3 = Fp.mul(b3, t2); // step 20\n Z3 = Fp.add(X3, Z3);\n X3 = Fp.sub(t1, Z3);\n Z3 = Fp.add(t1, Z3);\n Y3 = Fp.mul(X3, Z3);\n t1 = Fp.add(t0, t0); // step 25\n t1 = Fp.add(t1, t0);\n t2 = Fp.mul(a, t2);\n t4 = Fp.mul(b3, t4);\n t1 = Fp.add(t1, t2);\n t2 = Fp.sub(t0, t2); // step 30\n t2 = Fp.mul(a, t2);\n t4 = Fp.add(t4, t2);\n t0 = Fp.mul(t1, t4);\n Y3 = Fp.add(Y3, t0);\n t0 = Fp.mul(t5, t4); // step 35\n X3 = Fp.mul(t3, X3);\n X3 = Fp.sub(X3, t0);\n t0 = Fp.mul(t3, t1);\n Z3 = Fp.mul(t5, Z3);\n Z3 = Fp.add(Z3, t0); // step 40\n return new Point(X3, Y3, Z3);\n }\n subtract(other) {\n return this.add(other.negate());\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n wNAF(n) {\n return wnaf.wNAFCached(this, n, Point.normalizeZ);\n }\n /**\n * Non-constant-time multiplication. Uses double-and-add algorithm.\n * It's faster, but should only be used when you don't care about\n * an exposed private key e.g. sig verification, which works over *public* keys.\n */\n multiplyUnsafe(sc) {\n const { endo, n: N } = CURVE;\n aInRange('scalar', sc, _0n, N);\n const I = Point.ZERO;\n if (sc === _0n)\n return I;\n if (this.is0() || sc === _1n)\n return this;\n // Case a: no endomorphism. Case b: has precomputes.\n if (!endo || wnaf.hasPrecomputes(this))\n return wnaf.wNAFCachedUnsafe(this, sc, Point.normalizeZ);\n // Case c: endomorphism\n /** See docs for {@link EndomorphismOpts} */\n let { k1neg, k1, k2neg, k2 } = endo.splitScalar(sc);\n let k1p = I;\n let k2p = I;\n let d = this;\n while (k1 > _0n || k2 > _0n) {\n if (k1 & _1n)\n k1p = k1p.add(d);\n if (k2 & _1n)\n k2p = k2p.add(d);\n d = d.double();\n k1 >>= _1n;\n k2 >>= _1n;\n }\n if (k1neg)\n k1p = k1p.negate();\n if (k2neg)\n k2p = k2p.negate();\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n return k1p.add(k2p);\n }\n /**\n * Constant time multiplication.\n * Uses wNAF method. Windowed method may be 10% faster,\n * but takes 2x longer to generate and consumes 2x memory.\n * Uses precomputes when available.\n * Uses endomorphism for Koblitz curves.\n * @param scalar by which the point would be multiplied\n * @returns New point\n */\n multiply(scalar) {\n const { endo, n: N } = CURVE;\n aInRange('scalar', scalar, _1n, N);\n let point, fake; // Fake point is used to const-time mult\n /** See docs for {@link EndomorphismOpts} */\n if (endo) {\n const { k1neg, k1, k2neg, k2 } = endo.splitScalar(scalar);\n let { p: k1p, f: f1p } = this.wNAF(k1);\n let { p: k2p, f: f2p } = this.wNAF(k2);\n k1p = wnaf.constTimeNegate(k1neg, k1p);\n k2p = wnaf.constTimeNegate(k2neg, k2p);\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n point = k1p.add(k2p);\n fake = f1p.add(f2p);\n }\n else {\n const { p, f } = this.wNAF(scalar);\n point = p;\n fake = f;\n }\n // Normalize `z` for both points, but return only real one\n return Point.normalizeZ([point, fake])[0];\n }\n /**\n * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n * Not using Strauss-Shamir trick: precomputation tables are faster.\n * The trick could be useful if both P and Q are not G (not in our case).\n * @returns non-zero affine point\n */\n multiplyAndAddUnsafe(Q, a, b) {\n const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n const mul = (P, a // Select faster multiply() method\n ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n const sum = mul(this, a).add(mul(Q, b));\n return sum.is0() ? undefined : sum;\n }\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (x, y, z) ∋ (x=x/z, y=y/z)\n toAffine(iz) {\n return toAffineMemo(this, iz);\n }\n isTorsionFree() {\n const { h: cofactor, isTorsionFree } = CURVE;\n if (cofactor === _1n)\n return true; // No subgroups, always torsion-free\n if (isTorsionFree)\n return isTorsionFree(Point, this);\n throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n }\n clearCofactor() {\n const { h: cofactor, clearCofactor } = CURVE;\n if (cofactor === _1n)\n return this; // Fast-path\n if (clearCofactor)\n return clearCofactor(Point, this);\n return this.multiplyUnsafe(CURVE.h);\n }\n toRawBytes(isCompressed = true) {\n abool('isCompressed', isCompressed);\n this.assertValidity();\n return toBytes(Point, this, isCompressed);\n }\n toHex(isCompressed = true) {\n abool('isCompressed', isCompressed);\n return bytesToHex(this.toRawBytes(isCompressed));\n }\n }\n // base / generator point\n Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n // zero / infinity / identity point\n Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0\n const { endo, nBitLength } = CURVE;\n const wnaf = wNAF(Point, endo ? Math.ceil(nBitLength / 2) : nBitLength);\n return {\n CURVE,\n ProjectivePoint: Point,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n };\n}\nfunction validateOpts(curve) {\n const opts = validateBasic(curve);\n validateObject(opts, {\n hash: 'hash',\n hmac: 'function',\n randomBytes: 'function',\n }, {\n bits2int: 'function',\n bits2int_modN: 'function',\n lowS: 'boolean',\n });\n return Object.freeze({ lowS: true, ...opts });\n}\n/**\n * Creates short weierstrass curve and ECDSA signature methods for it.\n * @example\n * import { Field } from '@noble/curves/abstract/modular';\n * // Before that, define BigInt-s: a, b, p, n, Gx, Gy\n * const curve = weierstrass({ a, b, Fp: Field(p), n, Gx, Gy, h: 1n })\n */\nexport function weierstrass(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER, nByteLength, nBitLength } = CURVE;\n const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n function modN(a) {\n return mod(a, CURVE_ORDER);\n }\n function invN(a) {\n return invert(a, CURVE_ORDER);\n }\n const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({\n ...CURVE,\n toBytes(_c, point, isCompressed) {\n const a = point.toAffine();\n const x = Fp.toBytes(a.x);\n const cat = concatBytes;\n abool('isCompressed', isCompressed);\n if (isCompressed) {\n return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n }\n else {\n return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n }\n },\n fromBytes(bytes) {\n const len = bytes.length;\n const head = bytes[0];\n const tail = bytes.subarray(1);\n // this.assertValidity() is done inside of fromHex\n if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n const x = bytesToNumberBE(tail);\n if (!inRange(x, _1n, Fp.ORDER))\n throw new Error('Point is not on curve');\n const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n let y;\n try {\n y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n }\n catch (sqrtError) {\n const suffix = sqrtError instanceof Error ? ': ' + sqrtError.message : '';\n throw new Error('Point is not on curve' + suffix);\n }\n const isYOdd = (y & _1n) === _1n;\n // ECDSA\n const isHeadOdd = (head & 1) === 1;\n if (isHeadOdd !== isYOdd)\n y = Fp.neg(y);\n return { x, y };\n }\n else if (len === uncompressedLen && head === 0x04) {\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n }\n else {\n const cl = compressedLen;\n const ul = uncompressedLen;\n throw new Error('invalid Point, expected length of ' + cl + ', or uncompressed ' + ul + ', got ' + len);\n }\n },\n });\n function isBiggerThanHalfOrder(number) {\n const HALF = CURVE_ORDER >> _1n;\n return number > HALF;\n }\n function normalizeS(s) {\n return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n }\n // slice bytes num\n const slcNum = (b, from, to) => bytesToNumberBE(b.slice(from, to));\n /**\n * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n */\n class Signature {\n constructor(r, s, recovery) {\n aInRange('r', r, _1n, CURVE_ORDER); // r in [1..N]\n aInRange('s', s, _1n, CURVE_ORDER); // s in [1..N]\n this.r = r;\n this.s = s;\n if (recovery != null)\n this.recovery = recovery;\n Object.freeze(this);\n }\n // pair (bytes of r, bytes of s)\n static fromCompact(hex) {\n const l = nByteLength;\n hex = ensureBytes('compactSignature', hex, l * 2);\n return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n }\n // DER encoded ECDSA signature\n // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n static fromDER(hex) {\n const { r, s } = DER.toSig(ensureBytes('DER', hex));\n return new Signature(r, s);\n }\n /**\n * @todo remove\n * @deprecated\n */\n assertValidity() { }\n addRecoveryBit(recovery) {\n return new Signature(this.r, this.s, recovery);\n }\n recoverPublicKey(msgHash) {\n const { r, s, recovery: rec } = this;\n const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n if (rec == null || ![0, 1, 2, 3].includes(rec))\n throw new Error('recovery id invalid');\n const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n if (radj >= Fp.ORDER)\n throw new Error('recovery id 2 or 3 invalid');\n const prefix = (rec & 1) === 0 ? '02' : '03';\n const R = Point.fromHex(prefix + numToSizedHex(radj, Fp.BYTES));\n const ir = invN(radj); // r^-1\n const u1 = modN(-h * ir); // -hr^-1\n const u2 = modN(s * ir); // sr^-1\n const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n if (!Q)\n throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n Q.assertValidity();\n return Q;\n }\n // Signatures should be low-s, to prevent malleability.\n hasHighS() {\n return isBiggerThanHalfOrder(this.s);\n }\n normalizeS() {\n return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n }\n // DER-encoded\n toDERRawBytes() {\n return hexToBytes(this.toDERHex());\n }\n toDERHex() {\n return DER.hexFromSig(this);\n }\n // padded bytes of r, then padded bytes of s\n toCompactRawBytes() {\n return hexToBytes(this.toCompactHex());\n }\n toCompactHex() {\n const l = nByteLength;\n return numToSizedHex(this.r, l) + numToSizedHex(this.s, l);\n }\n }\n const utils = {\n isValidPrivateKey(privateKey) {\n try {\n normPrivateKeyToScalar(privateKey);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n normPrivateKeyToScalar: normPrivateKeyToScalar,\n /**\n * Produces cryptographically secure private key from random of size\n * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.\n */\n randomPrivateKey: () => {\n const length = getMinHashLength(CURVE.n);\n return mapHashToField(CURVE.randomBytes(length), CURVE.n);\n },\n /**\n * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n * Allows to massively speed-up `point.multiply(scalar)`.\n * @returns cached point\n * @example\n * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n * fast.multiply(privKey); // much faster ECDH now\n */\n precompute(windowSize = 8, point = Point.BASE) {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n return point;\n },\n };\n /**\n * Computes public key for a private key. Checks for validity of the private key.\n * @param privateKey private key\n * @param isCompressed whether to return compact (default), or full key\n * @returns Public key, full when isCompressed=false; short when isCompressed=true\n */\n function getPublicKey(privateKey, isCompressed = true) {\n return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n }\n /**\n * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n */\n function isProbPub(item) {\n if (typeof item === 'bigint')\n return false;\n if (item instanceof Point)\n return true;\n const arr = ensureBytes('key', item);\n const len = arr.length;\n const fpl = Fp.BYTES;\n const compLen = fpl + 1; // e.g. 33 for 32\n const uncompLen = 2 * fpl + 1; // e.g. 65 for 32\n if (CURVE.allowedPrivateKeyLengths || nByteLength === compLen) {\n return undefined;\n }\n else {\n return len === compLen || len === uncompLen;\n }\n }\n /**\n * ECDH (Elliptic Curve Diffie Hellman).\n * Computes shared public key from private key and public key.\n * Checks: 1) private key validity 2) shared key is on-curve.\n * Does NOT hash the result.\n * @param privateA private key\n * @param publicB different public key\n * @param isCompressed whether to return compact (default), or full key\n * @returns shared public key\n */\n function getSharedSecret(privateA, publicB, isCompressed = true) {\n if (isProbPub(privateA) === true)\n throw new Error('first arg must be private key');\n if (isProbPub(publicB) === false)\n throw new Error('second arg must be public key');\n const b = Point.fromHex(publicB); // check for being on-curve\n return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n }\n // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n const bits2int = CURVE.bits2int ||\n function (bytes) {\n // Our custom check \"just in case\", for protection against DoS\n if (bytes.length > 8192)\n throw new Error('input is too large');\n // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n // for some cases, since bytes.length * 8 is not actual bitLength.\n const num = bytesToNumberBE(bytes); // check for == u8 done here\n const delta = bytes.length * 8 - nBitLength; // truncate to nBitLength leftmost bits\n return delta > 0 ? num >> BigInt(delta) : num;\n };\n const bits2int_modN = CURVE.bits2int_modN ||\n function (bytes) {\n return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n };\n // NOTE: pads output with zero as per spec\n const ORDER_MASK = bitMask(nBitLength);\n /**\n * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n */\n function int2octets(num) {\n aInRange('num < 2^' + nBitLength, num, _0n, ORDER_MASK);\n // works with order, can have different size than numToField!\n return numberToBytesBE(num, nByteLength);\n }\n // Steps A, D of RFC6979 3.2\n // Creates RFC6979 seed; converts msg/privKey to numbers.\n // Used only in sign, not in verify.\n // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order,\n // this will be invalid at least for P521. Also it can be bigger for P224 + SHA256\n function prepSig(msgHash, privateKey, opts = defaultSigOpts) {\n if (['recovered', 'canonical'].some((k) => k in opts))\n throw new Error('sign() legacy options not supported');\n const { hash, randomBytes } = CURVE;\n let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n msgHash = ensureBytes('msgHash', msgHash);\n validateSigVerOpts(opts);\n if (prehash)\n msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n // We can't later call bits2octets, since nested bits2int is broken for curves\n // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n const h1int = bits2int_modN(msgHash);\n const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n const seedArgs = [int2octets(d), int2octets(h1int)];\n // extraEntropy. RFC6979 3.6: additional k' (optional).\n if (ent != null && ent !== false) {\n // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes\n }\n const seed = concatBytes(...seedArgs); // Step D of RFC6979 3.2\n const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n // Converts signature params into point w r/s, checks result for validity.\n function k2sig(kBytes) {\n // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n if (!isWithinCurveOrder(k))\n return; // Important: all mod() calls here must be done over N\n const ik = invN(k); // k^-1 mod n\n const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n const r = modN(q.x); // r = q.x mod n\n if (r === _0n)\n return;\n // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n const s = modN(ik * modN(m + r * d)); // Not using blinding here\n if (s === _0n)\n return;\n let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n let normS = s;\n if (lowS && isBiggerThanHalfOrder(s)) {\n normS = normalizeS(s); // if lowS was passed, ensure s is always\n recovery ^= 1; // // in the bottom half of N\n }\n return new Signature(r, normS, recovery); // use normS, not s\n }\n return { seed, k2sig };\n }\n const defaultSigOpts = { lowS: CURVE.lowS, prehash: false };\n const defaultVerOpts = { lowS: CURVE.lowS, prehash: false };\n /**\n * Signs message hash with a private key.\n * ```\n * sign(m, d, k) where\n * (x, y) = G × k\n * r = x mod n\n * s = (m + dr)/k mod n\n * ```\n * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`.\n * @param privKey private key\n * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg.\n * @returns signature with recovery param\n */\n function sign(msgHash, privKey, opts = defaultSigOpts) {\n const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n const C = CURVE;\n const drbg = createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac);\n return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n }\n // Enable precomputes. Slows down first publicKey computation by 20ms.\n Point.BASE._setWindowSize(8);\n // utils.precompute(8, ProjectivePoint.BASE)\n /**\n * Verifies a signature against message hash and public key.\n * Rejects lowS signatures by default: to override,\n * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n *\n * ```\n * verify(r, s, h, P) where\n * U1 = hs^-1 mod n\n * U2 = rs^-1 mod n\n * R = U1⋅G - U2⋅P\n * mod(R.x, n) == r\n * ```\n */\n function verify(signature, msgHash, publicKey, opts = defaultVerOpts) {\n const sg = signature;\n msgHash = ensureBytes('msgHash', msgHash);\n publicKey = ensureBytes('publicKey', publicKey);\n const { lowS, prehash, format } = opts;\n // Verify opts, deduce signature format\n validateSigVerOpts(opts);\n if ('strict' in opts)\n throw new Error('options.strict was renamed to lowS');\n if (format !== undefined && format !== 'compact' && format !== 'der')\n throw new Error('format must be compact or der');\n const isHex = typeof sg === 'string' || isBytes(sg);\n const isObj = !isHex &&\n !format &&\n typeof sg === 'object' &&\n sg !== null &&\n typeof sg.r === 'bigint' &&\n typeof sg.s === 'bigint';\n if (!isHex && !isObj)\n throw new Error('invalid signature, expected Uint8Array, hex string or Signature instance');\n let _sig = undefined;\n let P;\n try {\n if (isObj)\n _sig = new Signature(sg.r, sg.s);\n if (isHex) {\n // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n // Since DER can also be 2*nByteLength bytes, we check for it first.\n try {\n if (format !== 'compact')\n _sig = Signature.fromDER(sg);\n }\n catch (derError) {\n if (!(derError instanceof DER.Err))\n throw derError;\n }\n if (!_sig && format !== 'der')\n _sig = Signature.fromCompact(sg);\n }\n P = Point.fromHex(publicKey);\n }\n catch (error) {\n return false;\n }\n if (!_sig)\n return false;\n if (lowS && _sig.hasHighS())\n return false;\n if (prehash)\n msgHash = CURVE.hash(msgHash);\n const { r, s } = _sig;\n const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n const is = invN(s); // s^-1\n const u1 = modN(h * is); // u1 = hs^-1 mod n\n const u2 = modN(r * is); // u2 = rs^-1 mod n\n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n if (!R)\n return false;\n const v = modN(R.x);\n return v === r;\n }\n return {\n CURVE,\n getPublicKey,\n getSharedSecret,\n sign,\n verify,\n ProjectivePoint: Point,\n Signature,\n utils,\n };\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nexport function SWUFpSqrtRatio(Fp, Z) {\n // Generic implementation\n const q = Fp.ORDER;\n let l = _0n;\n for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n l += _1n;\n const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n // 2n ** c1 == 2n << (c1-1)\n const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic\n const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic\n const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic\n const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic\n const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n let sqrtRatio = (u, v) => {\n let tv1 = c6; // 1. tv1 = c6\n let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n // 17. for i in (c1, c1 - 1, ..., 2):\n for (let i = c1; i > _1n; i--) {\n let tv5 = i - _2n; // 18. tv5 = i - 2\n tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5\n let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5\n const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1\n tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1\n tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1\n tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)\n tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)\n }\n return { isValid: isQR, value: tv3 };\n };\n if (Fp.ORDER % _4n === _3n) {\n // sqrt_ratio_3mod4(u, v)\n const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic\n const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n sqrtRatio = (u, v) => {\n let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n };\n }\n // No curves uses that\n // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n return sqrtRatio;\n}\n/**\n * Simplified Shallue-van de Woestijne-Ulas Method\n * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2\n */\nexport function mapToCurveSimpleSWU(Fp, opts) {\n validateField(Fp);\n if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n throw new Error('mapToCurveSimpleSWU: invalid opts');\n const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n if (!Fp.isOdd)\n throw new Error('Fp.isOdd is not implemented!');\n // Input: u, an element of F.\n // Output: (x, y), a point on E.\n return (u) => {\n // prettier-ignore\n let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1\n tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2\n tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1\n tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1\n tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3\n tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)\n tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4\n tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2\n tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3\n const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1\n y = Fp.mul(y, value); // 20. y = y * y1\n x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)\n y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)\n const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)\n y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)\n const tv4_inv = FpInvertBatch(Fp, [tv4], true)[0];\n x = Fp.mul(x, tv4_inv); // 25. x = x / tv4\n return { x, y };\n };\n}\n//# sourceMappingURL=weierstrass.js.map","/**\n * Utilities for short weierstrass curves, combined with noble-hashes.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass } from \"./abstract/weierstrass.js\";\n/** connects noble-curves to noble-hashes */\nexport function getHash(hash) {\n return {\n hash,\n hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)),\n randomBytes,\n };\n}\nexport function createCurve(curveDef, defHash) {\n const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) });\n return { ...create(defHash), create };\n}\n//# sourceMappingURL=_shortw_utils.js.map","/**\n * NIST secp256k1. See [pdf](https://www.secg.org/sec2-v2.pdf).\n *\n * Seems to be rigid (not backdoored)\n * [as per discussion](https://bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975).\n *\n * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.\n * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.\n * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.\n * [See explanation](https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066).\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256 } from '@noble/hashes/sha2';\nimport { randomBytes } from '@noble/hashes/utils';\nimport { createCurve } from \"./_shortw_utils.js\";\nimport { createHasher, isogenyMap } from \"./abstract/hash-to-curve.js\";\nimport { Field, mod, pow2 } from \"./abstract/modular.js\";\nimport { aInRange, bytesToNumberBE, concatBytes, ensureBytes, inRange, numberToBytesBE, } from \"./abstract/utils.js\";\nimport { mapToCurveSimpleSWU } from \"./abstract/weierstrass.js\";\nconst secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f');\nconst secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b) => (a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n const P = secp256k1P;\n // prettier-ignore\n const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n // prettier-ignore\n const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n const b2 = (y * y * y) % P; // x^3, 11\n const b3 = (b2 * b2 * y) % P; // x^7\n const b6 = (pow2(b3, _3n, P) * b3) % P;\n const b9 = (pow2(b6, _3n, P) * b3) % P;\n const b11 = (pow2(b9, _2n, P) * b2) % P;\n const b22 = (pow2(b11, _11n, P) * b11) % P;\n const b44 = (pow2(b22, _22n, P) * b22) % P;\n const b88 = (pow2(b44, _44n, P) * b44) % P;\n const b176 = (pow2(b88, _88n, P) * b88) % P;\n const b220 = (pow2(b176, _44n, P) * b44) % P;\n const b223 = (pow2(b220, _3n, P) * b3) % P;\n const t1 = (pow2(b223, _23n, P) * b22) % P;\n const t2 = (pow2(t1, _6n, P) * b2) % P;\n const root = pow2(t2, _2n, P);\n if (!Fpk1.eql(Fpk1.sqr(root), y))\n throw new Error('Cannot find square root');\n return root;\n}\nconst Fpk1 = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });\n/**\n * secp256k1 curve, ECDSA and ECDH methods.\n *\n * Field: `2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n`\n *\n * @example\n * ```js\n * import { secp256k1 } from '@noble/curves/secp256k1';\n * const priv = secp256k1.utils.randomPrivateKey();\n * const pub = secp256k1.getPublicKey(priv);\n * const msg = new Uint8Array(32).fill(1); // message hash (not message) in ecdsa\n * const sig = secp256k1.sign(msg, priv); // `{prehash: true}` option is available\n * const isValid = secp256k1.verify(sig, msg, pub) === true;\n * ```\n */\nexport const secp256k1 = createCurve({\n a: _0n,\n b: BigInt(7),\n Fp: Fpk1,\n n: secp256k1N,\n Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'),\n Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'),\n h: BigInt(1),\n lowS: true, // Allow only low-S signatures by default in sign() and verify()\n endo: {\n // Endomorphism, see above\n beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n splitScalar: (k) => {\n const n = secp256k1N;\n const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15');\n const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3');\n const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8');\n const b2 = a1;\n const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16)\n const c1 = divNearest(b2 * k, n);\n const c2 = divNearest(-b1 * k, n);\n let k1 = mod(k - c1 * a1 - c2 * a2, n);\n let k2 = mod(-c1 * b1 - c2 * b2, n);\n const k1neg = k1 > POW_2_128;\n const k2neg = k2 > POW_2_128;\n if (k1neg)\n k1 = n - k1;\n if (k2neg)\n k2 = n - k2;\n if (k1 > POW_2_128 || k2 > POW_2_128) {\n throw new Error('splitScalar: Endomorphism failed, k=' + k);\n }\n return { k1neg, k1, k2neg, k2 };\n },\n },\n}, sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n let tagP = TAGGED_HASH_PREFIXES[tag];\n if (tagP === undefined) {\n const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));\n tagP = concatBytes(tagH, tagH);\n TAGGED_HASH_PREFIXES[tag] = tagP;\n }\n return sha256(concatBytes(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toRawBytes(true).slice(1);\nconst numTo32b = (n) => numberToBytesBE(n, 32);\nconst modP = (x) => mod(x, secp256k1P);\nconst modN = (x) => mod(x, secp256k1N);\nconst Point = /* @__PURE__ */ (() => secp256k1.ProjectivePoint)();\nconst GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b);\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey\n let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside\n const scalar = p.hasEvenY() ? d_ : modN(-d_);\n return { scalar: scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n aInRange('x', x, _1n, secp256k1P); // Fail if x ≥ p.\n const xx = modP(x * x);\n const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p.\n if (y % _2n !== _0n)\n y = modP(-y); // Return the unique point P such that x(P) = x and\n const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n p.assertValidity();\n return p;\n}\nconst num = bytesToNumberBE;\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n return modN(num(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(privateKey) {\n return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, privateKey, auxRand = randomBytes(32)) {\n const m = ensureBytes('message', message);\n const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder\n const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n const t = numTo32b(d ^ num(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n const k_ = modN(num(rand)); // Let k' = int(rand) mod n\n if (k_ === _0n)\n throw new Error('sign failed: k is zero'); // Fail if k' = 0.\n const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G.\n const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n sig.set(rx, 0);\n sig.set(numTo32b(modN(k + e * d)), 32);\n // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n if (!schnorrVerify(sig, m, px))\n throw new Error('sign: Invalid signature produced');\n return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n const sig = ensureBytes('signature', signature, 64);\n const m = ensureBytes('message', message);\n const pub = ensureBytes('publicKey', publicKey, 32);\n try {\n const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails\n const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n if (!inRange(r, _1n, secp256k1P))\n return false;\n const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n if (!inRange(s, _1n, secp256k1N))\n return false;\n const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n\n const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P\n if (!R || !R.hasEvenY() || R.toAffine().x !== r)\n return false; // -eP == (n-e)P\n return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n }\n catch (error) {\n return false;\n }\n}\n/**\n * Schnorr signatures over secp256k1.\n * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n * @example\n * ```js\n * import { schnorr } from '@noble/curves/secp256k1';\n * const priv = schnorr.utils.randomPrivateKey();\n * const pub = schnorr.getPublicKey(priv);\n * const msg = new TextEncoder().encode('hello');\n * const sig = schnorr.sign(msg, priv);\n * const isValid = schnorr.verify(sig, msg, pub);\n * ```\n */\nexport const schnorr = /* @__PURE__ */ (() => ({\n getPublicKey: schnorrGetPublicKey,\n sign: schnorrSign,\n verify: schnorrVerify,\n utils: {\n randomPrivateKey: secp256k1.utils.randomPrivateKey,\n lift_x,\n pointToBytes,\n numberToBytesBE,\n bytesToNumberBE,\n taggedHash,\n mod,\n },\n}))();\nconst isoMap = /* @__PURE__ */ (() => isogenyMap(Fpk1, [\n // xNum\n [\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n ],\n // xDen\n [\n '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n // yNum\n [\n '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n ],\n // yDen\n [\n '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fpk1, {\n A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n B: BigInt('1771'),\n Z: Fpk1.create(BigInt('-11')),\n}))();\n/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */\nexport const secp256k1_hasher = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {\n const { x, y } = mapSWU(Fpk1.create(scalars[0]));\n return isoMap(x, y);\n}, {\n DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n p: Fpk1.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha256,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => secp256k1_hasher.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => secp256k1_hasher.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport * as Bytes from './Bytes.js';\nimport * as Errors from './Errors.js';\nimport * as Hex from './Hex.js';\nimport * as Json from './Json.js';\nimport * as Solidity from './Solidity.js';\n/**\n * Asserts that a Signature is valid.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * Signature.assert({\n * r: -49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * yParity: 1,\n * })\n * // @error: InvalidSignatureRError:\n * // @error: Value `-549...n` is an invalid r value.\n * // @error: r must be a positive integer less than 2^256.\n * ```\n *\n * @param signature - The signature object to assert.\n */\nexport function assert(signature, options = {}) {\n const { recovered } = options;\n if (typeof signature.r === 'undefined')\n throw new MissingPropertiesError({ signature });\n if (typeof signature.s === 'undefined')\n throw new MissingPropertiesError({ signature });\n if (recovered && typeof signature.yParity === 'undefined')\n throw new MissingPropertiesError({ signature });\n if (signature.r < 0n || signature.r > Solidity.maxUint256)\n throw new InvalidRError({ value: signature.r });\n if (signature.s < 0n || signature.s > Solidity.maxUint256)\n throw new InvalidSError({ value: signature.s });\n if (typeof signature.yParity === 'number' &&\n signature.yParity !== 0 &&\n signature.yParity !== 1)\n throw new InvalidYParityError({ value: signature.yParity });\n}\n/**\n * Deserializes a {@link ox#Bytes.Bytes} signature into a structured {@link ox#Signature.Signature}.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Signature } from 'ox'\n *\n * Signature.fromBytes(new Uint8Array([128, 3, 131, ...]))\n * // @log: { r: 5231...n, s: 3522...n, yParity: 0 }\n * ```\n *\n * @param signature - The serialized signature.\n * @returns The deserialized {@link ox#Signature.Signature}.\n */\nexport function fromBytes(signature) {\n return fromHex(Hex.fromBytes(signature));\n}\n/**\n * Deserializes a {@link ox#Hex.Hex} signature into a structured {@link ox#Signature.Signature}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * Signature.fromHex('0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c')\n * // @log: { r: 5231...n, s: 3522...n, yParity: 0 }\n * ```\n *\n * @param serialized - The serialized signature.\n * @returns The deserialized {@link ox#Signature.Signature}.\n */\nexport function fromHex(signature) {\n if (signature.length !== 130 && signature.length !== 132)\n throw new InvalidSerializedSizeError({ signature });\n const r = BigInt(Hex.slice(signature, 0, 32));\n const s = BigInt(Hex.slice(signature, 32, 64));\n const yParity = (() => {\n const yParity = Number(`0x${signature.slice(130)}`);\n if (Number.isNaN(yParity))\n return undefined;\n try {\n return vToYParity(yParity);\n }\n catch {\n throw new InvalidYParityError({ value: yParity });\n }\n })();\n if (typeof yParity === 'undefined')\n return {\n r,\n s,\n };\n return {\n r,\n s,\n yParity,\n };\n}\n/**\n * Extracts a {@link ox#Signature.Signature} from an arbitrary object that may include signature properties.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Signature } from 'ox'\n *\n * Signature.extract({\n * baz: 'barry',\n * foo: 'bar',\n * r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * yParity: 1,\n * zebra: 'stripes',\n * })\n * // @log: {\n * // @log: r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * // @log: s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * // @log: yParity: 1\n * // @log: }\n * ```\n *\n * @param value - The arbitrary object to extract the signature from.\n * @returns The extracted {@link ox#Signature.Signature}.\n */\nexport function extract(value) {\n if (typeof value.r === 'undefined')\n return undefined;\n if (typeof value.s === 'undefined')\n return undefined;\n return from(value);\n}\n/**\n * Instantiates a typed {@link ox#Signature.Signature} object from a {@link ox#Signature.Signature}, {@link ox#Signature.Legacy}, {@link ox#Bytes.Bytes}, or {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * Signature.from({\n * r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * yParity: 1,\n * })\n * // @log: {\n * // @log: r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * // @log: s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * // @log: yParity: 1\n * // @log: }\n * ```\n *\n * @example\n * ### From Serialized\n *\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * Signature.from('0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db801')\n * // @log: {\n * // @log: r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * // @log: s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * // @log: yParity: 1,\n * // @log: }\n * ```\n *\n * @example\n * ### From Legacy\n *\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * Signature.from({\n * r: 47323457007453657207889730243826965761922296599680473886588287015755652701072n,\n * s: 57228803202727131502949358313456071280488184270258293674242124340113824882788n,\n * v: 27,\n * })\n * // @log: {\n * // @log: r: 47323457007453657207889730243826965761922296599680473886588287015755652701072n,\n * // @log: s: 57228803202727131502949358313456071280488184270258293674242124340113824882788n,\n * // @log: yParity: 0\n * // @log: }\n * ```\n *\n * @param signature - The signature value to instantiate.\n * @returns The instantiated {@link ox#Signature.Signature}.\n */\nexport function from(signature) {\n const signature_ = (() => {\n if (typeof signature === 'string')\n return fromHex(signature);\n if (signature instanceof Uint8Array)\n return fromBytes(signature);\n if (typeof signature.r === 'string')\n return fromRpc(signature);\n if (signature.v)\n return fromLegacy(signature);\n return {\n r: signature.r,\n s: signature.s,\n ...(typeof signature.yParity !== 'undefined'\n ? { yParity: signature.yParity }\n : {}),\n };\n })();\n assert(signature_);\n return signature_;\n}\n/**\n * Converts a DER-encoded signature to a {@link ox#Signature.Signature}.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Signature } from 'ox'\n *\n * const signature = Signature.fromDerBytes(new Uint8Array([132, 51, 23, ...]))\n * // @log: {\n * // @log: r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * // @log: s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * // @log: }\n * ```\n *\n * @param signature - The DER-encoded signature to convert.\n * @returns The {@link ox#Signature.Signature}.\n */\nexport function fromDerBytes(signature) {\n return fromDerHex(Hex.fromBytes(signature));\n}\n/**\n * Converts a DER-encoded signature to a {@link ox#Signature.Signature}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.fromDerHex('0x304402206e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf02204a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8')\n * // @log: {\n * // @log: r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * // @log: s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * // @log: }\n * ```\n *\n * @param signature - The DER-encoded signature to convert.\n * @returns The {@link ox#Signature.Signature}.\n */\nexport function fromDerHex(signature) {\n const { r, s } = secp256k1.Signature.fromDER(Hex.from(signature).slice(2));\n return { r, s };\n}\n/**\n * Converts a {@link ox#Signature.Legacy} into a {@link ox#Signature.Signature}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const legacy = Signature.fromLegacy({ r: 1n, s: 2n, v: 28 })\n * // @log: { r: 1n, s: 2n, yParity: 1 }\n * ```\n *\n * @param signature - The {@link ox#Signature.Legacy} to convert.\n * @returns The converted {@link ox#Signature.Signature}.\n */\nexport function fromLegacy(signature) {\n return {\n r: signature.r,\n s: signature.s,\n yParity: vToYParity(signature.v),\n };\n}\n/**\n * Converts a {@link ox#Signature.Rpc} into a {@link ox#Signature.Signature}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.fromRpc({\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * })\n * ```\n *\n * @param signature - The {@link ox#Signature.Rpc} to convert.\n * @returns The converted {@link ox#Signature.Signature}.\n */\nexport function fromRpc(signature) {\n const yParity = (() => {\n const v = signature.v ? Number(signature.v) : undefined;\n let yParity = signature.yParity ? Number(signature.yParity) : undefined;\n if (typeof v === 'number' && typeof yParity !== 'number')\n yParity = vToYParity(v);\n if (typeof yParity !== 'number')\n throw new InvalidYParityError({ value: signature.yParity });\n return yParity;\n })();\n return {\n r: BigInt(signature.r),\n s: BigInt(signature.s),\n yParity,\n };\n}\n/**\n * Converts a {@link ox#Signature.Tuple} to a {@link ox#Signature.Signature}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.fromTuple(['0x01', '0x7b', '0x1c8'])\n * // @log: {\n * // @log: r: 123n,\n * // @log: s: 456n,\n * // @log: yParity: 1,\n * // @log: }\n * ```\n *\n * @param tuple - The {@link ox#Signature.Tuple} to convert.\n * @returns The {@link ox#Signature.Signature}.\n */\nexport function fromTuple(tuple) {\n const [yParity, r, s] = tuple;\n return from({\n r: r === '0x' ? 0n : BigInt(r),\n s: s === '0x' ? 0n : BigInt(s),\n yParity: yParity === '0x' ? 0 : Number(yParity),\n });\n}\n/**\n * Serializes a {@link ox#Signature.Signature} to {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.toBytes({\n * r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * yParity: 1\n * })\n * // @log: Uint8Array [102, 16, 10, ...]\n * ```\n *\n * @param signature - The signature to serialize.\n * @returns The serialized signature.\n */\nexport function toBytes(signature) {\n return Bytes.fromHex(toHex(signature));\n}\n/**\n * Serializes a {@link ox#Signature.Signature} to {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.toHex({\n * r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * yParity: 1\n * })\n * // @log: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c'\n * ```\n *\n * @param signature - The signature to serialize.\n * @returns The serialized signature.\n */\nexport function toHex(signature) {\n assert(signature);\n const r = signature.r;\n const s = signature.s;\n const signature_ = Hex.concat(Hex.fromNumber(r, { size: 32 }), Hex.fromNumber(s, { size: 32 }), \n // If the signature is recovered, add the recovery byte to the signature.\n typeof signature.yParity === 'number'\n ? Hex.fromNumber(yParityToV(signature.yParity), { size: 1 })\n : '0x');\n return signature_;\n}\n/**\n * Converts a {@link ox#Signature.Signature} to DER-encoded format.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.from({\n * r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * })\n *\n * const signature_der = Signature.toDerBytes(signature)\n * // @log: Uint8Array [132, 51, 23, ...]\n * ```\n *\n * @param signature - The signature to convert.\n * @returns The DER-encoded signature.\n */\nexport function toDerBytes(signature) {\n const sig = new secp256k1.Signature(signature.r, signature.s);\n return sig.toDERRawBytes();\n}\n/**\n * Converts a {@link ox#Signature.Signature} to DER-encoded format.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.from({\n * r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * })\n *\n * const signature_der = Signature.toDerHex(signature)\n * // @log: '0x304402206e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf02204a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8'\n * ```\n *\n * @param signature - The signature to convert.\n * @returns The DER-encoded signature.\n */\nexport function toDerHex(signature) {\n const sig = new secp256k1.Signature(signature.r, signature.s);\n return `0x${sig.toDERHex()}`;\n}\n/**\n * Converts a {@link ox#Signature.Signature} into a {@link ox#Signature.Legacy}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const legacy = Signature.toLegacy({ r: 1n, s: 2n, yParity: 1 })\n * // @log: { r: 1n, s: 2n, v: 28 }\n * ```\n *\n * @param signature - The {@link ox#Signature.Signature} to convert.\n * @returns The converted {@link ox#Signature.Legacy}.\n */\nexport function toLegacy(signature) {\n return {\n r: signature.r,\n s: signature.s,\n v: yParityToV(signature.yParity),\n };\n}\n/**\n * Converts a {@link ox#Signature.Signature} into a {@link ox#Signature.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signature = Signature.toRpc({\n * r: 49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * yParity: 1\n * })\n * ```\n *\n * @param signature - The {@link ox#Signature.Signature} to convert.\n * @returns The converted {@link ox#Signature.Rpc}.\n */\nexport function toRpc(signature) {\n const { r, s, yParity } = signature;\n return {\n r: Hex.fromNumber(r, { size: 32 }),\n s: Hex.fromNumber(s, { size: 32 }),\n yParity: yParity === 0 ? '0x0' : '0x1',\n };\n}\n/**\n * Converts a {@link ox#Signature.Signature} to a serialized {@link ox#Signature.Tuple} to be used for signatures in Transaction Envelopes, EIP-7702 Authorization Lists, etc.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const signatureTuple = Signature.toTuple({\n * r: 123n,\n * s: 456n,\n * yParity: 1,\n * })\n * // @log: [yParity: '0x01', r: '0x7b', s: '0x1c8']\n * ```\n *\n * @param signature - The {@link ox#Signature.Signature} to convert.\n * @returns The {@link ox#Signature.Tuple}.\n */\nexport function toTuple(signature) {\n const { r, s, yParity } = signature;\n return [\n yParity ? '0x01' : '0x',\n r === 0n ? '0x' : Hex.trimLeft(Hex.fromNumber(r)),\n s === 0n ? '0x' : Hex.trimLeft(Hex.fromNumber(s)),\n ];\n}\n/**\n * Validates a Signature. Returns `true` if the signature is valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const valid = Signature.validate({\n * r: -49782753348462494199823712700004552394425719014458918871452329774910450607807n,\n * s: 33726695977844476214676913201140481102225469284307016937915595756355928419768n,\n * yParity: 1,\n * })\n * // @log: false\n * ```\n *\n * @param signature - The signature object to assert.\n */\nexport function validate(signature, options = {}) {\n try {\n assert(signature, options);\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * Converts a ECDSA `v` value to a `yParity` value.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const yParity = Signature.vToYParity(28)\n * // @log: 1\n * ```\n *\n * @param v - The ECDSA `v` value to convert.\n * @returns The `yParity` value.\n */\nexport function vToYParity(v) {\n if (v === 0 || v === 27)\n return 0;\n if (v === 1 || v === 28)\n return 1;\n if (v >= 35)\n return v % 2 === 0 ? 1 : 0;\n throw new InvalidVError({ value: v });\n}\n/**\n * Converts a ECDSA `v` value to a `yParity` value.\n *\n * @example\n * ```ts twoslash\n * import { Signature } from 'ox'\n *\n * const v = Signature.yParityToV(1)\n * // @log: 28\n * ```\n *\n * @param yParity - The ECDSA `yParity` value to convert.\n * @returns The `v` value.\n */\nexport function yParityToV(yParity) {\n if (yParity === 0)\n return 27;\n if (yParity === 1)\n return 28;\n throw new InvalidYParityError({ value: yParity });\n}\n/** Thrown when the serialized signature is of an invalid size. */\nexport class InvalidSerializedSizeError extends Errors.BaseError {\n constructor({ signature }) {\n super(`Value \\`${signature}\\` is an invalid signature size.`, {\n metaMessages: [\n 'Expected: 64 bytes or 65 bytes.',\n `Received ${Hex.size(Hex.from(signature))} bytes.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Signature.InvalidSerializedSizeError'\n });\n }\n}\n/** Thrown when the signature is missing either an `r`, `s`, or `yParity` property. */\nexport class MissingPropertiesError extends Errors.BaseError {\n constructor({ signature }) {\n super(`Signature \\`${Json.stringify(signature)}\\` is missing either an \\`r\\`, \\`s\\`, or \\`yParity\\` property.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Signature.MissingPropertiesError'\n });\n }\n}\n/** Thrown when the signature has an invalid `r` value. */\nexport class InvalidRError extends Errors.BaseError {\n constructor({ value }) {\n super(`Value \\`${value}\\` is an invalid r value. r must be a positive integer less than 2^256.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Signature.InvalidRError'\n });\n }\n}\n/** Thrown when the signature has an invalid `s` value. */\nexport class InvalidSError extends Errors.BaseError {\n constructor({ value }) {\n super(`Value \\`${value}\\` is an invalid s value. s must be a positive integer less than 2^256.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Signature.InvalidSError'\n });\n }\n}\n/** Thrown when the signature has an invalid `yParity` value. */\nexport class InvalidYParityError extends Errors.BaseError {\n constructor({ value }) {\n super(`Value \\`${value}\\` is an invalid y-parity value. Y-parity must be 0 or 1.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Signature.InvalidYParityError'\n });\n }\n}\n/** Thrown when the signature has an invalid `v` value. */\nexport class InvalidVError extends Errors.BaseError {\n constructor({ value }) {\n super(`Value \\`${value}\\` is an invalid v value. v must be 27, 28 or >=35.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'Signature.InvalidVError'\n });\n }\n}\n//# sourceMappingURL=Signature.js.map","import * as Hash from './Hash.js';\nimport * as Hex from './Hex.js';\nimport * as Rlp from './Rlp.js';\nimport * as Signature from './Signature.js';\n/**\n * Converts an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization object into a typed {@link ox#Authorization.Authorization}.\n *\n * @example\n * An Authorization can be instantiated from an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n * ```\n *\n * @example\n * ### Attaching Signatures\n *\n * A {@link ox#Signature.Signature} can be attached with the `signature` option. The example below demonstrates signing\n * an Authorization with {@link ox#Secp256k1.(sign:function)}.\n *\n * ```ts twoslash\n * import { Authorization, Secp256k1 } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * chainId: 1,\n * nonce: 40n,\n * })\n *\n * const signature = Secp256k1.sign({\n * payload: Authorization.getSignPayload(authorization),\n * privateKey: '0x...',\n * })\n *\n * const authorization_signed = Authorization.from(authorization, { signature }) // [!code focus]\n * ```\n *\n * @param authorization - An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.\n * @param options - Authorization options.\n * @returns The {@link ox#Authorization.Authorization}.\n */\nexport function from(authorization, options = {}) {\n if (typeof authorization.chainId === 'string')\n return fromRpc(authorization);\n return { ...authorization, ...options.signature };\n}\n/**\n * Converts an {@link ox#Authorization.Rpc} to an {@link ox#Authorization.Authorization}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromRpc({\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: '0x1',\n * nonce: '0x1',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * })\n * ```\n *\n * @param authorization - The RPC-formatted Authorization.\n * @returns A signed {@link ox#Authorization.Authorization}.\n */\nexport function fromRpc(authorization) {\n const { address, chainId, nonce } = authorization;\n const signature = Signature.extract(authorization);\n return {\n address,\n chainId: Number(chainId),\n nonce: BigInt(nonce),\n ...signature,\n };\n}\n/**\n * Converts an {@link ox#Authorization.ListRpc} to an {@link ox#Authorization.List}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromRpcList([{\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: '0x1',\n * nonce: '0x1',\n * r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',\n * s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',\n * yParity: '0x0',\n * }])\n * ```\n *\n * @param authorizationList - The RPC-formatted Authorization list.\n * @returns A signed {@link ox#Authorization.List}.\n */\nexport function fromRpcList(authorizationList) {\n return authorizationList.map(fromRpc);\n}\n/**\n * Converts an {@link ox#Authorization.Tuple} to an {@link ox#Authorization.Authorization}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromTuple([\n * '0x1',\n * '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * '0x3'\n * ])\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n\n * // @log: }\n * ```\n *\n * @example\n * It is also possible to append a Signature tuple to the end of an Authorization tuple.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.fromTuple([\n * '0x1',\n * '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * '0x3',\n * '0x1',\n * '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90',\n * '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064',\n * ])\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: }\n * ```\n *\n * @param tuple - The [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple.\n * @returns The {@link ox#Authorization.Authorization}.\n */\nexport function fromTuple(tuple) {\n const [chainId, address, nonce, yParity, r, s] = tuple;\n let args = {\n address,\n chainId: chainId === '0x' ? 0 : Number(chainId),\n nonce: nonce === '0x' ? 0n : BigInt(nonce),\n };\n if (yParity && r && s)\n args = { ...args, ...Signature.fromTuple([yParity, r, s]) };\n return from(args);\n}\n/**\n * Converts an {@link ox#Authorization.TupleList} to an {@link ox#Authorization.List}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromTupleList([\n * ['0x1', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x3'],\n * ['0x3', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x14'],\n * ])\n * // @log: [\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n,\n * // @log: },\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: },\n * // @log: ]\n * ```\n *\n * @example\n * It is also possible to append a Signature tuple to the end of an Authorization tuple.\n *\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorizationList = Authorization.fromTupleList([\n * ['0x1', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x3', '0x1', '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90', '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'],\n * ['0x3', '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c', '0x14', '0x1', '0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90', '0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'],\n * ])\n * // @log: [\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 1,\n * // @log: nonce: 3n,\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: },\n * // @log: {\n * // @log: address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),\n * // @log: s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),\n * // @log: yParity: 0,\n * // @log: },\n * // @log: ]\n * ```\n *\n * @param tupleList - The [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple list.\n * @returns An {@link ox#Authorization.List}.\n */\nexport function fromTupleList(tupleList) {\n const list = [];\n for (const tuple of tupleList)\n list.push(fromTuple(tuple));\n return list;\n}\n/**\n * Computes the sign payload for an {@link ox#Authorization.Authorization} in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.\n *\n * @example\n * The example below demonstrates computing the sign payload for an {@link ox#Authorization.Authorization}. This payload\n * can then be passed to signing functions like {@link ox#Secp256k1.(sign:function)}.\n *\n * ```ts twoslash\n * import { Authorization, Secp256k1 } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const payload = Authorization.getSignPayload(authorization) // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload,\n * privateKey: '0x...',\n * })\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns The sign payload.\n */\nexport function getSignPayload(authorization) {\n return hash(authorization, { presign: true });\n}\n/**\n * Computes the hash for an {@link ox#Authorization.Authorization} in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const hash = Authorization.hash(authorization) // [!code focus]\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns The hash.\n */\nexport function hash(authorization, options = {}) {\n const { presign } = options;\n return Hash.keccak256(Hex.concat('0x05', Rlp.fromHex(toTuple(presign\n ? {\n address: authorization.address,\n chainId: authorization.chainId,\n nonce: authorization.nonce,\n }\n : authorization))));\n}\n/**\n * Converts an {@link ox#Authorization.Authorization} to an {@link ox#Authorization.Rpc}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.toRpc({\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: 1,\n * nonce: 1n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * })\n * ```\n *\n * @param authorization - An Authorization.\n * @returns An RPC-formatted Authorization.\n */\nexport function toRpc(authorization) {\n const { address, chainId, nonce, ...signature } = authorization;\n return {\n address,\n chainId: Hex.fromNumber(chainId),\n nonce: Hex.fromNumber(nonce),\n ...Signature.toRpc(signature),\n };\n}\n/**\n * Converts an {@link ox#Authorization.List} to an {@link ox#Authorization.ListRpc}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.toRpcList([{\n * address: '0x0000000000000000000000000000000000000000',\n * chainId: 1,\n * nonce: 1n,\n * r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,\n * s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,\n * yParity: 0,\n * }])\n * ```\n *\n * @param authorizationList - An Authorization List.\n * @returns An RPC-formatted Authorization List.\n */\nexport function toRpcList(authorizationList) {\n return authorizationList.map(toRpc);\n}\n/**\n * Converts an {@link ox#Authorization.Authorization} to an {@link ox#Authorization.Tuple}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n *\n * const tuple = Authorization.toTuple(authorization) // [!code focus]\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 1,\n * // @log: nonce: 69n,\n * // @log: ]\n * ```\n *\n * @param authorization - The {@link ox#Authorization.Authorization}.\n * @returns An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple.\n */\nexport function toTuple(authorization) {\n const { address, chainId, nonce } = authorization;\n const signature = Signature.extract(authorization);\n return [\n chainId ? Hex.fromNumber(chainId) : '0x',\n address,\n nonce ? Hex.fromNumber(nonce) : '0x',\n ...(signature ? Signature.toTuple(signature) : []),\n ];\n}\n/**\n * Converts an {@link ox#Authorization.List} to an {@link ox#Authorization.TupleList}.\n *\n * @example\n * ```ts twoslash\n * import { Authorization } from 'ox'\n *\n * const authorization_1 = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 1,\n * nonce: 69n,\n * })\n * const authorization_2 = Authorization.from({\n * address: '0x1234567890abcdef1234567890abcdef12345678',\n * chainId: 3,\n * nonce: 20n,\n * })\n *\n * const tuple = Authorization.toTupleList([authorization_1, authorization_2]) // [!code focus]\n * // @log: [\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 1,\n * // @log: nonce: 69n,\n * // @log: ],\n * // @log: [\n * // @log: address: '0x1234567890abcdef1234567890abcdef12345678',\n * // @log: chainId: 3,\n * // @log: nonce: 20n,\n * // @log: ],\n * // @log: ]\n * ```\n *\n * @param list - An {@link ox#Authorization.List}.\n * @returns An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple list.\n */\nexport function toTupleList(list) {\n if (!list || list.length === 0)\n return [];\n const tupleList = [];\n for (const authorization of list)\n tupleList.push(toTuple(authorization));\n return tupleList;\n}\n//# sourceMappingURL=Authorization.js.map","import * as AbiParameters from '../core/AbiParameters.js';\nimport * as Authorization from '../core/Authorization.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\nimport * as Secp256k1 from '../core/Secp256k1.js';\nimport * as Signature from '../core/Signature.js';\n/**\n * Magic bytes used to identify ERC-8010 wrapped signatures.\n */\nexport const magicBytes = '0x8010801080108010801080108010801080108010801080108010801080108010';\n/** Suffix ABI parameters for the ERC-8010 wrapped signature. */\nexport const suffixParameters = AbiParameters.from('(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data');\n/**\n * Asserts that the wrapped signature is valid.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * SignatureErc8010.assert('0xdeadbeef')\n * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-8010 wrapped signature.\n * ```\n *\n * @param value - The value to assert.\n */\nexport function assert(value) {\n if (typeof value === 'string') {\n if (Hex.slice(value, -32) !== magicBytes)\n throw new InvalidWrappedSignatureError(value);\n }\n else\n Signature.assert(value.authorization);\n}\n/**\n * Parses an [ERC-8010 wrapped signature](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1 } from 'ox'\n * import { SignatureErc8010 } from 'ox/erc8010' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * // Instantiate from serialized format. // [!code focus]\n * const wrapped = SignatureErc8010.from('0x...') // [!code focus]\n * // @log: { authorization: { ... }, data: '0x...', signature: { ... } } // [!code focus]\n *\n * // Instantiate from constituent parts. // [!code focus]\n * const wrapped = SignatureErc8010.from({ // [!code focus]\n * authorization: { ... }, // [!code focus]\n * data: '0x...', // [!code focus]\n * signature, // [!code focus]\n * })\n * // @log: { authorization: { ... }, data: '0x...', signature: { ... } }\n * ```\n *\n * @param value - Value to parse.\n * @returns Parsed value.\n */\nexport function from(value) {\n if (typeof value === 'string')\n return unwrap(value);\n return value;\n}\n/**\n * Unwraps an [ERC-8010 wrapped signature](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * const { authorization, data, signature } = SignatureErc8010.unwrap('0x...')\n * ```\n *\n * @param wrapped - Wrapped signature to unwrap.\n * @returns Unwrapped signature.\n */\nexport function unwrap(wrapped) {\n assert(wrapped);\n const suffixLength = Hex.toNumber(Hex.slice(wrapped, -64, -32));\n const suffix = Hex.slice(wrapped, -suffixLength - 64, -64);\n const signature = Hex.slice(wrapped, 0, -suffixLength - 64);\n const [auth, to, data] = AbiParameters.decode(suffixParameters, suffix);\n const authorization = Authorization.from({\n address: auth.delegation,\n chainId: Number(auth.chainId),\n nonce: auth.nonce,\n yParity: auth.yParity,\n r: auth.r,\n s: auth.s,\n });\n return {\n authorization,\n signature,\n ...(data && data !== '0x' ? { data, to } : {}),\n };\n}\n/**\n * Wraps a signature into [ERC-8010 format](https://github.com/jxom/ERCs/blob/16f7e3891fff2e1e9c25dea0485497739db8a816/ERCS/erc-8010.md).\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1, Signature } from 'ox'\n * import { SignatureErc8010 } from 'ox/erc8010' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * const wrapped = SignatureErc8010.wrap({ // [!code focus]\n * authorization: { ... }, // [!code focus]\n * data: '0xdeadbeef', // [!code focus]\n * signature: Signature.toHex(signature), // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param value - Values to wrap.\n * @returns Wrapped signature.\n */\nexport function wrap(value) {\n const { data, signature } = value;\n assert(value);\n const self = Secp256k1.recoverAddress({\n payload: Authorization.getSignPayload(value.authorization),\n signature: Signature.from(value.authorization),\n });\n const suffix = AbiParameters.encode(suffixParameters, [\n {\n ...value.authorization,\n delegation: value.authorization.address,\n chainId: BigInt(value.authorization.chainId),\n },\n value.to ?? self,\n data ?? '0x',\n ]);\n const suffixLength = Hex.fromNumber(Hex.size(suffix), { size: 32 });\n return Hex.concat(signature, suffix, suffixLength, magicBytes);\n}\n/**\n * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc8010 } from 'ox/erc8010'\n *\n * const valid = SignatureErc8010.validate('0xdeadbeef')\n * // @log: false\n * ```\n *\n * @param value - The value to validate.\n * @returns `true` if the value is valid, `false` otherwise.\n */\nexport function validate(value) {\n try {\n assert(value);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when the ERC-8010 wrapped signature is invalid. */\nexport class InvalidWrappedSignatureError extends Errors.BaseError {\n constructor(wrapped) {\n super(`Value \\`${wrapped}\\` is an invalid ERC-8010 wrapped signature.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SignatureErc8010.InvalidWrappedSignatureError'\n });\n }\n}\n//# sourceMappingURL=SignatureErc8010.js.map","import { erc6492MagicBytes } from '../../constants/bytes.js';\nimport { encodeAbiParameters } from '../abi/encodeAbiParameters.js';\nimport { concatHex } from '../data/concat.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\n/**\n * @description Serializes a ERC-6492 flavoured signature into hex format.\n *\n * @param signature ERC-6492 signature in object format.\n * @returns ERC-6492 signature in hex format.\n *\n * @example\n * serializeSignature({ address: '0x...', data: '0x...', signature: '0x...' })\n * // '0x000000000000000000000000cafebabecafebabecafebabecafebabecafebabe000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004deadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a461f509887bd19e312c0c58467ce8ff8e300d3c1a90b608a760c5b80318eaf15fe57c96f9175d6cd4daad4663763baa7e78836e067d0163e9a2ccf2ff753f5b1b000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492'\n */\nexport function serializeErc6492Signature(parameters) {\n const { address, data, signature, to = 'hex' } = parameters;\n const signature_ = concatHex([\n encodeAbiParameters([{ type: 'address' }, { type: 'bytes' }, { type: 'bytes' }], [address, data, signature]),\n erc6492MagicBytes,\n ]);\n if (to === 'hex')\n return signature_;\n return hexToBytes(signature_);\n}\n//# sourceMappingURL=serializeErc6492Signature.js.map","export const erc6492MagicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';\nexport const zeroHash = '0x0000000000000000000000000000000000000000000000000000000000000000';\n//# sourceMappingURL=bytes.js.map","import { BaseError } from './base.js';\nexport class InvalidDecimalNumberError extends BaseError {\n constructor({ value }) {\n super(`Number \\`${value}\\` is not a valid decimal number.`, {\n name: 'InvalidDecimalNumberError',\n });\n }\n}\n//# sourceMappingURL=unit.js.map","import { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatProof, } from '../../utils/formatters/proof.js';\n/**\n * Returns the account and storage values of the specified account including the Merkle-proof.\n *\n * - Docs: https://viem.sh/docs/actions/public/getProof\n * - JSON-RPC Methods:\n * - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186)\n *\n * @param client - Client to use\n * @param parameters - {@link GetProofParameters}\n * @returns Proof data. {@link GetProofReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getProof } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const block = await getProof(client, {\n * address: '0x...',\n * storageKeys: ['0x...'],\n * })\n */\nexport async function getProof(client, { address, blockNumber, blockTag: blockTag_, storageKeys, }) {\n const blockTag = blockTag_ ?? 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const proof = await client.request({\n method: 'eth_getProof',\n params: [address, storageKeys, blockNumberHex || blockTag],\n });\n return formatProof(proof);\n}\n//# sourceMappingURL=getProof.js.map","import { hexToNumber } from '../index.js';\nfunction formatStorageProof(storageProof) {\n return storageProof.map((proof) => ({\n ...proof,\n value: BigInt(proof.value),\n }));\n}\nexport function formatProof(proof) {\n return {\n ...proof,\n balance: proof.balance ? BigInt(proof.balance) : undefined,\n nonce: proof.nonce ? hexToNumber(proof.nonce) : undefined,\n storageProof: proof.storageProof\n ? formatStorageProof(proof.storageProof)\n : undefined,\n };\n}\n//# sourceMappingURL=proof.js.map","import { TransactionNotFoundError, } from '../../errors/transaction.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { formatTransaction, } from '../../utils/formatters/transaction.js';\n/**\n * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransaction\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionParameters}\n * @returns The transaction information. {@link GetTransactionReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransaction } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transaction = await getTransaction(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransaction(client, { blockHash, blockNumber, blockTag: blockTag_, hash, index, }) {\n const blockTag = blockTag_ || 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let transaction = null;\n if (hash) {\n transaction = await client.request({\n method: 'eth_getTransactionByHash',\n params: [hash],\n }, { dedupe: true });\n }\n else if (blockHash) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockHashAndIndex',\n params: [blockHash, numberToHex(index)],\n }, { dedupe: true });\n }\n else if (blockNumberHex || blockTag) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockNumberAndIndex',\n params: [blockNumberHex || blockTag, numberToHex(index)],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n if (!transaction)\n throw new TransactionNotFoundError({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n });\n const format = client.chain?.formatters?.transaction?.format || formatTransaction;\n return format(transaction, 'getTransaction');\n}\n//# sourceMappingURL=getTransaction.js.map","import { TransactionReceiptNotFoundError, } from '../../errors/transaction.js';\nimport { formatTransactionReceipt, } from '../../utils/formatters/transactionReceipt.js';\n/**\n * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionReceiptParameters}\n * @returns The transaction receipt. {@link GetTransactionReceiptReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionReceipt } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionReceipt = await getTransactionReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionReceipt(client, { hash }) {\n const receipt = await client.request({\n method: 'eth_getTransactionReceipt',\n params: [hash],\n }, { dedupe: true });\n if (!receipt)\n throw new TransactionReceiptNotFoundError({ hash });\n const format = client.chain?.formatters?.transactionReceipt?.format ||\n formatTransactionReceipt;\n return format(receipt, 'getTransactionReceipt');\n}\n//# sourceMappingURL=getTransactionReceipt.js.map","import * as BlockOverrides from 'ox/BlockOverrides';\nimport { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { RawContractError } from '../../errors/contract.js';\nimport { UnknownNodeError } from '../../errors/node.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { concat } from '../../utils/data/concat.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { getNodeError, } from '../../utils/errors/getNodeError.js';\nimport { formatBlock, } from '../../utils/formatters/block.js';\nimport { formatLog } from '../../utils/formatters/log.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { serializeStateOverride, } from '../../utils/stateOverride.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\n/**\n * Simulates a set of calls on block(s) with optional block and state overrides.\n *\n * @example\n * ```ts\n * import { createClient, http, parseEther } from 'viem'\n * import { simulate } from 'viem/actions'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const result = await simulate(client, {\n * blocks: [{\n * blockOverrides: {\n * number: 69420n,\n * },\n * calls: [{\n * {\n * account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',\n * data: '0xdeadbeef',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * },\n * {\n * account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: parseEther('1'),\n * },\n * }],\n * stateOverrides: [{\n * address: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',\n * balance: parseEther('10'),\n * }],\n * }]\n * })\n * ```\n *\n * @param client - Client to use.\n * @param parameters - {@link SimulateBlocksParameters}\n * @returns Simulated blocks. {@link SimulateBlocksReturnType}\n */\nexport async function simulateBlocks(client, parameters) {\n const { blockNumber, blockTag = client.experimental_blockTag ?? 'latest', blocks, returnFullTransactions, traceTransfers, validation, } = parameters;\n try {\n const blockStateCalls = [];\n for (const block of blocks) {\n const blockOverrides = block.blockOverrides\n ? BlockOverrides.toRpc(block.blockOverrides)\n : undefined;\n const calls = block.calls.map((call_) => {\n const call = call_;\n const account = call.account ? parseAccount(call.account) : undefined;\n const data = call.abi ? encodeFunctionData(call) : call.data;\n const request = {\n ...call,\n data: call.dataSuffix\n ? concat([data || '0x', call.dataSuffix])\n : data,\n from: call.from ?? account?.address,\n };\n assertRequest(request);\n return formatTransactionRequest(request);\n });\n const stateOverrides = block.stateOverrides\n ? serializeStateOverride(block.stateOverrides)\n : undefined;\n blockStateCalls.push({\n blockOverrides,\n calls,\n stateOverrides,\n });\n }\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const result = await client.request({\n method: 'eth_simulateV1',\n params: [\n { blockStateCalls, returnFullTransactions, traceTransfers, validation },\n block,\n ],\n });\n return result.map((block, i) => ({\n ...formatBlock(block),\n calls: block.calls.map((call, j) => {\n const { abi, args, functionName, to } = blocks[i].calls[j];\n const data = call.error?.data ?? call.returnData;\n const gasUsed = BigInt(call.gasUsed);\n const logs = call.logs?.map((log) => formatLog(log));\n const status = call.status === '0x1' ? 'success' : 'failure';\n const result = abi && status === 'success' && data !== '0x'\n ? decodeFunctionResult({\n abi,\n data,\n functionName,\n })\n : null;\n const error = (() => {\n if (status === 'success')\n return undefined;\n let error;\n if (call.error?.data === '0x')\n error = new AbiDecodingZeroDataError();\n else if (call.error)\n error = new RawContractError(call.error);\n if (!error)\n return undefined;\n return getContractError(error, {\n abi: (abi ?? []),\n address: to ?? '0x',\n args,\n functionName: functionName ?? '<unknown>',\n });\n })();\n return {\n data,\n gasUsed,\n logs,\n status,\n ...(status === 'success'\n ? {\n result,\n }\n : {\n error,\n }),\n };\n }),\n }));\n }\n catch (e) {\n const cause = e;\n const error = getNodeError(cause, {});\n if (error instanceof UnknownNodeError)\n throw cause;\n throw error;\n }\n}\n//# sourceMappingURL=simulateBlocks.js.map","import * as Address from '../Address.js';\nimport * as Errors from '../Errors.js';\n/** @internal */\nexport function normalizeSignature(signature) {\n let active = true;\n let current = '';\n let level = 0;\n let result = '';\n let valid = false;\n for (let i = 0; i < signature.length; i++) {\n const char = signature[i];\n // If the character is a separator, we want to reactivate.\n if (['(', ')', ','].includes(char))\n active = true;\n // If the character is a \"level\" token, we want to increment/decrement.\n if (char === '(')\n level++;\n if (char === ')')\n level--;\n // If we aren't active, we don't want to mutate the result.\n if (!active)\n continue;\n // If level === 0, we are at the definition level.\n if (level === 0) {\n if (char === ' ' && ['event', 'function', 'error', ''].includes(result))\n result = '';\n else {\n result += char;\n // If we are at the end of the definition, we must be finished.\n if (char === ')') {\n valid = true;\n break;\n }\n }\n continue;\n }\n // Ignore spaces\n if (char === ' ') {\n // If the previous character is a separator, and the current section isn't empty, we want to deactivate.\n if (signature[i - 1] !== ',' && current !== ',' && current !== ',(') {\n current = '';\n active = false;\n }\n continue;\n }\n result += char;\n current += char;\n }\n if (!valid)\n throw new Errors.BaseError('Unable to normalize signature.');\n return result;\n}\n/** @internal */\nexport function isArgOfType(arg, abiParameter) {\n const argType = typeof arg;\n const abiParameterType = abiParameter.type;\n switch (abiParameterType) {\n case 'address':\n return Address.validate(arg, { strict: false });\n case 'bool':\n return argType === 'boolean';\n case 'function':\n return argType === 'string';\n case 'string':\n return argType === 'string';\n default: {\n if (abiParameterType === 'tuple' && 'components' in abiParameter)\n return Object.values(abiParameter.components).every((component, index) => {\n return isArgOfType(Object.values(arg)[index], component);\n });\n // `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n // https://regexr.com/6v8hp\n if (/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(abiParameterType))\n return argType === 'number' || argType === 'bigint';\n // `bytes<M>`: binary type of `M` bytes, `0 < M <= 32`\n // https://regexr.com/6va55\n if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType))\n return argType === 'string' || arg instanceof Uint8Array;\n // fixed-length (`<type>[M]`) and dynamic (`<type>[]`) arrays\n // https://regexr.com/6va6i\n if (/[a-z]+[1-9]{0,3}(\\[[0-9]{0,}\\])+$/.test(abiParameterType)) {\n return (Array.isArray(arg) &&\n arg.every((x) => isArgOfType(x, {\n ...abiParameter,\n // Pop off `[]` or `[M]` from end of type\n type: abiParameterType.replace(/(\\[[0-9]{0,}\\])$/, ''),\n })));\n }\n return false;\n }\n }\n}\n/** @internal */\nexport function getAmbiguousTypes(sourceParameters, targetParameters, args) {\n for (const parameterIndex in sourceParameters) {\n const sourceParameter = sourceParameters[parameterIndex];\n const targetParameter = targetParameters[parameterIndex];\n if (sourceParameter.type === 'tuple' &&\n targetParameter.type === 'tuple' &&\n 'components' in sourceParameter &&\n 'components' in targetParameter)\n return getAmbiguousTypes(sourceParameter.components, targetParameter.components, args[parameterIndex]);\n const types = [sourceParameter.type, targetParameter.type];\n const ambiguous = (() => {\n if (types.includes('address') && types.includes('bytes20'))\n return true;\n if (types.includes('address') && types.includes('string'))\n return Address.validate(args[parameterIndex], {\n strict: false,\n });\n if (types.includes('address') && types.includes('bytes'))\n return Address.validate(args[parameterIndex], {\n strict: false,\n });\n return false;\n })();\n if (ambiguous)\n return types;\n }\n return;\n}\n//# sourceMappingURL=abiItem.js.map","import * as abitype from 'abitype';\nimport * as Errors from './Errors.js';\nimport * as Hash from './Hash.js';\nimport * as Hex from './Hex.js';\nimport * as internal from './internal/abiItem.js';\n/**\n * Formats an {@link ox#AbiItem.AbiItem} into a **Human Readable ABI Item**.\n *\n * @example\n * ```ts twoslash\n * import { AbiItem } from 'ox'\n *\n * const formatted = AbiItem.format({\n * type: 'function',\n * name: 'approve',\n * stateMutability: 'nonpayable',\n * inputs: [\n * {\n * name: 'spender',\n * type: 'address',\n * },\n * {\n * name: 'amount',\n * type: 'uint256',\n * },\n * ],\n * outputs: [{ type: 'bool' }],\n * })\n *\n * formatted\n * // ^?\n *\n *\n * ```\n *\n * @param abiItem - The ABI Item to format.\n * @returns The formatted ABI Item .\n */\nexport function format(abiItem) {\n return abitype.formatAbiItem(abiItem);\n}\n/**\n * Parses an arbitrary **JSON ABI Item** or **Human Readable ABI Item** into a typed {@link ox#AbiItem.AbiItem}.\n *\n * @example\n * ### JSON ABIs\n *\n * ```ts twoslash\n * import { AbiItem } from 'ox'\n *\n * const abiItem = AbiItem.from({\n * type: 'function',\n * name: 'approve',\n * stateMutability: 'nonpayable',\n * inputs: [\n * {\n * name: 'spender',\n * type: 'address',\n * },\n * {\n * name: 'amount',\n * type: 'uint256',\n * },\n * ],\n * outputs: [{ type: 'bool' }],\n * })\n *\n * abiItem\n * //^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * ### Human Readable ABIs\n *\n * A Human Readable ABI can be parsed into a typed ABI object:\n *\n * ```ts twoslash\n * import { AbiItem } from 'ox'\n *\n * const abiItem = AbiItem.from(\n * 'function approve(address spender, uint256 amount) returns (bool)' // [!code hl]\n * )\n *\n * abiItem\n * //^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * It is possible to specify `struct`s along with your definitions:\n *\n * ```ts twoslash\n * import { AbiItem } from 'ox'\n *\n * const abiItem = AbiItem.from([\n * 'struct Foo { address spender; uint256 amount; }', // [!code hl]\n * 'function approve(Foo foo) returns (bool)',\n * ])\n *\n * abiItem\n * //^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n *\n *\n * @param abiItem - The ABI Item to parse.\n * @returns The typed ABI Item.\n */\nexport function from(abiItem, options = {}) {\n const { prepare = true } = options;\n const item = (() => {\n if (Array.isArray(abiItem))\n return abitype.parseAbiItem(abiItem);\n if (typeof abiItem === 'string')\n return abitype.parseAbiItem(abiItem);\n return abiItem;\n })();\n return {\n ...item,\n ...(prepare ? { hash: getSignatureHash(item) } : {}),\n };\n}\n/**\n * Extracts an {@link ox#AbiItem.AbiItem} from an {@link ox#Abi.Abi} given a name and optional arguments.\n *\n * @example\n * ABI Items can be extracted by their name using the `name` option:\n *\n * ```ts twoslash\n * import { Abi, AbiItem } from 'ox'\n *\n * const abi = Abi.from([\n * 'function foo()',\n * 'event Transfer(address owner, address to, uint256 tokenId)',\n * 'function bar(string a) returns (uint256 x)',\n * ])\n *\n * const item = AbiItem.fromAbi(abi, 'Transfer') // [!code focus]\n * // ^?\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * ### Extracting by Selector\n *\n * ABI Items can be extract by their selector when {@link ox#Hex.Hex} is provided to `name`.\n *\n * ```ts twoslash\n * import { Abi, AbiItem } from 'ox'\n *\n * const abi = Abi.from([\n * 'function foo()',\n * 'event Transfer(address owner, address to, uint256 tokenId)',\n * 'function bar(string a) returns (uint256 x)',\n * ])\n * const item = AbiItem.fromAbi(abi, '0x095ea7b3') // [!code focus]\n * // ^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * :::note\n *\n * Extracting via a hex selector is useful when extracting an ABI Item from an `eth_call` RPC response,\n * a Transaction `input`, or from Event Log `topics`.\n *\n * :::\n *\n * @param abi - The ABI to extract from.\n * @param name - The name (or selector) of the ABI item to extract.\n * @param options - Extraction options.\n * @returns The ABI item.\n */\nexport function fromAbi(abi, name, options) {\n const { args = [], prepare = true } = (options ??\n {});\n const isSelector = Hex.validate(name, { strict: false });\n const abiItems = abi.filter((abiItem) => {\n if (isSelector) {\n if (abiItem.type === 'function' || abiItem.type === 'error')\n return getSelector(abiItem) === Hex.slice(name, 0, 4);\n if (abiItem.type === 'event')\n return getSignatureHash(abiItem) === name;\n return false;\n }\n return 'name' in abiItem && abiItem.name === name;\n });\n if (abiItems.length === 0)\n throw new NotFoundError({ name: name });\n if (abiItems.length === 1)\n return {\n ...abiItems[0],\n ...(prepare ? { hash: getSignatureHash(abiItems[0]) } : {}),\n };\n let matchedAbiItem;\n for (const abiItem of abiItems) {\n if (!('inputs' in abiItem))\n continue;\n if (!args || args.length === 0) {\n if (!abiItem.inputs || abiItem.inputs.length === 0)\n return {\n ...abiItem,\n ...(prepare ? { hash: getSignatureHash(abiItem) } : {}),\n };\n continue;\n }\n if (!abiItem.inputs)\n continue;\n if (abiItem.inputs.length === 0)\n continue;\n if (abiItem.inputs.length !== args.length)\n continue;\n const matched = args.every((arg, index) => {\n const abiParameter = 'inputs' in abiItem && abiItem.inputs[index];\n if (!abiParameter)\n return false;\n return internal.isArgOfType(arg, abiParameter);\n });\n if (matched) {\n // Check for ambiguity against already matched parameters (e.g. `address` vs `bytes20`).\n if (matchedAbiItem &&\n 'inputs' in matchedAbiItem &&\n matchedAbiItem.inputs) {\n const ambiguousTypes = internal.getAmbiguousTypes(abiItem.inputs, matchedAbiItem.inputs, args);\n if (ambiguousTypes)\n throw new AmbiguityError({\n abiItem,\n type: ambiguousTypes[0],\n }, {\n abiItem: matchedAbiItem,\n type: ambiguousTypes[1],\n });\n }\n matchedAbiItem = abiItem;\n }\n }\n const abiItem = (() => {\n if (matchedAbiItem)\n return matchedAbiItem;\n const [abiItem, ...overloads] = abiItems;\n return { ...abiItem, overloads };\n })();\n if (!abiItem)\n throw new NotFoundError({ name: name });\n return {\n ...abiItem,\n ...(prepare ? { hash: getSignatureHash(abiItem) } : {}),\n };\n}\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function getSelector(...parameters) {\n const abiItem = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, name] = parameters;\n return fromAbi(abi, name);\n }\n return parameters[0];\n })();\n return Hex.slice(getSignatureHash(abiItem), 0, 4);\n}\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function getSignature(...parameters) {\n const abiItem = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, name] = parameters;\n return fromAbi(abi, name);\n }\n return parameters[0];\n })();\n const signature = (() => {\n if (typeof abiItem === 'string')\n return abiItem;\n return abitype.formatAbiItem(abiItem);\n })();\n return internal.normalizeSignature(signature);\n}\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function getSignatureHash(...parameters) {\n const abiItem = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, name] = parameters;\n return fromAbi(abi, name);\n }\n return parameters[0];\n })();\n if (typeof abiItem !== 'string' && 'hash' in abiItem && abiItem.hash)\n return abiItem.hash;\n return Hash.keccak256(Hex.fromString(getSignature(abiItem)));\n}\n/**\n * Throws when ambiguous types are found on overloaded ABI items.\n *\n * @example\n * ```ts twoslash\n * import { Abi, AbiFunction } from 'ox'\n *\n * const foo = Abi.from(['function foo(address)', 'function foo(bytes20)'])\n * AbiFunction.fromAbi(foo, 'foo', {\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * })\n * // @error: AbiItem.AmbiguityError: Found ambiguous types in overloaded ABI Items.\n * // @error: `bytes20` in `foo(bytes20)`, and\n * // @error: `address` in `foo(address)`\n * // @error: These types encode differently and cannot be distinguished at runtime.\n * // @error: Remove one of the ambiguous items in the ABI.\n * ```\n *\n * ### Solution\n *\n * Remove one of the ambiguous types from the ABI.\n *\n * ```ts twoslash\n * import { Abi, AbiFunction } from 'ox'\n *\n * const foo = Abi.from([\n * 'function foo(address)',\n * 'function foo(bytes20)' // [!code --]\n * ])\n * AbiFunction.fromAbi(foo, 'foo', {\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * })\n * // @error: AbiItem.AmbiguityError: Found ambiguous types in overloaded ABI Items.\n * // @error: `bytes20` in `foo(bytes20)`, and\n * // @error: `address` in `foo(address)`\n * // @error: These types encode differently and cannot be distinguished at runtime.\n * // @error: Remove one of the ambiguous items in the ABI.\n * ```\n */\nexport class AmbiguityError extends Errors.BaseError {\n constructor(x, y) {\n super('Found ambiguous types in overloaded ABI Items.', {\n metaMessages: [\n // TODO: abitype to add support for signature-formatted ABI items.\n `\\`${x.type}\\` in \\`${internal.normalizeSignature(abitype.formatAbiItem(x.abiItem))}\\`, and`,\n `\\`${y.type}\\` in \\`${internal.normalizeSignature(abitype.formatAbiItem(y.abiItem))}\\``,\n '',\n 'These types encode differently and cannot be distinguished at runtime.',\n 'Remove one of the ambiguous items in the ABI.',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiItem.AmbiguityError'\n });\n }\n}\n/**\n * Throws when an ABI item is not found in the ABI.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Abi, AbiFunction } from 'ox'\n *\n * const foo = Abi.from([\n * 'function foo(address)',\n * 'function bar(uint)'\n * ])\n * AbiFunction.fromAbi(foo, 'baz')\n * // @error: AbiItem.NotFoundError: ABI function with name \"baz\" not found.\n * ```\n *\n * ### Solution\n *\n * Ensure the ABI item exists on the ABI.\n *\n * ```ts twoslash\n * // @noErrors\n * import { Abi, AbiFunction } from 'ox'\n *\n * const foo = Abi.from([\n * 'function foo(address)',\n * 'function bar(uint)',\n * 'function baz(bool)' // [!code ++]\n * ])\n * AbiFunction.fromAbi(foo, 'baz')\n * ```\n */\nexport class NotFoundError extends Errors.BaseError {\n constructor({ name, data, type = 'item', }) {\n const selector = (() => {\n if (name)\n return ` with name \"${name}\"`;\n if (data)\n return ` with data \"${data}\"`;\n return '';\n })();\n super(`ABI ${type}${selector} not found.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiItem.NotFoundError'\n });\n }\n}\n/**\n * Throws when the selector size is invalid.\n *\n * @example\n * ```ts twoslash\n * import { Abi, AbiFunction } from 'ox'\n *\n * const foo = Abi.from([\n * 'function foo(address)',\n * 'function bar(uint)'\n * ])\n * AbiFunction.fromAbi(foo, '0xaaa')\n * // @error: AbiItem.InvalidSelectorSizeError: Selector size is invalid. Expected 4 bytes. Received 2 bytes (\"0xaaa\").\n * ```\n *\n * ### Solution\n *\n * Ensure the selector size is 4 bytes.\n *\n * ```ts twoslash\n * // @noErrors\n * import { Abi, AbiFunction } from 'ox'\n *\n * const foo = Abi.from([\n * 'function foo(address)',\n * 'function bar(uint)'\n * ])\n * AbiFunction.fromAbi(foo, '0x7af82b1a')\n * ```\n */\nexport class InvalidSelectorSizeError extends Errors.BaseError {\n constructor({ data }) {\n super(`Selector size is invalid. Expected 4 bytes. Received ${Hex.size(data)} bytes (\"${data}\").`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiItem.InvalidSelectorSizeError'\n });\n }\n}\n//# sourceMappingURL=AbiItem.js.map","import * as abitype from 'abitype';\nimport * as AbiItem from './AbiItem.js';\nimport * as AbiParameters from './AbiParameters.js';\nimport * as Hex from './Hex.js';\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function decode(...parameters) {\n const [abiConstructor, options] = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, options] = parameters;\n return [fromAbi(abi), options];\n }\n return parameters;\n })();\n const { bytecode } = options;\n if (abiConstructor.inputs.length === 0)\n return undefined;\n const data = options.data.replace(bytecode, '0x');\n return AbiParameters.decode(abiConstructor.inputs, data);\n}\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function encode(...parameters) {\n const [abiConstructor, options] = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, options] = parameters;\n return [fromAbi(abi), options];\n }\n return parameters;\n })();\n const { bytecode, args } = options;\n return Hex.concat(bytecode, abiConstructor.inputs?.length && args?.length\n ? AbiParameters.encode(abiConstructor.inputs, args)\n : '0x');\n}\n/** @internal */\nexport function format(abiConstructor) {\n return abitype.formatAbiItem(abiConstructor);\n}\n/** @internal */\nexport function from(abiConstructor) {\n return AbiItem.from(abiConstructor);\n}\n/** @internal */\nexport function fromAbi(abi) {\n const item = abi.find((item) => item.type === 'constructor');\n if (!item)\n throw new AbiItem.NotFoundError({ name: 'constructor' });\n return item;\n}\n//# sourceMappingURL=AbiConstructor.js.map","import * as abitype from 'abitype';\nimport * as AbiItem from './AbiItem.js';\nimport * as AbiParameters from './AbiParameters.js';\nimport * as Hex from './Hex.js';\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function decodeData(...parameters) {\n const [abiFunction, data] = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, name, data] = parameters;\n return [fromAbi(abi, name), data];\n }\n return parameters;\n })();\n const { overloads } = abiFunction;\n if (Hex.size(data) < 4)\n throw new AbiItem.InvalidSelectorSizeError({ data });\n if (abiFunction.inputs.length === 0)\n return undefined;\n const item = overloads\n ? fromAbi([abiFunction, ...overloads], data)\n : abiFunction;\n if (Hex.size(data) <= 4)\n return undefined;\n return AbiParameters.decode(item.inputs, Hex.slice(data, 4));\n}\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function decodeResult(...parameters) {\n const [abiFunction, data, options = {}] = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, name, data, options] = parameters;\n return [fromAbi(abi, name), data, options];\n }\n return parameters;\n })();\n const values = AbiParameters.decode(abiFunction.outputs, data, options);\n if (values && Object.keys(values).length === 0)\n return undefined;\n if (values && Object.keys(values).length === 1) {\n if (Array.isArray(values))\n return values[0];\n return Object.values(values)[0];\n }\n return values;\n}\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function encodeData(...parameters) {\n const [abiFunction, args = []] = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, name, args] = parameters;\n return [fromAbi(abi, name, { args }), args];\n }\n const [abiFunction, args] = parameters;\n return [abiFunction, args];\n })();\n const { overloads } = abiFunction;\n const item = overloads\n ? fromAbi([abiFunction, ...overloads], abiFunction.name, {\n args,\n })\n : abiFunction;\n const selector = getSelector(item);\n const data = args.length > 0 ? AbiParameters.encode(item.inputs, args) : undefined;\n return data ? Hex.concat(selector, data) : selector;\n}\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function encodeResult(...parameters) {\n const [abiFunction, output, options = {}] = (() => {\n if (Array.isArray(parameters[0])) {\n const [abi, name, output, options] = parameters;\n return [fromAbi(abi, name), output, options];\n }\n return parameters;\n })();\n const { as = 'Array' } = options;\n const values = (() => {\n if (abiFunction.outputs.length === 1)\n return [output];\n if (Array.isArray(output))\n return output;\n if (as === 'Object')\n return Object.values(output);\n return [output];\n })();\n return AbiParameters.encode(abiFunction.outputs, values);\n}\n/**\n * Formats an {@link ox#AbiFunction.AbiFunction} into a **Human Readable ABI Function**.\n *\n * @example\n * ```ts twoslash\n * import { AbiFunction } from 'ox'\n *\n * const formatted = AbiFunction.format({\n * type: 'function',\n * name: 'approve',\n * stateMutability: 'nonpayable',\n * inputs: [\n * {\n * name: 'spender',\n * type: 'address',\n * },\n * {\n * name: 'amount',\n * type: 'uint256',\n * },\n * ],\n * outputs: [{ type: 'bool' }],\n * })\n *\n * formatted\n * // ^?\n *\n *\n * ```\n *\n * @param abiFunction - The ABI Function to format.\n * @returns The formatted ABI Function.\n */\nexport function format(abiFunction) {\n return abitype.formatAbiItem(abiFunction);\n}\n/**\n * Parses an arbitrary **JSON ABI Function** or **Human Readable ABI Function** into a typed {@link ox#AbiFunction.AbiFunction}.\n *\n * @example\n * ### JSON ABIs\n *\n * ```ts twoslash\n * import { AbiFunction } from 'ox'\n *\n * const approve = AbiFunction.from({\n * type: 'function',\n * name: 'approve',\n * stateMutability: 'nonpayable',\n * inputs: [\n * {\n * name: 'spender',\n * type: 'address',\n * },\n * {\n * name: 'amount',\n * type: 'uint256',\n * },\n * ],\n * outputs: [{ type: 'bool' }],\n * })\n *\n * approve\n * //^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * ### Human Readable ABIs\n *\n * A Human Readable ABI can be parsed into a typed ABI object:\n *\n * ```ts twoslash\n * import { AbiFunction } from 'ox'\n *\n * const approve = AbiFunction.from(\n * 'function approve(address spender, uint256 amount) returns (bool)' // [!code hl]\n * )\n *\n * approve\n * //^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * It is possible to specify `struct`s along with your definitions:\n *\n * ```ts twoslash\n * import { AbiFunction } from 'ox'\n *\n * const approve = AbiFunction.from([\n * 'struct Foo { address spender; uint256 amount; }', // [!code hl]\n * 'function approve(Foo foo) returns (bool)',\n * ])\n *\n * approve\n * //^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n *\n *\n * @param abiFunction - The ABI Function to parse.\n * @returns Typed ABI Function.\n */\nexport function from(abiFunction, options = {}) {\n return AbiItem.from(abiFunction, options);\n}\n/**\n * Extracts an {@link ox#AbiFunction.AbiFunction} from an {@link ox#Abi.Abi} given a name and optional arguments.\n *\n * @example\n * ### Extracting by Name\n *\n * ABI Functions can be extracted by their name using the `name` option:\n *\n * ```ts twoslash\n * import { Abi, AbiFunction } from 'ox'\n *\n * const abi = Abi.from([\n * 'function foo()',\n * 'event Transfer(address owner, address to, uint256 tokenId)',\n * 'function bar(string a) returns (uint256 x)',\n * ])\n *\n * const item = AbiFunction.fromAbi(abi, 'foo') // [!code focus]\n * // ^?\n *\n *\n *\n *\n *\n *\n * ```\n *\n * @example\n * ### Extracting by Selector\n *\n * ABI Functions can be extract by their selector when {@link ox#Hex.Hex} is provided to `name`.\n *\n * ```ts twoslash\n * import { Abi, AbiFunction } from 'ox'\n *\n * const abi = Abi.from([\n * 'function foo()',\n * 'event Transfer(address owner, address to, uint256 tokenId)',\n * 'function bar(string a) returns (uint256 x)',\n * ])\n * const item = AbiFunction.fromAbi(abi, '0x095ea7b3') // [!code focus]\n * // ^?\n *\n *\n *\n *\n *\n *\n *\n *\n *\n * ```\n *\n * :::note\n *\n * Extracting via a hex selector is useful when extracting an ABI Function from an `eth_call` RPC response or\n * from a Transaction `input`.\n *\n * :::\n *\n * @param abi - The ABI to extract from.\n * @param name - The name (or selector) of the ABI item to extract.\n * @param options - Extraction options.\n * @returns The ABI item.\n */\nexport function fromAbi(abi, name, options) {\n const item = AbiItem.fromAbi(abi, name, options);\n if (item.type !== 'function')\n throw new AbiItem.NotFoundError({ name, type: 'function' });\n return item;\n}\n/**\n * Computes the [4-byte selector](https://solidity-by-example.org/function-selector/) for an {@link ox#AbiFunction.AbiFunction}.\n *\n * Useful for computing function selectors for calldata.\n *\n * @example\n * ```ts twoslash\n * import { AbiFunction } from 'ox'\n *\n * const selector = AbiFunction.getSelector('function ownerOf(uint256 tokenId)')\n * // @log: '0x6352211e'\n * ```\n *\n * @example\n * ```ts twoslash\n * import { AbiFunction } from 'ox'\n *\n * const selector = AbiFunction.getSelector({\n * inputs: [{ type: 'uint256' }],\n * name: 'ownerOf',\n * outputs: [],\n * stateMutability: 'view',\n * type: 'function'\n * })\n * // @log: '0x6352211e'\n * ```\n *\n * @param abiItem - The ABI item to compute the selector for.\n * @returns The first 4 bytes of the {@link ox#Hash.(keccak256:function)} hash of the function signature.\n */\nexport function getSelector(abiItem) {\n return AbiItem.getSelector(abiItem);\n}\n//# sourceMappingURL=AbiFunction.js.map","export const entryPoint06Address = '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789';\nexport const entryPoint07Address = '0x0000000071727De22E5E9d8BAf0edAc6f37da032';\nexport const entryPoint08Address = '0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108';\nexport const ethAddress = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee';\nexport const zeroAddress = '0x0000000000000000000000000000000000000000';\n//# sourceMappingURL=address.js.map","import * as AbiConstructor from 'ox/AbiConstructor';\nimport * as AbiFunction from 'ox/AbiFunction';\nimport { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { ethAddress, zeroAddress } from '../../constants/address.js';\nimport { deploylessCallViaBytecodeBytecode } from '../../constants/contracts.js';\nimport { BaseError } from '../../errors/base.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { hexToBigInt } from '../../utils/index.js';\nimport { createAccessList, } from './createAccessList.js';\nimport { simulateBlocks, } from './simulateBlocks.js';\nconst getBalanceCode = '0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033';\n/**\n * Simulates execution of a batch of calls.\n *\n * @param client - Client to use\n * @param parameters - {@link SimulateCallsParameters}\n * @returns Results. {@link SimulateCallsReturnType}\n *\n * @example\n * ```ts\n * import { createPublicClient, http, parseEther } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { simulateCalls } from 'viem/actions'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const result = await simulateCalls(client, {\n * account: '0x5a0b54d5dc17e482fe8b0bdca5320161b95fb929',\n * calls: [{\n * {\n * data: '0xdeadbeef',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * },\n * {\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: parseEther('1'),\n * },\n * ]\n * })\n * ```\n */\nexport async function simulateCalls(client, parameters) {\n const { blockNumber, blockTag, calls, stateOverrides, traceAssetChanges, traceTransfers, validation, } = parameters;\n const account = parameters.account\n ? parseAccount(parameters.account)\n : undefined;\n if (traceAssetChanges && !account)\n throw new BaseError('`account` is required when `traceAssetChanges` is true');\n // Derive bytecode to extract ETH balance via a contract call.\n const getBalanceData = account\n ? AbiConstructor.encode(AbiConstructor.from('constructor(bytes, bytes)'), {\n bytecode: deploylessCallViaBytecodeBytecode,\n args: [\n getBalanceCode,\n AbiFunction.encodeData(AbiFunction.from('function getBalance(address)'), [account.address]),\n ],\n })\n : undefined;\n // Fetch ERC20/721 addresses that were \"touched\" from the calls.\n const assetAddresses = traceAssetChanges\n ? await Promise.all(parameters.calls.map(async (call) => {\n if (!call.data && !call.abi)\n return;\n const { accessList } = await createAccessList(client, {\n account: account.address,\n ...call,\n data: call.abi ? encodeFunctionData(call) : call.data,\n });\n return accessList.map(({ address, storageKeys }) => storageKeys.length > 0 ? address : null);\n })).then((x) => x.flat().filter(Boolean))\n : [];\n const blocks = await simulateBlocks(client, {\n blockNumber,\n blockTag: blockTag,\n blocks: [\n ...(traceAssetChanges\n ? [\n // ETH pre balances\n {\n calls: [{ data: getBalanceData }],\n stateOverrides,\n },\n // Asset pre balances\n {\n calls: assetAddresses.map((address, i) => ({\n abi: [\n AbiFunction.from('function balanceOf(address) returns (uint256)'),\n ],\n functionName: 'balanceOf',\n args: [account.address],\n to: address,\n from: zeroAddress,\n nonce: i,\n })),\n stateOverrides: [\n {\n address: zeroAddress,\n nonce: 0,\n },\n ],\n },\n ]\n : []),\n {\n calls: [...calls, {}].map((call) => ({\n ...call,\n from: account?.address,\n })),\n stateOverrides,\n },\n ...(traceAssetChanges\n ? [\n // ETH post balances\n {\n calls: [{ data: getBalanceData }],\n },\n // Asset post balances\n {\n calls: assetAddresses.map((address, i) => ({\n abi: [\n AbiFunction.from('function balanceOf(address) returns (uint256)'),\n ],\n functionName: 'balanceOf',\n args: [account.address],\n to: address,\n from: zeroAddress,\n nonce: i,\n })),\n stateOverrides: [\n {\n address: zeroAddress,\n nonce: 0,\n },\n ],\n },\n // Decimals\n {\n calls: assetAddresses.map((address, i) => ({\n to: address,\n abi: [\n AbiFunction.from('function decimals() returns (uint256)'),\n ],\n functionName: 'decimals',\n from: zeroAddress,\n nonce: i,\n })),\n stateOverrides: [\n {\n address: zeroAddress,\n nonce: 0,\n },\n ],\n },\n // Token URI\n {\n calls: assetAddresses.map((address, i) => ({\n to: address,\n abi: [\n AbiFunction.from('function tokenURI(uint256) returns (string)'),\n ],\n functionName: 'tokenURI',\n args: [0n],\n from: zeroAddress,\n nonce: i,\n })),\n stateOverrides: [\n {\n address: zeroAddress,\n nonce: 0,\n },\n ],\n },\n // Symbols\n {\n calls: assetAddresses.map((address, i) => ({\n to: address,\n abi: [AbiFunction.from('function symbol() returns (string)')],\n functionName: 'symbol',\n from: zeroAddress,\n nonce: i,\n })),\n stateOverrides: [\n {\n address: zeroAddress,\n nonce: 0,\n },\n ],\n },\n ]\n : []),\n ],\n traceTransfers,\n validation,\n });\n const block_results = traceAssetChanges ? blocks[2] : blocks[0];\n const [block_ethPre, block_assetsPre, , block_ethPost, block_assetsPost, block_decimals, block_tokenURI, block_symbols,] = traceAssetChanges ? blocks : [];\n // Extract call results from the simulation.\n const { calls: block_calls, ...block } = block_results;\n const results = block_calls.slice(0, -1) ?? [];\n // Extract pre-execution ETH and asset balances.\n const ethPre = block_ethPre?.calls ?? [];\n const assetsPre = block_assetsPre?.calls ?? [];\n const balancesPre = [...ethPre, ...assetsPre].map((call) => call.status === 'success' ? hexToBigInt(call.data) : null);\n // Extract post-execution ETH and asset balances.\n const ethPost = block_ethPost?.calls ?? [];\n const assetsPost = block_assetsPost?.calls ?? [];\n const balancesPost = [...ethPost, ...assetsPost].map((call) => call.status === 'success' ? hexToBigInt(call.data) : null);\n // Extract asset symbols & decimals.\n const decimals = (block_decimals?.calls ?? []).map((x) => x.status === 'success' ? x.result : null);\n const symbols = (block_symbols?.calls ?? []).map((x) => x.status === 'success' ? x.result : null);\n const tokenURI = (block_tokenURI?.calls ?? []).map((x) => x.status === 'success' ? x.result : null);\n const changes = [];\n for (const [i, balancePost] of balancesPost.entries()) {\n const balancePre = balancesPre[i];\n if (typeof balancePost !== 'bigint')\n continue;\n if (typeof balancePre !== 'bigint')\n continue;\n const decimals_ = decimals[i - 1];\n const symbol_ = symbols[i - 1];\n const tokenURI_ = tokenURI[i - 1];\n const token = (() => {\n if (i === 0)\n return {\n address: ethAddress,\n decimals: 18,\n symbol: 'ETH',\n };\n return {\n address: assetAddresses[i - 1],\n decimals: tokenURI_ || decimals_ ? Number(decimals_ ?? 1) : undefined,\n symbol: symbol_ ?? undefined,\n };\n })();\n if (changes.some((change) => change.token.address === token.address))\n continue;\n changes.push({\n token,\n value: {\n pre: balancePre,\n post: balancePost,\n diff: balancePost - balancePre,\n },\n });\n }\n return {\n assetChanges: changes,\n block,\n results,\n };\n}\n//# sourceMappingURL=simulateCalls.js.map","import * as AbiParameters from '../core/AbiParameters.js';\nimport * as Errors from '../core/Errors.js';\nimport * as Hex from '../core/Hex.js';\n/**\n * Magic bytes used to identify ERC-6492 wrapped signatures.\n */\nexport const magicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';\n/**\n * Deployless ERC-6492 signature verification bytecode.\n */\nexport const universalSignatureValidatorBytecode = '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';\n/**\n * ABI for the ERC-6492 universal deployless signature validator contract.\n *\n * Constructor return value is `0x1` (valid) or `0x0` (invalid).\n */\nexport const universalSignatureValidatorAbi = [\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n {\n inputs: [\n {\n name: '_signer',\n type: 'address',\n },\n {\n name: '_hash',\n type: 'bytes32',\n },\n {\n name: '_signature',\n type: 'bytes',\n },\n ],\n outputs: [\n {\n type: 'bool',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n name: 'isValidSig',\n },\n];\n/**\n * Asserts that the wrapped signature is valid.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * SignatureErc6492.assert('0xdeadbeef')\n * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-6492 wrapped signature.\n * ```\n *\n * @param wrapped - The wrapped signature to assert.\n */\nexport function assert(wrapped) {\n if (Hex.slice(wrapped, -32) !== magicBytes)\n throw new InvalidWrappedSignatureError(wrapped);\n}\n/**\n * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * // @noErrors\n * import { Secp256k1 } from 'ox'\n * import { SignatureErc6492 } from 'ox/erc6492' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * // Instantiate from serialized format. // [!code focus]\n * const wrapped = SignatureErc6492.from('0x...') // [!code focus]\n * // @log: { data: '0x...', signature: { ... }, to: '0x...', } // [!code focus]\n *\n * // Instantiate from constituent parts. // [!code focus]\n * const wrapped = SignatureErc6492.from({ // [!code focus]\n * data: '0x...', // [!code focus]\n * signature, // [!code focus]\n * to: '0x...', // [!code focus]\n * })\n * // @log: { data: '0x...', signature: { ... }, to: '0x...', }\n * ```\n *\n * @param wrapped - Wrapped signature to parse.\n * @returns Wrapped signature.\n */\nexport function from(wrapped) {\n if (typeof wrapped === 'string')\n return unwrap(wrapped);\n return wrapped;\n}\n/**\n * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * const { data, signature, to } = SignatureErc6492.unwrap('0x...')\n * ```\n *\n * @param wrapped - Wrapped signature to parse.\n * @returns Wrapped signature.\n */\nexport function unwrap(wrapped) {\n assert(wrapped);\n const [to, data, signature] = AbiParameters.decode(AbiParameters.from('address, bytes, bytes'), wrapped);\n return { data, signature, to };\n}\n/**\n * Serializes an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification).\n *\n * @example\n * ```ts twoslash\n * import { Secp256k1, Signature } from 'ox'\n * import { SignatureErc6492 } from 'ox/erc6492' // [!code focus]\n *\n * const signature = Secp256k1.sign({\n * payload: '0x...',\n * privateKey: '0x...',\n * })\n *\n * const wrapped = SignatureErc6492.wrap({ // [!code focus]\n * data: '0xdeadbeef', // [!code focus]\n * signature: Signature.toHex(signature), // [!code focus]\n * to: '0x00000000219ab540356cBB839Cbe05303d7705Fa', // [!code focus]\n * }) // [!code focus]\n * ```\n *\n * @param value - Wrapped signature to serialize.\n * @returns Serialized wrapped signature.\n */\nexport function wrap(value) {\n const { data, signature, to } = value;\n return Hex.concat(AbiParameters.encode(AbiParameters.from('address, bytes, bytes'), [\n to,\n data,\n signature,\n ]), magicBytes);\n}\n/**\n * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.\n *\n * @example\n * ```ts twoslash\n * import { SignatureErc6492 } from 'ox/erc6492'\n *\n * const valid = SignatureErc6492.validate('0xdeadbeef')\n * // @log: false\n * ```\n *\n * @param wrapped - The wrapped signature to validate.\n * @returns `true` if the wrapped signature is valid, `false` otherwise.\n */\nexport function validate(wrapped) {\n try {\n assert(wrapped);\n return true;\n }\n catch {\n return false;\n }\n}\n/** Thrown when the ERC-6492 wrapped signature is invalid. */\nexport class InvalidWrappedSignatureError extends Errors.BaseError {\n constructor(wrapped) {\n super(`Value \\`${wrapped}\\` is an invalid ERC-6492 wrapped signature.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SignatureErc6492.InvalidWrappedSignatureError'\n });\n }\n}\n//# sourceMappingURL=SignatureErc6492.js.map","import { SignatureErc6492 } from 'ox/erc6492';\nimport { SignatureErc8010 } from 'ox/erc8010';\nimport { erc1271Abi, erc6492SignatureValidatorAbi, multicall3Abi, } from '../../constants/abis.js';\nimport { erc6492SignatureValidatorByteCode, multicall3Bytecode, } from '../../constants/contracts.js';\nimport { CallExecutionError, ContractFunctionExecutionError, } from '../../errors/contract.js';\nimport { encodeDeployData, } from '../../utils/abi/encodeDeployData.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getAddress, } from '../../utils/address/getAddress.js';\nimport { isAddressEqual, } from '../../utils/address/isAddressEqual.js';\nimport { verifyAuthorization } from '../../utils/authorization/verifyAuthorization.js';\nimport { concatHex } from '../../utils/data/concat.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { hexToBool } from '../../utils/encoding/fromHex.js';\nimport { bytesToHex, numberToHex, } from '../../utils/encoding/toHex.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { recoverAddress, } from '../../utils/signature/recoverAddress.js';\nimport { serializeSignature, } from '../../utils/signature/serializeSignature.js';\nimport { call } from './call.js';\nimport { getCode } from './getCode.js';\nimport { readContract } from './readContract.js';\n/**\n * Verifies a message hash onchain using ERC-6492.\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyHashParameters}\n * @returns Whether or not the signature is valid. {@link VerifyHashReturnType}\n */\nexport async function verifyHash(client, parameters) {\n const { address, hash, erc6492VerifierAddress: verifierAddress = parameters.universalSignatureVerifierAddress ??\n client.chain?.contracts?.erc6492Verifier?.address, multicallAddress = parameters.multicallAddress ??\n client.chain?.contracts?.multicall3?.address, } = parameters;\n const signature = (() => {\n const signature = parameters.signature;\n if (isHex(signature))\n return signature;\n if (typeof signature === 'object' && 'r' in signature && 's' in signature)\n return serializeSignature(signature);\n return bytesToHex(signature);\n })();\n try {\n if (SignatureErc8010.validate(signature))\n return await verifyErc8010(client, {\n ...parameters,\n multicallAddress,\n signature,\n });\n return await verifyErc6492(client, {\n ...parameters,\n verifierAddress,\n signature,\n });\n }\n catch (error) {\n // Fallback attempt to verify the signature via ECDSA recovery.\n try {\n const verified = isAddressEqual(getAddress(address), await recoverAddress({ hash, signature }));\n if (verified)\n return true;\n }\n catch { }\n if (error instanceof VerificationError) {\n // if the execution fails, the signature was not valid and an internal method inside of the validator reverted\n // this can happen for many reasons, for example if signer can not be recovered from the signature\n // or if the signature has no valid format\n return false;\n }\n throw error;\n }\n}\n/** @internal */\nexport async function verifyErc8010(client, parameters) {\n const { address, blockNumber, blockTag, hash, multicallAddress } = parameters;\n const { authorization: authorization_ox, data: initData, signature, to, } = SignatureErc8010.unwrap(parameters.signature);\n // Check if already delegated\n const code = await getCode(client, {\n address,\n blockNumber,\n blockTag,\n });\n // If already delegated, perform standard ERC-1271 verification.\n if (code === concatHex(['0xef0100', authorization_ox.address]))\n return await verifyErc1271(client, {\n address,\n blockNumber,\n blockTag,\n hash,\n signature,\n });\n const authorization = {\n address: authorization_ox.address,\n chainId: Number(authorization_ox.chainId),\n nonce: Number(authorization_ox.nonce),\n r: numberToHex(authorization_ox.r, { size: 32 }),\n s: numberToHex(authorization_ox.s, { size: 32 }),\n yParity: authorization_ox.yParity,\n };\n const valid = await verifyAuthorization({\n address,\n authorization,\n });\n if (!valid)\n throw new VerificationError();\n // Deployless verification.\n const results = await getAction(client, readContract, 'readContract')({\n ...(multicallAddress\n ? { address: multicallAddress }\n : { code: multicall3Bytecode }),\n authorizationList: [authorization],\n abi: multicall3Abi,\n blockNumber,\n blockTag: 'pending',\n functionName: 'aggregate3',\n args: [\n [\n ...(initData\n ? [\n {\n allowFailure: true,\n target: to ?? address,\n callData: initData,\n },\n ]\n : []),\n {\n allowFailure: true,\n target: address,\n callData: encodeFunctionData({\n abi: erc1271Abi,\n functionName: 'isValidSignature',\n args: [hash, signature],\n }),\n },\n ],\n ],\n });\n const data = results[results.length - 1]?.returnData;\n if (data?.startsWith('0x1626ba7e'))\n return true;\n throw new VerificationError();\n}\n/** @internal */\n// biome-ignore lint/correctness/noUnusedVariables: _\nasync function verifyErc6492(client, parameters) {\n const { address, factory, factoryData, hash, signature, verifierAddress, ...rest } = parameters;\n const wrappedSignature = await (async () => {\n // If no `factory` or `factoryData` is provided, it is assumed that the\n // address is not a Smart Account, or the Smart Account is already deployed.\n if (!factory && !factoryData)\n return signature;\n // If the signature is already wrapped, return the signature.\n if (SignatureErc6492.validate(signature))\n return signature;\n // If the Smart Account is not deployed, wrap the signature with a 6492 wrapper\n // to perform counterfactual validation.\n return SignatureErc6492.wrap({\n data: factoryData,\n signature,\n to: factory,\n });\n })();\n const args = verifierAddress\n ? {\n to: verifierAddress,\n data: encodeFunctionData({\n abi: erc6492SignatureValidatorAbi,\n functionName: 'isValidSig',\n args: [address, hash, wrappedSignature],\n }),\n ...rest,\n }\n : {\n data: encodeDeployData({\n abi: erc6492SignatureValidatorAbi,\n args: [address, hash, wrappedSignature],\n bytecode: erc6492SignatureValidatorByteCode,\n }),\n ...rest,\n };\n const { data } = await getAction(client, call, 'call')(args).catch((error) => {\n if (error instanceof CallExecutionError)\n throw new VerificationError();\n throw error;\n });\n if (hexToBool(data ?? '0x0'))\n return true;\n throw new VerificationError();\n}\n/** @internal */\nexport async function verifyErc1271(client, parameters) {\n const { address, blockNumber, blockTag, hash, signature } = parameters;\n const result = await getAction(client, readContract, 'readContract')({\n address,\n abi: erc1271Abi,\n args: [hash, signature],\n blockNumber,\n blockTag,\n functionName: 'isValidSignature',\n }).catch((error) => {\n if (error instanceof ContractFunctionExecutionError)\n throw new VerificationError();\n throw error;\n });\n if (result.startsWith('0x1626ba7e'))\n return true;\n throw new VerificationError();\n}\nclass VerificationError extends Error {\n}\n//# sourceMappingURL=verifyHash.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { hexToBigInt } from '../encoding/fromHex.js';\nimport { hexToBytes } from '../encoding/toBytes.js';\n/**\n * @description Converts a signature into hex format.\n *\n * @param signature The signature to convert.\n * @returns The signature in hex format.\n *\n * @example\n * serializeSignature({\n * r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',\n * s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',\n * yParity: 1\n * })\n * // \"0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c\"\n */\nexport function serializeSignature({ r, s, to = 'hex', v, yParity, }) {\n const yParity_ = (() => {\n if (yParity === 0 || yParity === 1)\n return yParity;\n if (v && (v === 27n || v === 28n || v >= 35n))\n return v % 2n === 0n ? 1 : 0;\n throw new Error('Invalid `v` or `yParity` value');\n })();\n const signature = `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${yParity_ === 0 ? '1b' : '1c'}`;\n if (to === 'hex')\n return signature;\n return hexToBytes(signature);\n}\n//# sourceMappingURL=serializeSignature.js.map","import { getAddress } from '../address/getAddress.js';\nimport { isAddressEqual, } from '../address/isAddressEqual.js';\nimport { recoverAuthorizationAddress, } from './recoverAuthorizationAddress.js';\n/**\n * Verify that an Authorization object was signed by the provided address.\n *\n * - Docs {@link https://viem.sh/docs/utilities/verifyAuthorization}\n *\n * @param parameters - {@link VerifyAuthorizationParameters}\n * @returns Whether or not the signature is valid. {@link VerifyAuthorizationReturnType}\n */\nexport async function verifyAuthorization({ address, authorization, signature, }) {\n return isAddressEqual(getAddress(address), await recoverAuthorizationAddress({\n authorization,\n signature,\n }));\n}\n//# sourceMappingURL=verifyAuthorization.js.map","import { hexToBigInt } from '../../utils/encoding/fromHex.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlockNumber, } from './getBlockNumber.js';\n/**\n * Watches and returns incoming block numbers.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchBlockNumber\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_watching-blocks\n * - JSON-RPC Methods:\n * - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newHeads\"` event.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchBlockNumberParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}\n *\n * @example\n * import { createPublicClient, watchBlockNumber, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchBlockNumber(client, {\n * onBlockNumber: (blockNumber) => console.log(blockNumber),\n * })\n */\nexport function watchBlockNumber(client, { emitOnBegin = false, emitMissed = false, onBlockNumber, onError, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = (() => {\n if (typeof poll_ !== 'undefined')\n return poll_;\n if (client.transport.type === 'webSocket' ||\n client.transport.type === 'ipc')\n return false;\n if (client.transport.type === 'fallback' &&\n (client.transport.transports[0].config.type === 'webSocket' ||\n client.transport.transports[0].config.type === 'ipc'))\n return false;\n return true;\n })();\n let prevBlockNumber;\n const pollBlockNumber = () => {\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n pollingInterval,\n ]);\n return observe(observerId, { onBlockNumber, onError }, (emit) => poll(async () => {\n try {\n const blockNumber = await getAction(client, getBlockNumber, 'getBlockNumber')({ cacheTime: 0 });\n if (prevBlockNumber !== undefined) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (blockNumber === prevBlockNumber)\n return;\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (blockNumber - prevBlockNumber > 1 && emitMissed) {\n for (let i = prevBlockNumber + 1n; i < blockNumber; i++) {\n emit.onBlockNumber(i, prevBlockNumber);\n prevBlockNumber = i;\n }\n }\n }\n // If the next block number is greater than the previous,\n // it is not in the past, and we can emit the new block number.\n if (prevBlockNumber === undefined ||\n blockNumber > prevBlockNumber) {\n emit.onBlockNumber(blockNumber, prevBlockNumber);\n prevBlockNumber = blockNumber;\n }\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin,\n interval: pollingInterval,\n }));\n };\n const subscribeBlockNumber = () => {\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n ]);\n return observe(observerId, { onBlockNumber, onError }, (emit) => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const transport = (() => {\n if (client.transport.type === 'fallback') {\n const transport = client.transport.transports.find((transport) => transport.config.type === 'webSocket' ||\n transport.config.type === 'ipc');\n if (!transport)\n return client.transport;\n return transport.value;\n }\n return client.transport;\n })();\n const { unsubscribe: unsubscribe_ } = await transport.subscribe({\n params: ['newHeads'],\n onData(data) {\n if (!active)\n return;\n const blockNumber = hexToBigInt(data.result?.number);\n emit.onBlockNumber(blockNumber, prevBlockNumber);\n prevBlockNumber = blockNumber;\n },\n onError(error) {\n emit.onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return () => unsubscribe();\n });\n };\n return enablePolling ? pollBlockNumber() : subscribeBlockNumber();\n}\n//# sourceMappingURL=watchBlockNumber.js.map","/**\n * @description Parses EIP-4361 formatted message into message fields object.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4361\n *\n * @returns EIP-4361 fields object\n */\nexport function parseSiweMessage(message) {\n const { scheme, statement, ...prefix } = (message.match(prefixRegex)\n ?.groups ?? {});\n const { chainId, expirationTime, issuedAt, notBefore, requestId, ...suffix } = (message.match(suffixRegex)?.groups ?? {});\n const resources = message.split('Resources:')[1]?.split('\\n- ').slice(1);\n return {\n ...prefix,\n ...suffix,\n ...(chainId ? { chainId: Number(chainId) } : {}),\n ...(expirationTime ? { expirationTime: new Date(expirationTime) } : {}),\n ...(issuedAt ? { issuedAt: new Date(issuedAt) } : {}),\n ...(notBefore ? { notBefore: new Date(notBefore) } : {}),\n ...(requestId ? { requestId } : {}),\n ...(resources ? { resources } : {}),\n ...(scheme ? { scheme } : {}),\n ...(statement ? { statement } : {}),\n };\n}\n// https://regexr.com/80gdj\nconst prefixRegex = /^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\\/\\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\\n)(?<address>0x[a-fA-F0-9]{40})\\n\\n(?:(?<statement>.*)\\n\\n)?/;\n// https://regexr.com/80gf9\nconst suffixRegex = /(?:URI: (?<uri>.+))\\n(?:Version: (?<version>.+))\\n(?:Chain ID: (?<chainId>\\d+))\\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\\n(?:Issued At: (?<issuedAt>.+))(?:\\nExpiration Time: (?<expirationTime>.+))?(?:\\nNot Before: (?<notBefore>.+))?(?:\\nRequest ID: (?<requestId>.+))?/;\n//# sourceMappingURL=parseSiweMessage.js.map","import { hashMessage } from '../../utils/signature/hashMessage.js';\nimport { parseSiweMessage } from '../../utils/siwe/parseSiweMessage.js';\nimport { validateSiweMessage, } from '../../utils/siwe/validateSiweMessage.js';\nimport { verifyHash, } from '../public/verifyHash.js';\n/**\n * Verifies [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) formatted message was signed.\n *\n * Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492).\n *\n * - Docs {@link https://viem.sh/docs/siwe/actions/verifySiweMessage}\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifySiweMessageParameters}\n * @returns Whether or not the signature is valid. {@link VerifySiweMessageReturnType}\n */\nexport async function verifySiweMessage(client, parameters) {\n const { address, domain, message, nonce, scheme, signature, time = new Date(), ...callRequest } = parameters;\n const parsed = parseSiweMessage(message);\n if (!parsed.address)\n return false;\n const isValid = validateSiweMessage({\n address,\n domain,\n message: parsed,\n nonce,\n scheme,\n time,\n });\n if (!isValid)\n return false;\n const hash = hashMessage(message);\n return verifyHash(client, {\n address: parsed.address,\n hash,\n signature,\n ...callRequest,\n });\n}\n//# sourceMappingURL=verifySiweMessage.js.map","import { isAddress } from '../address/isAddress.js';\nimport { isAddressEqual } from '../address/isAddressEqual.js';\n/**\n * @description Validates EIP-4361 message.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4361\n */\nexport function validateSiweMessage(parameters) {\n const { address, domain, message, nonce, scheme, time = new Date(), } = parameters;\n if (domain && message.domain !== domain)\n return false;\n if (nonce && message.nonce !== nonce)\n return false;\n if (scheme && message.scheme !== scheme)\n return false;\n if (message.expirationTime && time >= message.expirationTime)\n return false;\n if (message.notBefore && time < message.notBefore)\n return false;\n try {\n if (!message.address)\n return false;\n if (!isAddress(message.address, { strict: false }))\n return false;\n if (address && !isAddressEqual(message.address, address))\n return false;\n }\n catch {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=validateSiweMessage.js.map","import { getEnsAddress, } from '../../actions/ens/getEnsAddress.js';\nimport { getEnsAvatar, } from '../../actions/ens/getEnsAvatar.js';\nimport { getEnsName, } from '../../actions/ens/getEnsName.js';\nimport { getEnsResolver, } from '../../actions/ens/getEnsResolver.js';\nimport { getEnsText, } from '../../actions/ens/getEnsText.js';\nimport { call, } from '../../actions/public/call.js';\nimport { createAccessList, } from '../../actions/public/createAccessList.js';\nimport { createBlockFilter, } from '../../actions/public/createBlockFilter.js';\nimport { createContractEventFilter, } from '../../actions/public/createContractEventFilter.js';\nimport { createEventFilter, } from '../../actions/public/createEventFilter.js';\nimport { createPendingTransactionFilter, } from '../../actions/public/createPendingTransactionFilter.js';\nimport { estimateContractGas, } from '../../actions/public/estimateContractGas.js';\nimport { estimateFeesPerGas, } from '../../actions/public/estimateFeesPerGas.js';\nimport { estimateGas, } from '../../actions/public/estimateGas.js';\nimport { estimateMaxPriorityFeePerGas, } from '../../actions/public/estimateMaxPriorityFeePerGas.js';\nimport { getBalance, } from '../../actions/public/getBalance.js';\nimport { getBlobBaseFee, } from '../../actions/public/getBlobBaseFee.js';\nimport { getBlock, } from '../../actions/public/getBlock.js';\nimport { getBlockNumber, } from '../../actions/public/getBlockNumber.js';\nimport { getBlockTransactionCount, } from '../../actions/public/getBlockTransactionCount.js';\nimport { getChainId, } from '../../actions/public/getChainId.js';\nimport { getCode, } from '../../actions/public/getCode.js';\nimport { getContractEvents, } from '../../actions/public/getContractEvents.js';\nimport { getEip712Domain, } from '../../actions/public/getEip712Domain.js';\nimport { getFeeHistory, } from '../../actions/public/getFeeHistory.js';\nimport { getFilterChanges, } from '../../actions/public/getFilterChanges.js';\nimport { getFilterLogs, } from '../../actions/public/getFilterLogs.js';\nimport { getGasPrice, } from '../../actions/public/getGasPrice.js';\nimport { getLogs, } from '../../actions/public/getLogs.js';\nimport { getProof, } from '../../actions/public/getProof.js';\nimport { getStorageAt, } from '../../actions/public/getStorageAt.js';\nimport { getTransaction, } from '../../actions/public/getTransaction.js';\nimport { getTransactionConfirmations, } from '../../actions/public/getTransactionConfirmations.js';\nimport { getTransactionCount, } from '../../actions/public/getTransactionCount.js';\nimport { getTransactionReceipt, } from '../../actions/public/getTransactionReceipt.js';\nimport { multicall, } from '../../actions/public/multicall.js';\nimport { readContract, } from '../../actions/public/readContract.js';\nimport { simulateBlocks, } from '../../actions/public/simulateBlocks.js';\nimport { simulateCalls, } from '../../actions/public/simulateCalls.js';\nimport { simulateContract, } from '../../actions/public/simulateContract.js';\nimport { uninstallFilter, } from '../../actions/public/uninstallFilter.js';\nimport { verifyHash, } from '../../actions/public/verifyHash.js';\nimport { verifyMessage, } from '../../actions/public/verifyMessage.js';\nimport { verifyTypedData, } from '../../actions/public/verifyTypedData.js';\nimport { waitForTransactionReceipt, } from '../../actions/public/waitForTransactionReceipt.js';\nimport { watchBlockNumber, } from '../../actions/public/watchBlockNumber.js';\nimport { watchBlocks, } from '../../actions/public/watchBlocks.js';\nimport { watchContractEvent, } from '../../actions/public/watchContractEvent.js';\nimport { watchEvent, } from '../../actions/public/watchEvent.js';\nimport { watchPendingTransactions, } from '../../actions/public/watchPendingTransactions.js';\nimport { verifySiweMessage, } from '../../actions/siwe/verifySiweMessage.js';\nimport { prepareTransactionRequest, } from '../../actions/wallet/prepareTransactionRequest.js';\nimport { sendRawTransaction, } from '../../actions/wallet/sendRawTransaction.js';\nimport { sendRawTransactionSync, } from '../../actions/wallet/sendRawTransactionSync.js';\nexport function publicActions(client) {\n return {\n call: (args) => call(client, args),\n createAccessList: (args) => createAccessList(client, args),\n createBlockFilter: () => createBlockFilter(client),\n createContractEventFilter: (args) => createContractEventFilter(client, args),\n createEventFilter: (args) => createEventFilter(client, args),\n createPendingTransactionFilter: () => createPendingTransactionFilter(client),\n estimateContractGas: (args) => estimateContractGas(client, args),\n estimateGas: (args) => estimateGas(client, args),\n getBalance: (args) => getBalance(client, args),\n getBlobBaseFee: () => getBlobBaseFee(client),\n getBlock: (args) => getBlock(client, args),\n getBlockNumber: (args) => getBlockNumber(client, args),\n getBlockTransactionCount: (args) => getBlockTransactionCount(client, args),\n getBytecode: (args) => getCode(client, args),\n getChainId: () => getChainId(client),\n getCode: (args) => getCode(client, args),\n getContractEvents: (args) => getContractEvents(client, args),\n getEip712Domain: (args) => getEip712Domain(client, args),\n getEnsAddress: (args) => getEnsAddress(client, args),\n getEnsAvatar: (args) => getEnsAvatar(client, args),\n getEnsName: (args) => getEnsName(client, args),\n getEnsResolver: (args) => getEnsResolver(client, args),\n getEnsText: (args) => getEnsText(client, args),\n getFeeHistory: (args) => getFeeHistory(client, args),\n estimateFeesPerGas: (args) => estimateFeesPerGas(client, args),\n getFilterChanges: (args) => getFilterChanges(client, args),\n getFilterLogs: (args) => getFilterLogs(client, args),\n getGasPrice: () => getGasPrice(client),\n getLogs: (args) => getLogs(client, args),\n getProof: (args) => getProof(client, args),\n estimateMaxPriorityFeePerGas: (args) => estimateMaxPriorityFeePerGas(client, args),\n getStorageAt: (args) => getStorageAt(client, args),\n getTransaction: (args) => getTransaction(client, args),\n getTransactionConfirmations: (args) => getTransactionConfirmations(client, args),\n getTransactionCount: (args) => getTransactionCount(client, args),\n getTransactionReceipt: (args) => getTransactionReceipt(client, args),\n multicall: (args) => multicall(client, args),\n prepareTransactionRequest: (args) => prepareTransactionRequest(client, args),\n readContract: (args) => readContract(client, args),\n sendRawTransaction: (args) => sendRawTransaction(client, args),\n sendRawTransactionSync: (args) => sendRawTransactionSync(client, args),\n simulate: (args) => simulateBlocks(client, args),\n simulateBlocks: (args) => simulateBlocks(client, args),\n simulateCalls: (args) => simulateCalls(client, args),\n simulateContract: (args) => simulateContract(client, args),\n verifyHash: (args) => verifyHash(client, args),\n verifyMessage: (args) => verifyMessage(client, args),\n verifySiweMessage: (args) => verifySiweMessage(client, args),\n verifyTypedData: (args) => verifyTypedData(client, args),\n uninstallFilter: (args) => uninstallFilter(client, args),\n waitForTransactionReceipt: (args) => waitForTransactionReceipt(client, args),\n watchBlocks: (args) => watchBlocks(client, args),\n watchBlockNumber: (args) => watchBlockNumber(client, args),\n watchContractEvent: (args) => watchContractEvent(client, args),\n watchEvent: (args) => watchEvent(client, args),\n watchPendingTransactions: (args) => watchPendingTransactions(client, args),\n };\n}\n//# sourceMappingURL=public.js.map","import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).\n *\n * - Docs: https://viem.sh/docs/actions/public/createBlockFilter\n * - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'block' }\n */\nexport async function createBlockFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newBlockFilter',\n });\n const id = await client.request({\n method: 'eth_newBlockFilter',\n });\n return { id, request: getRequest(id), type: 'block' };\n}\n//# sourceMappingURL=createBlockFilter.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError, } from '../../utils/errors/getContractError.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { estimateGas, } from './estimateGas.js';\n/**\n * Estimates the gas required to successfully execute a contract write function call.\n *\n * - Docs: https://viem.sh/docs/contract/estimateContractGas\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateContractGasParameters}\n * @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateContractGas } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gas = await estimateContractGas(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint() public']),\n * functionName: 'mint',\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * })\n */\nexport async function estimateContractGas(client, parameters) {\n const { abi, address, args, functionName, dataSuffix, ...request } = parameters;\n const data = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const gas = await getAction(client, estimateGas, 'estimateGas')({\n data: `${data}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n to: address,\n ...request,\n });\n return gas;\n }\n catch (error) {\n const account = request.account ? parseAccount(request.account) : undefined;\n throw getContractError(error, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/estimateContractGas',\n functionName,\n sender: account?.address,\n });\n }\n}\n//# sourceMappingURL=estimateContractGas.js.map","import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the balance of an address in wei.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBalance\n * - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)\n *\n * You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther).\n *\n * ```ts\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * blockTag: 'safe'\n * })\n * const balanceAsEther = formatEther(balance)\n * // \"6.942\"\n * ```\n *\n * @param client - Client to use\n * @param parameters - {@link GetBalanceParameters}\n * @returns The balance of the address in wei. {@link GetBalanceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBalance } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n * // 10000000000000000000000n (wei)\n */\nexport async function getBalance(client, { address, blockNumber, blockTag = client.experimental_blockTag ?? 'latest', }) {\n const blockNumberHex = typeof blockNumber === 'bigint' ? numberToHex(blockNumber) : undefined;\n const balance = await client.request({\n method: 'eth_getBalance',\n params: [address, blockNumberHex || blockTag],\n });\n return BigInt(balance);\n}\n//# sourceMappingURL=getBalance.js.map","/**\n * Returns the base fee per blob gas in wei.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee\n * - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee)\n *\n * @param client - Client to use\n * @returns The blob base fee (in wei). {@link GetBlobBaseFeeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlobBaseFee } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const blobBaseFee = await getBlobBaseFee(client)\n */\nexport async function getBlobBaseFee(client) {\n const baseFee = await client.request({\n method: 'eth_blobBaseFee',\n });\n return BigInt(baseFee);\n}\n//# sourceMappingURL=getBlobBaseFee.js.map","import { hexToNumber, } from '../../utils/encoding/fromHex.js';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of Transactions at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockTransactionCountParameters}\n * @returns The block transaction count. {@link GetBlockTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const count = await getBlockTransactionCount(client)\n */\nexport async function getBlockTransactionCount(client, { blockHash, blockNumber, blockTag = 'latest', } = {}) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let count;\n if (blockHash) {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByHash',\n params: [blockHash],\n }, { dedupe: true });\n }\n else {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByNumber',\n params: [blockNumberHex || blockTag],\n }, { dedupe: Boolean(blockNumberHex) });\n }\n return hexToNumber(count);\n}\n//# sourceMappingURL=getBlockTransactionCount.js.map","import { addressResolverAbi, universalResolverResolveAbi, } from '../../constants/abis.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { trim } from '../../utils/data/trim.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { localBatchGatewayUrl } from '../../utils/ens/localBatchGatewayRequest.js';\nimport { namehash } from '../../utils/ens/namehash.js';\nimport { packetToBytes, } from '../../utils/ens/packetToBytes.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets address for ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsAddress\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens\n *\n * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsAddressParameters}\n * @returns Address for ENS name or `null` if not found. {@link GetEnsAddressReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsAddress, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensAddress = await getEnsAddress(client, {\n * name: normalize('wevm.eth'),\n * })\n * // '0xd2135CfB216b74109775236E36d4b433F1DF507B'\n */\nexport async function getEnsAddress(client, parameters) {\n const { blockNumber, blockTag, coinType, name, gatewayUrls, strict } = parameters;\n const { chain } = client;\n const universalResolverAddress = (() => {\n if (parameters.universalResolverAddress)\n return parameters.universalResolverAddress;\n if (!chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n return getChainContractAddress({\n blockNumber,\n chain,\n contract: 'ensUniversalResolver',\n });\n })();\n const tlds = chain?.ensTlds;\n if (tlds && !tlds.some((tld) => name.endsWith(tld)))\n return null;\n const args = (() => {\n if (coinType != null)\n return [namehash(name), BigInt(coinType)];\n return [namehash(name)];\n })();\n try {\n const functionData = encodeFunctionData({\n abi: addressResolverAbi,\n functionName: 'addr',\n args,\n });\n const readContractParameters = {\n address: universalResolverAddress,\n abi: universalResolverResolveAbi,\n functionName: 'resolveWithGateways',\n args: [\n toHex(packetToBytes(name)),\n functionData,\n gatewayUrls ?? [localBatchGatewayUrl],\n ],\n blockNumber,\n blockTag,\n };\n const readContractAction = getAction(client, readContract, 'readContract');\n const res = await readContractAction(readContractParameters);\n if (res[0] === '0x')\n return null;\n const address = decodeFunctionResult({\n abi: addressResolverAbi,\n args,\n functionName: 'addr',\n data: res[0],\n });\n if (address === '0x')\n return null;\n if (trim(address) === '0x00')\n return null;\n return address;\n }\n catch (err) {\n if (strict)\n throw err;\n if (isNullUniversalResolverError(err))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsAddress.js.map","import { parseAvatarRecord, } from '../../utils/ens/avatar/parseAvatarRecord.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { getEnsText, } from './getEnsText.js';\n/**\n * Gets the avatar of an ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens\n *\n * Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText) with `key` set to `'avatar'`.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsAvatarParameters}\n * @returns Avatar URI or `null` if not found. {@link GetEnsAvatarReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsAvatar, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensAvatar = await getEnsAvatar(client, {\n * name: normalize('wevm.eth'),\n * })\n * // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'\n */\nexport async function getEnsAvatar(client, { blockNumber, blockTag, assetGatewayUrls, name, gatewayUrls, strict, universalResolverAddress, }) {\n const record = await getAction(client, getEnsText, 'getEnsText')({\n blockNumber,\n blockTag,\n key: 'avatar',\n name,\n universalResolverAddress,\n gatewayUrls,\n strict,\n });\n if (!record)\n return null;\n try {\n return await parseAvatarRecord(client, {\n record,\n gatewayUrls: assetGatewayUrls,\n });\n }\n catch {\n return null;\n }\n}\n//# sourceMappingURL=getEnsAvatar.js.map","import { universalResolverReverseAbi } from '../../constants/abis.js';\nimport { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { localBatchGatewayUrl } from '../../utils/ens/localBatchGatewayRequest.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets primary name for specified address.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsName\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens\n *\n * Calls `reverse(bytes)` on ENS Universal Resolver Contract to \"reverse resolve\" the address to the primary ENS name.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsNameParameters}\n * @returns Name or `null` if not found. {@link GetEnsNameReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsName } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensName = await getEnsName(client, {\n * address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',\n * })\n * // 'wevm.eth'\n */\nexport async function getEnsName(client, parameters) {\n const { address, blockNumber, blockTag, coinType = 60n, gatewayUrls, strict, } = parameters;\n const { chain } = client;\n const universalResolverAddress = (() => {\n if (parameters.universalResolverAddress)\n return parameters.universalResolverAddress;\n if (!chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n return getChainContractAddress({\n blockNumber,\n chain,\n contract: 'ensUniversalResolver',\n });\n })();\n try {\n const readContractParameters = {\n address: universalResolverAddress,\n abi: universalResolverReverseAbi,\n args: [address, coinType, gatewayUrls ?? [localBatchGatewayUrl]],\n functionName: 'reverseWithGateways',\n blockNumber,\n blockTag,\n };\n const readContractAction = getAction(client, readContract, 'readContract');\n const [name] = await readContractAction(readContractParameters);\n return name || null;\n }\n catch (err) {\n if (strict)\n throw err;\n if (isNullUniversalResolverError(err))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsName.js.map","import { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { packetToBytes, } from '../../utils/ens/packetToBytes.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets resolver for ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens\n *\n * Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsResolverParameters}\n * @returns Address for ENS resolver. {@link GetEnsResolverReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsResolver, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const resolverAddress = await getEnsResolver(client, {\n * name: normalize('wevm.eth'),\n * })\n * // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'\n */\nexport async function getEnsResolver(client, parameters) {\n const { blockNumber, blockTag, name } = parameters;\n const { chain } = client;\n const universalResolverAddress = (() => {\n if (parameters.universalResolverAddress)\n return parameters.universalResolverAddress;\n if (!chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n return getChainContractAddress({\n blockNumber,\n chain,\n contract: 'ensUniversalResolver',\n });\n })();\n const tlds = chain?.ensTlds;\n if (tlds && !tlds.some((tld) => name.endsWith(tld)))\n throw new Error(`${name} is not a valid ENS TLD (${tlds?.join(', ')}) for chain \"${chain.name}\" (id: ${chain.id}).`);\n const [resolverAddress] = await getAction(client, readContract, 'readContract')({\n address: universalResolverAddress,\n abi: [\n {\n inputs: [{ type: 'bytes' }],\n name: 'findResolver',\n outputs: [\n { type: 'address' },\n { type: 'bytes32' },\n { type: 'uint256' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n functionName: 'findResolver',\n args: [toHex(packetToBytes(name))],\n blockNumber,\n blockTag,\n });\n return resolverAddress;\n}\n//# sourceMappingURL=getEnsResolver.js.map","import { parseEventLogs } from '../../utils/abi/parseEventLogs.js';\nimport { formatLog, } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs since the filter was created.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterLogs\n * - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)\n *\n * `getFilterLogs` is only compatible with **event filters**.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterLogsParameters}\n * @returns A list of event logs. {@link GetFilterLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterLogs(client, { filter })\n */\nexport async function getFilterLogs(_client, { filter, }) {\n const strict = filter.strict ?? false;\n const logs = await filter.request({\n method: 'eth_getFilterLogs',\n params: [filter.id],\n });\n const formattedLogs = logs.map((log) => formatLog(log));\n if (!filter.abi)\n return formattedLogs;\n return parseEventLogs({\n abi: filter.abi,\n logs: formattedLogs,\n strict,\n });\n}\n//# sourceMappingURL=getFilterLogs.js.map","import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Returns the value from a storage slot at a given address.\n *\n * - Docs: https://viem.sh/docs/contract/getStorageAt\n * - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)\n *\n * @param client - Client to use\n * @param parameters - {@link GetStorageAtParameters}\n * @returns The value of the storage slot. {@link GetStorageAtReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getStorageAt } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getStorageAt(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * slot: toHex(0),\n * })\n */\nexport async function getStorageAt(client, { address, blockNumber, blockTag = 'latest', slot }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const data = await client.request({\n method: 'eth_getStorageAt',\n params: [address, slot, blockNumberHex || blockTag],\n });\n return data;\n}\n//# sourceMappingURL=getStorageAt.js.map","import { getAction } from '../../utils/getAction.js';\nimport { getBlockNumber, } from './getBlockNumber.js';\nimport { getTransaction, } from './getTransaction.js';\n/**\n * Returns the number of blocks passed (confirmations) since the transaction was processed on a block.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionConfirmationsParameters}\n * @returns The number of blocks passed since the transaction was processed. If confirmations is 0, then the Transaction has not been confirmed & processed yet. {@link GetTransactionConfirmationsReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionConfirmations } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const confirmations = await getTransactionConfirmations(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionConfirmations(client, { hash, transactionReceipt }) {\n const [blockNumber, transaction] = await Promise.all([\n getAction(client, getBlockNumber, 'getBlockNumber')({}),\n hash\n ? getAction(client, getTransaction, 'getTransaction')({ hash })\n : undefined,\n ]);\n const transactionBlockNumber = transactionReceipt?.blockNumber || transaction?.blockNumber;\n if (!transactionBlockNumber)\n return 0n;\n return blockNumber - transactionBlockNumber + 1n;\n}\n//# sourceMappingURL=getTransactionConfirmations.js.map","import { multicall3Abi } from '../../constants/abis.js';\nimport { multicall3Bytecode } from '../../constants/contracts.js';\nimport { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { BaseError } from '../../errors/base.js';\nimport { RawContractError } from '../../errors/contract.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress, } from '../../utils/chain/getChainContractAddress.js';\nimport { getContractError, } from '../../utils/errors/getContractError.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { readContract } from './readContract.js';\n/**\n * Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).\n *\n * - Docs: https://viem.sh/docs/contract/multicall\n *\n * @param client - Client to use\n * @param parameters - {@link MulticallParameters}\n * @returns An array of results with accompanying status. {@link MulticallReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { multicall } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const abi = parseAbi([\n * 'function balanceOf(address) view returns (uint256)',\n * 'function totalSupply() view returns (uint256)',\n * ])\n * const results = await multicall(client, {\n * contracts: [\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'balanceOf',\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * },\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'totalSupply',\n * },\n * ],\n * })\n * // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]\n */\nexport async function multicall(client, parameters) {\n const { account, authorizationList, allowFailure = true, blockNumber, blockOverrides, blockTag, stateOverride, } = parameters;\n const contracts = parameters.contracts;\n const { batchSize = parameters.batchSize ?? 1024, deployless = parameters.deployless ?? false, } = typeof client.batch?.multicall === 'object' ? client.batch.multicall : {};\n const multicallAddress = (() => {\n if (parameters.multicallAddress)\n return parameters.multicallAddress;\n if (deployless)\n return null;\n if (client.chain) {\n return getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n throw new Error('client chain not configured. multicallAddress is required.');\n })();\n const chunkedCalls = [[]];\n let currentChunk = 0;\n let currentChunkSize = 0;\n for (let i = 0; i < contracts.length; i++) {\n const { abi, address, args, functionName } = contracts[i];\n try {\n const callData = encodeFunctionData({ abi, args, functionName });\n currentChunkSize += (callData.length - 2) / 2;\n // Check to see if we need to create a new chunk.\n if (\n // Check if batching is enabled.\n batchSize > 0 &&\n // Check if the current size of the batch exceeds the size limit.\n currentChunkSize > batchSize &&\n // Check if the current chunk is not already empty.\n chunkedCalls[currentChunk].length > 0) {\n currentChunk++;\n currentChunkSize = (callData.length - 2) / 2;\n chunkedCalls[currentChunk] = [];\n }\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData,\n target: address,\n },\n ];\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n sender: account,\n });\n if (!allowFailure)\n throw error;\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData: '0x',\n target: address,\n },\n ];\n }\n }\n const aggregate3Results = await Promise.allSettled(chunkedCalls.map((calls) => getAction(client, readContract, 'readContract')({\n ...(multicallAddress === null\n ? { code: multicall3Bytecode }\n : { address: multicallAddress }),\n abi: multicall3Abi,\n account,\n args: [calls],\n authorizationList,\n blockNumber,\n blockOverrides,\n blockTag,\n functionName: 'aggregate3',\n stateOverride,\n })));\n const results = [];\n for (let i = 0; i < aggregate3Results.length; i++) {\n const result = aggregate3Results[i];\n // If an error occurred in a `readContract` invocation (ie. network error),\n // then append the failure reason to each contract result.\n if (result.status === 'rejected') {\n if (!allowFailure)\n throw result.reason;\n for (let j = 0; j < chunkedCalls[i].length; j++) {\n results.push({\n status: 'failure',\n error: result.reason,\n result: undefined,\n });\n }\n continue;\n }\n // If the `readContract` call was successful, then decode the results.\n const aggregate3Result = result.value;\n for (let j = 0; j < aggregate3Result.length; j++) {\n // Extract the response from `readContract`\n const { returnData, success } = aggregate3Result[j];\n // Extract the request call data from the original call.\n const { callData } = chunkedCalls[i][j];\n // Extract the contract config for this call from the `contracts` argument\n // for decoding.\n const { abi, address, functionName, args } = contracts[results.length];\n try {\n if (callData === '0x')\n throw new AbiDecodingZeroDataError();\n if (!success)\n throw new RawContractError({ data: returnData });\n const result = decodeFunctionResult({\n abi,\n args,\n data: returnData,\n functionName,\n });\n results.push(allowFailure ? { result, status: 'success' } : result);\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n });\n if (!allowFailure)\n throw error;\n results.push({ error, result: undefined, status: 'failure' });\n }\n }\n }\n if (results.length !== contracts.length)\n throw new BaseError('multicall results mismatch');\n return results;\n}\n//# sourceMappingURL=multicall.js.map","/**\n * Sends a **signed** transaction to the network\n *\n * - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction\n * - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/)\n *\n * @param client - Client to use\n * @param parameters - {@link SendRawTransactionParameters}\n * @returns The transaction hash. {@link SendRawTransactionReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { sendRawTransaction } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n *\n * const hash = await sendRawTransaction(client, {\n * serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'\n * })\n */\nexport async function sendRawTransaction(client, { serializedTransaction }) {\n return client.request({\n method: 'eth_sendRawTransaction',\n params: [serializedTransaction],\n }, { retryCount: 0 });\n}\n//# sourceMappingURL=sendRawTransaction.js.map","import { TransactionReceiptRevertedError } from '../../errors/transaction.js';\nimport { formatTransactionReceipt } from '../../utils/formatters/transactionReceipt.js';\nimport { numberToHex, } from '../../utils/index.js';\n/**\n * Sends a **signed** transaction to the network synchronously,\n * and waits for the transaction to be included in a block.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/sendRawTransactionSync\n * - JSON-RPC Method: [`eth_sendRawTransactionSync`](https://eips.ethereum.org/EIPS/eip-7966)\n *\n * @param client - Client to use\n * @param parameters - {@link SendRawTransactionParameters}\n * @returns The transaction receipt. {@link SendRawTransactionSyncReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { sendRawTransactionSync } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n *\n * const receipt = await sendRawTransactionSync(client, {\n * serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'\n * })\n */\nexport async function sendRawTransactionSync(client, { serializedTransaction, throwOnReceiptRevert, timeout, }) {\n const receipt = await client.request({\n method: 'eth_sendRawTransactionSync',\n params: timeout\n ? [serializedTransaction, numberToHex(timeout)]\n : [serializedTransaction],\n }, { retryCount: 0 });\n const format = client.chain?.formatters?.transactionReceipt?.format ||\n formatTransactionReceipt;\n const formatted = format(receipt);\n if (formatted.status === 'reverted' && throwOnReceiptRevert)\n throw new TransactionReceiptRevertedError({ receipt: formatted });\n return formatted;\n}\n//# sourceMappingURL=sendRawTransactionSync.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError, } from '../../utils/errors/getContractError.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { call } from './call.js';\n/**\n * Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.\n *\n * - Docs: https://viem.sh/docs/contract/simulateContract\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts\n *\n * This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract), but also supports contract write functions.\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).\n *\n * @param client - Client to use\n * @param parameters - {@link SimulateContractParameters}\n * @returns The simulation result and write request. {@link SimulateContractReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { simulateContract } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const result = await simulateContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint(uint32) view returns (uint32)']),\n * functionName: 'mint',\n * args: ['69420'],\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function simulateContract(client, parameters) {\n const { abi, address, args, dataSuffix, functionName, ...callRequest } = parameters;\n const account = callRequest.account\n ? parseAccount(callRequest.account)\n : client.account;\n const calldata = encodeFunctionData({ abi, args, functionName });\n try {\n const { data } = await getAction(client, call, 'call')({\n batch: false,\n data: `${calldata}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n to: address,\n ...callRequest,\n account,\n });\n const result = decodeFunctionResult({\n abi,\n args,\n functionName,\n data: data || '0x',\n });\n const minimizedAbi = abi.filter((abiItem) => 'name' in abiItem && abiItem.name === parameters.functionName);\n return {\n result,\n request: {\n abi: minimizedAbi,\n address,\n args,\n dataSuffix,\n functionName,\n ...callRequest,\n account,\n },\n };\n }\n catch (error) {\n throw getContractError(error, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/simulateContract',\n functionName,\n sender: account?.address,\n });\n }\n}\n//# sourceMappingURL=simulateContract.js.map","import { hashMessage } from '../../utils/signature/hashMessage.js';\nimport { verifyHash, } from './verifyHash.js';\n/**\n * Verify that a message was signed by the provided address.\n *\n * Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492).\n *\n * - Docs {@link https://viem.sh/docs/actions/public/verifyMessage}\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyMessageParameters}\n * @returns Whether or not the signature is valid. {@link VerifyMessageReturnType}\n */\nexport async function verifyMessage(client, { address, message, factory, factoryData, signature, ...callRequest }) {\n const hash = hashMessage(message);\n return verifyHash(client, {\n address,\n factory: factory,\n factoryData: factoryData,\n hash,\n signature,\n ...callRequest,\n });\n}\n//# sourceMappingURL=verifyMessage.js.map","import { hashTypedData, } from '../../utils/signature/hashTypedData.js';\nimport { verifyHash, } from './verifyHash.js';\n/**\n * Verify that typed data was signed by the provided address.\n *\n * - Docs {@link https://viem.sh/docs/actions/public/verifyTypedData}\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyTypedDataParameters}\n * @returns Whether or not the signature is valid. {@link VerifyTypedDataReturnType}\n */\nexport async function verifyTypedData(client, parameters) {\n const { address, factory, factoryData, signature, message, primaryType, types, domain, ...callRequest } = parameters;\n const hash = hashTypedData({ message, primaryType, types, domain });\n return verifyHash(client, {\n address,\n factory: factory,\n factoryData: factoryData,\n hash,\n signature,\n ...callRequest,\n });\n}\n//# sourceMappingURL=verifyTypedData.js.map","import { BlockNotFoundError } from '../../errors/block.js';\nimport { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from '../../errors/transaction.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { observe } from '../../utils/observe.js';\nimport { withResolvers } from '../../utils/promise/withResolvers.js';\nimport { withRetry, } from '../../utils/promise/withRetry.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlock } from './getBlock.js';\nimport { getTransaction, } from './getTransaction.js';\nimport { getTransactionReceipt, } from './getTransactionReceipt.js';\nimport { watchBlockNumber, } from './watchBlockNumber.js';\n/**\n * Waits for the [Transaction](https://viem.sh/docs/glossary/terms#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt).\n *\n * - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt\n * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions\n * - JSON-RPC Methods:\n * - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.\n * - If a Transaction has been replaced:\n * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions\n * - Checks if one of the Transactions is a replacement\n * - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).\n *\n * The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions).\n *\n * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce.\n *\n * There are 3 types of Transaction Replacement reasons:\n *\n * - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`)\n * - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`)\n * - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`)\n *\n * @param client - Client to use\n * @param parameters - {@link WaitForTransactionReceiptParameters}\n * @returns The transaction receipt. {@link WaitForTransactionReceiptReturnType}\n *\n * @example\n * import { createPublicClient, waitForTransactionReceipt, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionReceipt = await waitForTransactionReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function waitForTransactionReceipt(client, parameters) {\n const { checkReplacement = true, confirmations = 1, hash, onReplaced, retryCount = 6, retryDelay = ({ count }) => ~~(1 << count) * 200, // exponential backoff\n timeout = 180_000, } = parameters;\n const observerId = stringify(['waitForTransactionReceipt', client.uid, hash]);\n const pollingInterval = (() => {\n if (parameters.pollingInterval)\n return parameters.pollingInterval;\n if (client.chain?.experimental_preconfirmationTime)\n return client.chain.experimental_preconfirmationTime;\n return client.pollingInterval;\n })();\n let transaction;\n let replacedTransaction;\n let receipt;\n let retrying = false;\n let _unobserve;\n let _unwatch;\n const { promise, resolve, reject } = withResolvers();\n const timer = timeout\n ? setTimeout(() => {\n _unwatch?.();\n _unobserve?.();\n reject(new WaitForTransactionReceiptTimeoutError({ hash }));\n }, timeout)\n : undefined;\n _unobserve = observe(observerId, { onReplaced, resolve, reject }, async (emit) => {\n receipt = await getAction(client, getTransactionReceipt, 'getTransactionReceipt')({ hash }).catch(() => undefined);\n if (receipt && confirmations <= 1) {\n clearTimeout(timer);\n emit.resolve(receipt);\n _unobserve?.();\n return;\n }\n _unwatch = getAction(client, watchBlockNumber, 'watchBlockNumber')({\n emitMissed: true,\n emitOnBegin: true,\n poll: true,\n pollingInterval,\n async onBlockNumber(blockNumber_) {\n const done = (fn) => {\n clearTimeout(timer);\n _unwatch?.();\n fn();\n _unobserve?.();\n };\n let blockNumber = blockNumber_;\n if (retrying)\n return;\n try {\n // If we already have a valid receipt, let's check if we have enough\n // confirmations. If we do, then we can resolve.\n if (receipt) {\n if (confirmations > 1 &&\n (!receipt.blockNumber ||\n blockNumber - receipt.blockNumber + 1n < confirmations))\n return;\n done(() => emit.resolve(receipt));\n return;\n }\n // Get the transaction to check if it's been replaced.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined transactions.\n if (checkReplacement && !transaction) {\n retrying = true;\n await withRetry(async () => {\n transaction = (await getAction(client, getTransaction, 'getTransaction')({ hash }));\n if (transaction.blockNumber)\n blockNumber = transaction.blockNumber;\n }, {\n delay: retryDelay,\n retryCount,\n });\n retrying = false;\n }\n // Get the receipt to check if it's been processed.\n receipt = await getAction(client, getTransactionReceipt, 'getTransactionReceipt')({ hash });\n // Check if we have enough confirmations. If not, continue polling.\n if (confirmations > 1 &&\n (!receipt.blockNumber ||\n blockNumber - receipt.blockNumber + 1n < confirmations))\n return;\n done(() => emit.resolve(receipt));\n }\n catch (err) {\n // If the receipt is not found, the transaction will be pending.\n // We need to check if it has potentially been replaced.\n if (err instanceof TransactionNotFoundError ||\n err instanceof TransactionReceiptNotFoundError) {\n if (!transaction) {\n retrying = false;\n return;\n }\n try {\n replacedTransaction = transaction;\n // Let's retrieve the transactions from the current block.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined blocks.\n retrying = true;\n const block = await withRetry(() => getAction(client, getBlock, 'getBlock')({\n blockNumber,\n includeTransactions: true,\n }), {\n delay: retryDelay,\n retryCount,\n shouldRetry: ({ error }) => error instanceof BlockNotFoundError,\n });\n retrying = false;\n const replacementTransaction = block.transactions.find(({ from, nonce }) => from === replacedTransaction.from &&\n nonce === replacedTransaction.nonce);\n // If we couldn't find a replacement transaction, continue polling.\n if (!replacementTransaction)\n return;\n // If we found a replacement transaction, return it's receipt.\n receipt = await getAction(client, getTransactionReceipt, 'getTransactionReceipt')({\n hash: replacementTransaction.hash,\n });\n // Check if we have enough confirmations. If not, continue polling.\n if (confirmations > 1 &&\n (!receipt.blockNumber ||\n blockNumber - receipt.blockNumber + 1n < confirmations))\n return;\n let reason = 'replaced';\n if (replacementTransaction.to === replacedTransaction.to &&\n replacementTransaction.value === replacedTransaction.value &&\n replacementTransaction.input === replacedTransaction.input) {\n reason = 'repriced';\n }\n else if (replacementTransaction.from === replacementTransaction.to &&\n replacementTransaction.value === 0n) {\n reason = 'cancelled';\n }\n done(() => {\n emit.onReplaced?.({\n reason,\n replacedTransaction: replacedTransaction,\n transaction: replacementTransaction,\n transactionReceipt: receipt,\n });\n emit.resolve(receipt);\n });\n }\n catch (err_) {\n done(() => emit.reject(err_));\n }\n }\n else {\n done(() => emit.reject(err));\n }\n }\n },\n });\n });\n return promise;\n}\n//# sourceMappingURL=waitForTransactionReceipt.js.map","import { getAction } from '../../utils/getAction.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlock } from './getBlock.js';\n/**\n * Watches and returns information for incoming blocks.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchBlocks\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks_watching-blocks\n * - JSON-RPC Methods:\n * - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newHeads\"` event.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchBlocksParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlocksReturnType}\n *\n * @example\n * import { createPublicClient, watchBlocks, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchBlocks(client, {\n * onBlock: (block) => console.log(block),\n * })\n */\nexport function watchBlocks(client, { blockTag = client.experimental_blockTag ?? 'latest', emitMissed = false, emitOnBegin = false, onBlock, onError, includeTransactions: includeTransactions_, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = (() => {\n if (typeof poll_ !== 'undefined')\n return poll_;\n if (client.transport.type === 'webSocket' ||\n client.transport.type === 'ipc')\n return false;\n if (client.transport.type === 'fallback' &&\n (client.transport.transports[0].config.type === 'webSocket' ||\n client.transport.transports[0].config.type === 'ipc'))\n return false;\n return true;\n })();\n const includeTransactions = includeTransactions_ ?? false;\n let prevBlock;\n const pollBlocks = () => {\n const observerId = stringify([\n 'watchBlocks',\n client.uid,\n blockTag,\n emitMissed,\n emitOnBegin,\n includeTransactions,\n pollingInterval,\n ]);\n return observe(observerId, { onBlock, onError }, (emit) => poll(async () => {\n try {\n const block = await getAction(client, getBlock, 'getBlock')({\n blockTag,\n includeTransactions,\n });\n if (block.number !== null && prevBlock?.number != null) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (block.number === prevBlock.number)\n return;\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (block.number - prevBlock.number > 1 && emitMissed) {\n for (let i = prevBlock?.number + 1n; i < block.number; i++) {\n const block = (await getAction(client, getBlock, 'getBlock')({\n blockNumber: i,\n includeTransactions,\n }));\n emit.onBlock(block, prevBlock);\n prevBlock = block;\n }\n }\n }\n if (\n // If no previous block exists, emit.\n prevBlock?.number == null ||\n // If the block tag is \"pending\" with no block number, emit.\n (blockTag === 'pending' && block?.number == null) ||\n // If the next block number is greater than the previous block number, emit.\n // We don't want to emit blocks in the past.\n (block.number !== null && block.number > prevBlock.number)) {\n emit.onBlock(block, prevBlock);\n prevBlock = block;\n }\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin,\n interval: pollingInterval,\n }));\n };\n const subscribeBlocks = () => {\n let active = true;\n let emitFetched = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n if (emitOnBegin) {\n getAction(client, getBlock, 'getBlock')({\n blockTag,\n includeTransactions,\n })\n .then((block) => {\n if (!active)\n return;\n if (!emitFetched)\n return;\n onBlock(block, undefined);\n emitFetched = false;\n })\n .catch(onError);\n }\n const transport = (() => {\n if (client.transport.type === 'fallback') {\n const transport = client.transport.transports.find((transport) => transport.config.type === 'webSocket' ||\n transport.config.type === 'ipc');\n if (!transport)\n return client.transport;\n return transport.value;\n }\n return client.transport;\n })();\n const { unsubscribe: unsubscribe_ } = await transport.subscribe({\n params: ['newHeads'],\n async onData(data) {\n if (!active)\n return;\n const block = (await getAction(client, getBlock, 'getBlock')({\n blockNumber: data.result?.number,\n includeTransactions,\n }).catch(() => { }));\n if (!active)\n return;\n onBlock(block, prevBlock);\n emitFetched = false;\n prevBlock = block;\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return () => unsubscribe();\n };\n return enablePolling ? pollBlocks() : subscribeBlocks();\n}\n//# sourceMappingURL=watchBlocks.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { InvalidInputRpcError } from '../../errors/rpc.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { formatLog } from '../../utils/formatters/log.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { createContractEventFilter } from './createContractEventFilter.js';\nimport { getBlockNumber } from './getBlockNumber.js';\nimport { getContractEvents, } from './getContractEvents.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns emitted contract event logs.\n *\n * - Docs: https://viem.sh/docs/contract/watchContractEvent\n *\n * This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent#onLogs).\n *\n * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchContractEventParameters}\n * @returns A function that can be invoked to stop watching for new event logs. {@link WatchContractEventReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchContractEvent } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchContractEvent(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']),\n * eventName: 'Transfer',\n * args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },\n * onLogs: (logs) => console.log(logs),\n * })\n */\nexport function watchContractEvent(client, parameters) {\n const { abi, address, args, batch = true, eventName, fromBlock, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_, } = parameters;\n const enablePolling = (() => {\n if (typeof poll_ !== 'undefined')\n return poll_;\n if (typeof fromBlock === 'bigint')\n return true;\n if (client.transport.type === 'webSocket' ||\n client.transport.type === 'ipc')\n return false;\n if (client.transport.type === 'fallback' &&\n (client.transport.transports[0].config.type === 'webSocket' ||\n client.transport.transports[0].config.type === 'ipc'))\n return false;\n return true;\n })();\n const pollContractEvent = () => {\n const strict = strict_ ?? false;\n const observerId = stringify([\n 'watchContractEvent',\n address,\n args,\n batch,\n client.uid,\n eventName,\n pollingInterval,\n strict,\n fromBlock,\n ]);\n return observe(observerId, { onLogs, onError }, (emit) => {\n let previousBlockNumber;\n if (fromBlock !== undefined)\n previousBlockNumber = fromBlock - 1n;\n let filter;\n let initialized = false;\n const unwatch = poll(async () => {\n if (!initialized) {\n try {\n filter = (await getAction(client, createContractEventFilter, 'createContractEventFilter')({\n abi,\n address,\n args: args,\n eventName: eventName,\n strict: strict,\n fromBlock,\n }));\n }\n catch { }\n initialized = true;\n return;\n }\n try {\n let logs;\n if (filter) {\n logs = await getAction(client, getFilterChanges, 'getFilterChanges')({ filter });\n }\n else {\n // If the filter doesn't exist, we will fall back to use `getLogs`.\n // The fall back exists because some RPC Providers do not support filters.\n // Fetch the block number to use for `getLogs`.\n const blockNumber = await getAction(client, getBlockNumber, 'getBlockNumber')({});\n // If the block number has changed, we will need to fetch the logs.\n // If the block number doesn't exist, we are yet to reach the first poll interval,\n // so do not emit any logs.\n if (previousBlockNumber && previousBlockNumber < blockNumber) {\n logs = await getAction(client, getContractEvents, 'getContractEvents')({\n abi,\n address,\n args,\n eventName,\n fromBlock: previousBlockNumber + 1n,\n toBlock: blockNumber,\n strict,\n });\n }\n else {\n logs = [];\n }\n previousBlockNumber = blockNumber;\n }\n if (logs.length === 0)\n return;\n if (batch)\n emit.onLogs(logs);\n else\n for (const log of logs)\n emit.onLogs([log]);\n }\n catch (err) {\n // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.\n // Reinitialize the filter when this occurs\n if (filter && err instanceof InvalidInputRpcError)\n initialized = false;\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await getAction(client, uninstallFilter, 'uninstallFilter')({ filter });\n unwatch();\n };\n });\n };\n const subscribeContractEvent = () => {\n const strict = strict_ ?? false;\n const observerId = stringify([\n 'watchContractEvent',\n address,\n args,\n batch,\n client.uid,\n eventName,\n pollingInterval,\n strict,\n ]);\n let active = true;\n let unsubscribe = () => (active = false);\n return observe(observerId, { onLogs, onError }, (emit) => {\n ;\n (async () => {\n try {\n const transport = (() => {\n if (client.transport.type === 'fallback') {\n const transport = client.transport.transports.find((transport) => transport.config.type === 'webSocket' ||\n transport.config.type === 'ipc');\n if (!transport)\n return client.transport;\n return transport.value;\n }\n return client.transport;\n })();\n const topics = eventName\n ? encodeEventTopics({\n abi: abi,\n eventName: eventName,\n args,\n })\n : [];\n const { unsubscribe: unsubscribe_ } = await transport.subscribe({\n params: ['logs', { address, topics }],\n onData(data) {\n if (!active)\n return;\n const log = data.result;\n try {\n const { eventName, args } = decodeEventLog({\n abi: abi,\n data: log.data,\n topics: log.topics,\n strict: strict_,\n });\n const formatted = formatLog(log, {\n args,\n eventName: eventName,\n });\n emit.onLogs([formatted]);\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict_)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n const formatted = formatLog(log, {\n args: isUnnamed ? [] : {},\n eventName,\n });\n emit.onLogs([formatted]);\n }\n },\n onError(error) {\n emit.onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return () => unsubscribe();\n });\n };\n return enablePolling ? pollContractEvent() : subscribeContractEvent();\n}\n//# sourceMappingURL=watchContractEvent.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { InvalidInputRpcError } from '../../errors/rpc.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { formatLog } from '../../utils/formatters/log.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { createEventFilter, } from './createEventFilter.js';\nimport { getBlockNumber } from './getBlockNumber.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { getLogs } from './getLogs.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).\n *\n * - Docs: https://viem.sh/docs/actions/public/watchEvent\n * - JSON-RPC Methods:\n * - **RPC Provider supports `eth_newFilter`:**\n * - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize).\n * - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges).\n * - **RPC Provider does not support `eth_newFilter`:**\n * - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval.\n *\n * This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent#onLogs).\n *\n * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchEventParameters}\n * @returns A function that can be invoked to stop watching for new Event Logs. {@link WatchEventReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchEvent } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchEvent(client, {\n * onLogs: (logs) => console.log(logs),\n * })\n */\nexport function watchEvent(client, { address, args, batch = true, event, events, fromBlock, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_, }) {\n const enablePolling = (() => {\n if (typeof poll_ !== 'undefined')\n return poll_;\n if (typeof fromBlock === 'bigint')\n return true;\n if (client.transport.type === 'webSocket' ||\n client.transport.type === 'ipc')\n return false;\n if (client.transport.type === 'fallback' &&\n (client.transport.transports[0].config.type === 'webSocket' ||\n client.transport.transports[0].config.type === 'ipc'))\n return false;\n return true;\n })();\n const strict = strict_ ?? false;\n const pollEvent = () => {\n const observerId = stringify([\n 'watchEvent',\n address,\n args,\n batch,\n client.uid,\n event,\n pollingInterval,\n fromBlock,\n ]);\n return observe(observerId, { onLogs, onError }, (emit) => {\n let previousBlockNumber;\n if (fromBlock !== undefined)\n previousBlockNumber = fromBlock - 1n;\n let filter;\n let initialized = false;\n const unwatch = poll(async () => {\n if (!initialized) {\n try {\n filter = (await getAction(client, createEventFilter, 'createEventFilter')({\n address,\n args,\n event: event,\n events,\n strict,\n fromBlock,\n }));\n }\n catch { }\n initialized = true;\n return;\n }\n try {\n let logs;\n if (filter) {\n logs = await getAction(client, getFilterChanges, 'getFilterChanges')({ filter });\n }\n else {\n // If the filter doesn't exist, we will fall back to use `getLogs`.\n // The fall back exists because some RPC Providers do not support filters.\n // Fetch the block number to use for `getLogs`.\n const blockNumber = await getAction(client, getBlockNumber, 'getBlockNumber')({});\n // If the block number has changed, we will need to fetch the logs.\n // If the block number doesn't exist, we are yet to reach the first poll interval,\n // so do not emit any logs.\n if (previousBlockNumber && previousBlockNumber !== blockNumber) {\n logs = await getAction(client, getLogs, 'getLogs')({\n address,\n args,\n event: event,\n events,\n fromBlock: previousBlockNumber + 1n,\n toBlock: blockNumber,\n });\n }\n else {\n logs = [];\n }\n previousBlockNumber = blockNumber;\n }\n if (logs.length === 0)\n return;\n if (batch)\n emit.onLogs(logs);\n else\n for (const log of logs)\n emit.onLogs([log]);\n }\n catch (err) {\n // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.\n // Reinitialize the filter when this occurs\n if (filter && err instanceof InvalidInputRpcError)\n initialized = false;\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await getAction(client, uninstallFilter, 'uninstallFilter')({ filter });\n unwatch();\n };\n });\n };\n const subscribeEvent = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const transport = (() => {\n if (client.transport.type === 'fallback') {\n const transport = client.transport.transports.find((transport) => transport.config.type === 'webSocket' ||\n transport.config.type === 'ipc');\n if (!transport)\n return client.transport;\n return transport.value;\n }\n return client.transport;\n })();\n const events_ = events ?? (event ? [event] : undefined);\n let topics = [];\n if (events_) {\n const encoded = events_.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n }));\n // TODO: Clean up type casting\n topics = [encoded];\n if (event)\n topics = topics[0];\n }\n const { unsubscribe: unsubscribe_ } = await transport.subscribe({\n params: ['logs', { address, topics }],\n onData(data) {\n if (!active)\n return;\n const log = data.result;\n try {\n const { eventName, args } = decodeEventLog({\n abi: events_ ?? [],\n data: log.data,\n topics: log.topics,\n strict,\n });\n const formatted = formatLog(log, { args, eventName });\n onLogs([formatted]);\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict_)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n const formatted = formatLog(log, {\n args: isUnnamed ? [] : {},\n eventName,\n });\n onLogs([formatted]);\n }\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return () => unsubscribe();\n };\n return enablePolling ? pollEvent() : subscribeEvent();\n}\n//# sourceMappingURL=watchEvent.js.map","import { getAction } from '../../utils/getAction.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { createPendingTransactionFilter } from './createPendingTransactionFilter.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns pending transaction hashes.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions\n * - JSON-RPC Methods:\n * - When `poll: true`\n * - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter.\n * - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newPendingTransactions\"` event.\n *\n * This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions#ontransactions).\n *\n * @param client - Client to use\n * @param parameters - {@link WatchPendingTransactionsParameters}\n * @returns A function that can be invoked to stop watching for new pending transaction hashes. {@link WatchPendingTransactionsReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchPendingTransactions } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = await watchPendingTransactions(client, {\n * onTransactions: (hashes) => console.log(hashes),\n * })\n */\nexport function watchPendingTransactions(client, { batch = true, onError, onTransactions, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = typeof poll_ !== 'undefined'\n ? poll_\n : client.transport.type !== 'webSocket' && client.transport.type !== 'ipc';\n const pollPendingTransactions = () => {\n const observerId = stringify([\n 'watchPendingTransactions',\n client.uid,\n batch,\n pollingInterval,\n ]);\n return observe(observerId, { onTransactions, onError }, (emit) => {\n let filter;\n const unwatch = poll(async () => {\n try {\n if (!filter) {\n try {\n filter = await getAction(client, createPendingTransactionFilter, 'createPendingTransactionFilter')({});\n return;\n }\n catch (err) {\n unwatch();\n throw err;\n }\n }\n const hashes = await getAction(client, getFilterChanges, 'getFilterChanges')({ filter });\n if (hashes.length === 0)\n return;\n if (batch)\n emit.onTransactions(hashes);\n else\n for (const hash of hashes)\n emit.onTransactions([hash]);\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await getAction(client, uninstallFilter, 'uninstallFilter')({ filter });\n unwatch();\n };\n });\n };\n const subscribePendingTransactions = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['newPendingTransactions'],\n onData(data) {\n if (!active)\n return;\n const transaction = data.result;\n onTransactions([transaction]);\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return () => unsubscribe();\n };\n return enablePolling\n ? pollPendingTransactions()\n : subscribePendingTransactions();\n}\n//# sourceMappingURL=watchPendingTransactions.js.map","import { BaseError } from './base.js';\nexport class UrlRequiredError extends BaseError {\n constructor() {\n super('No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.', {\n docsPath: '/docs/clients/intro',\n name: 'UrlRequiredError',\n });\n }\n}\n//# sourceMappingURL=transport.js.map","import { RpcRequestError } from '../../errors/request.js';\nimport { UrlRequiredError, } from '../../errors/transport.js';\nimport { createBatchScheduler } from '../../utils/promise/createBatchScheduler.js';\nimport { getHttpRpcClient, } from '../../utils/rpc/http.js';\nimport { createTransport, } from './createTransport.js';\n/**\n * @description Creates a HTTP transport that connects to a JSON-RPC API.\n */\nexport function http(\n/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */\nurl, config = {}) {\n const { batch, fetchFn, fetchOptions, key = 'http', methods, name = 'HTTP JSON-RPC', onFetchRequest, onFetchResponse, retryDelay, raw, } = config;\n return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {\n const { batchSize = 1000, wait = 0 } = typeof batch === 'object' ? batch : {};\n const retryCount = config.retryCount ?? retryCount_;\n const timeout = timeout_ ?? config.timeout ?? 10_000;\n const url_ = url || chain?.rpcUrls.default.http[0];\n if (!url_)\n throw new UrlRequiredError();\n const rpcClient = getHttpRpcClient(url_, {\n fetchFn,\n fetchOptions,\n onRequest: onFetchRequest,\n onResponse: onFetchResponse,\n timeout,\n });\n return createTransport({\n key,\n methods,\n name,\n async request({ method, params }) {\n const body = { method, params };\n const { schedule } = createBatchScheduler({\n id: url_,\n wait,\n shouldSplitBatch(requests) {\n return requests.length > batchSize;\n },\n fn: (body) => rpcClient.request({\n body,\n }),\n sort: (a, b) => a.id - b.id,\n });\n const fn = async (body) => batch\n ? schedule(body)\n : [\n await rpcClient.request({\n body,\n }),\n ];\n const [{ error, result }] = await fn(body);\n if (raw)\n return { error, result };\n if (error)\n throw new RpcRequestError({\n body,\n error,\n url: url_,\n });\n return result;\n },\n retryCount,\n retryDelay,\n timeout,\n type: 'http',\n }, {\n fetchOptions,\n url: url_,\n });\n };\n}\n//# sourceMappingURL=http.js.map","import { buildRequest } from '../../utils/buildRequest.js';\nimport { uid as uid_ } from '../../utils/uid.js';\n/**\n * @description Creates an transport intended to be used with a client.\n */\nexport function createTransport({ key, methods, name, request, retryCount = 3, retryDelay = 150, timeout, type, }, value) {\n const uid = uid_();\n return {\n config: {\n key,\n methods,\n name,\n request,\n retryCount,\n retryDelay,\n timeout,\n type,\n },\n request: buildRequest(request, { methods, retryCount, retryDelay, uid }),\n value,\n };\n}\n//# sourceMappingURL=createTransport.js.map","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n",null,null,null,null,"var n,l,u,t,i,o,r,f,e,c,s,a,h={},v=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)\"key\"==r?i=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function b(n){return n.children}function k(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return\"function\"==typeof n.type?x(n):null}function C(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,u,t,o,r,e,c,s;for(i.sort(f);n=i.shift();)n.__d&&(u=i.length,o=void 0,e=(r=(t=n).__v).__e,c=[],s=[],t.__P&&((o=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),O(t.__P,o,r,t.__n,t.__P.namespaceURI,32&r.__u?[e]:null,c,null==e?x(r):e,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,j(c,o,s),o.__e!=e&&C(o)),i.length>u&&i.sort(f));P.__r=0}function S(n,l,u,t,i,o,r,f,e,c,s){var a,p,y,d,w,_=t&&t.__k||v,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a<g;a++)null!=(y=u.__k[a])&&(p=-1===y.__i?h:_[y.__i]||h,y.__i=a,O(n,y,p,i,o,r,f,e,c,s),d=y.__e,y.ref&&p.ref!=y.ref&&(p.ref&&N(p.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),65536&y.__u||p.__k===y.__k?e=I(y,e,n):\"function\"==typeof y.type&&void 0!==y.__d?e=y.__d:d&&(e=d.nextSibling),y.__d=void 0,y.__u&=-196609);u.__d=e,u.__e=w}function $(n,l,u){var t,i,o,r,f,e=l.length,c=u.length,s=c,a=0;for(n.__k=[],t=0;t<e;t++)null!=(i=l[t])&&\"boolean\"!=typeof i&&\"function\"!=typeof i?(r=t+a,(i=n.__k[t]=\"string\"==typeof i||\"number\"==typeof i||\"bigint\"==typeof i||i.constructor==String?g(null,i,null,null,null):y(i)?g(b,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=n,i.__b=n.__b+1,o=null,-1!==(f=i.__i=L(i,u,r,s))&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,\"function\"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a--:f==r+1?a++:(f>r?a--:a++,i.__u|=65536))):i=n.__k[t]=null;if(s)for(t=0;t<c;t++)null!=(o=u[t])&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=x(o)),V(o,o))}function I(n,l,u){var t,i;if(\"function\"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=I(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=x(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function H(n,l){return l=l||[],null==n||\"boolean\"==typeof n||(y(n)?n.some(function(n){H(n,l)}):l.push(n)),l}function L(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type&&0==(131072&e.__u))return u;if(t>(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f<l.length){if((e=l[f])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return f;f++}}return-1}function T(n,l,u){\"-\"===l[0]?n.setProperty(l,null==u?\"\":u):n[l]=null==u?\"\":\"number\"!=typeof u||p.test(l)?u:u+\"px\"}function A(n,l,u,t,i){var o;n:if(\"style\"===l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof t&&(n.style.cssText=t=\"\"),t)for(l in t)u&&l in u||T(n.style,l,\"\");if(u)for(l in u)t&&u[l]===t[l]||T(n.style,l,u[l])}else if(\"o\"===l[0]&&\"n\"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/i,\"$1\")),l=l.toLowerCase()in n||\"onFocusOut\"===l||\"onFocusIn\"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=e,n.addEventListener(l,o?s:c,o)):n.removeEventListener(l,o?s:c,o);else{if(\"http://www.w3.org/2000/svg\"==i)l=l.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(\"width\"!=l&&\"height\"!=l&&\"href\"!=l&&\"list\"!=l&&\"form\"!=l&&\"tabIndex\"!=l&&\"download\"!=l&&\"rowSpan\"!=l&&\"colSpan\"!=l&&\"role\"!=l&&\"popover\"!=l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null==u||!1===u&&\"-\"!==l[4]?n.removeAttribute(l):n.setAttribute(l,\"popover\"==l&&1==u?\"\":u))}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=e++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function O(n,u,t,i,o,r,f,e,c,s){var a,h,v,p,w,_,g,m,x,C,M,P,$,I,H,L,T=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[e=u.__e=t.__e]),(a=l.__b)&&a(u);n:if(\"function\"==typeof T)try{if(m=u.props,x=\"prototype\"in T&&T.prototype.render,C=(a=T.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?g=(h=u.__c=t.__c).__=h.__E:(x?u.__c=h=new T(m,M):(u.__c=h=new k(m,M),h.constructor=T,h.render=q),C&&C.sub(h),h.props=m,h.state||(h.state={}),h.context=M,h.__n=i,v=h.__d=!0,h.__h=[],h._sb=[]),x&&null==h.__s&&(h.__s=h.state),x&&null!=T.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,T.getDerivedStateFromProps(m,h.__s))),p=h.props,w=h.state,h.__v=u,v)x&&null==T.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),x&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(x&&null==T.getDerivedStateFromProps&&m!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,M)||u.__v===t.__v)){for(u.__v!==t.__v&&(h.props=m,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,M),x&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(p,w,_)})}if(h.context=M,h.props=m,h.__P=n,h.__e=!1,$=l.__r,I=0,x){for(h.state=h.__s,h.__d=!1,$&&$(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,$&&$(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++I<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),x&&!v&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(p,w)),S(n,y(L=null!=a&&a.type===b&&null==a.key?a.props.children:a)?L:[L],u,t,i,o,r,f,e,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&f.push(h),g&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=r){for(u.__u|=c?160:32;e&&8===e.nodeType&&e.nextSibling;)e=e.nextSibling;r[r.indexOf(e)]=null,u.__e=e}else u.__e=t.__e,u.__k=t.__k;l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=z(t.__e,u,t,i,o,r,f,c,s);(a=l.diffed)&&a(u)}function j(n,u,t){u.__d=void 0;for(var i=0;i<t.length;i++)N(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function z(u,t,i,o,r,f,e,c,s){var a,v,p,d,_,g,m,b=i.props,k=t.props,C=t.type;if(\"svg\"===C?r=\"http://www.w3.org/2000/svg\":\"math\"===C?r=\"http://www.w3.org/1998/Math/MathML\":r||(r=\"http://www.w3.org/1999/xhtml\"),null!=f)for(a=0;a<f.length;a++)if((_=f[a])&&\"setAttribute\"in _==!!C&&(C?_.localName===C:3===_.nodeType)){u=_,f[a]=null;break}if(null==u){if(null===C)return document.createTextNode(k);u=document.createElementNS(r,C,k.is&&k),c&&(l.__m&&l.__m(t,f),c=!1),f=null}if(null===C)b===k||c&&u.data===k||(u.data=k);else{if(f=f&&n.call(u.childNodes),b=i.props||h,!c&&null!=f)for(b={},a=0;a<u.attributes.length;a++)b[(_=u.attributes[a]).name]=_.value;for(a in b)if(_=b[a],\"children\"==a);else if(\"dangerouslySetInnerHTML\"==a)p=_;else if(!(a in k)){if(\"value\"==a&&\"defaultValue\"in k||\"checked\"==a&&\"defaultChecked\"in k)continue;A(u,a,null,_,r)}for(a in k)_=k[a],\"children\"==a?d=_:\"dangerouslySetInnerHTML\"==a?v=_:\"value\"==a?g=_:\"checked\"==a?m=_:c&&\"function\"!=typeof _||b[a]===_||A(u,a,_,b[a],r);if(v)c||p&&(v.__html===p.__html||v.__html===u.innerHTML)||(u.innerHTML=v.__html),t.__k=[];else if(p&&(u.innerHTML=\"\"),S(u,y(d)?d:[d],t,i,o,\"foreignObject\"===C?\"http://www.w3.org/1999/xhtml\":r,f,e,f?f[0]:i.__k&&x(i,0),c,s),null!=f)for(a=f.length;a--;)w(f[a]);c||(a=\"value\",\"progress\"===C&&null==g?u.removeAttribute(\"value\"):void 0!==g&&(g!==u[a]||\"progress\"===C&&!g||\"option\"===C&&g!==b[a])&&A(u,a,g,b[a],r),a=\"checked\",void 0!==m&&m!==u[a]&&A(u,a,m,b[a],r))}return u}function N(n,u,t){try{if(\"function\"==typeof n){var i=\"function\"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function V(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||N(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&V(i[o],u,t||\"function\"!=typeof n.type);t||w(n.__e),n.__c=n.__=n.__e=n.__d=void 0}function q(n,l,u){return this.constructor(n,u)}function B(u,t,i){var o,r,f,e;l.__&&l.__(u,t),r=(o=\"function\"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],O(t,u=(!o&&i||t).__k=_(b,null,[u]),r||h,h,t.namespaceURI,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),j(f,u,e)}function D(n,l){B(n,l,D)}function E(l,u,t){var i,o,r,f,e=d({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)\"key\"==r?i=u[r]:\"ref\"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l=\"__cC\"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),\"function\"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},k.prototype.render=b,i=[],r=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,e=0,c=F(!1),s=F(!0),a=0;export{k as Component,b as Fragment,E as cloneElement,G as createContext,_ as createElement,m as createRef,_ as h,D as hydrate,t as isValidElement,l as options,B as render,H as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","import{options as r,Fragment as e}from\"preact\";export{Fragment}from\"preact\";var t=/[\"&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o=\"\",f=\"\";n<r.length;n++){switch(r.charCodeAt(n)){case 34:f=\""\";break;case 38:f=\"&\";break;case 60:f=\"<\";break;default:continue}n!==e&&(o+=r.slice(e,n)),o+=f,e=n+1}return n!==e&&(o+=r.slice(e,n)),o}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=0,i=Array.isArray;function u(e,t,n,o,i,u){t||(t={});var a,c,l=t;\"ref\"in t&&(a=t.ref,delete t.ref);var p={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--f,__i:-1,__u:0,__source:i,__self:u};if(\"function\"==typeof e&&(a=e.defaultProps))for(c in a)void 0===l[c]&&(l[c]=a[c]);return r.vnode&&r.vnode(p),p}function a(r){var t=u(e,{tpl:r,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t}var c={},l=/[A-Z]/g;function p(e,t){if(r.attr){var f=r.attr(e,t);if(\"string\"==typeof f)return f}if(\"ref\"===e||\"key\"===e)return\"\";if(\"style\"===e&&\"object\"==typeof t){var i=\"\";for(var u in t){var a=t[u];if(null!=a&&\"\"!==a){var p=\"-\"==u[0]?u:c[u]||(c[u]=u.replace(l,\"-$&\").toLowerCase()),_=\";\";\"number\"!=typeof a||p.startsWith(\"--\")||o.test(p)||(_=\"px;\"),i=i+p+\":\"+a+_}}return e+'=\"'+i+'\"'}return null==t||!1===t||\"function\"==typeof t||\"object\"==typeof t?\"\":!0===t?e:e+'=\"'+n(t)+'\"'}function _(r){if(null==r||\"boolean\"==typeof r||\"function\"==typeof r)return null;if(\"object\"==typeof r){if(void 0===r.constructor)return r;if(i(r)){for(var e=0;e<r.length;e++)r[e]=_(r[e]);return r}}return n(\"\"+r)}export{u as jsx,p as jsxAttr,u as jsxDEV,_ as jsxEscape,a as jsxTemplate,u as jsxs};\n//# sourceMappingURL=jsxRuntime.module.js.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f);else for(t in e)e[t]&&(n&&(n+=\" \"),n+=t);return n}export function clsx(){for(var e,t,f=0,n=\"\";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;",null,null,"import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=n,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,s=c.__;function d(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function h(n){return o=1,p(D,n)}function p(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=d(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__H.__h.push(i))}function _(n,u){var i=d(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.i=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){return\"function\"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n))}function T(n,r){var u=d(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=d(t++,10),i=h();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=d(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function j(){for(var n;n=f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],c.__e(t,n.__v)}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k=\"function\"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,100);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return\"function\"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,y as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,p as useReducer,A as useRef,h as useState};\n//# sourceMappingURL=hooks.module.js.map\n",null,null,null,null,null,null,null,null,"'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n",null,null,null,null,null,null,"import * as Bytes from './Bytes.js';\nimport * as Hex from './Hex.js';\nconst encoder = /*#__PURE__*/ new TextEncoder();\nconst decoder = /*#__PURE__*/ new TextDecoder();\nconst integerToCharacter = /*#__PURE__*/ Object.fromEntries(Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/').map((a, i) => [i, a.charCodeAt(0)]));\nconst characterToInteger = /*#__PURE__*/ {\n ...Object.fromEntries(Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/').map((a, i) => [a.charCodeAt(0), i])),\n ['='.charCodeAt(0)]: 0,\n ['-'.charCodeAt(0)]: 62,\n ['_'.charCodeAt(0)]: 63,\n};\n/**\n * Encodes a {@link ox#Bytes.Bytes} to a Base64-encoded string (with optional padding and/or URL-safe characters).\n *\n * @example\n * ```ts twoslash\n * import { Base64, Bytes } from 'ox'\n *\n * const value = Base64.fromBytes(Bytes.fromString('hello world'))\n * // @log: 'aGVsbG8gd29ybGQ='\n * ```\n *\n * @example\n * ### No Padding\n *\n * Turn off [padding of encoded data](https://datatracker.ietf.org/doc/html/rfc4648#section-3.2) with the `pad` option:\n *\n * ```ts twoslash\n * import { Base64, Bytes } from 'ox'\n *\n * const value = Base64.fromBytes(Bytes.fromString('hello world'), { pad: false })\n * // @log: 'aGVsbG8gd29ybGQ'\n * ```\n *\n * ### URL-safe Encoding\n *\n * Turn on [URL-safe encoding](https://datatracker.ietf.org/doc/html/rfc4648#section-5) (Base64 URL) with the `url` option:\n *\n * ```ts twoslash\n * import { Base64, Bytes } from 'ox'\n *\n * const value = Base64.fromBytes(Bytes.fromString('hello wod'), { url: true })\n * // @log: 'aGVsbG8gd29_77-9ZA=='\n * ```\n *\n * @param value - The byte array to encode.\n * @param options - Encoding options.\n * @returns The Base64 encoded string.\n */\nexport function fromBytes(value, options = {}) {\n const { pad = true, url = false } = options;\n const encoded = new Uint8Array(Math.ceil(value.length / 3) * 4);\n for (let i = 0, j = 0; j < value.length; i += 4, j += 3) {\n const y = (value[j] << 16) + (value[j + 1] << 8) + (value[j + 2] | 0);\n encoded[i] = integerToCharacter[y >> 18];\n encoded[i + 1] = integerToCharacter[(y >> 12) & 0x3f];\n encoded[i + 2] = integerToCharacter[(y >> 6) & 0x3f];\n encoded[i + 3] = integerToCharacter[y & 0x3f];\n }\n const k = value.length % 3;\n const end = Math.floor(value.length / 3) * 4 + (k && k + 1);\n let base64 = decoder.decode(new Uint8Array(encoded.buffer, 0, end));\n if (pad && k === 1)\n base64 += '==';\n if (pad && k === 2)\n base64 += '=';\n if (url)\n base64 = base64.replaceAll('+', '-').replaceAll('/', '_');\n return base64;\n}\n/**\n * Encodes a {@link ox#Hex.Hex} to a Base64-encoded string (with optional padding and/or URL-safe characters).\n *\n * @example\n * ```ts twoslash\n * import { Base64, Hex } from 'ox'\n *\n * const value = Base64.fromHex(Hex.fromString('hello world'))\n * // @log: 'aGVsbG8gd29ybGQ='\n * ```\n *\n * @example\n * ### No Padding\n *\n * Turn off [padding of encoded data](https://datatracker.ietf.org/doc/html/rfc4648#section-3.2) with the `pad` option:\n *\n * ```ts twoslash\n * import { Base64, Hex } from 'ox'\n *\n * const value = Base64.fromHex(Hex.fromString('hello world'), { pad: false })\n * // @log: 'aGVsbG8gd29ybGQ'\n * ```\n *\n * ### URL-safe Encoding\n *\n * Turn on [URL-safe encoding](https://datatracker.ietf.org/doc/html/rfc4648#section-5) (Base64 URL) with the `url` option:\n *\n * ```ts twoslash\n * import { Base64, Hex } from 'ox'\n *\n * const value = Base64.fromHex(Hex.fromString('hello wod'), { url: true })\n * // @log: 'aGVsbG8gd29_77-9ZA=='\n * ```\n *\n * @param value - The hex value to encode.\n * @param options - Encoding options.\n * @returns The Base64 encoded string.\n */\nexport function fromHex(value, options = {}) {\n return fromBytes(Bytes.fromHex(value), options);\n}\n/**\n * Encodes a string to a Base64-encoded string (with optional padding and/or URL-safe characters).\n *\n * @example\n * ```ts twoslash\n * import { Base64 } from 'ox'\n *\n * const value = Base64.fromString('hello world')\n * // @log: 'aGVsbG8gd29ybGQ='\n * ```\n *\n * @example\n * ### No Padding\n *\n * Turn off [padding of encoded data](https://datatracker.ietf.org/doc/html/rfc4648#section-3.2) with the `pad` option:\n *\n * ```ts twoslash\n * import { Base64 } from 'ox'\n *\n * const value = Base64.fromString('hello world', { pad: false })\n * // @log: 'aGVsbG8gd29ybGQ'\n * ```\n *\n * ### URL-safe Encoding\n *\n * Turn on [URL-safe encoding](https://datatracker.ietf.org/doc/html/rfc4648#section-5) (Base64 URL) with the `url` option:\n *\n * ```ts twoslash\n * import { Base64 } from 'ox'\n *\n * const value = Base64.fromString('hello wod', { url: true })\n * // @log: 'aGVsbG8gd29_77-9ZA=='\n * ```\n *\n * @param value - The string to encode.\n * @param options - Encoding options.\n * @returns The Base64 encoded string.\n */\nexport function fromString(value, options = {}) {\n return fromBytes(Bytes.fromString(value), options);\n}\n/**\n * Decodes a Base64-encoded string (with optional padding and/or URL-safe characters) to {@link ox#Bytes.Bytes}.\n *\n * @example\n * ```ts twoslash\n * import { Base64, Bytes } from 'ox'\n *\n * const value = Base64.toBytes('aGVsbG8gd29ybGQ=')\n * // @log: Uint8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])\n * ```\n *\n * @param value - The string, hex value, or byte array to encode.\n * @returns The Base64 decoded {@link ox#Bytes.Bytes}.\n */\nexport function toBytes(value) {\n const base64 = value.replace(/=+$/, '');\n const size = base64.length;\n const decoded = new Uint8Array(size + 3);\n encoder.encodeInto(base64 + '===', decoded);\n for (let i = 0, j = 0; i < base64.length; i += 4, j += 3) {\n const x = (characterToInteger[decoded[i]] << 18) +\n (characterToInteger[decoded[i + 1]] << 12) +\n (characterToInteger[decoded[i + 2]] << 6) +\n characterToInteger[decoded[i + 3]];\n decoded[j] = x >> 16;\n decoded[j + 1] = (x >> 8) & 0xff;\n decoded[j + 2] = x & 0xff;\n }\n const decodedSize = (size >> 2) * 3 + (size % 4 && (size % 4) - 1);\n return new Uint8Array(decoded.buffer, 0, decodedSize);\n}\n/**\n * Decodes a Base64-encoded string (with optional padding and/or URL-safe characters) to {@link ox#Hex.Hex}.\n *\n * @example\n * ```ts twoslash\n * import { Base64, Hex } from 'ox'\n *\n * const value = Base64.toHex('aGVsbG8gd29ybGQ=')\n * // @log: 0x68656c6c6f20776f726c64\n * ```\n *\n * @param value - The string, hex value, or byte array to encode.\n * @returns The Base64 decoded {@link ox#Hex.Hex}.\n */\nexport function toHex(value) {\n return Hex.fromBytes(toBytes(value));\n}\n/**\n * Decodes a Base64-encoded string (with optional padding and/or URL-safe characters) to a string.\n *\n * @example\n * ```ts twoslash\n * import { Base64 } from 'ox'\n *\n * const value = Base64.toString('aGVsbG8gd29ybGQ=')\n * // @log: 'hello world'\n * ```\n *\n * @param value - The string, hex value, or byte array to encode.\n * @returns The Base64 decoded string.\n */\nexport function toString(value) {\n return Bytes.toString(toBytes(value));\n}\n//# sourceMappingURL=Base64.js.map","/**\n * Internal module for NIST P256, P384, P521 curves.\n * Do not use for now.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256, sha384, sha512 } from '@noble/hashes/sha2';\nimport { createCurve } from \"./_shortw_utils.js\";\nimport { createHasher } from \"./abstract/hash-to-curve.js\";\nimport { Field } from \"./abstract/modular.js\";\nimport { mapToCurveSimpleSWU } from \"./abstract/weierstrass.js\";\nconst Fp256 = Field(BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'));\nconst p256_a = Fp256.create(BigInt('-3'));\nconst p256_b = BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b');\n/**\n * secp256r1 curve, ECDSA and ECDH methods.\n * Field: `2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n-1n`\n */\n// prettier-ignore\nexport const p256 = createCurve({\n a: p256_a,\n b: p256_b,\n Fp: Fp256,\n n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'),\n Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'),\n Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'),\n h: BigInt(1),\n lowS: false\n}, sha256);\n/** Alias to p256. */\nexport const secp256r1 = p256;\nconst p256_mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp256, {\n A: p256_a,\n B: p256_b,\n Z: Fp256.create(BigInt('-10')),\n}))();\n/** Hashing / encoding to p256 points / field. RFC 9380 methods. */\nexport const p256_hasher = /* @__PURE__ */ (() => createHasher(secp256r1.ProjectivePoint, (scalars) => p256_mapSWU(scalars[0]), {\n DST: 'P256_XMD:SHA-256_SSWU_RO_',\n encodeDST: 'P256_XMD:SHA-256_SSWU_NU_',\n p: Fp256.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha256,\n}))();\n// Field over which we'll do calculations.\nconst Fp384 = Field(BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'));\nconst p384_a = Fp384.create(BigInt('-3'));\n// prettier-ignore\nconst p384_b = BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef');\n/**\n * secp384r1 curve, ECDSA and ECDH methods.\n * Field: `2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n`.\n * */\n// prettier-ignore\nexport const p384 = createCurve({\n a: p384_a,\n b: p384_b,\n Fp: Fp384,\n n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'),\n Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'),\n Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'),\n h: BigInt(1),\n lowS: false\n}, sha384);\n/** Alias to p384. */\nexport const secp384r1 = p384;\nconst p384_mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp384, {\n A: p384_a,\n B: p384_b,\n Z: Fp384.create(BigInt('-12')),\n}))();\n/** Hashing / encoding to p384 points / field. RFC 9380 methods. */\nexport const p384_hasher = /* @__PURE__ */ (() => createHasher(secp384r1.ProjectivePoint, (scalars) => p384_mapSWU(scalars[0]), {\n DST: 'P384_XMD:SHA-384_SSWU_RO_',\n encodeDST: 'P384_XMD:SHA-384_SSWU_NU_',\n p: Fp384.ORDER,\n m: 1,\n k: 192,\n expand: 'xmd',\n hash: sha384,\n}))();\n// Field over which we'll do calculations.\nconst Fp521 = Field(BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'));\nconst p521_a = Fp521.create(BigInt('-3'));\nconst p521_b = BigInt('0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00');\n/**\n * NIST secp521r1 aka p521 curve, ECDSA and ECDH methods.\n * Field: `2n**521n - 1n`.\n */\n// prettier-ignore\nexport const p521 = createCurve({\n a: p521_a,\n b: p521_b,\n Fp: Fp521,\n n: BigInt('0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'),\n Gx: BigInt('0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'),\n Gy: BigInt('0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'),\n h: BigInt(1),\n lowS: false,\n allowedPrivateKeyLengths: [130, 131, 132] // P521 keys are variable-length. Normalize to 132b\n}, sha512);\n/** Alias to p521. */\nexport const secp521r1 = p521;\nconst p521_mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp521, {\n A: p521_a,\n B: p521_b,\n Z: Fp521.create(BigInt('-4')),\n}))();\n/** Hashing / encoding to p521 points / field. RFC 9380 methods. */\nexport const p521_hasher = /* @__PURE__ */ (() => createHasher(secp521r1.ProjectivePoint, (scalars) => p521_mapSWU(scalars[0]), {\n DST: 'P521_XMD:SHA-512_SSWU_RO_',\n encodeDST: 'P521_XMD:SHA-512_SSWU_NU_',\n p: Fp521.ORDER,\n m: 1,\n k: 256,\n expand: 'xmd',\n hash: sha512,\n}))();\n//# sourceMappingURL=nist.js.map","/**\n * NIST secp256r1 aka p256.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport {} from \"./abstract/hash-to-curve.js\";\nimport { p256_hasher, p256 as p256n } from \"./nist.js\";\nexport const p256 = p256n;\nexport const secp256r1 = p256n;\nexport const hashToCurve = /* @__PURE__ */ (() => p256_hasher.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => p256_hasher.encodeToCurve)();\n//# sourceMappingURL=p256.js.map","import * as Base64 from './Base64.js';\nimport * as Bytes from './Bytes.js';\nimport * as Errors from './Errors.js';\nimport * as Hash from './Hash.js';\nimport * as Hex from './Hex.js';\nimport * as internal from './internal/webauthn.js';\nimport * as P256 from './P256.js';\nexport const createChallenge = Uint8Array.from([\n 105, 171, 180, 181, 160, 222, 75, 198, 42, 42, 32, 31, 141, 37, 186, 233,\n]);\n/**\n * Creates a new WebAuthn P256 Credential, which can be stored and later used for signing.\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256 } from 'ox'\n *\n * const credential = await WebAuthnP256.createCredential({ name: 'Example' }) // [!code focus]\n * // @log: {\n * // @log: id: 'oZ48...',\n * // @log: publicKey: { x: 51421...5123n, y: 12345...6789n },\n * // @log: raw: PublicKeyCredential {},\n * // @log: }\n *\n * const { metadata, signature } = await WebAuthnP256.sign({\n * credentialId: credential.id,\n * challenge: '0xdeadbeef',\n * })\n * ```\n *\n * @param options - Credential creation options.\n * @returns A WebAuthn P256 credential.\n */\nexport async function createCredential(options) {\n const { createFn = window.navigator.credentials.create.bind(window.navigator.credentials), ...rest } = options;\n const creationOptions = getCredentialCreationOptions(rest);\n try {\n const credential = (await createFn(creationOptions));\n if (!credential)\n throw new CredentialCreationFailedError();\n const response = credential.response;\n const publicKey = await internal.parseCredentialPublicKey(response);\n return {\n id: credential.id,\n publicKey,\n raw: credential,\n };\n }\n catch (error) {\n throw new CredentialCreationFailedError({\n cause: error,\n });\n }\n}\n/**\n * Gets the authenticator data which contains information about the\n * processing of an authenticator request (ie. from `WebAuthnP256.sign`).\n *\n * :::warning\n *\n * This function is mainly for testing purposes or for manually constructing\n * autenticator data. In most cases you will not need this function.\n * `authenticatorData` is typically returned as part of the\n * {@link ox#WebAuthnP256.(sign:function)} response (ie. an authenticator response).\n *\n * :::\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256 } from 'ox'\n *\n * const authenticatorData = WebAuthnP256.getAuthenticatorData({\n * rpId: 'example.com',\n * signCount: 420,\n * })\n * // @log: \"0xa379a6f6eeafb9a55e378c118034e2751e682fab9f2d30ab13d2125586ce194705000001a4\"\n * ```\n *\n * @param options - Options to construct the authenticator data.\n * @returns The authenticator data.\n */\nexport function getAuthenticatorData(options = {}) {\n const { flag = 5, rpId = window.location.hostname, signCount = 0 } = options;\n const rpIdHash = Hash.sha256(Hex.fromString(rpId));\n const flag_bytes = Hex.fromNumber(flag, { size: 1 });\n const signCount_bytes = Hex.fromNumber(signCount, { size: 4 });\n return Hex.concat(rpIdHash, flag_bytes, signCount_bytes);\n}\n/**\n * Constructs the Client Data in stringified JSON format which represents client data that\n * was passed to `credentials.get()` in {@link ox#WebAuthnP256.(sign:function)}.\n *\n * :::warning\n *\n * This function is mainly for testing purposes or for manually constructing\n * client data. In most cases you will not need this function.\n * `clientDataJSON` is typically returned as part of the\n * {@link ox#WebAuthnP256.(sign:function)} response (ie. an authenticator response).\n *\n * :::\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256 } from 'ox'\n *\n * const clientDataJSON = WebAuthnP256.getClientDataJSON({\n * challenge: '0xdeadbeef',\n * origin: 'https://example.com',\n * })\n * // @log: \"{\"type\":\"webauthn.get\",\"challenge\":\"3q2-7w\",\"origin\":\"https://example.com\",\"crossOrigin\":false}\"\n * ```\n *\n * @param options - Options to construct the client data.\n * @returns The client data.\n */\nexport function getClientDataJSON(options) {\n const { challenge, crossOrigin = false, extraClientData, origin = window.location.origin, } = options;\n return JSON.stringify({\n type: 'webauthn.get',\n challenge: Base64.fromHex(challenge, { url: true, pad: false }),\n origin,\n crossOrigin,\n ...extraClientData,\n });\n}\n/**\n * Returns the creation options for a P256 WebAuthn Credential to be used with\n * the Web Authentication API.\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256 } from 'ox'\n *\n * const options = WebAuthnP256.getCredentialCreationOptions({ name: 'Example' })\n *\n * const credential = await window.navigator.credentials.create(options)\n * ```\n *\n * @param options - Options.\n * @returns The credential creation options.\n */\nexport function getCredentialCreationOptions(options) {\n const { attestation = 'none', authenticatorSelection = {\n residentKey: 'preferred',\n requireResidentKey: false,\n userVerification: 'required',\n }, challenge = createChallenge, excludeCredentialIds, extensions, name: name_, rp = {\n id: window.location.hostname,\n name: window.document.title,\n }, user, } = options;\n const name = (user?.name ?? name_);\n return {\n publicKey: {\n attestation,\n authenticatorSelection,\n challenge,\n ...(excludeCredentialIds\n ? {\n excludeCredentials: excludeCredentialIds?.map((id) => ({\n id: Base64.toBytes(id),\n type: 'public-key',\n })),\n }\n : {}),\n pubKeyCredParams: [\n {\n type: 'public-key',\n alg: -7, // p256\n },\n ],\n ...(extensions && { extensions }),\n rp,\n user: {\n id: user?.id ?? Hash.keccak256(Bytes.fromString(name), { as: 'Bytes' }),\n name,\n displayName: user?.displayName ?? name,\n },\n },\n };\n}\n/**\n * Returns the request options to sign a challenge with the Web Authentication API.\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256 } from 'ox'\n *\n * const options = WebAuthnP256.getCredentialRequestOptions({\n * challenge: '0xdeadbeef',\n * })\n *\n * const credential = await window.navigator.credentials.get(options)\n * ```\n *\n * @param options - Options.\n * @returns The credential request options.\n */\nexport function getCredentialRequestOptions(options) {\n const { credentialId, challenge, extensions, rpId = window.location.hostname, userVerification = 'required', } = options;\n return {\n publicKey: {\n ...(credentialId\n ? {\n allowCredentials: Array.isArray(credentialId)\n ? credentialId.map((id) => ({\n id: Base64.toBytes(id),\n type: 'public-key',\n }))\n : [\n {\n id: Base64.toBytes(credentialId),\n type: 'public-key',\n },\n ],\n }\n : {}),\n challenge: Bytes.fromHex(challenge),\n ...(extensions && { extensions }),\n rpId,\n userVerification,\n },\n };\n}\n/**\n * Constructs the final digest that was signed and computed by the authenticator. This payload includes\n * the cryptographic `challenge`, as well as authenticator metadata (`authenticatorData` + `clientDataJSON`).\n * This value can be also used with raw P256 verification (such as {@link ox#P256.(verify:function)} or\n * {@link ox#WebCryptoP256.(verify:function)}).\n *\n * :::warning\n *\n * This function is mainly for testing purposes or for manually constructing\n * signing payloads. In most cases you will not need this function and\n * instead use {@link ox#WebAuthnP256.(sign:function)}.\n *\n * :::\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256, WebCryptoP256 } from 'ox'\n *\n * const { metadata, payload } = WebAuthnP256.getSignPayload({ // [!code focus]\n * challenge: '0xdeadbeef', // [!code focus]\n * }) // [!code focus]\n * // @log: {\n * // @log: metadata: {\n * // @log: authenticatorData: \"0x49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000\",\n * // @log: challengeIndex: 23,\n * // @log: clientDataJSON: \"{\"type\":\"webauthn.get\",\"challenge\":\"9jEFijuhEWrM4SOW-tChJbUEHEP44VcjcJ-Bqo1fTM8\",\"origin\":\"http://localhost:5173\",\"crossOrigin\":false}\",\n * // @log: typeIndex: 1,\n * // @log: userVerificationRequired: true,\n * // @log: },\n * // @log: payload: \"0x49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763050000000045086dcb06a5f234db625bcdc94e657f86b76b6fd3eb9c30543eabc1e577a4b0\",\n * // @log: }\n *\n * const { publicKey, privateKey } = await WebCryptoP256.createKeyPair()\n *\n * const signature = await WebCryptoP256.sign({\n * payload,\n * privateKey,\n * })\n * ```\n *\n * @param options - Options to construct the signing payload.\n * @returns The signing payload.\n */\nexport function getSignPayload(options) {\n const { challenge, crossOrigin, extraClientData, flag, origin, rpId, signCount, userVerification = 'required', } = options;\n const authenticatorData = getAuthenticatorData({\n flag,\n rpId,\n signCount,\n });\n const clientDataJSON = getClientDataJSON({\n challenge,\n crossOrigin,\n extraClientData,\n origin,\n });\n const clientDataJSONHash = Hash.sha256(Hex.fromString(clientDataJSON));\n const challengeIndex = clientDataJSON.indexOf('\"challenge\"');\n const typeIndex = clientDataJSON.indexOf('\"type\"');\n const metadata = {\n authenticatorData,\n clientDataJSON,\n challengeIndex,\n typeIndex,\n userVerificationRequired: userVerification === 'required',\n };\n const payload = Hex.concat(authenticatorData, clientDataJSONHash);\n return { metadata, payload };\n}\n/**\n * Signs a challenge using a stored WebAuthn P256 Credential. If no Credential is provided,\n * a prompt will be displayed for the user to select an existing Credential\n * that was previously registered.\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256 } from 'ox'\n *\n * const credential = await WebAuthnP256.createCredential({\n * name: 'Example',\n * })\n *\n * const { metadata, signature } = await WebAuthnP256.sign({ // [!code focus]\n * credentialId: credential.id, // [!code focus]\n * challenge: '0xdeadbeef', // [!code focus]\n * }) // [!code focus]\n * // @log: {\n * // @log: metadata: {\n * // @log: authenticatorData: '0x49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000',\n * // @log: clientDataJSON: '{\"type\":\"webauthn.get\",\"challenge\":\"9jEFijuhEWrM4SOW-tChJbUEHEP44VcjcJ-Bqo1fTM8\",\"origin\":\"http://localhost:5173\",\"crossOrigin\":false}',\n * // @log: challengeIndex: 23,\n * // @log: typeIndex: 1,\n * // @log: userVerificationRequired: true,\n * // @log: },\n * // @log: signature: { r: 51231...4215n, s: 12345...6789n },\n * // @log: }\n * ```\n *\n * @param options - Options.\n * @returns The signature.\n */\nexport async function sign(options) {\n const { getFn = window.navigator.credentials.get.bind(window.navigator.credentials), ...rest } = options;\n const requestOptions = getCredentialRequestOptions(rest);\n try {\n const credential = (await getFn(requestOptions));\n if (!credential)\n throw new CredentialRequestFailedError();\n const response = credential.response;\n const clientDataJSON = String.fromCharCode(...new Uint8Array(response.clientDataJSON));\n const challengeIndex = clientDataJSON.indexOf('\"challenge\"');\n const typeIndex = clientDataJSON.indexOf('\"type\"');\n const signature = internal.parseAsn1Signature(new Uint8Array(response.signature));\n return {\n metadata: {\n authenticatorData: Hex.fromBytes(new Uint8Array(response.authenticatorData)),\n clientDataJSON,\n challengeIndex,\n typeIndex,\n userVerificationRequired: requestOptions.publicKey.userVerification === 'required',\n },\n signature,\n raw: credential,\n };\n }\n catch (error) {\n throw new CredentialRequestFailedError({\n cause: error,\n });\n }\n}\n/**\n * Verifies a signature using the Credential's public key and the challenge which was signed.\n *\n * @example\n * ```ts twoslash\n * import { WebAuthnP256 } from 'ox'\n *\n * const credential = await WebAuthnP256.createCredential({\n * name: 'Example',\n * })\n *\n * const { metadata, signature } = await WebAuthnP256.sign({\n * credentialId: credential.id,\n * challenge: '0xdeadbeef',\n * })\n *\n * const result = await WebAuthnP256.verify({ // [!code focus]\n * metadata, // [!code focus]\n * challenge: '0xdeadbeef', // [!code focus]\n * publicKey: credential.publicKey, // [!code focus]\n * signature, // [!code focus]\n * }) // [!code focus]\n * // @log: true\n * ```\n *\n * @param options - Options.\n * @returns Whether the signature is valid.\n */\nexport function verify(options) {\n const { challenge, hash = true, metadata, publicKey, signature } = options;\n const { authenticatorData, challengeIndex, clientDataJSON, typeIndex, userVerificationRequired, } = metadata;\n const authenticatorDataBytes = Bytes.fromHex(authenticatorData);\n // Check length of `authenticatorData`.\n if (authenticatorDataBytes.length < 37)\n return false;\n const flag = authenticatorDataBytes[32];\n // Verify that the UP bit of the flags in authData is set.\n if ((flag & 0x01) !== 0x01)\n return false;\n // If user verification was determined to be required, verify that\n // the UV bit of the flags in authData is set. Otherwise, ignore the\n // value of the UV flag.\n if (userVerificationRequired && (flag & 0x04) !== 0x04)\n return false;\n // If the BE bit of the flags in authData is not set, verify that\n // the BS bit is not set.\n if ((flag & 0x08) !== 0x08 && (flag & 0x10) === 0x10)\n return false;\n // Check that response is for an authentication assertion\n const type = '\"type\":\"webauthn.get\"';\n if (type !== clientDataJSON.slice(Number(typeIndex), type.length + 1))\n return false;\n // Check that hash is in the clientDataJSON.\n const match = clientDataJSON\n .slice(Number(challengeIndex))\n .match(/^\"challenge\":\"(.*?)\"/);\n if (!match)\n return false;\n // Validate the challenge in the clientDataJSON.\n const [_, challenge_extracted] = match;\n if (Hex.fromBytes(Base64.toBytes(challenge_extracted)) !== challenge)\n return false;\n const clientDataJSONHash = Hash.sha256(Bytes.fromString(clientDataJSON), {\n as: 'Bytes',\n });\n const payload = Bytes.concat(authenticatorDataBytes, clientDataJSONHash);\n return P256.verify({\n hash,\n payload,\n publicKey,\n signature,\n });\n}\n/** Thrown when a WebAuthn P256 credential creation fails. */\nexport class CredentialCreationFailedError extends Errors.BaseError {\n constructor({ cause } = {}) {\n super('Failed to create credential.', {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WebAuthnP256.CredentialCreationFailedError'\n });\n }\n}\n/** Thrown when a WebAuthn P256 credential request fails. */\nexport class CredentialRequestFailedError extends Errors.BaseError {\n constructor({ cause } = {}) {\n super('Failed to request credential.', {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WebAuthnP256.CredentialRequestFailedError'\n });\n }\n}\n//# sourceMappingURL=WebAuthnP256.js.map","export const entryPoint06Abi = [\n {\n inputs: [\n { name: 'preOpGas', type: 'uint256' },\n { name: 'paid', type: 'uint256' },\n { name: 'validAfter', type: 'uint48' },\n { name: 'validUntil', type: 'uint48' },\n { name: 'targetSuccess', type: 'bool' },\n { name: 'targetResult', type: 'bytes' },\n ],\n name: 'ExecutionResult',\n type: 'error',\n },\n {\n inputs: [\n { name: 'opIndex', type: 'uint256' },\n { name: 'reason', type: 'string' },\n ],\n name: 'FailedOp',\n type: 'error',\n },\n {\n inputs: [{ name: 'sender', type: 'address' }],\n name: 'SenderAddressResult',\n type: 'error',\n },\n {\n inputs: [{ name: 'aggregator', type: 'address' }],\n name: 'SignatureValidationFailed',\n type: 'error',\n },\n {\n inputs: [\n {\n components: [\n { name: 'preOpGas', type: 'uint256' },\n { name: 'prefund', type: 'uint256' },\n { name: 'sigFailed', type: 'bool' },\n { name: 'validAfter', type: 'uint48' },\n { name: 'validUntil', type: 'uint48' },\n { name: 'paymasterContext', type: 'bytes' },\n ],\n name: 'returnInfo',\n type: 'tuple',\n },\n {\n components: [\n { name: 'stake', type: 'uint256' },\n { name: 'unstakeDelaySec', type: 'uint256' },\n ],\n name: 'senderInfo',\n type: 'tuple',\n },\n {\n components: [\n { name: 'stake', type: 'uint256' },\n { name: 'unstakeDelaySec', type: 'uint256' },\n ],\n name: 'factoryInfo',\n type: 'tuple',\n },\n {\n components: [\n { name: 'stake', type: 'uint256' },\n { name: 'unstakeDelaySec', type: 'uint256' },\n ],\n name: 'paymasterInfo',\n type: 'tuple',\n },\n ],\n name: 'ValidationResult',\n type: 'error',\n },\n {\n inputs: [\n {\n components: [\n { name: 'preOpGas', type: 'uint256' },\n { name: 'prefund', type: 'uint256' },\n { name: 'sigFailed', type: 'bool' },\n { name: 'validAfter', type: 'uint48' },\n { name: 'validUntil', type: 'uint48' },\n { name: 'paymasterContext', type: 'bytes' },\n ],\n name: 'returnInfo',\n type: 'tuple',\n },\n {\n components: [\n { name: 'stake', type: 'uint256' },\n { name: 'unstakeDelaySec', type: 'uint256' },\n ],\n name: 'senderInfo',\n type: 'tuple',\n },\n {\n components: [\n { name: 'stake', type: 'uint256' },\n { name: 'unstakeDelaySec', type: 'uint256' },\n ],\n name: 'factoryInfo',\n type: 'tuple',\n },\n {\n components: [\n { name: 'stake', type: 'uint256' },\n { name: 'unstakeDelaySec', type: 'uint256' },\n ],\n name: 'paymasterInfo',\n type: 'tuple',\n },\n {\n components: [\n { name: 'aggregator', type: 'address' },\n {\n components: [\n { name: 'stake', type: 'uint256' },\n {\n name: 'unstakeDelaySec',\n type: 'uint256',\n },\n ],\n name: 'stakeInfo',\n type: 'tuple',\n },\n ],\n name: 'aggregatorInfo',\n type: 'tuple',\n },\n ],\n name: 'ValidationResultWithAggregation',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'factory',\n type: 'address',\n },\n {\n indexed: false,\n name: 'paymaster',\n type: 'address',\n },\n ],\n name: 'AccountDeployed',\n type: 'event',\n },\n { anonymous: false, inputs: [], name: 'BeforeExecution', type: 'event' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'totalDeposit',\n type: 'uint256',\n },\n ],\n name: 'Deposited',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'aggregator',\n type: 'address',\n },\n ],\n name: 'SignatureAggregatorChanged',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'totalStaked',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'unstakeDelaySec',\n type: 'uint256',\n },\n ],\n name: 'StakeLocked',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'withdrawTime',\n type: 'uint256',\n },\n ],\n name: 'StakeUnlocked',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'withdrawAddress',\n type: 'address',\n },\n {\n indexed: false,\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'StakeWithdrawn',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: true,\n name: 'paymaster',\n type: 'address',\n },\n {\n indexed: false,\n name: 'nonce',\n type: 'uint256',\n },\n { indexed: false, name: 'success', type: 'bool' },\n {\n indexed: false,\n name: 'actualGasCost',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'actualGasUsed',\n type: 'uint256',\n },\n ],\n name: 'UserOperationEvent',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'nonce',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'revertReason',\n type: 'bytes',\n },\n ],\n name: 'UserOperationRevertReason',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'withdrawAddress',\n type: 'address',\n },\n {\n indexed: false,\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Withdrawn',\n type: 'event',\n },\n {\n inputs: [],\n name: 'SIG_VALIDATION_FAILED',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { name: 'initCode', type: 'bytes' },\n { name: 'sender', type: 'address' },\n { name: 'paymasterAndData', type: 'bytes' },\n ],\n name: '_validateSenderAndPaymaster',\n outputs: [],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ name: 'unstakeDelaySec', type: 'uint32' }],\n name: 'addStake',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ name: 'account', type: 'address' }],\n name: 'balanceOf',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ name: 'account', type: 'address' }],\n name: 'depositTo',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ name: '', type: 'address' }],\n name: 'deposits',\n outputs: [\n { name: 'deposit', type: 'uint112' },\n { name: 'staked', type: 'bool' },\n { name: 'stake', type: 'uint112' },\n { name: 'unstakeDelaySec', type: 'uint32' },\n { name: 'withdrawTime', type: 'uint48' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ name: 'account', type: 'address' }],\n name: 'getDepositInfo',\n outputs: [\n {\n components: [\n { name: 'deposit', type: 'uint112' },\n { name: 'staked', type: 'bool' },\n { name: 'stake', type: 'uint112' },\n { name: 'unstakeDelaySec', type: 'uint32' },\n { name: 'withdrawTime', type: 'uint48' },\n ],\n name: 'info',\n type: 'tuple',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { name: 'sender', type: 'address' },\n { name: 'key', type: 'uint192' },\n ],\n name: 'getNonce',\n outputs: [{ name: 'nonce', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ name: 'initCode', type: 'bytes' }],\n name: 'getSenderAddress',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n { name: 'callGasLimit', type: 'uint256' },\n {\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'maxFeePerGas', type: 'uint256' },\n {\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'userOp',\n type: 'tuple',\n },\n ],\n name: 'getUserOpHash',\n outputs: [{ name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n {\n name: 'callGasLimit',\n type: 'uint256',\n },\n {\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n {\n name: 'maxFeePerGas',\n type: 'uint256',\n },\n {\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n {\n name: 'paymasterAndData',\n type: 'bytes',\n },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'userOps',\n type: 'tuple[]',\n },\n {\n name: 'aggregator',\n type: 'address',\n },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'opsPerAggregator',\n type: 'tuple[]',\n },\n { name: 'beneficiary', type: 'address' },\n ],\n name: 'handleAggregatedOps',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n { name: 'callGasLimit', type: 'uint256' },\n {\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'maxFeePerGas', type: 'uint256' },\n {\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'ops',\n type: 'tuple[]',\n },\n { name: 'beneficiary', type: 'address' },\n ],\n name: 'handleOps',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ name: 'key', type: 'uint192' }],\n name: 'incrementNonce',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { name: 'callData', type: 'bytes' },\n {\n components: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n {\n name: 'callGasLimit',\n type: 'uint256',\n },\n {\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'paymaster', type: 'address' },\n {\n name: 'maxFeePerGas',\n type: 'uint256',\n },\n {\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n ],\n name: 'mUserOp',\n type: 'tuple',\n },\n { name: 'userOpHash', type: 'bytes32' },\n { name: 'prefund', type: 'uint256' },\n { name: 'contextOffset', type: 'uint256' },\n { name: 'preOpGas', type: 'uint256' },\n ],\n name: 'opInfo',\n type: 'tuple',\n },\n { name: 'context', type: 'bytes' },\n ],\n name: 'innerHandleOp',\n outputs: [{ name: 'actualGasCost', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { name: '', type: 'address' },\n { name: '', type: 'uint192' },\n ],\n name: 'nonceSequenceNumber',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n { name: 'callGasLimit', type: 'uint256' },\n {\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'maxFeePerGas', type: 'uint256' },\n {\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'op',\n type: 'tuple',\n },\n { name: 'target', type: 'address' },\n { name: 'targetCallData', type: 'bytes' },\n ],\n name: 'simulateHandleOp',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n { name: 'callGasLimit', type: 'uint256' },\n {\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'maxFeePerGas', type: 'uint256' },\n {\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'userOp',\n type: 'tuple',\n },\n ],\n name: 'simulateValidation',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'unlockStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'withdrawAddress',\n type: 'address',\n },\n ],\n name: 'withdrawStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'withdrawAddress',\n type: 'address',\n },\n { name: 'withdrawAmount', type: 'uint256' },\n ],\n name: 'withdrawTo',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n { stateMutability: 'payable', type: 'receive' },\n];\nexport const entryPoint07Abi = [\n {\n inputs: [\n { name: 'success', type: 'bool' },\n { name: 'ret', type: 'bytes' },\n ],\n name: 'DelegateAndRevert',\n type: 'error',\n },\n {\n inputs: [\n { name: 'opIndex', type: 'uint256' },\n { name: 'reason', type: 'string' },\n ],\n name: 'FailedOp',\n type: 'error',\n },\n {\n inputs: [\n { name: 'opIndex', type: 'uint256' },\n { name: 'reason', type: 'string' },\n { name: 'inner', type: 'bytes' },\n ],\n name: 'FailedOpWithRevert',\n type: 'error',\n },\n {\n inputs: [{ name: 'returnData', type: 'bytes' }],\n name: 'PostOpReverted',\n type: 'error',\n },\n { inputs: [], name: 'ReentrancyGuardReentrantCall', type: 'error' },\n {\n inputs: [{ name: 'sender', type: 'address' }],\n name: 'SenderAddressResult',\n type: 'error',\n },\n {\n inputs: [{ name: 'aggregator', type: 'address' }],\n name: 'SignatureValidationFailed',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'factory',\n type: 'address',\n },\n {\n indexed: false,\n name: 'paymaster',\n type: 'address',\n },\n ],\n name: 'AccountDeployed',\n type: 'event',\n },\n { anonymous: false, inputs: [], name: 'BeforeExecution', type: 'event' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'totalDeposit',\n type: 'uint256',\n },\n ],\n name: 'Deposited',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'nonce',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'revertReason',\n type: 'bytes',\n },\n ],\n name: 'PostOpRevertReason',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'aggregator',\n type: 'address',\n },\n ],\n name: 'SignatureAggregatorChanged',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'totalStaked',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'unstakeDelaySec',\n type: 'uint256',\n },\n ],\n name: 'StakeLocked',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'withdrawTime',\n type: 'uint256',\n },\n ],\n name: 'StakeUnlocked',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'withdrawAddress',\n type: 'address',\n },\n {\n indexed: false,\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'StakeWithdrawn',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: true,\n name: 'paymaster',\n type: 'address',\n },\n {\n indexed: false,\n name: 'nonce',\n type: 'uint256',\n },\n { indexed: false, name: 'success', type: 'bool' },\n {\n indexed: false,\n name: 'actualGasCost',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'actualGasUsed',\n type: 'uint256',\n },\n ],\n name: 'UserOperationEvent',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'nonce',\n type: 'uint256',\n },\n ],\n name: 'UserOperationPrefundTooLow',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n name: 'nonce',\n type: 'uint256',\n },\n {\n indexed: false,\n name: 'revertReason',\n type: 'bytes',\n },\n ],\n name: 'UserOperationRevertReason',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n name: 'withdrawAddress',\n type: 'address',\n },\n {\n indexed: false,\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Withdrawn',\n type: 'event',\n },\n {\n inputs: [{ name: 'unstakeDelaySec', type: 'uint32' }],\n name: 'addStake',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ name: 'account', type: 'address' }],\n name: 'balanceOf',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { name: 'target', type: 'address' },\n { name: 'data', type: 'bytes' },\n ],\n name: 'delegateAndRevert',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ name: 'account', type: 'address' }],\n name: 'depositTo',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ name: '', type: 'address' }],\n name: 'deposits',\n outputs: [\n { name: 'deposit', type: 'uint256' },\n { name: 'staked', type: 'bool' },\n { name: 'stake', type: 'uint112' },\n { name: 'unstakeDelaySec', type: 'uint32' },\n { name: 'withdrawTime', type: 'uint48' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ name: 'account', type: 'address' }],\n name: 'getDepositInfo',\n outputs: [\n {\n components: [\n { name: 'deposit', type: 'uint256' },\n { name: 'staked', type: 'bool' },\n { name: 'stake', type: 'uint112' },\n { name: 'unstakeDelaySec', type: 'uint32' },\n { name: 'withdrawTime', type: 'uint48' },\n ],\n name: 'info',\n type: 'tuple',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { name: 'sender', type: 'address' },\n { name: 'key', type: 'uint192' },\n ],\n name: 'getNonce',\n outputs: [{ name: 'nonce', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ name: 'initCode', type: 'bytes' }],\n name: 'getSenderAddress',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n {\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'gasFees', type: 'bytes32' },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'userOp',\n type: 'tuple',\n },\n ],\n name: 'getUserOpHash',\n outputs: [{ name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n {\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'gasFees', type: 'bytes32' },\n {\n name: 'paymasterAndData',\n type: 'bytes',\n },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'userOps',\n type: 'tuple[]',\n },\n {\n name: 'aggregator',\n type: 'address',\n },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'opsPerAggregator',\n type: 'tuple[]',\n },\n { name: 'beneficiary', type: 'address' },\n ],\n name: 'handleAggregatedOps',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n {\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'gasFees', type: 'bytes32' },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'signature', type: 'bytes' },\n ],\n name: 'ops',\n type: 'tuple[]',\n },\n { name: 'beneficiary', type: 'address' },\n ],\n name: 'handleOps',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ name: 'key', type: 'uint192' }],\n name: 'incrementNonce',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { name: 'callData', type: 'bytes' },\n {\n components: [\n {\n components: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n {\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'callGasLimit',\n type: 'uint256',\n },\n {\n name: 'paymasterVerificationGasLimit',\n type: 'uint256',\n },\n {\n name: 'paymasterPostOpGasLimit',\n type: 'uint256',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { name: 'paymaster', type: 'address' },\n {\n name: 'maxFeePerGas',\n type: 'uint256',\n },\n {\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n ],\n name: 'mUserOp',\n type: 'tuple',\n },\n { name: 'userOpHash', type: 'bytes32' },\n { name: 'prefund', type: 'uint256' },\n { name: 'contextOffset', type: 'uint256' },\n { name: 'preOpGas', type: 'uint256' },\n ],\n name: 'opInfo',\n type: 'tuple',\n },\n { name: 'context', type: 'bytes' },\n ],\n name: 'innerHandleOp',\n outputs: [{ name: 'actualGasCost', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { name: '', type: 'address' },\n { name: '', type: 'uint192' },\n ],\n name: 'nonceSequenceNumber',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ name: 'interfaceId', type: 'bytes4' }],\n name: 'supportsInterface',\n outputs: [{ name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'unlockStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'withdrawAddress',\n type: 'address',\n },\n ],\n name: 'withdrawStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n name: 'withdrawAddress',\n type: 'address',\n },\n { name: 'withdrawAmount', type: 'uint256' },\n ],\n name: 'withdrawTo',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n { stateMutability: 'payable', type: 'receive' },\n];\nexport const entryPoint08Abi = [\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n {\n inputs: [\n { internalType: 'bool', name: 'success', type: 'bool' },\n { internalType: 'bytes', name: 'ret', type: 'bytes' },\n ],\n name: 'DelegateAndRevert',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'opIndex', type: 'uint256' },\n { internalType: 'string', name: 'reason', type: 'string' },\n ],\n name: 'FailedOp',\n type: 'error',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'opIndex', type: 'uint256' },\n { internalType: 'string', name: 'reason', type: 'string' },\n { internalType: 'bytes', name: 'inner', type: 'bytes' },\n ],\n name: 'FailedOpWithRevert',\n type: 'error',\n },\n { inputs: [], name: 'InvalidShortString', type: 'error' },\n {\n inputs: [{ internalType: 'bytes', name: 'returnData', type: 'bytes' }],\n name: 'PostOpReverted',\n type: 'error',\n },\n { inputs: [], name: 'ReentrancyGuardReentrantCall', type: 'error' },\n {\n inputs: [{ internalType: 'address', name: 'sender', type: 'address' }],\n name: 'SenderAddressResult',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'address', name: 'aggregator', type: 'address' }],\n name: 'SignatureValidationFailed',\n type: 'error',\n },\n {\n inputs: [{ internalType: 'string', name: 'str', type: 'string' }],\n name: 'StringTooLong',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'bytes32',\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'factory',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'paymaster',\n type: 'address',\n },\n ],\n name: 'AccountDeployed',\n type: 'event',\n },\n { anonymous: false, inputs: [], name: 'BeforeExecution', type: 'event' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'totalDeposit',\n type: 'uint256',\n },\n ],\n name: 'Deposited',\n type: 'event',\n },\n { anonymous: false, inputs: [], name: 'EIP712DomainChanged', type: 'event' },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'bytes32',\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'nonce',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'bytes',\n name: 'revertReason',\n type: 'bytes',\n },\n ],\n name: 'PostOpRevertReason',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'aggregator',\n type: 'address',\n },\n ],\n name: 'SignatureAggregatorChanged',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'totalStaked',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'unstakeDelaySec',\n type: 'uint256',\n },\n ],\n name: 'StakeLocked',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'withdrawTime',\n type: 'uint256',\n },\n ],\n name: 'StakeUnlocked',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'withdrawAddress',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'StakeWithdrawn',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'bytes32',\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'paymaster',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'nonce',\n type: 'uint256',\n },\n { indexed: false, internalType: 'bool', name: 'success', type: 'bool' },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'actualGasCost',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'actualGasUsed',\n type: 'uint256',\n },\n ],\n name: 'UserOperationEvent',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'bytes32',\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'nonce',\n type: 'uint256',\n },\n ],\n name: 'UserOperationPrefundTooLow',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'bytes32',\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'nonce',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'bytes',\n name: 'revertReason',\n type: 'bytes',\n },\n ],\n name: 'UserOperationRevertReason',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'account',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'address',\n name: 'withdrawAddress',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'amount',\n type: 'uint256',\n },\n ],\n name: 'Withdrawn',\n type: 'event',\n },\n {\n inputs: [\n { internalType: 'uint32', name: 'unstakeDelaySec', type: 'uint32' },\n ],\n name: 'addStake',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'balanceOf',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'target', type: 'address' },\n { internalType: 'bytes', name: 'data', type: 'bytes' },\n ],\n name: 'delegateAndRevert',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'depositTo',\n outputs: [],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'eip712Domain',\n outputs: [\n { internalType: 'bytes1', name: 'fields', type: 'bytes1' },\n { internalType: 'string', name: 'name', type: 'string' },\n { internalType: 'string', name: 'version', type: 'string' },\n { internalType: 'uint256', name: 'chainId', type: 'uint256' },\n { internalType: 'address', name: 'verifyingContract', type: 'address' },\n { internalType: 'bytes32', name: 'salt', type: 'bytes32' },\n { internalType: 'uint256[]', name: 'extensions', type: 'uint256[]' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'getDepositInfo',\n outputs: [\n {\n components: [\n { internalType: 'uint256', name: 'deposit', type: 'uint256' },\n { internalType: 'bool', name: 'staked', type: 'bool' },\n { internalType: 'uint112', name: 'stake', type: 'uint112' },\n { internalType: 'uint32', name: 'unstakeDelaySec', type: 'uint32' },\n { internalType: 'uint48', name: 'withdrawTime', type: 'uint48' },\n ],\n internalType: 'struct IStakeManager.DepositInfo',\n name: 'info',\n type: 'tuple',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getDomainSeparatorV4',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'sender', type: 'address' },\n { internalType: 'uint192', name: 'key', type: 'uint192' },\n ],\n name: 'getNonce',\n outputs: [{ internalType: 'uint256', name: 'nonce', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getPackedUserOpTypeHash',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'pure',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'bytes', name: 'initCode', type: 'bytes' }],\n name: 'getSenderAddress',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'sender', type: 'address' },\n { internalType: 'uint256', name: 'nonce', type: 'uint256' },\n { internalType: 'bytes', name: 'initCode', type: 'bytes' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n {\n internalType: 'bytes32',\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n internalType: 'uint256',\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { internalType: 'bytes32', name: 'gasFees', type: 'bytes32' },\n { internalType: 'bytes', name: 'paymasterAndData', type: 'bytes' },\n { internalType: 'bytes', name: 'signature', type: 'bytes' },\n ],\n internalType: 'struct PackedUserOperation',\n name: 'userOp',\n type: 'tuple',\n },\n ],\n name: 'getUserOpHash',\n outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n components: [\n { internalType: 'address', name: 'sender', type: 'address' },\n { internalType: 'uint256', name: 'nonce', type: 'uint256' },\n { internalType: 'bytes', name: 'initCode', type: 'bytes' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n {\n internalType: 'bytes32',\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n internalType: 'uint256',\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { internalType: 'bytes32', name: 'gasFees', type: 'bytes32' },\n {\n internalType: 'bytes',\n name: 'paymasterAndData',\n type: 'bytes',\n },\n { internalType: 'bytes', name: 'signature', type: 'bytes' },\n ],\n internalType: 'struct PackedUserOperation[]',\n name: 'userOps',\n type: 'tuple[]',\n },\n {\n internalType: 'contract IAggregator',\n name: 'aggregator',\n type: 'address',\n },\n { internalType: 'bytes', name: 'signature', type: 'bytes' },\n ],\n internalType: 'struct IEntryPoint.UserOpsPerAggregator[]',\n name: 'opsPerAggregator',\n type: 'tuple[]',\n },\n { internalType: 'address payable', name: 'beneficiary', type: 'address' },\n ],\n name: 'handleAggregatedOps',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n { internalType: 'address', name: 'sender', type: 'address' },\n { internalType: 'uint256', name: 'nonce', type: 'uint256' },\n { internalType: 'bytes', name: 'initCode', type: 'bytes' },\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n {\n internalType: 'bytes32',\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n internalType: 'uint256',\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { internalType: 'bytes32', name: 'gasFees', type: 'bytes32' },\n { internalType: 'bytes', name: 'paymasterAndData', type: 'bytes' },\n { internalType: 'bytes', name: 'signature', type: 'bytes' },\n ],\n internalType: 'struct PackedUserOperation[]',\n name: 'ops',\n type: 'tuple[]',\n },\n { internalType: 'address payable', name: 'beneficiary', type: 'address' },\n ],\n name: 'handleOps',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint192', name: 'key', type: 'uint192' }],\n name: 'incrementNonce',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'bytes', name: 'callData', type: 'bytes' },\n {\n components: [\n {\n components: [\n { internalType: 'address', name: 'sender', type: 'address' },\n { internalType: 'uint256', name: 'nonce', type: 'uint256' },\n {\n internalType: 'uint256',\n name: 'verificationGasLimit',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'callGasLimit',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'paymasterVerificationGasLimit',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'paymasterPostOpGasLimit',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'preVerificationGas',\n type: 'uint256',\n },\n { internalType: 'address', name: 'paymaster', type: 'address' },\n {\n internalType: 'uint256',\n name: 'maxFeePerGas',\n type: 'uint256',\n },\n {\n internalType: 'uint256',\n name: 'maxPriorityFeePerGas',\n type: 'uint256',\n },\n ],\n internalType: 'struct EntryPoint.MemoryUserOp',\n name: 'mUserOp',\n type: 'tuple',\n },\n { internalType: 'bytes32', name: 'userOpHash', type: 'bytes32' },\n { internalType: 'uint256', name: 'prefund', type: 'uint256' },\n { internalType: 'uint256', name: 'contextOffset', type: 'uint256' },\n { internalType: 'uint256', name: 'preOpGas', type: 'uint256' },\n ],\n internalType: 'struct EntryPoint.UserOpInfo',\n name: 'opInfo',\n type: 'tuple',\n },\n { internalType: 'bytes', name: 'context', type: 'bytes' },\n ],\n name: 'innerHandleOp',\n outputs: [\n { internalType: 'uint256', name: 'actualGasCost', type: 'uint256' },\n ],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: '', type: 'address' },\n { internalType: 'uint192', name: '', type: 'uint192' },\n ],\n name: 'nonceSequenceNumber',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'senderCreator',\n outputs: [\n { internalType: 'contract ISenderCreator', name: '', type: 'address' },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'bytes4', name: 'interfaceId', type: 'bytes4' }],\n name: 'supportsInterface',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'unlockStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address payable',\n name: 'withdrawAddress',\n type: 'address',\n },\n ],\n name: 'withdrawStake',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address payable',\n name: 'withdrawAddress',\n type: 'address',\n },\n { internalType: 'uint256', name: 'withdrawAmount', type: 'uint256' },\n ],\n name: 'withdrawTo',\n outputs: [],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n { stateMutability: 'payable', type: 'receive' },\n];\n//# sourceMappingURL=abis.js.map","import { concat } from '../../../utils/data/concat.js';\nexport function getInitCode(userOperation) {\n const { authorization, factory, factoryData } = userOperation;\n if (factory === '0x7702' ||\n factory === '0x7702000000000000000000000000000000000000') {\n if (!authorization)\n return '0x7702000000000000000000000000000000000000';\n const delegation = authorization.address;\n return concat([delegation, factoryData ?? '0x']);\n }\n if (!factory)\n return '0x';\n return concat([factory, factoryData ?? '0x']);\n}\n//# sourceMappingURL=getInitCode.js.map","import { concat } from '../../../utils/data/concat.js';\nimport { pad } from '../../../utils/data/pad.js';\nimport { numberToHex } from '../../../utils/index.js';\nimport { getInitCode } from './getInitCode.js';\nexport function toPackedUserOperation(userOperation) {\n const { callGasLimit, callData, maxPriorityFeePerGas, maxFeePerGas, paymaster, paymasterData, paymasterPostOpGasLimit, paymasterVerificationGasLimit, sender, signature = '0x', verificationGasLimit, } = userOperation;\n const accountGasLimits = concat([\n pad(numberToHex(verificationGasLimit || 0n), { size: 16 }),\n pad(numberToHex(callGasLimit || 0n), { size: 16 }),\n ]);\n const initCode = getInitCode(userOperation);\n const gasFees = concat([\n pad(numberToHex(maxPriorityFeePerGas || 0n), { size: 16 }),\n pad(numberToHex(maxFeePerGas || 0n), { size: 16 }),\n ]);\n const nonce = userOperation.nonce ?? 0n;\n const paymasterAndData = paymaster\n ? concat([\n paymaster,\n pad(numberToHex(paymasterVerificationGasLimit || 0n), {\n size: 16,\n }),\n pad(numberToHex(paymasterPostOpGasLimit || 0n), {\n size: 16,\n }),\n paymasterData || '0x',\n ])\n : '0x';\n const preVerificationGas = userOperation.preVerificationGas ?? 0n;\n return {\n accountGasLimits,\n callData,\n initCode,\n gasFees,\n nonce,\n paymasterAndData,\n preVerificationGas,\n sender,\n signature,\n };\n}\n//# sourceMappingURL=toPackedUserOperation.js.map","import { toPackedUserOperation } from './toPackedUserOperation.js';\nconst types = {\n PackedUserOperation: [\n { type: 'address', name: 'sender' },\n { type: 'uint256', name: 'nonce' },\n { type: 'bytes', name: 'initCode' },\n { type: 'bytes', name: 'callData' },\n { type: 'bytes32', name: 'accountGasLimits' },\n { type: 'uint256', name: 'preVerificationGas' },\n { type: 'bytes32', name: 'gasFees' },\n { type: 'bytes', name: 'paymasterAndData' },\n ],\n};\nexport function getUserOperationTypedData(parameters) {\n const { chainId, entryPointAddress, userOperation } = parameters;\n const packedUserOp = toPackedUserOperation(userOperation);\n return {\n types,\n primaryType: 'PackedUserOperation',\n domain: {\n name: 'ERC4337',\n version: '1',\n chainId,\n verifyingContract: entryPointAddress,\n },\n message: packedUserOp,\n };\n}\n//# sourceMappingURL=getUserOperationTypedData.js.map","import { encodeAbiParameters } from '../../../utils/abi/encodeAbiParameters.js';\nimport { keccak256 } from '../../../utils/hash/keccak256.js';\nimport { hashTypedData } from '../../../utils/signature/hashTypedData.js';\nimport { getInitCode } from './getInitCode.js';\nimport { getUserOperationTypedData } from './getUserOperationTypedData.js';\nimport { toPackedUserOperation } from './toPackedUserOperation.js';\nexport function getUserOperationHash(parameters) {\n const { chainId, entryPointAddress, entryPointVersion } = parameters;\n const userOperation = parameters.userOperation;\n const { authorization, callData = '0x', callGasLimit, maxFeePerGas, maxPriorityFeePerGas, nonce, paymasterAndData = '0x', preVerificationGas, sender, verificationGasLimit, } = userOperation;\n if (entryPointVersion === '0.8')\n return hashTypedData(getUserOperationTypedData({\n chainId,\n entryPointAddress,\n userOperation,\n }));\n const packedUserOp = (() => {\n if (entryPointVersion === '0.6') {\n const factory = userOperation.initCode?.slice(0, 42);\n const factoryData = userOperation.initCode?.slice(42);\n const initCode = getInitCode({\n authorization,\n factory,\n factoryData,\n });\n return encodeAbiParameters([\n { type: 'address' },\n { type: 'uint256' },\n { type: 'bytes32' },\n { type: 'bytes32' },\n { type: 'uint256' },\n { type: 'uint256' },\n { type: 'uint256' },\n { type: 'uint256' },\n { type: 'uint256' },\n { type: 'bytes32' },\n ], [\n sender,\n nonce,\n keccak256(initCode),\n keccak256(callData),\n callGasLimit,\n verificationGasLimit,\n preVerificationGas,\n maxFeePerGas,\n maxPriorityFeePerGas,\n keccak256(paymasterAndData),\n ]);\n }\n if (entryPointVersion === '0.7') {\n const packedUserOp = toPackedUserOperation(userOperation);\n return encodeAbiParameters([\n { type: 'address' },\n { type: 'uint256' },\n { type: 'bytes32' },\n { type: 'bytes32' },\n { type: 'bytes32' },\n { type: 'uint256' },\n { type: 'bytes32' },\n { type: 'bytes32' },\n ], [\n packedUserOp.sender,\n packedUserOp.nonce,\n keccak256(packedUserOp.initCode),\n keccak256(packedUserOp.callData),\n packedUserOp.accountGasLimits,\n packedUserOp.preVerificationGas,\n packedUserOp.gasFees,\n keccak256(packedUserOp.paymasterAndData),\n ]);\n }\n throw new Error(`entryPointVersion \"${entryPointVersion}\" not supported.`);\n })();\n return keccak256(encodeAbiParameters([{ type: 'bytes32' }, { type: 'address' }, { type: 'uint256' }], [keccak256(packedUserOp), entryPointAddress, BigInt(chainId)]));\n}\n//# sourceMappingURL=getUserOperationHash.js.map","import { BaseError } from '../../errors/base.js';\nexport class AccountNotDeployedError extends BaseError {\n constructor({ cause, }) {\n super('Smart Account is not deployed.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- No `factory`/`factoryData` or `initCode` properties are provided for Smart Account deployment.',\n '- An incorrect `sender` address is provided.',\n ],\n name: 'AccountNotDeployedError',\n });\n }\n}\nObject.defineProperty(AccountNotDeployedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa20/\n});\nexport class ExecutionRevertedError extends BaseError {\n constructor({ cause, data, message, } = {}) {\n const reason = message\n ?.replace('execution reverted: ', '')\n ?.replace('execution reverted', '');\n super(`Execution reverted ${reason ? `with reason: ${reason}` : 'for an unknown reason'}.`, {\n cause,\n name: 'ExecutionRevertedError',\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n }\n}\nObject.defineProperty(ExecutionRevertedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32521\n});\nObject.defineProperty(ExecutionRevertedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /execution reverted/\n});\nexport class FailedToSendToBeneficiaryError extends BaseError {\n constructor({ cause, }) {\n super('Failed to send funds to beneficiary.', {\n cause,\n name: 'FailedToSendToBeneficiaryError',\n });\n }\n}\nObject.defineProperty(FailedToSendToBeneficiaryError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa91/\n});\nexport class GasValuesOverflowError extends BaseError {\n constructor({ cause, }) {\n super('Gas value overflowed.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- one of the gas values exceeded 2**120 (uint120)',\n ].filter(Boolean),\n name: 'GasValuesOverflowError',\n });\n }\n}\nObject.defineProperty(GasValuesOverflowError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa94/\n});\nexport class HandleOpsOutOfGasError extends BaseError {\n constructor({ cause, }) {\n super('The `handleOps` function was called by the Bundler with a gas limit too low.', {\n cause,\n name: 'HandleOpsOutOfGasError',\n });\n }\n}\nObject.defineProperty(HandleOpsOutOfGasError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa95/\n});\nexport class InitCodeFailedError extends BaseError {\n constructor({ cause, factory, factoryData, initCode, }) {\n super('Failed to simulate deployment for Smart Account.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- Invalid `factory`/`factoryData` or `initCode` properties are present',\n '- Smart Account deployment execution ran out of gas (low `verificationGasLimit` value)',\n '- Smart Account deployment execution reverted with an error\\n',\n factory && `factory: ${factory}`,\n factoryData && `factoryData: ${factoryData}`,\n initCode && `initCode: ${initCode}`,\n ].filter(Boolean),\n name: 'InitCodeFailedError',\n });\n }\n}\nObject.defineProperty(InitCodeFailedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa13/\n});\nexport class InitCodeMustCreateSenderError extends BaseError {\n constructor({ cause, factory, factoryData, initCode, }) {\n super('Smart Account initialization implementation did not create an account.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- `factory`/`factoryData` or `initCode` properties are invalid',\n '- Smart Account initialization implementation is incorrect\\n',\n factory && `factory: ${factory}`,\n factoryData && `factoryData: ${factoryData}`,\n initCode && `initCode: ${initCode}`,\n ].filter(Boolean),\n name: 'InitCodeMustCreateSenderError',\n });\n }\n}\nObject.defineProperty(InitCodeMustCreateSenderError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa15/\n});\nexport class InitCodeMustReturnSenderError extends BaseError {\n constructor({ cause, factory, factoryData, initCode, sender, }) {\n super('Smart Account initialization implementation does not return the expected sender.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n 'Smart Account initialization implementation does not return a sender address\\n',\n factory && `factory: ${factory}`,\n factoryData && `factoryData: ${factoryData}`,\n initCode && `initCode: ${initCode}`,\n sender && `sender: ${sender}`,\n ].filter(Boolean),\n name: 'InitCodeMustReturnSenderError',\n });\n }\n}\nObject.defineProperty(InitCodeMustReturnSenderError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa14/\n});\nexport class InsufficientPrefundError extends BaseError {\n constructor({ cause, }) {\n super('Smart Account does not have sufficient funds to execute the User Operation.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the Smart Account does not have sufficient funds to cover the required prefund, or',\n '- a Paymaster was not provided',\n ].filter(Boolean),\n name: 'InsufficientPrefundError',\n });\n }\n}\nObject.defineProperty(InsufficientPrefundError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa21/\n});\nexport class InternalCallOnlyError extends BaseError {\n constructor({ cause, }) {\n super('Bundler attempted to call an invalid function on the EntryPoint.', {\n cause,\n name: 'InternalCallOnlyError',\n });\n }\n}\nObject.defineProperty(InternalCallOnlyError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa92/\n});\nexport class InvalidAggregatorError extends BaseError {\n constructor({ cause, }) {\n super('Bundler used an invalid aggregator for handling aggregated User Operations.', {\n cause,\n name: 'InvalidAggregatorError',\n });\n }\n}\nObject.defineProperty(InvalidAggregatorError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa96/\n});\nexport class InvalidAccountNonceError extends BaseError {\n constructor({ cause, nonce, }) {\n super('Invalid Smart Account nonce used for User Operation.', {\n cause,\n metaMessages: [nonce && `nonce: ${nonce}`].filter(Boolean),\n name: 'InvalidAccountNonceError',\n });\n }\n}\nObject.defineProperty(InvalidAccountNonceError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa25/\n});\nexport class InvalidBeneficiaryError extends BaseError {\n constructor({ cause, }) {\n super('Bundler has not set a beneficiary address.', {\n cause,\n name: 'InvalidBeneficiaryError',\n });\n }\n}\nObject.defineProperty(InvalidBeneficiaryError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa90/\n});\nexport class InvalidFieldsError extends BaseError {\n constructor({ cause, }) {\n super('Invalid fields set on User Operation.', {\n cause,\n name: 'InvalidFieldsError',\n });\n }\n}\nObject.defineProperty(InvalidFieldsError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32602\n});\nexport class InvalidPaymasterAndDataError extends BaseError {\n constructor({ cause, paymasterAndData, }) {\n super('Paymaster properties provided are invalid.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the `paymasterAndData` property is of an incorrect length\\n',\n paymasterAndData && `paymasterAndData: ${paymasterAndData}`,\n ].filter(Boolean),\n name: 'InvalidPaymasterAndDataError',\n });\n }\n}\nObject.defineProperty(InvalidPaymasterAndDataError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa93/\n});\nexport class PaymasterDepositTooLowError extends BaseError {\n constructor({ cause, }) {\n super('Paymaster deposit for the User Operation is too low.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the Paymaster has deposited less than the expected amount via the `deposit` function',\n ].filter(Boolean),\n name: 'PaymasterDepositTooLowError',\n });\n }\n}\nObject.defineProperty(PaymasterDepositTooLowError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32508\n});\nObject.defineProperty(PaymasterDepositTooLowError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa31/\n});\nexport class PaymasterFunctionRevertedError extends BaseError {\n constructor({ cause, }) {\n super('The `validatePaymasterUserOp` function on the Paymaster reverted.', {\n cause,\n name: 'PaymasterFunctionRevertedError',\n });\n }\n}\nObject.defineProperty(PaymasterFunctionRevertedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa33/\n});\nexport class PaymasterNotDeployedError extends BaseError {\n constructor({ cause, }) {\n super('The Paymaster contract has not been deployed.', {\n cause,\n name: 'PaymasterNotDeployedError',\n });\n }\n}\nObject.defineProperty(PaymasterNotDeployedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa30/\n});\nexport class PaymasterRateLimitError extends BaseError {\n constructor({ cause }) {\n super('UserOperation rejected because paymaster (or signature aggregator) is throttled/banned.', {\n cause,\n name: 'PaymasterRateLimitError',\n });\n }\n}\nObject.defineProperty(PaymasterRateLimitError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32504\n});\nexport class PaymasterStakeTooLowError extends BaseError {\n constructor({ cause }) {\n super('UserOperation rejected because paymaster (or signature aggregator) is throttled/banned.', {\n cause,\n name: 'PaymasterStakeTooLowError',\n });\n }\n}\nObject.defineProperty(PaymasterStakeTooLowError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32505\n});\nexport class PaymasterPostOpFunctionRevertedError extends BaseError {\n constructor({ cause, }) {\n super('Paymaster `postOp` function reverted.', {\n cause,\n name: 'PaymasterPostOpFunctionRevertedError',\n });\n }\n}\nObject.defineProperty(PaymasterPostOpFunctionRevertedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa50/\n});\nexport class SenderAlreadyConstructedError extends BaseError {\n constructor({ cause, factory, factoryData, initCode, }) {\n super('Smart Account has already been deployed.', {\n cause,\n metaMessages: [\n 'Remove the following properties and try again:',\n factory && '`factory`',\n factoryData && '`factoryData`',\n initCode && '`initCode`',\n ].filter(Boolean),\n name: 'SenderAlreadyConstructedError',\n });\n }\n}\nObject.defineProperty(SenderAlreadyConstructedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa10/\n});\nexport class SignatureCheckFailedError extends BaseError {\n constructor({ cause }) {\n super('UserOperation rejected because account signature check failed (or paymaster signature, if the paymaster uses its data as signature).', {\n cause,\n name: 'SignatureCheckFailedError',\n });\n }\n}\nObject.defineProperty(SignatureCheckFailedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32507\n});\nexport class SmartAccountFunctionRevertedError extends BaseError {\n constructor({ cause, }) {\n super('The `validateUserOp` function on the Smart Account reverted.', {\n cause,\n name: 'SmartAccountFunctionRevertedError',\n });\n }\n}\nObject.defineProperty(SmartAccountFunctionRevertedError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa23/\n});\nexport class UnsupportedSignatureAggregatorError extends BaseError {\n constructor({ cause }) {\n super('UserOperation rejected because account specified unsupported signature aggregator.', {\n cause,\n name: 'UnsupportedSignatureAggregatorError',\n });\n }\n}\nObject.defineProperty(UnsupportedSignatureAggregatorError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32506\n});\nexport class UserOperationExpiredError extends BaseError {\n constructor({ cause, }) {\n super('User Operation expired.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the `validAfter` or `validUntil` values returned from `validateUserOp` on the Smart Account are not satisfied',\n ].filter(Boolean),\n name: 'UserOperationExpiredError',\n });\n }\n}\nObject.defineProperty(UserOperationExpiredError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa22/\n});\nexport class UserOperationPaymasterExpiredError extends BaseError {\n constructor({ cause, }) {\n super('Paymaster for User Operation expired.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the `validAfter` or `validUntil` values returned from `validatePaymasterUserOp` on the Paymaster are not satisfied',\n ].filter(Boolean),\n name: 'UserOperationPaymasterExpiredError',\n });\n }\n}\nObject.defineProperty(UserOperationPaymasterExpiredError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa32/\n});\nexport class UserOperationSignatureError extends BaseError {\n constructor({ cause, }) {\n super('Signature provided for the User Operation is invalid.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Smart Account',\n ].filter(Boolean),\n name: 'UserOperationSignatureError',\n });\n }\n}\nObject.defineProperty(UserOperationSignatureError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa24/\n});\nexport class UserOperationPaymasterSignatureError extends BaseError {\n constructor({ cause, }) {\n super('Signature provided for the User Operation is invalid.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Paymaster',\n ].filter(Boolean),\n name: 'UserOperationPaymasterSignatureError',\n });\n }\n}\nObject.defineProperty(UserOperationPaymasterSignatureError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa34/\n});\nexport class UserOperationRejectedByEntryPointError extends BaseError {\n constructor({ cause }) {\n super(\"User Operation rejected by EntryPoint's `simulateValidation` during account creation or validation.\", {\n cause,\n name: 'UserOperationRejectedByEntryPointError',\n });\n }\n}\nObject.defineProperty(UserOperationRejectedByEntryPointError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32500\n});\nexport class UserOperationRejectedByPaymasterError extends BaseError {\n constructor({ cause }) {\n super(\"User Operation rejected by Paymaster's `validatePaymasterUserOp`.\", {\n cause,\n name: 'UserOperationRejectedByPaymasterError',\n });\n }\n}\nObject.defineProperty(UserOperationRejectedByPaymasterError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32501\n});\nexport class UserOperationRejectedByOpCodeError extends BaseError {\n constructor({ cause }) {\n super('User Operation rejected with op code validation error.', {\n cause,\n name: 'UserOperationRejectedByOpCodeError',\n });\n }\n}\nObject.defineProperty(UserOperationRejectedByOpCodeError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32502\n});\nexport class UserOperationOutOfTimeRangeError extends BaseError {\n constructor({ cause }) {\n super('UserOperation out of time-range: either wallet or paymaster returned a time-range, and it is already expired (or will expire soon).', {\n cause,\n name: 'UserOperationOutOfTimeRangeError',\n });\n }\n}\nObject.defineProperty(UserOperationOutOfTimeRangeError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32503\n});\nexport class UnknownBundlerError extends BaseError {\n constructor({ cause }) {\n super(`An error occurred while executing user operation: ${cause?.shortMessage}`, {\n cause,\n name: 'UnknownBundlerError',\n });\n }\n}\nexport class VerificationGasLimitExceededError extends BaseError {\n constructor({ cause, }) {\n super('User Operation verification gas limit exceeded.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the gas used for verification exceeded the `verificationGasLimit`',\n ].filter(Boolean),\n name: 'VerificationGasLimitExceededError',\n });\n }\n}\nObject.defineProperty(VerificationGasLimitExceededError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa40/\n});\nexport class VerificationGasLimitTooLowError extends BaseError {\n constructor({ cause, }) {\n super('User Operation verification gas limit is too low.', {\n cause,\n metaMessages: [\n 'This could arise when:',\n '- the `verificationGasLimit` is too low to verify the User Operation',\n ].filter(Boolean),\n name: 'VerificationGasLimitTooLowError',\n });\n }\n}\nObject.defineProperty(VerificationGasLimitTooLowError, \"message\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /aa41/\n});\n//# sourceMappingURL=bundler.js.map","import { BaseError } from '../../errors/base.js';\nimport { prettyPrint } from '../../errors/transaction.js';\nimport { formatGwei } from '../../utils/index.js';\nexport class UserOperationExecutionError extends BaseError {\n constructor(cause, { callData, callGasLimit, docsPath, factory, factoryData, initCode, maxFeePerGas, maxPriorityFeePerGas, nonce, paymaster, paymasterAndData, paymasterData, paymasterPostOpGasLimit, paymasterVerificationGasLimit, preVerificationGas, sender, signature, verificationGasLimit, }) {\n const prettyArgs = prettyPrint({\n callData,\n callGasLimit,\n factory,\n factoryData,\n initCode,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n paymaster,\n paymasterAndData,\n paymasterData,\n paymasterPostOpGasLimit,\n paymasterVerificationGasLimit,\n preVerificationGas,\n sender,\n signature,\n verificationGasLimit,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Request Arguments:',\n prettyArgs,\n ].filter(Boolean),\n name: 'UserOperationExecutionError',\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.cause = cause;\n }\n}\nexport class UserOperationReceiptNotFoundError extends BaseError {\n constructor({ hash }) {\n super(`User Operation receipt with hash \"${hash}\" could not be found. The User Operation may not have been processed yet.`, { name: 'UserOperationReceiptNotFoundError' });\n }\n}\nexport class UserOperationNotFoundError extends BaseError {\n constructor({ hash }) {\n super(`User Operation with hash \"${hash}\" could not be found.`, {\n name: 'UserOperationNotFoundError',\n });\n }\n}\nexport class WaitForUserOperationReceiptTimeoutError extends BaseError {\n constructor({ hash }) {\n super(`Timed out while waiting for User Operation with hash \"${hash}\" to be confirmed.`, { name: 'WaitForUserOperationReceiptTimeoutError' });\n }\n}\n//# sourceMappingURL=userOperation.js.map","import { AccountNotDeployedError, ExecutionRevertedError, FailedToSendToBeneficiaryError, GasValuesOverflowError, HandleOpsOutOfGasError, InitCodeFailedError, InitCodeMustCreateSenderError, InitCodeMustReturnSenderError, InsufficientPrefundError, InternalCallOnlyError, InvalidAccountNonceError, InvalidAggregatorError, InvalidBeneficiaryError, InvalidFieldsError, InvalidPaymasterAndDataError, PaymasterDepositTooLowError, PaymasterFunctionRevertedError, PaymasterNotDeployedError, PaymasterPostOpFunctionRevertedError, PaymasterRateLimitError, PaymasterStakeTooLowError, SenderAlreadyConstructedError, SignatureCheckFailedError, SmartAccountFunctionRevertedError, UnknownBundlerError, UnsupportedSignatureAggregatorError, UserOperationExpiredError, UserOperationOutOfTimeRangeError, UserOperationPaymasterExpiredError, UserOperationPaymasterSignatureError, UserOperationRejectedByEntryPointError, UserOperationRejectedByOpCodeError, UserOperationRejectedByPaymasterError, UserOperationSignatureError, VerificationGasLimitExceededError, VerificationGasLimitTooLowError, } from '../../errors/bundler.js';\nconst bundlerErrors = [\n ExecutionRevertedError,\n InvalidFieldsError,\n PaymasterDepositTooLowError,\n PaymasterRateLimitError,\n PaymasterStakeTooLowError,\n SignatureCheckFailedError,\n UnsupportedSignatureAggregatorError,\n UserOperationOutOfTimeRangeError,\n UserOperationRejectedByEntryPointError,\n UserOperationRejectedByPaymasterError,\n UserOperationRejectedByOpCodeError,\n];\nexport function getBundlerError(err, args) {\n const message = (err.details || '').toLowerCase();\n if (AccountNotDeployedError.message.test(message))\n return new AccountNotDeployedError({\n cause: err,\n });\n if (FailedToSendToBeneficiaryError.message.test(message))\n return new FailedToSendToBeneficiaryError({\n cause: err,\n });\n if (GasValuesOverflowError.message.test(message))\n return new GasValuesOverflowError({\n cause: err,\n });\n if (HandleOpsOutOfGasError.message.test(message))\n return new HandleOpsOutOfGasError({\n cause: err,\n });\n if (InitCodeFailedError.message.test(message))\n return new InitCodeFailedError({\n cause: err,\n factory: args.factory,\n factoryData: args.factoryData,\n initCode: args.initCode,\n });\n if (InitCodeMustCreateSenderError.message.test(message))\n return new InitCodeMustCreateSenderError({\n cause: err,\n factory: args.factory,\n factoryData: args.factoryData,\n initCode: args.initCode,\n });\n if (InitCodeMustReturnSenderError.message.test(message))\n return new InitCodeMustReturnSenderError({\n cause: err,\n factory: args.factory,\n factoryData: args.factoryData,\n initCode: args.initCode,\n sender: args.sender,\n });\n if (InsufficientPrefundError.message.test(message))\n return new InsufficientPrefundError({\n cause: err,\n });\n if (InternalCallOnlyError.message.test(message))\n return new InternalCallOnlyError({\n cause: err,\n });\n if (InvalidAccountNonceError.message.test(message))\n return new InvalidAccountNonceError({\n cause: err,\n nonce: args.nonce,\n });\n if (InvalidAggregatorError.message.test(message))\n return new InvalidAggregatorError({\n cause: err,\n });\n if (InvalidBeneficiaryError.message.test(message))\n return new InvalidBeneficiaryError({\n cause: err,\n });\n if (InvalidPaymasterAndDataError.message.test(message))\n return new InvalidPaymasterAndDataError({\n cause: err,\n });\n if (PaymasterDepositTooLowError.message.test(message))\n return new PaymasterDepositTooLowError({\n cause: err,\n });\n if (PaymasterFunctionRevertedError.message.test(message))\n return new PaymasterFunctionRevertedError({\n cause: err,\n });\n if (PaymasterNotDeployedError.message.test(message))\n return new PaymasterNotDeployedError({\n cause: err,\n });\n if (PaymasterPostOpFunctionRevertedError.message.test(message))\n return new PaymasterPostOpFunctionRevertedError({\n cause: err,\n });\n if (SmartAccountFunctionRevertedError.message.test(message))\n return new SmartAccountFunctionRevertedError({\n cause: err,\n });\n if (SenderAlreadyConstructedError.message.test(message))\n return new SenderAlreadyConstructedError({\n cause: err,\n factory: args.factory,\n factoryData: args.factoryData,\n initCode: args.initCode,\n });\n if (UserOperationExpiredError.message.test(message))\n return new UserOperationExpiredError({\n cause: err,\n });\n if (UserOperationPaymasterExpiredError.message.test(message))\n return new UserOperationPaymasterExpiredError({\n cause: err,\n });\n if (UserOperationPaymasterSignatureError.message.test(message))\n return new UserOperationPaymasterSignatureError({\n cause: err,\n });\n if (UserOperationSignatureError.message.test(message))\n return new UserOperationSignatureError({\n cause: err,\n });\n if (VerificationGasLimitExceededError.message.test(message))\n return new VerificationGasLimitExceededError({\n cause: err,\n });\n if (VerificationGasLimitTooLowError.message.test(message))\n return new VerificationGasLimitTooLowError({\n cause: err,\n });\n const error = err.walk((e) => bundlerErrors.some((error) => error.code === e.code));\n if (error) {\n if (error.code === ExecutionRevertedError.code)\n return new ExecutionRevertedError({\n cause: err,\n data: error.data,\n message: error.details,\n });\n if (error.code === InvalidFieldsError.code)\n return new InvalidFieldsError({\n cause: err,\n });\n if (error.code === PaymasterDepositTooLowError.code)\n return new PaymasterDepositTooLowError({\n cause: err,\n });\n if (error.code === PaymasterRateLimitError.code)\n return new PaymasterRateLimitError({\n cause: err,\n });\n if (error.code === PaymasterStakeTooLowError.code)\n return new PaymasterStakeTooLowError({\n cause: err,\n });\n if (error.code === SignatureCheckFailedError.code)\n return new SignatureCheckFailedError({\n cause: err,\n });\n if (error.code === UnsupportedSignatureAggregatorError.code)\n return new UnsupportedSignatureAggregatorError({\n cause: err,\n });\n if (error.code === UserOperationOutOfTimeRangeError.code)\n return new UserOperationOutOfTimeRangeError({\n cause: err,\n });\n if (error.code === UserOperationRejectedByEntryPointError.code)\n return new UserOperationRejectedByEntryPointError({\n cause: err,\n });\n if (error.code === UserOperationRejectedByPaymasterError.code)\n return new UserOperationRejectedByPaymasterError({\n cause: err,\n });\n if (error.code === UserOperationRejectedByOpCodeError.code)\n return new UserOperationRejectedByOpCodeError({\n cause: err,\n });\n }\n return new UnknownBundlerError({\n cause: err,\n });\n}\n//# sourceMappingURL=getBundlerError.js.map","import { BaseError } from '../../../errors/base.js';\nimport { ContractFunctionExecutionError, ContractFunctionRevertedError, ContractFunctionZeroDataError, } from '../../../errors/contract.js';\nimport { decodeErrorResult } from '../../../utils/abi/decodeErrorResult.js';\nimport { ExecutionRevertedError } from '../../errors/bundler.js';\nimport { UserOperationExecutionError, } from '../../errors/userOperation.js';\nimport { getBundlerError, } from './getBundlerError.js';\nexport function getUserOperationError(err, { calls, docsPath, ...args }) {\n const cause = (() => {\n const cause = getBundlerError(err, args);\n if (calls && cause instanceof ExecutionRevertedError) {\n const revertData = getRevertData(cause);\n const contractCalls = calls?.filter((call) => call.abi);\n if (revertData && contractCalls.length > 0)\n return getContractError({ calls: contractCalls, revertData });\n }\n return cause;\n })();\n return new UserOperationExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n/////////////////////////////////////////////////////////////////////////////////\nfunction getRevertData(error) {\n let revertData;\n error.walk((e) => {\n const error = e;\n if (typeof error.data === 'string' ||\n typeof error.data?.revertData === 'string' ||\n (!(error instanceof BaseError) && typeof error.message === 'string')) {\n const match = (error.data?.revertData ||\n error.data ||\n error.message).match?.(/(0x[A-Za-z0-9]*)/);\n if (match) {\n revertData = match[1];\n return true;\n }\n }\n return false;\n });\n return revertData;\n}\nfunction getContractError(parameters) {\n const { calls, revertData } = parameters;\n const { abi, functionName, args, to } = (() => {\n const contractCalls = calls?.filter((call) => Boolean(call.abi));\n if (contractCalls.length === 1)\n return contractCalls[0];\n const compatContractCalls = contractCalls.filter((call) => {\n try {\n return Boolean(decodeErrorResult({\n abi: call.abi,\n data: revertData,\n }));\n }\n catch {\n return false;\n }\n });\n if (compatContractCalls.length === 1)\n return compatContractCalls[0];\n return {\n abi: [],\n functionName: contractCalls.reduce((acc, call) => `${acc ? `${acc} | ` : ''}${call.functionName}`, ''),\n args: undefined,\n to: undefined,\n };\n })();\n const cause = (() => {\n if (revertData === '0x')\n return new ContractFunctionZeroDataError({ functionName });\n return new ContractFunctionRevertedError({\n abi,\n data: revertData,\n functionName,\n });\n })();\n return new ContractFunctionExecutionError(cause, {\n abi,\n args,\n contractAddress: to,\n functionName,\n });\n}\n//# sourceMappingURL=getUserOperationError.js.map","import { numberToHex } from '../../../utils/encoding/toHex.js';\nimport { pad } from '../../../utils/index.js';\nexport function formatUserOperationRequest(request) {\n const rpcRequest = {};\n if (typeof request.callData !== 'undefined')\n rpcRequest.callData = request.callData;\n if (typeof request.callGasLimit !== 'undefined')\n rpcRequest.callGasLimit = numberToHex(request.callGasLimit);\n if (typeof request.factory !== 'undefined')\n rpcRequest.factory = request.factory;\n if (typeof request.factoryData !== 'undefined')\n rpcRequest.factoryData = request.factoryData;\n if (typeof request.initCode !== 'undefined')\n rpcRequest.initCode = request.initCode;\n if (typeof request.maxFeePerGas !== 'undefined')\n rpcRequest.maxFeePerGas = numberToHex(request.maxFeePerGas);\n if (typeof request.maxPriorityFeePerGas !== 'undefined')\n rpcRequest.maxPriorityFeePerGas = numberToHex(request.maxPriorityFeePerGas);\n if (typeof request.nonce !== 'undefined')\n rpcRequest.nonce = numberToHex(request.nonce);\n if (typeof request.paymaster !== 'undefined')\n rpcRequest.paymaster = request.paymaster;\n if (typeof request.paymasterAndData !== 'undefined')\n rpcRequest.paymasterAndData = request.paymasterAndData || '0x';\n if (typeof request.paymasterData !== 'undefined')\n rpcRequest.paymasterData = request.paymasterData;\n if (typeof request.paymasterPostOpGasLimit !== 'undefined')\n rpcRequest.paymasterPostOpGasLimit = numberToHex(request.paymasterPostOpGasLimit);\n if (typeof request.paymasterVerificationGasLimit !== 'undefined')\n rpcRequest.paymasterVerificationGasLimit = numberToHex(request.paymasterVerificationGasLimit);\n if (typeof request.preVerificationGas !== 'undefined')\n rpcRequest.preVerificationGas = numberToHex(request.preVerificationGas);\n if (typeof request.sender !== 'undefined')\n rpcRequest.sender = request.sender;\n if (typeof request.signature !== 'undefined')\n rpcRequest.signature = request.signature;\n if (typeof request.verificationGasLimit !== 'undefined')\n rpcRequest.verificationGasLimit = numberToHex(request.verificationGasLimit);\n if (typeof request.authorization !== 'undefined')\n rpcRequest.eip7702Auth = formatAuthorization(request.authorization);\n return rpcRequest;\n}\nfunction formatAuthorization(authorization) {\n return {\n address: authorization.address,\n chainId: numberToHex(authorization.chainId),\n nonce: numberToHex(authorization.nonce),\n r: authorization.r\n ? numberToHex(BigInt(authorization.r), { size: 32 })\n : pad('0x', { size: 32 }),\n s: authorization.s\n ? numberToHex(BigInt(authorization.s), { size: 32 })\n : pad('0x', { size: 32 }),\n yParity: authorization.yParity\n ? numberToHex(authorization.yParity, { size: 1 })\n : pad('0x', { size: 32 }),\n };\n}\n//# sourceMappingURL=userOperationRequest.js.map","import { hexToBigInt } from '../../../utils/encoding/fromHex.js';\nimport { numberToHex } from '../../../utils/encoding/toHex.js';\nimport { formatUserOperationRequest, } from '../../utils/formatters/userOperationRequest.js';\n/**\n * Retrieves paymaster-related User Operation properties to be used for sending the User Operation.\n *\n * - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterData\n *\n * @param client - Client to use\n * @param parameters - {@link GetPaymasterDataParameters}\n * @returns Paymaster-related User Operation properties. {@link GetPaymasterDataReturnType}\n *\n * @example\n * import { http } from 'viem'\n * import { createPaymasterClient, getPaymasterData } from 'viem/account-abstraction'\n *\n * const paymasterClient = createPaymasterClient({\n * transport: http('https://...'),\n * })\n *\n * const userOperation = { ... }\n *\n * const values = await getPaymasterData(paymasterClient, {\n * chainId: 1,\n * entryPointAddress: '0x...',\n * ...userOperation,\n * })\n */\nexport async function getPaymasterData(client, parameters) {\n const { chainId, entryPointAddress, context, ...userOperation } = parameters;\n const request = formatUserOperationRequest(userOperation);\n const { paymasterPostOpGasLimit, paymasterVerificationGasLimit, ...rest } = await client.request({\n method: 'pm_getPaymasterData',\n params: [\n {\n ...request,\n callGasLimit: request.callGasLimit ?? '0x0',\n verificationGasLimit: request.verificationGasLimit ?? '0x0',\n preVerificationGas: request.preVerificationGas ?? '0x0',\n },\n entryPointAddress,\n numberToHex(chainId),\n context,\n ],\n });\n return {\n ...rest,\n ...(paymasterPostOpGasLimit && {\n paymasterPostOpGasLimit: hexToBigInt(paymasterPostOpGasLimit),\n }),\n ...(paymasterVerificationGasLimit && {\n paymasterVerificationGasLimit: hexToBigInt(paymasterVerificationGasLimit),\n }),\n };\n}\n//# sourceMappingURL=getPaymasterData.js.map","import { hexToBigInt } from '../../../utils/encoding/fromHex.js';\nimport { numberToHex } from '../../../utils/encoding/toHex.js';\nimport { formatUserOperationRequest, } from '../../utils/formatters/userOperationRequest.js';\n/**\n * Retrieves paymaster-related User Operation properties to be used for gas estimation.\n *\n * - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterStubData\n *\n * @param client - Client to use\n * @param parameters - {@link GetPaymasterStubDataParameters}\n * @returns Paymaster-related User Operation properties. {@link GetPaymasterStubDataReturnType}\n *\n * @example\n * import { http } from 'viem'\n * import { createPaymasterClient, getPaymasterStubData } from 'viem/account-abstraction'\n *\n * const paymasterClient = createPaymasterClient({\n * transport: http('https://...'),\n * })\n *\n * const userOperation = { ... }\n *\n * const values = await getPaymasterStubData(paymasterClient, {\n * chainId: 1,\n * entryPointAddress: '0x...',\n * ...userOperation,\n * })\n */\nexport async function getPaymasterStubData(client, parameters) {\n const { chainId, entryPointAddress, context, ...userOperation } = parameters;\n const request = formatUserOperationRequest(userOperation);\n const { paymasterPostOpGasLimit, paymasterVerificationGasLimit, ...rest } = await client.request({\n method: 'pm_getPaymasterStubData',\n params: [\n {\n ...request,\n callGasLimit: request.callGasLimit ?? '0x0',\n verificationGasLimit: request.verificationGasLimit ?? '0x0',\n preVerificationGas: request.preVerificationGas ?? '0x0',\n },\n entryPointAddress,\n numberToHex(chainId),\n context,\n ],\n });\n return {\n ...rest,\n ...(paymasterPostOpGasLimit && {\n paymasterPostOpGasLimit: hexToBigInt(paymasterPostOpGasLimit),\n }),\n ...(paymasterVerificationGasLimit && {\n paymasterVerificationGasLimit: hexToBigInt(paymasterVerificationGasLimit),\n }),\n };\n}\n//# sourceMappingURL=getPaymasterStubData.js.map","import { parseAccount, } from '../../../accounts/utils/parseAccount.js';\nimport { prepareAuthorization } from '../../../actions/index.js';\nimport { estimateFeesPerGas, } from '../../../actions/public/estimateFeesPerGas.js';\nimport { getChainId as getChainId_ } from '../../../actions/public/getChainId.js';\nimport { AccountNotFoundError } from '../../../errors/account.js';\nimport { encodeFunctionData, } from '../../../utils/abi/encodeFunctionData.js';\nimport { concat } from '../../../utils/data/concat.js';\nimport { getAction } from '../../../utils/getAction.js';\nimport { getPaymasterData as getPaymasterData_, } from '../paymaster/getPaymasterData.js';\nimport { getPaymasterStubData as getPaymasterStubData_, } from '../paymaster/getPaymasterStubData.js';\nimport { estimateUserOperationGas, } from './estimateUserOperationGas.js';\nconst defaultParameters = [\n 'factory',\n 'fees',\n 'gas',\n 'paymaster',\n 'nonce',\n 'signature',\n 'authorization',\n];\n/**\n * Prepares a User Operation and fills in missing properties.\n *\n * - Docs: https://viem.sh/actions/bundler/prepareUserOperation\n *\n * @param args - {@link PrepareUserOperationParameters}\n * @returns The User Operation. {@link PrepareUserOperationReturnType}\n *\n * @example\n * import { createBundlerClient, http } from 'viem'\n * import { toSmartAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { prepareUserOperation } from 'viem/actions'\n *\n * const account = await toSmartAccount({ ... })\n *\n * const client = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const request = await prepareUserOperation(client, {\n * account,\n * calls: [{ to: '0x...', value: parseEther('1') }],\n * })\n */\nexport async function prepareUserOperation(client, parameters_) {\n const parameters = parameters_;\n const { account: account_ = client.account, parameters: properties = defaultParameters, stateOverride, } = parameters;\n ////////////////////////////////////////////////////////////////////////////////\n // Assert that an Account is defined.\n ////////////////////////////////////////////////////////////////////////////////\n if (!account_)\n throw new AccountNotFoundError();\n const account = parseAccount(account_);\n ////////////////////////////////////////////////////////////////////////////////\n // Declare typed Bundler Client.\n ////////////////////////////////////////////////////////////////////////////////\n const bundlerClient = client;\n ////////////////////////////////////////////////////////////////////////////////\n // Declare Paymaster properties.\n ////////////////////////////////////////////////////////////////////////////////\n const paymaster = parameters.paymaster ?? bundlerClient?.paymaster;\n const paymasterAddress = typeof paymaster === 'string' ? paymaster : undefined;\n const { getPaymasterStubData, getPaymasterData } = (() => {\n // If `paymaster: true`, we will assume the Bundler Client supports Paymaster Actions.\n if (paymaster === true)\n return {\n getPaymasterStubData: (parameters) => getAction(bundlerClient, getPaymasterStubData_, 'getPaymasterStubData')(parameters),\n getPaymasterData: (parameters) => getAction(bundlerClient, getPaymasterData_, 'getPaymasterData')(parameters),\n };\n // If Actions are passed to `paymaster` (via Paymaster Client or directly), we will use them.\n if (typeof paymaster === 'object') {\n const { getPaymasterStubData, getPaymasterData } = paymaster;\n return {\n getPaymasterStubData: (getPaymasterData && getPaymasterStubData\n ? getPaymasterStubData\n : getPaymasterData),\n getPaymasterData: getPaymasterData && getPaymasterStubData\n ? getPaymasterData\n : undefined,\n };\n }\n // No Paymaster functions.\n return {\n getPaymasterStubData: undefined,\n getPaymasterData: undefined,\n };\n })();\n const paymasterContext = parameters.paymasterContext\n ? parameters.paymasterContext\n : bundlerClient?.paymasterContext;\n ////////////////////////////////////////////////////////////////////////////////\n // Set up the User Operation request.\n ////////////////////////////////////////////////////////////////////////////////\n let request = {\n ...parameters,\n paymaster: paymasterAddress,\n sender: account.address,\n };\n ////////////////////////////////////////////////////////////////////////////////\n // Concurrently prepare properties required to fill the User Operation.\n ////////////////////////////////////////////////////////////////////////////////\n const [callData, factory, fees, nonce, authorization] = await Promise.all([\n (async () => {\n if (parameters.calls)\n return account.encodeCalls(parameters.calls.map((call_) => {\n const call = call_;\n if (call.abi)\n return {\n data: encodeFunctionData(call),\n to: call.to,\n value: call.value,\n };\n return call;\n }));\n return parameters.callData;\n })(),\n (async () => {\n if (!properties.includes('factory'))\n return undefined;\n if (parameters.initCode)\n return { initCode: parameters.initCode };\n if (parameters.factory && parameters.factoryData) {\n return {\n factory: parameters.factory,\n factoryData: parameters.factoryData,\n };\n }\n const { factory, factoryData } = await account.getFactoryArgs();\n if (account.entryPoint.version === '0.6')\n return {\n initCode: factory && factoryData ? concat([factory, factoryData]) : undefined,\n };\n return {\n factory,\n factoryData,\n };\n })(),\n (async () => {\n if (!properties.includes('fees'))\n return undefined;\n // If we have sufficient properties for fees, return them.\n if (typeof parameters.maxFeePerGas === 'bigint' &&\n typeof parameters.maxPriorityFeePerGas === 'bigint')\n return request;\n // If the Bundler Client has a `estimateFeesPerGas` hook, run it.\n if (bundlerClient?.userOperation?.estimateFeesPerGas) {\n const fees = await bundlerClient.userOperation.estimateFeesPerGas({\n account,\n bundlerClient,\n userOperation: request,\n });\n return {\n ...request,\n ...fees,\n };\n }\n // Otherwise, we will need to estimate the fees to fill the fee properties.\n try {\n const client_ = bundlerClient.client ?? client;\n const fees = await getAction(client_, estimateFeesPerGas, 'estimateFeesPerGas')({\n chain: client_.chain,\n type: 'eip1559',\n });\n return {\n maxFeePerGas: typeof parameters.maxFeePerGas === 'bigint'\n ? parameters.maxFeePerGas\n : BigInt(\n // Bundlers unfortunately have strict rules on fee prechecks – we will need to set a generous buffer.\n 2n * fees.maxFeePerGas),\n maxPriorityFeePerGas: typeof parameters.maxPriorityFeePerGas === 'bigint'\n ? parameters.maxPriorityFeePerGas\n : BigInt(\n // Bundlers unfortunately have strict rules on fee prechecks – we will need to set a generous buffer.\n 2n * fees.maxPriorityFeePerGas),\n };\n }\n catch {\n return undefined;\n }\n })(),\n (async () => {\n if (!properties.includes('nonce'))\n return undefined;\n if (typeof parameters.nonce === 'bigint')\n return parameters.nonce;\n return account.getNonce();\n })(),\n (async () => {\n if (!properties.includes('authorization'))\n return undefined;\n if (typeof parameters.authorization === 'object')\n return parameters.authorization;\n if (account.authorization && !(await account.isDeployed())) {\n const authorization = await prepareAuthorization(account.client, account.authorization);\n return {\n ...authorization,\n r: '0xfffffffffffffffffffffffffffffff000000000000000000000000000000000',\n s: '0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n yParity: 1,\n };\n }\n return undefined;\n })(),\n ]);\n ////////////////////////////////////////////////////////////////////////////////\n // Fill User Operation with the prepared properties from above.\n ////////////////////////////////////////////////////////////////////////////////\n if (typeof callData !== 'undefined')\n request.callData = callData;\n if (typeof factory !== 'undefined')\n request = { ...request, ...factory };\n if (typeof fees !== 'undefined')\n request = { ...request, ...fees };\n if (typeof nonce !== 'undefined')\n request.nonce = nonce;\n if (typeof authorization !== 'undefined')\n request.authorization = authorization;\n ////////////////////////////////////////////////////////////////////////////////\n // Fill User Operation with the `signature` property.\n ////////////////////////////////////////////////////////////////////////////////\n if (properties.includes('signature')) {\n if (typeof parameters.signature !== 'undefined')\n request.signature = parameters.signature;\n else\n request.signature = await account.getStubSignature(request);\n }\n ////////////////////////////////////////////////////////////////////////////////\n // `initCode` is required to be filled with EntryPoint 0.6.\n ////////////////////////////////////////////////////////////////////////////////\n // If no `initCode` is provided, we use an empty bytes string.\n if (account.entryPoint.version === '0.6' && !request.initCode)\n request.initCode = '0x';\n ////////////////////////////////////////////////////////////////////////////////\n // Fill User Operation with paymaster-related properties for **gas estimation**.\n ////////////////////////////////////////////////////////////////////////////////\n let chainId;\n async function getChainId() {\n if (chainId)\n return chainId;\n if (client.chain)\n return client.chain.id;\n const chainId_ = await getAction(client, getChainId_, 'getChainId')({});\n chainId = chainId_;\n return chainId;\n }\n // If the User Operation is intended to be sponsored, we will need to fill the paymaster-related\n // User Operation properties required to estimate the User Operation gas.\n let isPaymasterPopulated = false;\n if (properties.includes('paymaster') &&\n getPaymasterStubData &&\n !paymasterAddress &&\n !parameters.paymasterAndData) {\n const { isFinal = false, sponsor: _, ...paymasterArgs } = await getPaymasterStubData({\n chainId: await getChainId(),\n entryPointAddress: account.entryPoint.address,\n context: paymasterContext,\n ...request,\n });\n isPaymasterPopulated = isFinal;\n request = {\n ...request,\n ...paymasterArgs,\n };\n }\n ////////////////////////////////////////////////////////////////////////////////\n // `paymasterAndData` is required to be filled with EntryPoint 0.6.\n ////////////////////////////////////////////////////////////////////////////////\n // If no `paymasterAndData` is provided, we use an empty bytes string.\n if (account.entryPoint.version === '0.6' && !request.paymasterAndData)\n request.paymasterAndData = '0x';\n ////////////////////////////////////////////////////////////////////////////////\n // Fill User Operation with gas-related properties.\n ////////////////////////////////////////////////////////////////////////////////\n if (properties.includes('gas')) {\n // If the Account has opinionated gas estimation logic, run the `estimateGas` hook and\n // fill the request with the prepared gas properties.\n if (account.userOperation?.estimateGas) {\n const gas = await account.userOperation.estimateGas(request);\n request = {\n ...request,\n ...gas,\n };\n }\n // If not all the gas properties are already populated, we will need to estimate the gas\n // to fill the gas properties.\n if (typeof request.callGasLimit === 'undefined' ||\n typeof request.preVerificationGas === 'undefined' ||\n typeof request.verificationGasLimit === 'undefined' ||\n (request.paymaster &&\n typeof request.paymasterPostOpGasLimit === 'undefined') ||\n (request.paymaster &&\n typeof request.paymasterVerificationGasLimit === 'undefined')) {\n const gas = await getAction(bundlerClient, estimateUserOperationGas, 'estimateUserOperationGas')({\n account,\n // Some Bundlers fail if nullish gas values are provided for gas estimation :') –\n // so we will need to set a default zeroish value.\n callGasLimit: 0n,\n preVerificationGas: 0n,\n verificationGasLimit: 0n,\n stateOverride,\n ...(request.paymaster\n ? {\n paymasterPostOpGasLimit: 0n,\n paymasterVerificationGasLimit: 0n,\n }\n : {}),\n ...request,\n });\n request = {\n ...request,\n callGasLimit: request.callGasLimit ?? gas.callGasLimit,\n preVerificationGas: request.preVerificationGas ?? gas.preVerificationGas,\n verificationGasLimit: request.verificationGasLimit ?? gas.verificationGasLimit,\n paymasterPostOpGasLimit: request.paymasterPostOpGasLimit ?? gas.paymasterPostOpGasLimit,\n paymasterVerificationGasLimit: request.paymasterVerificationGasLimit ??\n gas.paymasterVerificationGasLimit,\n };\n }\n }\n ////////////////////////////////////////////////////////////////////////////////\n // Fill User Operation with paymaster-related properties for **sending** the User Operation.\n ////////////////////////////////////////////////////////////////////////////////\n // If the User Operation is intended to be sponsored, we will need to fill the paymaster-related\n // User Operation properties required to send the User Operation.\n if (properties.includes('paymaster') &&\n getPaymasterData &&\n !paymasterAddress &&\n !parameters.paymasterAndData &&\n !isPaymasterPopulated) {\n // Retrieve paymaster-related User Operation properties to be used for **sending** the User Operation.\n const paymaster = await getPaymasterData({\n chainId: await getChainId(),\n entryPointAddress: account.entryPoint.address,\n context: paymasterContext,\n ...request,\n });\n request = {\n ...request,\n ...paymaster,\n };\n }\n ////////////////////////////////////////////////////////////////////////////////\n // Remove redundant properties that do not conform to the User Operation schema.\n ////////////////////////////////////////////////////////////////////////////////\n delete request.calls;\n delete request.parameters;\n delete request.paymasterContext;\n if (typeof request.paymaster !== 'string')\n delete request.paymaster;\n ////////////////////////////////////////////////////////////////////////////////\n return request;\n}\n//# sourceMappingURL=prepareUserOperation.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError, } from '../../errors/account.js';\nimport { isAddressEqual } from '../../utils/address/isAddressEqual.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { getChainId } from '../public/getChainId.js';\nimport { getTransactionCount } from '../public/getTransactionCount.js';\n/**\n * Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing.\n * This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`).\n *\n * With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object.\n *\n * @param client - Client to use\n * @param parameters - {@link PrepareAuthorizationParameters}\n * @returns The prepared Authorization object. {@link PrepareAuthorizationReturnType}\n *\n * @example\n * import { createClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { prepareAuthorization } from 'viem/experimental'\n *\n * const client = createClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const authorization = await prepareAuthorization(client, {\n * account: privateKeyToAccount('0x..'),\n * contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n *\n * @example\n * // Account Hoisting\n * import { createClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { prepareAuthorization } from 'viem/experimental'\n *\n * const client = createClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const authorization = await prepareAuthorization(client, {\n * contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function prepareAuthorization(client, parameters) {\n const { account: account_ = client.account, chainId, nonce } = parameters;\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/eip7702/prepareAuthorization',\n });\n const account = parseAccount(account_);\n const executor = (() => {\n if (!parameters.executor)\n return undefined;\n if (parameters.executor === 'self')\n return parameters.executor;\n return parseAccount(parameters.executor);\n })();\n const authorization = {\n address: parameters.contractAddress ?? parameters.address,\n chainId,\n nonce,\n };\n if (typeof authorization.chainId === 'undefined')\n authorization.chainId =\n client.chain?.id ??\n (await getAction(client, getChainId, 'getChainId')({}));\n if (typeof authorization.nonce === 'undefined') {\n authorization.nonce = await getAction(client, getTransactionCount, 'getTransactionCount')({\n address: account.address,\n blockTag: 'pending',\n });\n if (executor === 'self' ||\n (executor?.address && isAddressEqual(executor.address, account.address)))\n authorization.nonce += 1;\n }\n return authorization;\n}\n//# sourceMappingURL=prepareAuthorization.js.map","import { parseAccount, } from '../../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../../errors/account.js';\nimport { getAction } from '../../../utils/getAction.js';\nimport { serializeStateOverride } from '../../../utils/stateOverride.js';\nimport { getUserOperationError } from '../../utils/errors/getUserOperationError.js';\nimport { formatUserOperationGas, } from '../../utils/formatters/userOperationGas.js';\nimport { formatUserOperationRequest, } from '../../utils/formatters/userOperationRequest.js';\nimport { prepareUserOperation, } from './prepareUserOperation.js';\n/**\n * Returns an estimate of gas values necessary to execute the User Operation.\n *\n * - Docs: https://viem.sh/actions/bundler/estimateUserOperationGas\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateUserOperationGasParameters}\n * @returns The gas estimate (in wei). {@link EstimateUserOperationGasReturnType}\n *\n * @example\n * import { createBundlerClient, http, parseEther } from 'viem'\n * import { toSmartAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { estimateUserOperationGas } from 'viem/actions'\n *\n * const account = await toSmartAccount({ ... })\n *\n * const bundlerClient = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const values = await estimateUserOperationGas(bundlerClient, {\n * account,\n * calls: [{ to: '0x...', value: parseEther('1') }],\n * })\n */\nexport async function estimateUserOperationGas(client, parameters) {\n const { account: account_ = client.account, entryPointAddress, stateOverride, } = parameters;\n if (!account_ && !parameters.sender)\n throw new AccountNotFoundError();\n const account = account_ ? parseAccount(account_) : undefined;\n const rpcStateOverride = serializeStateOverride(stateOverride);\n const request = account\n ? await getAction(client, prepareUserOperation, 'prepareUserOperation')({\n ...parameters,\n parameters: [\n 'authorization',\n 'factory',\n 'nonce',\n 'paymaster',\n 'signature',\n ],\n })\n : parameters;\n try {\n const params = [\n formatUserOperationRequest(request),\n (entryPointAddress ?? account?.entryPoint?.address),\n ];\n const result = await client.request({\n method: 'eth_estimateUserOperationGas',\n params: rpcStateOverride ? [...params, rpcStateOverride] : [...params],\n });\n return formatUserOperationGas(result);\n }\n catch (error) {\n const calls = parameters.calls;\n throw getUserOperationError(error, {\n ...request,\n ...(calls ? { calls } : {}),\n });\n }\n}\n//# sourceMappingURL=estimateUserOperationGas.js.map","export function formatUserOperationGas(parameters) {\n const gas = {};\n if (parameters.callGasLimit)\n gas.callGasLimit = BigInt(parameters.callGasLimit);\n if (parameters.preVerificationGas)\n gas.preVerificationGas = BigInt(parameters.preVerificationGas);\n if (parameters.verificationGasLimit)\n gas.verificationGasLimit = BigInt(parameters.verificationGasLimit);\n if (parameters.paymasterPostOpGasLimit)\n gas.paymasterPostOpGasLimit = BigInt(parameters.paymasterPostOpGasLimit);\n if (parameters.paymasterVerificationGasLimit)\n gas.paymasterVerificationGasLimit = BigInt(parameters.paymasterVerificationGasLimit);\n return gas;\n}\n//# sourceMappingURL=userOperationGas.js.map","export function formatUserOperation(parameters) {\n const userOperation = { ...parameters };\n if (parameters.callGasLimit)\n userOperation.callGasLimit = BigInt(parameters.callGasLimit);\n if (parameters.maxFeePerGas)\n userOperation.maxFeePerGas = BigInt(parameters.maxFeePerGas);\n if (parameters.maxPriorityFeePerGas)\n userOperation.maxPriorityFeePerGas = BigInt(parameters.maxPriorityFeePerGas);\n if (parameters.nonce)\n userOperation.nonce = BigInt(parameters.nonce);\n if (parameters.paymasterPostOpGasLimit)\n userOperation.paymasterPostOpGasLimit = BigInt(parameters.paymasterPostOpGasLimit);\n if (parameters.paymasterVerificationGasLimit)\n userOperation.paymasterVerificationGasLimit = BigInt(parameters.paymasterVerificationGasLimit);\n if (parameters.preVerificationGas)\n userOperation.preVerificationGas = BigInt(parameters.preVerificationGas);\n if (parameters.verificationGasLimit)\n userOperation.verificationGasLimit = BigInt(parameters.verificationGasLimit);\n return userOperation;\n}\n//# sourceMappingURL=userOperation.js.map","import { UserOperationReceiptNotFoundError, } from '../../errors/userOperation.js';\nimport { formatUserOperationReceipt } from '../../utils/formatters/userOperationReceipt.js';\n/**\n * Returns the User Operation Receipt given a User Operation hash.\n *\n * - Docs: https://viem.sh/docs/actions/bundler/getUserOperationReceipt\n *\n * @param client - Client to use\n * @param parameters - {@link GetUserOperationReceiptParameters}\n * @returns The receipt. {@link GetUserOperationReceiptReturnType}\n *\n * @example\n * import { createBundlerClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getUserOperationReceipt } from 'viem/actions\n *\n * const client = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const receipt = await getUserOperationReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getUserOperationReceipt(client, { hash }) {\n const receipt = await client.request({\n method: 'eth_getUserOperationReceipt',\n params: [hash],\n }, { dedupe: true });\n if (!receipt)\n throw new UserOperationReceiptNotFoundError({ hash });\n return formatUserOperationReceipt(receipt);\n}\n//# sourceMappingURL=getUserOperationReceipt.js.map","import { formatLog } from '../../../utils/formatters/log.js';\nimport { formatTransactionReceipt } from '../../../utils/formatters/transactionReceipt.js';\nexport function formatUserOperationReceipt(parameters) {\n const receipt = { ...parameters };\n if (parameters.actualGasCost)\n receipt.actualGasCost = BigInt(parameters.actualGasCost);\n if (parameters.actualGasUsed)\n receipt.actualGasUsed = BigInt(parameters.actualGasUsed);\n if (parameters.logs)\n receipt.logs = parameters.logs.map((log) => formatLog(log));\n if (parameters.receipt)\n receipt.receipt = formatTransactionReceipt(receipt.receipt);\n return receipt;\n}\n//# sourceMappingURL=userOperationReceipt.js.map","import { getChainId, } from '../../../actions/public/getChainId.js';\nimport { estimateUserOperationGas, } from '../../actions/bundler/estimateUserOperationGas.js';\nimport { getSupportedEntryPoints, } from '../../actions/bundler/getSupportedEntryPoints.js';\nimport { getUserOperation, } from '../../actions/bundler/getUserOperation.js';\nimport { getUserOperationReceipt, } from '../../actions/bundler/getUserOperationReceipt.js';\nimport { prepareUserOperation, } from '../../actions/bundler/prepareUserOperation.js';\nimport { sendUserOperation, } from '../../actions/bundler/sendUserOperation.js';\nimport { waitForUserOperationReceipt, } from '../../actions/bundler/waitForUserOperationReceipt.js';\nexport function bundlerActions(client) {\n return {\n estimateUserOperationGas: (parameters) => estimateUserOperationGas(client, parameters),\n getChainId: () => getChainId(client),\n getSupportedEntryPoints: () => getSupportedEntryPoints(client),\n getUserOperation: (parameters) => getUserOperation(client, parameters),\n getUserOperationReceipt: (parameters) => getUserOperationReceipt(client, parameters),\n prepareUserOperation: (parameters) => prepareUserOperation(client, parameters),\n sendUserOperation: (parameters) => sendUserOperation(client, parameters),\n waitForUserOperationReceipt: (parameters) => waitForUserOperationReceipt(client, parameters),\n };\n}\n//# sourceMappingURL=bundler.js.map","/**\n * Returns the EntryPoints that the bundler supports.\n *\n * - Docs: https://viem.sh/actions/bundler/getSupportedEntryPoints\n *\n * @param client - Client to use\n * @param parameters - {@link GetSupportedEntryPointsParameters}\n * @returns Supported Entry Points. {@link GetSupportedEntryPointsReturnType}\n *\n * @example\n * import { createBundlerClient, http, parseEther } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getSupportedEntryPoints } from 'viem/actions'\n *\n * const bundlerClient = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const addresses = await getSupportedEntryPoints(bundlerClient)\n */\nexport function getSupportedEntryPoints(client) {\n return client.request({ method: 'eth_supportedEntryPoints' });\n}\n//# sourceMappingURL=getSupportedEntryPoints.js.map","import { UserOperationNotFoundError, } from '../../errors/userOperation.js';\nimport { formatUserOperation } from '../../utils/formatters/userOperation.js';\n/**\n * Retrieves information about a User Operation given a hash.\n *\n * - Docs: https://viem.sh/account-abstraction/actions/bundler/getUserOperation\n *\n * @param client - Client to use\n * @param parameters - {@link GetUserOperationParameters}\n * @returns The receipt. {@link GetUserOperationReturnType}\n *\n * @example\n * import { createBundlerClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getUserOperation } from 'viem/actions\n *\n * const client = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const receipt = await getUserOperation(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getUserOperation(client, { hash }) {\n const result = await client.request({\n method: 'eth_getUserOperationByHash',\n params: [hash],\n }, { dedupe: true });\n if (!result)\n throw new UserOperationNotFoundError({ hash });\n const { blockHash, blockNumber, entryPoint, transactionHash, userOperation } = result;\n return {\n blockHash,\n blockNumber: BigInt(blockNumber),\n entryPoint,\n transactionHash,\n userOperation: formatUserOperation(userOperation),\n };\n}\n//# sourceMappingURL=getUserOperation.js.map","import { parseAccount } from '../../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../../errors/account.js';\nimport { getAction } from '../../../utils/getAction.js';\nimport { getUserOperationError } from '../../utils/errors/getUserOperationError.js';\nimport { formatUserOperationRequest, } from '../../utils/formatters/userOperationRequest.js';\nimport { prepareUserOperation, } from './prepareUserOperation.js';\n/**\n * Broadcasts a User Operation to the Bundler.\n *\n * - Docs: https://viem.sh/actions/bundler/sendUserOperation\n *\n * @param client - Client to use\n * @param parameters - {@link SendUserOperationParameters}\n * @returns The User Operation hash. {@link SendUserOperationReturnType}\n *\n * @example\n * import { createBundlerClient, http, parseEther } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { toSmartAccount } from 'viem/accounts'\n * import { sendUserOperation } from 'viem/actions'\n *\n * const account = await toSmartAccount({ ... })\n *\n * const bundlerClient = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const values = await sendUserOperation(bundlerClient, {\n * account,\n * calls: [{ to: '0x...', value: parseEther('1') }],\n * })\n */\nexport async function sendUserOperation(client, parameters) {\n const { account: account_ = client.account, entryPointAddress } = parameters;\n if (!account_ && !parameters.sender)\n throw new AccountNotFoundError();\n const account = account_ ? parseAccount(account_) : undefined;\n const request = account\n ? await getAction(client, prepareUserOperation, 'prepareUserOperation')(parameters)\n : parameters;\n const signature = (parameters.signature ||\n (await account?.signUserOperation?.(request)));\n const rpcParameters = formatUserOperationRequest({\n ...request,\n signature,\n });\n try {\n return await client.request({\n method: 'eth_sendUserOperation',\n params: [\n rpcParameters,\n (entryPointAddress ?? account?.entryPoint?.address),\n ],\n }, { retryCount: 0 });\n }\n catch (error) {\n const calls = parameters.calls;\n throw getUserOperationError(error, {\n ...request,\n ...(calls ? { calls } : {}),\n signature,\n });\n }\n}\n//# sourceMappingURL=sendUserOperation.js.map","import { getAction } from '../../../utils/getAction.js';\nimport { observe } from '../../../utils/observe.js';\nimport { poll } from '../../../utils/poll.js';\nimport { stringify } from '../../../utils/stringify.js';\nimport { WaitForUserOperationReceiptTimeoutError, } from '../../errors/userOperation.js';\nimport { getUserOperationReceipt, } from './getUserOperationReceipt.js';\n/**\n * Waits for the User Operation to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the User Operation receipt.\n *\n * - Docs: https://viem.sh/docs/actions/bundler/waitForUserOperationReceipt\n *\n * @param client - Client to use\n * @param parameters - {@link WaitForUserOperationReceiptParameters}\n * @returns The receipt. {@link WaitForUserOperationReceiptReturnType}\n *\n * @example\n * import { createBundlerClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { waitForUserOperationReceipt } from 'viem/actions'\n *\n * const client = createBundlerClient({\n * chain: mainnet,\n * transport: http(),\n * })\n *\n * const receipt = await waitForUserOperationReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport function waitForUserOperationReceipt(client, parameters) {\n const { hash, pollingInterval = client.pollingInterval, retryCount, timeout = 120_000, } = parameters;\n let count = 0;\n const observerId = stringify([\n 'waitForUserOperationReceipt',\n client.uid,\n hash,\n ]);\n return new Promise((resolve, reject) => {\n const unobserve = observe(observerId, { resolve, reject }, (emit) => {\n const done = (fn) => {\n unpoll();\n fn();\n unobserve();\n };\n const unpoll = poll(async () => {\n if (retryCount && count >= retryCount)\n done(() => emit.reject(new WaitForUserOperationReceiptTimeoutError({ hash })));\n try {\n const receipt = await getAction(client, getUserOperationReceipt, 'getUserOperationReceipt')({ hash });\n done(() => emit.resolve(receipt));\n }\n catch (err) {\n const error = err;\n if (error.name !== 'UserOperationReceiptNotFoundError')\n done(() => emit.reject(error));\n }\n count++;\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n if (timeout)\n setTimeout(() => done(() => emit.reject(new WaitForUserOperationReceiptTimeoutError({ hash }))), timeout);\n return unpoll;\n });\n });\n}\n//# sourceMappingURL=waitForUserOperationReceipt.js.map","import { InvalidAddressError } from '../errors/address.js';\nimport { isAddress } from '../utils/address/isAddress.js';\nimport { concatHex } from '../utils/data/concat.js';\nimport { toHex } from '../utils/encoding/toHex.js';\nimport { toRlp } from '../utils/encoding/toRlp.js';\nimport { serializeTransaction as serializeTransaction_, } from '../utils/transaction/serializeTransaction.js';\nexport function serializeTransaction(transaction, signature) {\n if (isDeposit(transaction))\n return serializeTransactionDeposit(transaction);\n return serializeTransaction_(transaction, signature);\n}\nexport const serializers = {\n transaction: serializeTransaction,\n};\nfunction serializeTransactionDeposit(transaction) {\n assertTransactionDeposit(transaction);\n const { sourceHash, data, from, gas, isSystemTx, mint, to, value } = transaction;\n const serializedTransaction = [\n sourceHash,\n from,\n to ?? '0x',\n mint ? toHex(mint) : '0x',\n value ? toHex(value) : '0x',\n gas ? toHex(gas) : '0x',\n isSystemTx ? '0x1' : '0x',\n data ?? '0x',\n ];\n return concatHex([\n '0x7e',\n toRlp(serializedTransaction),\n ]);\n}\nfunction isDeposit(transaction) {\n if (transaction.type === 'deposit')\n return true;\n if (typeof transaction.sourceHash !== 'undefined')\n return true;\n return false;\n}\nexport function assertTransactionDeposit(transaction) {\n const { from, to } = transaction;\n if (from && !isAddress(from))\n throw new InvalidAddressError({ address: from });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n}\n//# sourceMappingURL=serializers.js.map","import { contracts } from './contracts.js';\nimport { formatters } from './formatters.js';\nimport { serializers } from './serializers.js';\nexport const chainConfig = {\n blockTime: 2_000,\n contracts,\n formatters,\n serializers,\n};\n//# sourceMappingURL=chainConfig.js.map","/**\n * Predeploy contracts for OP Stack.\n * @see https://github.com/ethereum-optimism/optimism/blob/develop/specs/predeploys.md\n */\nexport const contracts = {\n gasPriceOracle: { address: '0x420000000000000000000000000000000000000F' },\n l1Block: { address: '0x4200000000000000000000000000000000000015' },\n l2CrossDomainMessenger: {\n address: '0x4200000000000000000000000000000000000007',\n },\n l2Erc721Bridge: { address: '0x4200000000000000000000000000000000000014' },\n l2StandardBridge: { address: '0x4200000000000000000000000000000000000010' },\n l2ToL1MessagePasser: {\n address: '0x4200000000000000000000000000000000000016',\n },\n};\n//# sourceMappingURL=contracts.js.map","import { hexToBigInt } from '../utils/encoding/fromHex.js';\nimport { defineBlock } from '../utils/formatters/block.js';\nimport { defineTransaction, formatTransaction, } from '../utils/formatters/transaction.js';\nimport { defineTransactionReceipt } from '../utils/formatters/transactionReceipt.js';\nexport const formatters = {\n block: /*#__PURE__*/ defineBlock({\n format(args) {\n const transactions = args.transactions?.map((transaction) => {\n if (typeof transaction === 'string')\n return transaction;\n const formatted = formatTransaction(transaction);\n if (formatted.typeHex === '0x7e') {\n formatted.isSystemTx = transaction.isSystemTx;\n formatted.mint = transaction.mint\n ? hexToBigInt(transaction.mint)\n : undefined;\n formatted.sourceHash = transaction.sourceHash;\n formatted.type = 'deposit';\n }\n return formatted;\n });\n return {\n transactions,\n stateRoot: args.stateRoot,\n };\n },\n }),\n transaction: /*#__PURE__*/ defineTransaction({\n format(args) {\n const transaction = {};\n if (args.type === '0x7e') {\n transaction.isSystemTx = args.isSystemTx;\n transaction.mint = args.mint ? hexToBigInt(args.mint) : undefined;\n transaction.sourceHash = args.sourceHash;\n transaction.type = 'deposit';\n }\n return transaction;\n },\n }),\n transactionReceipt: /*#__PURE__*/ defineTransactionReceipt({\n format(args) {\n return {\n l1GasPrice: args.l1GasPrice ? hexToBigInt(args.l1GasPrice) : null,\n l1GasUsed: args.l1GasUsed ? hexToBigInt(args.l1GasUsed) : null,\n l1Fee: args.l1Fee ? hexToBigInt(args.l1Fee) : null,\n l1FeeScalar: args.l1FeeScalar ? Number(args.l1FeeScalar) : null,\n };\n },\n }),\n};\n//# sourceMappingURL=formatters.js.map","import { chainConfig } from '../../op-stack/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nconst sourceId = 1; // mainnet\nexport const base = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 8453,\n name: 'Base',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://mainnet.base.org'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Basescan',\n url: 'https://basescan.org',\n apiUrl: 'https://api.basescan.org/api',\n },\n },\n contracts: {\n ...chainConfig.contracts,\n disputeGameFactory: {\n [sourceId]: {\n address: '0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e',\n },\n },\n l2OutputOracle: {\n [sourceId]: {\n address: '0x56315b90c40730925ec5485cf004d835058518A0',\n },\n },\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 5022,\n },\n portal: {\n [sourceId]: {\n address: '0x49048044D57e1C92A77f79988d21Fa8fAF74E97e',\n blockCreated: 17482143,\n },\n },\n l1StandardBridge: {\n [sourceId]: {\n address: '0x3154Cf16ccdb4C6d922629664174b904d80F2C35',\n blockCreated: 17482143,\n },\n },\n },\n sourceId,\n});\nexport const basePreconf = /*#__PURE__*/ defineChain({\n ...base,\n experimental_preconfirmationTime: 200,\n rpcUrls: {\n default: {\n http: ['https://mainnet-preconf.base.org'],\n },\n },\n});\n//# sourceMappingURL=base.js.map","import { chainConfig } from '../../op-stack/chainConfig.js';\nimport { defineChain } from '../../utils/chain/defineChain.js';\nconst sourceId = 11_155_111; // sepolia\nexport const baseSepolia = /*#__PURE__*/ defineChain({\n ...chainConfig,\n id: 84532,\n network: 'base-sepolia',\n name: 'Base Sepolia',\n nativeCurrency: { name: 'Sepolia Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://sepolia.base.org'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Basescan',\n url: 'https://sepolia.basescan.org',\n apiUrl: 'https://api-sepolia.basescan.org/api',\n },\n },\n contracts: {\n ...chainConfig.contracts,\n disputeGameFactory: {\n [sourceId]: {\n address: '0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1',\n },\n },\n l2OutputOracle: {\n [sourceId]: {\n address: '0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254',\n },\n },\n portal: {\n [sourceId]: {\n address: '0x49f53e41452c74589e85ca1677426ba426459e85',\n blockCreated: 4446677,\n },\n },\n l1StandardBridge: {\n [sourceId]: {\n address: '0xfd0Bf71F60660E2f608ed56e1659C450eB113120',\n blockCreated: 4446677,\n },\n },\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 1059647,\n },\n },\n testnet: true,\n sourceId,\n});\nexport const baseSepoliaPreconf = /*#__PURE__*/ defineChain({\n ...baseSepolia,\n experimental_preconfirmationTime: 200,\n rpcUrls: {\n default: {\n http: ['https://sepolia-preconf.base.org'],\n },\n },\n});\n//# sourceMappingURL=baseSepolia.js.map",null,null,"import { createClient, } from './createClient.js';\nimport { publicActions } from './decorators/public.js';\n/**\n * Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).\n *\n * - Docs: https://viem.sh/docs/clients/public\n *\n * A Public Client is an interface to \"public\" [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction).\n *\n * @param config - {@link PublicClientConfig}\n * @returns A Public Client. {@link PublicClient}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n */\nexport function createPublicClient(parameters) {\n const { key = 'public', name = 'Public Client' } = parameters;\n const client = createClient({\n ...parameters,\n key,\n name,\n type: 'publicClient',\n });\n return client.extend(publicActions);\n}\n//# sourceMappingURL=createPublicClient.js.map","import { createClient, } from '../../clients/createClient.js';\nimport { bundlerActions } from './decorators/bundler.js';\nexport function createBundlerClient(parameters) {\n const { client: client_, key = 'bundler', name = 'Bundler Client', paymaster, paymasterContext, transport, userOperation, } = parameters;\n const client = Object.assign(createClient({\n ...parameters,\n chain: parameters.chain ?? client_?.chain,\n key,\n name,\n transport,\n type: 'bundlerClient',\n }), { client: client_, paymaster, paymasterContext, userOperation });\n return client.extend(bundlerActions);\n}\n//# sourceMappingURL=createBundlerClient.js.map",null,null,null,null,"function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n",null,null,"import { p256 } from '@noble/curves/p256';\nimport * as Bytes from './Bytes.js';\nimport * as Hex from './Hex.js';\nimport * as PublicKey from './PublicKey.js';\n/**\n * Generates an ECDSA P256 key pair that includes:\n *\n * - a `privateKey` of type [`CryptoKey`](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey)\n *\n * - a `publicKey` of type {@link ox#Hex.Hex} or {@link ox#Bytes.Bytes}\n *\n * @example\n * ```ts twoslash\n * import { WebCryptoP256 } from 'ox'\n *\n * const { publicKey, privateKey } = await WebCryptoP256.createKeyPair()\n * // @log: {\n * // @log: privateKey: CryptoKey {},\n * // @log: publicKey: {\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * // @log: prefix: 4,\n * // @log: },\n * // @log: }\n * ```\n *\n * @param options - Options for creating the key pair.\n * @returns The key pair.\n */\nexport async function createKeyPair(options = {}) {\n const { extractable = false } = options;\n const keypair = await globalThis.crypto.subtle.generateKey({\n name: 'ECDSA',\n namedCurve: 'P-256',\n }, extractable, ['sign', 'verify']);\n const publicKey_raw = await globalThis.crypto.subtle.exportKey('raw', keypair.publicKey);\n const publicKey = PublicKey.from(new Uint8Array(publicKey_raw));\n return {\n privateKey: keypair.privateKey,\n publicKey,\n };\n}\n/**\n * Generates an ECDH P256 key pair for key agreement that includes:\n *\n * - a `privateKey` of type [`CryptoKey`](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey)\n * - a `publicKey` of type {@link ox#PublicKey.PublicKey}\n *\n * @example\n * ```ts twoslash\n * import { WebCryptoP256 } from 'ox'\n *\n * const { publicKey, privateKey } = await WebCryptoP256.createKeyPairECDH()\n * // @log: {\n * // @log: privateKey: CryptoKey {},\n * // @log: publicKey: {\n * // @log: x: 59295962801117472859457908919941473389380284132224861839820747729565200149877n,\n * // @log: y: 24099691209996290925259367678540227198235484593389470330605641003500238088869n,\n * // @log: prefix: 4,\n * // @log: },\n * // @log: }\n * ```\n *\n * @param options - Options for creating the key pair.\n * @returns The key pair.\n */\nexport async function createKeyPairECDH(options = {}) {\n const { extractable = false } = options;\n const keypair = await globalThis.crypto.subtle.generateKey({\n name: 'ECDH',\n namedCurve: 'P-256',\n }, extractable, ['deriveKey', 'deriveBits']);\n const publicKey_raw = await globalThis.crypto.subtle.exportKey('raw', keypair.publicKey);\n const publicKey = PublicKey.from(new Uint8Array(publicKey_raw));\n return {\n privateKey: keypair.privateKey,\n publicKey,\n };\n}\n/**\n * Computes a shared secret using ECDH (Elliptic Curve Diffie-Hellman) between a private key and a public key using Web Crypto APIs.\n *\n * @example\n * ```ts twoslash\n * import { WebCryptoP256 } from 'ox'\n *\n * const { privateKey: privateKeyA } = await WebCryptoP256.createKeyPairECDH()\n * const { publicKey: publicKeyB } = await WebCryptoP256.createKeyPairECDH()\n *\n * const sharedSecret = await WebCryptoP256.getSharedSecret({\n * privateKey: privateKeyA,\n * publicKey: publicKeyB\n * })\n * ```\n *\n * @param options - The options to compute the shared secret.\n * @returns The computed shared secret.\n */\nexport async function getSharedSecret(options) {\n const { as = 'Hex', privateKey, publicKey } = options;\n if (privateKey.algorithm.name === 'ECDSA') {\n throw new Error('privateKey is not compatible with ECDH. please use `createKeyPairECDH` to create an ECDH key.');\n }\n const publicKeyCrypto = await globalThis.crypto.subtle.importKey('raw', PublicKey.toBytes(publicKey), { name: 'ECDH', namedCurve: 'P-256' }, false, []);\n const sharedSecretBuffer = await globalThis.crypto.subtle.deriveBits({\n name: 'ECDH',\n public: publicKeyCrypto,\n }, privateKey, 256);\n const sharedSecret = new Uint8Array(sharedSecretBuffer);\n if (as === 'Hex')\n return Hex.fromBytes(sharedSecret);\n return sharedSecret;\n}\n/**\n * Signs a payload with the provided `CryptoKey` private key and returns a P256 signature.\n *\n * @example\n * ```ts twoslash\n * import { WebCryptoP256 } from 'ox'\n *\n * const { privateKey } = await WebCryptoP256.createKeyPair()\n *\n * const signature = await WebCryptoP256.sign({ // [!code focus]\n * payload: '0xdeadbeef', // [!code focus]\n * privateKey, // [!code focus]\n * }) // [!code focus]\n * // @log: {\n * // @log: r: 151231...4423n,\n * // @log: s: 516123...5512n,\n * // @log: }\n * ```\n *\n * @param options - Options for signing the payload.\n * @returns The P256 ECDSA {@link ox#Signature.Signature}.\n */\nexport async function sign(options) {\n const { payload, privateKey } = options;\n const signature = await globalThis.crypto.subtle.sign({\n name: 'ECDSA',\n hash: 'SHA-256',\n }, privateKey, Bytes.from(payload));\n const signature_bytes = Bytes.fromArray(new Uint8Array(signature));\n const r = Bytes.toBigInt(Bytes.slice(signature_bytes, 0, 32));\n let s = Bytes.toBigInt(Bytes.slice(signature_bytes, 32, 64));\n if (s > p256.CURVE.n / 2n)\n s = p256.CURVE.n - s;\n return { r, s };\n}\n/**\n * Verifies a payload was signed by the provided public key.\n *\n * @example\n *\n * ```ts twoslash\n * import { WebCryptoP256 } from 'ox'\n *\n * const { privateKey, publicKey } = await WebCryptoP256.createKeyPair()\n * const signature = await WebCryptoP256.sign({ payload: '0xdeadbeef', privateKey })\n *\n * const verified = await WebCryptoP256.verify({ // [!code focus]\n * payload: '0xdeadbeef', // [!code focus]\n * publicKey, // [!code focus]\n * signature, // [!code focus]\n * }) // [!code focus]\n * // @log: true\n * ```\n *\n * @param options - The verification options.\n * @returns Whether the payload was signed by the provided public key.\n */\nexport async function verify(options) {\n const { payload, signature } = options;\n const publicKey = await globalThis.crypto.subtle.importKey('raw', PublicKey.toBytes(options.publicKey), { name: 'ECDSA', namedCurve: 'P-256' }, true, ['verify']);\n return await globalThis.crypto.subtle.verify({\n name: 'ECDSA',\n hash: 'SHA-256',\n }, publicKey, Bytes.concat(Bytes.fromNumber(signature.r), Bytes.fromNumber(signature.s)), Bytes.from(payload));\n}\n//# sourceMappingURL=WebCryptoP256.js.map",null,null,null,null,null,"export const entryPoint06Address = '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789';\nexport const entryPoint07Address = '0x0000000071727De22E5E9d8BAf0edAc6f37da032';\nexport const entryPoint08Address = '0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108';\n//# sourceMappingURL=address.js.map","import { parseAbi } from 'abitype';\nimport { getCode } from '../../actions/public/getCode.js';\nimport { readContract } from '../../actions/public/readContract.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { createNonceManager } from '../../utils/nonceManager.js';\nimport { serializeErc6492Signature } from '../../utils/signature/serializeErc6492Signature.js';\n/**\n * @description Creates a Smart Account with a provided account implementation.\n *\n * @param parameters - {@link ToSmartAccountParameters}\n * @returns A Smart Account. {@link ToSmartAccountReturnType}\n */\nexport async function toSmartAccount(implementation) {\n const { extend, nonceKeyManager = createNonceManager({\n source: {\n get() {\n return Date.now();\n },\n set() { },\n },\n }), ...rest } = implementation;\n let deployed = false;\n const address = await implementation.getAddress();\n return {\n ...extend,\n ...rest,\n address,\n async getFactoryArgs() {\n if ('isDeployed' in this && (await this.isDeployed()))\n return { factory: undefined, factoryData: undefined };\n return implementation.getFactoryArgs();\n },\n async getNonce(parameters) {\n const key = parameters?.key ??\n BigInt(await nonceKeyManager.consume({\n address,\n chainId: implementation.client.chain.id,\n client: implementation.client,\n }));\n if (implementation.getNonce)\n return await implementation.getNonce({ ...parameters, key });\n const nonce = await readContract(implementation.client, {\n abi: parseAbi([\n 'function getNonce(address, uint192) pure returns (uint256)',\n ]),\n address: implementation.entryPoint.address,\n functionName: 'getNonce',\n args: [address, key],\n });\n return nonce;\n },\n async isDeployed() {\n if (deployed)\n return true;\n const code = await getAction(implementation.client, getCode, 'getCode')({\n address,\n });\n deployed = Boolean(code);\n return deployed;\n },\n ...(implementation.sign\n ? {\n async sign(parameters) {\n const [{ factory, factoryData }, signature] = await Promise.all([\n this.getFactoryArgs(),\n implementation.sign(parameters),\n ]);\n if (factory && factoryData)\n return serializeErc6492Signature({\n address: factory,\n data: factoryData,\n signature,\n });\n return signature;\n },\n }\n : {}),\n async signMessage(parameters) {\n const [{ factory, factoryData }, signature] = await Promise.all([\n this.getFactoryArgs(),\n implementation.signMessage(parameters),\n ]);\n if (factory && factoryData && factory !== '0x7702')\n return serializeErc6492Signature({\n address: factory,\n data: factoryData,\n signature,\n });\n return signature;\n },\n async signTypedData(parameters) {\n const [{ factory, factoryData }, signature] = await Promise.all([\n this.getFactoryArgs(),\n implementation.signTypedData(parameters),\n ]);\n if (factory && factoryData && factory !== '0x7702')\n return serializeErc6492Signature({\n address: factory,\n data: factoryData,\n signature,\n });\n return signature;\n },\n type: 'smart',\n };\n}\n//# sourceMappingURL=toSmartAccount.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * @description Parses a hex formatted signature into a structured signature.\n *\n * @param signatureHex Signature in hex format.\n * @returns The structured signature.\n *\n * @example\n * parseSignature('0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c')\n * // { r: '0x...', s: '0x...', v: 28n }\n */\nexport function parseSignature(signatureHex) {\n const { r, s } = secp256k1.Signature.fromCompact(signatureHex.slice(2, 130));\n const yParityOrV = Number(`0x${signatureHex.slice(130)}`);\n const [v, yParity] = (() => {\n if (yParityOrV === 0 || yParityOrV === 1)\n return [undefined, yParityOrV];\n if (yParityOrV === 27)\n return [BigInt(yParityOrV), 0];\n if (yParityOrV === 28)\n return [BigInt(yParityOrV), 1];\n throw new Error('Invalid yParityOrV value');\n })();\n if (typeof v !== 'undefined')\n return {\n r: numberToHex(r, { size: 32 }),\n s: numberToHex(s, { size: 32 }),\n v,\n yParity,\n };\n return {\n r: numberToHex(r, { size: 32 }),\n s: numberToHex(s, { size: 32 }),\n yParity,\n };\n}\n//# sourceMappingURL=parseSignature.js.map",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"import { InvalidDecimalNumberError } from '../../errors/unit.js';\n/**\n * Multiplies a string representation of a number by a given exponent of base 10 (10exponent).\n *\n * - Docs: https://viem.sh/docs/utilities/parseUnits\n *\n * @example\n * import { parseUnits } from 'viem'\n *\n * parseUnits('420', 9)\n * // 420000000000n\n */\nexport function parseUnits(value, decimals) {\n if (!/^(-?)([0-9]*)\\.?([0-9]*)$/.test(value))\n throw new InvalidDecimalNumberError({ value });\n let [integer, fraction = '0'] = value.split('.');\n const negative = integer.startsWith('-');\n if (negative)\n integer = integer.slice(1);\n // trim trailing zeros.\n fraction = fraction.replace(/(0+)$/, '');\n // round off if the fraction is larger than the number of decimals.\n if (decimals === 0) {\n if (Math.round(Number(`.${fraction}`)) === 1)\n integer = `${BigInt(integer) + 1n}`;\n fraction = '';\n }\n else if (fraction.length > decimals) {\n const [left, unit, right] = [\n fraction.slice(0, decimals - 1),\n fraction.slice(decimals - 1, decimals),\n fraction.slice(decimals),\n ];\n const rounded = Math.round(Number(`${unit}.${right}`));\n if (rounded > 9)\n fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, '0');\n else\n fraction = `${left}${rounded}`;\n if (fraction.length > decimals) {\n fraction = fraction.slice(1);\n integer = `${BigInt(integer) + 1n}`;\n }\n fraction = fraction.slice(0, decimals);\n }\n else {\n fraction = fraction.padEnd(decimals, '0');\n }\n return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);\n}\n//# sourceMappingURL=parseUnits.js.map",null,null,null,null],"names":["CB_WALLET_RPC_URL","PACKAGE_NAME","PACKAGE_VERSION","createJSONStorage","getStorage","options","storage","e","persistStorage","getItem","name","_a","parse","str2","JSON","undefined","str","Promise","then","setItem","newValue","stringify","removeItem","toThenable","fn","input","result","onFulfilled","_onRejected","this","_onFulfilled","catch","onRejected","persist","config","baseOptions","set","get","api","localStorage","partialize","state","version","merge","persistedState","currentState","hasHydrated","hydrationListeners","Set","finishHydrationListeners","args","console","warn","savedSetState","setState","replace","configResult","stateFromStorage","getInitialState","hydrate","_b","forEach","cb","_a2","postRehydrationCallback","onRehydrateStorage","call","bind","deserializedStorageValue","migrate","migration","error","migrationResult","migrated","migratedState","setOptions","newOptions","clearStorage","getOptions","rehydrate","onHydrate","add","delete","onFinishHydration","skipHydration","createStoreImpl","createState","listeners","partial","nextState","Object","is","previousState","assign","listener","getState","initialState","subscribe","createStore","sdkstore","chains","keys","account","subAccount","spendPermissions","createConfigSlice","subAccountConfig","userInfo","clear","actions","subAccounts","address","subAccountsConfig","key","value","_state","store","initCCA","window","deviceId","_c","crypto","randomUUID","ClientAnalytics","init","identify","PlatformName","isProd","amplitudeApiKey","platform","web","projectName","showDebugLogging","apiEndpoint","abi","inputs","stateMutability","type","anonymous","indexed","outputs","components","factoryAbi","standardErrorCodes","invalidInput","resourceNotFound","resourceUnavailable","transactionRejected","methodNotSupported","limitExceeded","invalidRequest","methodNotFound","invalidParams","internal","userRejectedRequest","unauthorized","unsupportedMethod","disconnected","chainDisconnected","unsupportedChain","errorValues","standard","message","FALLBACK_MESSAGE","getMessageFromCode","code","fallbackMessage","Number","isInteger","codeString","toString","hasKey","isJsonRpcServerError","serialize","shouldIncludeStack","serialized","Array","isArray","isValidCode","_error","data","originalError","assignOriginalError","hasStringProperty","stack","obj","prototype","hasOwnProperty","prop","standardErrors","arg","getEthJsonRpcError","server","opts","Error","getEthProviderError","custom","EthereumProviderError","parseOpts","EthereumRpcError","constructor","super","isValidEthProviderCode","isActionableHttpRequestError","errorObject","isViemError","assertPresence","assertArrayPresence","checkCrossOriginOpenerPolicy","getCrossOriginOpenerPolicy","crossOriginOpenerPolicy","async","url","location","origin","pathname","response","fetch","method","ok","status","headers","createCoopChecker","validateSubAccount","toAccount","BaseError","shortMessage","details","cause","docsPath","metaMessages","join","defineProperty","enumerable","configurable","writable","execTyped","regex","string","match","exec","groups","bytesRegex","integerRegex","isTupleRegex","tupleRegex","formatAbiParameter","abiParameter","test","length","i","array","formatAbiParameters","abiParameters","params","errorSignatureRegex","eventSignatureRegex","functionSignatureRegex","structSignatureRegex","isStructSignature","signature","execStructSignature","constructorSignatureRegex","fallbackSignatureRegex","receiveSignatureRegex","eventModifiers","functionModifiers","param","modifier","current","depth","trim","parameterCache","Map","parseSignature","structs","isFunctionSignature","execFunctionSignature","InvalidSignatureError","inputParams","splitParameters","parameters","inputLength","push","parseAbiParameter","modifiers","returns","outputParams","outputLength","parseFunctionSignature","isEventSignature","execEventSignature","parseEventSignature","isErrorSignature","execErrorSignature","parseErrorSignature","isConstructorSignature","execConstructorSignature","parseConstructorSignature","isFallbackSignature","execFallbackSignature","parseFallbackSignature","isReceiveSignature","UnknownSignatureError","abiParameterWithoutTupleRegex","abiParameterWithTupleRegex","dynamicIntegerRegex","parameterCacheKey","structKey","struct","entries","propertyKey","property","getParameterCacheKey","has","isTuple","InvalidParameterError","protectedKeywordsRegex","isSolidityKeyword","SolidityProtectedKeywordError","components_","isSolidityType","UnknownSolidityTypeError","InvalidModifierError","isValidDataLocation","InvalidFunctionModifierError","char","tail","slice","InvalidParenthesisError","typeWithoutTupleRegex","resolveStructs","ancestors","InvalidAbiTypeParameterError","CircularReferenceError","UnknownTypeError","parseAbi","signatures","shallowStructs","signaturesLength","properties","split","propertiesLength","k","trimmed","InvalidStructSignatureError","resolvedStructs","entriesLength","parseStructs","getAction","client","actionFn","action_implicit","action_explicit","formatAbiItem","abiItem","includeName","InvalidDefinitionTypeError","formatAbiParams","map","startsWith","formatAbiParam","isHex","strict","size","Math","ceil","errorConfig","docsBaseUrl","docsSlug","docsUrl","walk","err","AbiConstructorNotFoundError","AbiConstructorParamsNotFoundError","AbiDecodingDataSizeTooSmallError","AbiDecodingZeroDataError","AbiEncodingArrayLengthMismatchError","expectedLength","givenLength","AbiEncodingBytesSizeMismatchError","expectedSize","AbiEncodingLengthMismatchError","AbiErrorInputsNotFoundError","errorName","AbiErrorNotFoundError","AbiErrorSignatureNotFoundError","AbiEventSignatureEmptyTopicsError","AbiEventSignatureNotFoundError","AbiEventNotFoundError","eventName","AbiFunctionNotFoundError","functionName","AbiFunctionOutputsNotFoundError","AbiFunctionSignatureNotFoundError","AbiItemAmbiguityError","x","y","givenSize","DecodeLogDataMismatch","DecodeLogTopicsMismatch","InvalidAbiEncodingTypeError","InvalidAbiDecodingTypeError","UnsupportedPackedAbiType","FilterTypeNotSupportedError","offset","position","targetSize","charAt","toUpperCase","toLowerCase","InvalidBytesLengthError","pad","hexOrBytes","dir","padHex","bytes","SizeExceedsPaddingSizeError","paddedBytes","Uint8Array","padEnd","padBytes","hex_","hex","max","min","signed","InvalidHexBooleanError","maxSize","sliceLength","assertSize","size_","SizeOverflowError","hexToBigInt","BigInt","padStart","hexToNumber","hexToString","hexToBytes","TextDecoder","decode","hexes","from","_v","toHex","numberToHex","stringToHex","boolToHex","bytesToHex","value_","maxValue","MAX_SAFE_INTEGER","minValue","suffix","IntegerOutOfRangeError","encoder","TextEncoder","encode","toBytes","numberToBytes","boolToBytes","stringToBytes","charCodeMap","zero","nine","A","F","a","f","charCodeToBase16","hexString","index","j","nibbleLeft","charCodeAt","nibbleRight","U32_MASK64","_32n","fromBig","n","le","h","l","lst","len","Ah","Uint32Array","Al","shrSH","_l","s","shrSL","rotrSH","rotrSL","rotrBH","rotrBL","Bh","Bl","add3L","Cl","add3H","low","Ch","add4L","Dl","add4H","Dh","add5L","El","add5H","Eh","globalThis","anumber","isSafeInteger","abytes","b","lengths","ArrayBuffer","isView","isBytes","includes","aexists","instance","checkFinished","destroyed","finished","aoutput","out","outputLen","clean","arrays","fill","createView","arr","DataView","buffer","byteOffset","byteLength","rotr","word","shift","byteSwap","swap32IfBE","u","utf8ToBytes","Hash","createHasher","hashCons","hashC","msg","update","digest","tmp","blockLen","create","randomBytes","bytesLength","getRandomValues","_0n","_1n","_2n","_7n","_256n","_0x71n","SHA3_PI","SHA3_ROTL","_SHA3_IOTA","round","R","t","IOTAS","SHA3_IOTA_H","SHA3_IOTA_L","rotlH","rotlBH","rotlSH","rotlL","rotlBL","rotlSL","Keccak","enableXOF","rounds","pos","posOut","state32","floor","clone","_cloneInto","keccak","B","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","keccakP","take","finish","writeInto","bufferOut","subarray","xofInto","xof","digestInto","destroy","to","keccak_256","gen","keccak256","to_","hashSignature","sig","toSignature","def","active","level","valid","normalizeSignature","toSignatureHash","toEventSelector","firstKey","next","checksumAddressCache","LruMap","checksumAddress","address_","chainId","hexAddress","substring","hash","getAddress","isAddress","InvalidAddressError","addressRegex","isAddressCache","cacheKey","concat","values","concatHex","concatBytes","reduce","acc","start","end","sliceHex","sliceBytes","assertStartOffset","SliceOffsetOutOfBoundsError","assertEndOffset","arrayRegex","encodeAbiParameters","preparedParams","prepareParam","prepareParams","encodeParams","arrayComponents","getArrayComponents","dynamic","InvalidArrayError","dynamicChild","preparedParam","encoded","encodeArray","param_","encodeTuple","encodeAddress","encodeBool","encodeNumber","paramSize","bytesSize","parseInt","encodeBytes","hexValue","partsLength","parts","encodeString","staticSize","staticParams","dynamicParams","dynamicSize","matches","toFunctionSelector","getAbiItem","isSelector","abiItems","filter","matchedAbiItem","matched","every","isArgOfType","ambiguousTypes","getAmbiguousTypes","argType","abiParameterType","component","sourceParameters","targetParameters","parameterIndex","sourceParameter","targetParameter","types","encodeEventTopics","item","definition","topics","indexedInputs","args_","_","encodeArg","createFilterRequestScope","requestMap","transport","onResponse","method_","id","request","createContractEventFilter","fromBlock","toBlock","getRequest","Boolean","parseAccount","encodeFunctionData","prepareEncodeFunctionData","panicReasons","solidityError","solidityPanic","count","limit","staticCursor","dataView","positionReadCount","recursiveReadCount","recursiveReadLimit","POSITIVE_INFINITY","assertReadLimit","RecursiveReadLimitExceededError","assertPosition","PositionOutOfBoundsError","decrementPosition","NegativeOffsetError","getReadCount","incrementPosition","inspectByte","position_","inspectBytes","inspectUint8","inspectUint16","getUint16","inspectUint24","getUint8","inspectUint32","getUint32","pushByte","byte","pushBytes","pushUint8","pushUint16","setUint16","pushUint24","setUint8","pushUint32","setUint32","readByte","_touch","readBytes","readUint8","readUint16","readUint24","readUint32","remaining","setPosition","oldPosition","createCursor","cursor","bytesToBigInt","bytesToBool","bytes_","InvalidBytesBooleanError","bytesToNumber","decodeAbiParameters","consumed","consumed_","decodeParameter","staticPosition","sizeOfOffset","startOfData","sizeOfLength","hasDynamicChild","decodeArray","hasUnnamedChild","some","decodeTuple","decodeAddress","decodeBool","decodeBytes","decodeNumber","bytesToString","decodeString","endsWith","decodeErrorResult","find","replacer","space","formatAbiItemWithArgs","includeFunctionName","etherUnits","gwei","wei","gweiUnits","ether","formatUnits","decimals","display","negative","integer","fraction","formatEther","unit","formatGwei","AccountStateConflictError","StateAssignmentConflictError","prettyStateMapping","stateMapping","pretty","slot","prettyPrint","maxLength","FeeConflictError","InvalidLegacyVError","v","InvalidSerializableTransactionError","transaction","InvalidStorageKeySizeError","storageKey","TransactionNotFoundError","blockHash","blockNumber","blockTag","identifier","TransactionReceiptNotFoundError","TransactionReceiptRevertedError","receipt","transactionHash","WaitForTransactionReceiptTimeoutError","CallExecutionError","account_","chain","gas","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","stateOverride","prettyArgs","nativeCurrency","symbol","val","balance","stateDiff","prettyStateOverride","ContractFunctionExecutionError","contractAddress","sender","formattedArgs","function","ContractFunctionRevertedError","decodedData","reason","errorArgs","firstArg","errorWithParams","raw","ContractFunctionZeroDataError","CounterfactualDeploymentFailedError","factory","RawContractError","HttpRequestError","body","RpcRequestError","TimeoutError","RpcError","ProviderRpcError","ParseRpcError","InvalidRequestRpcError","MethodNotFoundRpcError","InvalidParamsRpcError","InternalRpcError","InvalidInputRpcError","ResourceNotFoundRpcError","ResourceUnavailableRpcError","TransactionRejectedRpcError","MethodNotSupportedRpcError","LimitExceededRpcError","JsonRpcVersionUnsupportedError","UserRejectedRequestError","UnauthorizedProviderError","UnsupportedProviderMethodError","ProviderDisconnectedError","ChainDisconnectedError","SwitchChainError","UnsupportedNonOptionalCapabilityError","UnsupportedChainIdError","DuplicateIdError","UnknownBundleIdError","BundleTooLargeError","AtomicReadyWalletRejectedUpgradeError","AtomicityNotSupportedError","UnknownRpcError","EXECUTION_REVERTED_ERROR_CODE","getContractError","toRecoveryBit","yParityOrV","recoverAddress","publicKey","hashHex","secp256k1","resolve","secp256k1$1","signature_","r","yParity","recoveryBit","Signature","addRecoveryBit","signatureHex","fromCompact","recoverPublicKey","toRlp","encodable","getEncodable","list","bodyLength","sizeOfBodyLength","getSizeOfLength","getEncodableList","bytesOrHex","sizeOfBytesLength","getEncodableBytes","hashAuthorization","recoverAuthorizationAddress","authorization","EstimateGasExecutionError","ExecutionRevertedError","FeeCapTooHighError","FeeCapTooLowError","NonceTooHighError","NonceTooLowError","NonceMaxValueError","InsufficientFundsError","IntrinsicGasTooHighError","IntrinsicGasTooLowError","TransactionTypeNotSupportedError","TipAboveFeeCapError","UnknownNodeError","getNodeError","executionRevertedError","nodeMessage","extract","format","extract_","formatted","defineFormatter","exclude","overrides","action","rpcTransactionType","legacy","eip2930","eip1559","eip4844","eip7702","formatTransactionRequest","rpcRequest","authorizationList","accessList","blobVersionedHashes","blobs","maxFeePerBlobGas","serializeStateMapping","serializeAccountStateOverride","rpcAccountStateOverride","serializeStateOverride","rpcStateOverride","accountState","maxUint256","assertRequest","BaseFeeScalarError","Eip1559FeesNotSupportedError","MaxFeePerGasTooLowError","BlockNotFoundError","transactionType","formatTransaction","transaction_","transactionIndex","typeHex","defineTransaction","formatBlock","block","transactions","baseFeePerGas","blobGasUsed","difficulty","excessBlobGas","gasLimit","gasUsed","logsBloom","number","timestamp","totalDifficulty","defineBlock","getBlock","experimental_blockTag","includeTransactions","includeTransactions_","blockNumberHex","dedupe","formatters","getGasPrice","internal_estimateMaxPriorityFeePerGas","block_","fees","defaultPriorityFee","maxPriorityFeePerGas_","all","estimateFeesPerGas","internal_estimateFeesPerGas","baseFeeMultiplier","denominator","multiply","base","getTransactionCount","blobsToCommitments","kzg","commitments","blob","blobToKzgCommitment","blobsToProofs","proofs","commitment","computeBlobKzgProof","Chi","c","Maj","HashMD","padOffset","isLE","view","process","roundClean","setBigUint64","_u32_max","wh","wl","oview","outLen","res","SHA256_IV","SHA384_IV","SHA512_IV","SHA256_K","SHA256_W","SHA256","C","D","E","G","H","W15","W2","s0","s1","T1","T2","K512","u64.split","SHA512_Kh","SHA512_Kl","SHA512_W_H","SHA512_W_L","SHA512","Fh","Fl","Gh","Gl","Hh","Hl","W15h","W15l","s0h","u64.rotrSH","u64.shrSH","s0l","u64.rotrSL","u64.shrSL","W2h","W2l","s1h","u64.rotrBH","s1l","u64.rotrBL","SUMl","u64.add4L","SUMh","u64.add4H","sigma1h","sigma1l","CHIh","T1ll","u64.add5L","T1h","u64.add5H","T1l","sigma0h","sigma0l","MAJh","MAJl","u64.add","All","u64.add3L","u64.add3H","SHA384","sha256","sha512","sha384","sha256n","commitmentToVersionedHash","versionedHash","noble_sha256","commitmentsToVersionedHashes","hashes","fieldElementsPerBlob","bytesPerBlob","bytesPerFieldElement","maxBytesPerTransaction","BlobSizeTooLargeError","EmptyBlobError","InvalidVersionedHashSizeError","InvalidVersionedHashVersionError","toBlobSidecars","toBlobs","sidecars","proof","getTransactionType","getChainId","defaultParameters","eip1559NetworkCache","prepareTransactionRequest","nonceManager","getBlock_","chainId_","getChainId_","consume","versionedHashes","isEip1559Network","uid","gasPrice_","estimateGas","rest","chainFormat","transactionRequest","getEstimateGasError","isAddressEqual","decodeEventLog","strict_","argTopics","isUnnamed","argIndex","topic","decodeTopic","nonIndexedInputs","parseEventLogs","logs","log","event","matchArgs","isEqual","includesArgs","formatLog","logIndex","getLogs","events","events_","flatMap","formattedLogs","getContractEvents","decodeFunctionResult","abool","title","numberToHexUnpadded","num","hasHexBuiltin","fromHex","asciis","asciiToBase16","ch","hl","al","ai","hi","n1","n2","bytesToNumberBE","bytesToNumberLE","reverse","numberToBytesBE","numberToBytesLE","ensureBytes","sum","isPosBig","inRange","aInRange","bitMask","u8n","u8fr","validatorFns","bigint","boolean","stringOrUint8Array","field","object","Fp","isValid","validateObject","validators","optValidators","checkField","fieldName","isOptional","checkVal","String","memoized","WeakMap","computed","docs","Bytes.size","Bytes.SizeOverflowError","Hex.size","Hex.SizeOverflowError","Hex.SizeExceedsPaddingSizeError","decoder","fromArray","internal_hex.assertSize","Hex.padRight","internal.charCodeToBase16","Errors.BaseError","fromString","internal.assertSize","Bytes.SizeExceedsPaddingSizeError","internal.pad","padRight","Bytes.SliceOffsetOutOfBoundsError","internal.assertStartOffset","internal.assertEndOffset","toBigInt","Hex.toBigInt","Hex.fromBytes","toBoolean","trimLeft","toNumber","Hex.toNumber","internal.trim","validate","InvalidBytesTypeError","BYTES_PER_ELEMENT","assert","Json.stringify","fromBytes","fromBoolean","padLeft","fromNumber","Hex.SliceOffsetOutOfBoundsError","max_unsigned","InvalidHexTypeError","InvalidHexValueError","toRpc","withdrawal","amount","Hex.fromNumber","validatorIndex","blockOverrides","blobBaseFee","feeRecipient","prevRandao","time","withdrawals","Withdrawal.toRpc","multicall3Abi","internalType","batchGatewayAbi","universalResolverErrors","universalResolverResolveAbi","universalResolverReverseAbi","textResolverAbi","addressResolverAbi","erc1271Abi","erc6492SignatureValidatorAbi","aggregate3Signature","deploylessCallViaBytecodeBytecode","deploylessCallViaFactoryBytecode","erc6492SignatureValidatorByteCode","multicall3Bytecode","ChainDoesNotSupportContract","contract","blockCreated","ClientChainNotConfiguredError","InvalidChainIdError","encodeDeployData","bytecode","description","getChainContractAddress","contracts","getCallError","withResolvers","reject","promise","resolve_","reject_","schedulerCache","createBatchScheduler","shouldSplitBatch","wait","sort","scheduler","getScheduler","flush","setScheduler","schedule","setTimeout","batch","multicall","data_","factoryData","deploylessCallViaBytecode","deploylessCallViaFactory","deploylessCall","toDeploylessCallViaBytecodeData","toDeploylessCallViaFactoryData","rpcBlockOverrides","BlockOverrides.toRpc","request_","shouldPerformMulticall","batchSize","deployless","multicallAddress","requests","calls","allowFailure","callData","target","calldata","returnData","success","scheduleMulticall","getRevertErrorData","offchainLookup","offchainLookupSignature","ccip","ccipRead","readContract","listenersCache","cleanupCache","callbackCount","observe","observerId","callbacks","callbackId","getListeners","unwatch","cleanup","p","unsubscribe","fns","emit","poll","emitOnBegin","initialWaitTime","interval","unpoll","initialWait","watch","promiseCache","responseCache","withCache","cacheTime","cache","buildCache","getCache","Date","now","created","getTime","getBlockNumber","getFilterChanges","_client","uninstallFilter","AccountNotFoundError","BundleFailedError","statusCode","withRetry","delay","delay_","retryCount","shouldRetry","attemptRetry","retry","receiptStatuses","formatTransactionReceipt","transactionReceipt","cumulativeGasUsed","effectiveGasPrice","blobGasPrice","defineTransactionReceipt","fallbackTransactionErrorMagicIdentifier","getCallsStatus","atomic","receipts","getStatus","waitForCallsStatus","pollingInterval","retryDelay","timeout","throwOnFailure","timer","unobserve","done","clearTimeout","WaitForCallsStatusTimeoutError","random","createClient","experimental_preconfirmationTime","blockTime","defaultPollingInterval","extend","extendFn","extended","combined","isNullUniversalResolverError","decodeFunctionData","encodeErrorResult","localBatchGatewayUrl","localBatchGatewayRequest","ccipRequest","queries","failures","responses","query","urls","encodeFunctionResult","encodedLabelToLabelhash","label","indexOf","namehash","labels","hashFromEncodedLabel","hashed","encodeLabelhash","labelhash","packetToBytes","packet","EnsAvatarInvalidMetadataError","EnsAvatarInvalidNftUriError","EnsAvatarUriResolutionError","uri","EnsAvatarUnsupportedNamespaceError","namespace","networkRegex","ipfsHashRegex","base64Regex","dataURIRegex","getGateway","defaultGateway","resolveAvatarUri","gatewayUrls","isEncoded","isOnChain","ipfsGateway","ipfs","arweaveGateway","arweave","networkRegexMatch","protocol","subpath","subtarget","isIPNS","isIPFS","replacedUri","parsedUri","btoa","getJsonImage","image","image_url","image_data","parseAvatarUri","resolvedURI","isImage","contentType","hasOwn","img","Image","onload","onerror","src","isImageUri","parseAvatarRecord","record","nft","uri_","reference","asset_namespace","tokenID","eip_namespace","chainID","erc_namespace","parseNftUri","nftUri","getNftTokenUri","resolvedNftUri","encodedJson","atob","uriTokenId","json","getMetadataAvatarUri","parseNftAvatarUri","getEnsText","universalResolverAddress","tlds","ensTlds","tld","readContractParameters","readContractAction","createAccessList","createEventFilter","createPendingTransactionFilter","getCode","Eip712DomainNotFoundError","getFeeHistory","blockCount","rewardPercentiles","feeHistory","gasUsedRatio","oldestBlock","reward","formatFeeHistory","intMatch","_type","baseType","bits","bytesMatch","BytesSizeMismatchError","arrayMatch","childType","assertTransactionEIP1559","serializeAccessList","serializedAccessList","storageKeys","serializeTransaction","serializedTransaction","toYParitySignatureArray","serializeTransactionEIP1559","assertTransactionEIP2930","serializeTransactionEIP2930","assertTransactionEIP4844","serializeTransactionEIP4844","assertTransactionEIP7702","serializedAuthorizationList","serializeAuthorizationList","serializeTransactionEIP7702","assertTransactionLegacy","serializeTransactionLegacy","buildRequest","overrideOptions","methods","include","enabled","finally","withDedupe","err_","retryAfter","OffchainLookupError","callbackSelector","extraData","flat","OffchainLookupResponseMalformedError","OffchainLookupSenderMismatchError","offchainLookupAbiItem","text","statusText","ccipRequest_","defineChain","serializers","createNonceManager","source","deltaMap","nonceMap","promiseMap","getKey","increment","delta","previousNonce","reset","createIdStore","idCache","getHttpRpcClient","fetchFn","onRequest","fetchOptions","signal","signal_","errorInstance","timeoutId","controller","AbortController","abort","withTimeout","jsonrpc","Request","hashMessage","message_","toPrefixedMessage","InvalidDomainError","domain","InvalidPrimaryTypeError","primaryType","InvalidStructTypeError","getTypesForEIP712Domain","verifyingContract","salt","validateReference","hashTypedData","EIP712Domain","validateData","integerMatch","validateTypedData","hashStruct","hashDomain","encodeData","encodedTypes","encodedValues","hashType","encodeField","encodedHashType","unsortedDeps","findTypeDependencies","deps","encodeType","primaryType_","results","lastIndexOf","parsedType","typeValuePairs","InvalidAbiItemError","InvalidAbiParametersError","parseAbiItem","parseAbiParameters","parseAbiParameter_","checksum","as","noble_keccak256","Bytes.from","compressed","prefix","InvalidPrefixError","InvalidUncompressedPrefixError","InvalidError","InvalidCompressedPrefixError","Hex.validate","Bytes.validate","InvalidSerializedSizeError","Hex.slice","includePrefix","Hex.concat","Hex.from","InvalidInputError","InvalidChecksumError","Caches.checksum","Hash.keccak256","Bytes.fromString","characters","Bytes.toNumber","wrap","Address.checksum","Bytes.slice","Bytes.toBoolean","Bytes.toBigInt","Bytes.toString","Bytes.trimLeft","AbiParameters.InvalidTypeError","prepareParameter","parameter","parameter_","AbiParameters.InvalidArrayError","AbiParameters.ArrayLengthMismatchError","preparedParameters","Address.assert","Hex.padLeft","Hex.fromBoolean","encodeBoolean","Hex.IntegerOutOfRangeError","parametersize","AbiParameters.BytesSizeMismatchError","Hex.fromString","staticParameters","dynamicParameters","Bytes.fromHex","Cursor.create","ZeroDataError","DataSizeTooSmallError","internal.decodeParameter","LengthMismatchError","internal.prepareParameters","internal.encode","encodePacked","abitype.parseAbiParameters","Solidity.integerRegex","Solidity.bytesRegex","Solidity.arrayRegex","InvalidTypeError","abitype.formatAbiParameters","ArrayLengthMismatchError","HMAC","_key","ahash","iHash","oHash","buf","getPrototypeOf","hmac","_3n","_4n","_5n","_8n","mod","pow2","power","modulo","invert","m","sqrt3mod4","p1div4","ORDER","root","pow","eql","sqr","sqrt5mod8","p5div8","mul","nv","sub","ONE","FpSqrt","P","Q","S","Z","_Fp","Field","FpLegendre","cc","Q1div2","is0","M","ZERO","t_tmp","exponent","tonelliShanks","FIELD_FIELDS","FpInvertBatch","nums","passZero","inverted","multipliedAcc","invertedAcc","inv","reduceRight","p1mod2","powered","yes","no","neg","nLength","nBitLength","_nBitLength","nByteLength","bitLen","redef","BITS","BYTES","sqrtP","freeze","MASK","isOdd","lhs","rhs","d","FpPow","div","sqrN","addN","subN","mulN","sqrt","invertBatch","cmov","getFieldBytesLength","fieldOrder","bitLength","getMinHashLength","constTimeNegate","condition","negate","validateW","W","calcWOpts","scalarBits","maxNumber","windows","windowSize","mask","shiftBy","calcOffsets","wOpts","wbits","nextN","offsetStart","abs","isZero","isNeg","isNegF","offsetF","pointPrecomputes","pointWindowSizes","getW","pippenger","fieldN","points","scalars","validateMSMPoints","validateMSMScalars","plength","slength","buckets","scalar","resI","sumI","double","validateBasic","curve","Gx","Gy","validateSigVerOpts","lowS","prehash","DERErr","DER","Err","_tlv","tag","dataLen","lenLen","first","lengthBytes","_int","toSig","int","tlv","seqBytes","seqLeftBytes","rBytes","rLeftBytes","sBytes","sLeftBytes","hexFromSig","seq","numToSizedHex","weierstrassPoints","CURVE","allowInfinityPoint","allowedPrivateKeyLengths","clearCofactor","isTorsionFree","wrapPrivateKey","endo","beta","splitScalar","validatePointOpts","Fn","point","_isCompressed","toAffine","weierstrassEquation","x2","x3","isValidXY","left","right","_4a3","_27b2","normPrivateKeyToScalar","N","aprjpoint","other","Point","toAffineMemo","iz","px","py","pz","z","ax","ay","zz","assertValidMemo","fromAffine","normalizeZ","toInv","assertValidity","fromPrivateKey","privateKey","BASE","msm","_setWindowSize","wnaf","setWindowSize","hasEvenY","equals","X1","Y1","Z1","X2","Y2","Z2","U1","U2","b3","X3","Y3","Z3","t0","t1","t2","t3","t4","t5","subtract","wNAF","wNAFCached","multiplyUnsafe","sc","I","hasPrecomputes","wNAFCachedUnsafe","k1neg","k1","k2neg","k2","k1p","k2p","fake","f1p","f2p","multiplyAndAddUnsafe","cofactor","toRawBytes","isCompressed","elm","unsafeLadder","precomputeWindow","precomputes","wo","wNAFUnsafe","getPrecomputes","transform","comp","prev","ProjectivePoint","isWithinCurveOrder","weierstrass","curveDef","bits2int","bits2int_modN","validateOpts","CURVE_ORDER","compressedLen","uncompressedLen","modN","invN","cat","head","y2","sqrtError","isBiggerThanHalfOrder","slcNum","recovery","fromDER","msgHash","rec","radj","ir","u1","u2","hasHighS","normalizeS","toDERRawBytes","toDERHex","toCompactRawBytes","toCompactHex","utils","isValidPrivateKey","randomPrivateKey","fieldLen","minLen","reduced","mapHashToField","precompute","isProbPub","fpl","compLen","uncompLen","ORDER_MASK","int2octets","prepSig","defaultSigOpts","extraEntropy","ent","h1int","seedArgs","seed","k2sig","kBytes","ik","q","normS","defaultVerOpts","getPublicKey","getSharedSecret","privateA","publicB","sign","privKey","drbg","hashLen","qByteLen","hmacFn","reseed","sl","pred","createHmacDrbg","verify","sg","isObj","_sig","derError","getHash","msgs","createCurve","defHash","secp256k1P","secp256k1N","divNearest","Fpk1","_6n","_11n","_22n","_23n","_44n","_88n","b2","b6","b9","b11","b22","b44","b88","b176","b220","b223","a1","b1","a2","POW_2_128","c1","c2","recovered","MissingPropertiesError","Solidity.maxUint256","InvalidRError","InvalidSError","InvalidYParityError","isNaN","vToYParity","fromRpc","fromLegacy","yParityToV","InvalidVError","Signature.extract","suffixParameters","AbiParameters.from","InvalidWrappedSignatureError","Signature.assert","wrapped","serializeErc6492Signature","InvalidDecimalNumberError","getProof","blockTag_","storageProof","formatProof","getTransaction","getTransactionReceipt","simulateBlocks","blocks","returnFullTransactions","traceTransfers","validation","blockStateCalls","call_","dataSuffix","stateOverrides","Address.validate","prepare","abitype.parseAbiItem","getSignatureHash","fromAbi","getSelector","NotFoundError","internal.isArgOfType","internal.getAmbiguousTypes","AmbiguityError","overloads","internal.normalizeSignature","abitype.formatAbiItem","getSignature","AbiItem.NotFoundError","abiFunction","selector","AbiItem.getSelector","AbiParameters.encode","AbiItem.from","AbiItem.fromAbi","zeroAddress","simulateCalls","traceAssetChanges","getBalanceData","abiConstructor","AbiConstructor.encode","AbiFunction.encodeData","AbiFunction.from","assetAddresses","block_results","block_ethPre","block_assetsPre","block_ethPost","block_assetsPost","block_decimals","block_tokenURI","block_symbols","block_calls","balancesPre","balancesPost","symbols","tokenURI","changes","balancePost","balancePre","decimals_","symbol_","tokenURI_","token","change","pre","post","diff","assetChanges","magicBytes","verifyHash","erc6492VerifierAddress","verifierAddress","universalSignatureVerifierAddress","erc6492Verifier","multicall3","yParity_","serializeSignature","SignatureErc8010.validate","authorization_ox","initData","suffixLength","auth","AbiParameters.decode","Authorization.from","delegation","SignatureErc8010.unwrap","VerificationError","verifyErc1271","verifyAuthorization","verifyErc8010","wrappedSignature","SignatureErc6492.validate","SignatureErc6492.wrap","hexToBool","verifyErc6492","watchBlockNumber","emitMissed","onBlockNumber","onError","poll_","prevBlockNumber","transports","unsubscribe_","onData","prefixRegex","suffixRegex","verifySiweMessage","scheme","callRequest","parsed","statement","expirationTime","issuedAt","notBefore","requestId","resources","parseSiweMessage","validateSiweMessage","publicActions","createBlockFilter","estimateContractGas","getBalance","getBlobBaseFee","baseFee","getBlockTransactionCount","getBytecode","getEip712Domain","fields","extensions","getEnsAddress","coinType","functionData","getEnsAvatar","assetGatewayUrls","getEnsName","getEnsResolver","resolverAddress","getFilterLogs","estimateMaxPriorityFeePerGas","getStorageAt","getTransactionConfirmations","transactionBlockNumber","chunkedCalls","currentChunk","currentChunkSize","aggregate3Results","allSettled","aggregate3Result","sendRawTransaction","sendRawTransactionSync","throwOnReceiptRevert","simulate","simulateContract","verifyMessage","verifyTypedData","waitForTransactionReceipt","checkReplacement","confirmations","onReplaced","replacedTransaction","_unobserve","_unwatch","retrying","blockNumber_","replacementTransaction","watchBlocks","onBlock","enablePolling","prevBlock","emitFetched","subscribeBlocks","watchContractEvent","onLogs","previousBlockNumber","initialized","pollContractEvent","subscribeContractEvent","watchEvent","subscribeEvent","watchPendingTransactions","onTransactions","subscribePendingTransactions","UrlRequiredError","http","onFetchRequest","onFetchResponse","retryCount_","timeout_","url_","rpcUrls","default","rpcClient","uid_","createTransport","__rest","getOwnPropertySymbols","propertyIsEnumerable","ComponentType","ActionType","AnalyticsEventImportance","logEvent","importance","sdkVersion","sdkName","appName","metadata","appOrigin","SuppressedError","logDialogShown","dialogContext","render","componentType","modal","high","logDialogDismissed","dismiss","logDialogActionClicked","dialogAction","click","button","FONT_NAME","o","w","parentNode","removeChild","arguments","children","defaultProps","g","props","ref","__k","__","__b","__e","__d","__c","__v","__i","__u","vnode","context","__r","debounceRendering","__P","O","__n","namespaceURI","$","nextSibling","L","V","contains","insertBefore","nodeType","T","setProperty","style","cssText","addEventListener","removeEventListener","removeAttribute","setAttribute","contextType","__E","__h","_sb","__s","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","componentDidUpdate","getChildContext","getSnapshotBeforeUpdate","diffed","localName","document","createTextNode","createElementNS","__m","childNodes","attributes","__html","innerHTML","unmount","componentWillUnmount","firstChild","getDerivedStateFromError","componentDidCatch","forceUpdate","__source","__self","clsx","BaseLogo","_jsx","width","height","viewBox","xmlns","__H","__N","requestAnimationFrame","cancelAnimationFrame","isPhonePortrait","innerWidth","innerHeight","DialogHandleBar","showHandleBar","setShowHandleBar","useState","useEffect","checkOrientation","class","Dialog","items","nextItemKey","attach","el","createElement","className","appendChild","presentItem","itemProps","DialogContainer","_createElement","DialogInstance","handleClose","onClose","dragY","setDragY","isDragging","setIsDragging","startY","setStartY","_jsxs","onTouchStart","touch","touches","clientY","onTouchMove","deltaY","preventDefault","onTouchEnd","closeButton","querySelector","transition","actionItems","hidden","setHidden","isLoadingUsername","setIsLoadingUsername","username","setUsername","accounts","truncateAddress","getDisplayableUsername","fetchEnsName","headerTitle","useMemo","shouldShowHeaderTitle","onClick","variant","dialog","initDialog","textContent","injectFontStyle","POPUP_BLOCKED_TITLE","POPUP_BLOCKED_MESSAGE","openPopup","screenX","top","screenY","tryOpenPopup","popupId","popup","open","focus","coop","searchParams","append","appendAppInfoQueryParams","dappName","openPopupWithDialog","Communicator","preference","postMessage","waitForPopupLoaded","postRequestAndWaitForResponse","responsePromise","onMessage","predicate","disconnect","closed","close","unknown","URL","serializeError","errorMessage","errorCode","getErrorObject","docUrl","href","Events","EE","once","addListener","emitter","TypeError","evt","_events","_eventsCount","clearEvent","EventEmitter","__proto__","eventNames","names","handlers","ee","listenerCount","a3","a4","a5","removeListener","apply","on","removeAllListeners","off","prefixed","module","ProviderEventEmitter","parseErrorMessageFromAny","errorOrAny","HexString","IntNumber","INT_STRING_REGEX","HEXADECIMAL_STRING_REGEX","hexStringFromNumber","strip0x","ensureHexString","ensureIntNumber","isHexString","ensureEvenLengthHexString","integerToCharacter","fromEntries","base64","replaceAll","Fp256","p256","Fp384","Fp521","p256n","getSignPayload","challenge","crossOrigin","extraClientData","flag","rpId","signCount","userVerification","authenticatorData","hostname","Hash.sha256","getAuthenticatorData","clientDataJSON","Base64.fromHex","getClientDataJSON","clientDataJSONHash","challengeIndex","typeIndex","userVerificationRequired","payload","entryPoint06Abi","getInitCode","userOperation","toPackedUserOperation","callGasLimit","paymaster","paymasterData","paymasterPostOpGasLimit","paymasterVerificationGasLimit","verificationGasLimit","accountGasLimits","initCode","gasFees","paymasterAndData","preVerificationGas","PackedUserOperation","getUserOperationHash","entryPointAddress","entryPointVersion","packedUserOp","getUserOperationTypedData","AccountNotDeployedError","FailedToSendToBeneficiaryError","GasValuesOverflowError","HandleOpsOutOfGasError","InitCodeFailedError","InitCodeMustCreateSenderError","InitCodeMustReturnSenderError","InsufficientPrefundError","InternalCallOnlyError","InvalidAggregatorError","InvalidAccountNonceError","InvalidBeneficiaryError","InvalidFieldsError","InvalidPaymasterAndDataError","PaymasterDepositTooLowError","PaymasterFunctionRevertedError","PaymasterNotDeployedError","PaymasterRateLimitError","PaymasterStakeTooLowError","PaymasterPostOpFunctionRevertedError","SenderAlreadyConstructedError","SignatureCheckFailedError","SmartAccountFunctionRevertedError","UnsupportedSignatureAggregatorError","UserOperationExpiredError","UserOperationPaymasterExpiredError","UserOperationSignatureError","UserOperationPaymasterSignatureError","UserOperationRejectedByEntryPointError","UserOperationRejectedByPaymasterError","UserOperationRejectedByOpCodeError","UserOperationOutOfTimeRangeError","UnknownBundlerError","VerificationGasLimitExceededError","VerificationGasLimitTooLowError","UserOperationExecutionError","UserOperationReceiptNotFoundError","UserOperationNotFoundError","WaitForUserOperationReceiptTimeoutError","bundlerErrors","getUserOperationError","getBundlerError","revertData","getRevertData","contractCalls","compatContractCalls","formatUserOperationRequest","eip7702Auth","getPaymasterData","getPaymasterStubData","prepareUserOperation","parameters_","bundlerClient","paymasterAddress","getPaymasterStubData_","getPaymasterData_","paymasterContext","encodeCalls","getFactoryArgs","entryPoint","client_","getNonce","isDeployed","executor","prepareAuthorization","getStubSignature","isPaymasterPopulated","isFinal","sponsor","paymasterArgs","estimateUserOperationGas","formatUserOperationGas","formatUserOperation","getUserOperationReceipt","actualGasCost","actualGasUsed","formatUserOperationReceipt","bundlerActions","getSupportedEntryPoints","getUserOperation","sendUserOperation","signUserOperation","rpcParameters","waitForUserOperationReceipt","sourceHash","isDeposit","assertTransactionDeposit","isSystemTx","mint","serializeTransactionDeposit","serializeTransaction_","chainConfig","gasPriceOracle","l1Block","l2CrossDomainMessenger","l2Erc721Bridge","l2StandardBridge","l2ToL1MessagePasser","stateRoot","l1GasPrice","l1GasUsed","l1Fee","l1FeeScalar","sourceId","blockExplorers","apiUrl","disputeGameFactory","sourceId$1","l2OutputOracle","portal","l1StandardBridge","baseSepolia","network","testnet","ChainClients","FALLBACK_CHAINS","rpcUrl","decimal","createClients","fallbackChain","fc","createPublicClient","_d","_e","_f","_g","_h","createBundlerClient","getClient","correlationIdsStore","correlationIds","correlationId","newMap","assertSubAccount","info","getFormat","keyType","exportKeyToHexString","exported","subtle","exportKey","importKeyFromHexString","arrayBuffer","hexStringToUint8Array","importKey","namedCurve","encryptContent","content","sharedSecret","plainText","iv","cipherText","encrypt","decryptContent","encryptedData","decrypt","fetchRPCRequest","requestBody","mode","promisifyRequest","oncomplete","onsuccess","onabort","dbName","storeName","indexedDB","onupgradeneeded","createObjectStore","dbp","txMode","callback","db","objectStore","defaultGetStoreFunc","defaultGetStore","ACTIVE_ID_KEY","scope","customStore","del","put","createStorage","generateKeyPair","keypair","extractable","generateKey","publicKey_raw","PublicKey.from","WebCryptoP256.createKeyPair","PublicKey.toHex","getKeypair","getAccount","kp","pubKey","getOrCreateKeypair","WebAuthnP256.getSignPayload","signature_bytes","Bytes.fromArray","WebCryptoP256.sign","Signature.toHex","webauthn","getCryptoKeyAccount","OWN_PRIVATE_KEY","OWN_PUBLIC_KEY","PEER_PUBLIC_KEY","SCWKeyManager","ownPrivateKey","ownPublicKey","peerPublicKey","getOwnPublicKey","loadKeysIfNeeded","setPeerPublicKey","storeKey","newKeyPair","loadKey","deriveKey","public","deriveSharedSecret","path","assertParamsChainId","injectRequestCapabilities","capabilities","modifiedRequest","requestCapabilities","initSubAccountConfig","enableAutoSubAccounts","owner","toOwnerAccount","addSubAccount","waitForCallsTransactionHash","createWalletSendCallsRequest","paymasterUrls","atomicRequired","paymasterService","makeDataSuffix","attribution","dappOrigin","auto","requestHasCapability","capabilityName","prependWithoutDuplicates","filtered","appendWithoutDuplicates","arrayBufferToBase64Url","base64String","fromCharCode","convertCredentialToJSON","signatureRaw","Signature.fromHex","rawId","asn1EncodeSignature","rLength","sLength","totalLength","createSmartAccount","ownerIndex","implementation","nonceKeyManager","deployed","signMessage","signTypedData","toSmartAccount","decodeCalls","wrapSignature","toReplaySafeHash","toWebAuthnSignature","CoinbaseSmartWalletMessage","signatureData","createSubAccountSigner","parentAddress","rawParams","sendCallsRequest","prepareCallsRequest","funding","autoApply","sources","prepareCallsResponse","signResponse","signatureRequest","userOp","prepareCallsParams","typedData","newError","viemHttpErrorToProviderError","findOwnerIndex","owners","findIndex","formatPublicKey","ownerCount","handleAddSubAccountOwner","ownerAccount","globalAccountRequest","globalAccount","selection","presentAddOwnerDialog","callsId","routeThroughGlobalAccount","globalAccountAddress","subAccountAddress","prependCalls","originalSendCallsParams","isEthSendTransactionParams","subAccountCallData","requestToParent","spender","permissions","handleInsufficientBalanceError","presentSubAccountFundingDialog","Signer","communicator","keyManager","appChainIds","isConnected","handshake","logHandshakeStarted","handshakeMessage","createRequestMessage","failure","decrypted","decryptResponseMessage","handleResponse","logHandshakeCompleted","logHandshakeError","logRequestStarted","_request","logRequestCompleted","logRequestError","capabilitiesToInject","sendRequestToPopup","shouldRequestUseSubAccountSigner","logSubAccountRequestStarted","sendRequestToSubAccountSigner","logSubAccountRequestCompleted","logSubAccountRequestError","handleGetCapabilitiesRequest","handleGetUserInfoRequest","handleSwitchChainRequest","cachedResponse","walletConnectAccounts","getCachedWalletConnectResponse","_j","assertFetchPermissionsRequest","completeRequest","accountFromStore","subAccountFromStore","fillMissingParamsForFetchPermissions","requestedChainId","_k","permission","sendEncryptedRequest","at","capabilityResponse","accounts_","updateChain","popupResult","assertGetCapabilitiesParams","requestedAccount","filterChainIds","filterChainNumbers","capabilityKey","capabilityChainNumber","encrypted","availableChains","nativeCurrencies","walletCapabilities","newAvailableChains","getSenderFromRequest","addSenderToRequest","unstable_enableAutoSpendPermissions","logAddOwnerStarted","logAddOwnerCompleted","logAddOwnerError","subAccountRequest","logInsufficientBalanceErrorHandlingStarted","errorData","logInsufficientBalanceErrorHandlingCompleted","handlingError","logInsufficientBalanceErrorHandlingError","BaseAccountProvider","walletUrl","isBaseAccount","signer","signerType","logRequestResponded","checkErrorForInvalidRequestArgs","createBaseAccountSDK","appLogoUrl","telemetry","validatePreferences","script","provider","sdk","getProvider","injectedProvider","ethereum","getInjectedProvider","accountParam","addOwner","setToOwnerAccount","toSubAccountOwner","TOKENS","USDC","addresses","CHAIN_IDS","ERC20_TRANSFER_ABI","logPaymentStatusCheckCompleted","logPaymentStatusCheckError","getPaymentStatus","logPaymentStatusCheckStarted","bundlerUrl","userOpResponse","txReceipt","recipient","usdcAddress","senderAddress","usdcTransfers","logAddressLower","decoded","formattedAmount","senderTransfers","transferDetails","userFriendlyReason","executePaymentWithSDK","requestParams","createEphemeralSDK","payerInfoResponses","resultObj","dataCallback","executePayment","encodeTransferCall","amountInUnits","rounded","parseUnits","translatePaymentToSendCalls","payerInfo","transferData","optional","callbackURL","buildSendCallsRequest","pay","logPaymentStarted","maxDecimals","numAmount","parseFloat","decimalIndex","validateStringAmount","normalizedAddress","normalizeAddress","executionResult","logPaymentCompleted","logPaymentError","constants"],"mappings":"qPAEO,MACMA,EAAoB,kCAEpBC,sBACAC,UC4Ob,SAASC,EAAkBC,EAAYC,GACrC,IAAIC,EACJ,IACEA,EAAUF,GACZ,CAAE,MAAOG,GACP,MACF,CACA,MAAMC,EAAiB,CACrBC,QAAUC,IACR,IAAIC,EACJ,MAAMC,EAASC,GACA,OAATA,EACK,KAEFC,KAAKF,MAAMC,OAAwBE,GAEtCC,EAAsC,OAA/BL,EAAKL,EAAQG,QAAQC,IAAiBC,EAAK,KACxD,OAAIK,aAAeC,QACVD,EAAIE,KAAKN,GAEXA,EAAMI,IAEfG,QAAS,CAACT,EAAMU,IAAad,EAAQa,QACnCT,EACAI,KAAKO,UAAUD,OAA4BL,IAE7CO,WAAaZ,GAASJ,EAAQgB,WAAWZ,IAE3C,OAAOF,CACT,CACA,MAAMe,EAAcC,GAAQC,IAC1B,IACE,MAAMC,EAASF,EAAGC,GAClB,OAAIC,aAAkBT,QACbS,EAEF,CACLR,KAAKS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ignoreList":[1,2,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,300,301,302,305,314,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,357,358,363,366,372,373,374,392]}
|