diff --git a/.changeset/young-carrots-burn.md b/.changeset/young-carrots-burn.md new file mode 100644 index 00000000000..d5edf4799bf --- /dev/null +++ b/.changeset/young-carrots-burn.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +ERC20 assets diff --git a/packages/thirdweb/package.json b/packages/thirdweb/package.json index 25d7bfef47b..cfc7fa28890 100644 --- a/packages/thirdweb/package.json +++ b/packages/thirdweb/package.json @@ -97,128 +97,133 @@ }, "exports": { ".": { - "types": "./dist/types/exports/thirdweb.d.ts", + "default": "./dist/cjs/exports/thirdweb.js", "import": "./dist/esm/exports/thirdweb.js", - "default": "./dist/cjs/exports/thirdweb.js" + "types": "./dist/types/exports/thirdweb.d.ts" }, "./adapters/*": { - "types": "./dist/types/exports/adapters/*.d.ts", + "default": "./dist/cjs/exports/adapters/*.js", "import": "./dist/esm/exports/adapters/*.js", - "default": "./dist/cjs/exports/adapters/*.js" + "types": "./dist/types/exports/adapters/*.d.ts" }, "./ai": { - "types": "./dist/types/exports/ai.d.ts", + "default": "./dist/cjs/exports/ai.js", "import": "./dist/esm/exports/ai.js", - "default": "./dist/cjs/exports/ai.js" + "types": "./dist/types/exports/ai.d.ts" + }, + "./assets": { + "default": "./dist/cjs/exports/assets.js", + "import": "./dist/esm/exports/assets.js", + "types": "./dist/types/exports/assets.d.ts" }, "./auth": { - "types": "./dist/types/exports/auth.d.ts", + "default": "./dist/cjs/exports/auth.js", "import": "./dist/esm/exports/auth.js", - "default": "./dist/cjs/exports/auth.js" + "types": "./dist/types/exports/auth.d.ts" }, "./bridge": { - "types": "./dist/types/exports/bridge.d.ts", + "default": "./dist/cjs/exports/bridge.js", "import": "./dist/esm/exports/bridge.js", - "default": "./dist/cjs/exports/bridge.js" + "types": "./dist/types/exports/bridge.d.ts" }, "./chains": { - "types": "./dist/types/exports/chains.d.ts", + "default": "./dist/cjs/exports/chains.js", "import": "./dist/esm/exports/chains.js", - "default": "./dist/cjs/exports/chains.js" + "types": "./dist/types/exports/chains.d.ts" }, "./contract": { - "types": "./dist/types/exports/contract.d.ts", + "default": "./dist/cjs/exports/contract.js", "import": "./dist/esm/exports/contract.js", - "default": "./dist/cjs/exports/contract.js" + "types": "./dist/types/exports/contract.d.ts" }, "./deploys": { - "types": "./dist/types/exports/deploys.d.ts", + "default": "./dist/cjs/exports/deploys.js", "import": "./dist/esm/exports/deploys.js", - "default": "./dist/cjs/exports/deploys.js" + "types": "./dist/types/exports/deploys.d.ts" }, "./engine": { - "types": "./dist/types/exports/engine.d.ts", + "default": "./dist/cjs/exports/engine.js", "import": "./dist/esm/exports/engine.js", - "default": "./dist/cjs/exports/engine.js" + "types": "./dist/types/exports/engine.d.ts" }, "./event": { - "types": "./dist/types/exports/event.d.ts", + "default": "./dist/cjs/exports/event.js", "import": "./dist/esm/exports/event.js", - "default": "./dist/cjs/exports/event.js" + "types": "./dist/types/exports/event.d.ts" }, "./extensions/*": { - "types": "./dist/types/exports/extensions/*.d.ts", + "default": "./dist/cjs/exports/extensions/*.js", "import": "./dist/esm/exports/extensions/*.js", - "default": "./dist/cjs/exports/extensions/*.js" + "types": "./dist/types/exports/extensions/*.d.ts" }, "./insight": { - "types": "./dist/types/exports/insight.d.ts", + "default": "./dist/cjs/exports/insight.js", "import": "./dist/esm/exports/insight.js", - "default": "./dist/cjs/exports/insight.js" + "types": "./dist/types/exports/insight.d.ts" }, "./modules": { - "types": "./dist/types/exports/modules.d.ts", + "default": "./dist/cjs/exports/modules.js", "import": "./dist/esm/exports/modules.js", - "default": "./dist/cjs/exports/modules.js" + "types": "./dist/types/exports/modules.d.ts" }, "./package.json": "./package.json", "./pay": { - "types": "./dist/types/exports/pay.d.ts", + "default": "./dist/cjs/exports/pay.js", "import": "./dist/esm/exports/pay.js", - "default": "./dist/cjs/exports/pay.js" + "types": "./dist/types/exports/pay.d.ts" }, "./react": { - "types": "./dist/types/exports/react.d.ts", - "react-native": "./dist/esm/exports/react.native.js", + "default": "./dist/cjs/exports/react.js", "import": "./dist/esm/exports/react.js", - "default": "./dist/cjs/exports/react.js" + "react-native": "./dist/esm/exports/react.native.js", + "types": "./dist/types/exports/react.d.ts" }, "./react-native": { - "types": "./dist/types/exports/react.native.d.ts", + "default": "./dist/cjs/exports/react.native.js", "import": "./dist/esm/exports/react.native.js", - "default": "./dist/cjs/exports/react.native.js" + "types": "./dist/types/exports/react.native.d.ts" }, "./rpc": { - "types": "./dist/types/exports/rpc.d.ts", + "default": "./dist/cjs/exports/rpc.js", "import": "./dist/esm/exports/rpc.js", - "default": "./dist/cjs/exports/rpc.js" + "types": "./dist/types/exports/rpc.d.ts" }, "./social": { - "types": "./dist/types/exports/social.d.ts", + "default": "./dist/cjs/exports/social.js", "import": "./dist/esm/exports/social.js", - "default": "./dist/cjs/exports/social.js" + "types": "./dist/types/exports/social.d.ts" }, "./storage": { - "types": "./dist/types/exports/storage.d.ts", + "default": "./dist/cjs/exports/storage.js", "import": "./dist/esm/exports/storage.js", - "default": "./dist/cjs/exports/storage.js" + "types": "./dist/types/exports/storage.d.ts" }, "./transaction": { - "types": "./dist/types/exports/transaction.d.ts", + "default": "./dist/cjs/exports/transaction.js", "import": "./dist/esm/exports/transaction.js", - "default": "./dist/cjs/exports/transaction.js" + "types": "./dist/types/exports/transaction.d.ts" }, "./utils": { - "types": "./dist/types/exports/utils.d.ts", + "default": "./dist/cjs/exports/utils.js", "import": "./dist/esm/exports/utils.js", - "default": "./dist/cjs/exports/utils.js" + "types": "./dist/types/exports/utils.d.ts" }, "./wallets": { - "types": "./dist/types/exports/wallets.d.ts", - "react-native": "./dist/esm/exports/wallets.native.js", + "default": "./dist/cjs/exports/wallets.js", "import": "./dist/esm/exports/wallets.js", - "default": "./dist/cjs/exports/wallets.js" + "react-native": "./dist/esm/exports/wallets.native.js", + "types": "./dist/types/exports/wallets.d.ts" }, "./wallets/*": { - "types": "./dist/types/exports/wallets/*.d.ts", + "default": "./dist/cjs/exports/wallets/*.js", "import": "./dist/esm/exports/wallets/*.js", - "default": "./dist/cjs/exports/wallets/*.js" + "types": "./dist/types/exports/wallets/*.d.ts" }, "./wallets/in-app": { - "types": "./dist/types/exports/wallets/in-app.d.ts", - "react-native": "./dist/esm/exports/wallets/in-app.native.js", + "default": "./dist/cjs/exports/wallets/in-app.js", "import": "./dist/esm/exports/wallets/in-app.js", - "default": "./dist/cjs/exports/wallets/in-app.js" + "react-native": "./dist/esm/exports/wallets/in-app.native.js", + "types": "./dist/types/exports/wallets/in-app.d.ts" } }, "files": [ @@ -347,6 +352,9 @@ "ai": [ "./dist/types/exports/ai.d.ts" ], + "assets": [ + "./dist/types/exports/assets.d.ts" + ], "auth": [ "./dist/types/exports/auth.d.ts" ], diff --git a/packages/thirdweb/scripts/generate/abis/assets/AssetInfraDeployer.json b/packages/thirdweb/scripts/generate/abis/assets/AssetInfraDeployer.json new file mode 100644 index 00000000000..61dfe2aaaf5 --- /dev/null +++ b/packages/thirdweb/scripts/generate/abis/assets/AssetInfraDeployer.json @@ -0,0 +1,5 @@ +[ + "function deployInfraProxyDeterministic(address implementation, bytes data, bytes32 salt, bytes extraData) returns (address deployedProxy)", + "event AssetInfraDeployed(address indexed implementation, address indexed proxy, bytes32 inputSalt, bytes data, bytes extraData)", + "error ProxyDeploymentFailed()" +] \ No newline at end of file diff --git a/packages/thirdweb/scripts/generate/abis/assets/ERC20Asset.json b/packages/thirdweb/scripts/generate/abis/assets/ERC20Asset.json new file mode 100644 index 00000000000..9d9bcc9bf3a --- /dev/null +++ b/packages/thirdweb/scripts/generate/abis/assets/ERC20Asset.json @@ -0,0 +1,49 @@ +[ + "constructor()", + "function DOMAIN_SEPARATOR() view returns (bytes32 result)", + "function allowance(address owner, address spender) view returns (uint256 result)", + "function approve(address spender, uint256 amount) returns (bool)", + "function balanceOf(address owner) view returns (uint256 result)", + "function burn(uint256 amount)", + "function burnFrom(address from, uint256 amount)", + "function cancelOwnershipHandover() payable", + "function completeOwnershipHandover(address pendingOwner) payable", + "function contractURI() view returns (string)", + "function decimals() view returns (uint8)", + "function initialize(string _name, string _symbol, string _contractURI, uint256 _maxSupply, address _owner)", + "function name() view returns (string)", + "function nonces(address owner) view returns (uint256 result)", + "function owner() view returns (address result)", + "function ownershipHandoverExpiresAt(address pendingOwner) view returns (uint256 result)", + "function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)", + "function renounceOwnership() payable", + "function requestOwnershipHandover() payable", + "function setContractURI(string _contractURI)", + "function supportsInterface(bytes4 interfaceId) pure returns (bool)", + "function symbol() view returns (string)", + "function totalSupply() view returns (uint256 result)", + "function transfer(address to, uint256 amount) returns (bool)", + "function transferFrom(address from, address to, uint256 amount) returns (bool)", + "function transferOwnership(address newOwner) payable", + "event Approval(address indexed owner, address indexed spender, uint256 amount)", + "event ContractURIUpdated()", + "event Initialized(uint64 version)", + "event OwnershipHandoverCanceled(address indexed pendingOwner)", + "event OwnershipHandoverRequested(address indexed pendingOwner)", + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + "event Transfer(address indexed from, address indexed to, uint256 amount)", + "error AllowanceOverflow()", + "error AllowanceUnderflow()", + "error AlreadyInitialized()", + "error InsufficientAllowance()", + "error InsufficientBalance()", + "error InvalidInitialization()", + "error InvalidPermit()", + "error NewOwnerIsZeroAddress()", + "error NoHandoverRequest()", + "error NotInitializing()", + "error Permit2AllowanceIsFixedAtInfinity()", + "error PermitExpired()", + "error TotalSupplyOverflow()", + "error Unauthorized()" +] \ No newline at end of file diff --git a/packages/thirdweb/scripts/generate/abis/assets/ERC20AssetEntrypoint.json b/packages/thirdweb/scripts/generate/abis/assets/ERC20AssetEntrypoint.json new file mode 100644 index 00000000000..af7e9d1dad5 --- /dev/null +++ b/packages/thirdweb/scripts/generate/abis/assets/ERC20AssetEntrypoint.json @@ -0,0 +1,67 @@ +[ + "constructor()", + "function addImplementation((bytes32 contractId, address implementation, uint8 implementationType, uint8 createHook, bytes createHookData) config, bool isDefault)", + "function buyAsset(address asset, (address recipient, address referrer, address tokenIn, uint256 amountIn, uint256 minAmountOut, uint256 deadline, bytes hookData) params) payable returns (uint256 amountIn, uint256 amountOut)", + "function cancelOwnershipHandover() payable", + "function claimRewards(address asset)", + "function completeOwnershipHandover(address pendingOwner) payable", + "function createAsset(address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) createParams) returns (address asset)", + "function createAssetById(bytes32 contractId, address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) params) returns (address asset)", + "function createAssetByImplementationConfig((bytes32 contractId, address implementation, uint8 implementationType, uint8 createHook, bytes createHookData) config, address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) params) returns (address asset)", + "function decodeOwnerFromInitData(bytes data) pure returns (address owner)", + "function distributeAsset(address asset, (uint256 amount, address recipient)[] contents) payable", + "function getAirdrop() view returns (address airdrop)", + "function getImplementation(bytes32 contractId) view returns ((bytes32 contractId, address implementation, uint8 implementationType, uint8 createHook, bytes createHookData) config)", + "function getRewardLocker() view returns (address rewardLocker)", + "function getRewardPosition(address asset) view returns ((address positionManager, uint256 tokenId, address recipient, address referrer, uint16 referrerBps))", + "function getRouter() view returns (address router)", + "function guardSalt(bytes32 salt, address creator, bytes contractInitData, bytes hookInitData) view returns (bytes32)", + "function initialize(address owner, address router, address rewardLocker, address airdrop)", + "function listAsset(address asset, (address tokenOut, uint256 pricePerUnit, uint8 priceDenominator, uint256 totalSupply, uint48 startTime, uint48 endTime, address hook, bytes createHookData) params) returns (address sale, address position, uint256 positionId)", + "function owner() view returns (address result)", + "function ownershipHandoverExpiresAt(address pendingOwner) view returns (uint256 result)", + "function predictAssetAddress(bytes32 contractId, address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) params) view returns (address predicted)", + "function predictAssetAddressByConfig((bytes32 contractId, address implementation, uint8 implementationType, uint8 createHook, bytes createHookData) config, address creator, (uint256 amount, address referrer, bytes32 salt, bytes data, bytes hookData) params) view returns (address predicted)", + "function proxiableUUID() view returns (bytes32)", + "function renounceOwnership() payable", + "function requestOwnershipHandover() payable", + "function sellAsset(address asset, (address recipient, address tokenOut, uint256 amountIn, uint256 minAmountOut, uint256 deadline, bytes hookData) params) returns (uint256 amountIn, uint256 amountOut)", + "function setAirdrop(address airdrop)", + "function setRewardLocker(address rewardLocker)", + "function setRouter(address router)", + "function transferOwnership(address newOwner) payable", + "function upgradeToAndCall(address newImplementation, bytes data) payable", + "event AirdropUpdated(address airdrop)", + "event AssetCreated(bytes32 contractId, address indexed creator, address indexed asset, address referrer, bytes aux)", + "event AssetDistributed(address asset, uint256 recipientCount, uint256 totalAmount)", + "event ImplementationAdded(bytes32 contractId, address indexed implementation, uint8 implementationType, uint8 createHook, bytes createHookData)", + "event Initialized(uint64 version)", + "event OwnershipHandoverCanceled(address indexed pendingOwner)", + "event OwnershipHandoverRequested(address indexed pendingOwner)", + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + "event RewardLockerUpdated(address locker)", + "event RouterUpdated(address router)", + "event Upgraded(address indexed implementation)", + "error AlreadyInitialized()", + "error ArrayLengthMismatch()", + "error AssetNotRegistered()", + "error CreateHookFailed()", + "error CreateHookReverted(string reason)", + "error ImplementationAlreadyExists()", + "error InvalidContractId()", + "error InvalidCreateHook()", + "error InvalidCreator()", + "error InvalidDeploymentArgs()", + "error InvalidImplementation()", + "error InvalidInitialization()", + "error InvalidInitializer()", + "error InvalidSaltFlags()", + "error InvalidValue()", + "error NewOwnerIsZeroAddress()", + "error NoHandoverRequest()", + "error NotInitializing()", + "error Unauthorized()", + "error UnauthorizedCallContext()", + "error UpgradeFailed()", + "error ValueTransferFailed()" +] \ No newline at end of file diff --git a/packages/thirdweb/scripts/generate/abis/assets/FeeManager.json b/packages/thirdweb/scripts/generate/abis/assets/FeeManager.json new file mode 100644 index 00000000000..71e2b7a570b --- /dev/null +++ b/packages/thirdweb/scripts/generate/abis/assets/FeeManager.json @@ -0,0 +1,47 @@ +[ + "constructor(address _owner, address _feeRecipient)", + "function ROLE_FEE_MANAGER() view returns (uint256)", + "function calculateFee(address payer, bytes4 action, uint256 amount, uint256 maxFeeAmount) view returns (address recipient, uint256 feeAmount)", + "function cancelOwnershipHandover() payable", + "function completeOwnershipHandover(address pendingOwner) payable", + "function domainSeparator() view returns (bytes32)", + "function eip712Domain() view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)", + "function feeConfigs(address target, bytes4 action) view returns (address recipient, uint8 feeType, uint256 value)", + "function feeRecipient() view returns (address)", + "function getFeeConfig(address target, bytes4 action) view returns ((address recipient, uint8 feeType, uint256 value) config)", + "function grantRoles(address user, uint256 roles) payable", + "function hasAllRoles(address user, uint256 roles) view returns (bool)", + "function hasAnyRole(address user, uint256 roles) view returns (bool)", + "function owner() view returns (address result)", + "function ownershipHandoverExpiresAt(address pendingOwner) view returns (uint256 result)", + "function renounceOwnership() payable", + "function renounceRoles(uint256 roles) payable", + "function requestOwnershipHandover() payable", + "function revokeRoles(address user, uint256 roles) payable", + "function rolesOf(address user) view returns (uint256 roles)", + "function setFeeConfig(bytes4 action, uint8 feeType, uint256 value)", + "function setFeeConfigBySignature(address target, bytes4 action, address recipient, uint8 feeType, uint256 value, uint256 nonce, uint256 deadline, bytes signature)", + "function setFeeRecipient(address _feeRecipient)", + "function setTargetFeeConfig(address target, bytes4 action, address recipient, uint8 feeType, uint256 value)", + "function transferOwnership(address newOwner) payable", + "function usedNonces(bytes32 signerNonce) view returns (bool used)", + "event FeeConfigUpdated(address indexed target, bytes4 indexed action, address recipient, uint8 feeType, uint256 value)", + "event FeeConfigUpdatedBySignature(address indexed signer, address indexed target, bytes4 indexed action, address recipient, uint8 feeType, uint256 value)", + "event FeeRecipientUpdated(address feeRecipient)", + "event OwnershipHandoverCanceled(address indexed pendingOwner)", + "event OwnershipHandoverRequested(address indexed pendingOwner)", + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + "event RolesUpdated(address indexed user, uint256 indexed roles)", + "error AlreadyInitialized()", + "error InvalidConfig()", + "error InvalidFeeType()", + "error InvalidModule()", + "error InvalidNonce()", + "error InvalidRecipient()", + "error InvalidSignature()", + "error InvalidValue()", + "error NewOwnerIsZeroAddress()", + "error NoHandoverRequest()", + "error SignatureExpired()", + "error Unauthorized()" +] \ No newline at end of file diff --git a/packages/thirdweb/scripts/generate/abis/assets/RewardLocker.json b/packages/thirdweb/scripts/generate/abis/assets/RewardLocker.json new file mode 100644 index 00000000000..4d66d45475b --- /dev/null +++ b/packages/thirdweb/scripts/generate/abis/assets/RewardLocker.json @@ -0,0 +1,16 @@ +[ + "constructor(address _feeManager, address _v3PositionManager, address _v4PositionManager)", + "function collectRewards(address owner, address asset) returns (address token0, address token1, uint256 amount0, uint256 amount1)", + "function feeManager() view returns (address)", + "function lockPosition(address asset, address positionManager, uint256 tokenId, address recipient, address referrer, uint16 referrerBps)", + "function positions(address owner, address asset) view returns (address positionManager, uint256 tokenId, address recipient, address referrer, uint16 referrerBps)", + "function v3PositionManager() view returns (address)", + "function v4PositionManager() view returns (address)", + "event PositionLocked(address indexed owner, address indexed asset, address positionManager, uint256 tokenId, address recipient, address referrer)", + "event RewardsCollected(address indexed owner, address indexed asset, address positionManager, uint256 tokenId, uint256 amount0, uint256 amount1)", + "error InvalidPosition()", + "error InvalidPositionManager()", + "error InvalidReferrerBps()", + "error InvalidRewardRecipient()", + "error TokenAlreadyLocked()" +] diff --git a/packages/thirdweb/scripts/generate/abis/assets/Router.json b/packages/thirdweb/scripts/generate/abis/assets/Router.json new file mode 100644 index 00000000000..28c9887edb1 --- /dev/null +++ b/packages/thirdweb/scripts/generate/abis/assets/Router.json @@ -0,0 +1,54 @@ +[ + "constructor()", + "function NATIVE_TOKEN() view returns (address)", + "function cancelOwnershipHandover() payable", + "function completeOwnershipHandover(address pendingOwner) payable", + "function createMarket((address creator, address tokenIn, address tokenOut, uint256 pricePerUnit, uint8 priceDenominator, uint256 totalSupply, uint48 startTime, uint48 endTime, uint256 tokenId, address hook, bytes createHookData) createMarketConfig) payable returns (address sale, address position, uint256 positionId)", + "function createPool((address recipient, address referrer, address tokenA, address tokenB, uint256 amountA, uint256 amountB, bytes data) createPoolConfig) payable returns (address pool, address position, uint256 positionId, uint256 refundAmount0, uint256 refundAmount1)", + "function disableAdapter(uint8 adapterType)", + "function enableAdapter(uint8 adapterType, bytes config)", + "function initialize(address owner)", + "function owner() view returns (address result)", + "function ownershipHandoverExpiresAt(address pendingOwner) view returns (uint256 result)", + "function proxiableUUID() view returns (bytes32)", + "function renounceOwnership() payable", + "function requestOwnershipHandover() payable", + "function swap((address tokenIn, address tokenOut, uint256 amountIn, uint256 minAmountOut, address recipient, address refundRecipient, uint256 deadline, bytes data) config) payable returns ((uint256 amountIn, uint256 amountOut, address source) result)", + "function transferOwnership(address newOwner) payable", + "function upgradeToAndCall(address newImplementation, bytes data) payable", + "event AdapterDisabled(uint8 adapterType)", + "event AdapterEnabled(uint8 adapterType)", + "event Initialized(uint64 version)", + "event OwnershipHandoverCanceled(address indexed pendingOwner)", + "event OwnershipHandoverRequested(address indexed pendingOwner)", + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + "event SwapExecuted(address indexed sender, address indexed tokenIn, address indexed tokenOut, uint256 amountIn, uint256 amountOut, uint8 adapterUsed)", + "event Upgraded(address indexed implementation)", + "error AdapterNotFound()", + "error AlreadyInitialized()", + "error DeadlineExceeded()", + "error ExcessiveInput()", + "error InsufficientOutput()", + "error InvalidAmount()", + "error InvalidConfiguration()", + "error InvalidFee()", + "error InvalidFee()", + "error InvalidInitialization()", + "error InvalidPoolConfig()", + "error InvalidTick()", + "error InvalidTick()", + "error NewOwnerIsZeroAddress()", + "error NoAvailableRoute()", + "error NoHandoverRequest()", + "error NotInitializing()", + "error PoolAlreadyExists()", + "error PoolAlreadyExists()", + "error PoolNotFound()", + "error PoolNotFound()", + "error Reentrancy()", + "error SwapFailed()", + "error Unauthorized()", + "error UnauthorizedCallContext()", + "error UpgradeFailed()", + "error ZeroAddress()" +] \ No newline at end of file diff --git a/packages/thirdweb/src/assets/constants.ts b/packages/thirdweb/src/assets/constants.ts new file mode 100644 index 00000000000..47d2c9e2d69 --- /dev/null +++ b/packages/thirdweb/src/assets/constants.ts @@ -0,0 +1,31 @@ +export const DEFAULT_MAX_SUPPLY_ERC20 = 10_000_000_000n; +export const DEFAULT_POOL_INITIAL_TICK = 230200; +export const DEFAULT_REFERRER_REWARD_BPS = 5000; // 50% +export const DEFAULT_INFRA_ADMIN = "0x1a472863cf21d5aa27f417df9140400324c48f22"; +export const DEFAULT_FEE_RECIPIENT = + "0x1Af20C6B23373350aD464700B5965CE4B0D2aD94"; +export const DEFAULT_SALT = "0x"; + +export const IMPLEMENTATIONS: Record> = { + 8453: { + AssetEntrypointERC20: "0xe7caeE8a2df994cE00b575eE56A3c9DecB95028D", + }, + 84532: { + AssetEntrypointERC20: "0xa34ed67f2a327D8E87E3dFBcc7b4927df7C418ef", + }, +}; + +export enum ImplementationType { + CLONE = 0, + CLONE_WITH_IMMUTABLE_ARGS = 1, + ERC1967 = 2, + ERC1967_WITH_IMMUTABLE_ARGS = 3, +} + +export enum CreateHook { + NONE = 0, // do nothing + CREATE_POOL = 1, // create a DEX pool via Router + CREATE_MARKET = 2, // create a market sale via Router + DISTRIBUTE = 3, // distribute tokens to recipients + EXTERNAL_HOOK = 4, // call an external hook contract +} diff --git a/packages/thirdweb/src/assets/create-token-by-impl-config.ts b/packages/thirdweb/src/assets/create-token-by-impl-config.ts new file mode 100644 index 00000000000..23921c8d4d2 --- /dev/null +++ b/packages/thirdweb/src/assets/create-token-by-impl-config.ts @@ -0,0 +1,128 @@ +import type { Hex } from "viem"; +import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS } from "../constants/addresses.js"; +import { getContract } from "../contract/contract.js"; +import { parseEventLogs } from "../event/actions/parse-logs.js"; +import { assetCreatedEvent } from "../extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetCreated.js"; +import { createAssetByImplementationConfig } from "../extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAssetByImplementationConfig.js"; +import { decimals } from "../extensions/erc20/read/decimals.js"; +import { eth_blockNumber } from "../rpc/actions/eth_blockNumber.js"; +import { getRpcClient } from "../rpc/rpc.js"; +import { sendAndConfirmTransaction } from "../transaction/actions/send-and-confirm-transaction.js"; +import { keccakId } from "../utils/any-evm/keccak-id.js"; +import { toHex } from "../utils/encoding/hex.js"; +import { toUnits } from "../utils/units.js"; +import { + CreateHook, + DEFAULT_MAX_SUPPLY_ERC20, + ImplementationType, +} from "./constants.js"; +import { getOrDeployEntrypointERC20 } from "./get-entrypoint-erc20.js"; +import { + encodeInitParams, + encodeMarketConfig, + encodePoolConfig, +} from "./token-utils.js"; +import type { CreateTokenByImplementationConfigOptions } from "./types.js"; + +export async function createTokenByImplementationConfig(options: CreateTokenByImplementationConfigOptions) { + const { client, chain, account, params, implementationAddress, launchConfig } = options; + + const creator = params.owner || account.address; + + const encodedInitData = await encodeInitParams({ + client, + creator, + params, + }); + + const rpcRequest = getRpcClient({ + ...options, + }); + const blockNumber = await eth_blockNumber(rpcRequest); + const salt = options.salt + ? options.salt.startsWith("0x") && options.salt.length === 66 + ? (options.salt as `0x${string}`) + : keccakId(options.salt) + : toHex(blockNumber, { + size: 32, + }); + + const entrypoint = await getOrDeployEntrypointERC20(options); + + let hookData: Hex = "0x"; + let amount = toUnits( + params.maxSupply.toString() || DEFAULT_MAX_SUPPLY_ERC20.toString(), + 18, + ); + if (launchConfig?.kind === "pool") { + hookData = encodePoolConfig(launchConfig.config); + amount = toUnits( + launchConfig.config.amount.toString() || + DEFAULT_MAX_SUPPLY_ERC20.toString(), + 18, + ); + } else if (launchConfig?.kind === "market") { + const currencyContract = + launchConfig.config.tokenOut && + launchConfig.config.tokenOut !== NATIVE_TOKEN_ADDRESS + ? getContract({ + address: launchConfig.config.tokenOut, + chain, + client, + }) + : null; + const currencyDecimals = launchConfig.config.priceDenominator + ? launchConfig.config.priceDenominator + : currencyContract + ? await decimals({ + contract: currencyContract, + }) + : 18; + + hookData = encodeMarketConfig({ + ...launchConfig.config, + decimals: currencyDecimals, + }); + } + + const transaction = createAssetByImplementationConfig({ + config: { + contractId: keccakId("ERC20Asset"), + createHook: + launchConfig?.kind === "pool" + ? CreateHook.CREATE_POOL + : launchConfig?.kind === "market" + ? CreateHook.CREATE_MARKET + : launchConfig?.kind === "distribute" + ? CreateHook.DISTRIBUTE + : CreateHook.NONE, + createHookData: hookData, + implementation: implementationAddress, + implementationType: ImplementationType.ERC1967, + }, + contract: entrypoint, + creator, + params: { + amount, + data: encodedInitData, + hookData, + referrer: ZERO_ADDRESS, + salt, + }, + }); + + const receipt = await sendAndConfirmTransaction({ account, transaction }); + const assetEvent = assetCreatedEvent(); + const decodedEvent = parseEventLogs({ + events: [assetEvent], + logs: receipt.logs, + }); + + if (decodedEvent.length === 0 || !decodedEvent[0]) { + throw new Error( + `No AssetCreated event found in transaction: ${receipt.transactionHash}`, + ); + } + + return decodedEvent[0]?.args.asset; +} diff --git a/packages/thirdweb/src/assets/create-token.test.ts b/packages/thirdweb/src/assets/create-token.test.ts new file mode 100644 index 00000000000..9a48d990052 --- /dev/null +++ b/packages/thirdweb/src/assets/create-token.test.ts @@ -0,0 +1,45 @@ +import { describe, expect, it } from "vitest"; +import { ANVIL_CHAIN } from "../../test/src/chains.js"; +import { TEST_CLIENT } from "../../test/src/test-clients.js"; +import { TEST_ACCOUNT_A } from "../../test/src/test-wallets.js"; +import { getContract } from "../contract/contract.js"; +import { name } from "../extensions/common/read/name.js"; +// import { totalSupply } from "../extensions/erc20/__generated__/IERC20/read/totalSupply.js"; +import { createTokenByImplementationConfig } from "./create-token-by-impl-config.js"; + +describe.runIf(process.env.TW_SECRET_KEY)("create token by impl config", () => { + it("should create token without pool", async () => { + const token = await createTokenByImplementationConfig({ + account: TEST_ACCOUNT_A, + chain: ANVIL_CHAIN, + client: TEST_CLIENT, + params: { + maxSupply: 10_00n, + name: "Test", + }, + salt: "salt123", + implementationAddress: "", + }); + + expect(token).toBeDefined(); + + const tokenName = await name({ + contract: getContract({ + address: token, + chain: ANVIL_CHAIN, + client: TEST_CLIENT, + }), + }); + expect(tokenName).to.eq("Test"); + + // const supply = await totalSupply({ + // contract: getContract({ + // client: TEST_CLIENT, + // chain: ANVIL_CHAIN, + // address: token, + // }), + // }); + + // console.log("supply: ", supply); + }); +}); diff --git a/packages/thirdweb/src/assets/create-token.ts b/packages/thirdweb/src/assets/create-token.ts new file mode 100644 index 00000000000..7c69fb31c45 --- /dev/null +++ b/packages/thirdweb/src/assets/create-token.ts @@ -0,0 +1,116 @@ +import type { Hex } from "viem"; +import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS } from "../constants/addresses.js"; +import { getContract } from "../contract/contract.js"; +import { parseEventLogs } from "../event/actions/parse-logs.js"; +import { assetCreatedEvent } from "../extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetCreated.js"; +import { createAsset } from "../extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAsset.js"; +import { decimals } from "../extensions/erc20/read/decimals.js"; +import { eth_blockNumber } from "../rpc/actions/eth_blockNumber.js"; +import { getRpcClient } from "../rpc/rpc.js"; +import { sendAndConfirmTransaction } from "../transaction/actions/send-and-confirm-transaction.js"; +import { keccakId } from "../utils/any-evm/keccak-id.js"; +import { toHex } from "../utils/encoding/hex.js"; +import { toUnits } from "../utils/units.js"; +import { DEFAULT_MAX_SUPPLY_ERC20 } from "./constants.js"; +import { getOrDeployEntrypointERC20 } from "./get-entrypoint-erc20.js"; +import { + encodeInitParams, + encodeMarketConfig, + encodePoolConfig, +} from "./token-utils.js"; +import type { CreateTokenOptions } from "./types.js"; + +export async function createToken(options: CreateTokenOptions) { + const { client, chain, account, params, launchConfig } = options; + + const creator = params.owner || account.address; + + const encodedInitData = await encodeInitParams({ + client, + creator, + params, + }); + + const rpcRequest = getRpcClient({ + ...options, + }); + const blockNumber = await eth_blockNumber(rpcRequest); + + let salt: Hex = "0x"; + if (!options.salt) { + salt = `0x1f${toHex(blockNumber, { + size: 32, + }).substring(4)}`; + } else { + if (options.salt.startsWith("0x") && options.salt.length === 66) { + salt = options.salt; + } else { + salt = `0x1f${keccakId(options.salt).substring(4)}`; + } + } + + const entrypoint = await getOrDeployEntrypointERC20(options); + + let hookData: Hex = "0x"; + let amount = toUnits( + params.maxSupply.toString() || DEFAULT_MAX_SUPPLY_ERC20.toString(), + 18, + ); + if (launchConfig?.kind === "pool") { + hookData = encodePoolConfig(launchConfig.config); + amount = toUnits( + launchConfig.config.amount.toString() || + DEFAULT_MAX_SUPPLY_ERC20.toString(), + 18, + ); + } else if (launchConfig?.kind === "market") { + const currencyContract = + launchConfig.config.tokenOut && + launchConfig.config.tokenOut !== NATIVE_TOKEN_ADDRESS + ? getContract({ + address: launchConfig.config.tokenOut, + chain, + client, + }) + : null; + const currencyDecimals = launchConfig.config.priceDenominator + ? launchConfig.config.priceDenominator + : currencyContract + ? await decimals({ + contract: currencyContract, + }) + : 18; + + hookData = encodeMarketConfig({ + ...launchConfig.config, + decimals: currencyDecimals, + }); + } + + const transaction = createAsset({ + contract: entrypoint, + createParams: { + amount, + data: encodedInitData, + hookData, + referrer: options.referrerAddress || ZERO_ADDRESS, + salt, + }, + creator, + }); + + const receipt = await sendAndConfirmTransaction({ account, transaction }); + const assetEvent = assetCreatedEvent(); + const decodedEvent = parseEventLogs({ + events: [assetEvent], + logs: receipt.logs, + }); + + if (decodedEvent.length === 0 || !decodedEvent[0]) { + throw new Error( + `No AssetCreated event found in transaction: ${receipt.transactionHash}`, + ); + } + + return decodedEvent[0]?.args.asset; +} diff --git a/packages/thirdweb/src/assets/deploy-infra-proxy.ts b/packages/thirdweb/src/assets/deploy-infra-proxy.ts new file mode 100644 index 00000000000..cc18a36ac3d --- /dev/null +++ b/packages/thirdweb/src/assets/deploy-infra-proxy.ts @@ -0,0 +1,44 @@ +import type { Hex } from "viem"; +import type { ThirdwebContract } from "../contract/contract.js"; +import { parseEventLogs } from "../event/actions/parse-logs.js"; +import { assetInfraDeployedEvent } from "../extensions/assets/__generated__/AssetInfraDeployer/events/AssetInfraDeployed.js"; +import { deployInfraProxyDeterministic } from "../extensions/assets/__generated__/AssetInfraDeployer/write/deployInfraProxyDeterministic.js"; +import { sendAndConfirmTransaction } from "../transaction/actions/send-and-confirm-transaction.js"; +import { keccakId } from "../utils/any-evm/keccak-id.js"; +import type { ClientAndChainAndAccount } from "../utils/types.js"; +import { DEFAULT_SALT } from "./constants.js"; + +export async function deployInfraProxy( + options: ClientAndChainAndAccount & { + assetFactory: ThirdwebContract; + implementationAddress: string; + initData: Hex; + extraData: Hex; + }, +) { + const transaction = deployInfraProxyDeterministic({ + contract: options.assetFactory, + data: options.initData, + extraData: options.extraData, + implementation: options.implementationAddress, + salt: keccakId(DEFAULT_SALT), + }); + + const receipt = await sendAndConfirmTransaction({ + account: options.account, + transaction, + }); + const proxyEvent = assetInfraDeployedEvent(); + const decodedEvent = parseEventLogs({ + events: [proxyEvent], + logs: receipt.logs, + }); + + if (decodedEvent.length === 0 || !decodedEvent[0]) { + throw new Error( + `No AssetInfraDeployed event found in transaction: ${receipt.transactionHash}`, + ); + } + + return decodedEvent[0]?.args.proxy; +} diff --git a/packages/thirdweb/src/assets/distribute-token.test.ts b/packages/thirdweb/src/assets/distribute-token.test.ts new file mode 100644 index 00000000000..c399b36d780 --- /dev/null +++ b/packages/thirdweb/src/assets/distribute-token.test.ts @@ -0,0 +1,117 @@ +import { getContract, type ThirdwebContract } from "src/contract/contract.js"; +import { getBalance } from "src/extensions/erc20/read/getBalance.js"; +import { approve } from "src/extensions/erc20/write/approve.js"; +import { sendAndConfirmTransaction } from "src/transaction/actions/send-and-confirm-transaction.js"; +import { toUnits } from "src/utils/units.js"; +import { beforeAll, describe, expect, it } from "vitest"; +import { ANVIL_CHAIN } from "../../test/src/chains.js"; +import { TEST_CLIENT } from "../../test/src/test-clients.js"; +import { + TEST_ACCOUNT_A, + TEST_ACCOUNT_B, + TEST_ACCOUNT_C, + TEST_ACCOUNT_D, +} from "../../test/src/test-wallets.js"; +import { createTokenByImplementationConfig } from "./create-token-by-impl-config.js"; +import { distributeToken } from "./distribute-token.js"; +import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js"; + +describe.runIf(process.env.TW_SECRET_KEY)( + "create token by impl config", + { + timeout: 20000, + }, + () => { + let token: ThirdwebContract; + beforeAll(async () => { + // create token + const tokenAddress = await createTokenByImplementationConfig({ + account: TEST_ACCOUNT_A, + chain: ANVIL_CHAIN, + client: TEST_CLIENT, + params: { + maxSupply: 10_000_000_000n, + name: "Test", + }, + salt: "salt123", + implementationAddress: "0x", + }); + + token = getContract({ + address: tokenAddress, + chain: ANVIL_CHAIN, + client: TEST_CLIENT, + }); + + // approve tokens to entrypoint for distribution + const entrypoint = await getDeployedEntrypointERC20({ + chain: ANVIL_CHAIN, + client: TEST_CLIENT, + }); + + const approvalTx = approve({ + amountWei: toUnits("1000", 18), + contract: token, + spender: entrypoint?.address as string, + }); + await sendAndConfirmTransaction({ + account: TEST_ACCOUNT_A, + transaction: approvalTx, + }); + }, 20000); + + it("should distrbute tokens to specified recipients", async () => { + const contents = [ + { amount: 10n, recipient: TEST_ACCOUNT_B.address }, + { amount: 15n, recipient: TEST_ACCOUNT_C.address }, + { amount: 20n, recipient: TEST_ACCOUNT_D.address }, + ]; + + const transaction = await distributeToken({ + chain: ANVIL_CHAIN, + client: TEST_CLIENT, + contents, + tokenAddress: token.address, + }); + + await sendAndConfirmTransaction({ account: TEST_ACCOUNT_A, transaction }); + + const balanceB = ( + await getBalance({ + address: TEST_ACCOUNT_B.address, + contract: token, + }) + ).value; + + const balanceC = ( + await getBalance({ + address: TEST_ACCOUNT_C.address, + contract: token, + }) + ).value; + + const balanceD = ( + await getBalance({ + address: TEST_ACCOUNT_D.address, + contract: token, + }) + ).value; + + // admin balance + const balanceA = ( + await getBalance({ + address: TEST_ACCOUNT_A.address, + contract: token, + }) + ).value; + + expect(balanceB).to.equal(toUnits("10", 18)); + expect(balanceC).to.equal(toUnits("15", 18)); + expect(balanceD).to.equal(toUnits("20", 18)); + + expect(balanceA).to.equal( + toUnits("10000000000", 18) - balanceB - balanceC - balanceD, + ); + }); + }, +); diff --git a/packages/thirdweb/src/assets/distribute-token.ts b/packages/thirdweb/src/assets/distribute-token.ts new file mode 100644 index 00000000000..93a37d87111 --- /dev/null +++ b/packages/thirdweb/src/assets/distribute-token.ts @@ -0,0 +1,26 @@ +import { distributeAsset } from "../extensions/assets/__generated__/ERC20AssetEntrypoint/write/distributeAsset.js"; +import type { ClientAndChain } from "../utils/types.js"; +import { toUnits } from "../utils/units.js"; +import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js"; +import type { DistributeContent } from "./types.js"; + +type DistrbuteTokenParams = ClientAndChain & { + tokenAddress: string; + contents: DistributeContent[]; +}; + +export async function distributeToken(options: DistrbuteTokenParams) { + const entrypoint = await getDeployedEntrypointERC20(options); + + if (!entrypoint) { + throw new Error(`Entrypoint not found on chain: ${options.chain.id}`); + } + + return distributeAsset({ + asset: options.tokenAddress, + contents: options.contents.map((a) => { + return { ...a, amount: toUnits(a.amount.toString(), 18) }; + }), + contract: entrypoint, + }); +} diff --git a/packages/thirdweb/src/assets/get-entrypoint-erc20.ts b/packages/thirdweb/src/assets/get-entrypoint-erc20.ts new file mode 100644 index 00000000000..b95d28397bc --- /dev/null +++ b/packages/thirdweb/src/assets/get-entrypoint-erc20.ts @@ -0,0 +1,39 @@ +import { getContract, type ThirdwebContract } from "../contract/contract.js"; +import type { + ClientAndChain, + ClientAndChainAndAccount, +} from "../utils/types.js"; +import { + IMPLEMENTATIONS, +} from "./constants.js"; + +export async function getOrDeployEntrypointERC20( + options: ClientAndChainAndAccount, +): Promise { + const implementations = IMPLEMENTATIONS[options.chain.id]; + + if (implementations?.AssetEntrypointERC20) { + return getContract({ + address: implementations.AssetEntrypointERC20, + chain: options.chain, + client: options.client, + }); + } + + // TODO: Dynamically deploy asset factory if not already deployed + throw new Error("Asset factory deployment is not deployed yet."); +} + +export async function getDeployedEntrypointERC20(options: ClientAndChain) { + const implementations = IMPLEMENTATIONS[options.chain.id]; + + if (implementations?.AssetEntrypointERC20) { + return getContract({ + address: implementations.AssetEntrypointERC20, + chain: options.chain, + client: options.client, + }); + } + + throw new Error("Asset factory deployment is not deployed yet."); +} diff --git a/packages/thirdweb/src/assets/get-erc20-asset-impl.ts b/packages/thirdweb/src/assets/get-erc20-asset-impl.ts new file mode 100644 index 00000000000..a01d410b08e --- /dev/null +++ b/packages/thirdweb/src/assets/get-erc20-asset-impl.ts @@ -0,0 +1,24 @@ +import { getContract, type ThirdwebContract } from "../contract/contract.js"; +import { getOrDeployInfraContract } from "../contract/deployment/utils/bootstrap.js"; +import type { ClientAndChainAndAccount } from "../utils/types.js"; +import { IMPLEMENTATIONS } from "./constants.js"; + +export async function getOrDeployERC20AssetImpl( + options: ClientAndChainAndAccount, +): Promise { + const implementations = IMPLEMENTATIONS[options.chain.id]; + + if (implementations?.ERC20AssetImpl) { + return getContract({ + address: implementations.ERC20AssetImpl, + chain: options.chain, + client: options.client, + }); + } + + return await getOrDeployInfraContract({ + ...options, + contractId: "ERC20Asset", + publisher: "0x6453a486d52e0EB6E79Ec4491038E2522a926936", + }); +} diff --git a/packages/thirdweb/src/assets/get-initcode-hash-1967.ts b/packages/thirdweb/src/assets/get-initcode-hash-1967.ts new file mode 100644 index 00000000000..d1b3bd3e50a --- /dev/null +++ b/packages/thirdweb/src/assets/get-initcode-hash-1967.ts @@ -0,0 +1,8 @@ +import { keccak256 } from "../utils/hashing/keccak256.js"; + +export function getInitCodeHashERC1967(implementation: string) { + // See `initCodeHashERC1967` - LibClone {https://github.com/vectorized/solady/blob/main/src/utils/LibClone.sol} + return keccak256( + `0x603d3d8160223d3973${implementation.toLowerCase().replace(/^0x/, "")}60095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3`, + ); +} diff --git a/packages/thirdweb/src/assets/is-router-enabled.ts b/packages/thirdweb/src/assets/is-router-enabled.ts new file mode 100644 index 00000000000..5da30b4cc34 --- /dev/null +++ b/packages/thirdweb/src/assets/is-router-enabled.ts @@ -0,0 +1,20 @@ +import { ZERO_ADDRESS } from "../constants/addresses.js"; +import { getRouter } from "../extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRouter.js"; +import type { ClientAndChain } from "../utils/types.js"; +import { getDeployedEntrypointERC20 } from "./get-entrypoint-erc20.js"; + +export async function isRouterEnabled( + options: ClientAndChain, +): Promise { + const entrypoint = await getDeployedEntrypointERC20(options); + + if (!entrypoint) { + return false; + } + + const router = await getRouter({ + contract: entrypoint, + }); + + return router !== ZERO_ADDRESS; +} diff --git a/packages/thirdweb/src/assets/token-utils.ts b/packages/thirdweb/src/assets/token-utils.ts new file mode 100644 index 00000000000..9f8cafaf538 --- /dev/null +++ b/packages/thirdweb/src/assets/token-utils.ts @@ -0,0 +1,122 @@ +import type { Hex } from "viem"; +import type { ThirdwebClient } from "../client/client.js"; +import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS } from "../constants/addresses.js"; +import { encodeInitialize } from "../extensions/assets/__generated__/ERC20Asset/write/initialize.js"; +import { upload } from "../storage/upload.js"; +import { encodeAbiParameters } from "../utils/abi/encodeAbiParameters.js"; +import { toUnits } from "../utils/units.js"; +import { + DEFAULT_MAX_SUPPLY_ERC20, + DEFAULT_POOL_INITIAL_TICK, + DEFAULT_REFERRER_REWARD_BPS, +} from "./constants.js"; +import type { MarketConfig, PoolConfig, TokenParams } from "./types.js"; + +export async function encodeInitParams(options: { + client: ThirdwebClient; + params: TokenParams; + creator: string; +}): Promise { + const { client, params, creator } = options; + + const contractURI = + options.params.contractURI || + (await upload({ + client, + files: [ + { + description: params.description, + external_link: params.external_link, + image: params.image, + name: params.name, + social_urls: params.social_urls, + symbol: params.symbol, + }, + ], + })) || + ""; + + return encodeInitialize({ + contractURI, + maxSupply: toUnits( + params.maxSupply.toString() || DEFAULT_MAX_SUPPLY_ERC20.toString(), + 18, + ), + name: params.name, + owner: creator, + symbol: params.symbol || params.name, + }); +} + +export function encodePoolConfig(poolConfig: PoolConfig): Hex { + const POOL_PARAMS = [ + { + name: "amount", + type: "uint256", + }, + { + name: "currency", + type: "address", + }, + { + name: "initialTick", + type: "int24", + }, + { + name: "referrerRewardBps", + type: "uint16", + }, + ] as const; + + return encodeAbiParameters(POOL_PARAMS, [ + toUnits(poolConfig.amount.toString(), 18), + poolConfig.currency || NATIVE_TOKEN_ADDRESS, + poolConfig.initialTick || DEFAULT_POOL_INITIAL_TICK, + poolConfig.referrerRewardBps || DEFAULT_REFERRER_REWARD_BPS, + ]); +} + +export function encodeMarketConfig( + marketConfig: MarketConfig & { decimals: number }, +): Hex { + const MARKET_PARAMS = [ + { + name: "tokenOut", + type: "address", + }, + { + name: "pricePerUnit", + type: "uint256", + }, + { + name: "priceDenominator", + type: "uint8", + }, + { + name: "startTime", + type: "uint48", + }, + { + name: "endTime", + type: "uint48", + }, + { + name: "hook", + type: "address", + }, + { + name: "hookInit", + type: "bytes", + }, + ] as const; + + return encodeAbiParameters(MARKET_PARAMS, [ + marketConfig.tokenOut || NATIVE_TOKEN_ADDRESS, + marketConfig.pricePerUnit, + marketConfig.priceDenominator || marketConfig.decimals || 18, + marketConfig.startTime || 0, + marketConfig.endTime || 0, + ZERO_ADDRESS, + "0x", + ]); +} diff --git a/packages/thirdweb/src/assets/types.ts b/packages/thirdweb/src/assets/types.ts new file mode 100644 index 00000000000..8953c67e7ee --- /dev/null +++ b/packages/thirdweb/src/assets/types.ts @@ -0,0 +1,57 @@ +import type { Hex } from "viem"; +import type { FileOrBufferOrString } from "../storage/upload/types.js"; +import type { ClientAndChainAndAccount } from "../utils/types.js"; + +export type TokenParams = { + name: string; + description?: string; + image?: FileOrBufferOrString; + external_link?: string; + social_urls?: Record; + symbol?: string; + contractURI?: string; + maxSupply: bigint; + owner?: string; +}; + +export type PoolConfig = { + amount: bigint; + currency?: string; + initialTick?: number; + referrerRewardBps?: number; +}; + +export type MarketConfig = { + tokenOut?: string; + pricePerUnit: bigint; + priceDenominator?: number; + startTime?: number; + endTime?: number; + hookAddress?: string; + hookInitData?: string; +}; + +export type DistributeContent = { + amount: bigint; + recipient: string; +}; + +type DistributeConfig = { + content: DistributeContent[]; +}; + +type LaunchConfig = + | { kind: "pool"; config: PoolConfig } + | { kind: "market"; config: MarketConfig } + | { kind: "distribute"; config: DistributeConfig }; + +export type CreateTokenOptions = ClientAndChainAndAccount & { + salt?: Hex; + params: TokenParams; + launchConfig?: LaunchConfig; + referrerAddress?: string; +}; + +export type CreateTokenByImplementationConfigOptions = ClientAndChainAndAccount & CreateTokenOptions & { + implementationAddress: string; +}; diff --git a/packages/thirdweb/src/exports/assets.ts b/packages/thirdweb/src/exports/assets.ts new file mode 100644 index 00000000000..8235d844fcf --- /dev/null +++ b/packages/thirdweb/src/exports/assets.ts @@ -0,0 +1,13 @@ +export { createToken } from "../assets/create-token.js"; +export { createTokenByImplementationConfig } from "../assets/create-token-by-impl-config.js"; +export { distributeToken } from "../assets/distribute-token.js"; +export { getDeployedEntrypointERC20 } from "../assets/get-entrypoint-erc20.js"; +export { isRouterEnabled } from "../assets/is-router-enabled.js"; +export type { + CreateTokenOptions, + CreateTokenByImplementationConfigOptions, + DistributeContent, + MarketConfig, + PoolConfig, + TokenParams, +} from "../assets/types.js"; diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/events/OwnerUpdated.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/events/OwnerUpdated.ts index 0f9bbb7c89a..f256c499527 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/events/OwnerUpdated.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/events/OwnerUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "OwnerUpdated" event. @@ -40,8 +40,8 @@ export type OwnerUpdatedEventFilters = Partial<{ */ export function ownerUpdatedEvent(filters: OwnerUpdatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event OwnerUpdated(address indexed prevOwner, address indexed newOwner)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/eip712Domain.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/eip712Domain.ts index 896cf83855c..0f3e6933df7 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/eip712Domain.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/eip712Domain.ts @@ -1,39 +1,40 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x84b0196e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "fields", type: "bytes1", + name: "fields", }, { - name: "name", type: "string", + name: "name", }, { - name: "version", type: "string", + name: "version", }, { - name: "chainId", type: "uint256", + name: "chainId", }, { - name: "verifyingContract", type: "address", + name: "verifyingContract", }, { - name: "salt", type: "bytes32", + name: "salt", }, { - name: "extensions", type: "uint256[]", + name: "extensions", }, ] as const; diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/isClaimed.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/isClaimed.ts index 3bd9646dbe2..4ead09e35b3 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/isClaimed.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/isClaimed.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isClaimed" function. @@ -18,16 +18,16 @@ export type IsClaimedParams = { export const FN_SELECTOR = "0xd12acf73" as const; const FN_INPUTS = [ { - name: "_receiver", type: "address", + name: "_receiver", }, { - name: "_token", type: "address", + name: "_token", }, { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/owner.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/owner.ts index eb5900f0f41..eee9df78552 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/owner.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/owner.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x8da5cb5b" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenConditionId.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenConditionId.ts index 2bd9a328687..fa0dfaf9998 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenConditionId.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenConditionId.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenConditionId" function. @@ -19,8 +19,8 @@ export type TokenConditionIdParams = { export const FN_SELECTOR = "0x3dc28d49" as const; const FN_INPUTS = [ { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenMerkleRoot.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenMerkleRoot.ts index 770d310d660..cf0f7ee9db1 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenMerkleRoot.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/read/tokenMerkleRoot.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenMerkleRoot" function. @@ -19,8 +19,8 @@ export type TokenMerkleRootParams = { export const FN_SELECTOR = "0x95f5c120" as const; const FN_INPUTS = [ { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155.ts index bd6efbf659d..e7d492f3570 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC1155" function. @@ -30,26 +30,26 @@ export type AirdropERC1155Params = WithOverrides<{ export const FN_SELECTOR = "0x2d89e38b" as const; const FN_INPUTS = [ { - name: "_tokenAddress", type: "address", + name: "_tokenAddress", }, { + type: "tuple[]", + name: "_contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "_contents", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -153,23 +153,23 @@ export function airdropERC1155( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenAddress, resolvedOptions.contents] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155WithSignature.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155WithSignature.ts index 5a726f92b7e..f3dfb2d6509 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155WithSignature.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC1155WithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC1155WithSignature" function. @@ -36,44 +36,44 @@ export type AirdropERC1155WithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0xd0d4afd6" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "uid", type: "bytes32", + name: "uid", }, { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, { - name: "expirationTimestamp", type: "uint256", + name: "expirationTimestamp", }, { + type: "tuple[]", + name: "contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "contents", - type: "tuple[]", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -180,23 +180,23 @@ export function airdropERC1155WithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.req, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20.ts index 941d0cbfc9a..fa9bd57d7f7 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC20" function. @@ -29,22 +29,22 @@ export type AirdropERC20Params = WithOverrides<{ export const FN_SELECTOR = "0x56b0b449" as const; const FN_INPUTS = [ { - name: "_tokenAddress", type: "address", + name: "_tokenAddress", }, { + type: "tuple[]", + name: "_contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "_contents", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -148,23 +148,23 @@ export function airdropERC20( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenAddress, resolvedOptions.contents] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20WithSignature.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20WithSignature.ts index e2c906fb5b6..23bf45ea43f 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20WithSignature.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC20WithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC20WithSignature" function. @@ -35,40 +35,40 @@ export type AirdropERC20WithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0xaaba07f6" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "uid", type: "bytes32", + name: "uid", }, { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, { - name: "expirationTimestamp", type: "uint256", + name: "expirationTimestamp", }, { + type: "tuple[]", + name: "contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "contents", - type: "tuple[]", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -175,23 +175,23 @@ export function airdropERC20WithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.req, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721.ts index 9645483e334..0ee231575e2 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC721" function. @@ -29,22 +29,22 @@ export type AirdropERC721Params = WithOverrides<{ export const FN_SELECTOR = "0x6d582ebe" as const; const FN_INPUTS = [ { - name: "_tokenAddress", type: "address", + name: "_tokenAddress", }, { + type: "tuple[]", + name: "_contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ], - name: "_contents", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -148,23 +148,23 @@ export function airdropERC721( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenAddress, resolvedOptions.contents] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721WithSignature.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721WithSignature.ts index ac6a84f3ce4..303a8d546b6 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721WithSignature.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropERC721WithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC721WithSignature" function. @@ -35,40 +35,40 @@ export type AirdropERC721WithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0xb654a6f3" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "uid", type: "bytes32", + name: "uid", }, { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, { - name: "expirationTimestamp", type: "uint256", + name: "expirationTimestamp", }, { + type: "tuple[]", + name: "contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ], - name: "contents", - type: "tuple[]", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -175,23 +175,23 @@ export function airdropERC721WithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.req, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropNativeToken.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropNativeToken.ts index 65534cf1849..0f24fc95697 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropNativeToken.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/airdropNativeToken.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropNativeToken" function. @@ -25,18 +25,18 @@ export type AirdropNativeTokenParams = WithOverrides<{ export const FN_SELECTOR = "0x0d5818f7" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "_contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "_contents", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -136,23 +136,23 @@ export function airdropNativeToken( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.contents] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC1155.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC1155.ts index 1ae536a592f..80eb7e26bc7 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC1155.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC1155.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claimERC1155" function. @@ -22,24 +22,24 @@ export type ClaimERC1155Params = WithOverrides<{ export const FN_SELECTOR = "0xc6fa26ab" as const; const FN_INPUTS = [ { - name: "_token", type: "address", + name: "_token", }, { - name: "_receiver", type: "address", + name: "_receiver", }, { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, { - name: "_proofs", type: "bytes32[]", + name: "_proofs", }, ] as const; const FN_OUTPUTS = [] as const; @@ -155,19 +155,8 @@ export function claimERC1155( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -179,5 +168,16 @@ export function claimERC1155( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC20.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC20.ts index a2c0c7bcb5e..ba5895a0c69 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC20.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC20.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claimERC20" function. @@ -21,20 +21,20 @@ export type ClaimERC20Params = WithOverrides<{ export const FN_SELECTOR = "0xecf3d3d4" as const; const FN_INPUTS = [ { - name: "_token", type: "address", + name: "_token", }, { - name: "_receiver", type: "address", + name: "_receiver", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, { - name: "_proofs", type: "bytes32[]", + name: "_proofs", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,19 +146,8 @@ export function claimERC20( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -169,5 +158,16 @@ export function claimERC20( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC721.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC721.ts index 49d0b1720f8..c14bfa26737 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC721.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/claimERC721.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claimERC721" function. @@ -21,20 +21,20 @@ export type ClaimERC721Params = WithOverrides<{ export const FN_SELECTOR = "0x1290be10" as const; const FN_INPUTS = [ { - name: "_token", type: "address", + name: "_token", }, { - name: "_receiver", type: "address", + name: "_receiver", }, { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_proofs", type: "bytes32[]", + name: "_proofs", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,19 +146,8 @@ export function claimERC721( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -169,5 +158,16 @@ export function claimERC721( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/initialize.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/initialize.ts index 32cb05823bb..f835779317c 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/initialize.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -21,8 +21,8 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xc4d66de8" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.defaultAdmin] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setMerkleRoot.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setMerkleRoot.ts index ade70c41f0c..a9efda55328 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setMerkleRoot.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setMerkleRoot.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setMerkleRoot" function. @@ -26,16 +26,16 @@ export type SetMerkleRootParams = WithOverrides<{ export const FN_SELECTOR = "0x8259a87b" as const; const FN_INPUTS = [ { - name: "_token", type: "address", + name: "_token", }, { - name: "_tokenMerkleRoot", type: "bytes32", + name: "_tokenMerkleRoot", }, { - name: "_resetClaimStatus", type: "bool", + name: "_resetClaimStatus", }, ] as const; const FN_OUTPUTS = [] as const; @@ -143,19 +143,8 @@ export function setMerkleRoot( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -165,5 +154,16 @@ export function setMerkleRoot( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setOwner.ts b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setOwner.ts index 95f071a6d30..b432dc441f4 100644 --- a/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setOwner.ts +++ b/packages/thirdweb/src/extensions/airdrop/__generated__/Airdrop/write/setOwner.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setOwner" function. @@ -18,8 +18,8 @@ export type SetOwnerParams = WithOverrides<{ export const FN_SELECTOR = "0x13af4035" as const; const FN_INPUTS = [ { - name: "_newOwner", type: "address", + name: "_newOwner", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function setOwner( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newOwner] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/assets/__generated__/AssetInfraDeployer/events/AssetInfraDeployed.ts b/packages/thirdweb/src/extensions/assets/__generated__/AssetInfraDeployer/events/AssetInfraDeployed.ts new file mode 100644 index 00000000000..9eabdaeaaa7 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/AssetInfraDeployer/events/AssetInfraDeployed.ts @@ -0,0 +1,49 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "AssetInfraDeployed" event. + */ +export type AssetInfraDeployedEventFilters = Partial<{ + implementation: AbiParameterToPrimitiveType<{ + type: "address"; + name: "implementation"; + indexed: true; + }>; + proxy: AbiParameterToPrimitiveType<{ + type: "address"; + name: "proxy"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the AssetInfraDeployed event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { assetInfraDeployedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * assetInfraDeployedEvent({ + * implementation: ..., + * proxy: ..., + * }) + * ], + * }); + * ``` + */ +export function assetInfraDeployedEvent( + filters: AssetInfraDeployedEventFilters = {}, +) { + return prepareEvent({ + signature: + "event AssetInfraDeployed(address indexed implementation, address indexed proxy, bytes32 inputSalt, bytes data, bytes extraData)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/AssetInfraDeployer/write/deployInfraProxyDeterministic.ts b/packages/thirdweb/src/extensions/assets/__generated__/AssetInfraDeployer/write/deployInfraProxyDeterministic.ts new file mode 100644 index 00000000000..437686f8a5b --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/AssetInfraDeployer/write/deployInfraProxyDeterministic.ts @@ -0,0 +1,187 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "deployInfraProxyDeterministic" function. + */ +export type DeployInfraProxyDeterministicParams = WithOverrides<{ + implementation: AbiParameterToPrimitiveType<{ + type: "address"; + name: "implementation"; + }>; + data: AbiParameterToPrimitiveType<{ type: "bytes"; name: "data" }>; + salt: AbiParameterToPrimitiveType<{ type: "bytes32"; name: "salt" }>; + extraData: AbiParameterToPrimitiveType<{ type: "bytes"; name: "extraData" }>; +}>; + +export const FN_SELECTOR = "0xb43c830c" as const; +const FN_INPUTS = [ + { + type: "address", + name: "implementation", + }, + { + type: "bytes", + name: "data", + }, + { + type: "bytes32", + name: "salt", + }, + { + type: "bytes", + name: "extraData", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "deployedProxy", + }, +] as const; + +/** + * Checks if the `deployInfraProxyDeterministic` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `deployInfraProxyDeterministic` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isDeployInfraProxyDeterministicSupported } from "thirdweb/extensions/assets"; + * + * const supported = isDeployInfraProxyDeterministicSupported(["0x..."]); + * ``` + */ +export function isDeployInfraProxyDeterministicSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "deployInfraProxyDeterministic" function. + * @param options - The options for the deployInfraProxyDeterministic function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeDeployInfraProxyDeterministicParams } from "thirdweb/extensions/assets"; + * const result = encodeDeployInfraProxyDeterministicParams({ + * implementation: ..., + * data: ..., + * salt: ..., + * extraData: ..., + * }); + * ``` + */ +export function encodeDeployInfraProxyDeterministicParams( + options: DeployInfraProxyDeterministicParams, +) { + return encodeAbiParameters(FN_INPUTS, [ + options.implementation, + options.data, + options.salt, + options.extraData, + ]); +} + +/** + * Encodes the "deployInfraProxyDeterministic" function into a Hex string with its parameters. + * @param options - The options for the deployInfraProxyDeterministic function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeDeployInfraProxyDeterministic } from "thirdweb/extensions/assets"; + * const result = encodeDeployInfraProxyDeterministic({ + * implementation: ..., + * data: ..., + * salt: ..., + * extraData: ..., + * }); + * ``` + */ +export function encodeDeployInfraProxyDeterministic( + options: DeployInfraProxyDeterministicParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeDeployInfraProxyDeterministicParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "deployInfraProxyDeterministic" function on the contract. + * @param options - The options for the "deployInfraProxyDeterministic" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { deployInfraProxyDeterministic } from "thirdweb/extensions/assets"; + * + * const transaction = deployInfraProxyDeterministic({ + * contract, + * implementation: ..., + * data: ..., + * salt: ..., + * extraData: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function deployInfraProxyDeterministic( + options: BaseTransactionOptions< + | DeployInfraProxyDeterministicParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.implementation, + resolvedOptions.data, + resolvedOptions.salt, + resolvedOptions.extraData, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Approval.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Approval.ts new file mode 100644 index 00000000000..c163264f500 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Approval.ts @@ -0,0 +1,47 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "Approval" event. + */ +export type ApprovalEventFilters = Partial<{ + owner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "owner"; + indexed: true; + }>; + spender: AbiParameterToPrimitiveType<{ + type: "address"; + name: "spender"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the Approval event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { approvalEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * approvalEvent({ + * owner: ..., + * spender: ..., + * }) + * ], + * }); + * ``` + */ +export function approvalEvent(filters: ApprovalEventFilters = {}) { + return prepareEvent({ + signature: + "event Approval(address indexed owner, address indexed spender, uint256 amount)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/ContractURIUpdated.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/ContractURIUpdated.ts new file mode 100644 index 00000000000..16611ea0bd1 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/ContractURIUpdated.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the ContractURIUpdated event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { contractURIUpdatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * contractURIUpdatedEvent() + * ], + * }); + * ``` + */ +export function contractURIUpdatedEvent() { + return prepareEvent({ + signature: "event ContractURIUpdated()", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Initialized.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Initialized.ts new file mode 100644 index 00000000000..88705c10a63 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Initialized.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the Initialized event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { initializedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * initializedEvent() + * ], + * }); + * ``` + */ +export function initializedEvent() { + return prepareEvent({ + signature: "event Initialized(uint64 version)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipHandoverCanceled.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipHandoverCanceled.ts new file mode 100644 index 00000000000..2ab8996b8d3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipHandoverCanceled.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverCanceled" event. + */ +export type OwnershipHandoverCanceledEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverCanceled event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverCanceledEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverCanceledEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverCanceledEvent( + filters: OwnershipHandoverCanceledEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverCanceled(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipHandoverRequested.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipHandoverRequested.ts new file mode 100644 index 00000000000..a498506409a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipHandoverRequested.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverRequested" event. + */ +export type OwnershipHandoverRequestedEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverRequested event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverRequestedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverRequestedEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverRequestedEvent( + filters: OwnershipHandoverRequestedEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverRequested(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipTransferred.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipTransferred.ts new file mode 100644 index 00000000000..b1be6e750e1 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/OwnershipTransferred.ts @@ -0,0 +1,49 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipTransferred" event. + */ +export type OwnershipTransferredEventFilters = Partial<{ + oldOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "oldOwner"; + indexed: true; + }>; + newOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "newOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipTransferred event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipTransferredEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipTransferredEvent({ + * oldOwner: ..., + * newOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipTransferredEvent( + filters: OwnershipTransferredEventFilters = {}, +) { + return prepareEvent({ + signature: + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Transfer.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Transfer.ts new file mode 100644 index 00000000000..966872e8e8e --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/events/Transfer.ts @@ -0,0 +1,47 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "Transfer" event. + */ +export type TransferEventFilters = Partial<{ + from: AbiParameterToPrimitiveType<{ + type: "address"; + name: "from"; + indexed: true; + }>; + to: AbiParameterToPrimitiveType<{ + type: "address"; + name: "to"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the Transfer event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { transferEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * transferEvent({ + * from: ..., + * to: ..., + * }) + * ], + * }); + * ``` + */ +export function transferEvent(filters: TransferEventFilters = {}) { + return prepareEvent({ + signature: + "event Transfer(address indexed from, address indexed to, uint256 amount)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/DOMAIN_SEPARATOR.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/DOMAIN_SEPARATOR.ts new file mode 100644 index 00000000000..9d4decaf62a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/DOMAIN_SEPARATOR.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x3644e515" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "bytes32", + name: "result", + }, +] as const; + +/** + * Checks if the `DOMAIN_SEPARATOR` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `DOMAIN_SEPARATOR` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isDOMAIN_SEPARATORSupported } from "thirdweb/extensions/assets"; + * const supported = isDOMAIN_SEPARATORSupported(["0x..."]); + * ``` + */ +export function isDOMAIN_SEPARATORSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the DOMAIN_SEPARATOR function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeDOMAIN_SEPARATORResult } from "thirdweb/extensions/assets"; + * const result = decodeDOMAIN_SEPARATORResultResult("..."); + * ``` + */ +export function decodeDOMAIN_SEPARATORResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "DOMAIN_SEPARATOR" function on the contract. + * @param options - The options for the DOMAIN_SEPARATOR function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { DOMAIN_SEPARATOR } from "thirdweb/extensions/assets"; + * + * const result = await DOMAIN_SEPARATOR({ + * contract, + * }); + * + * ``` + */ +export async function DOMAIN_SEPARATOR(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/allowance.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/allowance.ts new file mode 100644 index 00000000000..8ce23927dd8 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/allowance.ts @@ -0,0 +1,134 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "allowance" function. + */ +export type AllowanceParams = { + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner" }>; + spender: AbiParameterToPrimitiveType<{ type: "address"; name: "spender" }>; +}; + +export const FN_SELECTOR = "0xdd62ed3e" as const; +const FN_INPUTS = [ + { + type: "address", + name: "owner", + }, + { + type: "address", + name: "spender", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `allowance` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `allowance` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isAllowanceSupported } from "thirdweb/extensions/assets"; + * const supported = isAllowanceSupported(["0x..."]); + * ``` + */ +export function isAllowanceSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "allowance" function. + * @param options - The options for the allowance function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeAllowanceParams } from "thirdweb/extensions/assets"; + * const result = encodeAllowanceParams({ + * owner: ..., + * spender: ..., + * }); + * ``` + */ +export function encodeAllowanceParams(options: AllowanceParams) { + return encodeAbiParameters(FN_INPUTS, [options.owner, options.spender]); +} + +/** + * Encodes the "allowance" function into a Hex string with its parameters. + * @param options - The options for the allowance function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeAllowance } from "thirdweb/extensions/assets"; + * const result = encodeAllowance({ + * owner: ..., + * spender: ..., + * }); + * ``` + */ +export function encodeAllowance(options: AllowanceParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeAllowanceParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the allowance function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeAllowanceResult } from "thirdweb/extensions/assets"; + * const result = decodeAllowanceResultResult("..."); + * ``` + */ +export function decodeAllowanceResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "allowance" function on the contract. + * @param options - The options for the allowance function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { allowance } from "thirdweb/extensions/assets"; + * + * const result = await allowance({ + * contract, + * owner: ..., + * spender: ..., + * }); + * + * ``` + */ +export async function allowance( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.owner, options.spender], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/balanceOf.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/balanceOf.ts new file mode 100644 index 00000000000..94ad6c49f8c --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/balanceOf.ts @@ -0,0 +1,126 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "balanceOf" function. + */ +export type BalanceOfParams = { + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner" }>; +}; + +export const FN_SELECTOR = "0x70a08231" as const; +const FN_INPUTS = [ + { + type: "address", + name: "owner", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `balanceOf` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `balanceOf` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isBalanceOfSupported } from "thirdweb/extensions/assets"; + * const supported = isBalanceOfSupported(["0x..."]); + * ``` + */ +export function isBalanceOfSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "balanceOf" function. + * @param options - The options for the balanceOf function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeBalanceOfParams } from "thirdweb/extensions/assets"; + * const result = encodeBalanceOfParams({ + * owner: ..., + * }); + * ``` + */ +export function encodeBalanceOfParams(options: BalanceOfParams) { + return encodeAbiParameters(FN_INPUTS, [options.owner]); +} + +/** + * Encodes the "balanceOf" function into a Hex string with its parameters. + * @param options - The options for the balanceOf function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeBalanceOf } from "thirdweb/extensions/assets"; + * const result = encodeBalanceOf({ + * owner: ..., + * }); + * ``` + */ +export function encodeBalanceOf(options: BalanceOfParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeBalanceOfParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the balanceOf function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeBalanceOfResult } from "thirdweb/extensions/assets"; + * const result = decodeBalanceOfResultResult("..."); + * ``` + */ +export function decodeBalanceOfResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "balanceOf" function on the contract. + * @param options - The options for the balanceOf function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { balanceOf } from "thirdweb/extensions/assets"; + * + * const result = await balanceOf({ + * contract, + * owner: ..., + * }); + * + * ``` + */ +export async function balanceOf( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.owner], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/contractURI.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/contractURI.ts new file mode 100644 index 00000000000..b6823beee40 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/contractURI.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0xe8a3d485" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "string", + }, +] as const; + +/** + * Checks if the `contractURI` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `contractURI` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isContractURISupported } from "thirdweb/extensions/assets"; + * const supported = isContractURISupported(["0x..."]); + * ``` + */ +export function isContractURISupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the contractURI function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeContractURIResult } from "thirdweb/extensions/assets"; + * const result = decodeContractURIResultResult("..."); + * ``` + */ +export function decodeContractURIResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "contractURI" function on the contract. + * @param options - The options for the contractURI function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { contractURI } from "thirdweb/extensions/assets"; + * + * const result = await contractURI({ + * contract, + * }); + * + * ``` + */ +export async function contractURI(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/decimals.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/decimals.ts new file mode 100644 index 00000000000..5df67764e49 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/decimals.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x313ce567" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "uint8", + }, +] as const; + +/** + * Checks if the `decimals` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `decimals` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isDecimalsSupported } from "thirdweb/extensions/assets"; + * const supported = isDecimalsSupported(["0x..."]); + * ``` + */ +export function isDecimalsSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the decimals function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeDecimalsResult } from "thirdweb/extensions/assets"; + * const result = decodeDecimalsResultResult("..."); + * ``` + */ +export function decodeDecimalsResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "decimals" function on the contract. + * @param options - The options for the decimals function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { decimals } from "thirdweb/extensions/assets"; + * + * const result = await decimals({ + * contract, + * }); + * + * ``` + */ +export async function decimals(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/name.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/name.ts new file mode 100644 index 00000000000..6fd19af5893 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/name.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x06fdde03" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "string", + }, +] as const; + +/** + * Checks if the `name` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `name` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isNameSupported } from "thirdweb/extensions/assets"; + * const supported = isNameSupported(["0x..."]); + * ``` + */ +export function isNameSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the name function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeNameResult } from "thirdweb/extensions/assets"; + * const result = decodeNameResultResult("..."); + * ``` + */ +export function decodeNameResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "name" function on the contract. + * @param options - The options for the name function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { name } from "thirdweb/extensions/assets"; + * + * const result = await name({ + * contract, + * }); + * + * ``` + */ +export async function name(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/nonces.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/nonces.ts new file mode 100644 index 00000000000..4594b063bd0 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/nonces.ts @@ -0,0 +1,122 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "nonces" function. + */ +export type NoncesParams = { + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner" }>; +}; + +export const FN_SELECTOR = "0x7ecebe00" as const; +const FN_INPUTS = [ + { + type: "address", + name: "owner", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `nonces` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `nonces` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isNoncesSupported } from "thirdweb/extensions/assets"; + * const supported = isNoncesSupported(["0x..."]); + * ``` + */ +export function isNoncesSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "nonces" function. + * @param options - The options for the nonces function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeNoncesParams } from "thirdweb/extensions/assets"; + * const result = encodeNoncesParams({ + * owner: ..., + * }); + * ``` + */ +export function encodeNoncesParams(options: NoncesParams) { + return encodeAbiParameters(FN_INPUTS, [options.owner]); +} + +/** + * Encodes the "nonces" function into a Hex string with its parameters. + * @param options - The options for the nonces function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeNonces } from "thirdweb/extensions/assets"; + * const result = encodeNonces({ + * owner: ..., + * }); + * ``` + */ +export function encodeNonces(options: NoncesParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeNoncesParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the nonces function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeNoncesResult } from "thirdweb/extensions/assets"; + * const result = decodeNoncesResultResult("..."); + * ``` + */ +export function decodeNoncesResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "nonces" function on the contract. + * @param options - The options for the nonces function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { nonces } from "thirdweb/extensions/assets"; + * + * const result = await nonces({ + * contract, + * owner: ..., + * }); + * + * ``` + */ +export async function nonces(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.owner], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/owner.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/owner.ts new file mode 100644 index 00000000000..9903177bd12 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/owner.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x8da5cb5b" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "result", + }, +] as const; + +/** + * Checks if the `owner` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `owner` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnerSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnerSupported(["0x..."]); + * ``` + */ +export function isOwnerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the owner function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnerResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnerResultResult("..."); + * ``` + */ +export function decodeOwnerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "owner" function on the contract. + * @param options - The options for the owner function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { owner } from "thirdweb/extensions/assets"; + * + * const result = await owner({ + * contract, + * }); + * + * ``` + */ +export async function owner(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/ownershipHandoverExpiresAt.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/ownershipHandoverExpiresAt.ts new file mode 100644 index 00000000000..5625095f262 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/ownershipHandoverExpiresAt.ts @@ -0,0 +1,135 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "ownershipHandoverExpiresAt" function. + */ +export type OwnershipHandoverExpiresAtParams = { + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}; + +export const FN_SELECTOR = "0xfee81cf4" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `ownershipHandoverExpiresAt` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `ownershipHandoverExpiresAt` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnershipHandoverExpiresAtSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnershipHandoverExpiresAtSupported(["0x..."]); + * ``` + */ +export function isOwnershipHandoverExpiresAtSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "ownershipHandoverExpiresAt" function. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAtParams } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAtParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAtParams( + options: OwnershipHandoverExpiresAtParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "ownershipHandoverExpiresAt" function into a Hex string with its parameters. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAt({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAt( + options: OwnershipHandoverExpiresAtParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeOwnershipHandoverExpiresAtParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the ownershipHandoverExpiresAt function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnershipHandoverExpiresAtResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnershipHandoverExpiresAtResultResult("..."); + * ``` + */ +export function decodeOwnershipHandoverExpiresAtResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "ownershipHandoverExpiresAt" function on the contract. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { ownershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * + * const result = await ownershipHandoverExpiresAt({ + * contract, + * pendingOwner: ..., + * }); + * + * ``` + */ +export async function ownershipHandoverExpiresAt( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.pendingOwner], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/supportsInterface.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/supportsInterface.ts new file mode 100644 index 00000000000..0ae59f66e8f --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/supportsInterface.ts @@ -0,0 +1,130 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "supportsInterface" function. + */ +export type SupportsInterfaceParams = { + interfaceId: AbiParameterToPrimitiveType<{ + type: "bytes4"; + name: "interfaceId"; + }>; +}; + +export const FN_SELECTOR = "0x01ffc9a7" as const; +const FN_INPUTS = [ + { + type: "bytes4", + name: "interfaceId", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bool", + }, +] as const; + +/** + * Checks if the `supportsInterface` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `supportsInterface` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSupportsInterfaceSupported } from "thirdweb/extensions/assets"; + * const supported = isSupportsInterfaceSupported(["0x..."]); + * ``` + */ +export function isSupportsInterfaceSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "supportsInterface" function. + * @param options - The options for the supportsInterface function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSupportsInterfaceParams } from "thirdweb/extensions/assets"; + * const result = encodeSupportsInterfaceParams({ + * interfaceId: ..., + * }); + * ``` + */ +export function encodeSupportsInterfaceParams( + options: SupportsInterfaceParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.interfaceId]); +} + +/** + * Encodes the "supportsInterface" function into a Hex string with its parameters. + * @param options - The options for the supportsInterface function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSupportsInterface } from "thirdweb/extensions/assets"; + * const result = encodeSupportsInterface({ + * interfaceId: ..., + * }); + * ``` + */ +export function encodeSupportsInterface(options: SupportsInterfaceParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSupportsInterfaceParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the supportsInterface function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeSupportsInterfaceResult } from "thirdweb/extensions/assets"; + * const result = decodeSupportsInterfaceResultResult("..."); + * ``` + */ +export function decodeSupportsInterfaceResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "supportsInterface" function on the contract. + * @param options - The options for the supportsInterface function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { supportsInterface } from "thirdweb/extensions/assets"; + * + * const result = await supportsInterface({ + * contract, + * interfaceId: ..., + * }); + * + * ``` + */ +export async function supportsInterface( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.interfaceId], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/symbol.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/symbol.ts new file mode 100644 index 00000000000..717ca59cb9e --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/symbol.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x95d89b41" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "string", + }, +] as const; + +/** + * Checks if the `symbol` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `symbol` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSymbolSupported } from "thirdweb/extensions/assets"; + * const supported = isSymbolSupported(["0x..."]); + * ``` + */ +export function isSymbolSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the symbol function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeSymbolResult } from "thirdweb/extensions/assets"; + * const result = decodeSymbolResultResult("..."); + * ``` + */ +export function decodeSymbolResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "symbol" function on the contract. + * @param options - The options for the symbol function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { symbol } from "thirdweb/extensions/assets"; + * + * const result = await symbol({ + * contract, + * }); + * + * ``` + */ +export async function symbol(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/totalSupply.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/totalSupply.ts new file mode 100644 index 00000000000..1ae861539a0 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/read/totalSupply.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x18160ddd" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `totalSupply` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `totalSupply` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isTotalSupplySupported } from "thirdweb/extensions/assets"; + * const supported = isTotalSupplySupported(["0x..."]); + * ``` + */ +export function isTotalSupplySupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the totalSupply function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeTotalSupplyResult } from "thirdweb/extensions/assets"; + * const result = decodeTotalSupplyResultResult("..."); + * ``` + */ +export function decodeTotalSupplyResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "totalSupply" function on the contract. + * @param options - The options for the totalSupply function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { totalSupply } from "thirdweb/extensions/assets"; + * + * const result = await totalSupply({ + * contract, + * }); + * + * ``` + */ +export async function totalSupply(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/approve.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/approve.ts new file mode 100644 index 00000000000..9795cbcb955 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/approve.ts @@ -0,0 +1,149 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "approve" function. + */ +export type ApproveParams = WithOverrides<{ + spender: AbiParameterToPrimitiveType<{ type: "address"; name: "spender" }>; + amount: AbiParameterToPrimitiveType<{ type: "uint256"; name: "amount" }>; +}>; + +export const FN_SELECTOR = "0x095ea7b3" as const; +const FN_INPUTS = [ + { + type: "address", + name: "spender", + }, + { + type: "uint256", + name: "amount", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bool", + }, +] as const; + +/** + * Checks if the `approve` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `approve` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isApproveSupported } from "thirdweb/extensions/assets"; + * + * const supported = isApproveSupported(["0x..."]); + * ``` + */ +export function isApproveSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "approve" function. + * @param options - The options for the approve function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeApproveParams } from "thirdweb/extensions/assets"; + * const result = encodeApproveParams({ + * spender: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeApproveParams(options: ApproveParams) { + return encodeAbiParameters(FN_INPUTS, [options.spender, options.amount]); +} + +/** + * Encodes the "approve" function into a Hex string with its parameters. + * @param options - The options for the approve function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeApprove } from "thirdweb/extensions/assets"; + * const result = encodeApprove({ + * spender: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeApprove(options: ApproveParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeApproveParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "approve" function on the contract. + * @param options - The options for the "approve" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { approve } from "thirdweb/extensions/assets"; + * + * const transaction = approve({ + * contract, + * spender: ..., + * amount: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function approve( + options: BaseTransactionOptions< + | ApproveParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.spender, resolvedOptions.amount] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/burn.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/burn.ts new file mode 100644 index 00000000000..636d1cb5503 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/burn.ts @@ -0,0 +1,137 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "burn" function. + */ +export type BurnParams = WithOverrides<{ + amount: AbiParameterToPrimitiveType<{ type: "uint256"; name: "amount" }>; +}>; + +export const FN_SELECTOR = "0x42966c68" as const; +const FN_INPUTS = [ + { + type: "uint256", + name: "amount", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `burn` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `burn` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isBurnSupported } from "thirdweb/extensions/assets"; + * + * const supported = isBurnSupported(["0x..."]); + * ``` + */ +export function isBurnSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "burn" function. + * @param options - The options for the burn function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeBurnParams } from "thirdweb/extensions/assets"; + * const result = encodeBurnParams({ + * amount: ..., + * }); + * ``` + */ +export function encodeBurnParams(options: BurnParams) { + return encodeAbiParameters(FN_INPUTS, [options.amount]); +} + +/** + * Encodes the "burn" function into a Hex string with its parameters. + * @param options - The options for the burn function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeBurn } from "thirdweb/extensions/assets"; + * const result = encodeBurn({ + * amount: ..., + * }); + * ``` + */ +export function encodeBurn(options: BurnParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeBurnParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "burn" function on the contract. + * @param options - The options for the "burn" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { burn } from "thirdweb/extensions/assets"; + * + * const transaction = burn({ + * contract, + * amount: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function burn( + options: BaseTransactionOptions< + | BurnParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.amount] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/burnFrom.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/burnFrom.ts new file mode 100644 index 00000000000..fd9bdeb8ac7 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/burnFrom.ts @@ -0,0 +1,145 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "burnFrom" function. + */ +export type BurnFromParams = WithOverrides<{ + from: AbiParameterToPrimitiveType<{ type: "address"; name: "from" }>; + amount: AbiParameterToPrimitiveType<{ type: "uint256"; name: "amount" }>; +}>; + +export const FN_SELECTOR = "0x79cc6790" as const; +const FN_INPUTS = [ + { + type: "address", + name: "from", + }, + { + type: "uint256", + name: "amount", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `burnFrom` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `burnFrom` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isBurnFromSupported } from "thirdweb/extensions/assets"; + * + * const supported = isBurnFromSupported(["0x..."]); + * ``` + */ +export function isBurnFromSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "burnFrom" function. + * @param options - The options for the burnFrom function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeBurnFromParams } from "thirdweb/extensions/assets"; + * const result = encodeBurnFromParams({ + * from: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeBurnFromParams(options: BurnFromParams) { + return encodeAbiParameters(FN_INPUTS, [options.from, options.amount]); +} + +/** + * Encodes the "burnFrom" function into a Hex string with its parameters. + * @param options - The options for the burnFrom function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeBurnFrom } from "thirdweb/extensions/assets"; + * const result = encodeBurnFrom({ + * from: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeBurnFrom(options: BurnFromParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeBurnFromParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "burnFrom" function on the contract. + * @param options - The options for the "burnFrom" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { burnFrom } from "thirdweb/extensions/assets"; + * + * const transaction = burnFrom({ + * contract, + * from: ..., + * amount: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function burnFrom( + options: BaseTransactionOptions< + | BurnFromParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.from, resolvedOptions.amount] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/cancelOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/cancelOwnershipHandover.ts new file mode 100644 index 00000000000..a1e60004b43 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/cancelOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x54d1f13d" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `cancelOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `cancelOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCancelOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCancelOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCancelOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. + * @param options - The options for the "cancelOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { cancelOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = cancelOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function cancelOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/completeOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/completeOwnershipHandover.ts new file mode 100644 index 00000000000..c4bf81966fe --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/completeOwnershipHandover.ts @@ -0,0 +1,148 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "completeOwnershipHandover" function. + */ +export type CompleteOwnershipHandoverParams = WithOverrides<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}>; + +export const FN_SELECTOR = "0xf04e283e" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `completeOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `completeOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCompleteOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCompleteOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCompleteOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "completeOwnershipHandover" function. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandoverParams } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandoverParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandoverParams( + options: CompleteOwnershipHandoverParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "completeOwnershipHandover" function into a Hex string with its parameters. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandover } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandover({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandover( + options: CompleteOwnershipHandoverParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCompleteOwnershipHandoverParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "completeOwnershipHandover" function on the contract. + * @param options - The options for the "completeOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { completeOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = completeOwnershipHandover({ + * contract, + * pendingOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function completeOwnershipHandover( + options: BaseTransactionOptions< + | CompleteOwnershipHandoverParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.pendingOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/initialize.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/initialize.ts new file mode 100644 index 00000000000..4787e7cf6f3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/initialize.ts @@ -0,0 +1,189 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "initialize" function. + */ +export type InitializeParams = WithOverrides<{ + name: AbiParameterToPrimitiveType<{ type: "string"; name: "_name" }>; + symbol: AbiParameterToPrimitiveType<{ type: "string"; name: "_symbol" }>; + contractURI: AbiParameterToPrimitiveType<{ + type: "string"; + name: "_contractURI"; + }>; + maxSupply: AbiParameterToPrimitiveType<{ + type: "uint256"; + name: "_maxSupply"; + }>; + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "_owner" }>; +}>; + +export const FN_SELECTOR = "0x30a8ff4e" as const; +const FN_INPUTS = [ + { + type: "string", + name: "_name", + }, + { + type: "string", + name: "_symbol", + }, + { + type: "string", + name: "_contractURI", + }, + { + type: "uint256", + name: "_maxSupply", + }, + { + type: "address", + name: "_owner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `initialize` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `initialize` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isInitializeSupported } from "thirdweb/extensions/assets"; + * + * const supported = isInitializeSupported(["0x..."]); + * ``` + */ +export function isInitializeSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "initialize" function. + * @param options - The options for the initialize function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeInitializeParams } from "thirdweb/extensions/assets"; + * const result = encodeInitializeParams({ + * name: ..., + * symbol: ..., + * contractURI: ..., + * maxSupply: ..., + * owner: ..., + * }); + * ``` + */ +export function encodeInitializeParams(options: InitializeParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.name, + options.symbol, + options.contractURI, + options.maxSupply, + options.owner, + ]); +} + +/** + * Encodes the "initialize" function into a Hex string with its parameters. + * @param options - The options for the initialize function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeInitialize } from "thirdweb/extensions/assets"; + * const result = encodeInitialize({ + * name: ..., + * symbol: ..., + * contractURI: ..., + * maxSupply: ..., + * owner: ..., + * }); + * ``` + */ +export function encodeInitialize(options: InitializeParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeInitializeParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "initialize" function on the contract. + * @param options - The options for the "initialize" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { initialize } from "thirdweb/extensions/assets"; + * + * const transaction = initialize({ + * contract, + * name: ..., + * symbol: ..., + * contractURI: ..., + * maxSupply: ..., + * owner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function initialize( + options: BaseTransactionOptions< + | InitializeParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.name, + resolvedOptions.symbol, + resolvedOptions.contractURI, + resolvedOptions.maxSupply, + resolvedOptions.owner, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/permit.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/permit.ts new file mode 100644 index 00000000000..472b88b0954 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/permit.ts @@ -0,0 +1,201 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "permit" function. + */ +export type PermitParams = WithOverrides<{ + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner" }>; + spender: AbiParameterToPrimitiveType<{ type: "address"; name: "spender" }>; + value: AbiParameterToPrimitiveType<{ type: "uint256"; name: "value" }>; + deadline: AbiParameterToPrimitiveType<{ type: "uint256"; name: "deadline" }>; + v: AbiParameterToPrimitiveType<{ type: "uint8"; name: "v" }>; + r: AbiParameterToPrimitiveType<{ type: "bytes32"; name: "r" }>; + s: AbiParameterToPrimitiveType<{ type: "bytes32"; name: "s" }>; +}>; + +export const FN_SELECTOR = "0xd505accf" as const; +const FN_INPUTS = [ + { + type: "address", + name: "owner", + }, + { + type: "address", + name: "spender", + }, + { + type: "uint256", + name: "value", + }, + { + type: "uint256", + name: "deadline", + }, + { + type: "uint8", + name: "v", + }, + { + type: "bytes32", + name: "r", + }, + { + type: "bytes32", + name: "s", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `permit` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `permit` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isPermitSupported } from "thirdweb/extensions/assets"; + * + * const supported = isPermitSupported(["0x..."]); + * ``` + */ +export function isPermitSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "permit" function. + * @param options - The options for the permit function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodePermitParams } from "thirdweb/extensions/assets"; + * const result = encodePermitParams({ + * owner: ..., + * spender: ..., + * value: ..., + * deadline: ..., + * v: ..., + * r: ..., + * s: ..., + * }); + * ``` + */ +export function encodePermitParams(options: PermitParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.owner, + options.spender, + options.value, + options.deadline, + options.v, + options.r, + options.s, + ]); +} + +/** + * Encodes the "permit" function into a Hex string with its parameters. + * @param options - The options for the permit function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodePermit } from "thirdweb/extensions/assets"; + * const result = encodePermit({ + * owner: ..., + * spender: ..., + * value: ..., + * deadline: ..., + * v: ..., + * r: ..., + * s: ..., + * }); + * ``` + */ +export function encodePermit(options: PermitParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodePermitParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "permit" function on the contract. + * @param options - The options for the "permit" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { permit } from "thirdweb/extensions/assets"; + * + * const transaction = permit({ + * contract, + * owner: ..., + * spender: ..., + * value: ..., + * deadline: ..., + * v: ..., + * r: ..., + * s: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function permit( + options: BaseTransactionOptions< + | PermitParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.owner, + resolvedOptions.spender, + resolvedOptions.value, + resolvedOptions.deadline, + resolvedOptions.v, + resolvedOptions.r, + resolvedOptions.s, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/renounceOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/renounceOwnership.ts new file mode 100644 index 00000000000..7b8b575e3b4 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/renounceOwnership.ts @@ -0,0 +1,50 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x715018a6" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `renounceOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `renounceOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRenounceOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRenounceOwnershipSupported(["0x..."]); + * ``` + */ +export function isRenounceOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "renounceOwnership" function on the contract. + * @param options - The options for the "renounceOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { renounceOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = renounceOwnership(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function renounceOwnership(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/requestOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/requestOwnershipHandover.ts new file mode 100644 index 00000000000..e0744619fae --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/requestOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x25692962" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `requestOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `requestOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRequestOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRequestOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isRequestOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "requestOwnershipHandover" function on the contract. + * @param options - The options for the "requestOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { requestOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = requestOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function requestOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/setContractURI.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/setContractURI.ts new file mode 100644 index 00000000000..432d7cc92dd --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/setContractURI.ts @@ -0,0 +1,142 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setContractURI" function. + */ +export type SetContractURIParams = WithOverrides<{ + contractURI: AbiParameterToPrimitiveType<{ + type: "string"; + name: "_contractURI"; + }>; +}>; + +export const FN_SELECTOR = "0x938e3d7b" as const; +const FN_INPUTS = [ + { + type: "string", + name: "_contractURI", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setContractURI` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setContractURI` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetContractURISupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetContractURISupported(["0x..."]); + * ``` + */ +export function isSetContractURISupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setContractURI" function. + * @param options - The options for the setContractURI function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetContractURIParams } from "thirdweb/extensions/assets"; + * const result = encodeSetContractURIParams({ + * contractURI: ..., + * }); + * ``` + */ +export function encodeSetContractURIParams(options: SetContractURIParams) { + return encodeAbiParameters(FN_INPUTS, [options.contractURI]); +} + +/** + * Encodes the "setContractURI" function into a Hex string with its parameters. + * @param options - The options for the setContractURI function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetContractURI } from "thirdweb/extensions/assets"; + * const result = encodeSetContractURI({ + * contractURI: ..., + * }); + * ``` + */ +export function encodeSetContractURI(options: SetContractURIParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetContractURIParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setContractURI" function on the contract. + * @param options - The options for the "setContractURI" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setContractURI } from "thirdweb/extensions/assets"; + * + * const transaction = setContractURI({ + * contract, + * contractURI: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setContractURI( + options: BaseTransactionOptions< + | SetContractURIParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.contractURI] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transfer.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transfer.ts new file mode 100644 index 00000000000..ec9cf538807 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transfer.ts @@ -0,0 +1,149 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "transfer" function. + */ +export type TransferParams = WithOverrides<{ + to: AbiParameterToPrimitiveType<{ type: "address"; name: "to" }>; + amount: AbiParameterToPrimitiveType<{ type: "uint256"; name: "amount" }>; +}>; + +export const FN_SELECTOR = "0xa9059cbb" as const; +const FN_INPUTS = [ + { + type: "address", + name: "to", + }, + { + type: "uint256", + name: "amount", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bool", + }, +] as const; + +/** + * Checks if the `transfer` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `transfer` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isTransferSupported } from "thirdweb/extensions/assets"; + * + * const supported = isTransferSupported(["0x..."]); + * ``` + */ +export function isTransferSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "transfer" function. + * @param options - The options for the transfer function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferParams } from "thirdweb/extensions/assets"; + * const result = encodeTransferParams({ + * to: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeTransferParams(options: TransferParams) { + return encodeAbiParameters(FN_INPUTS, [options.to, options.amount]); +} + +/** + * Encodes the "transfer" function into a Hex string with its parameters. + * @param options - The options for the transfer function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransfer } from "thirdweb/extensions/assets"; + * const result = encodeTransfer({ + * to: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeTransfer(options: TransferParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeTransferParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "transfer" function on the contract. + * @param options - The options for the "transfer" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { transfer } from "thirdweb/extensions/assets"; + * + * const transaction = transfer({ + * contract, + * to: ..., + * amount: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function transfer( + options: BaseTransactionOptions< + | TransferParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.to, resolvedOptions.amount] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transferFrom.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transferFrom.ts new file mode 100644 index 00000000000..ae3ed16352b --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transferFrom.ts @@ -0,0 +1,167 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "transferFrom" function. + */ +export type TransferFromParams = WithOverrides<{ + from: AbiParameterToPrimitiveType<{ type: "address"; name: "from" }>; + to: AbiParameterToPrimitiveType<{ type: "address"; name: "to" }>; + amount: AbiParameterToPrimitiveType<{ type: "uint256"; name: "amount" }>; +}>; + +export const FN_SELECTOR = "0x23b872dd" as const; +const FN_INPUTS = [ + { + type: "address", + name: "from", + }, + { + type: "address", + name: "to", + }, + { + type: "uint256", + name: "amount", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bool", + }, +] as const; + +/** + * Checks if the `transferFrom` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `transferFrom` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isTransferFromSupported } from "thirdweb/extensions/assets"; + * + * const supported = isTransferFromSupported(["0x..."]); + * ``` + */ +export function isTransferFromSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "transferFrom" function. + * @param options - The options for the transferFrom function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferFromParams } from "thirdweb/extensions/assets"; + * const result = encodeTransferFromParams({ + * from: ..., + * to: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeTransferFromParams(options: TransferFromParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.from, + options.to, + options.amount, + ]); +} + +/** + * Encodes the "transferFrom" function into a Hex string with its parameters. + * @param options - The options for the transferFrom function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferFrom } from "thirdweb/extensions/assets"; + * const result = encodeTransferFrom({ + * from: ..., + * to: ..., + * amount: ..., + * }); + * ``` + */ +export function encodeTransferFrom(options: TransferFromParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeTransferFromParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "transferFrom" function on the contract. + * @param options - The options for the "transferFrom" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { transferFrom } from "thirdweb/extensions/assets"; + * + * const transaction = transferFrom({ + * contract, + * from: ..., + * to: ..., + * amount: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function transferFrom( + options: BaseTransactionOptions< + | TransferFromParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.from, + resolvedOptions.to, + resolvedOptions.amount, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transferOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transferOwnership.ts new file mode 100644 index 00000000000..36f0df68e14 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20Asset/write/transferOwnership.ts @@ -0,0 +1,141 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "transferOwnership" function. + */ +export type TransferOwnershipParams = WithOverrides<{ + newOwner: AbiParameterToPrimitiveType<{ type: "address"; name: "newOwner" }>; +}>; + +export const FN_SELECTOR = "0xf2fde38b" as const; +const FN_INPUTS = [ + { + type: "address", + name: "newOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `transferOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `transferOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isTransferOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isTransferOwnershipSupported(["0x..."]); + * ``` + */ +export function isTransferOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "transferOwnership" function. + * @param options - The options for the transferOwnership function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnershipParams } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnershipParams({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnershipParams( + options: TransferOwnershipParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.newOwner]); +} + +/** + * Encodes the "transferOwnership" function into a Hex string with its parameters. + * @param options - The options for the transferOwnership function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnership } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnership({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnership(options: TransferOwnershipParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeTransferOwnershipParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "transferOwnership" function on the contract. + * @param options - The options for the "transferOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { transferOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = transferOwnership({ + * contract, + * newOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function transferOwnership( + options: BaseTransactionOptions< + | TransferOwnershipParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.newOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AirdropUpdated.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AirdropUpdated.ts new file mode 100644 index 00000000000..23caf5512ad --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AirdropUpdated.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the AirdropUpdated event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { airdropUpdatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * airdropUpdatedEvent() + * ], + * }); + * ``` + */ +export function airdropUpdatedEvent() { + return prepareEvent({ + signature: "event AirdropUpdated(address airdrop)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetCreated.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetCreated.ts new file mode 100644 index 00000000000..96c1d21407b --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetCreated.ts @@ -0,0 +1,47 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "AssetCreated" event. + */ +export type AssetCreatedEventFilters = Partial<{ + creator: AbiParameterToPrimitiveType<{ + type: "address"; + name: "creator"; + indexed: true; + }>; + asset: AbiParameterToPrimitiveType<{ + type: "address"; + name: "asset"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the AssetCreated event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { assetCreatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * assetCreatedEvent({ + * creator: ..., + * asset: ..., + * }) + * ], + * }); + * ``` + */ +export function assetCreatedEvent(filters: AssetCreatedEventFilters = {}) { + return prepareEvent({ + signature: + "event AssetCreated(bytes32 contractId, address indexed creator, address indexed asset, address referrer, bytes aux)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetDistributed.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetDistributed.ts new file mode 100644 index 00000000000..6367047c30b --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/AssetDistributed.ts @@ -0,0 +1,25 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the AssetDistributed event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { assetDistributedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * assetDistributedEvent() + * ], + * }); + * ``` + */ +export function assetDistributedEvent() { + return prepareEvent({ + signature: + "event AssetDistributed(address asset, uint256 recipientCount, uint256 totalAmount)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/ImplementationAdded.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/ImplementationAdded.ts new file mode 100644 index 00000000000..ea39ab990d0 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/ImplementationAdded.ts @@ -0,0 +1,43 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "ImplementationAdded" event. + */ +export type ImplementationAddedEventFilters = Partial<{ + implementation: AbiParameterToPrimitiveType<{ + type: "address"; + name: "implementation"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the ImplementationAdded event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { implementationAddedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * implementationAddedEvent({ + * implementation: ..., + * }) + * ], + * }); + * ``` + */ +export function implementationAddedEvent( + filters: ImplementationAddedEventFilters = {}, +) { + return prepareEvent({ + signature: + "event ImplementationAdded(bytes32 contractId, address indexed implementation, uint8 implementationType, uint8 createHook, bytes createHookData)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/Initialized.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/Initialized.ts new file mode 100644 index 00000000000..88705c10a63 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/Initialized.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the Initialized event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { initializedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * initializedEvent() + * ], + * }); + * ``` + */ +export function initializedEvent() { + return prepareEvent({ + signature: "event Initialized(uint64 version)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipHandoverCanceled.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipHandoverCanceled.ts new file mode 100644 index 00000000000..2ab8996b8d3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipHandoverCanceled.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverCanceled" event. + */ +export type OwnershipHandoverCanceledEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverCanceled event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverCanceledEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverCanceledEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverCanceledEvent( + filters: OwnershipHandoverCanceledEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverCanceled(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipHandoverRequested.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipHandoverRequested.ts new file mode 100644 index 00000000000..a498506409a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipHandoverRequested.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverRequested" event. + */ +export type OwnershipHandoverRequestedEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverRequested event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverRequestedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverRequestedEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverRequestedEvent( + filters: OwnershipHandoverRequestedEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverRequested(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipTransferred.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipTransferred.ts new file mode 100644 index 00000000000..b1be6e750e1 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/OwnershipTransferred.ts @@ -0,0 +1,49 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipTransferred" event. + */ +export type OwnershipTransferredEventFilters = Partial<{ + oldOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "oldOwner"; + indexed: true; + }>; + newOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "newOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipTransferred event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipTransferredEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipTransferredEvent({ + * oldOwner: ..., + * newOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipTransferredEvent( + filters: OwnershipTransferredEventFilters = {}, +) { + return prepareEvent({ + signature: + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/RewardLockerUpdated.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/RewardLockerUpdated.ts new file mode 100644 index 00000000000..5f070ae80d8 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/RewardLockerUpdated.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the RewardLockerUpdated event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { rewardLockerUpdatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * rewardLockerUpdatedEvent() + * ], + * }); + * ``` + */ +export function rewardLockerUpdatedEvent() { + return prepareEvent({ + signature: "event RewardLockerUpdated(address locker)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/RouterUpdated.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/RouterUpdated.ts new file mode 100644 index 00000000000..b622f2188f4 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/RouterUpdated.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the RouterUpdated event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { routerUpdatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * routerUpdatedEvent() + * ], + * }); + * ``` + */ +export function routerUpdatedEvent() { + return prepareEvent({ + signature: "event RouterUpdated(address router)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/Upgraded.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/Upgraded.ts new file mode 100644 index 00000000000..5ab5634fb24 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/events/Upgraded.ts @@ -0,0 +1,40 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "Upgraded" event. + */ +export type UpgradedEventFilters = Partial<{ + implementation: AbiParameterToPrimitiveType<{ + type: "address"; + name: "implementation"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the Upgraded event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { upgradedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * upgradedEvent({ + * implementation: ..., + * }) + * ], + * }); + * ``` + */ +export function upgradedEvent(filters: UpgradedEventFilters = {}) { + return prepareEvent({ + signature: "event Upgraded(address indexed implementation)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/decodeOwnerFromInitData.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/decodeOwnerFromInitData.ts new file mode 100644 index 00000000000..d800984ead2 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/decodeOwnerFromInitData.ts @@ -0,0 +1,132 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "decodeOwnerFromInitData" function. + */ +export type DecodeOwnerFromInitDataParams = { + data: AbiParameterToPrimitiveType<{ type: "bytes"; name: "data" }>; +}; + +export const FN_SELECTOR = "0xb4d9e9c2" as const; +const FN_INPUTS = [ + { + type: "bytes", + name: "data", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "owner", + }, +] as const; + +/** + * Checks if the `decodeOwnerFromInitData` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `decodeOwnerFromInitData` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isDecodeOwnerFromInitDataSupported } from "thirdweb/extensions/assets"; + * const supported = isDecodeOwnerFromInitDataSupported(["0x..."]); + * ``` + */ +export function isDecodeOwnerFromInitDataSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "decodeOwnerFromInitData" function. + * @param options - The options for the decodeOwnerFromInitData function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeDecodeOwnerFromInitDataParams } from "thirdweb/extensions/assets"; + * const result = encodeDecodeOwnerFromInitDataParams({ + * data: ..., + * }); + * ``` + */ +export function encodeDecodeOwnerFromInitDataParams( + options: DecodeOwnerFromInitDataParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.data]); +} + +/** + * Encodes the "decodeOwnerFromInitData" function into a Hex string with its parameters. + * @param options - The options for the decodeOwnerFromInitData function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeDecodeOwnerFromInitData } from "thirdweb/extensions/assets"; + * const result = encodeDecodeOwnerFromInitData({ + * data: ..., + * }); + * ``` + */ +export function encodeDecodeOwnerFromInitData( + options: DecodeOwnerFromInitDataParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeDecodeOwnerFromInitDataParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the decodeOwnerFromInitData function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeDecodeOwnerFromInitDataResult } from "thirdweb/extensions/assets"; + * const result = decodeDecodeOwnerFromInitDataResultResult("..."); + * ``` + */ +export function decodeDecodeOwnerFromInitDataResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "decodeOwnerFromInitData" function on the contract. + * @param options - The options for the decodeOwnerFromInitData function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnerFromInitData } from "thirdweb/extensions/assets"; + * + * const result = await decodeOwnerFromInitData({ + * contract, + * data: ..., + * }); + * + * ``` + */ +export async function decodeOwnerFromInitData( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.data], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getAirdrop.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getAirdrop.ts new file mode 100644 index 00000000000..658c082cc3e --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getAirdrop.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0xd25f82a0" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "airdrop", + }, +] as const; + +/** + * Checks if the `getAirdrop` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `getAirdrop` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGetAirdropSupported } from "thirdweb/extensions/assets"; + * const supported = isGetAirdropSupported(["0x..."]); + * ``` + */ +export function isGetAirdropSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the getAirdrop function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeGetAirdropResult } from "thirdweb/extensions/assets"; + * const result = decodeGetAirdropResultResult("..."); + * ``` + */ +export function decodeGetAirdropResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "getAirdrop" function on the contract. + * @param options - The options for the getAirdrop function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { getAirdrop } from "thirdweb/extensions/assets"; + * + * const result = await getAirdrop({ + * contract, + * }); + * + * ``` + */ +export async function getAirdrop(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getImplementation.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getImplementation.ts new file mode 100644 index 00000000000..5e705cc3f3d --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getImplementation.ts @@ -0,0 +1,153 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "getImplementation" function. + */ +export type GetImplementationParams = { + contractId: AbiParameterToPrimitiveType<{ + type: "bytes32"; + name: "contractId"; + }>; +}; + +export const FN_SELECTOR = "0x3c2e0828" as const; +const FN_INPUTS = [ + { + type: "bytes32", + name: "contractId", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "tuple", + name: "config", + components: [ + { + type: "bytes32", + name: "contractId", + }, + { + type: "address", + name: "implementation", + }, + { + type: "uint8", + name: "implementationType", + }, + { + type: "uint8", + name: "createHook", + }, + { + type: "bytes", + name: "createHookData", + }, + ], + }, +] as const; + +/** + * Checks if the `getImplementation` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `getImplementation` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGetImplementationSupported } from "thirdweb/extensions/assets"; + * const supported = isGetImplementationSupported(["0x..."]); + * ``` + */ +export function isGetImplementationSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "getImplementation" function. + * @param options - The options for the getImplementation function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeGetImplementationParams } from "thirdweb/extensions/assets"; + * const result = encodeGetImplementationParams({ + * contractId: ..., + * }); + * ``` + */ +export function encodeGetImplementationParams( + options: GetImplementationParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.contractId]); +} + +/** + * Encodes the "getImplementation" function into a Hex string with its parameters. + * @param options - The options for the getImplementation function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeGetImplementation } from "thirdweb/extensions/assets"; + * const result = encodeGetImplementation({ + * contractId: ..., + * }); + * ``` + */ +export function encodeGetImplementation(options: GetImplementationParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeGetImplementationParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the getImplementation function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeGetImplementationResult } from "thirdweb/extensions/assets"; + * const result = decodeGetImplementationResultResult("..."); + * ``` + */ +export function decodeGetImplementationResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "getImplementation" function on the contract. + * @param options - The options for the getImplementation function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { getImplementation } from "thirdweb/extensions/assets"; + * + * const result = await getImplementation({ + * contract, + * contractId: ..., + * }); + * + * ``` + */ +export async function getImplementation( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.contractId], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRewardLocker.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRewardLocker.ts new file mode 100644 index 00000000000..dbe2181ab56 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRewardLocker.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0xb0188df2" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "rewardLocker", + }, +] as const; + +/** + * Checks if the `getRewardLocker` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `getRewardLocker` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGetRewardLockerSupported } from "thirdweb/extensions/assets"; + * const supported = isGetRewardLockerSupported(["0x..."]); + * ``` + */ +export function isGetRewardLockerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the getRewardLocker function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeGetRewardLockerResult } from "thirdweb/extensions/assets"; + * const result = decodeGetRewardLockerResultResult("..."); + * ``` + */ +export function decodeGetRewardLockerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "getRewardLocker" function on the contract. + * @param options - The options for the getRewardLocker function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { getRewardLocker } from "thirdweb/extensions/assets"; + * + * const result = await getRewardLocker({ + * contract, + * }); + * + * ``` + */ +export async function getRewardLocker(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRewardPosition.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRewardPosition.ts new file mode 100644 index 00000000000..d4ac51a2f52 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRewardPosition.ts @@ -0,0 +1,149 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "getRewardPosition" function. + */ +export type GetRewardPositionParams = { + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "asset" }>; +}; + +export const FN_SELECTOR = "0x61d74a29" as const; +const FN_INPUTS = [ + { + type: "address", + name: "asset", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "tuple", + components: [ + { + type: "address", + name: "positionManager", + }, + { + type: "uint256", + name: "tokenId", + }, + { + type: "address", + name: "recipient", + }, + { + type: "address", + name: "referrer", + }, + { + type: "uint16", + name: "referrerBps", + }, + ], + }, +] as const; + +/** + * Checks if the `getRewardPosition` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `getRewardPosition` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGetRewardPositionSupported } from "thirdweb/extensions/assets"; + * const supported = isGetRewardPositionSupported(["0x..."]); + * ``` + */ +export function isGetRewardPositionSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "getRewardPosition" function. + * @param options - The options for the getRewardPosition function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeGetRewardPositionParams } from "thirdweb/extensions/assets"; + * const result = encodeGetRewardPositionParams({ + * asset: ..., + * }); + * ``` + */ +export function encodeGetRewardPositionParams( + options: GetRewardPositionParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.asset]); +} + +/** + * Encodes the "getRewardPosition" function into a Hex string with its parameters. + * @param options - The options for the getRewardPosition function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeGetRewardPosition } from "thirdweb/extensions/assets"; + * const result = encodeGetRewardPosition({ + * asset: ..., + * }); + * ``` + */ +export function encodeGetRewardPosition(options: GetRewardPositionParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeGetRewardPositionParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the getRewardPosition function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeGetRewardPositionResult } from "thirdweb/extensions/assets"; + * const result = decodeGetRewardPositionResultResult("..."); + * ``` + */ +export function decodeGetRewardPositionResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "getRewardPosition" function on the contract. + * @param options - The options for the getRewardPosition function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { getRewardPosition } from "thirdweb/extensions/assets"; + * + * const result = await getRewardPosition({ + * contract, + * asset: ..., + * }); + * + * ``` + */ +export async function getRewardPosition( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.asset], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRouter.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRouter.ts new file mode 100644 index 00000000000..f90e6da4cde --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/getRouter.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0xb0f479a1" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "router", + }, +] as const; + +/** + * Checks if the `getRouter` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `getRouter` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGetRouterSupported } from "thirdweb/extensions/assets"; + * const supported = isGetRouterSupported(["0x..."]); + * ``` + */ +export function isGetRouterSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the getRouter function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeGetRouterResult } from "thirdweb/extensions/assets"; + * const result = decodeGetRouterResultResult("..."); + * ``` + */ +export function decodeGetRouterResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "getRouter" function on the contract. + * @param options - The options for the getRouter function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { getRouter } from "thirdweb/extensions/assets"; + * + * const result = await getRouter({ + * contract, + * }); + * + * ``` + */ +export async function getRouter(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/guardSalt.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/guardSalt.ts new file mode 100644 index 00000000000..3d9bda9fed2 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/guardSalt.ts @@ -0,0 +1,165 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "guardSalt" function. + */ +export type GuardSaltParams = { + salt: AbiParameterToPrimitiveType<{ type: "bytes32"; name: "salt" }>; + creator: AbiParameterToPrimitiveType<{ type: "address"; name: "creator" }>; + contractInitData: AbiParameterToPrimitiveType<{ + type: "bytes"; + name: "contractInitData"; + }>; + hookInitData: AbiParameterToPrimitiveType<{ + type: "bytes"; + name: "hookInitData"; + }>; +}; + +export const FN_SELECTOR = "0xd5ebb1df" as const; +const FN_INPUTS = [ + { + type: "bytes32", + name: "salt", + }, + { + type: "address", + name: "creator", + }, + { + type: "bytes", + name: "contractInitData", + }, + { + type: "bytes", + name: "hookInitData", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bytes32", + }, +] as const; + +/** + * Checks if the `guardSalt` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `guardSalt` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGuardSaltSupported } from "thirdweb/extensions/assets"; + * const supported = isGuardSaltSupported(["0x..."]); + * ``` + */ +export function isGuardSaltSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "guardSalt" function. + * @param options - The options for the guardSalt function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeGuardSaltParams } from "thirdweb/extensions/assets"; + * const result = encodeGuardSaltParams({ + * salt: ..., + * creator: ..., + * contractInitData: ..., + * hookInitData: ..., + * }); + * ``` + */ +export function encodeGuardSaltParams(options: GuardSaltParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.salt, + options.creator, + options.contractInitData, + options.hookInitData, + ]); +} + +/** + * Encodes the "guardSalt" function into a Hex string with its parameters. + * @param options - The options for the guardSalt function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeGuardSalt } from "thirdweb/extensions/assets"; + * const result = encodeGuardSalt({ + * salt: ..., + * creator: ..., + * contractInitData: ..., + * hookInitData: ..., + * }); + * ``` + */ +export function encodeGuardSalt(options: GuardSaltParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeGuardSaltParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the guardSalt function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeGuardSaltResult } from "thirdweb/extensions/assets"; + * const result = decodeGuardSaltResultResult("..."); + * ``` + */ +export function decodeGuardSaltResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "guardSalt" function on the contract. + * @param options - The options for the guardSalt function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { guardSalt } from "thirdweb/extensions/assets"; + * + * const result = await guardSalt({ + * contract, + * salt: ..., + * creator: ..., + * contractInitData: ..., + * hookInitData: ..., + * }); + * + * ``` + */ +export async function guardSalt( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [ + options.salt, + options.creator, + options.contractInitData, + options.hookInitData, + ], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/owner.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/owner.ts new file mode 100644 index 00000000000..9903177bd12 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/owner.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x8da5cb5b" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "result", + }, +] as const; + +/** + * Checks if the `owner` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `owner` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnerSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnerSupported(["0x..."]); + * ``` + */ +export function isOwnerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the owner function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnerResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnerResultResult("..."); + * ``` + */ +export function decodeOwnerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "owner" function on the contract. + * @param options - The options for the owner function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { owner } from "thirdweb/extensions/assets"; + * + * const result = await owner({ + * contract, + * }); + * + * ``` + */ +export async function owner(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/ownershipHandoverExpiresAt.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/ownershipHandoverExpiresAt.ts new file mode 100644 index 00000000000..5625095f262 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/ownershipHandoverExpiresAt.ts @@ -0,0 +1,135 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "ownershipHandoverExpiresAt" function. + */ +export type OwnershipHandoverExpiresAtParams = { + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}; + +export const FN_SELECTOR = "0xfee81cf4" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `ownershipHandoverExpiresAt` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `ownershipHandoverExpiresAt` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnershipHandoverExpiresAtSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnershipHandoverExpiresAtSupported(["0x..."]); + * ``` + */ +export function isOwnershipHandoverExpiresAtSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "ownershipHandoverExpiresAt" function. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAtParams } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAtParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAtParams( + options: OwnershipHandoverExpiresAtParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "ownershipHandoverExpiresAt" function into a Hex string with its parameters. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAt({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAt( + options: OwnershipHandoverExpiresAtParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeOwnershipHandoverExpiresAtParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the ownershipHandoverExpiresAt function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnershipHandoverExpiresAtResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnershipHandoverExpiresAtResultResult("..."); + * ``` + */ +export function decodeOwnershipHandoverExpiresAtResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "ownershipHandoverExpiresAt" function on the contract. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { ownershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * + * const result = await ownershipHandoverExpiresAt({ + * contract, + * pendingOwner: ..., + * }); + * + * ``` + */ +export async function ownershipHandoverExpiresAt( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.pendingOwner], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/predictAssetAddress.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/predictAssetAddress.ts new file mode 100644 index 00000000000..79e47ec49be --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/predictAssetAddress.ts @@ -0,0 +1,183 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "predictAssetAddress" function. + */ +export type PredictAssetAddressParams = { + contractId: AbiParameterToPrimitiveType<{ + type: "bytes32"; + name: "contractId"; + }>; + creator: AbiParameterToPrimitiveType<{ type: "address"; name: "creator" }>; + params: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "params"; + components: [ + { type: "uint256"; name: "amount" }, + { type: "address"; name: "referrer" }, + { type: "bytes32"; name: "salt" }, + { type: "bytes"; name: "data" }, + { type: "bytes"; name: "hookData" }, + ]; + }>; +}; + +export const FN_SELECTOR = "0x8fc23f92" as const; +const FN_INPUTS = [ + { + type: "bytes32", + name: "contractId", + }, + { + type: "address", + name: "creator", + }, + { + type: "tuple", + name: "params", + components: [ + { + type: "uint256", + name: "amount", + }, + { + type: "address", + name: "referrer", + }, + { + type: "bytes32", + name: "salt", + }, + { + type: "bytes", + name: "data", + }, + { + type: "bytes", + name: "hookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "predicted", + }, +] as const; + +/** + * Checks if the `predictAssetAddress` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `predictAssetAddress` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isPredictAssetAddressSupported } from "thirdweb/extensions/assets"; + * const supported = isPredictAssetAddressSupported(["0x..."]); + * ``` + */ +export function isPredictAssetAddressSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "predictAssetAddress" function. + * @param options - The options for the predictAssetAddress function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodePredictAssetAddressParams } from "thirdweb/extensions/assets"; + * const result = encodePredictAssetAddressParams({ + * contractId: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodePredictAssetAddressParams( + options: PredictAssetAddressParams, +) { + return encodeAbiParameters(FN_INPUTS, [ + options.contractId, + options.creator, + options.params, + ]); +} + +/** + * Encodes the "predictAssetAddress" function into a Hex string with its parameters. + * @param options - The options for the predictAssetAddress function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodePredictAssetAddress } from "thirdweb/extensions/assets"; + * const result = encodePredictAssetAddress({ + * contractId: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodePredictAssetAddress(options: PredictAssetAddressParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodePredictAssetAddressParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the predictAssetAddress function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodePredictAssetAddressResult } from "thirdweb/extensions/assets"; + * const result = decodePredictAssetAddressResultResult("..."); + * ``` + */ +export function decodePredictAssetAddressResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "predictAssetAddress" function on the contract. + * @param options - The options for the predictAssetAddress function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { predictAssetAddress } from "thirdweb/extensions/assets"; + * + * const result = await predictAssetAddress({ + * contract, + * contractId: ..., + * creator: ..., + * params: ..., + * }); + * + * ``` + */ +export async function predictAssetAddress( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.contractId, options.creator, options.params], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/predictAssetAddressByConfig.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/predictAssetAddressByConfig.ts new file mode 100644 index 00000000000..779c4909a3a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/predictAssetAddressByConfig.ts @@ -0,0 +1,216 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "predictAssetAddressByConfig" function. + */ +export type PredictAssetAddressByConfigParams = { + config: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "config"; + components: [ + { type: "bytes32"; name: "contractId" }, + { type: "address"; name: "implementation" }, + { type: "uint8"; name: "implementationType" }, + { type: "uint8"; name: "createHook" }, + { type: "bytes"; name: "createHookData" }, + ]; + }>; + creator: AbiParameterToPrimitiveType<{ type: "address"; name: "creator" }>; + params: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "params"; + components: [ + { type: "uint256"; name: "amount" }, + { type: "address"; name: "referrer" }, + { type: "bytes32"; name: "salt" }, + { type: "bytes"; name: "data" }, + { type: "bytes"; name: "hookData" }, + ]; + }>; +}; + +export const FN_SELECTOR = "0x3e49076d" as const; +const FN_INPUTS = [ + { + type: "tuple", + name: "config", + components: [ + { + type: "bytes32", + name: "contractId", + }, + { + type: "address", + name: "implementation", + }, + { + type: "uint8", + name: "implementationType", + }, + { + type: "uint8", + name: "createHook", + }, + { + type: "bytes", + name: "createHookData", + }, + ], + }, + { + type: "address", + name: "creator", + }, + { + type: "tuple", + name: "params", + components: [ + { + type: "uint256", + name: "amount", + }, + { + type: "address", + name: "referrer", + }, + { + type: "bytes32", + name: "salt", + }, + { + type: "bytes", + name: "data", + }, + { + type: "bytes", + name: "hookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "predicted", + }, +] as const; + +/** + * Checks if the `predictAssetAddressByConfig` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `predictAssetAddressByConfig` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isPredictAssetAddressByConfigSupported } from "thirdweb/extensions/assets"; + * const supported = isPredictAssetAddressByConfigSupported(["0x..."]); + * ``` + */ +export function isPredictAssetAddressByConfigSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "predictAssetAddressByConfig" function. + * @param options - The options for the predictAssetAddressByConfig function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodePredictAssetAddressByConfigParams } from "thirdweb/extensions/assets"; + * const result = encodePredictAssetAddressByConfigParams({ + * config: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodePredictAssetAddressByConfigParams( + options: PredictAssetAddressByConfigParams, +) { + return encodeAbiParameters(FN_INPUTS, [ + options.config, + options.creator, + options.params, + ]); +} + +/** + * Encodes the "predictAssetAddressByConfig" function into a Hex string with its parameters. + * @param options - The options for the predictAssetAddressByConfig function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodePredictAssetAddressByConfig } from "thirdweb/extensions/assets"; + * const result = encodePredictAssetAddressByConfig({ + * config: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodePredictAssetAddressByConfig( + options: PredictAssetAddressByConfigParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodePredictAssetAddressByConfigParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the predictAssetAddressByConfig function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodePredictAssetAddressByConfigResult } from "thirdweb/extensions/assets"; + * const result = decodePredictAssetAddressByConfigResultResult("..."); + * ``` + */ +export function decodePredictAssetAddressByConfigResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "predictAssetAddressByConfig" function on the contract. + * @param options - The options for the predictAssetAddressByConfig function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { predictAssetAddressByConfig } from "thirdweb/extensions/assets"; + * + * const result = await predictAssetAddressByConfig({ + * contract, + * config: ..., + * creator: ..., + * params: ..., + * }); + * + * ``` + */ +export async function predictAssetAddressByConfig( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.config, options.creator, options.params], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/proxiableUUID.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/proxiableUUID.ts new file mode 100644 index 00000000000..fd62cd8e007 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/read/proxiableUUID.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x52d1902d" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "bytes32", + }, +] as const; + +/** + * Checks if the `proxiableUUID` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `proxiableUUID` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isProxiableUUIDSupported } from "thirdweb/extensions/assets"; + * const supported = isProxiableUUIDSupported(["0x..."]); + * ``` + */ +export function isProxiableUUIDSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the proxiableUUID function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeProxiableUUIDResult } from "thirdweb/extensions/assets"; + * const result = decodeProxiableUUIDResultResult("..."); + * ``` + */ +export function decodeProxiableUUIDResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "proxiableUUID" function on the contract. + * @param options - The options for the proxiableUUID function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { proxiableUUID } from "thirdweb/extensions/assets"; + * + * const result = await proxiableUUID({ + * contract, + * }); + * + * ``` + */ +export async function proxiableUUID(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/addImplementation.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/addImplementation.ts new file mode 100644 index 00000000000..1928273a182 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/addImplementation.ts @@ -0,0 +1,181 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "addImplementation" function. + */ +export type AddImplementationParams = WithOverrides<{ + config: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "config"; + components: [ + { type: "bytes32"; name: "contractId" }, + { type: "address"; name: "implementation" }, + { type: "uint8"; name: "implementationType" }, + { type: "uint8"; name: "createHook" }, + { type: "bytes"; name: "createHookData" }, + ]; + }>; + isDefault: AbiParameterToPrimitiveType<{ type: "bool"; name: "isDefault" }>; +}>; + +export const FN_SELECTOR = "0x4bf8055d" as const; +const FN_INPUTS = [ + { + type: "tuple", + name: "config", + components: [ + { + type: "bytes32", + name: "contractId", + }, + { + type: "address", + name: "implementation", + }, + { + type: "uint8", + name: "implementationType", + }, + { + type: "uint8", + name: "createHook", + }, + { + type: "bytes", + name: "createHookData", + }, + ], + }, + { + type: "bool", + name: "isDefault", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `addImplementation` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `addImplementation` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isAddImplementationSupported } from "thirdweb/extensions/assets"; + * + * const supported = isAddImplementationSupported(["0x..."]); + * ``` + */ +export function isAddImplementationSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "addImplementation" function. + * @param options - The options for the addImplementation function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeAddImplementationParams } from "thirdweb/extensions/assets"; + * const result = encodeAddImplementationParams({ + * config: ..., + * isDefault: ..., + * }); + * ``` + */ +export function encodeAddImplementationParams( + options: AddImplementationParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.config, options.isDefault]); +} + +/** + * Encodes the "addImplementation" function into a Hex string with its parameters. + * @param options - The options for the addImplementation function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeAddImplementation } from "thirdweb/extensions/assets"; + * const result = encodeAddImplementation({ + * config: ..., + * isDefault: ..., + * }); + * ``` + */ +export function encodeAddImplementation(options: AddImplementationParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeAddImplementationParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "addImplementation" function on the contract. + * @param options - The options for the "addImplementation" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { addImplementation } from "thirdweb/extensions/assets"; + * + * const transaction = addImplementation({ + * contract, + * config: ..., + * isDefault: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function addImplementation( + options: BaseTransactionOptions< + | AddImplementationParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.config, resolvedOptions.isDefault] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/buyAsset.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/buyAsset.ts new file mode 100644 index 00000000000..390056c69ad --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/buyAsset.ts @@ -0,0 +1,196 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "buyAsset" function. + */ +export type BuyAssetParams = WithOverrides<{ + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "asset" }>; + params: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "params"; + components: [ + { type: "address"; name: "recipient" }, + { type: "address"; name: "referrer" }, + { type: "address"; name: "tokenIn" }, + { type: "uint256"; name: "amountIn" }, + { type: "uint256"; name: "minAmountOut" }, + { type: "uint256"; name: "deadline" }, + { type: "bytes"; name: "hookData" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0x4af11f67" as const; +const FN_INPUTS = [ + { + type: "address", + name: "asset", + }, + { + type: "tuple", + name: "params", + components: [ + { + type: "address", + name: "recipient", + }, + { + type: "address", + name: "referrer", + }, + { + type: "address", + name: "tokenIn", + }, + { + type: "uint256", + name: "amountIn", + }, + { + type: "uint256", + name: "minAmountOut", + }, + { + type: "uint256", + name: "deadline", + }, + { + type: "bytes", + name: "hookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "amountIn", + }, + { + type: "uint256", + name: "amountOut", + }, +] as const; + +/** + * Checks if the `buyAsset` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `buyAsset` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isBuyAssetSupported } from "thirdweb/extensions/assets"; + * + * const supported = isBuyAssetSupported(["0x..."]); + * ``` + */ +export function isBuyAssetSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "buyAsset" function. + * @param options - The options for the buyAsset function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeBuyAssetParams } from "thirdweb/extensions/assets"; + * const result = encodeBuyAssetParams({ + * asset: ..., + * params: ..., + * }); + * ``` + */ +export function encodeBuyAssetParams(options: BuyAssetParams) { + return encodeAbiParameters(FN_INPUTS, [options.asset, options.params]); +} + +/** + * Encodes the "buyAsset" function into a Hex string with its parameters. + * @param options - The options for the buyAsset function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeBuyAsset } from "thirdweb/extensions/assets"; + * const result = encodeBuyAsset({ + * asset: ..., + * params: ..., + * }); + * ``` + */ +export function encodeBuyAsset(options: BuyAssetParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeBuyAssetParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "buyAsset" function on the contract. + * @param options - The options for the "buyAsset" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { buyAsset } from "thirdweb/extensions/assets"; + * + * const transaction = buyAsset({ + * contract, + * asset: ..., + * params: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function buyAsset( + options: BaseTransactionOptions< + | BuyAssetParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.asset, resolvedOptions.params] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/cancelOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/cancelOwnershipHandover.ts new file mode 100644 index 00000000000..a1e60004b43 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/cancelOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x54d1f13d" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `cancelOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `cancelOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCancelOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCancelOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCancelOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. + * @param options - The options for the "cancelOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { cancelOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = cancelOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function cancelOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/claimRewards.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/claimRewards.ts new file mode 100644 index 00000000000..794f0c1f7b7 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/claimRewards.ts @@ -0,0 +1,139 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "claimRewards" function. + */ +export type ClaimRewardsParams = WithOverrides<{ + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "asset" }>; +}>; + +export const FN_SELECTOR = "0xef5cfb8c" as const; +const FN_INPUTS = [ + { + type: "address", + name: "asset", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `claimRewards` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `claimRewards` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isClaimRewardsSupported } from "thirdweb/extensions/assets"; + * + * const supported = isClaimRewardsSupported(["0x..."]); + * ``` + */ +export function isClaimRewardsSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "claimRewards" function. + * @param options - The options for the claimRewards function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeClaimRewardsParams } from "thirdweb/extensions/assets"; + * const result = encodeClaimRewardsParams({ + * asset: ..., + * }); + * ``` + */ +export function encodeClaimRewardsParams(options: ClaimRewardsParams) { + return encodeAbiParameters(FN_INPUTS, [options.asset]); +} + +/** + * Encodes the "claimRewards" function into a Hex string with its parameters. + * @param options - The options for the claimRewards function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeClaimRewards } from "thirdweb/extensions/assets"; + * const result = encodeClaimRewards({ + * asset: ..., + * }); + * ``` + */ +export function encodeClaimRewards(options: ClaimRewardsParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeClaimRewardsParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "claimRewards" function on the contract. + * @param options - The options for the "claimRewards" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { claimRewards } from "thirdweb/extensions/assets"; + * + * const transaction = claimRewards({ + * contract, + * asset: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function claimRewards( + options: BaseTransactionOptions< + | ClaimRewardsParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.asset] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/completeOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/completeOwnershipHandover.ts new file mode 100644 index 00000000000..c4bf81966fe --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/completeOwnershipHandover.ts @@ -0,0 +1,148 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "completeOwnershipHandover" function. + */ +export type CompleteOwnershipHandoverParams = WithOverrides<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}>; + +export const FN_SELECTOR = "0xf04e283e" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `completeOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `completeOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCompleteOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCompleteOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCompleteOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "completeOwnershipHandover" function. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandoverParams } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandoverParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandoverParams( + options: CompleteOwnershipHandoverParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "completeOwnershipHandover" function into a Hex string with its parameters. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandover } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandover({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandover( + options: CompleteOwnershipHandoverParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCompleteOwnershipHandoverParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "completeOwnershipHandover" function on the contract. + * @param options - The options for the "completeOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { completeOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = completeOwnershipHandover({ + * contract, + * pendingOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function completeOwnershipHandover( + options: BaseTransactionOptions< + | CompleteOwnershipHandoverParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.pendingOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAsset.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAsset.ts new file mode 100644 index 00000000000..3ab09e5350e --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAsset.ts @@ -0,0 +1,187 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "createAsset" function. + */ +export type CreateAssetParams = WithOverrides<{ + creator: AbiParameterToPrimitiveType<{ type: "address"; name: "creator" }>; + createParams: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "createParams"; + components: [ + { type: "uint256"; name: "amount" }, + { type: "address"; name: "referrer" }, + { type: "bytes32"; name: "salt" }, + { type: "bytes"; name: "data" }, + { type: "bytes"; name: "hookData" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0x58ac06bd" as const; +const FN_INPUTS = [ + { + type: "address", + name: "creator", + }, + { + type: "tuple", + name: "createParams", + components: [ + { + type: "uint256", + name: "amount", + }, + { + type: "address", + name: "referrer", + }, + { + type: "bytes32", + name: "salt", + }, + { + type: "bytes", + name: "data", + }, + { + type: "bytes", + name: "hookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "asset", + }, +] as const; + +/** + * Checks if the `createAsset` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `createAsset` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCreateAssetSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCreateAssetSupported(["0x..."]); + * ``` + */ +export function isCreateAssetSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "createAsset" function. + * @param options - The options for the createAsset function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateAssetParams } from "thirdweb/extensions/assets"; + * const result = encodeCreateAssetParams({ + * creator: ..., + * createParams: ..., + * }); + * ``` + */ +export function encodeCreateAssetParams(options: CreateAssetParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.creator, + options.createParams, + ]); +} + +/** + * Encodes the "createAsset" function into a Hex string with its parameters. + * @param options - The options for the createAsset function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateAsset } from "thirdweb/extensions/assets"; + * const result = encodeCreateAsset({ + * creator: ..., + * createParams: ..., + * }); + * ``` + */ +export function encodeCreateAsset(options: CreateAssetParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCreateAssetParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "createAsset" function on the contract. + * @param options - The options for the "createAsset" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { createAsset } from "thirdweb/extensions/assets"; + * + * const transaction = createAsset({ + * contract, + * creator: ..., + * createParams: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function createAsset( + options: BaseTransactionOptions< + | CreateAssetParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.creator, resolvedOptions.createParams] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAssetById.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAssetById.ts new file mode 100644 index 00000000000..5c79d94b26a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAssetById.ts @@ -0,0 +1,203 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "createAssetById" function. + */ +export type CreateAssetByIdParams = WithOverrides<{ + contractId: AbiParameterToPrimitiveType<{ + type: "bytes32"; + name: "contractId"; + }>; + creator: AbiParameterToPrimitiveType<{ type: "address"; name: "creator" }>; + params: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "params"; + components: [ + { type: "uint256"; name: "amount" }, + { type: "address"; name: "referrer" }, + { type: "bytes32"; name: "salt" }, + { type: "bytes"; name: "data" }, + { type: "bytes"; name: "hookData" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0x1c8dd10a" as const; +const FN_INPUTS = [ + { + type: "bytes32", + name: "contractId", + }, + { + type: "address", + name: "creator", + }, + { + type: "tuple", + name: "params", + components: [ + { + type: "uint256", + name: "amount", + }, + { + type: "address", + name: "referrer", + }, + { + type: "bytes32", + name: "salt", + }, + { + type: "bytes", + name: "data", + }, + { + type: "bytes", + name: "hookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "asset", + }, +] as const; + +/** + * Checks if the `createAssetById` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `createAssetById` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCreateAssetByIdSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCreateAssetByIdSupported(["0x..."]); + * ``` + */ +export function isCreateAssetByIdSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "createAssetById" function. + * @param options - The options for the createAssetById function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateAssetByIdParams } from "thirdweb/extensions/assets"; + * const result = encodeCreateAssetByIdParams({ + * contractId: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodeCreateAssetByIdParams(options: CreateAssetByIdParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.contractId, + options.creator, + options.params, + ]); +} + +/** + * Encodes the "createAssetById" function into a Hex string with its parameters. + * @param options - The options for the createAssetById function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateAssetById } from "thirdweb/extensions/assets"; + * const result = encodeCreateAssetById({ + * contractId: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodeCreateAssetById(options: CreateAssetByIdParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCreateAssetByIdParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "createAssetById" function on the contract. + * @param options - The options for the "createAssetById" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { createAssetById } from "thirdweb/extensions/assets"; + * + * const transaction = createAssetById({ + * contract, + * contractId: ..., + * creator: ..., + * params: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function createAssetById( + options: BaseTransactionOptions< + | CreateAssetByIdParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.contractId, + resolvedOptions.creator, + resolvedOptions.params, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAssetByImplementationConfig.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAssetByImplementationConfig.ts new file mode 100644 index 00000000000..4c3c7c73308 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/createAssetByImplementationConfig.ts @@ -0,0 +1,238 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "createAssetByImplementationConfig" function. + */ +export type CreateAssetByImplementationConfigParams = WithOverrides<{ + config: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "config"; + components: [ + { type: "bytes32"; name: "contractId" }, + { type: "address"; name: "implementation" }, + { type: "uint8"; name: "implementationType" }, + { type: "uint8"; name: "createHook" }, + { type: "bytes"; name: "createHookData" }, + ]; + }>; + creator: AbiParameterToPrimitiveType<{ type: "address"; name: "creator" }>; + params: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "params"; + components: [ + { type: "uint256"; name: "amount" }, + { type: "address"; name: "referrer" }, + { type: "bytes32"; name: "salt" }, + { type: "bytes"; name: "data" }, + { type: "bytes"; name: "hookData" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0x230ffc78" as const; +const FN_INPUTS = [ + { + type: "tuple", + name: "config", + components: [ + { + type: "bytes32", + name: "contractId", + }, + { + type: "address", + name: "implementation", + }, + { + type: "uint8", + name: "implementationType", + }, + { + type: "uint8", + name: "createHook", + }, + { + type: "bytes", + name: "createHookData", + }, + ], + }, + { + type: "address", + name: "creator", + }, + { + type: "tuple", + name: "params", + components: [ + { + type: "uint256", + name: "amount", + }, + { + type: "address", + name: "referrer", + }, + { + type: "bytes32", + name: "salt", + }, + { + type: "bytes", + name: "data", + }, + { + type: "bytes", + name: "hookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "asset", + }, +] as const; + +/** + * Checks if the `createAssetByImplementationConfig` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `createAssetByImplementationConfig` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCreateAssetByImplementationConfigSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCreateAssetByImplementationConfigSupported(["0x..."]); + * ``` + */ +export function isCreateAssetByImplementationConfigSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "createAssetByImplementationConfig" function. + * @param options - The options for the createAssetByImplementationConfig function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateAssetByImplementationConfigParams } from "thirdweb/extensions/assets"; + * const result = encodeCreateAssetByImplementationConfigParams({ + * config: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodeCreateAssetByImplementationConfigParams( + options: CreateAssetByImplementationConfigParams, +) { + return encodeAbiParameters(FN_INPUTS, [ + options.config, + options.creator, + options.params, + ]); +} + +/** + * Encodes the "createAssetByImplementationConfig" function into a Hex string with its parameters. + * @param options - The options for the createAssetByImplementationConfig function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateAssetByImplementationConfig } from "thirdweb/extensions/assets"; + * const result = encodeCreateAssetByImplementationConfig({ + * config: ..., + * creator: ..., + * params: ..., + * }); + * ``` + */ +export function encodeCreateAssetByImplementationConfig( + options: CreateAssetByImplementationConfigParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCreateAssetByImplementationConfigParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "createAssetByImplementationConfig" function on the contract. + * @param options - The options for the "createAssetByImplementationConfig" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { createAssetByImplementationConfig } from "thirdweb/extensions/assets"; + * + * const transaction = createAssetByImplementationConfig({ + * contract, + * config: ..., + * creator: ..., + * params: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function createAssetByImplementationConfig( + options: BaseTransactionOptions< + | CreateAssetByImplementationConfigParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.config, + resolvedOptions.creator, + resolvedOptions.params, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/distributeAsset.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/distributeAsset.ts new file mode 100644 index 00000000000..49d845a11d2 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/distributeAsset.ts @@ -0,0 +1,164 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "distributeAsset" function. + */ +export type DistributeAssetParams = WithOverrides<{ + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "asset" }>; + contents: AbiParameterToPrimitiveType<{ + type: "tuple[]"; + name: "contents"; + components: [ + { type: "uint256"; name: "amount" }, + { type: "address"; name: "recipient" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0x5954167a" as const; +const FN_INPUTS = [ + { + type: "address", + name: "asset", + }, + { + type: "tuple[]", + name: "contents", + components: [ + { + type: "uint256", + name: "amount", + }, + { + type: "address", + name: "recipient", + }, + ], + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `distributeAsset` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `distributeAsset` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isDistributeAssetSupported } from "thirdweb/extensions/assets"; + * + * const supported = isDistributeAssetSupported(["0x..."]); + * ``` + */ +export function isDistributeAssetSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "distributeAsset" function. + * @param options - The options for the distributeAsset function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeDistributeAssetParams } from "thirdweb/extensions/assets"; + * const result = encodeDistributeAssetParams({ + * asset: ..., + * contents: ..., + * }); + * ``` + */ +export function encodeDistributeAssetParams(options: DistributeAssetParams) { + return encodeAbiParameters(FN_INPUTS, [options.asset, options.contents]); +} + +/** + * Encodes the "distributeAsset" function into a Hex string with its parameters. + * @param options - The options for the distributeAsset function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeDistributeAsset } from "thirdweb/extensions/assets"; + * const result = encodeDistributeAsset({ + * asset: ..., + * contents: ..., + * }); + * ``` + */ +export function encodeDistributeAsset(options: DistributeAssetParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeDistributeAssetParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "distributeAsset" function on the contract. + * @param options - The options for the "distributeAsset" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { distributeAsset } from "thirdweb/extensions/assets"; + * + * const transaction = distributeAsset({ + * contract, + * asset: ..., + * contents: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function distributeAsset( + options: BaseTransactionOptions< + | DistributeAssetParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.asset, resolvedOptions.contents] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/initialize.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/initialize.ts new file mode 100644 index 00000000000..9b4ed568539 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/initialize.ts @@ -0,0 +1,176 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "initialize" function. + */ +export type InitializeParams = WithOverrides<{ + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner" }>; + router: AbiParameterToPrimitiveType<{ type: "address"; name: "router" }>; + rewardLocker: AbiParameterToPrimitiveType<{ + type: "address"; + name: "rewardLocker"; + }>; + airdrop: AbiParameterToPrimitiveType<{ type: "address"; name: "airdrop" }>; +}>; + +export const FN_SELECTOR = "0xf8c8765e" as const; +const FN_INPUTS = [ + { + type: "address", + name: "owner", + }, + { + type: "address", + name: "router", + }, + { + type: "address", + name: "rewardLocker", + }, + { + type: "address", + name: "airdrop", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `initialize` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `initialize` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isInitializeSupported } from "thirdweb/extensions/assets"; + * + * const supported = isInitializeSupported(["0x..."]); + * ``` + */ +export function isInitializeSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "initialize" function. + * @param options - The options for the initialize function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeInitializeParams } from "thirdweb/extensions/assets"; + * const result = encodeInitializeParams({ + * owner: ..., + * router: ..., + * rewardLocker: ..., + * airdrop: ..., + * }); + * ``` + */ +export function encodeInitializeParams(options: InitializeParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.owner, + options.router, + options.rewardLocker, + options.airdrop, + ]); +} + +/** + * Encodes the "initialize" function into a Hex string with its parameters. + * @param options - The options for the initialize function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeInitialize } from "thirdweb/extensions/assets"; + * const result = encodeInitialize({ + * owner: ..., + * router: ..., + * rewardLocker: ..., + * airdrop: ..., + * }); + * ``` + */ +export function encodeInitialize(options: InitializeParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeInitializeParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "initialize" function on the contract. + * @param options - The options for the "initialize" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { initialize } from "thirdweb/extensions/assets"; + * + * const transaction = initialize({ + * contract, + * owner: ..., + * router: ..., + * rewardLocker: ..., + * airdrop: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function initialize( + options: BaseTransactionOptions< + | InitializeParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.owner, + resolvedOptions.router, + resolvedOptions.rewardLocker, + resolvedOptions.airdrop, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/listAsset.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/listAsset.ts new file mode 100644 index 00000000000..ff12a1e5de2 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/listAsset.ts @@ -0,0 +1,207 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "listAsset" function. + */ +export type ListAssetParams = WithOverrides<{ + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "asset" }>; + params: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "params"; + components: [ + { type: "address"; name: "tokenOut" }, + { type: "uint256"; name: "pricePerUnit" }, + { type: "uint8"; name: "priceDenominator" }, + { type: "uint256"; name: "totalSupply" }, + { type: "uint48"; name: "startTime" }, + { type: "uint48"; name: "endTime" }, + { type: "address"; name: "hook" }, + { type: "bytes"; name: "createHookData" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0xe83a685a" as const; +const FN_INPUTS = [ + { + type: "address", + name: "asset", + }, + { + type: "tuple", + name: "params", + components: [ + { + type: "address", + name: "tokenOut", + }, + { + type: "uint256", + name: "pricePerUnit", + }, + { + type: "uint8", + name: "priceDenominator", + }, + { + type: "uint256", + name: "totalSupply", + }, + { + type: "uint48", + name: "startTime", + }, + { + type: "uint48", + name: "endTime", + }, + { + type: "address", + name: "hook", + }, + { + type: "bytes", + name: "createHookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "sale", + }, + { + type: "address", + name: "position", + }, + { + type: "uint256", + name: "positionId", + }, +] as const; + +/** + * Checks if the `listAsset` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `listAsset` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isListAssetSupported } from "thirdweb/extensions/assets"; + * + * const supported = isListAssetSupported(["0x..."]); + * ``` + */ +export function isListAssetSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "listAsset" function. + * @param options - The options for the listAsset function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeListAssetParams } from "thirdweb/extensions/assets"; + * const result = encodeListAssetParams({ + * asset: ..., + * params: ..., + * }); + * ``` + */ +export function encodeListAssetParams(options: ListAssetParams) { + return encodeAbiParameters(FN_INPUTS, [options.asset, options.params]); +} + +/** + * Encodes the "listAsset" function into a Hex string with its parameters. + * @param options - The options for the listAsset function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeListAsset } from "thirdweb/extensions/assets"; + * const result = encodeListAsset({ + * asset: ..., + * params: ..., + * }); + * ``` + */ +export function encodeListAsset(options: ListAssetParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeListAssetParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "listAsset" function on the contract. + * @param options - The options for the "listAsset" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { listAsset } from "thirdweb/extensions/assets"; + * + * const transaction = listAsset({ + * contract, + * asset: ..., + * params: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function listAsset( + options: BaseTransactionOptions< + | ListAssetParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.asset, resolvedOptions.params] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/renounceOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/renounceOwnership.ts new file mode 100644 index 00000000000..7b8b575e3b4 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/renounceOwnership.ts @@ -0,0 +1,50 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x715018a6" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `renounceOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `renounceOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRenounceOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRenounceOwnershipSupported(["0x..."]); + * ``` + */ +export function isRenounceOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "renounceOwnership" function on the contract. + * @param options - The options for the "renounceOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { renounceOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = renounceOwnership(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function renounceOwnership(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/requestOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/requestOwnershipHandover.ts new file mode 100644 index 00000000000..e0744619fae --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/requestOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x25692962" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `requestOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `requestOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRequestOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRequestOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isRequestOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "requestOwnershipHandover" function on the contract. + * @param options - The options for the "requestOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { requestOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = requestOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function requestOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/sellAsset.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/sellAsset.ts new file mode 100644 index 00000000000..df1ea6b0785 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/sellAsset.ts @@ -0,0 +1,193 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "sellAsset" function. + */ +export type SellAssetParams = WithOverrides<{ + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "asset" }>; + params: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "params"; + components: [ + { type: "address"; name: "recipient" }, + { type: "address"; name: "tokenOut" }, + { type: "uint256"; name: "amountIn" }, + { type: "uint256"; name: "minAmountOut" }, + { type: "uint256"; name: "deadline" }, + { type: "bytes"; name: "hookData" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0x5de3eedb" as const; +const FN_INPUTS = [ + { + type: "address", + name: "asset", + }, + { + type: "tuple", + name: "params", + components: [ + { + type: "address", + name: "recipient", + }, + { + type: "address", + name: "tokenOut", + }, + { + type: "uint256", + name: "amountIn", + }, + { + type: "uint256", + name: "minAmountOut", + }, + { + type: "uint256", + name: "deadline", + }, + { + type: "bytes", + name: "hookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "amountIn", + }, + { + type: "uint256", + name: "amountOut", + }, +] as const; + +/** + * Checks if the `sellAsset` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `sellAsset` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSellAssetSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSellAssetSupported(["0x..."]); + * ``` + */ +export function isSellAssetSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "sellAsset" function. + * @param options - The options for the sellAsset function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSellAssetParams } from "thirdweb/extensions/assets"; + * const result = encodeSellAssetParams({ + * asset: ..., + * params: ..., + * }); + * ``` + */ +export function encodeSellAssetParams(options: SellAssetParams) { + return encodeAbiParameters(FN_INPUTS, [options.asset, options.params]); +} + +/** + * Encodes the "sellAsset" function into a Hex string with its parameters. + * @param options - The options for the sellAsset function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSellAsset } from "thirdweb/extensions/assets"; + * const result = encodeSellAsset({ + * asset: ..., + * params: ..., + * }); + * ``` + */ +export function encodeSellAsset(options: SellAssetParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSellAssetParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "sellAsset" function on the contract. + * @param options - The options for the "sellAsset" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { sellAsset } from "thirdweb/extensions/assets"; + * + * const transaction = sellAsset({ + * contract, + * asset: ..., + * params: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function sellAsset( + options: BaseTransactionOptions< + | SellAssetParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.asset, resolvedOptions.params] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setAirdrop.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setAirdrop.ts new file mode 100644 index 00000000000..98ea672ed10 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setAirdrop.ts @@ -0,0 +1,139 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setAirdrop" function. + */ +export type SetAirdropParams = WithOverrides<{ + airdrop: AbiParameterToPrimitiveType<{ type: "address"; name: "airdrop" }>; +}>; + +export const FN_SELECTOR = "0x72820dbc" as const; +const FN_INPUTS = [ + { + type: "address", + name: "airdrop", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setAirdrop` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setAirdrop` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetAirdropSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetAirdropSupported(["0x..."]); + * ``` + */ +export function isSetAirdropSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setAirdrop" function. + * @param options - The options for the setAirdrop function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetAirdropParams } from "thirdweb/extensions/assets"; + * const result = encodeSetAirdropParams({ + * airdrop: ..., + * }); + * ``` + */ +export function encodeSetAirdropParams(options: SetAirdropParams) { + return encodeAbiParameters(FN_INPUTS, [options.airdrop]); +} + +/** + * Encodes the "setAirdrop" function into a Hex string with its parameters. + * @param options - The options for the setAirdrop function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetAirdrop } from "thirdweb/extensions/assets"; + * const result = encodeSetAirdrop({ + * airdrop: ..., + * }); + * ``` + */ +export function encodeSetAirdrop(options: SetAirdropParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetAirdropParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setAirdrop" function on the contract. + * @param options - The options for the "setAirdrop" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setAirdrop } from "thirdweb/extensions/assets"; + * + * const transaction = setAirdrop({ + * contract, + * airdrop: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setAirdrop( + options: BaseTransactionOptions< + | SetAirdropParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.airdrop] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setRewardLocker.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setRewardLocker.ts new file mode 100644 index 00000000000..159899d75b1 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setRewardLocker.ts @@ -0,0 +1,142 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setRewardLocker" function. + */ +export type SetRewardLockerParams = WithOverrides<{ + rewardLocker: AbiParameterToPrimitiveType<{ + type: "address"; + name: "rewardLocker"; + }>; +}>; + +export const FN_SELECTOR = "0xeb7fb197" as const; +const FN_INPUTS = [ + { + type: "address", + name: "rewardLocker", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setRewardLocker` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setRewardLocker` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetRewardLockerSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetRewardLockerSupported(["0x..."]); + * ``` + */ +export function isSetRewardLockerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setRewardLocker" function. + * @param options - The options for the setRewardLocker function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetRewardLockerParams } from "thirdweb/extensions/assets"; + * const result = encodeSetRewardLockerParams({ + * rewardLocker: ..., + * }); + * ``` + */ +export function encodeSetRewardLockerParams(options: SetRewardLockerParams) { + return encodeAbiParameters(FN_INPUTS, [options.rewardLocker]); +} + +/** + * Encodes the "setRewardLocker" function into a Hex string with its parameters. + * @param options - The options for the setRewardLocker function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetRewardLocker } from "thirdweb/extensions/assets"; + * const result = encodeSetRewardLocker({ + * rewardLocker: ..., + * }); + * ``` + */ +export function encodeSetRewardLocker(options: SetRewardLockerParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetRewardLockerParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setRewardLocker" function on the contract. + * @param options - The options for the "setRewardLocker" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setRewardLocker } from "thirdweb/extensions/assets"; + * + * const transaction = setRewardLocker({ + * contract, + * rewardLocker: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setRewardLocker( + options: BaseTransactionOptions< + | SetRewardLockerParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.rewardLocker] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setRouter.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setRouter.ts new file mode 100644 index 00000000000..5245d9c150d --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/setRouter.ts @@ -0,0 +1,139 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setRouter" function. + */ +export type SetRouterParams = WithOverrides<{ + router: AbiParameterToPrimitiveType<{ type: "address"; name: "router" }>; +}>; + +export const FN_SELECTOR = "0xc0d78655" as const; +const FN_INPUTS = [ + { + type: "address", + name: "router", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setRouter` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setRouter` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetRouterSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetRouterSupported(["0x..."]); + * ``` + */ +export function isSetRouterSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setRouter" function. + * @param options - The options for the setRouter function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetRouterParams } from "thirdweb/extensions/assets"; + * const result = encodeSetRouterParams({ + * router: ..., + * }); + * ``` + */ +export function encodeSetRouterParams(options: SetRouterParams) { + return encodeAbiParameters(FN_INPUTS, [options.router]); +} + +/** + * Encodes the "setRouter" function into a Hex string with its parameters. + * @param options - The options for the setRouter function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetRouter } from "thirdweb/extensions/assets"; + * const result = encodeSetRouter({ + * router: ..., + * }); + * ``` + */ +export function encodeSetRouter(options: SetRouterParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetRouterParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setRouter" function on the contract. + * @param options - The options for the "setRouter" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setRouter } from "thirdweb/extensions/assets"; + * + * const transaction = setRouter({ + * contract, + * router: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setRouter( + options: BaseTransactionOptions< + | SetRouterParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.router] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/transferOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/transferOwnership.ts new file mode 100644 index 00000000000..36f0df68e14 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/transferOwnership.ts @@ -0,0 +1,141 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "transferOwnership" function. + */ +export type TransferOwnershipParams = WithOverrides<{ + newOwner: AbiParameterToPrimitiveType<{ type: "address"; name: "newOwner" }>; +}>; + +export const FN_SELECTOR = "0xf2fde38b" as const; +const FN_INPUTS = [ + { + type: "address", + name: "newOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `transferOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `transferOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isTransferOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isTransferOwnershipSupported(["0x..."]); + * ``` + */ +export function isTransferOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "transferOwnership" function. + * @param options - The options for the transferOwnership function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnershipParams } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnershipParams({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnershipParams( + options: TransferOwnershipParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.newOwner]); +} + +/** + * Encodes the "transferOwnership" function into a Hex string with its parameters. + * @param options - The options for the transferOwnership function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnership } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnership({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnership(options: TransferOwnershipParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeTransferOwnershipParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "transferOwnership" function on the contract. + * @param options - The options for the "transferOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { transferOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = transferOwnership({ + * contract, + * newOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function transferOwnership( + options: BaseTransactionOptions< + | TransferOwnershipParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.newOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/upgradeToAndCall.ts b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/upgradeToAndCall.ts new file mode 100644 index 00000000000..63e1152f422 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/ERC20AssetEntrypoint/write/upgradeToAndCall.ts @@ -0,0 +1,153 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "upgradeToAndCall" function. + */ +export type UpgradeToAndCallParams = WithOverrides<{ + newImplementation: AbiParameterToPrimitiveType<{ + type: "address"; + name: "newImplementation"; + }>; + data: AbiParameterToPrimitiveType<{ type: "bytes"; name: "data" }>; +}>; + +export const FN_SELECTOR = "0x4f1ef286" as const; +const FN_INPUTS = [ + { + type: "address", + name: "newImplementation", + }, + { + type: "bytes", + name: "data", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `upgradeToAndCall` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `upgradeToAndCall` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isUpgradeToAndCallSupported } from "thirdweb/extensions/assets"; + * + * const supported = isUpgradeToAndCallSupported(["0x..."]); + * ``` + */ +export function isUpgradeToAndCallSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "upgradeToAndCall" function. + * @param options - The options for the upgradeToAndCall function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeUpgradeToAndCallParams } from "thirdweb/extensions/assets"; + * const result = encodeUpgradeToAndCallParams({ + * newImplementation: ..., + * data: ..., + * }); + * ``` + */ +export function encodeUpgradeToAndCallParams(options: UpgradeToAndCallParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.newImplementation, + options.data, + ]); +} + +/** + * Encodes the "upgradeToAndCall" function into a Hex string with its parameters. + * @param options - The options for the upgradeToAndCall function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeUpgradeToAndCall } from "thirdweb/extensions/assets"; + * const result = encodeUpgradeToAndCall({ + * newImplementation: ..., + * data: ..., + * }); + * ``` + */ +export function encodeUpgradeToAndCall(options: UpgradeToAndCallParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeUpgradeToAndCallParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "upgradeToAndCall" function on the contract. + * @param options - The options for the "upgradeToAndCall" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { upgradeToAndCall } from "thirdweb/extensions/assets"; + * + * const transaction = upgradeToAndCall({ + * contract, + * newImplementation: ..., + * data: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function upgradeToAndCall( + options: BaseTransactionOptions< + | UpgradeToAndCallParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.newImplementation, resolvedOptions.data] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeConfigUpdated.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeConfigUpdated.ts new file mode 100644 index 00000000000..5128c83b16d --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeConfigUpdated.ts @@ -0,0 +1,49 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "FeeConfigUpdated" event. + */ +export type FeeConfigUpdatedEventFilters = Partial<{ + target: AbiParameterToPrimitiveType<{ + type: "address"; + name: "target"; + indexed: true; + }>; + action: AbiParameterToPrimitiveType<{ + type: "bytes4"; + name: "action"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the FeeConfigUpdated event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { feeConfigUpdatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * feeConfigUpdatedEvent({ + * target: ..., + * action: ..., + * }) + * ], + * }); + * ``` + */ +export function feeConfigUpdatedEvent( + filters: FeeConfigUpdatedEventFilters = {}, +) { + return prepareEvent({ + signature: + "event FeeConfigUpdated(address indexed target, bytes4 indexed action, address recipient, uint8 feeType, uint256 value)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeConfigUpdatedBySignature.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeConfigUpdatedBySignature.ts new file mode 100644 index 00000000000..d32666975bc --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeConfigUpdatedBySignature.ts @@ -0,0 +1,55 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "FeeConfigUpdatedBySignature" event. + */ +export type FeeConfigUpdatedBySignatureEventFilters = Partial<{ + signer: AbiParameterToPrimitiveType<{ + type: "address"; + name: "signer"; + indexed: true; + }>; + target: AbiParameterToPrimitiveType<{ + type: "address"; + name: "target"; + indexed: true; + }>; + action: AbiParameterToPrimitiveType<{ + type: "bytes4"; + name: "action"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the FeeConfigUpdatedBySignature event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { feeConfigUpdatedBySignatureEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * feeConfigUpdatedBySignatureEvent({ + * signer: ..., + * target: ..., + * action: ..., + * }) + * ], + * }); + * ``` + */ +export function feeConfigUpdatedBySignatureEvent( + filters: FeeConfigUpdatedBySignatureEventFilters = {}, +) { + return prepareEvent({ + signature: + "event FeeConfigUpdatedBySignature(address indexed signer, address indexed target, bytes4 indexed action, address recipient, uint8 feeType, uint256 value)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeRecipientUpdated.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeRecipientUpdated.ts new file mode 100644 index 00000000000..bf300bbf21a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/FeeRecipientUpdated.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the FeeRecipientUpdated event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { feeRecipientUpdatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * feeRecipientUpdatedEvent() + * ], + * }); + * ``` + */ +export function feeRecipientUpdatedEvent() { + return prepareEvent({ + signature: "event FeeRecipientUpdated(address feeRecipient)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipHandoverCanceled.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipHandoverCanceled.ts new file mode 100644 index 00000000000..2ab8996b8d3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipHandoverCanceled.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverCanceled" event. + */ +export type OwnershipHandoverCanceledEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverCanceled event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverCanceledEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverCanceledEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverCanceledEvent( + filters: OwnershipHandoverCanceledEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverCanceled(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipHandoverRequested.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipHandoverRequested.ts new file mode 100644 index 00000000000..a498506409a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipHandoverRequested.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverRequested" event. + */ +export type OwnershipHandoverRequestedEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverRequested event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverRequestedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverRequestedEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverRequestedEvent( + filters: OwnershipHandoverRequestedEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverRequested(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipTransferred.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipTransferred.ts new file mode 100644 index 00000000000..b1be6e750e1 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/OwnershipTransferred.ts @@ -0,0 +1,49 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipTransferred" event. + */ +export type OwnershipTransferredEventFilters = Partial<{ + oldOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "oldOwner"; + indexed: true; + }>; + newOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "newOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipTransferred event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipTransferredEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipTransferredEvent({ + * oldOwner: ..., + * newOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipTransferredEvent( + filters: OwnershipTransferredEventFilters = {}, +) { + return prepareEvent({ + signature: + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/RolesUpdated.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/RolesUpdated.ts new file mode 100644 index 00000000000..67aa23f71ff --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/events/RolesUpdated.ts @@ -0,0 +1,47 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "RolesUpdated" event. + */ +export type RolesUpdatedEventFilters = Partial<{ + user: AbiParameterToPrimitiveType<{ + type: "address"; + name: "user"; + indexed: true; + }>; + roles: AbiParameterToPrimitiveType<{ + type: "uint256"; + name: "roles"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the RolesUpdated event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { rolesUpdatedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * rolesUpdatedEvent({ + * user: ..., + * roles: ..., + * }) + * ], + * }); + * ``` + */ +export function rolesUpdatedEvent(filters: RolesUpdatedEventFilters = {}) { + return prepareEvent({ + signature: + "event RolesUpdated(address indexed user, uint256 indexed roles)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/ROLE_FEE_MANAGER.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/ROLE_FEE_MANAGER.ts new file mode 100644 index 00000000000..449bf58bc2a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/ROLE_FEE_MANAGER.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x99ba5936" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + }, +] as const; + +/** + * Checks if the `ROLE_FEE_MANAGER` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `ROLE_FEE_MANAGER` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isROLE_FEE_MANAGERSupported } from "thirdweb/extensions/assets"; + * const supported = isROLE_FEE_MANAGERSupported(["0x..."]); + * ``` + */ +export function isROLE_FEE_MANAGERSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the ROLE_FEE_MANAGER function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeROLE_FEE_MANAGERResult } from "thirdweb/extensions/assets"; + * const result = decodeROLE_FEE_MANAGERResultResult("..."); + * ``` + */ +export function decodeROLE_FEE_MANAGERResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "ROLE_FEE_MANAGER" function on the contract. + * @param options - The options for the ROLE_FEE_MANAGER function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { ROLE_FEE_MANAGER } from "thirdweb/extensions/assets"; + * + * const result = await ROLE_FEE_MANAGER({ + * contract, + * }); + * + * ``` + */ +export async function ROLE_FEE_MANAGER(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/calculateFee.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/calculateFee.ts new file mode 100644 index 00000000000..325ff4c94df --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/calculateFee.ts @@ -0,0 +1,167 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "calculateFee" function. + */ +export type CalculateFeeParams = { + payer: AbiParameterToPrimitiveType<{ type: "address"; name: "payer" }>; + action: AbiParameterToPrimitiveType<{ type: "bytes4"; name: "action" }>; + amount: AbiParameterToPrimitiveType<{ type: "uint256"; name: "amount" }>; + maxFeeAmount: AbiParameterToPrimitiveType<{ + type: "uint256"; + name: "maxFeeAmount"; + }>; +}; + +export const FN_SELECTOR = "0x69588801" as const; +const FN_INPUTS = [ + { + type: "address", + name: "payer", + }, + { + type: "bytes4", + name: "action", + }, + { + type: "uint256", + name: "amount", + }, + { + type: "uint256", + name: "maxFeeAmount", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "recipient", + }, + { + type: "uint256", + name: "feeAmount", + }, +] as const; + +/** + * Checks if the `calculateFee` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `calculateFee` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCalculateFeeSupported } from "thirdweb/extensions/assets"; + * const supported = isCalculateFeeSupported(["0x..."]); + * ``` + */ +export function isCalculateFeeSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "calculateFee" function. + * @param options - The options for the calculateFee function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCalculateFeeParams } from "thirdweb/extensions/assets"; + * const result = encodeCalculateFeeParams({ + * payer: ..., + * action: ..., + * amount: ..., + * maxFeeAmount: ..., + * }); + * ``` + */ +export function encodeCalculateFeeParams(options: CalculateFeeParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.payer, + options.action, + options.amount, + options.maxFeeAmount, + ]); +} + +/** + * Encodes the "calculateFee" function into a Hex string with its parameters. + * @param options - The options for the calculateFee function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCalculateFee } from "thirdweb/extensions/assets"; + * const result = encodeCalculateFee({ + * payer: ..., + * action: ..., + * amount: ..., + * maxFeeAmount: ..., + * }); + * ``` + */ +export function encodeCalculateFee(options: CalculateFeeParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCalculateFeeParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the calculateFee function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeCalculateFeeResult } from "thirdweb/extensions/assets"; + * const result = decodeCalculateFeeResultResult("..."); + * ``` + */ +export function decodeCalculateFeeResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result); +} + +/** + * Calls the "calculateFee" function on the contract. + * @param options - The options for the calculateFee function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { calculateFee } from "thirdweb/extensions/assets"; + * + * const result = await calculateFee({ + * contract, + * payer: ..., + * action: ..., + * amount: ..., + * maxFeeAmount: ..., + * }); + * + * ``` + */ +export async function calculateFee( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [ + options.payer, + options.action, + options.amount, + options.maxFeeAmount, + ], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/domainSeparator.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/domainSeparator.ts new file mode 100644 index 00000000000..2d3a7ff9ee3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/domainSeparator.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0xf698da25" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "bytes32", + }, +] as const; + +/** + * Checks if the `domainSeparator` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `domainSeparator` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isDomainSeparatorSupported } from "thirdweb/extensions/assets"; + * const supported = isDomainSeparatorSupported(["0x..."]); + * ``` + */ +export function isDomainSeparatorSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the domainSeparator function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeDomainSeparatorResult } from "thirdweb/extensions/assets"; + * const result = decodeDomainSeparatorResultResult("..."); + * ``` + */ +export function decodeDomainSeparatorResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "domainSeparator" function on the contract. + * @param options - The options for the domainSeparator function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { domainSeparator } from "thirdweb/extensions/assets"; + * + * const result = await domainSeparator({ + * contract, + * }); + * + * ``` + */ +export async function domainSeparator(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/eip712Domain.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/eip712Domain.ts new file mode 100644 index 00000000000..652bbb76ec8 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/eip712Domain.ts @@ -0,0 +1,95 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x84b0196e" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "bytes1", + name: "fields", + }, + { + type: "string", + name: "name", + }, + { + type: "string", + name: "version", + }, + { + type: "uint256", + name: "chainId", + }, + { + type: "address", + name: "verifyingContract", + }, + { + type: "bytes32", + name: "salt", + }, + { + type: "uint256[]", + name: "extensions", + }, +] as const; + +/** + * Checks if the `eip712Domain` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `eip712Domain` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isEip712DomainSupported } from "thirdweb/extensions/assets"; + * const supported = isEip712DomainSupported(["0x..."]); + * ``` + */ +export function isEip712DomainSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the eip712Domain function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeEip712DomainResult } from "thirdweb/extensions/assets"; + * const result = decodeEip712DomainResultResult("..."); + * ``` + */ +export function decodeEip712DomainResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result); +} + +/** + * Calls the "eip712Domain" function on the contract. + * @param options - The options for the eip712Domain function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { eip712Domain } from "thirdweb/extensions/assets"; + * + * const result = await eip712Domain({ + * contract, + * }); + * + * ``` + */ +export async function eip712Domain(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/feeConfigs.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/feeConfigs.ts new file mode 100644 index 00000000000..616184e5f1f --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/feeConfigs.ts @@ -0,0 +1,142 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "feeConfigs" function. + */ +export type FeeConfigsParams = { + target: AbiParameterToPrimitiveType<{ type: "address"; name: "target" }>; + action: AbiParameterToPrimitiveType<{ type: "bytes4"; name: "action" }>; +}; + +export const FN_SELECTOR = "0x758515e1" as const; +const FN_INPUTS = [ + { + type: "address", + name: "target", + }, + { + type: "bytes4", + name: "action", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "recipient", + }, + { + type: "uint8", + name: "feeType", + }, + { + type: "uint256", + name: "value", + }, +] as const; + +/** + * Checks if the `feeConfigs` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `feeConfigs` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isFeeConfigsSupported } from "thirdweb/extensions/assets"; + * const supported = isFeeConfigsSupported(["0x..."]); + * ``` + */ +export function isFeeConfigsSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "feeConfigs" function. + * @param options - The options for the feeConfigs function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeFeeConfigsParams } from "thirdweb/extensions/assets"; + * const result = encodeFeeConfigsParams({ + * target: ..., + * action: ..., + * }); + * ``` + */ +export function encodeFeeConfigsParams(options: FeeConfigsParams) { + return encodeAbiParameters(FN_INPUTS, [options.target, options.action]); +} + +/** + * Encodes the "feeConfigs" function into a Hex string with its parameters. + * @param options - The options for the feeConfigs function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeFeeConfigs } from "thirdweb/extensions/assets"; + * const result = encodeFeeConfigs({ + * target: ..., + * action: ..., + * }); + * ``` + */ +export function encodeFeeConfigs(options: FeeConfigsParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeFeeConfigsParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the feeConfigs function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeFeeConfigsResult } from "thirdweb/extensions/assets"; + * const result = decodeFeeConfigsResultResult("..."); + * ``` + */ +export function decodeFeeConfigsResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result); +} + +/** + * Calls the "feeConfigs" function on the contract. + * @param options - The options for the feeConfigs function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { feeConfigs } from "thirdweb/extensions/assets"; + * + * const result = await feeConfigs({ + * contract, + * target: ..., + * action: ..., + * }); + * + * ``` + */ +export async function feeConfigs( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.target, options.action], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/feeRecipient.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/feeRecipient.ts new file mode 100644 index 00000000000..fe9c0c425b3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/feeRecipient.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x46904840" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + }, +] as const; + +/** + * Checks if the `feeRecipient` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `feeRecipient` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isFeeRecipientSupported } from "thirdweb/extensions/assets"; + * const supported = isFeeRecipientSupported(["0x..."]); + * ``` + */ +export function isFeeRecipientSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the feeRecipient function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeFeeRecipientResult } from "thirdweb/extensions/assets"; + * const result = decodeFeeRecipientResultResult("..."); + * ``` + */ +export function decodeFeeRecipientResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "feeRecipient" function on the contract. + * @param options - The options for the feeRecipient function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { feeRecipient } from "thirdweb/extensions/assets"; + * + * const result = await feeRecipient({ + * contract, + * }); + * + * ``` + */ +export async function feeRecipient(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/getFeeConfig.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/getFeeConfig.ts new file mode 100644 index 00000000000..b8de65828ce --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/getFeeConfig.ts @@ -0,0 +1,148 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "getFeeConfig" function. + */ +export type GetFeeConfigParams = { + target: AbiParameterToPrimitiveType<{ type: "address"; name: "target" }>; + action: AbiParameterToPrimitiveType<{ type: "bytes4"; name: "action" }>; +}; + +export const FN_SELECTOR = "0x17305ee1" as const; +const FN_INPUTS = [ + { + type: "address", + name: "target", + }, + { + type: "bytes4", + name: "action", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "tuple", + name: "config", + components: [ + { + type: "address", + name: "recipient", + }, + { + type: "uint8", + name: "feeType", + }, + { + type: "uint256", + name: "value", + }, + ], + }, +] as const; + +/** + * Checks if the `getFeeConfig` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `getFeeConfig` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGetFeeConfigSupported } from "thirdweb/extensions/assets"; + * const supported = isGetFeeConfigSupported(["0x..."]); + * ``` + */ +export function isGetFeeConfigSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "getFeeConfig" function. + * @param options - The options for the getFeeConfig function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeGetFeeConfigParams } from "thirdweb/extensions/assets"; + * const result = encodeGetFeeConfigParams({ + * target: ..., + * action: ..., + * }); + * ``` + */ +export function encodeGetFeeConfigParams(options: GetFeeConfigParams) { + return encodeAbiParameters(FN_INPUTS, [options.target, options.action]); +} + +/** + * Encodes the "getFeeConfig" function into a Hex string with its parameters. + * @param options - The options for the getFeeConfig function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeGetFeeConfig } from "thirdweb/extensions/assets"; + * const result = encodeGetFeeConfig({ + * target: ..., + * action: ..., + * }); + * ``` + */ +export function encodeGetFeeConfig(options: GetFeeConfigParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeGetFeeConfigParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the getFeeConfig function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeGetFeeConfigResult } from "thirdweb/extensions/assets"; + * const result = decodeGetFeeConfigResultResult("..."); + * ``` + */ +export function decodeGetFeeConfigResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "getFeeConfig" function on the contract. + * @param options - The options for the getFeeConfig function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { getFeeConfig } from "thirdweb/extensions/assets"; + * + * const result = await getFeeConfig({ + * contract, + * target: ..., + * action: ..., + * }); + * + * ``` + */ +export async function getFeeConfig( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.target, options.action], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/hasAllRoles.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/hasAllRoles.ts new file mode 100644 index 00000000000..05ec4d41cb2 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/hasAllRoles.ts @@ -0,0 +1,133 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "hasAllRoles" function. + */ +export type HasAllRolesParams = { + user: AbiParameterToPrimitiveType<{ type: "address"; name: "user" }>; + roles: AbiParameterToPrimitiveType<{ type: "uint256"; name: "roles" }>; +}; + +export const FN_SELECTOR = "0x1cd64df4" as const; +const FN_INPUTS = [ + { + type: "address", + name: "user", + }, + { + type: "uint256", + name: "roles", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bool", + }, +] as const; + +/** + * Checks if the `hasAllRoles` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `hasAllRoles` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isHasAllRolesSupported } from "thirdweb/extensions/assets"; + * const supported = isHasAllRolesSupported(["0x..."]); + * ``` + */ +export function isHasAllRolesSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "hasAllRoles" function. + * @param options - The options for the hasAllRoles function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeHasAllRolesParams } from "thirdweb/extensions/assets"; + * const result = encodeHasAllRolesParams({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeHasAllRolesParams(options: HasAllRolesParams) { + return encodeAbiParameters(FN_INPUTS, [options.user, options.roles]); +} + +/** + * Encodes the "hasAllRoles" function into a Hex string with its parameters. + * @param options - The options for the hasAllRoles function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeHasAllRoles } from "thirdweb/extensions/assets"; + * const result = encodeHasAllRoles({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeHasAllRoles(options: HasAllRolesParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeHasAllRolesParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the hasAllRoles function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeHasAllRolesResult } from "thirdweb/extensions/assets"; + * const result = decodeHasAllRolesResultResult("..."); + * ``` + */ +export function decodeHasAllRolesResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "hasAllRoles" function on the contract. + * @param options - The options for the hasAllRoles function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { hasAllRoles } from "thirdweb/extensions/assets"; + * + * const result = await hasAllRoles({ + * contract, + * user: ..., + * roles: ..., + * }); + * + * ``` + */ +export async function hasAllRoles( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.user, options.roles], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/hasAnyRole.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/hasAnyRole.ts new file mode 100644 index 00000000000..11e595201f3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/hasAnyRole.ts @@ -0,0 +1,133 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "hasAnyRole" function. + */ +export type HasAnyRoleParams = { + user: AbiParameterToPrimitiveType<{ type: "address"; name: "user" }>; + roles: AbiParameterToPrimitiveType<{ type: "uint256"; name: "roles" }>; +}; + +export const FN_SELECTOR = "0x514e62fc" as const; +const FN_INPUTS = [ + { + type: "address", + name: "user", + }, + { + type: "uint256", + name: "roles", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bool", + }, +] as const; + +/** + * Checks if the `hasAnyRole` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `hasAnyRole` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isHasAnyRoleSupported } from "thirdweb/extensions/assets"; + * const supported = isHasAnyRoleSupported(["0x..."]); + * ``` + */ +export function isHasAnyRoleSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "hasAnyRole" function. + * @param options - The options for the hasAnyRole function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeHasAnyRoleParams } from "thirdweb/extensions/assets"; + * const result = encodeHasAnyRoleParams({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeHasAnyRoleParams(options: HasAnyRoleParams) { + return encodeAbiParameters(FN_INPUTS, [options.user, options.roles]); +} + +/** + * Encodes the "hasAnyRole" function into a Hex string with its parameters. + * @param options - The options for the hasAnyRole function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeHasAnyRole } from "thirdweb/extensions/assets"; + * const result = encodeHasAnyRole({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeHasAnyRole(options: HasAnyRoleParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeHasAnyRoleParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the hasAnyRole function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeHasAnyRoleResult } from "thirdweb/extensions/assets"; + * const result = decodeHasAnyRoleResultResult("..."); + * ``` + */ +export function decodeHasAnyRoleResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "hasAnyRole" function on the contract. + * @param options - The options for the hasAnyRole function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { hasAnyRole } from "thirdweb/extensions/assets"; + * + * const result = await hasAnyRole({ + * contract, + * user: ..., + * roles: ..., + * }); + * + * ``` + */ +export async function hasAnyRole( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.user, options.roles], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/owner.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/owner.ts new file mode 100644 index 00000000000..9903177bd12 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/owner.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x8da5cb5b" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "result", + }, +] as const; + +/** + * Checks if the `owner` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `owner` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnerSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnerSupported(["0x..."]); + * ``` + */ +export function isOwnerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the owner function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnerResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnerResultResult("..."); + * ``` + */ +export function decodeOwnerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "owner" function on the contract. + * @param options - The options for the owner function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { owner } from "thirdweb/extensions/assets"; + * + * const result = await owner({ + * contract, + * }); + * + * ``` + */ +export async function owner(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/ownershipHandoverExpiresAt.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/ownershipHandoverExpiresAt.ts new file mode 100644 index 00000000000..5625095f262 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/ownershipHandoverExpiresAt.ts @@ -0,0 +1,135 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "ownershipHandoverExpiresAt" function. + */ +export type OwnershipHandoverExpiresAtParams = { + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}; + +export const FN_SELECTOR = "0xfee81cf4" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `ownershipHandoverExpiresAt` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `ownershipHandoverExpiresAt` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnershipHandoverExpiresAtSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnershipHandoverExpiresAtSupported(["0x..."]); + * ``` + */ +export function isOwnershipHandoverExpiresAtSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "ownershipHandoverExpiresAt" function. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAtParams } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAtParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAtParams( + options: OwnershipHandoverExpiresAtParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "ownershipHandoverExpiresAt" function into a Hex string with its parameters. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAt({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAt( + options: OwnershipHandoverExpiresAtParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeOwnershipHandoverExpiresAtParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the ownershipHandoverExpiresAt function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnershipHandoverExpiresAtResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnershipHandoverExpiresAtResultResult("..."); + * ``` + */ +export function decodeOwnershipHandoverExpiresAtResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "ownershipHandoverExpiresAt" function on the contract. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { ownershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * + * const result = await ownershipHandoverExpiresAt({ + * contract, + * pendingOwner: ..., + * }); + * + * ``` + */ +export async function ownershipHandoverExpiresAt( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.pendingOwner], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/rolesOf.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/rolesOf.ts new file mode 100644 index 00000000000..e64c25fe267 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/rolesOf.ts @@ -0,0 +1,122 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "rolesOf" function. + */ +export type RolesOfParams = { + user: AbiParameterToPrimitiveType<{ type: "address"; name: "user" }>; +}; + +export const FN_SELECTOR = "0x2de94807" as const; +const FN_INPUTS = [ + { + type: "address", + name: "user", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "roles", + }, +] as const; + +/** + * Checks if the `rolesOf` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `rolesOf` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRolesOfSupported } from "thirdweb/extensions/assets"; + * const supported = isRolesOfSupported(["0x..."]); + * ``` + */ +export function isRolesOfSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "rolesOf" function. + * @param options - The options for the rolesOf function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeRolesOfParams } from "thirdweb/extensions/assets"; + * const result = encodeRolesOfParams({ + * user: ..., + * }); + * ``` + */ +export function encodeRolesOfParams(options: RolesOfParams) { + return encodeAbiParameters(FN_INPUTS, [options.user]); +} + +/** + * Encodes the "rolesOf" function into a Hex string with its parameters. + * @param options - The options for the rolesOf function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeRolesOf } from "thirdweb/extensions/assets"; + * const result = encodeRolesOf({ + * user: ..., + * }); + * ``` + */ +export function encodeRolesOf(options: RolesOfParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeRolesOfParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the rolesOf function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeRolesOfResult } from "thirdweb/extensions/assets"; + * const result = decodeRolesOfResultResult("..."); + * ``` + */ +export function decodeRolesOfResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "rolesOf" function on the contract. + * @param options - The options for the rolesOf function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { rolesOf } from "thirdweb/extensions/assets"; + * + * const result = await rolesOf({ + * contract, + * user: ..., + * }); + * + * ``` + */ +export async function rolesOf(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.user], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/usedNonces.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/usedNonces.ts new file mode 100644 index 00000000000..b84a31b53b7 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/read/usedNonces.ts @@ -0,0 +1,129 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "usedNonces" function. + */ +export type UsedNoncesParams = { + signerNonce: AbiParameterToPrimitiveType<{ + type: "bytes32"; + name: "signerNonce"; + }>; +}; + +export const FN_SELECTOR = "0xfeb61724" as const; +const FN_INPUTS = [ + { + type: "bytes32", + name: "signerNonce", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "bool", + name: "used", + }, +] as const; + +/** + * Checks if the `usedNonces` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `usedNonces` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isUsedNoncesSupported } from "thirdweb/extensions/assets"; + * const supported = isUsedNoncesSupported(["0x..."]); + * ``` + */ +export function isUsedNoncesSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "usedNonces" function. + * @param options - The options for the usedNonces function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeUsedNoncesParams } from "thirdweb/extensions/assets"; + * const result = encodeUsedNoncesParams({ + * signerNonce: ..., + * }); + * ``` + */ +export function encodeUsedNoncesParams(options: UsedNoncesParams) { + return encodeAbiParameters(FN_INPUTS, [options.signerNonce]); +} + +/** + * Encodes the "usedNonces" function into a Hex string with its parameters. + * @param options - The options for the usedNonces function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeUsedNonces } from "thirdweb/extensions/assets"; + * const result = encodeUsedNonces({ + * signerNonce: ..., + * }); + * ``` + */ +export function encodeUsedNonces(options: UsedNoncesParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeUsedNoncesParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the usedNonces function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeUsedNoncesResult } from "thirdweb/extensions/assets"; + * const result = decodeUsedNoncesResultResult("..."); + * ``` + */ +export function decodeUsedNoncesResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "usedNonces" function on the contract. + * @param options - The options for the usedNonces function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { usedNonces } from "thirdweb/extensions/assets"; + * + * const result = await usedNonces({ + * contract, + * signerNonce: ..., + * }); + * + * ``` + */ +export async function usedNonces( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.signerNonce], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/cancelOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/cancelOwnershipHandover.ts new file mode 100644 index 00000000000..a1e60004b43 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/cancelOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x54d1f13d" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `cancelOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `cancelOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCancelOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCancelOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCancelOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. + * @param options - The options for the "cancelOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { cancelOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = cancelOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function cancelOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/completeOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/completeOwnershipHandover.ts new file mode 100644 index 00000000000..c4bf81966fe --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/completeOwnershipHandover.ts @@ -0,0 +1,148 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "completeOwnershipHandover" function. + */ +export type CompleteOwnershipHandoverParams = WithOverrides<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}>; + +export const FN_SELECTOR = "0xf04e283e" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `completeOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `completeOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCompleteOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCompleteOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCompleteOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "completeOwnershipHandover" function. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandoverParams } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandoverParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandoverParams( + options: CompleteOwnershipHandoverParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "completeOwnershipHandover" function into a Hex string with its parameters. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandover } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandover({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandover( + options: CompleteOwnershipHandoverParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCompleteOwnershipHandoverParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "completeOwnershipHandover" function on the contract. + * @param options - The options for the "completeOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { completeOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = completeOwnershipHandover({ + * contract, + * pendingOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function completeOwnershipHandover( + options: BaseTransactionOptions< + | CompleteOwnershipHandoverParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.pendingOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/grantRoles.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/grantRoles.ts new file mode 100644 index 00000000000..b2469579e29 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/grantRoles.ts @@ -0,0 +1,147 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "grantRoles" function. + */ +export type GrantRolesParams = WithOverrides<{ + user: AbiParameterToPrimitiveType<{ type: "address"; name: "user" }>; + roles: AbiParameterToPrimitiveType<{ type: "uint256"; name: "roles" }>; +}>; + +export const FN_SELECTOR = "0x1c10893f" as const; +const FN_INPUTS = [ + { + type: "address", + name: "user", + }, + { + type: "uint256", + name: "roles", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `grantRoles` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `grantRoles` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isGrantRolesSupported } from "thirdweb/extensions/assets"; + * + * const supported = isGrantRolesSupported(["0x..."]); + * ``` + */ +export function isGrantRolesSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "grantRoles" function. + * @param options - The options for the grantRoles function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeGrantRolesParams } from "thirdweb/extensions/assets"; + * const result = encodeGrantRolesParams({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeGrantRolesParams(options: GrantRolesParams) { + return encodeAbiParameters(FN_INPUTS, [options.user, options.roles]); +} + +/** + * Encodes the "grantRoles" function into a Hex string with its parameters. + * @param options - The options for the grantRoles function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeGrantRoles } from "thirdweb/extensions/assets"; + * const result = encodeGrantRoles({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeGrantRoles(options: GrantRolesParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeGrantRolesParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "grantRoles" function on the contract. + * @param options - The options for the "grantRoles" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { grantRoles } from "thirdweb/extensions/assets"; + * + * const transaction = grantRoles({ + * contract, + * user: ..., + * roles: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function grantRoles( + options: BaseTransactionOptions< + | GrantRolesParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.user, resolvedOptions.roles] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/renounceOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/renounceOwnership.ts new file mode 100644 index 00000000000..7b8b575e3b4 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/renounceOwnership.ts @@ -0,0 +1,50 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x715018a6" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `renounceOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `renounceOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRenounceOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRenounceOwnershipSupported(["0x..."]); + * ``` + */ +export function isRenounceOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "renounceOwnership" function on the contract. + * @param options - The options for the "renounceOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { renounceOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = renounceOwnership(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function renounceOwnership(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/renounceRoles.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/renounceRoles.ts new file mode 100644 index 00000000000..fa83b586359 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/renounceRoles.ts @@ -0,0 +1,139 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "renounceRoles" function. + */ +export type RenounceRolesParams = WithOverrides<{ + roles: AbiParameterToPrimitiveType<{ type: "uint256"; name: "roles" }>; +}>; + +export const FN_SELECTOR = "0x183a4f6e" as const; +const FN_INPUTS = [ + { + type: "uint256", + name: "roles", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `renounceRoles` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `renounceRoles` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRenounceRolesSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRenounceRolesSupported(["0x..."]); + * ``` + */ +export function isRenounceRolesSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "renounceRoles" function. + * @param options - The options for the renounceRoles function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeRenounceRolesParams } from "thirdweb/extensions/assets"; + * const result = encodeRenounceRolesParams({ + * roles: ..., + * }); + * ``` + */ +export function encodeRenounceRolesParams(options: RenounceRolesParams) { + return encodeAbiParameters(FN_INPUTS, [options.roles]); +} + +/** + * Encodes the "renounceRoles" function into a Hex string with its parameters. + * @param options - The options for the renounceRoles function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeRenounceRoles } from "thirdweb/extensions/assets"; + * const result = encodeRenounceRoles({ + * roles: ..., + * }); + * ``` + */ +export function encodeRenounceRoles(options: RenounceRolesParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeRenounceRolesParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "renounceRoles" function on the contract. + * @param options - The options for the "renounceRoles" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { renounceRoles } from "thirdweb/extensions/assets"; + * + * const transaction = renounceRoles({ + * contract, + * roles: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function renounceRoles( + options: BaseTransactionOptions< + | RenounceRolesParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.roles] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/requestOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/requestOwnershipHandover.ts new file mode 100644 index 00000000000..e0744619fae --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/requestOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x25692962" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `requestOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `requestOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRequestOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRequestOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isRequestOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "requestOwnershipHandover" function on the contract. + * @param options - The options for the "requestOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { requestOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = requestOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function requestOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/revokeRoles.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/revokeRoles.ts new file mode 100644 index 00000000000..c6450bfcd50 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/revokeRoles.ts @@ -0,0 +1,147 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "revokeRoles" function. + */ +export type RevokeRolesParams = WithOverrides<{ + user: AbiParameterToPrimitiveType<{ type: "address"; name: "user" }>; + roles: AbiParameterToPrimitiveType<{ type: "uint256"; name: "roles" }>; +}>; + +export const FN_SELECTOR = "0x4a4ee7b1" as const; +const FN_INPUTS = [ + { + type: "address", + name: "user", + }, + { + type: "uint256", + name: "roles", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `revokeRoles` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `revokeRoles` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRevokeRolesSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRevokeRolesSupported(["0x..."]); + * ``` + */ +export function isRevokeRolesSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "revokeRoles" function. + * @param options - The options for the revokeRoles function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeRevokeRolesParams } from "thirdweb/extensions/assets"; + * const result = encodeRevokeRolesParams({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeRevokeRolesParams(options: RevokeRolesParams) { + return encodeAbiParameters(FN_INPUTS, [options.user, options.roles]); +} + +/** + * Encodes the "revokeRoles" function into a Hex string with its parameters. + * @param options - The options for the revokeRoles function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeRevokeRoles } from "thirdweb/extensions/assets"; + * const result = encodeRevokeRoles({ + * user: ..., + * roles: ..., + * }); + * ``` + */ +export function encodeRevokeRoles(options: RevokeRolesParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeRevokeRolesParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "revokeRoles" function on the contract. + * @param options - The options for the "revokeRoles" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { revokeRoles } from "thirdweb/extensions/assets"; + * + * const transaction = revokeRoles({ + * contract, + * user: ..., + * roles: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function revokeRoles( + options: BaseTransactionOptions< + | RevokeRolesParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.user, resolvedOptions.roles] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeConfig.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeConfig.ts new file mode 100644 index 00000000000..fdf708570f0 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeConfig.ts @@ -0,0 +1,163 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setFeeConfig" function. + */ +export type SetFeeConfigParams = WithOverrides<{ + action: AbiParameterToPrimitiveType<{ type: "bytes4"; name: "action" }>; + feeType: AbiParameterToPrimitiveType<{ type: "uint8"; name: "feeType" }>; + value: AbiParameterToPrimitiveType<{ type: "uint256"; name: "value" }>; +}>; + +export const FN_SELECTOR = "0x636d2be9" as const; +const FN_INPUTS = [ + { + type: "bytes4", + name: "action", + }, + { + type: "uint8", + name: "feeType", + }, + { + type: "uint256", + name: "value", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setFeeConfig` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setFeeConfig` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetFeeConfigSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetFeeConfigSupported(["0x..."]); + * ``` + */ +export function isSetFeeConfigSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setFeeConfig" function. + * @param options - The options for the setFeeConfig function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetFeeConfigParams } from "thirdweb/extensions/assets"; + * const result = encodeSetFeeConfigParams({ + * action: ..., + * feeType: ..., + * value: ..., + * }); + * ``` + */ +export function encodeSetFeeConfigParams(options: SetFeeConfigParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.action, + options.feeType, + options.value, + ]); +} + +/** + * Encodes the "setFeeConfig" function into a Hex string with its parameters. + * @param options - The options for the setFeeConfig function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetFeeConfig } from "thirdweb/extensions/assets"; + * const result = encodeSetFeeConfig({ + * action: ..., + * feeType: ..., + * value: ..., + * }); + * ``` + */ +export function encodeSetFeeConfig(options: SetFeeConfigParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetFeeConfigParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setFeeConfig" function on the contract. + * @param options - The options for the "setFeeConfig" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setFeeConfig } from "thirdweb/extensions/assets"; + * + * const transaction = setFeeConfig({ + * contract, + * action: ..., + * feeType: ..., + * value: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setFeeConfig( + options: BaseTransactionOptions< + | SetFeeConfigParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.action, + resolvedOptions.feeType, + resolvedOptions.value, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeConfigBySignature.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeConfigBySignature.ts new file mode 100644 index 00000000000..dac81287896 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeConfigBySignature.ts @@ -0,0 +1,222 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setFeeConfigBySignature" function. + */ +export type SetFeeConfigBySignatureParams = WithOverrides<{ + target: AbiParameterToPrimitiveType<{ type: "address"; name: "target" }>; + action: AbiParameterToPrimitiveType<{ type: "bytes4"; name: "action" }>; + recipient: AbiParameterToPrimitiveType<{ + type: "address"; + name: "recipient"; + }>; + feeType: AbiParameterToPrimitiveType<{ type: "uint8"; name: "feeType" }>; + value: AbiParameterToPrimitiveType<{ type: "uint256"; name: "value" }>; + nonce: AbiParameterToPrimitiveType<{ type: "uint256"; name: "nonce" }>; + deadline: AbiParameterToPrimitiveType<{ type: "uint256"; name: "deadline" }>; + signature: AbiParameterToPrimitiveType<{ type: "bytes"; name: "signature" }>; +}>; + +export const FN_SELECTOR = "0x9ba861e3" as const; +const FN_INPUTS = [ + { + type: "address", + name: "target", + }, + { + type: "bytes4", + name: "action", + }, + { + type: "address", + name: "recipient", + }, + { + type: "uint8", + name: "feeType", + }, + { + type: "uint256", + name: "value", + }, + { + type: "uint256", + name: "nonce", + }, + { + type: "uint256", + name: "deadline", + }, + { + type: "bytes", + name: "signature", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setFeeConfigBySignature` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setFeeConfigBySignature` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetFeeConfigBySignatureSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetFeeConfigBySignatureSupported(["0x..."]); + * ``` + */ +export function isSetFeeConfigBySignatureSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setFeeConfigBySignature" function. + * @param options - The options for the setFeeConfigBySignature function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetFeeConfigBySignatureParams } from "thirdweb/extensions/assets"; + * const result = encodeSetFeeConfigBySignatureParams({ + * target: ..., + * action: ..., + * recipient: ..., + * feeType: ..., + * value: ..., + * nonce: ..., + * deadline: ..., + * signature: ..., + * }); + * ``` + */ +export function encodeSetFeeConfigBySignatureParams( + options: SetFeeConfigBySignatureParams, +) { + return encodeAbiParameters(FN_INPUTS, [ + options.target, + options.action, + options.recipient, + options.feeType, + options.value, + options.nonce, + options.deadline, + options.signature, + ]); +} + +/** + * Encodes the "setFeeConfigBySignature" function into a Hex string with its parameters. + * @param options - The options for the setFeeConfigBySignature function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetFeeConfigBySignature } from "thirdweb/extensions/assets"; + * const result = encodeSetFeeConfigBySignature({ + * target: ..., + * action: ..., + * recipient: ..., + * feeType: ..., + * value: ..., + * nonce: ..., + * deadline: ..., + * signature: ..., + * }); + * ``` + */ +export function encodeSetFeeConfigBySignature( + options: SetFeeConfigBySignatureParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetFeeConfigBySignatureParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setFeeConfigBySignature" function on the contract. + * @param options - The options for the "setFeeConfigBySignature" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setFeeConfigBySignature } from "thirdweb/extensions/assets"; + * + * const transaction = setFeeConfigBySignature({ + * contract, + * target: ..., + * action: ..., + * recipient: ..., + * feeType: ..., + * value: ..., + * nonce: ..., + * deadline: ..., + * signature: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setFeeConfigBySignature( + options: BaseTransactionOptions< + | SetFeeConfigBySignatureParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.target, + resolvedOptions.action, + resolvedOptions.recipient, + resolvedOptions.feeType, + resolvedOptions.value, + resolvedOptions.nonce, + resolvedOptions.deadline, + resolvedOptions.signature, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeRecipient.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeRecipient.ts new file mode 100644 index 00000000000..df6cb2b220c --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setFeeRecipient.ts @@ -0,0 +1,142 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setFeeRecipient" function. + */ +export type SetFeeRecipientParams = WithOverrides<{ + feeRecipient: AbiParameterToPrimitiveType<{ + type: "address"; + name: "_feeRecipient"; + }>; +}>; + +export const FN_SELECTOR = "0xe74b981b" as const; +const FN_INPUTS = [ + { + type: "address", + name: "_feeRecipient", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setFeeRecipient` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setFeeRecipient` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetFeeRecipientSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetFeeRecipientSupported(["0x..."]); + * ``` + */ +export function isSetFeeRecipientSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setFeeRecipient" function. + * @param options - The options for the setFeeRecipient function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetFeeRecipientParams } from "thirdweb/extensions/assets"; + * const result = encodeSetFeeRecipientParams({ + * feeRecipient: ..., + * }); + * ``` + */ +export function encodeSetFeeRecipientParams(options: SetFeeRecipientParams) { + return encodeAbiParameters(FN_INPUTS, [options.feeRecipient]); +} + +/** + * Encodes the "setFeeRecipient" function into a Hex string with its parameters. + * @param options - The options for the setFeeRecipient function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetFeeRecipient } from "thirdweb/extensions/assets"; + * const result = encodeSetFeeRecipient({ + * feeRecipient: ..., + * }); + * ``` + */ +export function encodeSetFeeRecipient(options: SetFeeRecipientParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetFeeRecipientParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setFeeRecipient" function on the contract. + * @param options - The options for the "setFeeRecipient" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setFeeRecipient } from "thirdweb/extensions/assets"; + * + * const transaction = setFeeRecipient({ + * contract, + * feeRecipient: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setFeeRecipient( + options: BaseTransactionOptions< + | SetFeeRecipientParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.feeRecipient] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setTargetFeeConfig.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setTargetFeeConfig.ts new file mode 100644 index 00000000000..abd3a0e6f54 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/setTargetFeeConfig.ts @@ -0,0 +1,188 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "setTargetFeeConfig" function. + */ +export type SetTargetFeeConfigParams = WithOverrides<{ + target: AbiParameterToPrimitiveType<{ type: "address"; name: "target" }>; + action: AbiParameterToPrimitiveType<{ type: "bytes4"; name: "action" }>; + recipient: AbiParameterToPrimitiveType<{ + type: "address"; + name: "recipient"; + }>; + feeType: AbiParameterToPrimitiveType<{ type: "uint8"; name: "feeType" }>; + value: AbiParameterToPrimitiveType<{ type: "uint256"; name: "value" }>; +}>; + +export const FN_SELECTOR = "0xd20caa1a" as const; +const FN_INPUTS = [ + { + type: "address", + name: "target", + }, + { + type: "bytes4", + name: "action", + }, + { + type: "address", + name: "recipient", + }, + { + type: "uint8", + name: "feeType", + }, + { + type: "uint256", + name: "value", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `setTargetFeeConfig` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `setTargetFeeConfig` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSetTargetFeeConfigSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSetTargetFeeConfigSupported(["0x..."]); + * ``` + */ +export function isSetTargetFeeConfigSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "setTargetFeeConfig" function. + * @param options - The options for the setTargetFeeConfig function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetTargetFeeConfigParams } from "thirdweb/extensions/assets"; + * const result = encodeSetTargetFeeConfigParams({ + * target: ..., + * action: ..., + * recipient: ..., + * feeType: ..., + * value: ..., + * }); + * ``` + */ +export function encodeSetTargetFeeConfigParams( + options: SetTargetFeeConfigParams, +) { + return encodeAbiParameters(FN_INPUTS, [ + options.target, + options.action, + options.recipient, + options.feeType, + options.value, + ]); +} + +/** + * Encodes the "setTargetFeeConfig" function into a Hex string with its parameters. + * @param options - The options for the setTargetFeeConfig function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSetTargetFeeConfig } from "thirdweb/extensions/assets"; + * const result = encodeSetTargetFeeConfig({ + * target: ..., + * action: ..., + * recipient: ..., + * feeType: ..., + * value: ..., + * }); + * ``` + */ +export function encodeSetTargetFeeConfig(options: SetTargetFeeConfigParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSetTargetFeeConfigParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "setTargetFeeConfig" function on the contract. + * @param options - The options for the "setTargetFeeConfig" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { setTargetFeeConfig } from "thirdweb/extensions/assets"; + * + * const transaction = setTargetFeeConfig({ + * contract, + * target: ..., + * action: ..., + * recipient: ..., + * feeType: ..., + * value: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function setTargetFeeConfig( + options: BaseTransactionOptions< + | SetTargetFeeConfigParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.target, + resolvedOptions.action, + resolvedOptions.recipient, + resolvedOptions.feeType, + resolvedOptions.value, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/transferOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/transferOwnership.ts new file mode 100644 index 00000000000..36f0df68e14 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/FeeManager/write/transferOwnership.ts @@ -0,0 +1,141 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "transferOwnership" function. + */ +export type TransferOwnershipParams = WithOverrides<{ + newOwner: AbiParameterToPrimitiveType<{ type: "address"; name: "newOwner" }>; +}>; + +export const FN_SELECTOR = "0xf2fde38b" as const; +const FN_INPUTS = [ + { + type: "address", + name: "newOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `transferOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `transferOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isTransferOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isTransferOwnershipSupported(["0x..."]); + * ``` + */ +export function isTransferOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "transferOwnership" function. + * @param options - The options for the transferOwnership function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnershipParams } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnershipParams({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnershipParams( + options: TransferOwnershipParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.newOwner]); +} + +/** + * Encodes the "transferOwnership" function into a Hex string with its parameters. + * @param options - The options for the transferOwnership function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnership } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnership({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnership(options: TransferOwnershipParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeTransferOwnershipParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "transferOwnership" function on the contract. + * @param options - The options for the "transferOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { transferOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = transferOwnership({ + * contract, + * newOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function transferOwnership( + options: BaseTransactionOptions< + | TransferOwnershipParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.newOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/events/PositionLocked.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/events/PositionLocked.ts new file mode 100644 index 00000000000..1081dc5be42 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/events/PositionLocked.ts @@ -0,0 +1,47 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "PositionLocked" event. + */ +export type PositionLockedEventFilters = Partial<{ + owner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "owner"; + indexed: true; + }>; + asset: AbiParameterToPrimitiveType<{ + type: "address"; + name: "asset"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the PositionLocked event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { positionLockedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * positionLockedEvent({ + * owner: ..., + * asset: ..., + * }) + * ], + * }); + * ``` + */ +export function positionLockedEvent(filters: PositionLockedEventFilters = {}) { + return prepareEvent({ + signature: + "event PositionLocked(address indexed owner, address indexed asset, address positionManager, uint256 tokenId, address recipient, address referrer)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/events/RewardsCollected.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/events/RewardsCollected.ts new file mode 100644 index 00000000000..4022252e4bb --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/events/RewardsCollected.ts @@ -0,0 +1,49 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "RewardsCollected" event. + */ +export type RewardsCollectedEventFilters = Partial<{ + owner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "owner"; + indexed: true; + }>; + asset: AbiParameterToPrimitiveType<{ + type: "address"; + name: "asset"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the RewardsCollected event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { rewardsCollectedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * rewardsCollectedEvent({ + * owner: ..., + * asset: ..., + * }) + * ], + * }); + * ``` + */ +export function rewardsCollectedEvent( + filters: RewardsCollectedEventFilters = {}, +) { + return prepareEvent({ + signature: + "event RewardsCollected(address indexed owner, address indexed asset, address positionManager, uint256 tokenId, uint256 amount0, uint256 amount1)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/feeManager.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/feeManager.ts new file mode 100644 index 00000000000..8a54aadd7b9 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/feeManager.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0xd0fb0203" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + }, +] as const; + +/** + * Checks if the `feeManager` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `feeManager` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isFeeManagerSupported } from "thirdweb/extensions/assets"; + * const supported = isFeeManagerSupported(["0x..."]); + * ``` + */ +export function isFeeManagerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the feeManager function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeFeeManagerResult } from "thirdweb/extensions/assets"; + * const result = decodeFeeManagerResultResult("..."); + * ``` + */ +export function decodeFeeManagerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "feeManager" function on the contract. + * @param options - The options for the feeManager function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { feeManager } from "thirdweb/extensions/assets"; + * + * const result = await feeManager({ + * contract, + * }); + * + * ``` + */ +export async function feeManager(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/positions.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/positions.ts new file mode 100644 index 00000000000..4aebc340c58 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/positions.ts @@ -0,0 +1,150 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "positions" function. + */ +export type PositionsParams = { + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner" }>; + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "asset" }>; +}; + +export const FN_SELECTOR = "0x4bd21445" as const; +const FN_INPUTS = [ + { + type: "address", + name: "owner", + }, + { + type: "address", + name: "asset", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "positionManager", + }, + { + type: "uint256", + name: "tokenId", + }, + { + type: "address", + name: "recipient", + }, + { + type: "address", + name: "referrer", + }, + { + type: "uint16", + name: "referrerBps", + }, +] as const; + +/** + * Checks if the `positions` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `positions` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isPositionsSupported } from "thirdweb/extensions/assets"; + * const supported = isPositionsSupported(["0x..."]); + * ``` + */ +export function isPositionsSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "positions" function. + * @param options - The options for the positions function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodePositionsParams } from "thirdweb/extensions/assets"; + * const result = encodePositionsParams({ + * owner: ..., + * asset: ..., + * }); + * ``` + */ +export function encodePositionsParams(options: PositionsParams) { + return encodeAbiParameters(FN_INPUTS, [options.owner, options.asset]); +} + +/** + * Encodes the "positions" function into a Hex string with its parameters. + * @param options - The options for the positions function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodePositions } from "thirdweb/extensions/assets"; + * const result = encodePositions({ + * owner: ..., + * asset: ..., + * }); + * ``` + */ +export function encodePositions(options: PositionsParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodePositionsParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the positions function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodePositionsResult } from "thirdweb/extensions/assets"; + * const result = decodePositionsResultResult("..."); + * ``` + */ +export function decodePositionsResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result); +} + +/** + * Calls the "positions" function on the contract. + * @param options - The options for the positions function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { positions } from "thirdweb/extensions/assets"; + * + * const result = await positions({ + * contract, + * owner: ..., + * asset: ..., + * }); + * + * ``` + */ +export async function positions( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.owner, options.asset], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/v3PositionManager.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/v3PositionManager.ts new file mode 100644 index 00000000000..6ffae04260c --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/v3PositionManager.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x39406c50" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + }, +] as const; + +/** + * Checks if the `v3PositionManager` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `v3PositionManager` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isV3PositionManagerSupported } from "thirdweb/extensions/assets"; + * const supported = isV3PositionManagerSupported(["0x..."]); + * ``` + */ +export function isV3PositionManagerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the v3PositionManager function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeV3PositionManagerResult } from "thirdweb/extensions/assets"; + * const result = decodeV3PositionManagerResultResult("..."); + * ``` + */ +export function decodeV3PositionManagerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "v3PositionManager" function on the contract. + * @param options - The options for the v3PositionManager function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { v3PositionManager } from "thirdweb/extensions/assets"; + * + * const result = await v3PositionManager({ + * contract, + * }); + * + * ``` + */ +export async function v3PositionManager(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/v4PositionManager.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/v4PositionManager.ts new file mode 100644 index 00000000000..9af4367be8e --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/read/v4PositionManager.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0xe2f4dd43" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + }, +] as const; + +/** + * Checks if the `v4PositionManager` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `v4PositionManager` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isV4PositionManagerSupported } from "thirdweb/extensions/assets"; + * const supported = isV4PositionManagerSupported(["0x..."]); + * ``` + */ +export function isV4PositionManagerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the v4PositionManager function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeV4PositionManagerResult } from "thirdweb/extensions/assets"; + * const result = decodeV4PositionManagerResultResult("..."); + * ``` + */ +export function decodeV4PositionManagerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "v4PositionManager" function on the contract. + * @param options - The options for the v4PositionManager function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { v4PositionManager } from "thirdweb/extensions/assets"; + * + * const result = await v4PositionManager({ + * contract, + * }); + * + * ``` + */ +export async function v4PositionManager(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/write/collectRewards.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/write/collectRewards.ts new file mode 100644 index 00000000000..ae7a0993275 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/write/collectRewards.ts @@ -0,0 +1,164 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "collectRewards" function. + */ +export type CollectRewardsParams = WithOverrides<{ + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "_owner" }>; + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "_asset" }>; +}>; + +export const FN_SELECTOR = "0x195da960" as const; +const FN_INPUTS = [ + { + type: "address", + name: "_owner", + }, + { + type: "address", + name: "_asset", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "token0", + }, + { + type: "address", + name: "token1", + }, + { + type: "uint256", + name: "amount0", + }, + { + type: "uint256", + name: "amount1", + }, +] as const; + +/** + * Checks if the `collectRewards` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `collectRewards` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCollectRewardsSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCollectRewardsSupported(["0x..."]); + * ``` + */ +export function isCollectRewardsSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "collectRewards" function. + * @param options - The options for the collectRewards function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCollectRewardsParams } from "thirdweb/extensions/assets"; + * const result = encodeCollectRewardsParams({ + * owner: ..., + * asset: ..., + * }); + * ``` + */ +export function encodeCollectRewardsParams(options: CollectRewardsParams) { + return encodeAbiParameters(FN_INPUTS, [options.owner, options.asset]); +} + +/** + * Encodes the "collectRewards" function into a Hex string with its parameters. + * @param options - The options for the collectRewards function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCollectRewards } from "thirdweb/extensions/assets"; + * const result = encodeCollectRewards({ + * owner: ..., + * asset: ..., + * }); + * ``` + */ +export function encodeCollectRewards(options: CollectRewardsParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCollectRewardsParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "collectRewards" function on the contract. + * @param options - The options for the "collectRewards" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { collectRewards } from "thirdweb/extensions/assets"; + * + * const transaction = collectRewards({ + * contract, + * owner: ..., + * asset: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function collectRewards( + options: BaseTransactionOptions< + | CollectRewardsParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.owner, resolvedOptions.asset] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/write/lockPosition.ts b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/write/lockPosition.ts new file mode 100644 index 00000000000..4b4fa53c5d6 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/RewardLocker/write/lockPosition.ts @@ -0,0 +1,202 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "lockPosition" function. + */ +export type LockPositionParams = WithOverrides<{ + asset: AbiParameterToPrimitiveType<{ type: "address"; name: "_asset" }>; + positionManager: AbiParameterToPrimitiveType<{ + type: "address"; + name: "_positionManager"; + }>; + tokenId: AbiParameterToPrimitiveType<{ type: "uint256"; name: "_tokenId" }>; + recipient: AbiParameterToPrimitiveType<{ + type: "address"; + name: "_recipient"; + }>; + referrer: AbiParameterToPrimitiveType<{ type: "address"; name: "_referrer" }>; + referrerBps: AbiParameterToPrimitiveType<{ + type: "uint16"; + name: "_referrerBps"; + }>; +}>; + +export const FN_SELECTOR = "0x2cde40c2" as const; +const FN_INPUTS = [ + { + type: "address", + name: "_asset", + }, + { + type: "address", + name: "_positionManager", + }, + { + type: "uint256", + name: "_tokenId", + }, + { + type: "address", + name: "_recipient", + }, + { + type: "address", + name: "_referrer", + }, + { + type: "uint16", + name: "_referrerBps", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `lockPosition` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `lockPosition` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isLockPositionSupported } from "thirdweb/extensions/assets"; + * + * const supported = isLockPositionSupported(["0x..."]); + * ``` + */ +export function isLockPositionSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "lockPosition" function. + * @param options - The options for the lockPosition function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeLockPositionParams } from "thirdweb/extensions/assets"; + * const result = encodeLockPositionParams({ + * asset: ..., + * positionManager: ..., + * tokenId: ..., + * recipient: ..., + * referrer: ..., + * referrerBps: ..., + * }); + * ``` + */ +export function encodeLockPositionParams(options: LockPositionParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.asset, + options.positionManager, + options.tokenId, + options.recipient, + options.referrer, + options.referrerBps, + ]); +} + +/** + * Encodes the "lockPosition" function into a Hex string with its parameters. + * @param options - The options for the lockPosition function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeLockPosition } from "thirdweb/extensions/assets"; + * const result = encodeLockPosition({ + * asset: ..., + * positionManager: ..., + * tokenId: ..., + * recipient: ..., + * referrer: ..., + * referrerBps: ..., + * }); + * ``` + */ +export function encodeLockPosition(options: LockPositionParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeLockPositionParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "lockPosition" function on the contract. + * @param options - The options for the "lockPosition" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { lockPosition } from "thirdweb/extensions/assets"; + * + * const transaction = lockPosition({ + * contract, + * asset: ..., + * positionManager: ..., + * tokenId: ..., + * recipient: ..., + * referrer: ..., + * referrerBps: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function lockPosition( + options: BaseTransactionOptions< + | LockPositionParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [ + resolvedOptions.asset, + resolvedOptions.positionManager, + resolvedOptions.tokenId, + resolvedOptions.recipient, + resolvedOptions.referrer, + resolvedOptions.referrerBps, + ] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/AdapterDisabled.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/AdapterDisabled.ts new file mode 100644 index 00000000000..bb6d50984ce --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/AdapterDisabled.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the AdapterDisabled event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { adapterDisabledEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * adapterDisabledEvent() + * ], + * }); + * ``` + */ +export function adapterDisabledEvent() { + return prepareEvent({ + signature: "event AdapterDisabled(uint8 adapterType)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/AdapterEnabled.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/AdapterEnabled.ts new file mode 100644 index 00000000000..b15e372eafc --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/AdapterEnabled.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the AdapterEnabled event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { adapterEnabledEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * adapterEnabledEvent() + * ], + * }); + * ``` + */ +export function adapterEnabledEvent() { + return prepareEvent({ + signature: "event AdapterEnabled(uint8 adapterType)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/Initialized.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/Initialized.ts new file mode 100644 index 00000000000..88705c10a63 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/Initialized.ts @@ -0,0 +1,24 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; + +/** + * Creates an event object for the Initialized event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { initializedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * initializedEvent() + * ], + * }); + * ``` + */ +export function initializedEvent() { + return prepareEvent({ + signature: "event Initialized(uint64 version)", + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipHandoverCanceled.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipHandoverCanceled.ts new file mode 100644 index 00000000000..2ab8996b8d3 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipHandoverCanceled.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverCanceled" event. + */ +export type OwnershipHandoverCanceledEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverCanceled event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverCanceledEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverCanceledEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverCanceledEvent( + filters: OwnershipHandoverCanceledEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverCanceled(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipHandoverRequested.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipHandoverRequested.ts new file mode 100644 index 00000000000..a498506409a --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipHandoverRequested.ts @@ -0,0 +1,42 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipHandoverRequested" event. + */ +export type OwnershipHandoverRequestedEventFilters = Partial<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipHandoverRequested event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipHandoverRequestedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipHandoverRequestedEvent({ + * pendingOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipHandoverRequestedEvent( + filters: OwnershipHandoverRequestedEventFilters = {}, +) { + return prepareEvent({ + signature: "event OwnershipHandoverRequested(address indexed pendingOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipTransferred.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipTransferred.ts new file mode 100644 index 00000000000..b1be6e750e1 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/OwnershipTransferred.ts @@ -0,0 +1,49 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "OwnershipTransferred" event. + */ +export type OwnershipTransferredEventFilters = Partial<{ + oldOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "oldOwner"; + indexed: true; + }>; + newOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "newOwner"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the OwnershipTransferred event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { ownershipTransferredEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * ownershipTransferredEvent({ + * oldOwner: ..., + * newOwner: ..., + * }) + * ], + * }); + * ``` + */ +export function ownershipTransferredEvent( + filters: OwnershipTransferredEventFilters = {}, +) { + return prepareEvent({ + signature: + "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/SwapExecuted.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/SwapExecuted.ts new file mode 100644 index 00000000000..a5e453c7717 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/SwapExecuted.ts @@ -0,0 +1,53 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "SwapExecuted" event. + */ +export type SwapExecutedEventFilters = Partial<{ + sender: AbiParameterToPrimitiveType<{ + type: "address"; + name: "sender"; + indexed: true; + }>; + tokenIn: AbiParameterToPrimitiveType<{ + type: "address"; + name: "tokenIn"; + indexed: true; + }>; + tokenOut: AbiParameterToPrimitiveType<{ + type: "address"; + name: "tokenOut"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the SwapExecuted event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { swapExecutedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * swapExecutedEvent({ + * sender: ..., + * tokenIn: ..., + * tokenOut: ..., + * }) + * ], + * }); + * ``` + */ +export function swapExecutedEvent(filters: SwapExecutedEventFilters = {}) { + return prepareEvent({ + signature: + "event SwapExecuted(address indexed sender, address indexed tokenIn, address indexed tokenOut, uint256 amountIn, uint256 amountOut, uint8 adapterUsed)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/events/Upgraded.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/Upgraded.ts new file mode 100644 index 00000000000..5ab5634fb24 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/events/Upgraded.ts @@ -0,0 +1,40 @@ +import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; + +/** + * Represents the filters for the "Upgraded" event. + */ +export type UpgradedEventFilters = Partial<{ + implementation: AbiParameterToPrimitiveType<{ + type: "address"; + name: "implementation"; + indexed: true; + }>; +}>; + +/** + * Creates an event object for the Upgraded event. + * @param filters - Optional filters to apply to the event. + * @returns The prepared event object. + * @extension ASSETS + * @example + * ```ts + * import { getContractEvents } from "thirdweb"; + * import { upgradedEvent } from "thirdweb/extensions/assets"; + * + * const events = await getContractEvents({ + * contract, + * events: [ + * upgradedEvent({ + * implementation: ..., + * }) + * ], + * }); + * ``` + */ +export function upgradedEvent(filters: UpgradedEventFilters = {}) { + return prepareEvent({ + signature: "event Upgraded(address indexed implementation)", + filters, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/read/NATIVE_TOKEN.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/NATIVE_TOKEN.ts new file mode 100644 index 00000000000..b7a3a2b4481 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/NATIVE_TOKEN.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x31f7d964" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + }, +] as const; + +/** + * Checks if the `NATIVE_TOKEN` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `NATIVE_TOKEN` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isNATIVE_TOKENSupported } from "thirdweb/extensions/assets"; + * const supported = isNATIVE_TOKENSupported(["0x..."]); + * ``` + */ +export function isNATIVE_TOKENSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the NATIVE_TOKEN function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeNATIVE_TOKENResult } from "thirdweb/extensions/assets"; + * const result = decodeNATIVE_TOKENResultResult("..."); + * ``` + */ +export function decodeNATIVE_TOKENResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "NATIVE_TOKEN" function on the contract. + * @param options - The options for the NATIVE_TOKEN function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { NATIVE_TOKEN } from "thirdweb/extensions/assets"; + * + * const result = await NATIVE_TOKEN({ + * contract, + * }); + * + * ``` + */ +export async function NATIVE_TOKEN(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/read/owner.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/owner.ts new file mode 100644 index 00000000000..9903177bd12 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/owner.ts @@ -0,0 +1,71 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x8da5cb5b" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "result", + }, +] as const; + +/** + * Checks if the `owner` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `owner` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnerSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnerSupported(["0x..."]); + * ``` + */ +export function isOwnerSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the owner function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnerResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnerResultResult("..."); + * ``` + */ +export function decodeOwnerResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "owner" function on the contract. + * @param options - The options for the owner function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { owner } from "thirdweb/extensions/assets"; + * + * const result = await owner({ + * contract, + * }); + * + * ``` + */ +export async function owner(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/read/ownershipHandoverExpiresAt.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/ownershipHandoverExpiresAt.ts new file mode 100644 index 00000000000..5625095f262 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/ownershipHandoverExpiresAt.ts @@ -0,0 +1,135 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "ownershipHandoverExpiresAt" function. + */ +export type OwnershipHandoverExpiresAtParams = { + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}; + +export const FN_SELECTOR = "0xfee81cf4" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [ + { + type: "uint256", + name: "result", + }, +] as const; + +/** + * Checks if the `ownershipHandoverExpiresAt` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `ownershipHandoverExpiresAt` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isOwnershipHandoverExpiresAtSupported } from "thirdweb/extensions/assets"; + * const supported = isOwnershipHandoverExpiresAtSupported(["0x..."]); + * ``` + */ +export function isOwnershipHandoverExpiresAtSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "ownershipHandoverExpiresAt" function. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAtParams } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAtParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAtParams( + options: OwnershipHandoverExpiresAtParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "ownershipHandoverExpiresAt" function into a Hex string with its parameters. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeOwnershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * const result = encodeOwnershipHandoverExpiresAt({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeOwnershipHandoverExpiresAt( + options: OwnershipHandoverExpiresAtParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeOwnershipHandoverExpiresAtParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Decodes the result of the ownershipHandoverExpiresAt function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeOwnershipHandoverExpiresAtResult } from "thirdweb/extensions/assets"; + * const result = decodeOwnershipHandoverExpiresAtResultResult("..."); + * ``` + */ +export function decodeOwnershipHandoverExpiresAtResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "ownershipHandoverExpiresAt" function on the contract. + * @param options - The options for the ownershipHandoverExpiresAt function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { ownershipHandoverExpiresAt } from "thirdweb/extensions/assets"; + * + * const result = await ownershipHandoverExpiresAt({ + * contract, + * pendingOwner: ..., + * }); + * + * ``` + */ +export async function ownershipHandoverExpiresAt( + options: BaseTransactionOptions, +) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [options.pendingOwner], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/read/proxiableUUID.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/proxiableUUID.ts new file mode 100644 index 00000000000..fd62cd8e007 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/read/proxiableUUID.ts @@ -0,0 +1,70 @@ +import { readContract } from "../../../../../transaction/read-contract.js"; +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; + +import { decodeAbiParameters } from "viem"; +import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x52d1902d" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [ + { + type: "bytes32", + }, +] as const; + +/** + * Checks if the `proxiableUUID` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `proxiableUUID` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isProxiableUUIDSupported } from "thirdweb/extensions/assets"; + * const supported = isProxiableUUIDSupported(["0x..."]); + * ``` + */ +export function isProxiableUUIDSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Decodes the result of the proxiableUUID function call. + * @param result - The hexadecimal result to decode. + * @returns The decoded result as per the FN_OUTPUTS definition. + * @extension ASSETS + * @example + * ```ts + * import { decodeProxiableUUIDResult } from "thirdweb/extensions/assets"; + * const result = decodeProxiableUUIDResultResult("..."); + * ``` + */ +export function decodeProxiableUUIDResult(result: Hex) { + return decodeAbiParameters(FN_OUTPUTS, result)[0]; +} + +/** + * Calls the "proxiableUUID" function on the contract. + * @param options - The options for the proxiableUUID function. + * @returns The parsed result of the function call. + * @extension ASSETS + * @example + * ```ts + * import { proxiableUUID } from "thirdweb/extensions/assets"; + * + * const result = await proxiableUUID({ + * contract, + * }); + * + * ``` + */ +export async function proxiableUUID(options: BaseTransactionOptions) { + return readContract({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: [], + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/cancelOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/cancelOwnershipHandover.ts new file mode 100644 index 00000000000..a1e60004b43 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/cancelOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x54d1f13d" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `cancelOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `cancelOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCancelOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCancelOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCancelOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "cancelOwnershipHandover" function on the contract. + * @param options - The options for the "cancelOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { cancelOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = cancelOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function cancelOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/completeOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/completeOwnershipHandover.ts new file mode 100644 index 00000000000..c4bf81966fe --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/completeOwnershipHandover.ts @@ -0,0 +1,148 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "completeOwnershipHandover" function. + */ +export type CompleteOwnershipHandoverParams = WithOverrides<{ + pendingOwner: AbiParameterToPrimitiveType<{ + type: "address"; + name: "pendingOwner"; + }>; +}>; + +export const FN_SELECTOR = "0xf04e283e" as const; +const FN_INPUTS = [ + { + type: "address", + name: "pendingOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `completeOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `completeOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCompleteOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCompleteOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isCompleteOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "completeOwnershipHandover" function. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandoverParams } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandoverParams({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandoverParams( + options: CompleteOwnershipHandoverParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.pendingOwner]); +} + +/** + * Encodes the "completeOwnershipHandover" function into a Hex string with its parameters. + * @param options - The options for the completeOwnershipHandover function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCompleteOwnershipHandover } from "thirdweb/extensions/assets"; + * const result = encodeCompleteOwnershipHandover({ + * pendingOwner: ..., + * }); + * ``` + */ +export function encodeCompleteOwnershipHandover( + options: CompleteOwnershipHandoverParams, +) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCompleteOwnershipHandoverParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "completeOwnershipHandover" function on the contract. + * @param options - The options for the "completeOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { completeOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = completeOwnershipHandover({ + * contract, + * pendingOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function completeOwnershipHandover( + options: BaseTransactionOptions< + | CompleteOwnershipHandoverParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.pendingOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/createMarket.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/createMarket.ts new file mode 100644 index 00000000000..bece8074748 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/createMarket.ts @@ -0,0 +1,214 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "createMarket" function. + */ +export type CreateMarketParams = WithOverrides<{ + createMarketConfig: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "createMarketConfig"; + components: [ + { type: "address"; name: "creator" }, + { type: "address"; name: "tokenIn" }, + { type: "address"; name: "tokenOut" }, + { type: "uint256"; name: "pricePerUnit" }, + { type: "uint8"; name: "priceDenominator" }, + { type: "uint256"; name: "totalSupply" }, + { type: "uint48"; name: "startTime" }, + { type: "uint48"; name: "endTime" }, + { type: "uint256"; name: "tokenId" }, + { type: "address"; name: "hook" }, + { type: "bytes"; name: "createHookData" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0xc6d6be45" as const; +const FN_INPUTS = [ + { + type: "tuple", + name: "createMarketConfig", + components: [ + { + type: "address", + name: "creator", + }, + { + type: "address", + name: "tokenIn", + }, + { + type: "address", + name: "tokenOut", + }, + { + type: "uint256", + name: "pricePerUnit", + }, + { + type: "uint8", + name: "priceDenominator", + }, + { + type: "uint256", + name: "totalSupply", + }, + { + type: "uint48", + name: "startTime", + }, + { + type: "uint48", + name: "endTime", + }, + { + type: "uint256", + name: "tokenId", + }, + { + type: "address", + name: "hook", + }, + { + type: "bytes", + name: "createHookData", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "sale", + }, + { + type: "address", + name: "position", + }, + { + type: "uint256", + name: "positionId", + }, +] as const; + +/** + * Checks if the `createMarket` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `createMarket` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCreateMarketSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCreateMarketSupported(["0x..."]); + * ``` + */ +export function isCreateMarketSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "createMarket" function. + * @param options - The options for the createMarket function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateMarketParams } from "thirdweb/extensions/assets"; + * const result = encodeCreateMarketParams({ + * createMarketConfig: ..., + * }); + * ``` + */ +export function encodeCreateMarketParams(options: CreateMarketParams) { + return encodeAbiParameters(FN_INPUTS, [options.createMarketConfig]); +} + +/** + * Encodes the "createMarket" function into a Hex string with its parameters. + * @param options - The options for the createMarket function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreateMarket } from "thirdweb/extensions/assets"; + * const result = encodeCreateMarket({ + * createMarketConfig: ..., + * }); + * ``` + */ +export function encodeCreateMarket(options: CreateMarketParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCreateMarketParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "createMarket" function on the contract. + * @param options - The options for the "createMarket" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { createMarket } from "thirdweb/extensions/assets"; + * + * const transaction = createMarket({ + * contract, + * createMarketConfig: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function createMarket( + options: BaseTransactionOptions< + | CreateMarketParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.createMarketConfig] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/createPool.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/createPool.ts new file mode 100644 index 00000000000..099fc89f3d8 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/createPool.ts @@ -0,0 +1,202 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "createPool" function. + */ +export type CreatePoolParams = WithOverrides<{ + createPoolConfig: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "createPoolConfig"; + components: [ + { type: "address"; name: "recipient" }, + { type: "address"; name: "referrer" }, + { type: "address"; name: "tokenA" }, + { type: "address"; name: "tokenB" }, + { type: "uint256"; name: "amountA" }, + { type: "uint256"; name: "amountB" }, + { type: "bytes"; name: "data" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0xa1970c55" as const; +const FN_INPUTS = [ + { + type: "tuple", + name: "createPoolConfig", + components: [ + { + type: "address", + name: "recipient", + }, + { + type: "address", + name: "referrer", + }, + { + type: "address", + name: "tokenA", + }, + { + type: "address", + name: "tokenB", + }, + { + type: "uint256", + name: "amountA", + }, + { + type: "uint256", + name: "amountB", + }, + { + type: "bytes", + name: "data", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "address", + name: "pool", + }, + { + type: "address", + name: "position", + }, + { + type: "uint256", + name: "positionId", + }, + { + type: "uint256", + name: "refundAmount0", + }, + { + type: "uint256", + name: "refundAmount1", + }, +] as const; + +/** + * Checks if the `createPool` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `createPool` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isCreatePoolSupported } from "thirdweb/extensions/assets"; + * + * const supported = isCreatePoolSupported(["0x..."]); + * ``` + */ +export function isCreatePoolSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "createPool" function. + * @param options - The options for the createPool function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreatePoolParams } from "thirdweb/extensions/assets"; + * const result = encodeCreatePoolParams({ + * createPoolConfig: ..., + * }); + * ``` + */ +export function encodeCreatePoolParams(options: CreatePoolParams) { + return encodeAbiParameters(FN_INPUTS, [options.createPoolConfig]); +} + +/** + * Encodes the "createPool" function into a Hex string with its parameters. + * @param options - The options for the createPool function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeCreatePool } from "thirdweb/extensions/assets"; + * const result = encodeCreatePool({ + * createPoolConfig: ..., + * }); + * ``` + */ +export function encodeCreatePool(options: CreatePoolParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeCreatePoolParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "createPool" function on the contract. + * @param options - The options for the "createPool" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { createPool } from "thirdweb/extensions/assets"; + * + * const transaction = createPool({ + * contract, + * createPoolConfig: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function createPool( + options: BaseTransactionOptions< + | CreatePoolParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.createPoolConfig] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/disableAdapter.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/disableAdapter.ts new file mode 100644 index 00000000000..e337f719658 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/disableAdapter.ts @@ -0,0 +1,142 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "disableAdapter" function. + */ +export type DisableAdapterParams = WithOverrides<{ + adapterType: AbiParameterToPrimitiveType<{ + type: "uint8"; + name: "adapterType"; + }>; +}>; + +export const FN_SELECTOR = "0xa3f3a7bd" as const; +const FN_INPUTS = [ + { + type: "uint8", + name: "adapterType", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `disableAdapter` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `disableAdapter` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isDisableAdapterSupported } from "thirdweb/extensions/assets"; + * + * const supported = isDisableAdapterSupported(["0x..."]); + * ``` + */ +export function isDisableAdapterSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "disableAdapter" function. + * @param options - The options for the disableAdapter function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeDisableAdapterParams } from "thirdweb/extensions/assets"; + * const result = encodeDisableAdapterParams({ + * adapterType: ..., + * }); + * ``` + */ +export function encodeDisableAdapterParams(options: DisableAdapterParams) { + return encodeAbiParameters(FN_INPUTS, [options.adapterType]); +} + +/** + * Encodes the "disableAdapter" function into a Hex string with its parameters. + * @param options - The options for the disableAdapter function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeDisableAdapter } from "thirdweb/extensions/assets"; + * const result = encodeDisableAdapter({ + * adapterType: ..., + * }); + * ``` + */ +export function encodeDisableAdapter(options: DisableAdapterParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeDisableAdapterParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "disableAdapter" function on the contract. + * @param options - The options for the "disableAdapter" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { disableAdapter } from "thirdweb/extensions/assets"; + * + * const transaction = disableAdapter({ + * contract, + * adapterType: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function disableAdapter( + options: BaseTransactionOptions< + | DisableAdapterParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.adapterType] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/enableAdapter.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/enableAdapter.ts new file mode 100644 index 00000000000..a8eac8c28d5 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/enableAdapter.ts @@ -0,0 +1,150 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "enableAdapter" function. + */ +export type EnableAdapterParams = WithOverrides<{ + adapterType: AbiParameterToPrimitiveType<{ + type: "uint8"; + name: "adapterType"; + }>; + config: AbiParameterToPrimitiveType<{ type: "bytes"; name: "config" }>; +}>; + +export const FN_SELECTOR = "0xab348bdb" as const; +const FN_INPUTS = [ + { + type: "uint8", + name: "adapterType", + }, + { + type: "bytes", + name: "config", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `enableAdapter` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `enableAdapter` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isEnableAdapterSupported } from "thirdweb/extensions/assets"; + * + * const supported = isEnableAdapterSupported(["0x..."]); + * ``` + */ +export function isEnableAdapterSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "enableAdapter" function. + * @param options - The options for the enableAdapter function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeEnableAdapterParams } from "thirdweb/extensions/assets"; + * const result = encodeEnableAdapterParams({ + * adapterType: ..., + * config: ..., + * }); + * ``` + */ +export function encodeEnableAdapterParams(options: EnableAdapterParams) { + return encodeAbiParameters(FN_INPUTS, [options.adapterType, options.config]); +} + +/** + * Encodes the "enableAdapter" function into a Hex string with its parameters. + * @param options - The options for the enableAdapter function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeEnableAdapter } from "thirdweb/extensions/assets"; + * const result = encodeEnableAdapter({ + * adapterType: ..., + * config: ..., + * }); + * ``` + */ +export function encodeEnableAdapter(options: EnableAdapterParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeEnableAdapterParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "enableAdapter" function on the contract. + * @param options - The options for the "enableAdapter" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { enableAdapter } from "thirdweb/extensions/assets"; + * + * const transaction = enableAdapter({ + * contract, + * adapterType: ..., + * config: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function enableAdapter( + options: BaseTransactionOptions< + | EnableAdapterParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.adapterType, resolvedOptions.config] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/initialize.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/initialize.ts new file mode 100644 index 00000000000..3c12ac4ee92 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/initialize.ts @@ -0,0 +1,139 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "initialize" function. + */ +export type InitializeParams = WithOverrides<{ + owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner" }>; +}>; + +export const FN_SELECTOR = "0xc4d66de8" as const; +const FN_INPUTS = [ + { + type: "address", + name: "owner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `initialize` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `initialize` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isInitializeSupported } from "thirdweb/extensions/assets"; + * + * const supported = isInitializeSupported(["0x..."]); + * ``` + */ +export function isInitializeSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "initialize" function. + * @param options - The options for the initialize function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeInitializeParams } from "thirdweb/extensions/assets"; + * const result = encodeInitializeParams({ + * owner: ..., + * }); + * ``` + */ +export function encodeInitializeParams(options: InitializeParams) { + return encodeAbiParameters(FN_INPUTS, [options.owner]); +} + +/** + * Encodes the "initialize" function into a Hex string with its parameters. + * @param options - The options for the initialize function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeInitialize } from "thirdweb/extensions/assets"; + * const result = encodeInitialize({ + * owner: ..., + * }); + * ``` + */ +export function encodeInitialize(options: InitializeParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeInitializeParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "initialize" function on the contract. + * @param options - The options for the "initialize" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { initialize } from "thirdweb/extensions/assets"; + * + * const transaction = initialize({ + * contract, + * owner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function initialize( + options: BaseTransactionOptions< + | InitializeParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.owner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/renounceOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/renounceOwnership.ts new file mode 100644 index 00000000000..7b8b575e3b4 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/renounceOwnership.ts @@ -0,0 +1,50 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x715018a6" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `renounceOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `renounceOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRenounceOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRenounceOwnershipSupported(["0x..."]); + * ``` + */ +export function isRenounceOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "renounceOwnership" function on the contract. + * @param options - The options for the "renounceOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { renounceOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = renounceOwnership(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function renounceOwnership(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/requestOwnershipHandover.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/requestOwnershipHandover.ts new file mode 100644 index 00000000000..e0744619fae --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/requestOwnershipHandover.ts @@ -0,0 +1,52 @@ +import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; + +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +export const FN_SELECTOR = "0x25692962" as const; +const FN_INPUTS = [] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `requestOwnershipHandover` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `requestOwnershipHandover` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isRequestOwnershipHandoverSupported } from "thirdweb/extensions/assets"; + * + * const supported = isRequestOwnershipHandoverSupported(["0x..."]); + * ``` + */ +export function isRequestOwnershipHandoverSupported( + availableSelectors: string[], +) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Prepares a transaction to call the "requestOwnershipHandover" function on the contract. + * @param options - The options for the "requestOwnershipHandover" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { requestOwnershipHandover } from "thirdweb/extensions/assets"; + * + * const transaction = requestOwnershipHandover(); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function requestOwnershipHandover(options: BaseTransactionOptions) { + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/swap.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/swap.ts new file mode 100644 index 00000000000..4d51ce7fe8e --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/swap.ts @@ -0,0 +1,203 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "swap" function. + */ +export type SwapParams = WithOverrides<{ + config: AbiParameterToPrimitiveType<{ + type: "tuple"; + name: "config"; + components: [ + { type: "address"; name: "tokenIn" }, + { type: "address"; name: "tokenOut" }, + { type: "uint256"; name: "amountIn" }, + { type: "uint256"; name: "minAmountOut" }, + { type: "address"; name: "recipient" }, + { type: "address"; name: "refundRecipient" }, + { type: "uint256"; name: "deadline" }, + { type: "bytes"; name: "data" }, + ]; + }>; +}>; + +export const FN_SELECTOR = "0x8892376c" as const; +const FN_INPUTS = [ + { + type: "tuple", + name: "config", + components: [ + { + type: "address", + name: "tokenIn", + }, + { + type: "address", + name: "tokenOut", + }, + { + type: "uint256", + name: "amountIn", + }, + { + type: "uint256", + name: "minAmountOut", + }, + { + type: "address", + name: "recipient", + }, + { + type: "address", + name: "refundRecipient", + }, + { + type: "uint256", + name: "deadline", + }, + { + type: "bytes", + name: "data", + }, + ], + }, +] as const; +const FN_OUTPUTS = [ + { + type: "tuple", + name: "result", + components: [ + { + type: "uint256", + name: "amountIn", + }, + { + type: "uint256", + name: "amountOut", + }, + { + type: "address", + name: "source", + }, + ], + }, +] as const; + +/** + * Checks if the `swap` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `swap` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isSwapSupported } from "thirdweb/extensions/assets"; + * + * const supported = isSwapSupported(["0x..."]); + * ``` + */ +export function isSwapSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "swap" function. + * @param options - The options for the swap function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeSwapParams } from "thirdweb/extensions/assets"; + * const result = encodeSwapParams({ + * config: ..., + * }); + * ``` + */ +export function encodeSwapParams(options: SwapParams) { + return encodeAbiParameters(FN_INPUTS, [options.config]); +} + +/** + * Encodes the "swap" function into a Hex string with its parameters. + * @param options - The options for the swap function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeSwap } from "thirdweb/extensions/assets"; + * const result = encodeSwap({ + * config: ..., + * }); + * ``` + */ +export function encodeSwap(options: SwapParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeSwapParams(options).slice(2)) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "swap" function on the contract. + * @param options - The options for the "swap" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { swap } from "thirdweb/extensions/assets"; + * + * const transaction = swap({ + * contract, + * config: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function swap( + options: BaseTransactionOptions< + | SwapParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.config] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/transferOwnership.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/transferOwnership.ts new file mode 100644 index 00000000000..36f0df68e14 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/transferOwnership.ts @@ -0,0 +1,141 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "transferOwnership" function. + */ +export type TransferOwnershipParams = WithOverrides<{ + newOwner: AbiParameterToPrimitiveType<{ type: "address"; name: "newOwner" }>; +}>; + +export const FN_SELECTOR = "0xf2fde38b" as const; +const FN_INPUTS = [ + { + type: "address", + name: "newOwner", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `transferOwnership` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `transferOwnership` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isTransferOwnershipSupported } from "thirdweb/extensions/assets"; + * + * const supported = isTransferOwnershipSupported(["0x..."]); + * ``` + */ +export function isTransferOwnershipSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "transferOwnership" function. + * @param options - The options for the transferOwnership function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnershipParams } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnershipParams({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnershipParams( + options: TransferOwnershipParams, +) { + return encodeAbiParameters(FN_INPUTS, [options.newOwner]); +} + +/** + * Encodes the "transferOwnership" function into a Hex string with its parameters. + * @param options - The options for the transferOwnership function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeTransferOwnership } from "thirdweb/extensions/assets"; + * const result = encodeTransferOwnership({ + * newOwner: ..., + * }); + * ``` + */ +export function encodeTransferOwnership(options: TransferOwnershipParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeTransferOwnershipParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "transferOwnership" function on the contract. + * @param options - The options for the "transferOwnership" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { transferOwnership } from "thirdweb/extensions/assets"; + * + * const transaction = transferOwnership({ + * contract, + * newOwner: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function transferOwnership( + options: BaseTransactionOptions< + | TransferOwnershipParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.newOwner] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/assets/__generated__/Router/write/upgradeToAndCall.ts b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/upgradeToAndCall.ts new file mode 100644 index 00000000000..63e1152f422 --- /dev/null +++ b/packages/thirdweb/src/extensions/assets/__generated__/Router/write/upgradeToAndCall.ts @@ -0,0 +1,153 @@ +import type { AbiParameterToPrimitiveType } from "abitype"; +import type { + BaseTransactionOptions, + WithOverrides, +} from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; +import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; +import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +/** + * Represents the parameters for the "upgradeToAndCall" function. + */ +export type UpgradeToAndCallParams = WithOverrides<{ + newImplementation: AbiParameterToPrimitiveType<{ + type: "address"; + name: "newImplementation"; + }>; + data: AbiParameterToPrimitiveType<{ type: "bytes"; name: "data" }>; +}>; + +export const FN_SELECTOR = "0x4f1ef286" as const; +const FN_INPUTS = [ + { + type: "address", + name: "newImplementation", + }, + { + type: "bytes", + name: "data", + }, +] as const; +const FN_OUTPUTS = [] as const; + +/** + * Checks if the `upgradeToAndCall` method is supported by the given contract. + * @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors. + * @returns A boolean indicating if the `upgradeToAndCall` method is supported. + * @extension ASSETS + * @example + * ```ts + * import { isUpgradeToAndCallSupported } from "thirdweb/extensions/assets"; + * + * const supported = isUpgradeToAndCallSupported(["0x..."]); + * ``` + */ +export function isUpgradeToAndCallSupported(availableSelectors: string[]) { + return detectMethod({ + availableSelectors, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + }); +} + +/** + * Encodes the parameters for the "upgradeToAndCall" function. + * @param options - The options for the upgradeToAndCall function. + * @returns The encoded ABI parameters. + * @extension ASSETS + * @example + * ```ts + * import { encodeUpgradeToAndCallParams } from "thirdweb/extensions/assets"; + * const result = encodeUpgradeToAndCallParams({ + * newImplementation: ..., + * data: ..., + * }); + * ``` + */ +export function encodeUpgradeToAndCallParams(options: UpgradeToAndCallParams) { + return encodeAbiParameters(FN_INPUTS, [ + options.newImplementation, + options.data, + ]); +} + +/** + * Encodes the "upgradeToAndCall" function into a Hex string with its parameters. + * @param options - The options for the upgradeToAndCall function. + * @returns The encoded hexadecimal string. + * @extension ASSETS + * @example + * ```ts + * import { encodeUpgradeToAndCall } from "thirdweb/extensions/assets"; + * const result = encodeUpgradeToAndCall({ + * newImplementation: ..., + * data: ..., + * }); + * ``` + */ +export function encodeUpgradeToAndCall(options: UpgradeToAndCallParams) { + // we do a "manual" concat here to avoid the overhead of the "concatHex" function + // we can do this because we know the specific formats of the values + return (FN_SELECTOR + + encodeUpgradeToAndCallParams(options).slice( + 2, + )) as `${typeof FN_SELECTOR}${string}`; +} + +/** + * Prepares a transaction to call the "upgradeToAndCall" function on the contract. + * @param options - The options for the "upgradeToAndCall" function. + * @returns A prepared transaction object. + * @extension ASSETS + * @example + * ```ts + * import { sendTransaction } from "thirdweb"; + * import { upgradeToAndCall } from "thirdweb/extensions/assets"; + * + * const transaction = upgradeToAndCall({ + * contract, + * newImplementation: ..., + * data: ..., + * overrides: { + * ... + * } + * }); + * + * // Send the transaction + * await sendTransaction({ transaction, account }); + * ``` + */ +export function upgradeToAndCall( + options: BaseTransactionOptions< + | UpgradeToAndCallParams + | { + asyncParams: () => Promise; + } + >, +) { + const asyncOptions = once(async () => { + return "asyncParams" in options ? await options.asyncParams() : options; + }); + + return prepareContractCall({ + contract: options.contract, + method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, + params: async () => { + const resolvedOptions = await asyncOptions(); + return [resolvedOptions.newImplementation, resolvedOptions.data] as const; + }, + value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, + }); +} diff --git a/packages/thirdweb/src/extensions/common/__generated__/IClaimConditionsSinglePhase/write/setClaimConditions.ts b/packages/thirdweb/src/extensions/common/__generated__/IClaimConditionsSinglePhase/write/setClaimConditions.ts index de478f3c8be..56c279e35ce 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IClaimConditionsSinglePhase/write/setClaimConditions.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IClaimConditionsSinglePhase/write/setClaimConditions.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimConditions" function. @@ -35,46 +35,46 @@ export type SetClaimConditionsParams = WithOverrides<{ export const FN_SELECTOR = "0x426cfaf3" as const; const FN_INPUTS = [ { + type: "tuple", + name: "phase", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "phase", - type: "tuple", }, { - name: "resetClaimEligibility", type: "bool", + name: "resetClaimEligibility", }, ] as const; const FN_OUTPUTS = [] as const; @@ -180,19 +180,8 @@ export function setClaimConditions( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -201,5 +190,16 @@ export function setClaimConditions( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/contractURI.ts b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/contractURI.ts index d50373e8312..2ea7753de27 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/contractURI.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/contractURI.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe8a3d485" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/name.ts b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/name.ts index 1b93894ecfe..3ffea0690fc 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/name.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/name.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x06fdde03" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/symbol.ts b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/symbol.ts index 3ded3f5529b..bb275da2f18 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/symbol.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/read/symbol.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x95d89b41" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/write/setContractURI.ts b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/write/setContractURI.ts index b2bda000fe3..da4fc19dbd4 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/write/setContractURI.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IContractMetadata/write/setContractURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setContractURI" function. @@ -18,8 +18,8 @@ export type SetContractURIParams = WithOverrides<{ export const FN_SELECTOR = "0x938e3d7b" as const; const FN_INPUTS = [ { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function setContractURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IMulticall/write/multicall.ts b/packages/thirdweb/src/extensions/common/__generated__/IMulticall/write/multicall.ts index 74199738d5d..191addedb4a 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IMulticall/write/multicall.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IMulticall/write/multicall.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "multicall" function. @@ -18,14 +18,14 @@ export type MulticallParams = WithOverrides<{ export const FN_SELECTOR = "0xac9650d8" as const; const FN_INPUTS = [ { - name: "data", type: "bytes[]", + name: "data", }, ] as const; const FN_OUTPUTS = [ { - name: "results", type: "bytes[]", + name: "results", }, ] as const; @@ -122,23 +122,23 @@ export function multicall( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.data] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IOwnable/events/OwnerUpdated.ts b/packages/thirdweb/src/extensions/common/__generated__/IOwnable/events/OwnerUpdated.ts index dcbeaf28259..b4114846977 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IOwnable/events/OwnerUpdated.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IOwnable/events/OwnerUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "OwnerUpdated" event. @@ -40,8 +40,8 @@ export type OwnerUpdatedEventFilters = Partial<{ */ export function ownerUpdatedEvent(filters: OwnerUpdatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event OwnerUpdated(address indexed prevOwner, address indexed newOwner)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IOwnable/read/owner.ts b/packages/thirdweb/src/extensions/common/__generated__/IOwnable/read/owner.ts index e7d18e25f94..91c7d953571 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IOwnable/read/owner.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IOwnable/read/owner.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x8da5cb5b" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IOwnable/write/setOwner.ts b/packages/thirdweb/src/extensions/common/__generated__/IOwnable/write/setOwner.ts index c6f3df7afa6..ccd898be5ea 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IOwnable/write/setOwner.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IOwnable/write/setOwner.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setOwner" function. @@ -18,8 +18,8 @@ export type SetOwnerParams = WithOverrides<{ export const FN_SELECTOR = "0x13af4035" as const; const FN_INPUTS = [ { - name: "_newOwner", type: "address", + name: "_newOwner", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function setOwner( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newOwner] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/events/PlatformFeeInfoUpdated.ts b/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/events/PlatformFeeInfoUpdated.ts index f0d95180ea3..2db6b4f4412 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/events/PlatformFeeInfoUpdated.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/events/PlatformFeeInfoUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PlatformFeeInfoUpdated" event. @@ -36,8 +36,8 @@ export function platformFeeInfoUpdatedEvent( filters: PlatformFeeInfoUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/read/getPlatformFeeInfo.ts b/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/read/getPlatformFeeInfo.ts index 8ea7d761d26..8a762797f05 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/read/getPlatformFeeInfo.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/read/getPlatformFeeInfo.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xd45573f6" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/write/setPlatformFeeInfo.ts b/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/write/setPlatformFeeInfo.ts index 8de7bf51263..4dd68636156 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/write/setPlatformFeeInfo.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IPlatformFee/write/setPlatformFeeInfo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setPlatformFeeInfo" function. @@ -25,12 +25,12 @@ export type SetPlatformFeeInfoParams = WithOverrides<{ export const FN_SELECTOR = "0x1e7ac488" as const; const FN_INPUTS = [ { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, { - name: "_platformFeeBps", type: "uint256", + name: "_platformFeeBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -136,19 +136,8 @@ export function setPlatformFeeInfo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function setPlatformFeeInfo( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/events/PrimarySaleRecipientUpdated.ts b/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/events/PrimarySaleRecipientUpdated.ts index e247a3f1119..435c2f003e0 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/events/PrimarySaleRecipientUpdated.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/events/PrimarySaleRecipientUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PrimarySaleRecipientUpdated" event. @@ -36,7 +36,7 @@ export function primarySaleRecipientUpdatedEvent( filters: PrimarySaleRecipientUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PrimarySaleRecipientUpdated(address indexed recipient)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/read/primarySaleRecipient.ts b/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/read/primarySaleRecipient.ts index 56a38752334..d5bc32a66fd 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/read/primarySaleRecipient.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/read/primarySaleRecipient.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x079fe40e" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/write/setPrimarySaleRecipient.ts b/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/write/setPrimarySaleRecipient.ts index b80fe119c12..1700a8c5103 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/write/setPrimarySaleRecipient.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IPrimarySale/write/setPrimarySaleRecipient.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setPrimarySaleRecipient" function. @@ -21,8 +21,8 @@ export type SetPrimarySaleRecipientParams = WithOverrides<{ export const FN_SELECTOR = "0x6f4f2837" as const; const FN_INPUTS = [ { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -126,23 +126,23 @@ export function setPrimarySaleRecipient( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.saleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/DefaultRoyalty.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/DefaultRoyalty.ts index e99421c5576..bda5d833de1 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/DefaultRoyalty.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/DefaultRoyalty.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "DefaultRoyalty" event. @@ -34,8 +34,8 @@ export type DefaultRoyaltyEventFilters = Partial<{ */ export function defaultRoyaltyEvent(filters: DefaultRoyaltyEventFilters = {}) { return prepareEvent({ - filters, signature: "event DefaultRoyalty(address indexed newRoyaltyRecipient, uint256 newRoyaltyBps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/RoyaltyForToken.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/RoyaltyForToken.ts index 435be15ef77..4dea19eac28 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/RoyaltyForToken.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/events/RoyaltyForToken.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoyaltyForToken" event. @@ -42,8 +42,8 @@ export function royaltyForTokenEvent( filters: RoyaltyForTokenEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event RoyaltyForToken(uint256 indexed tokenId, address indexed royaltyRecipient, uint256 royaltyBps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getDefaultRoyaltyInfo.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getDefaultRoyaltyInfo.ts index 586f785dd19..35b885df948 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getDefaultRoyaltyInfo.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getDefaultRoyaltyInfo.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xb24f2d39" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getRoyaltyInfoForToken.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getRoyaltyInfoForToken.ts index fd5e7a63dd9..df38082ccab 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getRoyaltyInfoForToken.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/getRoyaltyInfoForToken.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoyaltyInfoForToken" function. @@ -16,8 +16,8 @@ export type GetRoyaltyInfoForTokenParams = { export const FN_SELECTOR = "0x4cc157df" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/royaltyInfo.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/royaltyInfo.ts index d697e3822da..9b63a90861b 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/royaltyInfo.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/royaltyInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "royaltyInfo" function. @@ -20,22 +20,22 @@ export type RoyaltyInfoParams = { export const FN_SELECTOR = "0x2a55205a" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "salePrice", type: "uint256", + name: "salePrice", }, ] as const; const FN_OUTPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "royaltyAmount", type: "uint256", + name: "royaltyAmount", }, ] as const; diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/supportsInterface.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/supportsInterface.ts index f24fc2d98c7..2ac55df9cbf 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setDefaultRoyaltyInfo.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setDefaultRoyaltyInfo.ts index 560af965e80..d50f9564b26 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setDefaultRoyaltyInfo.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setDefaultRoyaltyInfo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setDefaultRoyaltyInfo" function. @@ -25,12 +25,12 @@ export type SetDefaultRoyaltyInfoParams = WithOverrides<{ export const FN_SELECTOR = "0x600dd5ea" as const; const FN_INPUTS = [ { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint256", + name: "_royaltyBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -138,19 +138,8 @@ export function setDefaultRoyaltyInfo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -159,5 +148,16 @@ export function setDefaultRoyaltyInfo( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setRoyaltyInfoForToken.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setRoyaltyInfoForToken.ts index a429c655018..7ea6f0a96e3 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setRoyaltyInfoForToken.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyalty/write/setRoyaltyInfoForToken.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setRoyaltyInfoForToken" function. @@ -23,16 +23,16 @@ export type SetRoyaltyInfoForTokenParams = WithOverrides<{ export const FN_SELECTOR = "0x9bcf7a15" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "recipient", type: "address", + name: "recipient", }, { - name: "bps", type: "uint256", + name: "bps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,19 +146,8 @@ export function setRoyaltyInfoForToken( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -168,5 +157,16 @@ export function setRoyaltyInfoForToken( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/events/RoyaltyEngineUpdated.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/events/RoyaltyEngineUpdated.ts index 9c938a8bc7c..4de63a5df08 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/events/RoyaltyEngineUpdated.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/events/RoyaltyEngineUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoyaltyEngineUpdated" event. @@ -42,8 +42,8 @@ export function royaltyEngineUpdatedEvent( filters: RoyaltyEngineUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event RoyaltyEngineUpdated(address indexed previousAddress, address indexed newAddress)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/read/supportsInterface.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/read/supportsInterface.ts index f24fc2d98c7..2ac55df9cbf 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/getRoyalty.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/getRoyalty.ts index 10b2fa5dba7..a2f63658455 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/getRoyalty.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/getRoyalty.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoyalty" function. @@ -23,26 +23,26 @@ export type GetRoyaltyParams = WithOverrides<{ export const FN_SELECTOR = "0xf533b802" as const; const FN_INPUTS = [ { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "value", type: "uint256", + name: "value", }, ] as const; const FN_OUTPUTS = [ { - name: "recipients", type: "address[]", + name: "recipients", }, { - name: "amounts", type: "uint256[]", + name: "amounts", }, ] as const; @@ -149,19 +149,8 @@ export function getRoyalty( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -171,5 +160,16 @@ export function getRoyalty( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/setRoyaltyEngine.ts b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/setRoyaltyEngine.ts index fd34974caa0..6b3ae0a2749 100644 --- a/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/setRoyaltyEngine.ts +++ b/packages/thirdweb/src/extensions/common/__generated__/IRoyaltyPayments/write/setRoyaltyEngine.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setRoyaltyEngine" function. @@ -21,8 +21,8 @@ export type SetRoyaltyEngineParams = WithOverrides<{ export const FN_SELECTOR = "0x21ede032" as const; const FN_INPUTS = [ { - name: "_royaltyEngineAddress", type: "address", + name: "_royaltyEngineAddress", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setRoyaltyEngine( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.royaltyEngineAddress] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/read/getAllExtensions.ts b/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/read/getAllExtensions.ts index ad7179fa3bb..e3a8808253c 100644 --- a/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/read/getAllExtensions.ts +++ b/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/read/getAllExtensions.ts @@ -1,48 +1,49 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x4a00cc48" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { + type: "tuple", + name: "metadata", components: [ { - name: "name", type: "string", + name: "name", }, { - name: "metadataURI", type: "string", + name: "metadataURI", }, { - name: "implementation", type: "address", + name: "implementation", }, ], - name: "metadata", - type: "tuple", }, { + type: "tuple[]", + name: "functions", components: [ { - name: "functionSelector", type: "bytes4", + name: "functionSelector", }, { - name: "functionSignature", type: "string", + name: "functionSignature", }, ], - name: "functions", - type: "tuple[]", }, ], - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/addExtension.ts b/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/addExtension.ts index f5e348496b7..6ad5e011e49 100644 --- a/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/addExtension.ts +++ b/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/addExtension.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "addExtension" function. @@ -40,42 +40,42 @@ export type AddExtensionParams = WithOverrides<{ export const FN_SELECTOR = "0xe05688fe" as const; const FN_INPUTS = [ { + type: "tuple", + name: "extension", components: [ { + type: "tuple", + name: "metadata", components: [ { - name: "name", type: "string", + name: "name", }, { - name: "metadataURI", type: "string", + name: "metadataURI", }, { - name: "implementation", type: "address", + name: "implementation", }, ], - name: "metadata", - type: "tuple", }, { + type: "tuple[]", + name: "functions", components: [ { - name: "functionSelector", type: "bytes4", + name: "functionSelector", }, { - name: "functionSignature", type: "string", + name: "functionSignature", }, ], - name: "functions", - type: "tuple[]", }, ], - name: "extension", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -173,23 +173,23 @@ export function addExtension( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.extension] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/removeExtension.ts b/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/removeExtension.ts index e44ffee9980..34a7822686b 100644 --- a/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/removeExtension.ts +++ b/packages/thirdweb/src/extensions/dynamic-contracts/__generated__/IExtensionManager/write/removeExtension.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "removeExtension" function. @@ -21,8 +21,8 @@ export type RemoveExtensionParams = WithOverrides<{ export const FN_SELECTOR = "0xee7d2adf" as const; const FN_INPUTS = [ { - name: "extensionName", type: "string", + name: "extensionName", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function removeExtension( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.extensionName] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/ABI.ts b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/ABI.ts index 5343718a58f..73082960b11 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/ABI.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/ABI.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "ABI" function. @@ -20,12 +20,12 @@ export type ABIParams = { export const FN_SELECTOR = "0x2203ab56" as const; const FN_INPUTS = [ { - name: "name", type: "bytes32", + name: "name", }, { - name: "contentTypes", type: "uint256", + name: "contentTypes", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/addr.ts b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/addr.ts index 27820676373..bad6f8ddea0 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/addr.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/addr.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "addr" function. @@ -16,8 +16,8 @@ export type AddrParams = { export const FN_SELECTOR = "0x3b3b57de" as const; const FN_INPUTS = [ { - name: "name", type: "bytes32", + name: "name", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/contenthash.ts b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/contenthash.ts index 9a1bd4f9e85..dc86243a44a 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/contenthash.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/contenthash.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "contenthash" function. @@ -16,8 +16,8 @@ export type ContenthashParams = { export const FN_SELECTOR = "0xbc1c58d1" as const; const FN_INPUTS = [ { - name: "name", type: "bytes32", + name: "name", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/name.ts b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/name.ts index 7e785fe9ad3..660beaf8001 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/name.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/name.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "name" function. @@ -16,8 +16,8 @@ export type NameParams = { export const FN_SELECTOR = "0x691f3431" as const; const FN_INPUTS = [ { - name: "name", type: "bytes32", + name: "name", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/pubkey.ts b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/pubkey.ts index 0173ffa5d1c..26356b9a164 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/pubkey.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/pubkey.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "pubkey" function. @@ -16,18 +16,18 @@ export type PubkeyParams = { export const FN_SELECTOR = "0xc8690233" as const; const FN_INPUTS = [ { - name: "name", type: "bytes32", + name: "name", }, ] as const; const FN_OUTPUTS = [ { - name: "x", type: "bytes32", + name: "x", }, { - name: "y", type: "bytes32", + name: "y", }, ] as const; diff --git a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/text.ts b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/text.ts index 8e7eae1f029..48245cd713c 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/text.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/AddressResolver/read/text.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "text" function. @@ -17,12 +17,12 @@ export type TextParams = { export const FN_SELECTOR = "0x59d1d43c" as const; const FN_INPUTS = [ { - name: "name", type: "bytes32", + name: "name", }, { - name: "key", type: "string", + name: "key", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/ens/__generated__/L2Resolver/read/name.ts b/packages/thirdweb/src/extensions/ens/__generated__/L2Resolver/read/name.ts index 20af79874cb..578f2a95426 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/L2Resolver/read/name.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/L2Resolver/read/name.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "name" function. @@ -16,8 +16,8 @@ export type NameParams = { export const FN_SELECTOR = "0x691f3431" as const; const FN_INPUTS = [ { - name: "node", type: "bytes32", + name: "node", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/resolve.ts b/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/resolve.ts index 2c9bcbb9fcb..3fe798c55dd 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/resolve.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/resolve.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "resolve" function. @@ -17,12 +17,12 @@ export type ResolveParams = { export const FN_SELECTOR = "0x9061b923" as const; const FN_INPUTS = [ { - name: "name", type: "bytes", + name: "name", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/reverse.ts b/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/reverse.ts index f9e4de7d1a1..6fe4e4d1c1f 100644 --- a/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/reverse.ts +++ b/packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/reverse.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "reverse" function. @@ -19,8 +19,8 @@ export type ReverseParams = { export const FN_SELECTOR = "0xec11c823" as const; const FN_INPUTS = [ { - name: "reverseName", type: "bytes", + name: "reverseName", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBaseURICount.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBaseURICount.ts index 73f45348e7c..c676d387afb 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBaseURICount.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBaseURICount.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x63b45e2d" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBatchIdAtIndex.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBatchIdAtIndex.ts index 91ed4f0c74d..0c3088f8948 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBatchIdAtIndex.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/BatchMintMetadata/read/getBatchIdAtIndex.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getBatchIdAtIndex" function. @@ -16,8 +16,8 @@ export type GetBatchIdAtIndexParams = { export const FN_SELECTOR = "0x2419f51b" as const; const FN_INPUTS = [ { - name: "_index", type: "uint256", + name: "_index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/read/verifyClaim.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/read/verifyClaim.ts index 32684a2ec82..b4467275ef2 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/read/verifyClaim.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/read/verifyClaim.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verifyClaim" function. @@ -37,56 +37,56 @@ export type VerifyClaimParams = { export const FN_SELECTOR = "0xea1def9c" as const; const FN_INPUTS = [ { - name: "_conditionId", type: "uint256", + name: "_conditionId", }, { - name: "_claimer", type: "address", + name: "_claimer", }, { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_pricePerToken", type: "uint256", + name: "_pricePerToken", }, { + type: "tuple", + name: "_allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "_allowlistProof", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "isOverride", type: "bool", + name: "isOverride", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/freezeBatchBaseURI.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/freezeBatchBaseURI.ts index 534892538b5..6684c87c397 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/freezeBatchBaseURI.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/freezeBatchBaseURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "freezeBatchBaseURI" function. @@ -18,8 +18,8 @@ export type FreezeBatchBaseURIParams = WithOverrides<{ export const FN_SELECTOR = "0xa07ced9e" as const; const FN_INPUTS = [ { - name: "_index", type: "uint256", + name: "_index", }, ] as const; const FN_OUTPUTS = [] as const; @@ -119,23 +119,23 @@ export function freezeBatchBaseURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.index] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setMaxTotalSupply.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setMaxTotalSupply.ts index c7f10409d0f..55a70ef2392 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setMaxTotalSupply.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setMaxTotalSupply.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setMaxTotalSupply" function. @@ -22,12 +22,12 @@ export type SetMaxTotalSupplyParams = WithOverrides<{ export const FN_SELECTOR = "0x87198cf2" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_maxTotalSupply", type: "uint256", + name: "_maxTotalSupply", }, ] as const; const FN_OUTPUTS = [] as const; @@ -133,23 +133,23 @@ export function setMaxTotalSupply( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.maxTotalSupply] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setSaleRecipientForToken.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setSaleRecipientForToken.ts index fca39ad0b4b..5076f66c719 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setSaleRecipientForToken.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/setSaleRecipientForToken.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSaleRecipientForToken" function. @@ -22,12 +22,12 @@ export type SetSaleRecipientForTokenParams = WithOverrides<{ export const FN_SELECTOR = "0x29c49b9b" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -137,23 +137,23 @@ export function setSaleRecipientForToken( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.saleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/updateBatchBaseURI.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/updateBatchBaseURI.ts index cf52797da62..0c718deff5a 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/updateBatchBaseURI.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/DropERC1155/write/updateBatchBaseURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "updateBatchBaseURI" function. @@ -19,12 +19,12 @@ export type UpdateBatchBaseURIParams = WithOverrides<{ export const FN_SELECTOR = "0xde903ddd" as const; const FN_INPUTS = [ { - name: "_index", type: "uint256", + name: "_index", }, { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -127,23 +127,23 @@ export function updateBatchBaseURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.index, resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/events/AirdropFailed.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/events/AirdropFailed.ts index fdae53acdc8..2762fcdd17d 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/events/AirdropFailed.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/events/AirdropFailed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AirdropFailed" event. @@ -46,8 +46,8 @@ export type AirdropFailedEventFilters = Partial<{ */ export function airdropFailedEvent(filters: AirdropFailedEventFilters = {}) { return prepareEvent({ - filters, signature: "event AirdropFailed(address indexed tokenAddress, address indexed tokenOwner, address indexed recipient, uint256 tokenId, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/write/airdropERC1155.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/write/airdropERC1155.ts index 03a10e0d4e6..df9e69cfcfb 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/write/airdropERC1155.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155/write/airdropERC1155.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC1155" function. @@ -34,30 +34,30 @@ export type AirdropERC1155Params = WithOverrides<{ export const FN_SELECTOR = "0x41444690" as const; const FN_INPUTS = [ { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, { - name: "tokenOwner", type: "address", + name: "tokenOwner", }, { + type: "tuple[]", + name: "contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "contents", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -165,19 +165,8 @@ export function airdropERC1155( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -187,5 +176,16 @@ export function airdropERC1155( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/events/TokensClaimed.ts index a51a976cc27..fa7b986927c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 indexed tokenId, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/write/claim.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/write/claim.ts index 6678253a7c9..7ec6e819a8d 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IAirdropERC1155Claimable/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -25,24 +25,24 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x38524a10" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "proofs", type: "bytes32[]", + name: "proofs", }, { - name: "proofMaxQuantityForWallet", type: "uint256", + name: "proofMaxQuantityForWallet", }, ] as const; const FN_OUTPUTS = [] as const; @@ -156,19 +156,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -180,5 +169,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burn.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burn.ts index 90310881fed..f36a7e6d858 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burn.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burn.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burn" function. @@ -20,16 +20,16 @@ export type BurnParams = WithOverrides<{ export const FN_SELECTOR = "0xf5298aca" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, { - name: "id", type: "uint256", + name: "id", }, { - name: "value", type: "uint256", + name: "value", }, ] as const; const FN_OUTPUTS = [] as const; @@ -135,19 +135,8 @@ export function burn( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function burn( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burnBatch.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burnBatch.ts index adf8783c218..630fd7070d8 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burnBatch.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IBurnableERC1155/write/burnBatch.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burnBatch" function. @@ -20,16 +20,16 @@ export type BurnBatchParams = WithOverrides<{ export const FN_SELECTOR = "0x6b20c454" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, { - name: "ids", type: "uint256[]", + name: "ids", }, { - name: "values", type: "uint256[]", + name: "values", }, ] as const; const FN_OUTPUTS = [] as const; @@ -137,19 +137,8 @@ export function burnBatch( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -159,5 +148,16 @@ export function burnBatch( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/events/TokensClaimed.ts index a51a976cc27..fa7b986927c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 indexed tokenId, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/read/verifyClaim.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/read/verifyClaim.ts index 3a46dec6f77..8344ea32448 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/read/verifyClaim.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/read/verifyClaim.ts @@ -17,16 +17,16 @@ export type VerifyClaimParams = { export const FN_SELECTOR = "0x4bbb1abf" as const; const FN_INPUTS = [ { - name: "_claimer", type: "address", + name: "_claimer", }, { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, ] as const; const FN_OUTPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/write/claim.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/write/claim.ts index c1bdd3f62e5..daeeb9564ec 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IClaimableERC1155/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -20,16 +20,16 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x2bc43fd9" as const; const FN_INPUTS = [ { - name: "_receiver", type: "address", + name: "_receiver", }, { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, ] as const; const FN_OUTPUTS = [] as const; @@ -135,19 +135,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/ClaimConditionsUpdated.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/ClaimConditionsUpdated.ts index 7a27f5af36d..777715966d4 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/ClaimConditionsUpdated.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/ClaimConditionsUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ClaimConditionsUpdated" event. @@ -36,8 +36,8 @@ export function claimConditionsUpdatedEvent( filters: ClaimConditionsUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ClaimConditionsUpdated(uint256 indexed tokenId, (uint256 startTimestamp, uint256 maxClaimableSupply, uint256 supplyClaimed, uint256 quantityLimitPerWallet, bytes32 merkleRoot, uint256 pricePerToken, address currency, string metadata)[] claimConditions, bool resetEligibility)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/TokensClaimed.ts index 84638a2129a..e1accf0d244 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(uint256 indexed claimConditionIndex, address indexed claimer, address indexed receiver, uint256 tokenId, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/claimCondition.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/claimCondition.ts index 9c8220f9e29..64dd8ca345d 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/claimCondition.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/claimCondition.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claimCondition" function. @@ -16,18 +16,18 @@ export type ClaimConditionParams = { export const FN_SELECTOR = "0xe9703d25" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ { - name: "currentStartId", type: "uint256", + name: "currentStartId", }, { - name: "count", type: "uint256", + name: "count", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getActiveClaimConditionId.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getActiveClaimConditionId.ts index 3a1a57e210c..1684879b155 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getActiveClaimConditionId.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getActiveClaimConditionId.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getActiveClaimConditionId" function. @@ -16,8 +16,8 @@ export type GetActiveClaimConditionIdParams = { export const FN_SELECTOR = "0x5ab063e8" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getClaimConditionById.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getClaimConditionById.ts index 829a3eae7c0..7da28e54495 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getClaimConditionById.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/read/getClaimConditionById.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getClaimConditionById" function. @@ -20,52 +20,52 @@ export type GetClaimConditionByIdParams = { export const FN_SELECTOR = "0xd45b28d7" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_conditionId", type: "uint256", + name: "_conditionId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "condition", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "condition", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/claim.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/claim.ts index 68b510c857e..8c3db1e8d27 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -36,50 +36,50 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x57bc3d78" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { + type: "tuple", + name: "allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "allowlistProof", - type: "tuple", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -201,19 +201,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -227,5 +216,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/setClaimConditions.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/setClaimConditions.ts index ef17b4dacc7..36b0884c34c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/setClaimConditions.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDrop1155/write/setClaimConditions.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimConditions" function. @@ -36,50 +36,50 @@ export type SetClaimConditionsParams = WithOverrides<{ export const FN_SELECTOR = "0x183718d1" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { + type: "tuple[]", + name: "phases", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "phases", - type: "tuple[]", }, { - name: "resetClaimEligibility", type: "bool", + name: "resetClaimEligibility", }, ] as const; const FN_OUTPUTS = [] as const; @@ -189,19 +189,8 @@ export function setClaimConditions( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -211,5 +200,16 @@ export function setClaimConditions( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.ts index a5e6a7e3072..21040cdf986 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/ClaimConditionUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ClaimConditionUpdated" event. @@ -36,8 +36,8 @@ export function claimConditionUpdatedEvent( filters: ClaimConditionUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ClaimConditionUpdated(uint256 indexed tokenId, (uint256 startTimestamp, uint256 maxClaimableSupply, uint256 supplyClaimed, uint256 quantityLimitPerWallet, bytes32 merkleRoot, uint256 pricePerToken, address currency, string metadata) condition, bool resetEligibility)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.ts index a51a976cc27..fa7b986927c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 indexed tokenId, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.ts index abbb7c6b067..04b44c4486c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/read/claimCondition.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claimCondition" function. @@ -16,42 +16,42 @@ export type ClaimConditionParams = { export const FN_SELECTOR = "0xe9703d25" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.ts index 68b510c857e..8c3db1e8d27 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -36,50 +36,50 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x57bc3d78" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { + type: "tuple", + name: "allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "allowlistProof", - type: "tuple", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -201,19 +201,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -227,5 +216,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.ts index 3a872f85105..043ca48332c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IDropSinglePhase1155/write/setClaimConditions.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimConditions" function. @@ -36,50 +36,50 @@ export type SetClaimConditionsParams = WithOverrides<{ export const FN_SELECTOR = "0x8affb89f" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { + type: "tuple", + name: "phase", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "phase", - type: "tuple", }, { - name: "resetClaimEligibility", type: "bool", + name: "resetClaimEligibility", }, ] as const; const FN_OUTPUTS = [] as const; @@ -189,19 +189,8 @@ export function setClaimConditions( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -211,5 +200,16 @@ export function setClaimConditions( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/ApprovalForAll.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/ApprovalForAll.ts index 0812f02a604..96daa76e1c0 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/ApprovalForAll.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/ApprovalForAll.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ApprovalForAll" event. @@ -40,8 +40,8 @@ export type ApprovalForAllEventFilters = Partial<{ */ export function approvalForAllEvent(filters: ApprovalForAllEventFilters = {}) { return prepareEvent({ - filters, signature: "event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferBatch.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferBatch.ts index 6bf4aef7795..e293e23488c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferBatch.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferBatch.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TransferBatch" event. @@ -46,8 +46,8 @@ export type TransferBatchEventFilters = Partial<{ */ export function transferBatchEvent(filters: TransferBatchEventFilters = {}) { return prepareEvent({ - filters, signature: "event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] tokenIds, uint256[] _values)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferSingle.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferSingle.ts index fda95005b26..43726f4eeea 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferSingle.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/TransferSingle.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TransferSingle" event. @@ -46,8 +46,8 @@ export type TransferSingleEventFilters = Partial<{ */ export function transferSingleEvent(filters: TransferSingleEventFilters = {}) { return prepareEvent({ - filters, signature: "event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 tokenId, uint256 _value)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/URI.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/URI.ts index cc015d354d3..4993d85f7ee 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/URI.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/events/URI.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "URI" event. @@ -34,7 +34,7 @@ export type URIEventFilters = Partial<{ */ export function uRIEvent(filters: URIEventFilters = {}) { return prepareEvent({ - filters, signature: "event URI(string _value, uint256 indexed tokenId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOf.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOf.ts index b38f6b85e23..06edf5575c1 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOf.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "balanceOf" function. @@ -17,12 +17,12 @@ export type BalanceOfParams = { export const FN_SELECTOR = "0x00fdd58e" as const; const FN_INPUTS = [ { - name: "_owner", type: "address", + name: "_owner", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOfBatch.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOfBatch.ts index 6f321bad1cd..ecfeac7aa8a 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOfBatch.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/balanceOfBatch.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "balanceOfBatch" function. @@ -20,12 +20,12 @@ export type BalanceOfBatchParams = { export const FN_SELECTOR = "0x4e1273f4" as const; const FN_INPUTS = [ { - name: "_owners", type: "address[]", + name: "_owners", }, { - name: "tokenIds", type: "uint256[]", + name: "tokenIds", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/isApprovedForAll.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/isApprovedForAll.ts index 91fd045ab17..ae49f338a36 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/isApprovedForAll.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/isApprovedForAll.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isApprovedForAll" function. @@ -17,12 +17,12 @@ export type IsApprovedForAllParams = { export const FN_SELECTOR = "0xe985e9c5" as const; const FN_INPUTS = [ { - name: "_owner", type: "address", + name: "_owner", }, { - name: "_operator", type: "address", + name: "_operator", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/totalSupply.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/totalSupply.ts index 349c73b8a2e..293d69ec291 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/totalSupply.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/totalSupply.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "totalSupply" function. @@ -16,8 +16,8 @@ export type TotalSupplyParams = { export const FN_SELECTOR = "0xbd85b039" as const; const FN_INPUTS = [ { - name: "id", type: "uint256", + name: "id", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/uri.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/uri.ts index f98a426d732..16c6c93fc3b 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/uri.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/read/uri.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "uri" function. @@ -16,8 +16,8 @@ export type UriParams = { export const FN_SELECTOR = "0x0e89341c" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeBatchTransferFrom.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeBatchTransferFrom.ts index 94ddf0ac95b..69941c9ab48 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeBatchTransferFrom.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeBatchTransferFrom.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "safeBatchTransferFrom" function. @@ -25,24 +25,24 @@ export type SafeBatchTransferFromParams = WithOverrides<{ export const FN_SELECTOR = "0x2eb2c2d6" as const; const FN_INPUTS = [ { - name: "_from", type: "address", + name: "_from", }, { - name: "_to", type: "address", + name: "_to", }, { - name: "tokenIds", type: "uint256[]", + name: "tokenIds", }, { - name: "_values", type: "uint256[]", + name: "_values", }, { - name: "_data", type: "bytes", + name: "_data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -162,19 +162,8 @@ export function safeBatchTransferFrom( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -186,5 +175,16 @@ export function safeBatchTransferFrom( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeTransferFrom.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeTransferFrom.ts index 9ee70134846..31dc293f5dc 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeTransferFrom.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/safeTransferFrom.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "safeTransferFrom" function. @@ -22,24 +22,24 @@ export type SafeTransferFromParams = WithOverrides<{ export const FN_SELECTOR = "0xf242432a" as const; const FN_INPUTS = [ { - name: "_from", type: "address", + name: "_from", }, { - name: "_to", type: "address", + name: "_to", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "_value", type: "uint256", + name: "_value", }, { - name: "_data", type: "bytes", + name: "_data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -155,19 +155,8 @@ export function safeTransferFrom( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -179,5 +168,16 @@ export function safeTransferFrom( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/setApprovalForAll.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/setApprovalForAll.ts index 0d720b5aedb..4d62b4b8e95 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/setApprovalForAll.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155/write/setApprovalForAll.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setApprovalForAll" function. @@ -19,12 +19,12 @@ export type SetApprovalForAllParams = WithOverrides<{ export const FN_SELECTOR = "0xa22cb465" as const; const FN_INPUTS = [ { - name: "_operator", type: "address", + name: "_operator", }, { - name: "_approved", type: "bool", + name: "_approved", }, ] as const; const FN_OUTPUTS = [] as const; @@ -127,23 +127,23 @@ export function setApprovalForAll( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.operator, resolvedOptions.approved] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Enumerable/read/nextTokenIdToMint.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Enumerable/read/nextTokenIdToMint.ts index edf264b16d5..19dddf43c7c 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Enumerable/read/nextTokenIdToMint.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Enumerable/read/nextTokenIdToMint.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3b1475a7" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/read/supportsInterface.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/read/supportsInterface.ts index 26d3510c06c..0a0627687ed 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155BatchReceived.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155BatchReceived.ts index eaedd907454..b21c1c5e90d 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155BatchReceived.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155BatchReceived.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "onERC1155BatchReceived" function. @@ -22,24 +22,24 @@ export type OnERC1155BatchReceivedParams = WithOverrides<{ export const FN_SELECTOR = "0xbc197c81" as const; const FN_INPUTS = [ { - name: "operator", type: "address", + name: "operator", }, { - name: "from", type: "address", + name: "from", }, { - name: "ids", type: "uint256[]", + name: "ids", }, { - name: "values", type: "uint256[]", + name: "values", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [ @@ -165,19 +165,8 @@ export function onERC1155BatchReceived( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -189,5 +178,16 @@ export function onERC1155BatchReceived( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155Received.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155Received.ts index d84c3bb6dbc..cb3d27032ac 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155Received.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IERC1155Receiver/write/onERC1155Received.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "onERC1155Received" function. @@ -22,24 +22,24 @@ export type OnERC1155ReceivedParams = WithOverrides<{ export const FN_SELECTOR = "0xf23a6e61" as const; const FN_INPUTS = [ { - name: "operator", type: "address", + name: "operator", }, { - name: "from", type: "address", + name: "from", }, { - name: "id", type: "uint256", + name: "id", }, { - name: "value", type: "uint256", + name: "value", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [ @@ -161,19 +161,8 @@ export function onERC1155Received( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -185,5 +174,16 @@ export function onERC1155Received( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/depositRewardTokens.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/depositRewardTokens.ts index 79359b01906..4f7225de3d2 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/depositRewardTokens.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/depositRewardTokens.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "depositRewardTokens" function. @@ -18,8 +18,8 @@ export type DepositRewardTokensParams = WithOverrides<{ export const FN_SELECTOR = "0x16c621e0" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -119,23 +119,23 @@ export function depositRewardTokens( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/withdrawRewardTokens.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/withdrawRewardTokens.ts index 24930ac8e9e..aab127edc73 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/withdrawRewardTokens.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IEditionStake/write/withdrawRewardTokens.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdrawRewardTokens" function. @@ -18,8 +18,8 @@ export type WithdrawRewardTokensParams = WithOverrides<{ export const FN_SELECTOR = "0xcb43b2dd" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -121,23 +121,23 @@ export function withdrawRewardTokens( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/events/TokensLazyMinted.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/events/TokensLazyMinted.ts index b998658e49e..dd2a413af02 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/events/TokensLazyMinted.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/events/TokensLazyMinted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensLazyMinted" event. @@ -36,8 +36,8 @@ export function tokensLazyMintedEvent( filters: TokensLazyMintedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensLazyMinted(uint256 indexed startTokenId, uint256 endTokenId, string baseURI, bytes encryptedBaseURI)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/write/lazyMint.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/write/lazyMint.ts index 90f6de754f4..5a175f1a89f 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/write/lazyMint.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/ILazyMint/write/lazyMint.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "lazyMint" function. @@ -23,22 +23,22 @@ export type LazyMintParams = WithOverrides<{ export const FN_SELECTOR = "0xd37c353b" as const; const FN_INPUTS = [ { - name: "amount", type: "uint256", + name: "amount", }, { - name: "baseURIForTokens", type: "string", + name: "baseURIForTokens", }, { - name: "extraData", type: "bytes", + name: "extraData", }, ] as const; const FN_OUTPUTS = [ { - name: "batchId", type: "uint256", + name: "batchId", }, ] as const; @@ -143,19 +143,8 @@ export function lazyMint( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -165,5 +154,16 @@ export function lazyMint( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/events/TokensMinted.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/events/TokensMinted.ts index e86cc980365..45a4d431a21 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/events/TokensMinted.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/events/TokensMinted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMinted" event. @@ -40,8 +40,8 @@ export type TokensMintedEventFilters = Partial<{ */ export function tokensMintedEvent(filters: TokensMintedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri, uint256 quantityMinted)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/write/mintTo.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/write/mintTo.ts index 84a299fbe0b..b28be8d3f50 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/write/mintTo.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IMintableERC1155/write/mintTo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintTo" function. @@ -21,20 +21,20 @@ export type MintToParams = WithOverrides<{ export const FN_SELECTOR = "0xb03f4528" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "uri", type: "string", + name: "uri", }, { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -144,19 +144,8 @@ export function mintTo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -167,5 +156,16 @@ export function mintTo( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/read/supportsInterface.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/read/supportsInterface.ts index 26d3510c06c..0a0627687ed 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/freezeMetadata.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/freezeMetadata.ts index 003e54a53cc..0ce21caab41 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/freezeMetadata.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/freezeMetadata.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/setTokenURI.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/setTokenURI.ts index 7bdae1392a5..3d42dad88ac 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/setTokenURI.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/INFTMetadata/write/setTokenURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTokenURI" function. @@ -19,12 +19,12 @@ export type SetTokenURIParams = WithOverrides<{ export const FN_SELECTOR = "0x162094c4" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function setTokenURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackCreated.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackCreated.ts index 285247a806b..a2f1c1da7bb 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackCreated.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackCreated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackCreated" event. @@ -34,8 +34,8 @@ export type PackCreatedEventFilters = Partial<{ */ export function packCreatedEvent(filters: PackCreatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event PackCreated(uint256 indexed packId, address recipient, uint256 totalPacksCreated)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackOpened.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackOpened.ts index f06d0783ba6..aa6b44b5de6 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackOpened.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackOpened.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackOpened" event. @@ -40,8 +40,8 @@ export type PackOpenedEventFilters = Partial<{ */ export function packOpenedEvent(filters: PackOpenedEventFilters = {}) { return prepareEvent({ - filters, signature: "event PackOpened(uint256 indexed packId, address indexed opener, uint256 numOfPacksOpened, (address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount)[] rewardUnitsDistributed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackUpdated.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackUpdated.ts index 2bac3df8ffe..7b9a4ae3ada 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackUpdated.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/events/PackUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackUpdated" event. @@ -34,8 +34,8 @@ export type PackUpdatedEventFilters = Partial<{ */ export function packUpdatedEvent(filters: PackUpdatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event PackUpdated(uint256 indexed packId, address recipient, uint256 totalPacksCreated)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/createPack.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/createPack.ts index b76f966b0ff..651159cc31f 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/createPack.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/createPack.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createPack" function. @@ -44,56 +44,56 @@ export type CreatePackParams = WithOverrides<{ export const FN_SELECTOR = "0x092e6075" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "contents", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - name: "contents", - type: "tuple[]", }, { - name: "numOfRewardUnits", type: "uint256[]", + name: "numOfRewardUnits", }, { - name: "packUri", type: "string", + name: "packUri", }, { - name: "openStartTimestamp", type: "uint128", + name: "openStartTimestamp", }, { - name: "amountDistributedPerOpen", type: "uint128", + name: "amountDistributedPerOpen", }, { - name: "recipient", type: "address", + name: "recipient", }, ] as const; const FN_OUTPUTS = [ { - name: "packId", type: "uint256", + name: "packId", }, { - name: "packTotalSupply", type: "uint256", + name: "packTotalSupply", }, ] as const; @@ -212,19 +212,8 @@ export function createPack( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -237,5 +226,16 @@ export function createPack( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/openPack.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/openPack.ts index e5ff179ee6c..b76754ccb3e 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/openPack.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPack/write/openPack.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "openPack" function. @@ -22,35 +22,35 @@ export type OpenPackParams = WithOverrides<{ export const FN_SELECTOR = "0x914e126a" as const; const FN_INPUTS = [ { - name: "packId", type: "uint256", + name: "packId", }, { - name: "amountToOpen", type: "uint256", + name: "amountToOpen", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - type: "tuple[]", }, ] as const; @@ -148,23 +148,23 @@ export function openPack( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.packId, resolvedOptions.amountToOpen] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackOpenRequested.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackOpenRequested.ts index d5bd6f7d865..1700b14ae6d 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackOpenRequested.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackOpenRequested.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackOpenRequested" event. @@ -42,8 +42,8 @@ export function packOpenRequestedEvent( filters: PackOpenRequestedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PackOpenRequested(address indexed opener, uint256 indexed packId, uint256 amountToOpen, uint256 requestId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts index dee10b5c0bb..973a8afa50d 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackRandomnessFulfilled" event. @@ -42,8 +42,8 @@ export function packRandomnessFulfilledEvent( filters: PackRandomnessFulfilledEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PackRandomnessFulfilled(uint256 indexed packId, uint256 indexed requestId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/read/canClaimRewards.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/read/canClaimRewards.ts index 7db5e93a362..dad4ba854e1 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/read/canClaimRewards.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/read/canClaimRewards.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "canClaimRewards" function. @@ -16,8 +16,8 @@ export type CanClaimRewardsParams = { export const FN_SELECTOR = "0xa9b47a66" as const; const FN_INPUTS = [ { - name: "_opener", type: "address", + name: "_opener", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/claimRewards.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/claimRewards.ts index 2c5c67dcc1d..f27ff5f2568 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/claimRewards.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/claimRewards.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; @@ -7,26 +7,26 @@ export const FN_SELECTOR = "0x372500ab" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "rewardUnits", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - name: "rewardUnits", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts index 53eef2b87f1..a062fe62999 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "openPackAndClaimRewards" function. @@ -26,16 +26,16 @@ export type OpenPackAndClaimRewardsParams = WithOverrides<{ export const FN_SELECTOR = "0xac296b3f" as const; const FN_INPUTS = [ { - name: "_packId", type: "uint256", + name: "_packId", }, { - name: "_amountToOpen", type: "uint256", + name: "_amountToOpen", }, { - name: "_callBackGasLimit", type: "uint32", + name: "_callBackGasLimit", }, ] as const; const FN_OUTPUTS = [ @@ -153,19 +153,8 @@ export function openPackAndClaimRewards( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -175,5 +164,16 @@ export function openPackAndClaimRewards( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/events/TokensMintedWithSignature.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/events/TokensMintedWithSignature.ts index fbe3d4fcabd..ca1f6d20821 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/events/TokensMintedWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/events/TokensMintedWithSignature.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMintedWithSignature" event. @@ -48,8 +48,8 @@ export function tokensMintedWithSignatureEvent( filters: TokensMintedWithSignatureEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, (address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, uint256 tokenId, string uri, uint256 quantity, uint256 pricePerToken, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, bytes32 uid) mintRequest)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/read/verify.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/read/verify.ts index 7d9b75e617f..09bb704a2ca 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/read/verify.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/read/verify.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verify" function. @@ -34,72 +34,72 @@ export type VerifyParams = { export const FN_SELECTOR = "0xb17cd86f" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint256", + name: "royaltyBps", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "uri", type: "string", + name: "uri", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "success", type: "bool", + name: "success", }, { - name: "signer", type: "address", + name: "signer", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/write/mintWithSignature.ts index 988aa78d23d..6a85a154053 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/ISignatureMintERC1155/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -36,62 +36,62 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0x98a6e993" as const; const FN_INPUTS = [ { + type: "tuple", + name: "payload", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint256", + name: "royaltyBps", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "uri", type: "string", + name: "uri", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "payload", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -194,23 +194,23 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.payload, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/RewardsClaimed.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/RewardsClaimed.ts index 1a218d64ec6..3caf37ca828 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/RewardsClaimed.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/RewardsClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RewardsClaimed" event. @@ -34,8 +34,8 @@ export type RewardsClaimedEventFilters = Partial<{ */ export function rewardsClaimedEvent(filters: RewardsClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RewardsClaimed(address indexed staker, uint256 rewardAmount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensStaked.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensStaked.ts index 10b199d165b..57cc777cc94 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensStaked.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensStaked.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensStaked" event. @@ -40,8 +40,8 @@ export type TokensStakedEventFilters = Partial<{ */ export function tokensStakedEvent(filters: TokensStakedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensStaked(address indexed staker, uint256 indexed tokenId, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensWithdrawn.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensWithdrawn.ts index dfe8e2c7093..93b50de0267 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensWithdrawn.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/TokensWithdrawn.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensWithdrawn" event. @@ -42,8 +42,8 @@ export function tokensWithdrawnEvent( filters: TokensWithdrawnEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensWithdrawn(address indexed staker, uint256 indexed tokenId, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedRewardsPerUnitTime.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedRewardsPerUnitTime.ts index ef17c6bf886..cc60bb803ec 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedRewardsPerUnitTime.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedRewardsPerUnitTime.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "UpdatedRewardsPerUnitTime" event. @@ -36,8 +36,8 @@ export function updatedRewardsPerUnitTimeEvent( filters: UpdatedRewardsPerUnitTimeEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event UpdatedRewardsPerUnitTime(uint256 indexed _tokenId, uint256 oldRewardsPerUnitTime, uint256 newRewardsPerUnitTime)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedTimeUnit.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedTimeUnit.ts index df51fd0eff5..1bdc0e9edab 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedTimeUnit.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/events/UpdatedTimeUnit.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "UpdatedTimeUnit" event. @@ -36,8 +36,8 @@ export function updatedTimeUnitEvent( filters: UpdatedTimeUnitEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event UpdatedTimeUnit(uint256 indexed _tokenId, uint256 oldTimeUnit, uint256 newTimeUnit)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfo.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfo.ts index f8e34b3afa6..381a97e4ac0 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfo.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getStakeInfo" function. @@ -16,22 +16,22 @@ export type GetStakeInfoParams = { export const FN_SELECTOR = "0xc3453153" as const; const FN_INPUTS = [ { - name: "staker", type: "address", + name: "staker", }, ] as const; const FN_OUTPUTS = [ { - name: "_tokensStaked", type: "uint256[]", + name: "_tokensStaked", }, { - name: "_tokenAmounts", type: "uint256[]", + name: "_tokenAmounts", }, { - name: "_totalRewards", type: "uint256", + name: "_totalRewards", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfoForToken.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfoForToken.ts index 9f1ebcdddc3..95246a9bf77 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfoForToken.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/read/getStakeInfoForToken.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getStakeInfoForToken" function. @@ -17,22 +17,22 @@ export type GetStakeInfoForTokenParams = { export const FN_SELECTOR = "0x168fb5c5" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "staker", type: "address", + name: "staker", }, ] as const; const FN_OUTPUTS = [ { - name: "_tokensStaked", type: "uint256", + name: "_tokensStaked", }, { - name: "_rewards", type: "uint256", + name: "_rewards", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/claimRewards.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/claimRewards.ts index 7a85cb7c3cb..72773f0c947 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/claimRewards.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/claimRewards.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claimRewards" function. @@ -18,8 +18,8 @@ export type ClaimRewardsParams = WithOverrides<{ export const FN_SELECTOR = "0x0962ef79" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function claimRewards( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/stake.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/stake.ts index e33708310d0..4640d2664d8 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/stake.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/stake.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "stake" function. @@ -19,12 +19,12 @@ export type StakeParams = WithOverrides<{ export const FN_SELECTOR = "0x952e68cf" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint64", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -123,23 +123,23 @@ export function stake( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/withdraw.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/withdraw.ts index 564158e54ed..261bf72277e 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/withdraw.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/IStaking1155/write/withdraw.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdraw" function. @@ -19,12 +19,12 @@ export type WithdrawParams = WithOverrides<{ export const FN_SELECTOR = "0xc434dcfe" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint64", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -123,23 +123,23 @@ export function withdraw( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc1155/__generated__/Zora1155/read/nextTokenId.ts b/packages/thirdweb/src/extensions/erc1155/__generated__/Zora1155/read/nextTokenId.ts index 9761a5cdbfa..a1c7ae20ebc 100644 --- a/packages/thirdweb/src/extensions/erc1155/__generated__/Zora1155/read/nextTokenId.ts +++ b/packages/thirdweb/src/extensions/erc1155/__generated__/Zora1155/read/nextTokenId.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x75794a3c" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc1271/__generated__/isValidSignature/read/isValidSignature.ts b/packages/thirdweb/src/extensions/erc1271/__generated__/isValidSignature/read/isValidSignature.ts index cfc9abc6131..b276e41eaab 100644 --- a/packages/thirdweb/src/extensions/erc1271/__generated__/isValidSignature/read/isValidSignature.ts +++ b/packages/thirdweb/src/extensions/erc1271/__generated__/isValidSignature/read/isValidSignature.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isValidSignature" function. @@ -17,12 +17,12 @@ export type IsValidSignatureParams = { export const FN_SELECTOR = "0x1626ba7e" as const; const FN_INPUTS = [ { - name: "hash", type: "bytes32", + name: "hash", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc165/__generated__/IERC165/read/supportsInterface.ts b/packages/thirdweb/src/extensions/erc165/__generated__/IERC165/read/supportsInterface.ts index 15c9f31dc9b..da351e0658d 100644 --- a/packages/thirdweb/src/extensions/erc165/__generated__/IERC165/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/erc165/__generated__/IERC165/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc1822/__generated__/IERC1822Proxiable/read/proxiableUUID.ts b/packages/thirdweb/src/extensions/erc1822/__generated__/IERC1822Proxiable/read/proxiableUUID.ts index e2032fab9d0..e3d2a786c0f 100644 --- a/packages/thirdweb/src/extensions/erc1822/__generated__/IERC1822Proxiable/read/proxiableUUID.ts +++ b/packages/thirdweb/src/extensions/erc1822/__generated__/IERC1822Proxiable/read/proxiableUUID.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x52d1902d" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/DropERC20/read/verifyClaim.ts b/packages/thirdweb/src/extensions/erc20/__generated__/DropERC20/read/verifyClaim.ts index 22b945be9c4..5033086ff1f 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/DropERC20/read/verifyClaim.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/DropERC20/read/verifyClaim.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verifyClaim" function. @@ -36,52 +36,52 @@ export type VerifyClaimParams = { export const FN_SELECTOR = "0x23a2902b" as const; const FN_INPUTS = [ { - name: "_conditionId", type: "uint256", + name: "_conditionId", }, { - name: "_claimer", type: "address", + name: "_claimer", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_pricePerToken", type: "uint256", + name: "_pricePerToken", }, { + type: "tuple", + name: "_allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "_allowlistProof", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "isOverride", type: "bool", + name: "isOverride", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/events/AirdropFailed.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/events/AirdropFailed.ts index b84ff753d85..cd60467baae 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/events/AirdropFailed.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/events/AirdropFailed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AirdropFailed" event. @@ -46,8 +46,8 @@ export type AirdropFailedEventFilters = Partial<{ */ export function airdropFailedEvent(filters: AirdropFailedEventFilters = {}) { return prepareEvent({ - filters, signature: "event AirdropFailed(address indexed tokenAddress, address indexed tokenOwner, address indexed recipient, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/write/airdropERC20.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/write/airdropERC20.ts index 78ffaebbb8c..9499d363326 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/write/airdropERC20.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20/write/airdropERC20.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC20" function. @@ -33,26 +33,26 @@ export type AirdropERC20Params = WithOverrides<{ export const FN_SELECTOR = "0x0670b2b3" as const; const FN_INPUTS = [ { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, { - name: "tokenOwner", type: "address", + name: "tokenOwner", }, { + type: "tuple[]", + name: "contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "contents", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -160,19 +160,8 @@ export function airdropERC20( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -182,5 +171,16 @@ export function airdropERC20( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/events/TokensClaimed.ts index 051402a467d..980f90c08d6 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -40,8 +40,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/write/claim.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/write/claim.ts index ede95cd288e..315fd89acb6 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IAirdropERC20Claimable/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -24,20 +24,20 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x3b4b57b0" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "proofs", type: "bytes32[]", + name: "proofs", }, { - name: "proofMaxQuantityForWallet", type: "uint256", + name: "proofMaxQuantityForWallet", }, ] as const; const FN_OUTPUTS = [] as const; @@ -147,19 +147,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -170,5 +159,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burn.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burn.ts index 023c029e5a1..14e6c3521f6 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burn.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burn.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burn" function. @@ -18,8 +18,8 @@ export type BurnParams = WithOverrides<{ export const FN_SELECTOR = "0x42966c68" as const; const FN_INPUTS = [ { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function burn( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burnFrom.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burnFrom.ts index bdf88fcc32f..0a39df5ef61 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burnFrom.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IBurnableERC20/write/burnFrom.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burnFrom" function. @@ -19,12 +19,12 @@ export type BurnFromParams = WithOverrides<{ export const FN_SELECTOR = "0x79cc6790" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -123,23 +123,23 @@ export function burnFrom( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.account, resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/events/TokensClaimed.ts index 82f026e2b60..32ae497829f 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(uint256 indexed claimConditionIndex, address indexed claimer, address indexed receiver, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/claimCondition.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/claimCondition.ts index 76f6e75d5cc..543ca00aeb3 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/claimCondition.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/claimCondition.ts @@ -1,19 +1,20 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xd637ed59" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "currentStartId", type: "uint256", + name: "currentStartId", }, { - name: "count", type: "uint256", + name: "count", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getActiveClaimConditionId.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getActiveClaimConditionId.ts index d05c49e0642..8874f1f8b77 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getActiveClaimConditionId.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getActiveClaimConditionId.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xc68907de" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getClaimConditionById.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getClaimConditionById.ts index 2230db5b8b9..a0bff681c08 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getClaimConditionById.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/read/getClaimConditionById.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getClaimConditionById" function. @@ -19,48 +19,48 @@ export type GetClaimConditionByIdParams = { export const FN_SELECTOR = "0x6f8934f4" as const; const FN_INPUTS = [ { - name: "_conditionId", type: "uint256", + name: "_conditionId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "condition", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "condition", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/claim.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/claim.ts index 0a71bc9edcb..2c1aabd1066 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -35,46 +35,46 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x84bb1e42" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { + type: "tuple", + name: "allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "allowlistProof", - type: "tuple", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -192,19 +192,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -217,5 +206,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/setClaimConditions.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/setClaimConditions.ts index 1409455f1aa..dbfd5398c08 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/setClaimConditions.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IDropERC20/write/setClaimConditions.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimConditions" function. @@ -35,46 +35,46 @@ export type SetClaimConditionsParams = WithOverrides<{ export const FN_SELECTOR = "0x74bc7db7" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "phases", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "phases", - type: "tuple[]", }, { - name: "resetClaimEligibility", type: "bool", + name: "resetClaimEligibility", }, ] as const; const FN_OUTPUTS = [] as const; @@ -180,19 +180,8 @@ export function setClaimConditions( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -201,5 +190,16 @@ export function setClaimConditions( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Approval.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Approval.ts index 5f51e60e237..83c90ba1373 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Approval.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Approval.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Approval" event. @@ -40,8 +40,8 @@ export type ApprovalEventFilters = Partial<{ */ export function approvalEvent(filters: ApprovalEventFilters = {}) { return prepareEvent({ - filters, signature: "event Approval(address indexed owner, address indexed spender, uint256 value)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Transfer.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Transfer.ts index ca3bdadb5e5..392798f0938 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Transfer.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/events/Transfer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Transfer" event. @@ -40,8 +40,8 @@ export type TransferEventFilters = Partial<{ */ export function transferEvent(filters: TransferEventFilters = {}) { return prepareEvent({ - filters, signature: "event Transfer(address indexed from, address indexed to, uint256 value)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/allowance.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/allowance.ts index 64452c82fa1..90f936573ff 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/allowance.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/allowance.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "allowance" function. @@ -17,12 +17,12 @@ export type AllowanceParams = { export const FN_SELECTOR = "0xdd62ed3e" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, { - name: "spender", type: "address", + name: "spender", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/balanceOf.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/balanceOf.ts index 4a5e362ea45..05bfa99e8b9 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/balanceOf.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/balanceOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "balanceOf" function. @@ -16,8 +16,8 @@ export type BalanceOfParams = { export const FN_SELECTOR = "0x70a08231" as const; const FN_INPUTS = [ { - name: "_address", type: "address", + name: "_address", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/decimals.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/decimals.ts index 7c6f025f370..e713101a8f2 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/decimals.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/decimals.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x313ce567" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/totalSupply.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/totalSupply.ts index 315fc80ca09..a40ddadb5ea 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/totalSupply.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/read/totalSupply.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x18160ddd" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/approve.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/approve.ts index 1e297ba3bdf..c3071082e4e 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/approve.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/approve.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "approve" function. @@ -19,12 +19,12 @@ export type ApproveParams = WithOverrides<{ export const FN_SELECTOR = "0x095ea7b3" as const; const FN_INPUTS = [ { - name: "spender", type: "address", + name: "spender", }, { - name: "value", type: "uint256", + name: "value", }, ] as const; const FN_OUTPUTS = [ @@ -127,23 +127,23 @@ export function approve( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.spender, resolvedOptions.value] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transfer.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transfer.ts index 409dcfe395b..bb688023945 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transfer.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transfer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transfer" function. @@ -19,12 +19,12 @@ export type TransferParams = WithOverrides<{ export const FN_SELECTOR = "0xa9059cbb" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "value", type: "uint256", + name: "value", }, ] as const; const FN_OUTPUTS = [ @@ -127,23 +127,23 @@ export function transfer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.to, resolvedOptions.value] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transferFrom.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transferFrom.ts index a1283faf7e1..84e581ee5d0 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transferFrom.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20/write/transferFrom.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transferFrom" function. @@ -20,16 +20,16 @@ export type TransferFromParams = WithOverrides<{ export const FN_SELECTOR = "0x23b872dd" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "to", type: "address", + name: "to", }, { - name: "value", type: "uint256", + name: "value", }, ] as const; const FN_OUTPUTS = [ @@ -141,19 +141,8 @@ export function transferFrom( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -163,5 +152,16 @@ export function transferFrom( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/DOMAIN_SEPARATOR.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/DOMAIN_SEPARATOR.ts index 77488bf42f4..f3088be371b 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/DOMAIN_SEPARATOR.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/DOMAIN_SEPARATOR.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3644e515" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/nonces.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/nonces.ts index 62a9e4df4ca..0785785f1cf 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/nonces.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/read/nonces.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "nonces" function. @@ -16,8 +16,8 @@ export type NoncesParams = { export const FN_SELECTOR = "0x7ecebe00" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/write/permit.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/write/permit.ts index 67ffe7a6329..196dae6e56c 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/write/permit.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IERC20Permit/write/permit.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "permit" function. @@ -24,32 +24,32 @@ export type PermitParams = WithOverrides<{ export const FN_SELECTOR = "0xd505accf" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, { - name: "spender", type: "address", + name: "spender", }, { - name: "value", type: "uint256", + name: "value", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "v", type: "uint8", + name: "v", }, { - name: "r", type: "bytes32", + name: "r", }, { - name: "s", type: "bytes32", + name: "s", }, ] as const; const FN_OUTPUTS = [] as const; @@ -171,19 +171,8 @@ export function permit( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -197,5 +186,16 @@ export function permit( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/events/TokensMinted.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/events/TokensMinted.ts index b1453037bfc..6b64f961507 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/events/TokensMinted.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/events/TokensMinted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMinted" event. @@ -34,8 +34,8 @@ export type TokensMintedEventFilters = Partial<{ */ export function tokensMintedEvent(filters: TokensMintedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensMinted(address indexed mintedTo, uint256 quantityMinted)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/write/mintTo.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/write/mintTo.ts index b975e1f1ded..e0db2221abd 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/write/mintTo.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IMintableERC20/write/mintTo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintTo" function. @@ -19,12 +19,12 @@ export type MintToParams = WithOverrides<{ export const FN_SELECTOR = "0x449a52f8" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -123,23 +123,23 @@ export function mintTo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.to, resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/events/TokensMintedWithSignature.ts b/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/events/TokensMintedWithSignature.ts index 77164157de7..edb03b78b32 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/events/TokensMintedWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/events/TokensMintedWithSignature.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMintedWithSignature" event. @@ -42,8 +42,8 @@ export function tokensMintedWithSignatureEvent( filters: TokensMintedWithSignatureEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, (address to, address primarySaleRecipient, uint256 quantity, uint256 price, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, bytes32 uid) mintRequest)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/read/verify.ts b/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/read/verify.ts index bf47fbaaf53..3d910a7024d 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/read/verify.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/read/verify.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verify" function. @@ -30,56 +30,56 @@ export type VerifyParams = { export const FN_SELECTOR = "0xc1b606e2" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "price", type: "uint256", + name: "price", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "success", type: "bool", + name: "success", }, { - name: "signer", type: "address", + name: "signer", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/write/mintWithSignature.ts index 1fd20177ab2..42821808bda 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/ISignatureMintERC20/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -32,46 +32,46 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0x8f0fefbb" as const; const FN_INPUTS = [ { + type: "tuple", + name: "payload", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "price", type: "uint256", + name: "price", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "payload", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -174,23 +174,23 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.payload, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/RewardsClaimed.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/RewardsClaimed.ts index 969fd654e5c..b727ca0d9b2 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/RewardsClaimed.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/RewardsClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RewardsClaimed" event. @@ -34,8 +34,8 @@ export type RewardsClaimedEventFilters = Partial<{ */ export function rewardsClaimedEvent(filters: RewardsClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RewardsClaimed(address indexed staker, uint256 rewardAmount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensStaked.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensStaked.ts index 583547e8918..481bb8eb721 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensStaked.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensStaked.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensStaked" event. @@ -34,7 +34,7 @@ export type TokensStakedEventFilters = Partial<{ */ export function tokensStakedEvent(filters: TokensStakedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensStaked(address indexed staker, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensWithdrawn.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensWithdrawn.ts index 53b02e8bc67..bdcc3f2ca69 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensWithdrawn.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/events/TokensWithdrawn.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensWithdrawn" event. @@ -36,7 +36,7 @@ export function tokensWithdrawnEvent( filters: TokensWithdrawnEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensWithdrawn(address indexed staker, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/read/getStakeInfo.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/read/getStakeInfo.ts index 4ec3e9363f7..6e8274dfa05 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/read/getStakeInfo.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/read/getStakeInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getStakeInfo" function. @@ -16,18 +16,18 @@ export type GetStakeInfoParams = { export const FN_SELECTOR = "0xc3453153" as const; const FN_INPUTS = [ { - name: "staker", type: "address", + name: "staker", }, ] as const; const FN_OUTPUTS = [ { - name: "_tokensStaked", type: "uint256", + name: "_tokensStaked", }, { - name: "_rewards", type: "uint256", + name: "_rewards", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/claimRewards.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/claimRewards.ts index 1704b169c28..57d0a77dff7 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/claimRewards.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/claimRewards.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/stake.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/stake.ts index e3480d1c5df..408f9cd07a8 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/stake.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/stake.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "stake" function. @@ -18,8 +18,8 @@ export type StakeParams = WithOverrides<{ export const FN_SELECTOR = "0xa694fc3a" as const; const FN_INPUTS = [ { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function stake( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/withdraw.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/withdraw.ts index 4b2e17a7852..c1c69ea396d 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/withdraw.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IStaking20/write/withdraw.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdraw" function. @@ -18,8 +18,8 @@ export type WithdrawParams = WithOverrides<{ export const FN_SELECTOR = "0x2e1a7d4d" as const; const FN_INPUTS = [ { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function withdraw( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/depositRewardTokens.ts b/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/depositRewardTokens.ts index 4f9d27bd8b6..0c3048d17f9 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/depositRewardTokens.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/depositRewardTokens.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "depositRewardTokens" function. @@ -18,8 +18,8 @@ export type DepositRewardTokensParams = WithOverrides<{ export const FN_SELECTOR = "0x16c621e0" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -119,23 +119,23 @@ export function depositRewardTokens( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/withdrawRewardTokens.ts b/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/withdrawRewardTokens.ts index 20eac341e3f..6fdc7ac02c8 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/withdrawRewardTokens.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/ITokenStake/write/withdrawRewardTokens.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdrawRewardTokens" function. @@ -18,8 +18,8 @@ export type WithdrawRewardTokensParams = WithOverrides<{ export const FN_SELECTOR = "0xcb43b2dd" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -121,23 +121,23 @@ export function withdrawRewardTokens( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateChanged.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateChanged.ts index c3acecb27ce..6ac50c18b65 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateChanged.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateChanged.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "DelegateChanged" event. @@ -48,8 +48,8 @@ export function delegateChangedEvent( filters: DelegateChangedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateVotesChanged.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateVotesChanged.ts index 2edeed797af..3dee0b93a04 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateVotesChanged.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/events/DelegateVotesChanged.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "DelegateVotesChanged" event. @@ -36,8 +36,8 @@ export function delegateVotesChangedEvent( filters: DelegateVotesChangedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/delegates.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/delegates.ts index ea655ae1b0c..c571722679d 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/delegates.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/delegates.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "delegates" function. @@ -16,8 +16,8 @@ export type DelegatesParams = { export const FN_SELECTOR = "0x587cde1e" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastTotalSupply.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastTotalSupply.ts index 7d1d44e1552..e3441230e1e 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastTotalSupply.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastTotalSupply.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPastTotalSupply" function. @@ -19,8 +19,8 @@ export type GetPastTotalSupplyParams = { export const FN_SELECTOR = "0x8e539e8c" as const; const FN_INPUTS = [ { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastVotes.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastVotes.ts index 2c200dbfc9f..ae46edb8b0c 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastVotes.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getPastVotes.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPastVotes" function. @@ -20,12 +20,12 @@ export type GetPastVotesParams = { export const FN_SELECTOR = "0x3a46b1a8" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getVotes.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getVotes.ts index 4e8e527637e..cff1749bd6b 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getVotes.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/read/getVotes.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getVotes" function. @@ -16,8 +16,8 @@ export type GetVotesParams = { export const FN_SELECTOR = "0x9ab24eb0" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegate.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegate.ts index 21bbcf173b3..7cef71ff61a 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegate.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegate.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "delegate" function. @@ -21,8 +21,8 @@ export type DelegateParams = WithOverrides<{ export const FN_SELECTOR = "0x5c19a95c" as const; const FN_INPUTS = [ { - name: "delegatee", type: "address", + name: "delegatee", }, ] as const; const FN_OUTPUTS = [] as const; @@ -118,23 +118,23 @@ export function delegate( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.delegatee] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegateBySig.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegateBySig.ts index 63ae89d2acf..d4ccd48cc5a 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegateBySig.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IVotes/write/delegateBySig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "delegateBySig" function. @@ -26,28 +26,28 @@ export type DelegateBySigParams = WithOverrides<{ export const FN_SELECTOR = "0xc3cda520" as const; const FN_INPUTS = [ { - name: "delegatee", type: "address", + name: "delegatee", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "expiry", type: "uint256", + name: "expiry", }, { - name: "v", type: "uint8", + name: "v", }, { - name: "r", type: "bytes32", + name: "r", }, { - name: "s", type: "bytes32", + name: "s", }, ] as const; const FN_OUTPUTS = [] as const; @@ -167,19 +167,8 @@ export function delegateBySig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -192,5 +181,16 @@ export function delegateBySig( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/deposit.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/deposit.ts index 08a9dede108..71983157230 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/deposit.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/deposit.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/transfer.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/transfer.ts index 409dcfe395b..bb688023945 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/transfer.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/transfer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transfer" function. @@ -19,12 +19,12 @@ export type TransferParams = WithOverrides<{ export const FN_SELECTOR = "0xa9059cbb" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "value", type: "uint256", + name: "value", }, ] as const; const FN_OUTPUTS = [ @@ -127,23 +127,23 @@ export function transfer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.to, resolvedOptions.value] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/withdraw.ts b/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/withdraw.ts index 4b2e17a7852..c1c69ea396d 100644 --- a/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/withdraw.ts +++ b/packages/thirdweb/src/extensions/erc20/__generated__/IWETH/write/withdraw.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdraw" function. @@ -18,8 +18,8 @@ export type WithdrawParams = WithOverrides<{ export const FN_SELECTOR = "0x2e1a7d4d" as const; const FN_INPUTS = [ { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function withdraw( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc2771/__generated__/IERC2771Context/read/isTrustedForwarder.ts b/packages/thirdweb/src/extensions/erc2771/__generated__/IERC2771Context/read/isTrustedForwarder.ts index 8f413a85ce8..64ca336631f 100644 --- a/packages/thirdweb/src/extensions/erc2771/__generated__/IERC2771Context/read/isTrustedForwarder.ts +++ b/packages/thirdweb/src/extensions/erc2771/__generated__/IERC2771Context/read/isTrustedForwarder.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isTrustedForwarder" function. @@ -19,8 +19,8 @@ export type IsTrustedForwarderParams = { export const FN_SELECTOR = "0x572b6c05" as const; const FN_INPUTS = [ { - name: "forwarder", type: "address", + name: "forwarder", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc2981/__generated__/IERC2981/read/royaltyInfo.ts b/packages/thirdweb/src/extensions/erc2981/__generated__/IERC2981/read/royaltyInfo.ts index fc39904bb62..af103446eff 100644 --- a/packages/thirdweb/src/extensions/erc2981/__generated__/IERC2981/read/royaltyInfo.ts +++ b/packages/thirdweb/src/extensions/erc2981/__generated__/IERC2981/read/royaltyInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "royaltyInfo" function. @@ -20,22 +20,22 @@ export type RoyaltyInfoParams = { export const FN_SELECTOR = "0x2a55205a" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "salePrice", type: "uint256", + name: "salePrice", }, ] as const; const FN_OUTPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "royaltyAmount", type: "uint256", + name: "royaltyAmount", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccount/write/validateUserOp.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccount/write/validateUserOp.ts index f87b2c21692..61732d4c768 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccount/write/validateUserOp.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccount/write/validateUserOp.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "validateUserOp" function. @@ -42,68 +42,68 @@ export type ValidateUserOpParams = WithOverrides<{ export const FN_SELECTOR = "0x3a871cdd" as const; const FN_INPUTS = [ { + type: "tuple", + name: "userOp", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "callGasLimit", type: "uint256", + name: "callGasLimit", }, { - name: "verificationGasLimit", type: "uint256", + name: "verificationGasLimit", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "maxFeePerGas", type: "uint256", + name: "maxFeePerGas", }, { - name: "maxPriorityFeePerGas", type: "uint256", + name: "maxPriorityFeePerGas", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "userOp", - type: "tuple", }, { - name: "userOpHash", type: "bytes32", + name: "userOpHash", }, { - name: "missingAccountFunds", type: "uint256", + name: "missingAccountFunds", }, ] as const; const FN_OUTPUTS = [ { - name: "validationData", type: "uint256", + name: "validationData", }, ] as const; @@ -210,19 +210,8 @@ export function validateUserOp( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -232,5 +221,16 @@ export function validateUserOp( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/AccountCreated.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/AccountCreated.ts index 3919789bd3c..9704d1c60fa 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/AccountCreated.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/AccountCreated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AccountCreated" event. @@ -40,8 +40,8 @@ export type AccountCreatedEventFilters = Partial<{ */ export function accountCreatedEvent(filters: AccountCreatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event AccountCreated(address indexed account, address indexed accountAdmin)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerAdded.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerAdded.ts index f96231b08cf..29ba1977797 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerAdded.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerAdded.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "SignerAdded" event. @@ -40,8 +40,8 @@ export type SignerAddedEventFilters = Partial<{ */ export function signerAddedEvent(filters: SignerAddedEventFilters = {}) { return prepareEvent({ - filters, signature: "event SignerAdded(address indexed account, address indexed signer)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerRemoved.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerRemoved.ts index c6cf3b98d23..ee49f539f23 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerRemoved.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/events/SignerRemoved.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "SignerRemoved" event. @@ -40,8 +40,8 @@ export type SignerRemovedEventFilters = Partial<{ */ export function signerRemovedEvent(filters: SignerRemovedEventFilters = {}) { return prepareEvent({ - filters, signature: "event SignerRemoved(address indexed account, address indexed signer)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/accountImplementation.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/accountImplementation.ts index 31f9d6e64c0..88b5f01391a 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/accountImplementation.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/accountImplementation.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x11464fbe" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccounts.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccounts.ts index 26429c67036..e442c9ebe15 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccounts.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccounts.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAccounts" function. @@ -17,12 +17,12 @@ export type GetAccountsParams = { export const FN_SELECTOR = "0xe68a7c3b" as const; const FN_INPUTS = [ { - name: "start", type: "uint256", + name: "start", }, { - name: "end", type: "uint256", + name: "end", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccountsOfSigner.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccountsOfSigner.ts index 9d328ef60b2..f0bac129833 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccountsOfSigner.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAccountsOfSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAccountsOfSigner" function. @@ -16,14 +16,14 @@ export type GetAccountsOfSignerParams = { export const FN_SELECTOR = "0x0e6254fd" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ { - name: "accounts", type: "address[]", + name: "accounts", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAddress.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAddress.ts index 7793bc2c85e..07d3c8f0a19 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAddress.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAddress.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAddress" function. @@ -20,12 +20,12 @@ export type GetAddressParams = { export const FN_SELECTOR = "0x8878ed33" as const; const FN_INPUTS = [ { - name: "adminSigner", type: "address", + name: "adminSigner", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAllAccounts.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAllAccounts.ts index 93cf2387dff..49004ff07df 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAllAccounts.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/getAllAccounts.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x08e93d0a" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/isRegistered.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/isRegistered.ts index 56ac9b61de6..4213342788a 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/isRegistered.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/isRegistered.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isRegistered" function. @@ -16,8 +16,8 @@ export type IsRegisteredParams = { export const FN_SELECTOR = "0xc3c5a547" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/totalAccounts.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/totalAccounts.ts index 213525ca085..d13cf94c6b5 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/totalAccounts.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/read/totalAccounts.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x58451f97" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/createAccount.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/createAccount.ts index cd71a3487a1..d71e0c7bbee 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/createAccount.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/createAccount.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createAccount" function. @@ -19,18 +19,18 @@ export type CreateAccountParams = WithOverrides<{ export const FN_SELECTOR = "0xd8fd8f44" as const; const FN_INPUTS = [ { - name: "admin", type: "address", + name: "admin", }, { - name: "_data", type: "bytes", + name: "_data", }, ] as const; const FN_OUTPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; @@ -130,23 +130,23 @@ export function createAccount( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.admin, resolvedOptions.data] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerAdded.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerAdded.ts index 72b25239083..58b1f104269 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerAdded.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerAdded.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "onSignerAdded" function. @@ -23,16 +23,16 @@ export type OnSignerAddedParams = WithOverrides<{ export const FN_SELECTOR = "0x9ddbb9d8" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, { - name: "creatorAdmin", type: "address", + name: "creatorAdmin", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -140,19 +140,8 @@ export function onSignerAdded( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -162,5 +151,16 @@ export function onSignerAdded( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerRemoved.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerRemoved.ts index 1b1a5d20e4f..eeb95bb3887 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerRemoved.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountFactory/write/onSignerRemoved.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "onSignerRemoved" function. @@ -23,16 +23,16 @@ export type OnSignerRemovedParams = WithOverrides<{ export const FN_SELECTOR = "0x0db33003" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, { - name: "creatorAdmin", type: "address", + name: "creatorAdmin", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -140,19 +140,8 @@ export function onSignerRemoved( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -162,5 +151,16 @@ export function onSignerRemoved( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/AdminUpdated.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/AdminUpdated.ts index e1cb6933d25..3c4cdb022dc 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/AdminUpdated.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/AdminUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AdminUpdated" event. @@ -34,7 +34,7 @@ export type AdminUpdatedEventFilters = Partial<{ */ export function adminUpdatedEvent(filters: AdminUpdatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event AdminUpdated(address indexed signer, bool isAdmin)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/SignerPermissionsUpdated.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/SignerPermissionsUpdated.ts index 0e331399365..49b12b5e7ca 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/SignerPermissionsUpdated.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/events/SignerPermissionsUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "SignerPermissionsUpdated" event. @@ -42,8 +42,8 @@ export function signerPermissionsUpdatedEvent( filters: SignerPermissionsUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event SignerPermissionsUpdated(address indexed authorizingSigner, address indexed targetSigner, (address signer, uint8 isAdmin, address[] approvedTargets, uint256 nativeTokenLimitPerTransaction, uint128 permissionStartTimestamp, uint128 permissionEndTimestamp, uint128 reqValidityStartTimestamp, uint128 reqValidityEndTimestamp, bytes32 uid) permissions)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllActiveSigners.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllActiveSigners.ts index 2e47c5cf525..b25927d7f3e 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllActiveSigners.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllActiveSigners.ts @@ -1,37 +1,38 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x8b52d723" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "signers", components: [ { - name: "signer", type: "address", + name: "signer", }, { - name: "approvedTargets", type: "address[]", + name: "approvedTargets", }, { - name: "nativeTokenLimitPerTransaction", type: "uint256", + name: "nativeTokenLimitPerTransaction", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, ], - name: "signers", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllAdmins.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllAdmins.ts index 4f5f26e99c5..340e8e2b338 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllAdmins.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllAdmins.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe9523c97" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "admins", type: "address[]", + name: "admins", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllSigners.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllSigners.ts index b6031dc3105..473f22cee70 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllSigners.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getAllSigners.ts @@ -1,37 +1,38 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xd42f2f35" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "signers", components: [ { - name: "signer", type: "address", + name: "signer", }, { - name: "approvedTargets", type: "address[]", + name: "approvedTargets", }, { - name: "nativeTokenLimitPerTransaction", type: "uint256", + name: "nativeTokenLimitPerTransaction", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, ], - name: "signers", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getPermissionsForSigner.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getPermissionsForSigner.ts index ccae2c07226..6f91832c4d4 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getPermissionsForSigner.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/getPermissionsForSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPermissionsForSigner" function. @@ -16,36 +16,36 @@ export type GetPermissionsForSignerParams = { export const FN_SELECTOR = "0xf15d424e" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "permissions", components: [ { - name: "signer", type: "address", + name: "signer", }, { - name: "approvedTargets", type: "address[]", + name: "approvedTargets", }, { - name: "nativeTokenLimitPerTransaction", type: "uint256", + name: "nativeTokenLimitPerTransaction", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, ], - name: "permissions", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isActiveSigner.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isActiveSigner.ts index 3bdebf0400d..f70ae69ae27 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isActiveSigner.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isActiveSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isActiveSigner" function. @@ -16,8 +16,8 @@ export type IsActiveSignerParams = { export const FN_SELECTOR = "0x7dff5a79" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isAdmin.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isAdmin.ts index b30b9ba947c..421e3fb9b05 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isAdmin.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/isAdmin.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isAdmin" function. @@ -16,8 +16,8 @@ export type IsAdminParams = { export const FN_SELECTOR = "0x24d7806c" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/verifySignerPermissionRequest.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/verifySignerPermissionRequest.ts index 6078893f412..13c9660d679 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/verifySignerPermissionRequest.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/read/verifySignerPermissionRequest.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verifySignerPermissionRequest" function. @@ -31,60 +31,60 @@ export type VerifySignerPermissionRequestParams = { export const FN_SELECTOR = "0xa9082d84" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "signer", type: "address", + name: "signer", }, { - name: "isAdmin", type: "uint8", + name: "isAdmin", }, { - name: "approvedTargets", type: "address[]", + name: "approvedTargets", }, { - name: "nativeTokenLimitPerTransaction", type: "uint256", + name: "nativeTokenLimitPerTransaction", }, { - name: "permissionStartTimestamp", type: "uint128", + name: "permissionStartTimestamp", }, { - name: "permissionEndTimestamp", type: "uint128", + name: "permissionEndTimestamp", }, { - name: "reqValidityStartTimestamp", type: "uint128", + name: "reqValidityStartTimestamp", }, { - name: "reqValidityEndTimestamp", type: "uint128", + name: "reqValidityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "success", type: "bool", + name: "success", }, { - name: "signer", type: "address", + name: "signer", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/write/setPermissionsForSigner.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/write/setPermissionsForSigner.ts index 99f03a9d50e..0dfecdfe3e3 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/write/setPermissionsForSigner.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IAccountPermissions/write/setPermissionsForSigner.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setPermissionsForSigner" function. @@ -33,50 +33,50 @@ export type SetPermissionsForSignerParams = WithOverrides<{ export const FN_SELECTOR = "0x5892e236" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "signer", type: "address", + name: "signer", }, { - name: "isAdmin", type: "uint8", + name: "isAdmin", }, { - name: "approvedTargets", type: "address[]", + name: "approvedTargets", }, { - name: "nativeTokenLimitPerTransaction", type: "uint256", + name: "nativeTokenLimitPerTransaction", }, { - name: "permissionStartTimestamp", type: "uint128", + name: "permissionStartTimestamp", }, { - name: "permissionEndTimestamp", type: "uint128", + name: "permissionEndTimestamp", }, { - name: "reqValidityStartTimestamp", type: "uint128", + name: "reqValidityStartTimestamp", }, { - name: "reqValidityEndTimestamp", type: "uint128", + name: "reqValidityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -183,23 +183,23 @@ export function setPermissionsForSigner( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.req, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/AccountDeployed.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/AccountDeployed.ts index c5c76a6a19d..aefeda70d1f 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/AccountDeployed.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/AccountDeployed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AccountDeployed" event. @@ -42,8 +42,8 @@ export function accountDeployedEvent( filters: AccountDeployedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Deposited.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Deposited.ts index 5a3d67beffe..979246b3a32 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Deposited.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Deposited.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Deposited" event. @@ -34,7 +34,7 @@ export type DepositedEventFilters = Partial<{ */ export function depositedEvent(filters: DepositedEventFilters = {}) { return prepareEvent({ - filters, signature: "event Deposited(address indexed account, uint256 totalDeposit)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/SignatureAggregatorChanged.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/SignatureAggregatorChanged.ts index be1fef18557..408f596d1b3 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/SignatureAggregatorChanged.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/SignatureAggregatorChanged.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "SignatureAggregatorChanged" event. @@ -36,7 +36,7 @@ export function signatureAggregatorChangedEvent( filters: SignatureAggregatorChangedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event SignatureAggregatorChanged(address indexed aggregator)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeLocked.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeLocked.ts index 238cfb9053f..cdb5cb7718a 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeLocked.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeLocked.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "StakeLocked" event. @@ -34,8 +34,8 @@ export type StakeLockedEventFilters = Partial<{ */ export function stakeLockedEvent(filters: StakeLockedEventFilters = {}) { return prepareEvent({ - filters, signature: "event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeUnlocked.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeUnlocked.ts index 30b473ab2b2..2c2a521b3e8 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeUnlocked.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeUnlocked.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "StakeUnlocked" event. @@ -34,8 +34,8 @@ export type StakeUnlockedEventFilters = Partial<{ */ export function stakeUnlockedEvent(filters: StakeUnlockedEventFilters = {}) { return prepareEvent({ - filters, signature: "event StakeUnlocked(address indexed account, uint256 withdrawTime)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeWithdrawn.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeWithdrawn.ts index 3f3e8d02b33..d6baaadd015 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeWithdrawn.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/StakeWithdrawn.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "StakeWithdrawn" event. @@ -34,8 +34,8 @@ export type StakeWithdrawnEventFilters = Partial<{ */ export function stakeWithdrawnEvent(filters: StakeWithdrawnEventFilters = {}) { return prepareEvent({ - filters, signature: "event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationEvent.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationEvent.ts index 0dcf93c6e9c..e7361b8f242 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationEvent.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationEvent.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "UserOperationEvent" event. @@ -48,8 +48,8 @@ export function userOperationEventEvent( filters: UserOperationEventEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationRevertReason.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationRevertReason.ts index 4ae291a64af..651ba8f699d 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationRevertReason.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/UserOperationRevertReason.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "UserOperationRevertReason" event. @@ -42,8 +42,8 @@ export function userOperationRevertReasonEvent( filters: UserOperationRevertReasonEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Withdrawn.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Withdrawn.ts index 2d59fcb2fe8..ba6086ca941 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Withdrawn.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/events/Withdrawn.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Withdrawn" event. @@ -34,8 +34,8 @@ export type WithdrawnEventFilters = Partial<{ */ export function withdrawnEvent(filters: WithdrawnEventFilters = {}) { return prepareEvent({ - filters, signature: "event Withdrawn(address indexed account, address withdrawAddress, uint256 amount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/balanceOf.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/balanceOf.ts index 55e6ca4003f..b7ff3081b0c 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/balanceOf.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/balanceOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "balanceOf" function. @@ -16,8 +16,8 @@ export type BalanceOfParams = { export const FN_SELECTOR = "0x70a08231" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getDepositInfo.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getDepositInfo.ts index 08cce1e0335..ef2dd86df6b 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getDepositInfo.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getDepositInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getDepositInfo" function. @@ -16,36 +16,36 @@ export type GetDepositInfoParams = { export const FN_SELECTOR = "0x5287ce12" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "info", components: [ { - name: "deposit", type: "uint112", + name: "deposit", }, { - name: "staked", type: "bool", + name: "staked", }, { - name: "stake", type: "uint112", + name: "stake", }, { - name: "unstakeDelaySec", type: "uint32", + name: "unstakeDelaySec", }, { - name: "withdrawTime", type: "uint48", + name: "withdrawTime", }, ], - name: "info", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getNonce.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getNonce.ts index 78d6bd5f232..4047aff1316 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getNonce.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getNonce.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getNonce" function. @@ -17,18 +17,18 @@ export type GetNonceParams = { export const FN_SELECTOR = "0x35567e1a" as const; const FN_INPUTS = [ { - name: "sender", type: "address", + name: "sender", }, { - name: "key", type: "uint192", + name: "key", }, ] as const; const FN_OUTPUTS = [ { - name: "nonce", type: "uint256", + name: "nonce", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getUserOpHash.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getUserOpHash.ts index df7cd5a0476..035be155152 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getUserOpHash.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/read/getUserOpHash.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getUserOpHash" function. @@ -32,54 +32,54 @@ export type GetUserOpHashParams = { export const FN_SELECTOR = "0xa6193531" as const; const FN_INPUTS = [ { + type: "tuple", + name: "userOp", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "callGasLimit", type: "uint256", + name: "callGasLimit", }, { - name: "verificationGasLimit", type: "uint256", + name: "verificationGasLimit", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "maxFeePerGas", type: "uint256", + name: "maxFeePerGas", }, { - name: "maxPriorityFeePerGas", type: "uint256", + name: "maxPriorityFeePerGas", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "userOp", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/addStake.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/addStake.ts index 5ee1b30c191..9dadba06162 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/addStake.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/addStake.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "addStake" function. @@ -21,8 +21,8 @@ export type AddStakeParams = WithOverrides<{ export const FN_SELECTOR = "0x0396cb60" as const; const FN_INPUTS = [ { - name: "_unstakeDelaySec", type: "uint32", + name: "_unstakeDelaySec", }, ] as const; const FN_OUTPUTS = [] as const; @@ -118,23 +118,23 @@ export function addStake( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.unstakeDelaySec] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/depositTo.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/depositTo.ts index a680c985f9f..b401e7ffe20 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/depositTo.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/depositTo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "depositTo" function. @@ -18,8 +18,8 @@ export type DepositToParams = WithOverrides<{ export const FN_SELECTOR = "0xb760faf9" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function depositTo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/getSenderAddress.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/getSenderAddress.ts index 3c156b207e1..824cf867b60 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/getSenderAddress.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/getSenderAddress.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getSenderAddress" function. @@ -18,8 +18,8 @@ export type GetSenderAddressParams = WithOverrides<{ export const FN_SELECTOR = "0x9b249f69" as const; const FN_INPUTS = [ { - name: "initCode", type: "bytes", + name: "initCode", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function getSenderAddress( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.initCode] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleAggregatedOps.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleAggregatedOps.ts index d3600668bd4..5ec1fb8864c 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleAggregatedOps.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleAggregatedOps.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "handleAggregatedOps" function. @@ -46,72 +46,72 @@ export type HandleAggregatedOpsParams = WithOverrides<{ export const FN_SELECTOR = "0x4b1d7cf5" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "opsPerAggregator", components: [ { + type: "tuple[]", + name: "userOps", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "callGasLimit", type: "uint256", + name: "callGasLimit", }, { - name: "verificationGasLimit", type: "uint256", + name: "verificationGasLimit", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "maxFeePerGas", type: "uint256", + name: "maxFeePerGas", }, { - name: "maxPriorityFeePerGas", type: "uint256", + name: "maxPriorityFeePerGas", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "userOps", - type: "tuple[]", }, { - name: "aggregator", type: "address", + name: "aggregator", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "opsPerAggregator", - type: "tuple[]", }, { - name: "beneficiary", type: "address", + name: "beneficiary", }, ] as const; const FN_OUTPUTS = [] as const; @@ -217,19 +217,8 @@ export function handleAggregatedOps( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -238,5 +227,16 @@ export function handleAggregatedOps( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleOps.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleOps.ts index 9ba76421223..5021df6b320 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleOps.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/handleOps.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "handleOps" function. @@ -38,58 +38,58 @@ export type HandleOpsParams = WithOverrides<{ export const FN_SELECTOR = "0x1fad948c" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "ops", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "callGasLimit", type: "uint256", + name: "callGasLimit", }, { - name: "verificationGasLimit", type: "uint256", + name: "verificationGasLimit", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "maxFeePerGas", type: "uint256", + name: "maxFeePerGas", }, { - name: "maxPriorityFeePerGas", type: "uint256", + name: "maxPriorityFeePerGas", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "ops", - type: "tuple[]", }, { - name: "beneficiary", type: "address", + name: "beneficiary", }, ] as const; const FN_OUTPUTS = [] as const; @@ -190,23 +190,23 @@ export function handleOps( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.ops, resolvedOptions.beneficiary] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/incrementNonce.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/incrementNonce.ts index f302d500846..66aeaeb26ac 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/incrementNonce.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/incrementNonce.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "incrementNonce" function. @@ -18,8 +18,8 @@ export type IncrementNonceParams = WithOverrides<{ export const FN_SELECTOR = "0x0bd28e3b" as const; const FN_INPUTS = [ { - name: "key", type: "uint192", + name: "key", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function incrementNonce( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.key] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateHandleOp.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateHandleOp.ts index 2cbf03a7c47..8ad17a56ed6 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateHandleOp.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateHandleOp.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "simulateHandleOp" function. @@ -39,62 +39,62 @@ export type SimulateHandleOpParams = WithOverrides<{ export const FN_SELECTOR = "0xd6383f94" as const; const FN_INPUTS = [ { + type: "tuple", + name: "op", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "callGasLimit", type: "uint256", + name: "callGasLimit", }, { - name: "verificationGasLimit", type: "uint256", + name: "verificationGasLimit", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "maxFeePerGas", type: "uint256", + name: "maxFeePerGas", }, { - name: "maxPriorityFeePerGas", type: "uint256", + name: "maxPriorityFeePerGas", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "op", - type: "tuple", }, { - name: "target", type: "address", + name: "target", }, { - name: "targetCallData", type: "bytes", + name: "targetCallData", }, ] as const; const FN_OUTPUTS = [] as const; @@ -202,19 +202,8 @@ export function simulateHandleOp( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -224,5 +213,16 @@ export function simulateHandleOp( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateValidation.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateValidation.ts index 219eb9561dc..be82ffcd830 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateValidation.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/simulateValidation.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "simulateValidation" function. @@ -34,54 +34,54 @@ export type SimulateValidationParams = WithOverrides<{ export const FN_SELECTOR = "0xee219423" as const; const FN_INPUTS = [ { + type: "tuple", + name: "userOp", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "callGasLimit", type: "uint256", + name: "callGasLimit", }, { - name: "verificationGasLimit", type: "uint256", + name: "verificationGasLimit", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "maxFeePerGas", type: "uint256", + name: "maxFeePerGas", }, { - name: "maxPriorityFeePerGas", type: "uint256", + name: "maxPriorityFeePerGas", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "userOp", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -181,23 +181,23 @@ export function simulateValidation( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.userOp] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/unlockStake.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/unlockStake.ts index 3506e68345a..c136fb4c701 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/unlockStake.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/unlockStake.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawStake.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawStake.ts index 14e3ed95f92..10668f3080d 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawStake.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawStake.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdrawStake" function. @@ -21,8 +21,8 @@ export type WithdrawStakeParams = WithOverrides<{ export const FN_SELECTOR = "0xc23a5cea" as const; const FN_INPUTS = [ { - name: "withdrawAddress", type: "address", + name: "withdrawAddress", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function withdrawStake( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.withdrawAddress] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawTo.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawTo.ts index 4cdfea7260f..8d0e04b7655 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawTo.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint/write/withdrawTo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdrawTo" function. @@ -25,12 +25,12 @@ export type WithdrawToParams = WithOverrides<{ export const FN_SELECTOR = "0x205c2878" as const; const FN_INPUTS = [ { - name: "withdrawAddress", type: "address", + name: "withdrawAddress", }, { - name: "withdrawAmount", type: "uint256", + name: "withdrawAmount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -134,19 +134,8 @@ export function withdrawTo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -155,5 +144,16 @@ export function withdrawTo( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/events/PostOpRevertReason.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/events/PostOpRevertReason.ts index 991f9320412..b8d5ff51605 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/events/PostOpRevertReason.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/events/PostOpRevertReason.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PostOpRevertReason" event. @@ -42,8 +42,8 @@ export function postOpRevertReasonEvent( filters: PostOpRevertReasonEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PostOpRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/read/getUserOpHash.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/read/getUserOpHash.ts index 0fdce243df6..deff206f64d 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/read/getUserOpHash.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IEntryPoint_v07/read/getUserOpHash.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getUserOpHash" function. @@ -30,46 +30,46 @@ export type GetUserOpHashParams = { export const FN_SELECTOR = "0x22cdde4c" as const; const FN_INPUTS = [ { + type: "tuple", + name: "userOp", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "accountGasLimits", type: "bytes32", + name: "accountGasLimits", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "gasFees", type: "bytes32", + name: "gasFees", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "userOp", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/postOp.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/postOp.ts index dc71be29b9d..cdb00c1cd44 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/postOp.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/postOp.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "postOp" function. @@ -23,16 +23,16 @@ export type PostOpParams = WithOverrides<{ export const FN_SELECTOR = "0xa9a23409" as const; const FN_INPUTS = [ { - name: "mode", type: "uint8", + name: "mode", }, { - name: "context", type: "bytes", + name: "context", }, { - name: "actualGasCost", type: "uint256", + name: "actualGasCost", }, ] as const; const FN_OUTPUTS = [] as const; @@ -138,19 +138,8 @@ export function postOp( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -160,5 +149,16 @@ export function postOp( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/validatePaymasterUserOp.ts b/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/validatePaymasterUserOp.ts index e5e33c429c0..ce0e1b226f6 100644 --- a/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/validatePaymasterUserOp.ts +++ b/packages/thirdweb/src/extensions/erc4337/__generated__/IPaymaster/write/validatePaymasterUserOp.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "validatePaymasterUserOp" function. @@ -39,72 +39,72 @@ export type ValidatePaymasterUserOpParams = WithOverrides<{ export const FN_SELECTOR = "0xf465c77e" as const; const FN_INPUTS = [ { + type: "tuple", + name: "userOp", components: [ { - name: "sender", type: "address", + name: "sender", }, { - name: "nonce", type: "uint256", + name: "nonce", }, { - name: "initCode", type: "bytes", + name: "initCode", }, { - name: "callData", type: "bytes", + name: "callData", }, { - name: "callGasLimit", type: "uint256", + name: "callGasLimit", }, { - name: "verificationGasLimit", type: "uint256", + name: "verificationGasLimit", }, { - name: "preVerificationGas", type: "uint256", + name: "preVerificationGas", }, { - name: "maxFeePerGas", type: "uint256", + name: "maxFeePerGas", }, { - name: "maxPriorityFeePerGas", type: "uint256", + name: "maxPriorityFeePerGas", }, { - name: "paymasterAndData", type: "bytes", + name: "paymasterAndData", }, { - name: "signature", type: "bytes", + name: "signature", }, ], - name: "userOp", - type: "tuple", }, { - name: "userOpHash", type: "bytes32", + name: "userOpHash", }, { - name: "maxCost", type: "uint256", + name: "maxCost", }, ] as const; const FN_OUTPUTS = [ { - name: "context", type: "bytes", + name: "context", }, { - name: "validationData", type: "uint256", + name: "validationData", }, ] as const; @@ -217,19 +217,8 @@ export function validatePaymasterUserOp( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -239,5 +228,16 @@ export function validatePaymasterUserOp( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Deposit.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Deposit.ts index 753a8961fff..dc44d6e24ab 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Deposit.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Deposit.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Deposit" event. @@ -40,8 +40,8 @@ export type DepositEventFilters = Partial<{ */ export function depositEvent(filters: DepositEventFilters = {}) { return prepareEvent({ - filters, signature: "event Deposit(address indexed caller, address indexed owner, uint256 assets, uint256 shares)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Withdraw.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Withdraw.ts index 8450bb95731..702a6b214e0 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Withdraw.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/events/Withdraw.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Withdraw" event. @@ -46,8 +46,8 @@ export type WithdrawEventFilters = Partial<{ */ export function withdrawEvent(filters: WithdrawEventFilters = {}) { return prepareEvent({ - filters, signature: "event Withdraw(address indexed caller, address indexed receiver, address indexed owner, uint256 assets, uint256 shares)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/asset.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/asset.ts index 06812146334..c6aa2cf4a8f 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/asset.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/asset.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x38d52e0f" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "assetTokenAddress", type: "address", + name: "assetTokenAddress", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToAssets.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToAssets.ts index 7288d41eabb..a336a3ba71d 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToAssets.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToAssets.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "convertToAssets" function. @@ -16,14 +16,14 @@ export type ConvertToAssetsParams = { export const FN_SELECTOR = "0x07a2d13a" as const; const FN_INPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; const FN_OUTPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToShares.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToShares.ts index 75ac99b846e..19adbec5d30 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToShares.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/convertToShares.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "convertToShares" function. @@ -16,14 +16,14 @@ export type ConvertToSharesParams = { export const FN_SELECTOR = "0xc6e6f592" as const; const FN_INPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, ] as const; const FN_OUTPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxDeposit.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxDeposit.ts index a79217d1108..c381e4e07ce 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxDeposit.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxDeposit.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "maxDeposit" function. @@ -16,14 +16,14 @@ export type MaxDepositParams = { export const FN_SELECTOR = "0x402d267d" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, ] as const; const FN_OUTPUTS = [ { - name: "maxAssets", type: "uint256", + name: "maxAssets", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxMint.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxMint.ts index be7362591b6..31d838daa75 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxMint.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxMint.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "maxMint" function. @@ -16,14 +16,14 @@ export type MaxMintParams = { export const FN_SELECTOR = "0xc63d75b6" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, ] as const; const FN_OUTPUTS = [ { - name: "maxShares", type: "uint256", + name: "maxShares", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxRedeem.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxRedeem.ts index fdf9a9bd349..c87d5ca24be 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxRedeem.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxRedeem.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "maxRedeem" function. @@ -16,14 +16,14 @@ export type MaxRedeemParams = { export const FN_SELECTOR = "0xd905777e" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ { - name: "maxShares", type: "uint256", + name: "maxShares", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxWithdraw.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxWithdraw.ts index 2f5cb5760df..5d2194959f1 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxWithdraw.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/maxWithdraw.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "maxWithdraw" function. @@ -16,14 +16,14 @@ export type MaxWithdrawParams = { export const FN_SELECTOR = "0xce96cb77" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ { - name: "maxAssets", type: "uint256", + name: "maxAssets", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewDeposit.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewDeposit.ts index fc50a5d5b2e..55bd138d5c8 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewDeposit.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewDeposit.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "previewDeposit" function. @@ -16,14 +16,14 @@ export type PreviewDepositParams = { export const FN_SELECTOR = "0xef8b30f7" as const; const FN_INPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, ] as const; const FN_OUTPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewMint.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewMint.ts index 0c11d728319..1c77082a6d4 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewMint.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewMint.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "previewMint" function. @@ -16,8 +16,8 @@ export type PreviewMintParams = { export const FN_SELECTOR = "0xb3d7f6b9" as const; const FN_INPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewRedeem.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewRedeem.ts index 1ffa9dd1327..d22c9fc5c1c 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewRedeem.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewRedeem.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "previewRedeem" function. @@ -16,14 +16,14 @@ export type PreviewRedeemParams = { export const FN_SELECTOR = "0x4cdad506" as const; const FN_INPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; const FN_OUTPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewWithdraw.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewWithdraw.ts index d66508de4a0..0b48678535b 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewWithdraw.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/previewWithdraw.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "previewWithdraw" function. @@ -16,14 +16,14 @@ export type PreviewWithdrawParams = { export const FN_SELECTOR = "0x0a28a477" as const; const FN_INPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, ] as const; const FN_OUTPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/totalAssets.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/totalAssets.ts index 1801c0053ff..13444d4de6f 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/totalAssets.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/read/totalAssets.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x01e1d114" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "totalManagedAssets", type: "uint256", + name: "totalManagedAssets", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/deposit.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/deposit.ts index d37c26b12d0..f987f82b52f 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/deposit.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/deposit.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "deposit" function. @@ -19,18 +19,18 @@ export type DepositParams = WithOverrides<{ export const FN_SELECTOR = "0x6e553f65" as const; const FN_INPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, { - name: "receiver", type: "address", + name: "receiver", }, ] as const; const FN_OUTPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; @@ -128,23 +128,23 @@ export function deposit( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.assets, resolvedOptions.receiver] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/mint.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/mint.ts index 9499cfff6f9..21674a7ae44 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/mint.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/mint.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mint" function. @@ -19,18 +19,18 @@ export type MintParams = WithOverrides<{ export const FN_SELECTOR = "0x94bf804d" as const; const FN_INPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, { - name: "receiver", type: "address", + name: "receiver", }, ] as const; const FN_OUTPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, ] as const; @@ -128,23 +128,23 @@ export function mint( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.shares, resolvedOptions.receiver] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/redeem.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/redeem.ts index dcc70c39d48..df351f6ff7b 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/redeem.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/redeem.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "redeem" function. @@ -20,22 +20,22 @@ export type RedeemParams = WithOverrides<{ export const FN_SELECTOR = "0xba087652" as const; const FN_INPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, { - name: "receiver", type: "address", + name: "receiver", }, { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, ] as const; @@ -140,19 +140,8 @@ export function redeem( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -162,5 +151,16 @@ export function redeem( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/withdraw.ts b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/withdraw.ts index 70362e7237b..f9d36616418 100644 --- a/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/withdraw.ts +++ b/packages/thirdweb/src/extensions/erc4626/__generated__/IERC4626/write/withdraw.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdraw" function. @@ -20,22 +20,22 @@ export type WithdrawParams = WithOverrides<{ export const FN_SELECTOR = "0xb460af94" as const; const FN_INPUTS = [ { - name: "assets", type: "uint256", + name: "assets", }, { - name: "receiver", type: "address", + name: "receiver", }, { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ { - name: "shares", type: "uint256", + name: "shares", }, ] as const; @@ -140,19 +140,8 @@ export function withdraw( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -162,5 +151,16 @@ export function withdraw( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/isValidSigner.ts b/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/isValidSigner.ts index 26a270ebb9f..f48782ca657 100644 --- a/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/isValidSigner.ts +++ b/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/isValidSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isValidSigner" function. @@ -17,18 +17,18 @@ export type IsValidSignerParams = { export const FN_SELECTOR = "0x523e3260" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, { - name: "context", type: "bytes", + name: "context", }, ] as const; const FN_OUTPUTS = [ { - name: "magicValue", type: "bytes4", + name: "magicValue", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/state.ts b/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/state.ts index 4a94d5ca5f4..366fa324ff1 100644 --- a/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/state.ts +++ b/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/state.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xc19d93fb" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/token.ts b/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/token.ts index 758898583c1..5b0fd38dc2d 100644 --- a/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/token.ts +++ b/packages/thirdweb/src/extensions/erc6551/__generated__/IERC6551Account/read/token.ts @@ -1,23 +1,24 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfc0c546a" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "chainId", type: "uint256", + name: "chainId", }, { - name: "tokenContract", type: "address", + name: "tokenContract", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/read/verifyClaim.ts b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/read/verifyClaim.ts index 9547268a917..d6fbe26258f 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/read/verifyClaim.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/read/verifyClaim.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verifyClaim" function. @@ -36,52 +36,52 @@ export type VerifyClaimParams = { export const FN_SELECTOR = "0x23a2902b" as const; const FN_INPUTS = [ { - name: "_conditionId", type: "uint256", + name: "_conditionId", }, { - name: "_claimer", type: "address", + name: "_claimer", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_pricePerToken", type: "uint256", + name: "_pricePerToken", }, { + type: "tuple", + name: "_allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "_allowlistProof", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "isOverride", type: "bool", + name: "isOverride", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/freezeBatchBaseURI.ts b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/freezeBatchBaseURI.ts index 529ea40cad5..5a98dee8f1b 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/freezeBatchBaseURI.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/freezeBatchBaseURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "freezeBatchBaseURI" function. @@ -18,8 +18,8 @@ export type FreezeBatchBaseURIParams = WithOverrides<{ export const FN_SELECTOR = "0xa07ced9e" as const; const FN_INPUTS = [ { - name: "_index", type: "uint256", + name: "_index", }, ] as const; const FN_OUTPUTS = [] as const; @@ -119,23 +119,23 @@ export function freezeBatchBaseURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.index] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/setMaxTotalSupply.ts b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/setMaxTotalSupply.ts index fa6e333d998..fef30ba5b5b 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/setMaxTotalSupply.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/setMaxTotalSupply.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setMaxTotalSupply" function. @@ -21,8 +21,8 @@ export type SetMaxTotalSupplyParams = WithOverrides<{ export const FN_SELECTOR = "0x3f3e4c11" as const; const FN_INPUTS = [ { - name: "_maxTotalSupply", type: "uint256", + name: "_maxTotalSupply", }, ] as const; const FN_OUTPUTS = [] as const; @@ -122,23 +122,23 @@ export function setMaxTotalSupply( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.maxTotalSupply] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/updateBatchBaseURI.ts b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/updateBatchBaseURI.ts index 0368737cc6c..80e7ca4d58c 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/updateBatchBaseURI.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/DropERC721/write/updateBatchBaseURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "updateBatchBaseURI" function. @@ -19,12 +19,12 @@ export type UpdateBatchBaseURIParams = WithOverrides<{ export const FN_SELECTOR = "0xde903ddd" as const; const FN_INPUTS = [ { - name: "_index", type: "uint256", + name: "_index", }, { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -127,23 +127,23 @@ export function updateBatchBaseURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.index, resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/events/AirdropFailed.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/events/AirdropFailed.ts index 074ba92c517..f4caa50a316 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/events/AirdropFailed.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/events/AirdropFailed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AirdropFailed" event. @@ -46,8 +46,8 @@ export type AirdropFailedEventFilters = Partial<{ */ export function airdropFailedEvent(filters: AirdropFailedEventFilters = {}) { return prepareEvent({ - filters, signature: "event AirdropFailed(address indexed tokenAddress, address indexed tokenOwner, address indexed recipient, uint256 tokenId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/write/airdropERC721.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/write/airdropERC721.ts index 9ab804ed1ce..2f96fcc6574 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/write/airdropERC721.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721/write/airdropERC721.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "airdropERC721" function. @@ -33,26 +33,26 @@ export type AirdropERC721Params = WithOverrides<{ export const FN_SELECTOR = "0x7c2c059d" as const; const FN_INPUTS = [ { - name: "tokenAddress", type: "address", + name: "tokenAddress", }, { - name: "tokenOwner", type: "address", + name: "tokenOwner", }, { + type: "tuple[]", + name: "contents", components: [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ], - name: "contents", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -160,19 +160,8 @@ export function airdropERC721( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -182,5 +171,16 @@ export function airdropERC721( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/events/TokensClaimed.ts index b40aec40e59..6713f907a04 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -40,8 +40,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/write/claim.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/write/claim.ts index f20c344b892..c8242f26ff7 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IAirdropERC721Claimable/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -24,20 +24,20 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x3b4b57b0" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "proofs", type: "bytes32[]", + name: "proofs", }, { - name: "proofMaxQuantityForWallet", type: "uint256", + name: "proofMaxQuantityForWallet", }, ] as const; const FN_OUTPUTS = [] as const; @@ -147,19 +147,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -170,5 +159,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBaseURICount.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBaseURICount.ts index 28715bb477e..05c14805732 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBaseURICount.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBaseURICount.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x63b45e2d" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBatchIdAtIndex.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBatchIdAtIndex.ts index 2ab79d4d7e5..0c742164d79 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBatchIdAtIndex.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IBatchMintMetadata/read/getBatchIdAtIndex.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getBatchIdAtIndex" function. @@ -16,8 +16,8 @@ export type GetBatchIdAtIndexParams = { export const FN_SELECTOR = "0x2419f51b" as const; const FN_INPUTS = [ { - name: "_index", type: "uint256", + name: "_index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IBurnableERC721/write/burn.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IBurnableERC721/write/burn.ts index b544f973801..1f66b6a3b03 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IBurnableERC721/write/burn.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IBurnableERC721/write/burn.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burn" function. @@ -18,8 +18,8 @@ export type BurnParams = WithOverrides<{ export const FN_SELECTOR = "0x42966c68" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function burn( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/events/TokensClaimed.ts index fd159360a2f..96d8aeb4491 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 indexed startTokenId, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/read/verifyClaim.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/read/verifyClaim.ts index fcd6bff6605..2696773d0ab 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/read/verifyClaim.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/read/verifyClaim.ts @@ -16,12 +16,12 @@ export type VerifyClaimParams = { export const FN_SELECTOR = "0x2f92023a" as const; const FN_INPUTS = [ { - name: "_claimer", type: "address", + name: "_claimer", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, ] as const; const FN_OUTPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/write/claim.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/write/claim.ts index 58e59b6eb27..b6d15533e0c 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IClaimableERC721/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -19,12 +19,12 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0xaad3ec96" as const; const FN_INPUTS = [ { - name: "_receiver", type: "address", + name: "_receiver", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, ] as const; const FN_OUTPUTS = [] as const; @@ -123,23 +123,23 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.receiver, resolvedOptions.quantity] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/events/TokenURIRevealed.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/events/TokenURIRevealed.ts index 1fecec5b724..80887b4834b 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/events/TokenURIRevealed.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/events/TokenURIRevealed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokenURIRevealed" event. @@ -36,8 +36,8 @@ export function tokenURIRevealedEvent( filters: TokenURIRevealedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokenURIRevealed(uint256 indexed index, string revealedURI)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptDecrypt.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptDecrypt.ts index c1f1a999672..72fec8c3c7a 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptDecrypt.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptDecrypt.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "encryptDecrypt" function. @@ -17,18 +17,18 @@ export type EncryptDecryptParams = { export const FN_SELECTOR = "0xe7150322" as const; const FN_INPUTS = [ { - name: "data", type: "bytes", + name: "data", }, { - name: "key", type: "bytes", + name: "key", }, ] as const; const FN_OUTPUTS = [ { - name: "result", type: "bytes", + name: "result", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptedData.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptedData.ts index b1cc0015030..6c8d4a2dca7 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptedData.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/read/encryptedData.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "encryptedData" function. @@ -16,8 +16,8 @@ export type EncryptedDataParams = { export const FN_SELECTOR = "0xa05112fc" as const; const FN_INPUTS = [ { - name: "index", type: "uint256", + name: "index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/write/reveal.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/write/reveal.ts index 72c6e0dfd22..d458a71158e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/write/reveal.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDelayedReveal/write/reveal.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "reveal" function. @@ -22,18 +22,18 @@ export type RevealParams = WithOverrides<{ export const FN_SELECTOR = "0xce805642" as const; const FN_INPUTS = [ { - name: "identifier", type: "uint256", + name: "identifier", }, { - name: "key", type: "bytes", + name: "key", }, ] as const; const FN_OUTPUTS = [ { - name: "revealedURI", type: "string", + name: "revealedURI", }, ] as const; @@ -131,23 +131,23 @@ export function reveal( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.identifier, resolvedOptions.key] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/events/TokensClaimed.ts index 50e2640a789..f9323d3861e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(uint256 indexed claimConditionIndex, address indexed claimer, address indexed receiver, uint256 startTokenId, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/baseURIIndices.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/baseURIIndices.ts index 3f13709afb6..15d51107b1f 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/baseURIIndices.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/baseURIIndices.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "baseURIIndices" function. @@ -16,8 +16,8 @@ export type BaseURIIndicesParams = { export const FN_SELECTOR = "0xd860483f" as const; const FN_INPUTS = [ { - name: "index", type: "uint256", + name: "index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/claimCondition.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/claimCondition.ts index c209f44db85..bdd2144fb09 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/claimCondition.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/claimCondition.ts @@ -1,19 +1,20 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xd637ed59" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "currentStartId", type: "uint256", + name: "currentStartId", }, { - name: "count", type: "uint256", + name: "count", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getActiveClaimConditionId.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getActiveClaimConditionId.ts index 05fc620d047..5e4f78b73ee 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getActiveClaimConditionId.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getActiveClaimConditionId.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xc68907de" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getClaimConditionById.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getClaimConditionById.ts index efe91824b1c..4c03e0387d5 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getClaimConditionById.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/getClaimConditionById.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getClaimConditionById" function. @@ -19,48 +19,48 @@ export type GetClaimConditionByIdParams = { export const FN_SELECTOR = "0x6f8934f4" as const; const FN_INPUTS = [ { - name: "_conditionId", type: "uint256", + name: "_conditionId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "condition", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "condition", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/nextTokenIdToClaim.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/nextTokenIdToClaim.ts index a3a6212cb9a..409a4030ce4 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/nextTokenIdToClaim.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/read/nextTokenIdToClaim.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xacd083f8" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/claim.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/claim.ts index 3939be3ce53..bd199d831e0 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -35,46 +35,46 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x84bb1e42" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { + type: "tuple", + name: "allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "allowlistProof", - type: "tuple", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -192,19 +192,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -217,5 +206,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/setClaimConditions.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/setClaimConditions.ts index ecdcd810f2d..59a01bbc213 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/setClaimConditions.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDrop/write/setClaimConditions.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimConditions" function. @@ -35,46 +35,46 @@ export type SetClaimConditionsParams = WithOverrides<{ export const FN_SELECTOR = "0x74bc7db7" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "phases", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "phases", - type: "tuple[]", }, { - name: "resetClaimEligibility", type: "bool", + name: "resetClaimEligibility", }, ] as const; const FN_OUTPUTS = [] as const; @@ -180,19 +180,8 @@ export function setClaimConditions( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -201,5 +190,16 @@ export function setClaimConditions( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.ts index fd159360a2f..96d8aeb4491 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/events/TokensClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensClaimed" event. @@ -46,8 +46,8 @@ export type TokensClaimedEventFilters = Partial<{ */ export function tokensClaimedEvent(filters: TokensClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensClaimed(address indexed claimer, address indexed receiver, uint256 indexed startTokenId, uint256 quantityClaimed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.ts index 5b1917ac2ec..60f4078f4d2 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/read/claimCondition.ts @@ -1,49 +1,50 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xd637ed59" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "condition", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "condition", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/claim.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/claim.ts index 3939be3ce53..bd199d831e0 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/claim.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/claim.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "claim" function. @@ -35,46 +35,46 @@ export type ClaimParams = WithOverrides<{ export const FN_SELECTOR = "0x84bb1e42" as const; const FN_INPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { + type: "tuple", + name: "allowlistProof", components: [ { - name: "proof", type: "bytes32[]", + name: "proof", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, ], - name: "allowlistProof", - type: "tuple", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -192,19 +192,8 @@ export function claim( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -217,5 +206,16 @@ export function claim( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.ts index 27f4ce8cc9e..d07fd8efc8e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IDropSinglePhase/write/setClaimConditions.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimConditions" function. @@ -35,46 +35,46 @@ export type SetClaimConditionsParams = WithOverrides<{ export const FN_SELECTOR = "0x426cfaf3" as const; const FN_INPUTS = [ { + type: "tuple", + name: "phase", components: [ { - name: "startTimestamp", type: "uint256", + name: "startTimestamp", }, { - name: "maxClaimableSupply", type: "uint256", + name: "maxClaimableSupply", }, { - name: "supplyClaimed", type: "uint256", + name: "supplyClaimed", }, { - name: "quantityLimitPerWallet", type: "uint256", + name: "quantityLimitPerWallet", }, { - name: "merkleRoot", type: "bytes32", + name: "merkleRoot", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "metadata", type: "string", + name: "metadata", }, ], - name: "phase", - type: "tuple", }, { - name: "resetClaimEligibility", type: "bool", + name: "resetClaimEligibility", }, ] as const; const FN_OUTPUTS = [] as const; @@ -180,19 +180,8 @@ export function setClaimConditions( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -201,5 +190,16 @@ export function setClaimConditions( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Approval.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Approval.ts index cd341395868..c1f8b0cb939 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Approval.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Approval.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Approval" event. @@ -46,8 +46,8 @@ export type ApprovalEventFilters = Partial<{ */ export function approvalEvent(filters: ApprovalEventFilters = {}) { return prepareEvent({ - filters, signature: "event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/ApprovalForAll.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/ApprovalForAll.ts index b2735569c9e..da4f0dfc8d7 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/ApprovalForAll.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/ApprovalForAll.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ApprovalForAll" event. @@ -40,8 +40,8 @@ export type ApprovalForAllEventFilters = Partial<{ */ export function approvalForAllEvent(filters: ApprovalForAllEventFilters = {}) { return prepareEvent({ - filters, signature: "event ApprovalForAll(address indexed owner, address indexed operator, bool approved)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Transfer.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Transfer.ts index 4163cf5363a..b0d19bab766 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Transfer.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/events/Transfer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Transfer" event. @@ -46,8 +46,8 @@ export type TransferEventFilters = Partial<{ */ export function transferEvent(filters: TransferEventFilters = {}) { return prepareEvent({ - filters, signature: "event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/balanceOf.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/balanceOf.ts index c75d7c35b12..0a97dbe010d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/balanceOf.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/balanceOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "balanceOf" function. @@ -16,8 +16,8 @@ export type BalanceOfParams = { export const FN_SELECTOR = "0x70a08231" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/getApproved.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/getApproved.ts index 3b08cf7171d..e6e6c742b20 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/getApproved.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/getApproved.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getApproved" function. @@ -16,8 +16,8 @@ export type GetApprovedParams = { export const FN_SELECTOR = "0x081812fc" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/isApprovedForAll.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/isApprovedForAll.ts index 518585e4966..48aae344fd6 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/isApprovedForAll.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/isApprovedForAll.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isApprovedForAll" function. @@ -17,12 +17,12 @@ export type IsApprovedForAllParams = { export const FN_SELECTOR = "0xe985e9c5" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, { - name: "operator", type: "address", + name: "operator", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/name.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/name.ts index 977eb71775a..7f2ee48afd1 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/name.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/name.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x06fdde03" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/ownerOf.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/ownerOf.ts index d47f48285ab..725b42cb89c 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/ownerOf.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/ownerOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "ownerOf" function. @@ -16,8 +16,8 @@ export type OwnerOfParams = { export const FN_SELECTOR = "0x6352211e" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/startTokenId.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/startTokenId.ts index a7437962276..44320640e09 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/startTokenId.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/startTokenId.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe6798baa" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/symbol.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/symbol.ts index 09032ae8d6a..2541453f1fa 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/symbol.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/symbol.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x95d89b41" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/tokenURI.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/tokenURI.ts index 1088ee3775c..cdd424d3861 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/tokenURI.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/tokenURI.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenURI" function. @@ -16,8 +16,8 @@ export type TokenURIParams = { export const FN_SELECTOR = "0xc87b56dd" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/totalSupply.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/totalSupply.ts index 08c6748815e..a19be2e4323 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/totalSupply.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/read/totalSupply.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x18160ddd" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/approve.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/approve.ts index d8980b43c68..35b4af6555e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/approve.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/approve.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "approve" function. @@ -19,12 +19,12 @@ export type ApproveParams = WithOverrides<{ export const FN_SELECTOR = "0x095ea7b3" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -123,23 +123,23 @@ export function approve( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.to, resolvedOptions.tokenId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/safeTransferFrom.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/safeTransferFrom.ts index e05e5fcaca5..6a39c3be5ca 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/safeTransferFrom.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/safeTransferFrom.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "safeTransferFrom" function. @@ -20,16 +20,16 @@ export type SafeTransferFromParams = WithOverrides<{ export const FN_SELECTOR = "0x42842e0e" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "to", type: "address", + name: "to", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -137,19 +137,8 @@ export function safeTransferFrom( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -159,5 +148,16 @@ export function safeTransferFrom( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/setApprovalForAll.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/setApprovalForAll.ts index 9096c337621..b2a383dd006 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/setApprovalForAll.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/setApprovalForAll.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setApprovalForAll" function. @@ -19,12 +19,12 @@ export type SetApprovalForAllParams = WithOverrides<{ export const FN_SELECTOR = "0xa22cb465" as const; const FN_INPUTS = [ { - name: "operator", type: "address", + name: "operator", }, { - name: "_approved", type: "bool", + name: "_approved", }, ] as const; const FN_OUTPUTS = [] as const; @@ -127,23 +127,23 @@ export function setApprovalForAll( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.operator, resolvedOptions.approved] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/transferFrom.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/transferFrom.ts index bd1283d5c04..7eda6c94dfe 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/transferFrom.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721A/write/transferFrom.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transferFrom" function. @@ -20,16 +20,16 @@ export type TransferFromParams = WithOverrides<{ export const FN_SELECTOR = "0x23b872dd" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "to", type: "address", + name: "to", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -137,19 +137,8 @@ export function transferFrom( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -159,5 +148,16 @@ export function transferFrom( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/events/ConsecutiveTransfer.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/events/ConsecutiveTransfer.ts index f2b6876432f..09dbce48836 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/events/ConsecutiveTransfer.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/events/ConsecutiveTransfer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ConsecutiveTransfer" event. @@ -48,8 +48,8 @@ export function consecutiveTransferEvent( filters: ConsecutiveTransferEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwner.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwner.ts index 345073d1a33..c57aff8f227 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwner.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokensOfOwner" function. @@ -16,8 +16,8 @@ export type TokensOfOwnerParams = { export const FN_SELECTOR = "0x8462151c" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwnerIn.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwnerIn.ts index 3ab75e3ee86..fae3b29b1eb 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwnerIn.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721AQueryable/read/tokensOfOwnerIn.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokensOfOwnerIn" function. @@ -18,16 +18,16 @@ export type TokensOfOwnerInParams = { export const FN_SELECTOR = "0x99a2557a" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, { - name: "start", type: "uint256", + name: "start", }, { - name: "stop", type: "uint256", + name: "stop", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/nextTokenIdToMint.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/nextTokenIdToMint.ts index 2bb30b6fa3b..abab41a1765 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/nextTokenIdToMint.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/nextTokenIdToMint.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3b1475a7" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenByIndex.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenByIndex.ts index e3ec8eac5f0..a2194155e72 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenByIndex.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenByIndex.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenByIndex" function. @@ -16,8 +16,8 @@ export type TokenByIndexParams = { export const FN_SELECTOR = "0x4f6ccce7" as const; const FN_INPUTS = [ { - name: "_index", type: "uint256", + name: "_index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenOfOwnerByIndex.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenOfOwnerByIndex.ts index 260539c27a7..317ffdcd06e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenOfOwnerByIndex.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Enumerable/read/tokenOfOwnerByIndex.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenOfOwnerByIndex" function. @@ -17,12 +17,12 @@ export type TokenOfOwnerByIndexParams = { export const FN_SELECTOR = "0x2f745c59" as const; const FN_INPUTS = [ { - name: "_owner", type: "address", + name: "_owner", }, { - name: "_index", type: "uint256", + name: "_index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Receiver/write/onERC721Received.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Receiver/write/onERC721Received.ts index 68ff8a10a2b..4e89a7ec99f 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Receiver/write/onERC721Received.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IERC721Receiver/write/onERC721Received.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "onERC721Received" function. @@ -21,20 +21,20 @@ export type OnERC721ReceivedParams = WithOverrides<{ export const FN_SELECTOR = "0x150b7a02" as const; const FN_INPUTS = [ { - name: "operator", type: "address", + name: "operator", }, { - name: "from", type: "address", + name: "from", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [ @@ -150,19 +150,8 @@ export function onERC721Received( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -173,5 +162,16 @@ export function onERC721Received( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/events/TokensLazyMinted.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/events/TokensLazyMinted.ts index 6fe312990fc..eb69059bee4 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/events/TokensLazyMinted.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/events/TokensLazyMinted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensLazyMinted" event. @@ -36,8 +36,8 @@ export function tokensLazyMintedEvent( filters: TokensLazyMintedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensLazyMinted(uint256 indexed startTokenId, uint256 endTokenId, string baseURI, bytes encryptedBaseURI)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/write/lazyMint.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/write/lazyMint.ts index 1eeb18fc85e..9889bbbb726 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/write/lazyMint.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ILazyMint/write/lazyMint.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "lazyMint" function. @@ -23,22 +23,22 @@ export type LazyMintParams = WithOverrides<{ export const FN_SELECTOR = "0xd37c353b" as const; const FN_INPUTS = [ { - name: "amount", type: "uint256", + name: "amount", }, { - name: "baseURIForTokens", type: "string", + name: "baseURIForTokens", }, { - name: "extraData", type: "bytes", + name: "extraData", }, ] as const; const FN_OUTPUTS = [ { - name: "batchId", type: "uint256", + name: "batchId", }, ] as const; @@ -143,19 +143,8 @@ export function lazyMint( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -165,5 +154,16 @@ export function lazyMint( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/events/TokensMinted.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/events/TokensMinted.ts index b4e26aa7184..667cd89e059 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/events/TokensMinted.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/events/TokensMinted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMinted" event. @@ -40,8 +40,8 @@ export type TokensMintedEventFilters = Partial<{ */ export function tokensMintedEvent(filters: TokensMintedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/write/mintTo.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/write/mintTo.ts index 722f0bace6a..5541d6823a5 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/write/mintTo.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IMintableERC721/write/mintTo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintTo" function. @@ -19,12 +19,12 @@ export type MintToParams = WithOverrides<{ export const FN_SELECTOR = "0x0075a317" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "uri", type: "string", + name: "uri", }, ] as const; const FN_OUTPUTS = [ @@ -127,23 +127,23 @@ export function mintTo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.to, resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/read/supportsInterface.ts b/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/read/supportsInterface.ts index 8ead51593eb..0f6b2f9089d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/freezeMetadata.ts b/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/freezeMetadata.ts index 4bc2551a316..072e98db461 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/freezeMetadata.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/freezeMetadata.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/setTokenURI.ts b/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/setTokenURI.ts index e6fafb0e530..2ae9e83a539 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/setTokenURI.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/INFTMetadata/write/setTokenURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTokenURI" function. @@ -19,12 +19,12 @@ export type SetTokenURIParams = WithOverrides<{ export const FN_SELECTOR = "0x162094c4" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function setTokenURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/depositRewardTokens.ts b/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/depositRewardTokens.ts index d434b122090..bee2ca42a4e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/depositRewardTokens.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/depositRewardTokens.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "depositRewardTokens" function. @@ -18,8 +18,8 @@ export type DepositRewardTokensParams = WithOverrides<{ export const FN_SELECTOR = "0x16c621e0" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -119,23 +119,23 @@ export function depositRewardTokens( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/withdrawRewardTokens.ts b/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/withdrawRewardTokens.ts index 66cec30444f..ed1eccc08f6 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/withdrawRewardTokens.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/INFTStake/write/withdrawRewardTokens.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdrawRewardTokens" function. @@ -18,8 +18,8 @@ export type WithdrawRewardTokensParams = WithOverrides<{ export const FN_SELECTOR = "0xcb43b2dd" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -121,23 +121,23 @@ export function withdrawRewardTokens( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/read/sharedMetadata.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/read/sharedMetadata.ts index 430d0358c54..19270af23a0 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/read/sharedMetadata.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/read/sharedMetadata.ts @@ -1,27 +1,28 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xb280f703" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "name", type: "string", + name: "name", }, { - name: "description", type: "string", + name: "description", }, { - name: "imageURI", type: "string", + name: "imageURI", }, { - name: "animationURI", type: "string", + name: "animationURI", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/write/setSharedMetadata.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/write/setSharedMetadata.ts index d3213e60abd..cce5712e655 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/write/setSharedMetadata.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadata/write/setSharedMetadata.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSharedMetadata" function. @@ -27,26 +27,26 @@ export type SetSharedMetadataParams = WithOverrides<{ export const FN_SELECTOR = "0xa7d27d9d" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_metadata", components: [ { - name: "name", type: "string", + name: "name", }, { - name: "description", type: "string", + name: "description", }, { - name: "imageURI", type: "string", + name: "imageURI", }, { - name: "animationURI", type: "string", + name: "animationURI", }, ], - name: "_metadata", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,23 +146,23 @@ export function setSharedMetadata( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.metadata] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataDeleted.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataDeleted.ts index a96c36cd312..c60a5c32c2e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataDeleted.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataDeleted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "SharedMetadataDeleted" event. @@ -36,7 +36,7 @@ export function sharedMetadataDeletedEvent( filters: SharedMetadataDeletedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event SharedMetadataDeleted(bytes32 indexed id)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataUpdated.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataUpdated.ts index 3b3f5625eda..57d4bb484fb 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataUpdated.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/events/SharedMetadataUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "SharedMetadataUpdated" event. @@ -36,8 +36,8 @@ export function sharedMetadataUpdatedEvent( filters: SharedMetadataUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event SharedMetadataUpdated(bytes32 indexed id, string name, string description, string imageURI, string animationURI)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/read/getAllSharedMetadata.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/read/getAllSharedMetadata.ts index da31f2a43bc..af641d83093 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/read/getAllSharedMetadata.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/read/getAllSharedMetadata.ts @@ -1,43 +1,44 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfc3c2a73" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "metadata", components: [ { - name: "id", type: "bytes32", + name: "id", }, { + type: "tuple", + name: "metadata", components: [ { - name: "name", type: "string", + name: "name", }, { - name: "description", type: "string", + name: "description", }, { - name: "imageURI", type: "string", + name: "imageURI", }, { - name: "animationURI", type: "string", + name: "animationURI", }, ], - name: "metadata", - type: "tuple", }, ], - name: "metadata", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/deleteSharedMetadata.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/deleteSharedMetadata.ts index 53289cc2231..2c361c8dad4 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/deleteSharedMetadata.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/deleteSharedMetadata.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "deleteSharedMetadata" function. @@ -18,8 +18,8 @@ export type DeleteSharedMetadataParams = WithOverrides<{ export const FN_SELECTOR = "0x1ebb2422" as const; const FN_INPUTS = [ { - name: "id", type: "bytes32", + name: "id", }, ] as const; const FN_OUTPUTS = [] as const; @@ -121,23 +121,23 @@ export function deleteSharedMetadata( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.id] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/setSharedMetadata.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/setSharedMetadata.ts index a0f31717dc7..da44ced507e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/setSharedMetadata.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISharedMetadataBatch/write/setSharedMetadata.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSharedMetadata" function. @@ -28,30 +28,30 @@ export type SetSharedMetadataParams = WithOverrides<{ export const FN_SELECTOR = "0x696b0c1a" as const; const FN_INPUTS = [ { + type: "tuple", + name: "metadata", components: [ { - name: "name", type: "string", + name: "name", }, { - name: "description", type: "string", + name: "description", }, { - name: "imageURI", type: "string", + name: "imageURI", }, { - name: "animationURI", type: "string", + name: "animationURI", }, ], - name: "metadata", - type: "tuple", }, { - name: "id", type: "bytes32", + name: "id", }, ] as const; const FN_OUTPUTS = [] as const; @@ -154,23 +154,23 @@ export function setSharedMetadata( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.metadata, resolvedOptions.id] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/events/TokensMintedWithSignature.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/events/TokensMintedWithSignature.ts index ca29a0a1af8..9da306f14a9 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/events/TokensMintedWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/events/TokensMintedWithSignature.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMintedWithSignature" event. @@ -48,8 +48,8 @@ export function tokensMintedWithSignatureEvent( filters: TokensMintedWithSignatureEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, (address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, string uri, uint256 price, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, bytes32 uid) mintpayload)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/read/verify.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/read/verify.ts index 7fe7800d736..c1389c23da5 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/read/verify.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/read/verify.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verify" function. @@ -32,64 +32,64 @@ export type VerifyParams = { export const FN_SELECTOR = "0xde903774" as const; const FN_INPUTS = [ { + type: "tuple", + name: "payload", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint256", + name: "royaltyBps", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "uri", type: "string", + name: "uri", }, { - name: "price", type: "uint256", + name: "price", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "payload", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "success", type: "bool", + name: "success", }, { - name: "signer", type: "address", + name: "signer", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/write/mintWithSignature.ts index 25d1533f72c..d2d2e11439a 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -34,60 +34,60 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0x2c4510f8" as const; const FN_INPUTS = [ { + type: "tuple", + name: "payload", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint256", + name: "royaltyBps", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "uri", type: "string", + name: "uri", }, { - name: "price", type: "uint256", + name: "price", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "payload", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "tokenIdMinted", type: "uint256", + name: "tokenIdMinted", }, ] as const; @@ -189,23 +189,23 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.payload, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/events/TokensMintedWithSignature.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/events/TokensMintedWithSignature.ts index 6070f21cb48..e51025efeaf 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/events/TokensMintedWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/events/TokensMintedWithSignature.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMintedWithSignature" event. @@ -48,8 +48,8 @@ export function tokensMintedWithSignatureEvent( filters: TokensMintedWithSignatureEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, (address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, string uri, uint256 quantity, uint256 pricePerToken, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, bytes32 uid) mintRequest)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/read/verify.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/read/verify.ts index eea0742e752..271dd56a03a 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/read/verify.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/read/verify.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verify" function. @@ -33,68 +33,68 @@ export type VerifyParams = { export const FN_SELECTOR = "0x252e82e8" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint256", + name: "royaltyBps", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "uri", type: "string", + name: "uri", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "success", type: "bool", + name: "success", }, { - name: "signer", type: "address", + name: "signer", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/write/mintWithSignature.ts index d3a242538bf..43d69ee4691 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/ISignatureMintERC721_v2/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -35,64 +35,64 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0x439c7be5" as const; const FN_INPUTS = [ { + type: "tuple", + name: "payload", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint256", + name: "royaltyBps", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "uri", type: "string", + name: "uri", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "payload", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; @@ -194,23 +194,23 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.payload, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/RewardsClaimed.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/RewardsClaimed.ts index 88248c5ecbd..691150f4d6b 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/RewardsClaimed.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/RewardsClaimed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RewardsClaimed" event. @@ -34,8 +34,8 @@ export type RewardsClaimedEventFilters = Partial<{ */ export function rewardsClaimedEvent(filters: RewardsClaimedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RewardsClaimed(address indexed staker, uint256 rewardAmount)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensStaked.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensStaked.ts index 69c85b925fe..85cbbd5ce3f 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensStaked.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensStaked.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensStaked" event. @@ -40,8 +40,8 @@ export type TokensStakedEventFilters = Partial<{ */ export function tokensStakedEvent(filters: TokensStakedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensStaked(address indexed staker, uint256[] indexed tokenIds)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensWithdrawn.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensWithdrawn.ts index 398986435e3..0955ed53001 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensWithdrawn.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/events/TokensWithdrawn.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensWithdrawn" event. @@ -42,8 +42,8 @@ export function tokensWithdrawnEvent( filters: TokensWithdrawnEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensWithdrawn(address indexed staker, uint256[] indexed tokenIds)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/read/getStakeInfo.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/read/getStakeInfo.ts index 6865a02efdb..8cb89434077 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/read/getStakeInfo.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/read/getStakeInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getStakeInfo" function. @@ -16,18 +16,18 @@ export type GetStakeInfoParams = { export const FN_SELECTOR = "0xc3453153" as const; const FN_INPUTS = [ { - name: "staker", type: "address", + name: "staker", }, ] as const; const FN_OUTPUTS = [ { - name: "_tokensStaked", type: "uint256[]", + name: "_tokensStaked", }, { - name: "_rewards", type: "uint256", + name: "_rewards", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/claimRewards.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/claimRewards.ts index 5971444a1c1..c8304c9c6af 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/claimRewards.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/claimRewards.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/stake.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/stake.ts index af616913fd7..e15d31e6f1e 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/stake.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/stake.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "stake" function. @@ -21,8 +21,8 @@ export type StakeParams = WithOverrides<{ export const FN_SELECTOR = "0x0fbf0a93" as const; const FN_INPUTS = [ { - name: "tokenIds", type: "uint256[]", + name: "tokenIds", }, ] as const; const FN_OUTPUTS = [] as const; @@ -118,23 +118,23 @@ export function stake( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenIds] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/withdraw.ts b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/withdraw.ts index 49b00b8d192..3f20b599377 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/withdraw.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/IStaking721/write/withdraw.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdraw" function. @@ -21,8 +21,8 @@ export type WithdrawParams = WithOverrides<{ export const FN_SELECTOR = "0x983d95ce" as const; const FN_INPUTS = [ { - name: "tokenIds", type: "uint256[]", + name: "tokenIds", }, ] as const; const FN_OUTPUTS = [] as const; @@ -118,23 +118,23 @@ export function withdraw( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenIds] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.ts index b4e26aa7184..667cd89e059 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMinted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMinted" event. @@ -40,8 +40,8 @@ export type TokensMintedEventFilters = Partial<{ */ export function tokensMintedEvent(filters: TokensMintedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.ts index 38f41c7c98b..9b1685e557a 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/events/TokensMintedWithSignature.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensMintedWithSignature" event. @@ -48,8 +48,8 @@ export function tokensMintedWithSignatureEvent( filters: TokensMintedWithSignatureEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, (address to, address royaltyRecipient, uint256 royaltyBps, address primarySaleRecipient, uint256 quantity, uint256 pricePerToken, address currency, uint128 validityStartTimestamp, uint128 validityEndTimestamp, string uri) mintRequest)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.ts index 2bb30b6fa3b..abab41a1765 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/nextTokenIdToMint.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3b1475a7" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.ts index 8ead51593eb..0f6b2f9089d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.ts index 1088ee3775c..cdd424d3861 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/tokenURI.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenURI" function. @@ -16,8 +16,8 @@ export type TokenURIParams = { export const FN_SELECTOR = "0xc87b56dd" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.ts index d9344309eea..121dc3577cd 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/read/totalMinted.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa2309ff8" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/cancel.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/cancel.ts index 0c2e0f3e9ba..2ffb88f2541 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/cancel.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/cancel.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "cancel" function. @@ -18,8 +18,8 @@ export type CancelParams = WithOverrides<{ export const FN_SELECTOR = "0x40e58ee5" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function cancel( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/initialize.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/initialize.ts index ae9acd0a859..54ee1fb1625 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/initialize.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -51,44 +51,44 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xe1591634" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint128", + name: "_royaltyBps", }, { - name: "_platformFeeBps", type: "uint128", + name: "_platformFeeBps", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -224,19 +224,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -253,5 +242,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.ts index 9cc6dc7e5fe..266759ba60d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintTo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintTo" function. @@ -19,18 +19,18 @@ export type MintToParams = WithOverrides<{ export const FN_SELECTOR = "0x0075a317" as const; const FN_INPUTS = [ { - name: "_to", type: "address", + name: "_to", }, { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [ { - name: "tokenIdMinted", type: "uint256", + name: "tokenIdMinted", }, ] as const; @@ -128,23 +128,23 @@ export function mintTo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.to, resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.ts index 127443b9598..7a7692db51d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -34,60 +34,60 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0x91c5ee92" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_req", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint256", + name: "royaltyBps", }, { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uri", type: "string", + name: "uri", }, ], - name: "_req", - type: "tuple", }, { - name: "_signature", type: "bytes", + name: "_signature", }, ] as const; const FN_OUTPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; @@ -189,23 +189,23 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.req, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/revoke.ts b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/revoke.ts index b9e637a13fc..76f13dfcba5 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/revoke.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/LoyaltyCard/write/revoke.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "revoke" function. @@ -18,8 +18,8 @@ export type RevokeParams = WithOverrides<{ export const FN_SELECTOR = "0x20c5429b" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function revoke( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.ts index ce08d0e6a20..1c2e257586d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensUnwrapped.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensUnwrapped" event. @@ -48,8 +48,8 @@ export function tokensUnwrappedEvent( filters: TokensUnwrappedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokensUnwrapped(address indexed unwrapper, address indexed recipientOfWrappedContents, uint256 indexed tokenIdOfWrappedToken)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.ts index 6752b8171c0..476e907ad6d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/events/TokensWrapped.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokensWrapped" event. @@ -46,8 +46,8 @@ export type TokensWrappedEventFilters = Partial<{ */ export function tokensWrappedEvent(filters: TokensWrappedEventFilters = {}) { return prepareEvent({ - filters, signature: "event TokensWrapped(address indexed wrapper, address indexed recipientOfWrappedToken, uint256 indexed tokenIdOfWrappedToken, (address assetContract, uint8 tokenType, uint256 tokenId, uint256 amount)[] wrappedContents)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractType.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractType.ts index 3299d46f932..1ea0195f972 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractType.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractType.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcb2ef6f7" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractVersion.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractVersion.ts index d4d1cac88b2..c8d50c84091 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractVersion.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/contractVersion.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa0a8e460" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.ts index 0f0e7c0e59f..4b768cdca11 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/getWrappedContents.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getWrappedContents" function. @@ -16,32 +16,32 @@ export type GetWrappedContentsParams = { export const FN_SELECTOR = "0xd5576d26" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "contents", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "contents", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.ts index 2bb30b6fa3b..abab41a1765 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/nextTokenIdToMint.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3b1475a7" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.ts index 8ead51593eb..0f6b2f9089d 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceId", type: "bytes4", + name: "interfaceId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/tokenURI.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/tokenURI.ts index 1088ee3775c..cdd424d3861 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/tokenURI.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/read/tokenURI.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenURI" function. @@ -16,8 +16,8 @@ export type TokenURIParams = { export const FN_SELECTOR = "0xc87b56dd" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/initialize.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/initialize.ts index 705cfeb456e..1b88232e138 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/initialize.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -39,32 +39,32 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x754b8fe7" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint256", + name: "_royaltyBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -188,19 +188,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -214,5 +203,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/unwrap.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/unwrap.ts index e1bd6b38d57..2ea813d8f3f 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/unwrap.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/unwrap.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "unwrap" function. @@ -22,12 +22,12 @@ export type UnwrapParams = WithOverrides<{ export const FN_SELECTOR = "0x7647691d" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_recipient", type: "address", + name: "_recipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -126,23 +126,23 @@ export function unwrap( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.recipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/wrap.ts b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/wrap.ts index 78026fa445b..03582322e9c 100644 --- a/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/wrap.ts +++ b/packages/thirdweb/src/extensions/erc721/__generated__/Multiwrap/write/wrap.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "wrap" function. @@ -35,40 +35,40 @@ export type WrapParams = WithOverrides<{ export const FN_SELECTOR = "0x29e471dd" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "_tokensToWrap", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint256", + name: "amount", }, ], - name: "_tokensToWrap", - type: "tuple[]", }, { - name: "_uriForWrappedToken", type: "string", + name: "_uriForWrappedToken", }, { - name: "_recipient", type: "address", + name: "_recipient", }, ] as const; const FN_OUTPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; @@ -173,19 +173,8 @@ export function wrap( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -195,5 +184,16 @@ export function wrap( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7504/__generated__/IRouterState/read/getAllExtensions.ts b/packages/thirdweb/src/extensions/erc7504/__generated__/IRouterState/read/getAllExtensions.ts index e9d9edffc70..6c8ce5a86d9 100644 --- a/packages/thirdweb/src/extensions/erc7504/__generated__/IRouterState/read/getAllExtensions.ts +++ b/packages/thirdweb/src/extensions/erc7504/__generated__/IRouterState/read/getAllExtensions.ts @@ -1,49 +1,50 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x4a00cc48" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "allExtensions", components: [ { + type: "tuple", + name: "metadata", components: [ { - name: "name", type: "string", + name: "name", }, { - name: "metadataURI", type: "string", + name: "metadataURI", }, { - name: "implementation", type: "address", + name: "implementation", }, ], - name: "metadata", - type: "tuple", }, { + type: "tuple[]", + name: "functions", components: [ { - name: "functionSelector", type: "bytes4", + name: "functionSelector", }, { - name: "functionSignature", type: "string", + name: "functionSignature", }, ], - name: "functions", - type: "tuple[]", }, ], - name: "allExtensions", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/accountId.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/accountId.ts index 0cdc82fe213..c833872cbc4 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/accountId.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/accountId.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x9cfd7cff" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "accountImplementationId", type: "string", + name: "accountImplementationId", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isModuleInstalled.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isModuleInstalled.ts index 60ad0322483..7225170e831 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isModuleInstalled.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isModuleInstalled.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isModuleInstalled" function. @@ -24,16 +24,16 @@ export type IsModuleInstalledParams = { export const FN_SELECTOR = "0x112d3a7d" as const; const FN_INPUTS = [ { - name: "moduleTypeId", type: "uint256", + name: "moduleTypeId", }, { - name: "module", type: "address", + name: "module", }, { - name: "additionalContext", type: "bytes", + name: "additionalContext", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isValidSignature.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isValidSignature.ts index df322da3153..88b6b0b11aa 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isValidSignature.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isValidSignature.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isValidSignature" function. @@ -17,12 +17,12 @@ export type IsValidSignatureParams = { export const FN_SELECTOR = "0x1626ba7e" as const; const FN_INPUTS = [ { - name: "hash", type: "bytes32", + name: "hash", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsExecutionMode.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsExecutionMode.ts index 3d6a47da4a3..7778eae8bee 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsExecutionMode.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsExecutionMode.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsExecutionMode" function. @@ -19,8 +19,8 @@ export type SupportsExecutionModeParams = { export const FN_SELECTOR = "0xd03c7914" as const; const FN_INPUTS = [ { - name: "encodedMode", type: "bytes32", + name: "encodedMode", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsModule.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsModule.ts index ff29be0c985..b31d7ab4910 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsModule.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/supportsModule.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsModule" function. @@ -19,8 +19,8 @@ export type SupportsModuleParams = { export const FN_SELECTOR = "0xf2dc691d" as const; const FN_INPUTS = [ { - name: "moduleTypeId", type: "uint256", + name: "moduleTypeId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/execute.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/execute.ts index a45cd99822c..5a7c9b02cd4 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/execute.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/execute.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "execute" function. @@ -22,12 +22,12 @@ export type ExecuteParams = WithOverrides<{ export const FN_SELECTOR = "0xe9ae5c53" as const; const FN_INPUTS = [ { - name: "mode", type: "bytes32", + name: "mode", }, { - name: "executionCalldata", type: "bytes", + name: "executionCalldata", }, ] as const; const FN_OUTPUTS = [] as const; @@ -129,23 +129,23 @@ export function execute( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.mode, resolvedOptions.executionCalldata] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/executeFromExecutor.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/executeFromExecutor.ts index 2590e8ce64a..dcc7750443a 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/executeFromExecutor.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/executeFromExecutor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "executeFromExecutor" function. @@ -22,18 +22,18 @@ export type ExecuteFromExecutorParams = WithOverrides<{ export const FN_SELECTOR = "0xd691c964" as const; const FN_INPUTS = [ { - name: "mode", type: "bytes32", + name: "mode", }, { - name: "executionCalldata", type: "bytes", + name: "executionCalldata", }, ] as const; const FN_OUTPUTS = [ { - name: "returnData", type: "bytes[]", + name: "returnData", }, ] as const; @@ -138,23 +138,23 @@ export function executeFromExecutor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.mode, resolvedOptions.executionCalldata] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/installModule.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/installModule.ts index 822845b2145..9431c3d7dcf 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/installModule.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/installModule.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "installModule" function. @@ -23,16 +23,16 @@ export type InstallModuleParams = WithOverrides<{ export const FN_SELECTOR = "0x9517e29f" as const; const FN_INPUTS = [ { - name: "moduleTypeId", type: "uint256", + name: "moduleTypeId", }, { - name: "module", type: "address", + name: "module", }, { - name: "initData", type: "bytes", + name: "initData", }, ] as const; const FN_OUTPUTS = [] as const; @@ -140,19 +140,8 @@ export function installModule( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -162,5 +151,16 @@ export function installModule( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/uninstallModule.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/uninstallModule.ts index 1288636e295..5cf2425dcac 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/uninstallModule.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/write/uninstallModule.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "uninstallModule" function. @@ -26,16 +26,16 @@ export type UninstallModuleParams = WithOverrides<{ export const FN_SELECTOR = "0xa71763a8" as const; const FN_INPUTS = [ { - name: "moduleTypeId", type: "uint256", + name: "moduleTypeId", }, { - name: "module", type: "address", + name: "module", }, { - name: "deInitData", type: "bytes", + name: "deInitData", }, ] as const; const FN_OUTPUTS = [] as const; @@ -143,19 +143,8 @@ export function uninstallModule( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -165,5 +154,16 @@ export function uninstallModule( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/OwnershipTransferred.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/OwnershipTransferred.ts index a4e11bccd61..bd823de97a1 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/OwnershipTransferred.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/OwnershipTransferred.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "OwnershipTransferred" event. @@ -42,8 +42,8 @@ export function ownershipTransferredEvent( filters: OwnershipTransferredEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/Upgraded.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/Upgraded.ts index e3c49af0a2f..ee84303fd0b 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/Upgraded.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/events/Upgraded.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Upgraded" event. @@ -34,7 +34,7 @@ export type UpgradedEventFilters = Partial<{ */ export function upgradedEvent(filters: UpgradedEventFilters = {}) { return prepareEvent({ - filters, signature: "event Upgraded(address indexed implementation)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/accountImplementation.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/accountImplementation.ts index 5f54e325971..bbf45d7fb41 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/accountImplementation.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/accountImplementation.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x11464fbe" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/entrypoint.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/entrypoint.ts index 2125755adc1..f31566f4716 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/entrypoint.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/entrypoint.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa65d69d4" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/getAddress.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/getAddress.ts index b9633b280df..180f8da52fc 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/getAddress.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/getAddress.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAddress" function. @@ -17,18 +17,18 @@ export type GetAddressParams = { export const FN_SELECTOR = "0x8878ed33" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, { - name: "salt", type: "bytes", + name: "salt", }, ] as const; const FN_OUTPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/implementation.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/implementation.ts index 3da59c7f228..99a48c2f09d 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/implementation.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/implementation.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x5c60da1b" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "result", type: "address", + name: "result", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/owner.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/owner.ts index a9edc4b89a6..3323ac7ce15 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/owner.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/read/owner.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x8da5cb5b" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "result", type: "address", + name: "result", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/addStake.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/addStake.ts index 31435f0de4d..3c7faad0ce7 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/addStake.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/addStake.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "addStake" function. @@ -21,8 +21,8 @@ export type AddStakeParams = WithOverrides<{ export const FN_SELECTOR = "0x0396cb60" as const; const FN_INPUTS = [ { - name: "unstakeDelaySec", type: "uint32", + name: "unstakeDelaySec", }, ] as const; const FN_OUTPUTS = [] as const; @@ -118,23 +118,23 @@ export function addStake( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.unstakeDelaySec] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/createAccountWithModules.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/createAccountWithModules.ts index da584e4ee29..e499f3b0187 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/createAccountWithModules.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/createAccountWithModules.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createAccountWithModules" function. @@ -28,30 +28,30 @@ export type CreateAccountWithModulesParams = WithOverrides<{ export const FN_SELECTOR = "0x7c37d0dc" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, { - name: "salt", type: "bytes", + name: "salt", }, { + type: "tuple[]", + name: "modules", components: [ { - name: "moduleTypeId", type: "uint256", + name: "moduleTypeId", }, { - name: "module", type: "address", + name: "module", }, { - name: "initData", type: "bytes", + name: "initData", }, ], - name: "modules", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [ @@ -169,19 +169,8 @@ export function createAccountWithModules( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -191,5 +180,16 @@ export function createAccountWithModules( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/renounceOwnership.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/renounceOwnership.ts index 0fa112c28e3..5798a31905c 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/renounceOwnership.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/renounceOwnership.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/transferOwnership.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/transferOwnership.ts index ae9fadeeb32..21c03f6f32a 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/transferOwnership.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/transferOwnership.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transferOwnership" function. @@ -18,8 +18,8 @@ export type TransferOwnershipParams = WithOverrides<{ export const FN_SELECTOR = "0xf2fde38b" as const; const FN_INPUTS = [ { - name: "newOwner", type: "address", + name: "newOwner", }, ] as const; const FN_OUTPUTS = [] as const; @@ -119,23 +119,23 @@ export function transferOwnership( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newOwner] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/unlockStake.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/unlockStake.ts index b2443506421..c3601ab471b 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/unlockStake.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/unlockStake.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/upgradeTo.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/upgradeTo.ts index 69778356cbc..632ee9f2fce 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/upgradeTo.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/upgradeTo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "upgradeTo" function. @@ -21,8 +21,8 @@ export type UpgradeToParams = WithOverrides<{ export const FN_SELECTOR = "0x3659cfe6" as const; const FN_INPUTS = [ { - name: "newImplementation", type: "address", + name: "newImplementation", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function upgradeTo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newImplementation] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdraw.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdraw.ts index b9f2a3c4a34..4a20c5590f8 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdraw.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdraw.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdraw" function. @@ -20,16 +20,16 @@ export type WithdrawParams = WithOverrides<{ export const FN_SELECTOR = "0xd9caed12" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "token", type: "address", + name: "token", }, { - name: "amount", type: "uint256", + name: "amount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -135,19 +135,8 @@ export function withdraw( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function withdraw( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdrawStake.ts b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdrawStake.ts index 7eb496448d3..a8e5011d893 100644 --- a/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdrawStake.ts +++ b/packages/thirdweb/src/extensions/erc7579/__generated__/ModularAccountFactory/write/withdrawStake.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "withdrawStake" function. @@ -18,8 +18,8 @@ export type WithdrawStakeParams = WithOverrides<{ export const FN_SELECTOR = "0xc23a5cea" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function withdrawStake( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.to] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/Executed.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/Executed.ts index de30c93be7e..8d5f1a700d2 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/Executed.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/Executed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Executed" event. @@ -34,7 +34,7 @@ export type ExecutedEventFilters = Partial<{ */ export function executedEvent(filters: ExecutedEventFilters = {}) { return prepareEvent({ - filters, signature: "event Executed(address indexed to, uint256 value, bytes data)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/SessionCreated.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/SessionCreated.ts index 6851748f9d1..93310f4dc59 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/SessionCreated.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/events/SessionCreated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "SessionCreated" event. @@ -34,8 +34,8 @@ export type SessionCreatedEventFilters = Partial<{ */ export function sessionCreatedEvent(filters: SessionCreatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event SessionCreated(address indexed signer, (address signer, bool isWildcard, uint256 expiresAt, (address target, bytes4 selector, uint256 maxValuePerUse, (uint8 limitType, uint256 limit, uint256 period) valueLimit, (uint8 condition, uint64 index, bytes32 refValue, (uint8 limitType, uint256 limit, uint256 period) limit)[] constraints)[] callPolicies, (address target, uint256 maxValuePerUse, (uint8 limitType, uint256 limit, uint256 period) valueLimit)[] transferPolicies, bytes32 uid) sessionSpec)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/eip712Domain.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/eip712Domain.ts index 95be7b27e5a..a8020aabb12 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/eip712Domain.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/eip712Domain.ts @@ -1,39 +1,40 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x84b0196e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "fields", type: "bytes1", + name: "fields", }, { - name: "name", type: "string", + name: "name", }, { - name: "version", type: "string", + name: "version", }, { - name: "chainId", type: "uint256", + name: "chainId", }, { - name: "verifyingContract", type: "address", + name: "verifyingContract", }, { - name: "salt", type: "bytes32", + name: "salt", }, { - name: "extensions", type: "uint256[]", + name: "extensions", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getCallPoliciesForSigner.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getCallPoliciesForSigner.ts index e5680d5fe09..3566c481b00 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getCallPoliciesForSigner.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getCallPoliciesForSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getCallPoliciesForSigner" function. @@ -16,81 +16,81 @@ export type GetCallPoliciesForSignerParams = { export const FN_SELECTOR = "0x7103acbb" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "maxValuePerUse", type: "uint256", + name: "maxValuePerUse", }, { + type: "tuple", + name: "valueLimit", components: [ { - name: "limitType", type: "uint8", + name: "limitType", }, { - name: "limit", type: "uint256", + name: "limit", }, { - name: "period", type: "uint256", + name: "period", }, ], - name: "valueLimit", - type: "tuple", }, { + type: "tuple[]", + name: "constraints", components: [ { - name: "condition", type: "uint8", + name: "condition", }, { - name: "index", type: "uint64", + name: "index", }, { - name: "refValue", type: "bytes32", + name: "refValue", }, { + type: "tuple", + name: "limit", components: [ { - name: "limitType", type: "uint8", + name: "limitType", }, { - name: "limit", type: "uint256", + name: "limit", }, { - name: "period", type: "uint256", + name: "period", }, ], - name: "limit", - type: "tuple", }, ], - name: "constraints", - type: "tuple[]", }, ], - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionExpirationForSigner.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionExpirationForSigner.ts index de9198c6317..9c789a7cfff 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionExpirationForSigner.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionExpirationForSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getSessionExpirationForSigner" function. @@ -16,8 +16,8 @@ export type GetSessionExpirationForSignerParams = { export const FN_SELECTOR = "0xf0a83adf" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionStateForSigner.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionStateForSigner.ts index 190f7ace4ba..ea93606d2d6 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionStateForSigner.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getSessionStateForSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getSessionStateForSigner" function. @@ -16,81 +16,81 @@ export type GetSessionStateForSignerParams = { export const FN_SELECTOR = "0x74e25eb2" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { + type: "tuple[]", + name: "transferValue", components: [ { - name: "remaining", type: "uint256", + name: "remaining", }, { - name: "target", type: "address", + name: "target", }, { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "index", type: "uint256", + name: "index", }, ], - name: "transferValue", - type: "tuple[]", }, { + type: "tuple[]", + name: "callValue", components: [ { - name: "remaining", type: "uint256", + name: "remaining", }, { - name: "target", type: "address", + name: "target", }, { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "index", type: "uint256", + name: "index", }, ], - name: "callValue", - type: "tuple[]", }, { + type: "tuple[]", + name: "callParams", components: [ { - name: "remaining", type: "uint256", + name: "remaining", }, { - name: "target", type: "address", + name: "target", }, { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "index", type: "uint256", + name: "index", }, ], - name: "callParams", - type: "tuple[]", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getTransferPoliciesForSigner.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getTransferPoliciesForSigner.ts index e08786479ca..a1763951ba8 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getTransferPoliciesForSigner.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/getTransferPoliciesForSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getTransferPoliciesForSigner" function. @@ -16,41 +16,41 @@ export type GetTransferPoliciesForSignerParams = { export const FN_SELECTOR = "0xed6ed279" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "maxValuePerUse", type: "uint256", + name: "maxValuePerUse", }, { + type: "tuple", + name: "valueLimit", components: [ { - name: "limitType", type: "uint8", + name: "limitType", }, { - name: "limit", type: "uint256", + name: "limit", }, { - name: "period", type: "uint256", + name: "period", }, ], - name: "valueLimit", - type: "tuple", }, ], - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/isWildcardSigner.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/isWildcardSigner.ts index 880b985ffdd..3287eb5fbd0 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/isWildcardSigner.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/read/isWildcardSigner.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isWildcardSigner" function. @@ -16,8 +16,8 @@ export type IsWildcardSignerParams = { export const FN_SELECTOR = "0x16c258a7" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/createSessionWithSig.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/createSessionWithSig.ts index e4b50d9a004..f78b186f2cf 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/createSessionWithSig.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/createSessionWithSig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createSessionWithSig" function. @@ -81,134 +81,134 @@ export type CreateSessionWithSigParams = WithOverrides<{ export const FN_SELECTOR = "0xb5051648" as const; const FN_INPUTS = [ { + type: "tuple", + name: "sessionSpec", components: [ { - name: "signer", type: "address", + name: "signer", }, { - name: "isWildcard", type: "bool", + name: "isWildcard", }, { - name: "expiresAt", type: "uint256", + name: "expiresAt", }, { + type: "tuple[]", + name: "callPolicies", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "maxValuePerUse", type: "uint256", + name: "maxValuePerUse", }, { + type: "tuple", + name: "valueLimit", components: [ { - name: "limitType", type: "uint8", + name: "limitType", }, { - name: "limit", type: "uint256", + name: "limit", }, { - name: "period", type: "uint256", + name: "period", }, ], - name: "valueLimit", - type: "tuple", }, { + type: "tuple[]", + name: "constraints", components: [ { - name: "condition", type: "uint8", + name: "condition", }, { - name: "index", type: "uint64", + name: "index", }, { - name: "refValue", type: "bytes32", + name: "refValue", }, { + type: "tuple", + name: "limit", components: [ { - name: "limitType", type: "uint8", + name: "limitType", }, { - name: "limit", type: "uint256", + name: "limit", }, { - name: "period", type: "uint256", + name: "period", }, ], - name: "limit", - type: "tuple", }, ], - name: "constraints", - type: "tuple[]", }, ], - name: "callPolicies", - type: "tuple[]", }, { + type: "tuple[]", + name: "transferPolicies", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "maxValuePerUse", type: "uint256", + name: "maxValuePerUse", }, { + type: "tuple", + name: "valueLimit", components: [ { - name: "limitType", type: "uint8", + name: "limitType", }, { - name: "limit", type: "uint256", + name: "limit", }, { - name: "period", type: "uint256", + name: "period", }, ], - name: "valueLimit", - type: "tuple", }, ], - name: "transferPolicies", - type: "tuple[]", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "sessionSpec", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -316,23 +316,23 @@ export function createSessionWithSig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.sessionSpec, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/execute.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/execute.ts index e3e0a0ad402..81b1df259d6 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/execute.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/execute.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "execute" function. @@ -26,22 +26,22 @@ export type ExecuteParams = WithOverrides<{ export const FN_SELECTOR = "0x3f707e6b" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "value", type: "uint256", + name: "value", }, { - name: "data", type: "bytes", + name: "data", }, ], - name: "calls", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [] as const; @@ -137,23 +137,23 @@ export function execute( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.calls] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/executeWithSig.ts b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/executeWithSig.ts index b70e69ad6cd..808b3854139 100644 --- a/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/executeWithSig.ts +++ b/packages/thirdweb/src/extensions/erc7702/__generated__/MinimalAccount/write/executeWithSig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "executeWithSig" function. @@ -34,36 +34,36 @@ export type ExecuteWithSigParams = WithOverrides<{ export const FN_SELECTOR = "0xba61557d" as const; const FN_INPUTS = [ { + type: "tuple", + name: "wrappedCalls", components: [ { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "value", type: "uint256", + name: "value", }, { - name: "data", type: "bytes", + name: "data", }, ], - name: "calls", - type: "tuple[]", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "wrappedCalls", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -167,23 +167,23 @@ export function executeWithSig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.wrappedCalls, resolvedOptions.signature] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/idGateway.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/idGateway.ts index ab6c007dacf..31bb53a4e44 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/idGateway.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/idGateway.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x4b57a600" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/keyGateway.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/keyGateway.ts index b27d76ee6e0..7ead96b0c37 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/keyGateway.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/keyGateway.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x80334737" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/price.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/price.ts index 80f60351838..52d7a381538 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/price.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/read/price.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "price" function. @@ -19,8 +19,8 @@ export type PriceParams = { export const FN_SELECTOR = "0x26a49e37" as const; const FN_INPUTS = [ { - name: "extraStorage", type: "uint256", + name: "extraStorage", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/write/register.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/write/register.ts index 22f7b727c93..06c46b0a455 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/write/register.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IBundler/write/register.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "register" function. @@ -43,66 +43,66 @@ export type RegisterParams = WithOverrides<{ export const FN_SELECTOR = "0xa44c9ce7" as const; const FN_INPUTS = [ { + type: "tuple", + name: "registerParams", components: [ { - name: "to", type: "address", + name: "to", }, { - name: "recovery", type: "address", + name: "recovery", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ], - name: "registerParams", - type: "tuple", }, { + type: "tuple[]", + name: "signerParams", components: [ { - name: "keyType", type: "uint32", + name: "keyType", }, { - name: "key", type: "bytes", + name: "key", }, { - name: "metadataType", type: "uint8", + name: "metadataType", }, { - name: "metadata", type: "bytes", + name: "metadata", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ], - name: "signerParams", - type: "tuple[]", }, { - name: "extraStorage", type: "uint256", + name: "extraStorage", }, ] as const; const FN_OUTPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, ] as const; @@ -207,19 +207,8 @@ export function register( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -229,5 +218,16 @@ export function register( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/REGISTER_TYPEHASH.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/REGISTER_TYPEHASH.ts index 4a3345eef0f..2c959f33f59 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/REGISTER_TYPEHASH.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/REGISTER_TYPEHASH.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x6a5306a3" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/idRegistry.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/idRegistry.ts index 011085f6144..af26e126344 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/idRegistry.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/idRegistry.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x0aa13b8c" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/price.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/price.ts index 80f60351838..52d7a381538 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/price.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/price.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "price" function. @@ -19,8 +19,8 @@ export type PriceParams = { export const FN_SELECTOR = "0x26a49e37" as const; const FN_INPUTS = [ { - name: "extraStorage", type: "uint256", + name: "extraStorage", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/storageRegistry.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/storageRegistry.ts index 7a97f33ba5e..5bb15a70f8d 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/storageRegistry.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/read/storageRegistry.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x4ec77b45" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/register.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/register.ts index f0f2d76ae4a..9be06cdbe1e 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/register.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/register.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "register" function. @@ -22,22 +22,22 @@ export type RegisterParams = WithOverrides<{ export const FN_SELECTOR = "0x6d705ebb" as const; const FN_INPUTS = [ { - name: "recovery", type: "address", + name: "recovery", }, { - name: "extraStorage", type: "uint256", + name: "extraStorage", }, ] as const; const FN_OUTPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, { - name: "overpayment", type: "uint256", + name: "overpayment", }, ] as const; @@ -138,23 +138,23 @@ export function register( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.recovery, resolvedOptions.extraStorage] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/registerFor.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/registerFor.ts index 17e541df5d2..dfc90dfd636 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/registerFor.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdGateway/write/registerFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "registerFor" function. @@ -25,34 +25,34 @@ export type RegisterForParams = WithOverrides<{ export const FN_SELECTOR = "0xa0c7529c" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "recovery", type: "address", + name: "recovery", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, { - name: "extraStorage", type: "uint256", + name: "extraStorage", }, ] as const; const FN_OUTPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, { - name: "overpayment", type: "uint256", + name: "overpayment", }, ] as const; @@ -167,19 +167,8 @@ export function registerFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -191,5 +180,16 @@ export function registerFor( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/AdminReset.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/AdminReset.ts index 19cd2f4d448..514c3444a8e 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/AdminReset.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/AdminReset.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AdminReset" event. @@ -34,7 +34,7 @@ export type AdminResetEventFilters = Partial<{ */ export function adminResetEvent(filters: AdminResetEventFilters = {}) { return prepareEvent({ - filters, signature: "event AdminReset(uint256 indexed fid)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/ChangeRecoveryAddress.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/ChangeRecoveryAddress.ts index 29ab077be4e..655c8354855 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/ChangeRecoveryAddress.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/ChangeRecoveryAddress.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ChangeRecoveryAddress" event. @@ -42,8 +42,8 @@ export function changeRecoveryAddressEvent( filters: ChangeRecoveryAddressEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ChangeRecoveryAddress(uint256 indexed id, address indexed recovery)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Recover.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Recover.ts index c859416f5bf..a646e6f7252 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Recover.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Recover.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Recover" event. @@ -46,8 +46,8 @@ export type RecoverEventFilters = Partial<{ */ export function recoverEvent(filters: RecoverEventFilters = {}) { return prepareEvent({ - filters, signature: "event Recover(address indexed from, address indexed to, uint256 indexed id)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Register.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Register.ts index bbcd30cbe49..43d1195a0c1 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Register.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Register.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Register" event. @@ -40,8 +40,8 @@ export type RegisterEventFilters = Partial<{ */ export function registerEvent(filters: RegisterEventFilters = {}) { return prepareEvent({ - filters, signature: "event Register(address indexed to, uint256 indexed id, address recovery)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Transfer.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Transfer.ts index 7f232ba6a13..e5e708c2290 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Transfer.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/events/Transfer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Transfer" event. @@ -40,8 +40,8 @@ export type TransferEventFilters = Partial<{ */ export function transferEvent(filters: TransferEventFilters = {}) { return prepareEvent({ - filters, signature: "event Transfer(address indexed from, address indexed to, uint256 id)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/CHANGE_RECOVERY_ADDRESS_TYPEHASH.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/CHANGE_RECOVERY_ADDRESS_TYPEHASH.ts index 8cf023ced5f..e92335890f0 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/CHANGE_RECOVERY_ADDRESS_TYPEHASH.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/CHANGE_RECOVERY_ADDRESS_TYPEHASH.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xd5bac7f3" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH.ts index 16234140459..cd9b402fa7a 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xea2bbb83" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_TYPEHASH.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_TYPEHASH.ts index f968b97b123..cb54955823e 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_TYPEHASH.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/TRANSFER_TYPEHASH.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x00bf26f4" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/custodyOf.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/custodyOf.ts index 0ef60f6be42..dd5e0800b68 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/custodyOf.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/custodyOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "custodyOf" function. @@ -16,14 +16,14 @@ export type CustodyOfParams = { export const FN_SELECTOR = "0x65269e47" as const; const FN_INPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, ] as const; const FN_OUTPUTS = [ { - name: "owner", type: "address", + name: "owner", }, ] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/gatewayFrozen.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/gatewayFrozen.ts index b1633b0da23..60f0638f844 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/gatewayFrozen.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/gatewayFrozen.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x95e7549f" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idCounter.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idCounter.ts index 4670417928c..86c34619ada 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idCounter.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idCounter.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xeb08ab28" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idGateway.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idGateway.ts index ab6c007dacf..31bb53a4e44 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idGateway.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idGateway.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x4b57a600" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idOf.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idOf.ts index b7de6626faa..aa4fbda61f2 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idOf.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/idOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "idOf" function. @@ -16,14 +16,14 @@ export type IdOfParams = { export const FN_SELECTOR = "0xd94fe832" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, ] as const; const FN_OUTPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, ] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/recoveryOf.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/recoveryOf.ts index 17bc3551062..a790ee0cf7d 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/recoveryOf.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/recoveryOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "recoveryOf" function. @@ -16,14 +16,14 @@ export type RecoveryOfParams = { export const FN_SELECTOR = "0xfa1a1b25" as const; const FN_INPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, ] as const; const FN_OUTPUTS = [ { - name: "recovery", type: "address", + name: "recovery", }, ] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/verifyFidSignature.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/verifyFidSignature.ts index 271eadf920a..3b1472b3eab 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/verifyFidSignature.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/read/verifyFidSignature.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verifyFidSignature" function. @@ -22,26 +22,26 @@ export type VerifyFidSignatureParams = { export const FN_SELECTOR = "0x32faac70" as const; const FN_INPUTS = [ { - name: "custodyAddress", type: "address", + name: "custodyAddress", }, { - name: "fid", type: "uint256", + name: "fid", }, { - name: "digest", type: "bytes32", + name: "digest", }, { - name: "sig", type: "bytes", + name: "sig", }, ] as const; const FN_OUTPUTS = [ { - name: "isValid", type: "bool", + name: "isValid", }, ] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddress.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddress.ts index 330bccfb96f..bda18636266 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddress.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddress.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "changeRecoveryAddress" function. @@ -18,8 +18,8 @@ export type ChangeRecoveryAddressParams = WithOverrides<{ export const FN_SELECTOR = "0xf1f0b224" as const; const FN_INPUTS = [ { - name: "recovery", type: "address", + name: "recovery", }, ] as const; const FN_OUTPUTS = [] as const; @@ -121,23 +121,23 @@ export function changeRecoveryAddress( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.recovery] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddressFor.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddressFor.ts index 80e9629a194..60bc5bc9fc7 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddressFor.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/changeRecoveryAddressFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "changeRecoveryAddressFor" function. @@ -21,20 +21,20 @@ export type ChangeRecoveryAddressForParams = WithOverrides<{ export const FN_SELECTOR = "0x9cbef8dc" as const; const FN_INPUTS = [ { - name: "owner", type: "address", + name: "owner", }, { - name: "recovery", type: "address", + name: "recovery", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -152,19 +152,8 @@ export function changeRecoveryAddressFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -175,5 +164,16 @@ export function changeRecoveryAddressFor( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recover.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recover.ts index a0a9b3368f5..8831467efb6 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recover.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recover.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "recover" function. @@ -21,20 +21,20 @@ export type RecoverParams = WithOverrides<{ export const FN_SELECTOR = "0x2a42ede3" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "to", type: "address", + name: "to", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -144,19 +144,8 @@ export function recover( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -167,5 +156,16 @@ export function recover( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recoverFor.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recoverFor.ts index 93482dacc65..af489197a44 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recoverFor.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/recoverFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "recoverFor" function. @@ -32,28 +32,28 @@ export type RecoverForParams = WithOverrides<{ export const FN_SELECTOR = "0xba656434" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "to", type: "address", + name: "to", }, { - name: "recoveryDeadline", type: "uint256", + name: "recoveryDeadline", }, { - name: "recoverySig", type: "bytes", + name: "recoverySig", }, { - name: "toDeadline", type: "uint256", + name: "toDeadline", }, { - name: "toSig", type: "bytes", + name: "toSig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -173,19 +173,8 @@ export function recoverFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -198,5 +187,16 @@ export function recoverFor( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transfer.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transfer.ts index e910082125e..326c6c3ab43 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transfer.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transfer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transfer" function. @@ -20,16 +20,16 @@ export type TransferParams = WithOverrides<{ export const FN_SELECTOR = "0xbe45fd62" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -135,19 +135,8 @@ export function transfer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function transfer( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecovery.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecovery.ts index 6b19a04a8f8..2bbdcece210 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecovery.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecovery.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transferAndChangeRecovery" function. @@ -21,20 +21,20 @@ export type TransferAndChangeRecoveryParams = WithOverrides<{ export const FN_SELECTOR = "0x3ab8465d" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "recovery", type: "address", + name: "recovery", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -152,19 +152,8 @@ export function transferAndChangeRecovery( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -175,5 +164,16 @@ export function transferAndChangeRecovery( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecoveryFor.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecoveryFor.ts index e7626ce8d2d..f254cef9caf 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecoveryFor.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferAndChangeRecoveryFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transferAndChangeRecoveryFor" function. @@ -30,32 +30,32 @@ export type TransferAndChangeRecoveryForParams = WithOverrides<{ export const FN_SELECTOR = "0x4c5cbb34" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "to", type: "address", + name: "to", }, { - name: "recovery", type: "address", + name: "recovery", }, { - name: "fromDeadline", type: "uint256", + name: "fromDeadline", }, { - name: "fromSig", type: "bytes", + name: "fromSig", }, { - name: "toDeadline", type: "uint256", + name: "toDeadline", }, { - name: "toSig", type: "bytes", + name: "toSig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -185,19 +185,8 @@ export function transferAndChangeRecoveryFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -211,5 +200,16 @@ export function transferAndChangeRecoveryFor( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferFor.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferFor.ts index adfb3d6d281..d4499dad613 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferFor.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IIdRegistry/write/transferFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transferFor" function. @@ -29,28 +29,28 @@ export type TransferForParams = WithOverrides<{ export const FN_SELECTOR = "0x16f72842" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "to", type: "address", + name: "to", }, { - name: "fromDeadline", type: "uint256", + name: "fromDeadline", }, { - name: "fromSig", type: "bytes", + name: "fromSig", }, { - name: "toDeadline", type: "uint256", + name: "toDeadline", }, { - name: "toSig", type: "bytes", + name: "toSig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -170,19 +170,8 @@ export function transferFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -195,5 +184,16 @@ export function transferFor( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/ADD_TYPEHASH.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/ADD_TYPEHASH.ts index 978192092e2..c4ac42ba8be 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/ADD_TYPEHASH.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/ADD_TYPEHASH.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xab583c1b" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/keyRegistry.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/keyRegistry.ts index e9d4f945ce6..32289cc6879 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/keyRegistry.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/keyRegistry.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x086b5198" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/nonces.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/nonces.ts index 2d4370a57bd..57aad7f4608 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/nonces.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/read/nonces.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "nonces" function. @@ -16,8 +16,8 @@ export type NoncesParams = { export const FN_SELECTOR = "0x7ecebe00" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/add.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/add.ts index 2693fa21f00..2e72ed2db94 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/add.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/add.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "add" function. @@ -24,20 +24,20 @@ export type AddParams = WithOverrides<{ export const FN_SELECTOR = "0x22b1a414" as const; const FN_INPUTS = [ { - name: "keyType", type: "uint32", + name: "keyType", }, { - name: "key", type: "bytes", + name: "key", }, { - name: "metadataType", type: "uint8", + name: "metadataType", }, { - name: "metadata", type: "bytes", + name: "metadata", }, ] as const; const FN_OUTPUTS = [] as const; @@ -147,19 +147,8 @@ export function add( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -170,5 +159,16 @@ export function add( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/addFor.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/addFor.ts index 36d8b42a717..ab6001559a8 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/addFor.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyGateway/write/addFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "addFor" function. @@ -27,32 +27,32 @@ export type AddForParams = WithOverrides<{ export const FN_SELECTOR = "0xa005d3d2" as const; const FN_INPUTS = [ { - name: "fidOwner", type: "address", + name: "fidOwner", }, { - name: "keyType", type: "uint32", + name: "keyType", }, { - name: "key", type: "bytes", + name: "key", }, { - name: "metadataType", type: "uint8", + name: "metadataType", }, { - name: "metadata", type: "bytes", + name: "metadata", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -174,19 +174,8 @@ export function addFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -200,5 +189,16 @@ export function addFor( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Add.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Add.ts index aca8ff4c464..82c9fe8a6e9 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Add.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Add.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Add" event. @@ -46,8 +46,8 @@ export type AddEventFilters = Partial<{ */ export function addEvent(filters: AddEventFilters = {}) { return prepareEvent({ - filters, signature: "event Add(uint256 indexed fid, uint32 indexed keyType, bytes indexed key, bytes keyBytes, uint8 metadataType, bytes metadata)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/AdminReset.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/AdminReset.ts index d058ba543ac..4ddf953a99a 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/AdminReset.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/AdminReset.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AdminReset" event. @@ -40,8 +40,8 @@ export type AdminResetEventFilters = Partial<{ */ export function adminResetEvent(filters: AdminResetEventFilters = {}) { return prepareEvent({ - filters, signature: "event AdminReset(uint256 indexed fid, bytes indexed key, bytes keyBytes)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Remove.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Remove.ts index 2cbb8f5e029..76876634bc2 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Remove.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/events/Remove.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Remove" event. @@ -40,8 +40,8 @@ export type RemoveEventFilters = Partial<{ */ export function removeEvent(filters: RemoveEventFilters = {}) { return prepareEvent({ - filters, signature: "event Remove(uint256 indexed fid, bytes indexed key, bytes keyBytes)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/REMOVE_TYPEHASH.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/REMOVE_TYPEHASH.ts index ff5dd13852a..c3ce52a2acc 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/REMOVE_TYPEHASH.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/REMOVE_TYPEHASH.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xb5775561" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/gatewayFrozen.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/gatewayFrozen.ts index b1633b0da23..60f0638f844 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/gatewayFrozen.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/gatewayFrozen.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x95e7549f" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/idRegistry.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/idRegistry.ts index 011085f6144..af26e126344 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/idRegistry.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/idRegistry.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x0aa13b8c" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyAt.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyAt.ts index 08add3ea42d..c603ca366d6 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyAt.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyAt.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "keyAt" function. @@ -18,16 +18,16 @@ export type KeyAtParams = { export const FN_SELECTOR = "0x0ea9442c" as const; const FN_INPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, { - name: "state", type: "uint8", + name: "state", }, { - name: "index", type: "uint256", + name: "index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyDataOf.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyDataOf.ts index 7466ff56320..3ec2a78a3f8 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyDataOf.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyDataOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "keyDataOf" function. @@ -17,12 +17,12 @@ export type KeyDataOfParams = { export const FN_SELECTOR = "0xac34cc5a" as const; const FN_INPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, { - name: "key", type: "bytes", + name: "key", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyGateway.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyGateway.ts index b27d76ee6e0..7ead96b0c37 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyGateway.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keyGateway.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x80334737" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keysOf.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keysOf.ts index 0a933d04649..47e7e10c438 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keysOf.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/keysOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "keysOf" function. @@ -17,12 +17,12 @@ export type KeysOfParams = { export const FN_SELECTOR = "0x1f64222f" as const; const FN_INPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, { - name: "state", type: "uint8", + name: "state", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/maxKeysPerFid.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/maxKeysPerFid.ts index 2ba35c2da2e..fe3c07d5561 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/maxKeysPerFid.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/maxKeysPerFid.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe33acf38" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/totalKeys.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/totalKeys.ts index 9a240bd9d14..70f25124341 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/totalKeys.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/read/totalKeys.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "totalKeys" function. @@ -17,12 +17,12 @@ export type TotalKeysParams = { export const FN_SELECTOR = "0x6840b75e" as const; const FN_INPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, { - name: "state", type: "uint8", + name: "state", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/remove.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/remove.ts index 505b8038435..96d8096c9d7 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/remove.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/remove.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "remove" function. @@ -18,8 +18,8 @@ export type RemoveParams = WithOverrides<{ export const FN_SELECTOR = "0x58edef4c" as const; const FN_INPUTS = [ { - name: "key", type: "bytes", + name: "key", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function remove( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.key] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/removeFor.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/removeFor.ts index ea1c8ca3925..9f9ca5ec955 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/removeFor.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IKeyRegistry/write/removeFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "removeFor" function. @@ -21,20 +21,20 @@ export type RemoveForParams = WithOverrides<{ export const FN_SELECTOR = "0x787bd966" as const; const FN_INPUTS = [ { - name: "fidOwner", type: "address", + name: "fidOwner", }, { - name: "key", type: "bytes", + name: "key", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "sig", type: "bytes", + name: "sig", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,19 +146,8 @@ export function removeFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -169,5 +158,16 @@ export function removeFor( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/deprecationTimestamp.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/deprecationTimestamp.ts index a14b1157781..2804abcbb62 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/deprecationTimestamp.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/deprecationTimestamp.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x2c39d670" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/maxUnits.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/maxUnits.ts index 6b44251b8fd..95f61c0b3b5 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/maxUnits.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/maxUnits.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x06517a29" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/price.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/price.ts index 8505431f921..b269ae251b3 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/price.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/price.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "price" function. @@ -16,8 +16,8 @@ export type PriceParams = { export const FN_SELECTOR = "0x26a49e37" as const; const FN_INPUTS = [ { - name: "units", type: "uint256", + name: "units", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/rentedUnits.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/rentedUnits.ts index 467003b92d2..251d0af30af 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/rentedUnits.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/rentedUnits.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x2751c4fd" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/unitPrice.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/unitPrice.ts index cb8970c72f0..0ea65e49702 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/unitPrice.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/unitPrice.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe73faa2d" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/usdUnitPrice.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/usdUnitPrice.ts index 6d9acff24e6..051a7d5075d 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/usdUnitPrice.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/read/usdUnitPrice.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x40df0ba0" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/batchRent.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/batchRent.ts index 62dc2021742..7fe28d59ed6 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/batchRent.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/batchRent.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "batchRent" function. @@ -19,12 +19,12 @@ export type BatchRentParams = WithOverrides<{ export const FN_SELECTOR = "0xa82c356e" as const; const FN_INPUTS = [ { - name: "fids", type: "uint256[]", + name: "fids", }, { - name: "units", type: "uint256[]", + name: "units", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function batchRent( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.fids, resolvedOptions.units] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/rent.ts b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/rent.ts index 025e4f80b37..83175b73a06 100644 --- a/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/rent.ts +++ b/packages/thirdweb/src/extensions/farcaster/__generated__/IStorageRegistry/write/rent.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "rent" function. @@ -19,18 +19,18 @@ export type RentParams = WithOverrides<{ export const FN_SELECTOR = "0x783a112b" as const; const FN_INPUTS = [ { - name: "fid", type: "uint256", + name: "fid", }, { - name: "units", type: "uint256", + name: "units", }, ] as const; const FN_OUTPUTS = [ { - name: "overpayment", type: "uint256", + name: "overpayment", }, ] as const; @@ -128,23 +128,23 @@ export function rent( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.fid, resolvedOptions.units] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowData.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowData.ts index a3f4b147599..7727e542752 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowData.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowData.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getFollowData" function. @@ -19,31 +19,31 @@ export type GetFollowDataParams = { export const FN_SELECTOR = "0xd6cbec5d" as const; const FN_INPUTS = [ { - name: "followTokenId", type: "uint256", + name: "followTokenId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "followerProfileId", type: "uint160", + name: "followerProfileId", }, { - name: "originalFollowTimestamp", type: "uint48", + name: "originalFollowTimestamp", }, { - name: "followTimestamp", type: "uint48", + name: "followTimestamp", }, { - name: "profileIdAllowedToRecover", type: "uint256", + name: "profileIdAllowedToRecover", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTimestamp.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTimestamp.ts index 658742012bc..790321c4822 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTimestamp.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTimestamp.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getFollowTimestamp" function. @@ -19,8 +19,8 @@ export type GetFollowTimestampParams = { export const FN_SELECTOR = "0x3543a277" as const; const FN_INPUTS = [ { - name: "followTokenId", type: "uint256", + name: "followTokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTokenId.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTokenId.ts index 4f7435a95c8..8ad5fa2669a 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTokenId.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowTokenId.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getFollowTokenId" function. @@ -19,8 +19,8 @@ export type GetFollowTokenIdParams = { export const FN_SELECTOR = "0x11c763d6" as const; const FN_INPUTS = [ { - name: "followerProfileId", type: "uint256", + name: "followerProfileId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerCount.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerCount.ts index b77f53ea762..32715c1467b 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerCount.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerCount.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x7829ae4a" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerProfileId.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerProfileId.ts index 8cf23e11f65..9d41e05d6ec 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerProfileId.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getFollowerProfileId.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getFollowerProfileId" function. @@ -19,8 +19,8 @@ export type GetFollowerProfileIdParams = { export const FN_SELECTOR = "0x886a65c3" as const; const FN_INPUTS = [ { - name: "followTokenId", type: "uint256", + name: "followTokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getOriginalFollowTimestamp.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getOriginalFollowTimestamp.ts index c82404bae68..5eb6814b734 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getOriginalFollowTimestamp.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getOriginalFollowTimestamp.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getOriginalFollowTimestamp" function. @@ -19,8 +19,8 @@ export type GetOriginalFollowTimestampParams = { export const FN_SELECTOR = "0xd1b34934" as const; const FN_INPUTS = [ { - name: "followTokenId", type: "uint256", + name: "followTokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getProfileIdAllowedToRecover.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getProfileIdAllowedToRecover.ts index 2942f9bf24e..101623902a7 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getProfileIdAllowedToRecover.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/getProfileIdAllowedToRecover.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getProfileIdAllowedToRecover" function. @@ -19,8 +19,8 @@ export type GetProfileIdAllowedToRecoverParams = { export const FN_SELECTOR = "0x2af1544f" as const; const FN_INPUTS = [ { - name: "followTokenId", type: "uint256", + name: "followTokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/isFollowing.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/isFollowing.ts index fecddef35fa..6856b518944 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/isFollowing.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/isFollowing.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isFollowing" function. @@ -19,8 +19,8 @@ export type IsFollowingParams = { export const FN_SELECTOR = "0x4d71688d" as const; const FN_INPUTS = [ { - name: "followerProfileId", type: "uint256", + name: "followerProfileId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/mintTimestampOf.ts b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/mintTimestampOf.ts index 75308c367f1..1631c257613 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/mintTimestampOf.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/FollowNFT/read/mintTimestampOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintTimestampOf" function. @@ -16,8 +16,8 @@ export type MintTimestampOfParams = { export const FN_SELECTOR = "0x50ddf35c" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandle.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandle.ts index d2b50d02fd7..b30d2e0f539 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandle.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandle.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getHandle" function. @@ -16,8 +16,8 @@ export type GetHandleParams = { export const FN_SELECTOR = "0xec81d194" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandleTokenURIContract.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandleTokenURIContract.ts index eac910c2726..de298f22a2d 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandleTokenURIContract.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getHandleTokenURIContract.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x35eb3cb9" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getLocalName.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getLocalName.ts index d38af7a477c..099379d9c7a 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getLocalName.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getLocalName.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getLocalName" function. @@ -16,8 +16,8 @@ export type GetLocalNameParams = { export const FN_SELECTOR = "0x4985e504" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getTokenId.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getTokenId.ts index 11639e363d1..e2e95574a6d 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getTokenId.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHandle/read/getTokenId.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getTokenId" function. @@ -16,8 +16,8 @@ export type GetTokenIdParams = { export const FN_SELECTOR = "0x1e7663bc" as const; const FN_INPUTS = [ { - name: "localName", type: "string", + name: "localName", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/exists.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/exists.ts index d510979c856..cc5518032e3 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/exists.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/exists.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "exists" function. @@ -16,8 +16,8 @@ export type ExistsParams = { export const FN_SELECTOR = "0x4f558e79" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getContentURI.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getContentURI.ts index 91ae1a9deaa..114e9c70f25 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getContentURI.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getContentURI.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getContentURI" function. @@ -20,12 +20,12 @@ export type GetContentURIParams = { export const FN_SELECTOR = "0xb5a31496" as const; const FN_INPUTS = [ { - name: "profileId", type: "uint256", + name: "profileId", }, { - name: "pubId", type: "uint256", + name: "pubId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfile.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfile.ts index b2edcfdec8b..849132cce2d 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfile.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfile.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getProfile" function. @@ -19,43 +19,43 @@ export type GetProfileParams = { export const FN_SELECTOR = "0xf08f4f64" as const; const FN_INPUTS = [ { - name: "profileId", type: "uint256", + name: "profileId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "pubCount", type: "uint256", + name: "pubCount", }, { - name: "followModule", type: "address", + name: "followModule", }, { - name: "followNFT", type: "address", + name: "followNFT", }, { - name: "__DEPRECATED__handle", type: "string", + name: "__DEPRECATED__handle", }, { - name: "__DEPRECATED__imageURI", type: "string", + name: "__DEPRECATED__imageURI", }, { - name: "__DEPRECATED__followNFTURI", type: "string", + name: "__DEPRECATED__followNFTURI", }, { - name: "metadataURI", type: "string", + name: "metadataURI", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfileIdByHandleHash.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfileIdByHandleHash.ts index 2e009569ebd..378495f5b5e 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfileIdByHandleHash.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getProfileIdByHandleHash.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getProfileIdByHandleHash" function. @@ -19,8 +19,8 @@ export type GetProfileIdByHandleHashParams = { export const FN_SELECTOR = "0x19e14070" as const; const FN_INPUTS = [ { - name: "handleHash", type: "bytes32", + name: "handleHash", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getPublication.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getPublication.ts index ba8160ed54d..940c42b7539 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getPublication.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/getPublication.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPublication" function. @@ -20,55 +20,55 @@ export type GetPublicationParams = { export const FN_SELECTOR = "0x7385ebc9" as const; const FN_INPUTS = [ { - name: "profileId", type: "uint256", + name: "profileId", }, { - name: "pubId", type: "uint256", + name: "pubId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "pointedProfileId", type: "uint256", + name: "pointedProfileId", }, { - name: "pointedPubId", type: "uint256", + name: "pointedPubId", }, { - name: "contentURI", type: "string", + name: "contentURI", }, { - name: "referenceModule", type: "address", + name: "referenceModule", }, { - name: "__DEPRECATED__collectModule", type: "address", + name: "__DEPRECATED__collectModule", }, { - name: "__DEPRECATED__collectNFT", type: "address", + name: "__DEPRECATED__collectNFT", }, { - name: "pubType", type: "uint8", + name: "pubType", }, { - name: "rootProfileId", type: "uint256", + name: "rootProfileId", }, { - name: "rootPubId", type: "uint256", + name: "rootPubId", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/mintTimestampOf.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/mintTimestampOf.ts index 75308c367f1..1631c257613 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/mintTimestampOf.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/mintTimestampOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintTimestampOf" function. @@ -16,8 +16,8 @@ export type MintTimestampOfParams = { export const FN_SELECTOR = "0x50ddf35c" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/nonces.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/nonces.ts index d2a646311e4..87a92d9f86e 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/nonces.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/nonces.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "nonces" function. @@ -16,8 +16,8 @@ export type NoncesParams = { export const FN_SELECTOR = "0x7ecebe00" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/tokenDataOf.ts b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/tokenDataOf.ts index 0bb4f9c14c9..ce9edc4470c 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/tokenDataOf.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/LensHub/read/tokenDataOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tokenDataOf" function. @@ -16,23 +16,23 @@ export type TokenDataOfParams = { export const FN_SELECTOR = "0xc0da9bcd" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "owner", type: "address", + name: "owner", }, { - name: "mintTimestamp", type: "uint96", + name: "mintTimestamp", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/getModuleTypes.ts b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/getModuleTypes.ts index a5c8d475339..3e5b2b4e859 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/getModuleTypes.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/getModuleTypes.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getModuleTypes" function. @@ -19,8 +19,8 @@ export type GetModuleTypesParams = { export const FN_SELECTOR = "0xc5dcd896" as const; const FN_INPUTS = [ { - name: "moduleAddress", type: "address", + name: "moduleAddress", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isErc20CurrencyRegistered.ts b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isErc20CurrencyRegistered.ts index 54b6845605c..65cd261d708 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isErc20CurrencyRegistered.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isErc20CurrencyRegistered.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isErc20CurrencyRegistered" function. @@ -19,8 +19,8 @@ export type IsErc20CurrencyRegisteredParams = { export const FN_SELECTOR = "0xf21b24d7" as const; const FN_INPUTS = [ { - name: "currencyAddress", type: "address", + name: "currencyAddress", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegistered.ts b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegistered.ts index 8fa808d018d..0676878e575 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegistered.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegistered.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isModuleRegistered" function. @@ -19,8 +19,8 @@ export type IsModuleRegisteredParams = { export const FN_SELECTOR = "0x1c5ebe2f" as const; const FN_INPUTS = [ { - name: "moduleAddress", type: "address", + name: "moduleAddress", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegisteredAs.ts b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegisteredAs.ts index 82708a7fd9e..6c94f98c632 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegisteredAs.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/ModuleRegistry/read/isModuleRegisteredAs.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isModuleRegisteredAs" function. @@ -23,12 +23,12 @@ export type IsModuleRegisteredAsParams = { export const FN_SELECTOR = "0xc2b62fdd" as const; const FN_INPUTS = [ { - name: "moduleAddress", type: "address", + name: "moduleAddress", }, { - name: "moduleType", type: "uint256", + name: "moduleType", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/getDefaultHandle.ts b/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/getDefaultHandle.ts index 9b4eb1a45de..c7a8d1aaa1b 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/getDefaultHandle.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/getDefaultHandle.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getDefaultHandle" function. @@ -19,8 +19,8 @@ export type GetDefaultHandleParams = { export const FN_SELECTOR = "0xe524488d" as const; const FN_INPUTS = [ { - name: "profileId", type: "uint256", + name: "profileId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/nonces.ts b/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/nonces.ts index d208bdb8586..2137f95a805 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/nonces.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/nonces.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "nonces" function. @@ -16,14 +16,14 @@ export type NoncesParams = { export const FN_SELECTOR = "0x7ecebe00" as const; const FN_INPUTS = [ { - name: "signer", type: "address", + name: "signer", }, ] as const; const FN_OUTPUTS = [ { - name: "nonce", type: "uint256", + name: "nonce", }, ] as const; diff --git a/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/resolve.ts b/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/resolve.ts index a3169c977c5..3c9809bd374 100644 --- a/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/resolve.ts +++ b/packages/thirdweb/src/extensions/lens/__generated__/TokenHandleRegistry/read/resolve.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "resolve" function. @@ -16,8 +16,8 @@ export type ResolveParams = { export const FN_SELECTOR = "0x4f896d4f" as const; const FN_INPUTS = [ { - name: "handleId", type: "uint256", + name: "handleId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/BuyerApprovedForListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/BuyerApprovedForListing.ts index 50ae329f61e..3bfc6a92603 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/BuyerApprovedForListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/BuyerApprovedForListing.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "BuyerApprovedForListing" event. @@ -42,8 +42,8 @@ export function buyerApprovedForListingEvent( filters: BuyerApprovedForListingEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event BuyerApprovedForListing(uint256 indexed listingId, address indexed buyer, bool approved)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CancelledListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CancelledListing.ts index 754fc8b8bec..46d14a1b078 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CancelledListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CancelledListing.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "CancelledListing" event. @@ -42,8 +42,8 @@ export function cancelledListingEvent( filters: CancelledListingEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event CancelledListing(address indexed listingCreator, uint256 indexed listingId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CurrencyApprovedForListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CurrencyApprovedForListing.ts index dbafa7ec768..127a498ddaf 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CurrencyApprovedForListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/CurrencyApprovedForListing.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "CurrencyApprovedForListing" event. @@ -42,8 +42,8 @@ export function currencyApprovedForListingEvent( filters: CurrencyApprovedForListingEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event CurrencyApprovedForListing(uint256 indexed listingId, address indexed currency, uint256 pricePerToken)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewListing.ts index f9739d155ee..23f46addfec 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewListing.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewListing" event. @@ -46,8 +46,8 @@ export type NewListingEventFilters = Partial<{ */ export function newListingEvent(filters: NewListingEventFilters = {}) { return prepareEvent({ - filters, signature: "event NewListing(address indexed listingCreator, uint256 indexed listingId, address indexed assetContract, (uint256 listingId, uint256 tokenId, uint256 quantity, uint256 pricePerToken, uint128 startTimestamp, uint128 endTimestamp, address listingCreator, address assetContract, address currency, uint8 tokenType, uint8 status, bool reserved) listing)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewSale.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewSale.ts index 012105533c8..4ea1ff93b92 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewSale.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/NewSale.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewSale" event. @@ -46,8 +46,8 @@ export type NewSaleEventFilters = Partial<{ */ export function newSaleEvent(filters: NewSaleEventFilters = {}) { return prepareEvent({ - filters, signature: "event NewSale(address indexed listingCreator, uint256 indexed listingId, address indexed assetContract, uint256 tokenId, address buyer, uint256 quantityBought, uint256 totalPricePaid)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/UpdatedListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/UpdatedListing.ts index 277774c796e..f33e4de028d 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/UpdatedListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/events/UpdatedListing.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "UpdatedListing" event. @@ -46,8 +46,8 @@ export type UpdatedListingEventFilters = Partial<{ */ export function updatedListingEvent(filters: UpdatedListingEventFilters = {}) { return prepareEvent({ - filters, signature: "event UpdatedListing(address indexed listingCreator, uint256 indexed listingId, address indexed assetContract, (uint256 listingId, uint256 tokenId, uint256 quantity, uint256 pricePerToken, uint128 startTimestamp, uint128 endTimestamp, address listingCreator, address assetContract, address currency, uint8 tokenType, uint8 status, bool reserved) listing)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/currencyPriceForListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/currencyPriceForListing.ts index ee737722047..e4db3be77d7 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/currencyPriceForListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/currencyPriceForListing.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "currencyPriceForListing" function. @@ -20,12 +20,12 @@ export type CurrencyPriceForListingParams = { export const FN_SELECTOR = "0xfb14079d" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_currency", type: "address", + name: "_currency", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllListings.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllListings.ts index 86a7393c146..734378136b7 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllListings.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllListings.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAllListings" function. @@ -17,68 +17,68 @@ export type GetAllListingsParams = { export const FN_SELECTOR = "0xc5275fb0" as const; const FN_INPUTS = [ { - name: "_startId", type: "uint256", + name: "_startId", }, { - name: "_endId", type: "uint256", + name: "_endId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "listings", components: [ { - name: "listingId", type: "uint256", + name: "listingId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, { - name: "listingCreator", type: "address", + name: "listingCreator", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, { - name: "reserved", type: "bool", + name: "reserved", }, ], - name: "listings", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllValidListings.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllValidListings.ts index 922ad75762b..2b829550285 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllValidListings.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getAllValidListings.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAllValidListings" function. @@ -17,68 +17,68 @@ export type GetAllValidListingsParams = { export const FN_SELECTOR = "0x31654b4d" as const; const FN_INPUTS = [ { - name: "_startId", type: "uint256", + name: "_startId", }, { - name: "_endId", type: "uint256", + name: "_endId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "listings", components: [ { - name: "listingId", type: "uint256", + name: "listingId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, { - name: "listingCreator", type: "address", + name: "listingCreator", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, { - name: "reserved", type: "bool", + name: "reserved", }, ], - name: "listings", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getListing.ts index b40e9af13c2..3002d389ef2 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/getListing.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getListing" function. @@ -19,64 +19,64 @@ export type GetListingParams = { export const FN_SELECTOR = "0x107a274a" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "listing", components: [ { - name: "listingId", type: "uint256", + name: "listingId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, { - name: "listingCreator", type: "address", + name: "listingCreator", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, { - name: "reserved", type: "bool", + name: "reserved", }, ], - name: "listing", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isBuyerApprovedForListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isBuyerApprovedForListing.ts index c3dac315fb9..9bcfe71cbf1 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isBuyerApprovedForListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isBuyerApprovedForListing.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isBuyerApprovedForListing" function. @@ -20,12 +20,12 @@ export type IsBuyerApprovedForListingParams = { export const FN_SELECTOR = "0x9cfbe2a6" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_buyer", type: "address", + name: "_buyer", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isCurrencyApprovedForListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isCurrencyApprovedForListing.ts index 67e44c1c426..6351c37f548 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isCurrencyApprovedForListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/isCurrencyApprovedForListing.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isCurrencyApprovedForListing" function. @@ -20,12 +20,12 @@ export type IsCurrencyApprovedForListingParams = { export const FN_SELECTOR = "0xa8519047" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_currency", type: "address", + name: "_currency", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/totalListings.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/totalListings.ts index 742169f4f44..b8d0b72e56a 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/totalListings.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/read/totalListings.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xc78b616c" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveBuyerForListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveBuyerForListing.ts index e0db3ba1e41..be8ce99cf58 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveBuyerForListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveBuyerForListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "approveBuyerForListing" function. @@ -23,16 +23,16 @@ export type ApproveBuyerForListingParams = WithOverrides<{ export const FN_SELECTOR = "0x48dd77df" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_buyer", type: "address", + name: "_buyer", }, { - name: "_toApprove", type: "bool", + name: "_toApprove", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,19 +146,8 @@ export function approveBuyerForListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -168,5 +157,16 @@ export function approveBuyerForListing( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveCurrencyForListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveCurrencyForListing.ts index 1d6b7c5d0a8..ca45650bb17 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveCurrencyForListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/approveCurrencyForListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "approveCurrencyForListing" function. @@ -26,16 +26,16 @@ export type ApproveCurrencyForListingParams = WithOverrides<{ export const FN_SELECTOR = "0xea8f9a3c" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_pricePerTokenInCurrency", type: "uint256", + name: "_pricePerTokenInCurrency", }, ] as const; const FN_OUTPUTS = [] as const; @@ -149,19 +149,8 @@ export function approveCurrencyForListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -171,5 +160,16 @@ export function approveCurrencyForListing( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/buyFromListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/buyFromListing.ts index 0b5e66a8d5e..d695f899c51 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/buyFromListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/buyFromListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "buyFromListing" function. @@ -28,24 +28,24 @@ export type BuyFromListingParams = WithOverrides<{ export const FN_SELECTOR = "0x704232dc" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_buyFor", type: "address", + name: "_buyFor", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_expectedTotalPrice", type: "uint256", + name: "_expectedTotalPrice", }, ] as const; const FN_OUTPUTS = [] as const; @@ -161,19 +161,8 @@ export function buyFromListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -185,5 +174,16 @@ export function buyFromListing( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/cancelListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/cancelListing.ts index 0f6d9036dac..504776da5b0 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/cancelListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/cancelListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "cancelListing" function. @@ -21,8 +21,8 @@ export type CancelListingParams = WithOverrides<{ export const FN_SELECTOR = "0x305a67a8" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function cancelListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.listingId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/createListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/createListing.ts index 71b1d602dbb..49303739da5 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/createListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/createListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createListing" function. @@ -31,48 +31,48 @@ export type CreateListingParams = WithOverrides<{ export const FN_SELECTOR = "0x746415b5" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_params", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, { - name: "reserved", type: "bool", + name: "reserved", }, ], - name: "_params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "listingId", type: "uint256", + name: "listingId", }, ] as const; @@ -169,23 +169,23 @@ export function createListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/updateListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/updateListing.ts index e8e9b0db944..e484d216997 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/updateListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IDirectListings/write/updateListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "updateListing" function. @@ -35,46 +35,46 @@ export type UpdateListingParams = WithOverrides<{ export const FN_SELECTOR = "0x07b67758" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { + type: "tuple", + name: "_params", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerToken", type: "uint256", + name: "pricePerToken", }, { - name: "startTimestamp", type: "uint128", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint128", + name: "endTimestamp", }, { - name: "reserved", type: "bool", + name: "reserved", }, ], - name: "_params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -175,23 +175,23 @@ export function updateListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.listingId, resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/AuctionClosed.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/AuctionClosed.ts index d0ff9814ed0..b15d763c5af 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/AuctionClosed.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/AuctionClosed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AuctionClosed" event. @@ -46,8 +46,8 @@ export type AuctionClosedEventFilters = Partial<{ */ export function auctionClosedEvent(filters: AuctionClosedEventFilters = {}) { return prepareEvent({ - filters, signature: "event AuctionClosed(uint256 indexed auctionId, address indexed assetContract, address indexed closer, uint256 tokenId, address auctionCreator, address winningBidder)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/CancelledAuction.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/CancelledAuction.ts index 07175dd29db..930e0f2aa44 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/CancelledAuction.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/CancelledAuction.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "CancelledAuction" event. @@ -42,8 +42,8 @@ export function cancelledAuctionEvent( filters: CancelledAuctionEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event CancelledAuction(address indexed auctionCreator, uint256 indexed auctionId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewAuction.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewAuction.ts index dce5bdedf9c..dd69261100a 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewAuction.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewAuction.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewAuction" event. @@ -46,8 +46,8 @@ export type NewAuctionEventFilters = Partial<{ */ export function newAuctionEvent(filters: NewAuctionEventFilters = {}) { return prepareEvent({ - filters, signature: "event NewAuction(address indexed auctionCreator, uint256 indexed auctionId, address indexed assetContract, (uint256 auctionId, uint256 tokenId, uint256 quantity, uint256 minimumBidAmount, uint256 buyoutBidAmount, uint64 timeBufferInSeconds, uint64 bidBufferBps, uint64 startTimestamp, uint64 endTimestamp, address auctionCreator, address assetContract, address currency, uint8 tokenType, uint8 status) auction)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewBid.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewBid.ts index 1fa747408d2..27f25f28508 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewBid.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/events/NewBid.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewBid" event. @@ -46,8 +46,8 @@ export type NewBidEventFilters = Partial<{ */ export function newBidEvent(filters: NewBidEventFilters = {}) { return prepareEvent({ - filters, signature: "event NewBid(uint256 indexed auctionId, address indexed bidder, address indexed assetContract, uint256 bidAmount, (uint256 auctionId, uint256 tokenId, uint256 quantity, uint256 minimumBidAmount, uint256 buyoutBidAmount, uint64 timeBufferInSeconds, uint64 bidBufferBps, uint64 startTimestamp, uint64 endTimestamp, address auctionCreator, address assetContract, address currency, uint8 tokenType, uint8 status) auction)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllAuctions.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllAuctions.ts index f69f3a5af5a..dd88bdc4fbb 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllAuctions.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllAuctions.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAllAuctions" function. @@ -17,76 +17,76 @@ export type GetAllAuctionsParams = { export const FN_SELECTOR = "0xc291537c" as const; const FN_INPUTS = [ { - name: "_startId", type: "uint256", + name: "_startId", }, { - name: "_endId", type: "uint256", + name: "_endId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "auctions", components: [ { - name: "auctionId", type: "uint256", + name: "auctionId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "minimumBidAmount", type: "uint256", + name: "minimumBidAmount", }, { - name: "buyoutBidAmount", type: "uint256", + name: "buyoutBidAmount", }, { - name: "timeBufferInSeconds", type: "uint64", + name: "timeBufferInSeconds", }, { - name: "bidBufferBps", type: "uint64", + name: "bidBufferBps", }, { - name: "startTimestamp", type: "uint64", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint64", + name: "endTimestamp", }, { - name: "auctionCreator", type: "address", + name: "auctionCreator", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, ], - name: "auctions", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllValidAuctions.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllValidAuctions.ts index 6eb0f5938da..77c5116f129 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllValidAuctions.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAllValidAuctions.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAllValidAuctions" function. @@ -17,76 +17,76 @@ export type GetAllValidAuctionsParams = { export const FN_SELECTOR = "0x7b063801" as const; const FN_INPUTS = [ { - name: "_startId", type: "uint256", + name: "_startId", }, { - name: "_endId", type: "uint256", + name: "_endId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "auctions", components: [ { - name: "auctionId", type: "uint256", + name: "auctionId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "minimumBidAmount", type: "uint256", + name: "minimumBidAmount", }, { - name: "buyoutBidAmount", type: "uint256", + name: "buyoutBidAmount", }, { - name: "timeBufferInSeconds", type: "uint64", + name: "timeBufferInSeconds", }, { - name: "bidBufferBps", type: "uint64", + name: "bidBufferBps", }, { - name: "startTimestamp", type: "uint64", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint64", + name: "endTimestamp", }, { - name: "auctionCreator", type: "address", + name: "auctionCreator", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, ], - name: "auctions", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAuction.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAuction.ts index 08ed92b3e27..036617fbd7b 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAuction.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getAuction.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAuction" function. @@ -19,72 +19,72 @@ export type GetAuctionParams = { export const FN_SELECTOR = "0x78bd7935" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "auction", components: [ { - name: "auctionId", type: "uint256", + name: "auctionId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "minimumBidAmount", type: "uint256", + name: "minimumBidAmount", }, { - name: "buyoutBidAmount", type: "uint256", + name: "buyoutBidAmount", }, { - name: "timeBufferInSeconds", type: "uint64", + name: "timeBufferInSeconds", }, { - name: "bidBufferBps", type: "uint64", + name: "bidBufferBps", }, { - name: "startTimestamp", type: "uint64", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint64", + name: "endTimestamp", }, { - name: "auctionCreator", type: "address", + name: "auctionCreator", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, ], - name: "auction", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getWinningBid.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getWinningBid.ts index 8a933346840..9546e3db173 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getWinningBid.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/getWinningBid.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getWinningBid" function. @@ -19,22 +19,22 @@ export type GetWinningBidParams = { export const FN_SELECTOR = "0x6891939d" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, ] as const; const FN_OUTPUTS = [ { - name: "bidder", type: "address", + name: "bidder", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "bidAmount", type: "uint256", + name: "bidAmount", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isAuctionExpired.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isAuctionExpired.ts index d90f1b5c0ed..11c8eab2430 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isAuctionExpired.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isAuctionExpired.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isAuctionExpired" function. @@ -19,8 +19,8 @@ export type IsAuctionExpiredParams = { export const FN_SELECTOR = "0x1389b117" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isNewWinningBid.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isNewWinningBid.ts index 7885c7c450e..aea27839d1d 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isNewWinningBid.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/isNewWinningBid.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isNewWinningBid" function. @@ -23,12 +23,12 @@ export type IsNewWinningBidParams = { export const FN_SELECTOR = "0x2eb566bd" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, { - name: "_bidAmount", type: "uint256", + name: "_bidAmount", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/totalAuctions.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/totalAuctions.ts index 6a9174b4a20..0610fda8156 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/totalAuctions.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/read/totalAuctions.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x16002f4a" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/bidInAuction.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/bidInAuction.ts index d571dfda0f6..942bb17d0c2 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/bidInAuction.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/bidInAuction.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "bidInAuction" function. @@ -25,12 +25,12 @@ export type BidInAuctionParams = WithOverrides<{ export const FN_SELECTOR = "0x0858e5ad" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, { - name: "_bidAmount", type: "uint256", + name: "_bidAmount", }, ] as const; const FN_OUTPUTS = [] as const; @@ -131,23 +131,23 @@ export function bidInAuction( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.auctionId, resolvedOptions.bidAmount] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/cancelAuction.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/cancelAuction.ts index 9c30227fc67..846aded52d0 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/cancelAuction.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/cancelAuction.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "cancelAuction" function. @@ -21,8 +21,8 @@ export type CancelAuctionParams = WithOverrides<{ export const FN_SELECTOR = "0x96b5a755" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function cancelAuction( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.auctionId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionPayout.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionPayout.ts index b6dbe57b1f9..8004652acac 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionPayout.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionPayout.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "collectAuctionPayout" function. @@ -21,8 +21,8 @@ export type CollectAuctionPayoutParams = WithOverrides<{ export const FN_SELECTOR = "0xebf05a62" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -124,23 +124,23 @@ export function collectAuctionPayout( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.auctionId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionTokens.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionTokens.ts index de394d93a4c..864aab2e45f 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionTokens.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/collectAuctionTokens.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "collectAuctionTokens" function. @@ -21,8 +21,8 @@ export type CollectAuctionTokensParams = WithOverrides<{ export const FN_SELECTOR = "0x03a54fe0" as const; const FN_INPUTS = [ { - name: "_auctionId", type: "uint256", + name: "_auctionId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -124,23 +124,23 @@ export function collectAuctionTokens( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.auctionId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/createAuction.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/createAuction.ts index 0e10c08fbd0..e48106af277 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/createAuction.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IEnglishAuctions/write/createAuction.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createAuction" function. @@ -33,56 +33,56 @@ export type CreateAuctionParams = WithOverrides<{ export const FN_SELECTOR = "0x16654d40" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_params", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "minimumBidAmount", type: "uint256", + name: "minimumBidAmount", }, { - name: "buyoutBidAmount", type: "uint256", + name: "buyoutBidAmount", }, { - name: "timeBufferInSeconds", type: "uint64", + name: "timeBufferInSeconds", }, { - name: "bidBufferBps", type: "uint64", + name: "bidBufferBps", }, { - name: "startTimestamp", type: "uint64", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint64", + name: "endTimestamp", }, ], - name: "_params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "auctionId", type: "uint256", + name: "auctionId", }, ] as const; @@ -179,23 +179,23 @@ export function createAuction( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/AuctionClosed.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/AuctionClosed.ts index 193ef08a9c8..37e97c246e0 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/AuctionClosed.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/AuctionClosed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AuctionClosed" event. @@ -46,8 +46,8 @@ export type AuctionClosedEventFilters = Partial<{ */ export function auctionClosedEvent(filters: AuctionClosedEventFilters = {}) { return prepareEvent({ - filters, signature: "event AuctionClosed(uint256 indexed listingId, address indexed closer, bool indexed cancelled, address auctionCreator, address winningBidder)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingAdded.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingAdded.ts index 3d715351f07..7fe12ca837f 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingAdded.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingAdded.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ListingAdded" event. @@ -46,8 +46,8 @@ export type ListingAddedEventFilters = Partial<{ */ export function listingAddedEvent(filters: ListingAddedEventFilters = {}) { return prepareEvent({ - filters, signature: "event ListingAdded(uint256 indexed listingId, address indexed assetContract, address indexed lister, (uint256 listingId, address tokenOwner, address assetContract, uint256 tokenId, uint256 startTime, uint256 endTime, uint256 quantity, address currency, uint256 reservePricePerToken, uint256 buyoutPricePerToken, uint8 tokenType, uint8 listingType) listing)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingRemoved.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingRemoved.ts index 7a765b236c1..2233c856fc7 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingRemoved.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingRemoved.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ListingRemoved" event. @@ -40,8 +40,8 @@ export type ListingRemovedEventFilters = Partial<{ */ export function listingRemovedEvent(filters: ListingRemovedEventFilters = {}) { return prepareEvent({ - filters, signature: "event ListingRemoved(uint256 indexed listingId, address indexed listingCreator)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingUpdated.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingUpdated.ts index 531eba5ddf4..5a9f20825a0 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingUpdated.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/ListingUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ListingUpdated" event. @@ -40,8 +40,8 @@ export type ListingUpdatedEventFilters = Partial<{ */ export function listingUpdatedEvent(filters: ListingUpdatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event ListingUpdated(uint256 indexed listingId, address indexed listingCreator)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewOffer.ts index 4b1606b5789..b033e92129f 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewOffer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewOffer" event. @@ -46,8 +46,8 @@ export type NewOfferEventFilters = Partial<{ */ export function newOfferEvent(filters: NewOfferEventFilters = {}) { return prepareEvent({ - filters, signature: "event NewOffer(uint256 indexed listingId, address indexed offeror, uint8 indexed listingType, uint256 quantityWanted, uint256 totalOfferAmount, address currency)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewSale.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewSale.ts index 893e02000fc..c5d506f7736 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewSale.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/NewSale.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewSale" event. @@ -46,8 +46,8 @@ export type NewSaleEventFilters = Partial<{ */ export function newSaleEvent(filters: NewSaleEventFilters = {}) { return prepareEvent({ - filters, signature: "event NewSale(uint256 indexed listingId, address indexed assetContract, address indexed lister, address buyer, uint256 quantityBought, uint256 totalPricePaid)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/PlatformFeeInfoUpdated.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/PlatformFeeInfoUpdated.ts index 4e91f71b9d2..ec779ad8e7d 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/PlatformFeeInfoUpdated.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/events/PlatformFeeInfoUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PlatformFeeInfoUpdated" event. @@ -36,8 +36,8 @@ export function platformFeeInfoUpdatedEvent( filters: PlatformFeeInfoUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractType.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractType.ts index 1cf532447a5..75061f26982 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractType.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractType.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcb2ef6f7" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractURI.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractURI.ts index 63421151241..ca512450a4f 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractURI.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractURI.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe8a3d485" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractVersion.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractVersion.ts index 3b2d58a96e6..cd44865ea62 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractVersion.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/contractVersion.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa0a8e460" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/getPlatformFeeInfo.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/getPlatformFeeInfo.ts index acfdf87abf0..a7f71ea7315 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/getPlatformFeeInfo.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/read/getPlatformFeeInfo.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xd45573f6" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/acceptOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/acceptOffer.ts index 49183fe3c78..387aed05883 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/acceptOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/acceptOffer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "acceptOffer" function. @@ -27,20 +27,20 @@ export type AcceptOfferParams = WithOverrides<{ export const FN_SELECTOR = "0xb13c0e63" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_offeror", type: "address", + name: "_offeror", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_totalPrice", type: "uint256", + name: "_totalPrice", }, ] as const; const FN_OUTPUTS = [] as const; @@ -152,19 +152,8 @@ export function acceptOffer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -175,5 +164,16 @@ export function acceptOffer( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/buy.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/buy.ts index 027f141225b..97a608d0a86 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/buy.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/buy.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "buy" function. @@ -28,24 +28,24 @@ export type BuyParams = WithOverrides<{ export const FN_SELECTOR = "0x7687ab02" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_buyFor", type: "address", + name: "_buyFor", }, { - name: "_quantity", type: "uint256", + name: "_quantity", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_totalPrice", type: "uint256", + name: "_totalPrice", }, ] as const; const FN_OUTPUTS = [] as const; @@ -159,19 +159,8 @@ export function buy( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -183,5 +172,16 @@ export function buy( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/cancelDirectListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/cancelDirectListing.ts index 0257eb65715..16205373cf0 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/cancelDirectListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/cancelDirectListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "cancelDirectListing" function. @@ -21,8 +21,8 @@ export type CancelDirectListingParams = WithOverrides<{ export const FN_SELECTOR = "0x7506c84a" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -122,23 +122,23 @@ export function cancelDirectListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.listingId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/closeAuction.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/closeAuction.ts index ec6f0d8de8b..f44a7290903 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/closeAuction.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/closeAuction.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "closeAuction" function. @@ -22,12 +22,12 @@ export type CloseAuctionParams = WithOverrides<{ export const FN_SELECTOR = "0x6bab66ae" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_closeFor", type: "address", + name: "_closeFor", }, ] as const; const FN_OUTPUTS = [] as const; @@ -128,23 +128,23 @@ export function closeAuction( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.listingId, resolvedOptions.closeFor] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/createListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/createListing.ts index 1890f378f7f..a117cfa8e94 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/createListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/createListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createListing" function. @@ -32,46 +32,46 @@ export type CreateListingParams = WithOverrides<{ export const FN_SELECTOR = "0x296f4e16" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_params", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "startTime", type: "uint256", + name: "startTime", }, { - name: "secondsUntilEndTime", type: "uint256", + name: "secondsUntilEndTime", }, { - name: "quantityToList", type: "uint256", + name: "quantityToList", }, { - name: "currencyToAccept", type: "address", + name: "currencyToAccept", }, { - name: "reservePricePerToken", type: "uint256", + name: "reservePricePerToken", }, { - name: "buyoutPricePerToken", type: "uint256", + name: "buyoutPricePerToken", }, { - name: "listingType", type: "uint8", + name: "listingType", }, ], - name: "_params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -169,23 +169,23 @@ export function createListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/offer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/offer.ts index 8c95eb6ab63..f4e8ccdcf4f 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/offer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/offer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "offer" function. @@ -34,24 +34,24 @@ export type OfferParams = WithOverrides<{ export const FN_SELECTOR = "0x5fef45e7" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_quantityWanted", type: "uint256", + name: "_quantityWanted", }, { - name: "_currency", type: "address", + name: "_currency", }, { - name: "_pricePerToken", type: "uint256", + name: "_pricePerToken", }, { - name: "_expirationTimestamp", type: "uint256", + name: "_expirationTimestamp", }, ] as const; const FN_OUTPUTS = [] as const; @@ -165,19 +165,8 @@ export function offer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -189,5 +178,16 @@ export function offer( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setContractURI.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setContractURI.ts index a7d8b046f46..8c2125dcf6f 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setContractURI.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setContractURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setContractURI" function. @@ -18,8 +18,8 @@ export type SetContractURIParams = WithOverrides<{ export const FN_SELECTOR = "0x938e3d7b" as const; const FN_INPUTS = [ { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function setContractURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setPlatformFeeInfo.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setPlatformFeeInfo.ts index 93dadff3486..f65d00c8a21 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setPlatformFeeInfo.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/setPlatformFeeInfo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setPlatformFeeInfo" function. @@ -25,12 +25,12 @@ export type SetPlatformFeeInfoParams = WithOverrides<{ export const FN_SELECTOR = "0x1e7ac488" as const; const FN_INPUTS = [ { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, { - name: "_platformFeeBps", type: "uint256", + name: "_platformFeeBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -136,19 +136,8 @@ export function setPlatformFeeInfo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function setPlatformFeeInfo( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/updateListing.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/updateListing.ts index 6951adfe72f..cf7822145e7 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/updateListing.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IMarketplace/write/updateListing.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "updateListing" function. @@ -45,32 +45,32 @@ export type UpdateListingParams = WithOverrides<{ export const FN_SELECTOR = "0xc4b5b15f" as const; const FN_INPUTS = [ { - name: "_listingId", type: "uint256", + name: "_listingId", }, { - name: "_quantityToList", type: "uint256", + name: "_quantityToList", }, { - name: "_reservePricePerToken", type: "uint256", + name: "_reservePricePerToken", }, { - name: "_buyoutPricePerToken", type: "uint256", + name: "_buyoutPricePerToken", }, { - name: "_currencyToAccept", type: "address", + name: "_currencyToAccept", }, { - name: "_startTime", type: "uint256", + name: "_startTime", }, { - name: "_secondsUntilEndTime", type: "uint256", + name: "_secondsUntilEndTime", }, ] as const; const FN_OUTPUTS = [] as const; @@ -194,19 +194,8 @@ export function updateListing( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -220,5 +209,16 @@ export function updateListing( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/AcceptedOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/AcceptedOffer.ts index 36db9ddb0a1..611ab797190 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/AcceptedOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/AcceptedOffer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "AcceptedOffer" event. @@ -46,8 +46,8 @@ export type AcceptedOfferEventFilters = Partial<{ */ export function acceptedOfferEvent(filters: AcceptedOfferEventFilters = {}) { return prepareEvent({ - filters, signature: "event AcceptedOffer(address indexed offeror, uint256 indexed offerId, address indexed assetContract, uint256 tokenId, address seller, uint256 quantityBought, uint256 totalPricePaid)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/CancelledOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/CancelledOffer.ts index 052ab0867b1..44708d6932b 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/CancelledOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/CancelledOffer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "CancelledOffer" event. @@ -40,8 +40,8 @@ export type CancelledOfferEventFilters = Partial<{ */ export function cancelledOfferEvent(filters: CancelledOfferEventFilters = {}) { return prepareEvent({ - filters, signature: "event CancelledOffer(address indexed offeror, uint256 indexed offerId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/NewOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/NewOffer.ts index 3ec6d81ed9b..839757be049 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/NewOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/events/NewOffer.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewOffer" event. @@ -46,8 +46,8 @@ export type NewOfferEventFilters = Partial<{ */ export function newOfferEvent(filters: NewOfferEventFilters = {}) { return prepareEvent({ - filters, signature: "event NewOffer(address indexed offeror, uint256 indexed offerId, address indexed assetContract, (uint256 offerId, uint256 tokenId, uint256 quantity, uint256 totalPrice, uint256 expirationTimestamp, address offeror, address assetContract, address currency, uint8 tokenType, uint8 status) offer)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllOffers.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllOffers.ts index de44cd07ef4..9d96cf8d183 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllOffers.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllOffers.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAllOffers" function. @@ -17,60 +17,60 @@ export type GetAllOffersParams = { export const FN_SELECTOR = "0xc1edcfbe" as const; const FN_INPUTS = [ { - name: "_startId", type: "uint256", + name: "_startId", }, { - name: "_endId", type: "uint256", + name: "_endId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "offers", components: [ { - name: "offerId", type: "uint256", + name: "offerId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "totalPrice", type: "uint256", + name: "totalPrice", }, { - name: "expirationTimestamp", type: "uint256", + name: "expirationTimestamp", }, { - name: "offeror", type: "address", + name: "offeror", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, ], - name: "offers", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllValidOffers.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllValidOffers.ts index ef901d30f17..d3b4a4df5cd 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllValidOffers.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getAllValidOffers.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAllValidOffers" function. @@ -17,60 +17,60 @@ export type GetAllValidOffersParams = { export const FN_SELECTOR = "0x91940b3e" as const; const FN_INPUTS = [ { - name: "_startId", type: "uint256", + name: "_startId", }, { - name: "_endId", type: "uint256", + name: "_endId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "offers", components: [ { - name: "offerId", type: "uint256", + name: "offerId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "totalPrice", type: "uint256", + name: "totalPrice", }, { - name: "expirationTimestamp", type: "uint256", + name: "expirationTimestamp", }, { - name: "offeror", type: "address", + name: "offeror", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, ], - name: "offers", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getOffer.ts index 97fe560e741..8004b2e251d 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/getOffer.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getOffer" function. @@ -16,56 +16,56 @@ export type GetOfferParams = { export const FN_SELECTOR = "0x4579268a" as const; const FN_INPUTS = [ { - name: "_offerId", type: "uint256", + name: "_offerId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "offer", components: [ { - name: "offerId", type: "uint256", + name: "offerId", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "totalPrice", type: "uint256", + name: "totalPrice", }, { - name: "expirationTimestamp", type: "uint256", + name: "expirationTimestamp", }, { - name: "offeror", type: "address", + name: "offeror", }, { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "status", type: "uint8", + name: "status", }, ], - name: "offer", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/totalOffers.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/totalOffers.ts index a9656ff8634..4de665a1cb5 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/totalOffers.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/read/totalOffers.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa9fd8ed1" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/acceptOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/acceptOffer.ts index ba388eb5203..a055869c958 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/acceptOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/acceptOffer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "acceptOffer" function. @@ -18,8 +18,8 @@ export type AcceptOfferParams = WithOverrides<{ export const FN_SELECTOR = "0xc815729d" as const; const FN_INPUTS = [ { - name: "_offerId", type: "uint256", + name: "_offerId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function acceptOffer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.offerId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/cancelOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/cancelOffer.ts index 0ad97cd1fce..449475eae93 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/cancelOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/cancelOffer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "cancelOffer" function. @@ -18,8 +18,8 @@ export type CancelOfferParams = WithOverrides<{ export const FN_SELECTOR = "0xef706adf" as const; const FN_INPUTS = [ { - name: "_offerId", type: "uint256", + name: "_offerId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function cancelOffer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.offerId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/makeOffer.ts b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/makeOffer.ts index 7f373c49bac..b57181f8d69 100644 --- a/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/makeOffer.ts +++ b/packages/thirdweb/src/extensions/marketplace/__generated__/IOffers/write/makeOffer.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "makeOffer" function. @@ -29,40 +29,40 @@ export type MakeOfferParams = WithOverrides<{ export const FN_SELECTOR = "0x016767fa" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_params", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "quantity", type: "uint256", + name: "quantity", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "totalPrice", type: "uint256", + name: "totalPrice", }, { - name: "expirationTimestamp", type: "uint256", + name: "expirationTimestamp", }, ], - name: "_params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "offerId", type: "uint256", + name: "offerId", }, ] as const; @@ -159,23 +159,23 @@ export function makeOffer( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/module/install.ts index 6cc34069075..93a3b918f36 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/module/install.ts @@ -48,8 +48,8 @@ export function module(params?: { publisher?: string }) { publisher: params?.publisher, }); return { - data: "0x" as const, module: moduleContract.address as Address, + data: "0x" as const, }; }; } @@ -83,8 +83,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: "0x" as const, moduleName: contractId, + moduleData: "0x" as const, publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/encodeBytesOnInstall.ts index b015f39ef05..70b5e739f97 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/encodeBytesOnInstall.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfec7ff72" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getAllMetadataBatches.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getAllMetadataBatches.ts index d4d3f44f0f6..cb8daa93fac 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getAllMetadataBatches.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getAllMetadataBatches.ts @@ -1,28 +1,29 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe6c23512" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "startTokenIdInclusive", type: "uint256", + name: "startTokenIdInclusive", }, { - name: "endTokenIdInclusive", type: "uint256", + name: "endTokenIdInclusive", }, { - name: "baseURI", type: "string", + name: "baseURI", }, ], - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getBatchIndex.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getBatchIndex.ts index 3c5f845b84d..5a193fd2cb0 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getBatchIndex.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getBatchIndex.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getBatchIndex" function. @@ -16,8 +16,8 @@ export type GetBatchIndexParams = { export const FN_SELECTOR = "0x44ec3c07" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getMetadataBatch.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getMetadataBatch.ts index 15e13a44647..ca806668ee7 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getMetadataBatch.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getMetadataBatch.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getMetadataBatch" function. @@ -19,27 +19,27 @@ export type GetMetadataBatchParams = { export const FN_SELECTOR = "0xe034558b" as const; const FN_INPUTS = [ { - name: "_batchIndex", type: "uint256", + name: "_batchIndex", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "startTokenIdInclusive", type: "uint256", + name: "startTokenIdInclusive", }, { - name: "endTokenIdInclusive", type: "uint256", + name: "endTokenIdInclusive", }, { - name: "baseURI", type: "string", + name: "baseURI", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getModuleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getModuleConfig.ts index 84d5b4efa81..cf036b86757 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getModuleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getModuleConfig.ts @@ -1,53 +1,54 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x89e04e0e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "config", components: [ { - name: "registerInstallationCallback", type: "bool", + name: "registerInstallationCallback", }, { - name: "requiredInterfaces", type: "bytes4[]", + name: "requiredInterfaces", }, { - name: "supportedInterfaces", type: "bytes4[]", + name: "supportedInterfaces", }, { + type: "tuple[]", + name: "callbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, ], - name: "callbackFunctions", - type: "tuple[]", }, { + type: "tuple[]", + name: "fallbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "permissionBits", type: "uint256", + name: "permissionBits", }, ], - name: "fallbackFunctions", - type: "tuple[]", }, ], - name: "config", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/setBaseURI.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/setBaseURI.ts index d83394d46e5..7d42f61ef90 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/setBaseURI.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/setBaseURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setBaseURI" function. @@ -22,12 +22,12 @@ export type SetBaseURIParams = WithOverrides<{ export const FN_SELECTOR = "0x33cfcb9f" as const; const FN_INPUTS = [ { - name: "_batchIndex", type: "uint256", + name: "_batchIndex", }, { - name: "_baseURI", type: "string", + name: "_baseURI", }, ] as const; const FN_OUTPUTS = [] as const; @@ -128,23 +128,23 @@ export function setBaseURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.batchIndex, resolvedOptions.baseURI] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/uploadMetadata.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/uploadMetadata.ts index 1223ae32382..3e18197cdbc 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/uploadMetadata.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/uploadMetadata.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "uploadMetadata" function. @@ -19,12 +19,12 @@ export type UploadMetadataParams = WithOverrides<{ export const FN_SELECTOR = "0xbfa2f36e" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, { - name: "_baseURI", type: "string", + name: "_baseURI", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function uploadMetadata( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount, resolvedOptions.baseURI] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/module/install.ts index 3c7ead09b1d..4bfa3868136 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/module/install.ts @@ -48,8 +48,8 @@ export function module(params?: { publisher?: string }) { publisher: params?.publisher, }); return { - data: "0x" as const, module: moduleContract.address as Address, + data: "0x" as const, }; }; } @@ -83,8 +83,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: "0x" as const, moduleName: contractId, + moduleData: "0x" as const, publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/encodeBytesOnInstall.ts index 79e6a9a81a1..8fc04c50266 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/encodeBytesOnInstall.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfec7ff72" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getAllMetadataBatches.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getAllMetadataBatches.ts index f28001b736c..ef821c8a2d7 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getAllMetadataBatches.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getAllMetadataBatches.ts @@ -1,28 +1,29 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe6c23512" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "startTokenIdInclusive", type: "uint256", + name: "startTokenIdInclusive", }, { - name: "endTokenIdInclusive", type: "uint256", + name: "endTokenIdInclusive", }, { - name: "baseURI", type: "string", + name: "baseURI", }, ], - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getBatchIndex.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getBatchIndex.ts index 98ba6899f86..f6004039b01 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getBatchIndex.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getBatchIndex.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getBatchIndex" function. @@ -16,8 +16,8 @@ export type GetBatchIndexParams = { export const FN_SELECTOR = "0x44ec3c07" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getMetadataBatch.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getMetadataBatch.ts index f4e4d3638b2..89701986e36 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getMetadataBatch.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getMetadataBatch.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getMetadataBatch" function. @@ -19,27 +19,27 @@ export type GetMetadataBatchParams = { export const FN_SELECTOR = "0xe034558b" as const; const FN_INPUTS = [ { - name: "_batchIndex", type: "uint256", + name: "_batchIndex", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "startTokenIdInclusive", type: "uint256", + name: "startTokenIdInclusive", }, { - name: "endTokenIdInclusive", type: "uint256", + name: "endTokenIdInclusive", }, { - name: "baseURI", type: "string", + name: "baseURI", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getModuleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getModuleConfig.ts index 96a414e53b6..315f110f39a 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getModuleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getModuleConfig.ts @@ -1,53 +1,54 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x89e04e0e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "config", components: [ { - name: "registerInstallationCallback", type: "bool", + name: "registerInstallationCallback", }, { - name: "requiredInterfaces", type: "bytes4[]", + name: "requiredInterfaces", }, { - name: "supportedInterfaces", type: "bytes4[]", + name: "supportedInterfaces", }, { + type: "tuple[]", + name: "callbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, ], - name: "callbackFunctions", - type: "tuple[]", }, { + type: "tuple[]", + name: "fallbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "permissionBits", type: "uint256", + name: "permissionBits", }, ], - name: "fallbackFunctions", - type: "tuple[]", }, ], - name: "config", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/setBaseURI.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/setBaseURI.ts index 4249bee158c..511924b2dcf 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/setBaseURI.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/setBaseURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setBaseURI" function. @@ -22,12 +22,12 @@ export type SetBaseURIParams = WithOverrides<{ export const FN_SELECTOR = "0x33cfcb9f" as const; const FN_INPUTS = [ { - name: "_batchIndex", type: "uint256", + name: "_batchIndex", }, { - name: "_baseURI", type: "string", + name: "_baseURI", }, ] as const; const FN_OUTPUTS = [] as const; @@ -128,23 +128,23 @@ export function setBaseURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.batchIndex, resolvedOptions.baseURI] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/uploadMetadata.ts b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/uploadMetadata.ts index cfba6d11c9d..074b04bbfc1 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/uploadMetadata.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/uploadMetadata.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "uploadMetadata" function. @@ -19,12 +19,12 @@ export type UploadMetadataParams = WithOverrides<{ export const FN_SELECTOR = "0xbfa2f36e" as const; const FN_INPUTS = [ { - name: "_amount", type: "uint256", + name: "_amount", }, { - name: "_baseURI", type: "string", + name: "_baseURI", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function uploadMetadata( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.amount, resolvedOptions.baseURI] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintERC1155.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintERC1155.ts index 7ee536eb81c..1e04910839c 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintERC1155.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintERC1155.ts @@ -20,22 +20,22 @@ export type EncodeBytesBeforeMintERC1155Params = { export const FN_SELECTOR = "0x819ed5a3" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "recipientAllowlistProof", type: "bytes32[]", + name: "recipientAllowlistProof", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts index 67aa84517d0..a29c31da0f3 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts @@ -23,34 +23,34 @@ export type EncodeBytesBeforeMintWithSignatureERC1155Params = { export const FN_SELECTOR = "0x63dacad2" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesOnInstall.ts index 472bbda5bd9..e352e188aa6 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/encode/encodeBytesOnInstall.ts @@ -15,8 +15,8 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x5d4c0b89" as const; const FN_INPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/module/install.ts index d7ae3d13255..51850c27a6b 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "ClaimableERC1155"; @@ -55,8 +55,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -92,8 +92,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getClaimConditionByTokenId.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getClaimConditionByTokenId.ts index feda9f2530a..37ecb3a29ec 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getClaimConditionByTokenId.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getClaimConditionByTokenId.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getClaimConditionByTokenId" function. @@ -16,48 +16,48 @@ export type GetClaimConditionByTokenIdParams = { export const FN_SELECTOR = "0x29a20bf4" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "claimCondition", components: [ { - name: "availableSupply", type: "uint256", + name: "availableSupply", }, { - name: "allowlistMerkleRoot", type: "bytes32", + name: "allowlistMerkleRoot", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "auxData", type: "string", + name: "auxData", }, ], - name: "claimCondition", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getSaleConfig.ts index ef5c00dc302..ca8d248d475 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getSaleConfig.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcea943ee" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setClaimConditionByTokenId.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setClaimConditionByTokenId.ts index c6f44da5916..f9ed45eafa0 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setClaimConditionByTokenId.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setClaimConditionByTokenId.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimConditionByTokenId" function. @@ -32,46 +32,46 @@ export type SetClaimConditionByTokenIdParams = WithOverrides<{ export const FN_SELECTOR = "0x3bcec708" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { + type: "tuple", + name: "_claimCondition", components: [ { - name: "availableSupply", type: "uint256", + name: "availableSupply", }, { - name: "allowlistMerkleRoot", type: "bytes32", + name: "allowlistMerkleRoot", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "auxData", type: "string", + name: "auxData", }, ], - name: "_claimCondition", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -181,23 +181,23 @@ export function setClaimConditionByTokenId( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.claimCondition] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setSaleConfig.ts index 408b582e56e..de6de1fac6f 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setSaleConfig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSaleConfig" function. @@ -21,8 +21,8 @@ export type SetSaleConfigParams = WithOverrides<{ export const FN_SELECTOR = "0xd29a3628" as const; const FN_INPUTS = [ { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setSaleConfig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.primarySaleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintERC20.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintERC20.ts index 807504e8605..80b41cd4b0a 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintERC20.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintERC20.ts @@ -20,22 +20,22 @@ export type EncodeBytesBeforeMintERC20Params = { export const FN_SELECTOR = "0x4e6030da" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "recipientAllowlistProof", type: "bytes32[]", + name: "recipientAllowlistProof", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts index 65624f7e192..fe4972d9e1c 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts @@ -23,34 +23,34 @@ export type EncodeBytesBeforeMintWithSignatureERC20Params = { export const FN_SELECTOR = "0x3f4a1bb6" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesOnInstall.ts index 472bbda5bd9..e352e188aa6 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/encode/encodeBytesOnInstall.ts @@ -15,8 +15,8 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x5d4c0b89" as const; const FN_INPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/module/install.ts index fda1dd75578..4f07605a11f 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "ClaimableERC20"; @@ -55,8 +55,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -92,8 +92,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getClaimCondition.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getClaimCondition.ts index 034494e34a1..88f1fa11af0 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getClaimCondition.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getClaimCondition.ts @@ -1,49 +1,50 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x30a63e11" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "claimCondition", components: [ { - name: "availableSupply", type: "uint256", + name: "availableSupply", }, { - name: "allowlistMerkleRoot", type: "bytes32", + name: "allowlistMerkleRoot", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "auxData", type: "string", + name: "auxData", }, ], - name: "claimCondition", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getSaleConfig.ts index 3aa090f11c4..d77a83b90b3 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getSaleConfig.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcea943ee" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setClaimCondition.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setClaimCondition.ts index 3ab227ed981..68acc8f5564 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setClaimCondition.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setClaimCondition.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimCondition" function. @@ -31,42 +31,42 @@ export type SetClaimConditionParams = WithOverrides<{ export const FN_SELECTOR = "0xac0c12f4" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_claimCondition", components: [ { - name: "availableSupply", type: "uint256", + name: "availableSupply", }, { - name: "allowlistMerkleRoot", type: "bytes32", + name: "allowlistMerkleRoot", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "auxData", type: "string", + name: "auxData", }, ], - name: "_claimCondition", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -166,23 +166,23 @@ export function setClaimCondition( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.claimCondition] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setSaleConfig.ts index 08b8be4fbc6..8f35e243b55 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setSaleConfig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSaleConfig" function. @@ -21,8 +21,8 @@ export type SetSaleConfigParams = WithOverrides<{ export const FN_SELECTOR = "0xd29a3628" as const; const FN_INPUTS = [ { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setSaleConfig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.primarySaleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintERC721.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintERC721.ts index 3643365d32b..1433a0cb4e8 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintERC721.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintERC721.ts @@ -20,22 +20,22 @@ export type EncodeBytesBeforeMintERC721Params = { export const FN_SELECTOR = "0xd9584651" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "recipientAllowlistProof", type: "bytes32[]", + name: "recipientAllowlistProof", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts index 13646dc8d2c..2aeb7ccf962 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts @@ -23,34 +23,34 @@ export type EncodeBytesBeforeMintWithSignatureERC721Params = { export const FN_SELECTOR = "0x937bdca4" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesOnInstall.ts index 472bbda5bd9..e352e188aa6 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/encode/encodeBytesOnInstall.ts @@ -15,8 +15,8 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x5d4c0b89" as const; const FN_INPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/module/install.ts index 79b494f3934..03a615c3f62 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "ClaimableERC721"; @@ -55,8 +55,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -92,8 +92,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getClaimCondition.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getClaimCondition.ts index 9e478cd3ba9..7040ddc3643 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getClaimCondition.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getClaimCondition.ts @@ -1,49 +1,50 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x30a63e11" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "claimCondition", components: [ { - name: "availableSupply", type: "uint256", + name: "availableSupply", }, { - name: "allowlistMerkleRoot", type: "bytes32", + name: "allowlistMerkleRoot", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "auxData", type: "string", + name: "auxData", }, ], - name: "claimCondition", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getSaleConfig.ts index 12438909570..4be195f871d 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getSaleConfig.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcea943ee" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setClaimCondition.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setClaimCondition.ts index e22768b0ac0..b4e0bba598b 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setClaimCondition.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setClaimCondition.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setClaimCondition" function. @@ -31,42 +31,42 @@ export type SetClaimConditionParams = WithOverrides<{ export const FN_SELECTOR = "0xac0c12f4" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_claimCondition", components: [ { - name: "availableSupply", type: "uint256", + name: "availableSupply", }, { - name: "allowlistMerkleRoot", type: "bytes32", + name: "allowlistMerkleRoot", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "maxMintPerWallet", type: "uint256", + name: "maxMintPerWallet", }, { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "auxData", type: "string", + name: "auxData", }, ], - name: "_claimCondition", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -166,23 +166,23 @@ export function setClaimCondition( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.claimCondition] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setSaleConfig.ts index c865fd7ab43..0086cabc826 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setSaleConfig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSaleConfig" function. @@ -21,8 +21,8 @@ export type SetSaleConfigParams = WithOverrides<{ export const FN_SELECTOR = "0xd29a3628" as const; const FN_INPUTS = [ { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setSaleConfig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.primarySaleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/burn.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/burn.ts index 5a5c87744d9..286199fdb6d 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/burn.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/burn.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burn" function. @@ -21,20 +21,20 @@ export type BurnParams = WithOverrides<{ export const FN_SELECTOR = "0x8a94b05f" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "value", type: "uint256", + name: "value", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -144,19 +144,8 @@ export function burn( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -167,5 +156,16 @@ export function burn( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/initialize.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/initialize.ts index 5ac92bed461..75422b16100 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/initialize.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -29,28 +29,28 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x62835ade" as const; const FN_INPUTS = [ { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_owner", type: "address", + name: "_owner", }, { - name: "_modules", type: "address[]", + name: "_modules", }, { - name: "_moduleInstallData", type: "bytes[]", + name: "_moduleInstallData", }, ] as const; const FN_OUTPUTS = [] as const; @@ -170,19 +170,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -195,5 +184,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mint.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mint.ts index 3e490cab7f1..ad1b67dbc55 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mint.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mint.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mint" function. @@ -22,24 +22,24 @@ export type MintParams = WithOverrides<{ export const FN_SELECTOR = "0xa4b645eb" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint256", + name: "amount", }, { - name: "baseURI", type: "string", + name: "baseURI", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -153,19 +153,8 @@ export function mint( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -177,5 +166,16 @@ export function mint( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mintWithSignature.ts index 547c35b3196..62821e2d4fc 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -23,28 +23,28 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0xe6bd6ada" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "amount", type: "uint256", + name: "amount", }, { - name: "baseURI", type: "string", + name: "baseURI", }, { - name: "data", type: "bytes", + name: "data", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -166,19 +166,8 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -191,5 +180,16 @@ export function mintWithSignature( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/burn.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/burn.ts index 48e0fea98c2..67b1b0cfbe1 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/burn.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/burn.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burn" function. @@ -20,16 +20,16 @@ export type BurnParams = WithOverrides<{ export const FN_SELECTOR = "0x44d17187" as const; const FN_INPUTS = [ { - name: "from", type: "address", + name: "from", }, { - name: "amount", type: "uint256", + name: "amount", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -135,19 +135,8 @@ export function burn( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function burn( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/initialize.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/initialize.ts index 0fc533a1f71..a380e4ee56f 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/initialize.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -29,28 +29,28 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x62835ade" as const; const FN_INPUTS = [ { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_owner", type: "address", + name: "_owner", }, { - name: "_modules", type: "address[]", + name: "_modules", }, { - name: "_moduleInstallData", type: "bytes[]", + name: "_moduleInstallData", }, ] as const; const FN_OUTPUTS = [] as const; @@ -170,19 +170,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -195,5 +184,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mint.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mint.ts index 75498e5102f..a5540effcfc 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mint.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mint.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mint" function. @@ -20,16 +20,16 @@ export type MintParams = WithOverrides<{ export const FN_SELECTOR = "0x94d008ef" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "amount", type: "uint256", + name: "amount", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -135,19 +135,8 @@ export function mint( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function mint( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mintWithSignature.ts index 075d4f6e81d..98d9e06e4d4 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -21,20 +21,20 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0x0f7d3652" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "amount", type: "uint256", + name: "amount", }, { - name: "data", type: "bytes", + name: "data", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -148,19 +148,8 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -171,5 +160,16 @@ export function mintWithSignature( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/read/totalMinted.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/read/totalMinted.ts index bd7a10125ee..00be5232ce5 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/read/totalMinted.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/read/totalMinted.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa2309ff8" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/burn.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/burn.ts index 794487cb1fd..f0e404d832b 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/burn.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/burn.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "burn" function. @@ -19,12 +19,12 @@ export type BurnParams = WithOverrides<{ export const FN_SELECTOR = "0xfe9d9303" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -123,23 +123,23 @@ export function burn( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.data] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/initialize.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/initialize.ts index 8e8d54b68ed..c176139c21c 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/initialize.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -29,28 +29,28 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x62835ade" as const; const FN_INPUTS = [ { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_owner", type: "address", + name: "_owner", }, { - name: "_modules", type: "address[]", + name: "_modules", }, { - name: "_moduleInstallData", type: "bytes[]", + name: "_moduleInstallData", }, ] as const; const FN_OUTPUTS = [] as const; @@ -170,19 +170,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -195,5 +184,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mint.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mint.ts index 7dc21f0c27f..4b4f3ae9b43 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mint.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mint.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mint" function. @@ -21,20 +21,20 @@ export type MintParams = WithOverrides<{ export const FN_SELECTOR = "0xd2b04fd6" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "amount", type: "uint256", + name: "amount", }, { - name: "baseURI", type: "string", + name: "baseURI", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -144,19 +144,8 @@ export function mint( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -167,5 +156,16 @@ export function mint( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mintWithSignature.ts b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mintWithSignature.ts index 33c6d26c550..00b3b74bad7 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mintWithSignature.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mintWithSignature.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "mintWithSignature" function. @@ -22,24 +22,24 @@ export type MintWithSignatureParams = WithOverrides<{ export const FN_SELECTOR = "0xeb4ada8a" as const; const FN_INPUTS = [ { - name: "to", type: "address", + name: "to", }, { - name: "amount", type: "uint256", + name: "amount", }, { - name: "baseURI", type: "string", + name: "baseURI", }, { - name: "data", type: "bytes", + name: "data", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [] as const; @@ -157,19 +157,8 @@ export function mintWithSignature( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -181,5 +170,16 @@ export function mintWithSignature( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getInstalledModules.ts b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getInstalledModules.ts index 1431afe234c..c3e63b2ed21 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getInstalledModules.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getInstalledModules.ts @@ -1,62 +1,63 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3e429396" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "implementation", type: "address", + name: "implementation", }, { + type: "tuple", + name: "config", components: [ { - name: "registerInstallationCallback", type: "bool", + name: "registerInstallationCallback", }, { - name: "requiredInterfaces", type: "bytes4[]", + name: "requiredInterfaces", }, { - name: "supportedInterfaces", type: "bytes4[]", + name: "supportedInterfaces", }, { + type: "tuple[]", + name: "callbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, ], - name: "callbackFunctions", - type: "tuple[]", }, { + type: "tuple[]", + name: "fallbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "permissionBits", type: "uint256", + name: "permissionBits", }, ], - name: "fallbackFunctions", - type: "tuple[]", }, ], - name: "config", - type: "tuple", }, ], - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getSupportedCallbackFunctions.ts b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getSupportedCallbackFunctions.ts index 3ed05afb70e..719f3b0ae6a 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getSupportedCallbackFunctions.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/getSupportedCallbackFunctions.ts @@ -1,24 +1,25 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xf147db8a" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "mode", type: "uint8", + name: "mode", }, ], - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/supportsInterface.ts b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/supportsInterface.ts index 028c738f9f1..1ae6424e1b4 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/supportsInterface.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/read/supportsInterface.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "supportsInterface" function. @@ -19,8 +19,8 @@ export type SupportsInterfaceParams = { export const FN_SELECTOR = "0x01ffc9a7" as const; const FN_INPUTS = [ { - name: "interfaceID", type: "bytes4", + name: "interfaceID", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/installModule.ts b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/installModule.ts index a99b9fe145c..983aead308b 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/installModule.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/installModule.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "installModule" function. @@ -22,12 +22,12 @@ export type InstallModuleParams = WithOverrides<{ export const FN_SELECTOR = "0x8da798da" as const; const FN_INPUTS = [ { - name: "moduleContract", type: "address", + name: "moduleContract", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -128,23 +128,23 @@ export function installModule( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.moduleContract, resolvedOptions.data] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/uninstallModule.ts b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/uninstallModule.ts index 49defff7752..f8887d33005 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/uninstallModule.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/IModularCore/write/uninstallModule.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "uninstallModule" function. @@ -22,12 +22,12 @@ export type UninstallModuleParams = WithOverrides<{ export const FN_SELECTOR = "0x70c109cd" as const; const FN_INPUTS = [ { - name: "moduleContract", type: "address", + name: "moduleContract", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -128,23 +128,23 @@ export function uninstallModule( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.moduleContract, resolvedOptions.data] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/IModule/read/getModuleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/IModule/read/getModuleConfig.ts index 375cd7455d0..f1360d0e902 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/IModule/read/getModuleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/IModule/read/getModuleConfig.ts @@ -1,52 +1,53 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x89e04e0e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "registerInstallationCallback", type: "bool", + name: "registerInstallationCallback", }, { - name: "requiredInterfaces", type: "bytes4[]", + name: "requiredInterfaces", }, { - name: "supportedInterfaces", type: "bytes4[]", + name: "supportedInterfaces", }, { + type: "tuple[]", + name: "callbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, ], - name: "callbackFunctions", - type: "tuple[]", }, { + type: "tuple[]", + name: "fallbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "permissionBits", type: "uint256", + name: "permissionBits", }, ], - name: "fallbackFunctions", - type: "tuple[]", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts index 1f8b979b0cc..d4cdaf386fb 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesBeforeMintWithSignatureERC1155.ts @@ -22,30 +22,30 @@ export type EncodeBytesBeforeMintWithSignatureERC1155Params = { export const FN_SELECTOR = "0x2e33c806" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesOnInstall.ts index 472bbda5bd9..e352e188aa6 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/encode/encodeBytesOnInstall.ts @@ -15,8 +15,8 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x5d4c0b89" as const; const FN_INPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/module/install.ts index 0b7bb6d7aa4..6371f09be45 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "MintableERC1155"; @@ -55,8 +55,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -92,8 +92,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/read/getSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/read/getSaleConfig.ts index 11d94b6158c..673d7cc1ebf 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/read/getSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/read/getSaleConfig.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcea943ee" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setSaleConfig.ts index 23dc1237e2c..b81647b202d 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setSaleConfig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSaleConfig" function. @@ -21,8 +21,8 @@ export type SetSaleConfigParams = WithOverrides<{ export const FN_SELECTOR = "0xd29a3628" as const; const FN_INPUTS = [ { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setSaleConfig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.primarySaleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setTokenURI.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setTokenURI.ts index 41f55380ad5..eb9899c1979 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setTokenURI.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setTokenURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTokenURI" function. @@ -19,12 +19,12 @@ export type SetTokenURIParams = WithOverrides<{ export const FN_SELECTOR = "0x162094c4" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_tokenURI", type: "string", + name: "_tokenURI", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function setTokenURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId, resolvedOptions.tokenURI] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts index 27c321b1114..7b619ad0290 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesBeforeMintWithSignatureERC20.ts @@ -22,30 +22,30 @@ export type EncodeBytesBeforeMintWithSignatureERC20Params = { export const FN_SELECTOR = "0x76e51eae" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesOnInstall.ts index 472bbda5bd9..e352e188aa6 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/encode/encodeBytesOnInstall.ts @@ -15,8 +15,8 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x5d4c0b89" as const; const FN_INPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/module/install.ts index c24512fd757..7a9aebc778c 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "MintableERC20"; @@ -55,8 +55,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -92,8 +92,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/read/getSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/read/getSaleConfig.ts index f7d4ab4a5f6..64b25a5b2f0 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/read/getSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/read/getSaleConfig.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcea943ee" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/write/setSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/write/setSaleConfig.ts index d22cd1992d7..cbe052bf6ee 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/write/setSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/write/setSaleConfig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSaleConfig" function. @@ -21,8 +21,8 @@ export type SetSaleConfigParams = WithOverrides<{ export const FN_SELECTOR = "0xd29a3628" as const; const FN_INPUTS = [ { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setSaleConfig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.primarySaleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts index 191ca3c367e..fa4ec577b2f 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesBeforeMintWithSignatureERC721.ts @@ -22,30 +22,30 @@ export type EncodeBytesBeforeMintWithSignatureERC721Params = { export const FN_SELECTOR = "0xcab11f42" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "startTimestamp", type: "uint48", + name: "startTimestamp", }, { - name: "endTimestamp", type: "uint48", + name: "endTimestamp", }, { - name: "currency", type: "address", + name: "currency", }, { - name: "pricePerUnit", type: "uint256", + name: "pricePerUnit", }, { - name: "uid", type: "bytes32", + name: "uid", }, ], - name: "params", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesOnInstall.ts index 472bbda5bd9..e352e188aa6 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/encode/encodeBytesOnInstall.ts @@ -15,8 +15,8 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x5d4c0b89" as const; const FN_INPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/events/NewMetadataBatch.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/events/NewMetadataBatch.ts index 590125d7378..ca998dd2c29 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/events/NewMetadataBatch.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/events/NewMetadataBatch.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "NewMetadataBatch" event. @@ -42,8 +42,8 @@ export function newMetadataBatchEvent( filters: NewMetadataBatchEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event NewMetadataBatch(uint256 indexed startTokenIdInclusive, uint256 indexed endTokenIdNonInclusive, string baseURI)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/module/install.ts index df47c808fc8..9b60229de6b 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "MintableERC721"; @@ -55,8 +55,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -92,8 +92,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/read/getSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/read/getSaleConfig.ts index e890af50168..f87c6bd5c9c 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/read/getSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/read/getSaleConfig.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcea943ee" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "primarySaleRecipient", type: "address", + name: "primarySaleRecipient", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/write/setSaleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/write/setSaleConfig.ts index c03481cd89e..2b74aa58d07 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/write/setSaleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/write/setSaleConfig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSaleConfig" function. @@ -21,8 +21,8 @@ export type SetSaleConfigParams = WithOverrides<{ export const FN_SELECTOR = "0xd29a3628" as const; const FN_INPUTS = [ { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setSaleConfig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.primarySaleRecipient] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/module/install.ts index e65b530c488..208a0b32079 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/module/install.ts @@ -48,8 +48,8 @@ export function module(params?: { publisher?: string }) { publisher: params?.publisher, }); return { - data: "0x" as const, module: moduleContract.address as Address, + data: "0x" as const, }; }; } @@ -83,8 +83,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: "0x" as const, moduleName: contractId, + moduleData: "0x" as const, publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/encodeBytesOnInstall.ts index dc0d78919c8..616dc92e9b5 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/encodeBytesOnInstall.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfec7ff72" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/onTokenURI.ts b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/onTokenURI.ts index d035555f3b4..5dc96770798 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/onTokenURI.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/onTokenURI.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "onTokenURI" function. @@ -16,8 +16,8 @@ export type OnTokenURIParams = { export const FN_SELECTOR = "0xcfc0cb96" as const; const FN_INPUTS = [ { - name: "_id", type: "uint256", + name: "_id", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/write/setSharedMetadata.ts b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/write/setSharedMetadata.ts index 2dcb41b5319..7e3187f8f91 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/write/setSharedMetadata.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/write/setSharedMetadata.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setSharedMetadata" function. @@ -27,26 +27,26 @@ export type SetSharedMetadataParams = WithOverrides<{ export const FN_SELECTOR = "0xa7d27d9d" as const; const FN_INPUTS = [ { + type: "tuple", + name: "_metadata", components: [ { - name: "name", type: "string", + name: "name", }, { - name: "description", type: "string", + name: "description", }, { - name: "imageURI", type: "string", + name: "imageURI", }, { - name: "animationURI", type: "string", + name: "animationURI", }, ], - name: "_metadata", - type: "tuple", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,23 +146,23 @@ export function setSharedMetadata( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.metadata] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverCanceled.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverCanceled.ts index b87781e237f..bc9687f3f35 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverCanceled.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverCanceled.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "OwnershipHandoverCanceled" event. @@ -36,7 +36,7 @@ export function ownershipHandoverCanceledEvent( filters: OwnershipHandoverCanceledEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event OwnershipHandoverCanceled(address indexed pendingOwner)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverRequested.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverRequested.ts index c6c082fa6fe..b1a9f4ee776 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverRequested.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipHandoverRequested.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "OwnershipHandoverRequested" event. @@ -36,7 +36,7 @@ export function ownershipHandoverRequestedEvent( filters: OwnershipHandoverRequestedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event OwnershipHandoverRequested(address indexed pendingOwner)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipTransferred.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipTransferred.ts index 8aa28dbb9e4..c951a7071ba 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipTransferred.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/OwnershipTransferred.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "OwnershipTransferred" event. @@ -42,8 +42,8 @@ export function ownershipTransferredEvent( filters: OwnershipTransferredEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/RolesUpdated.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/RolesUpdated.ts index 09855a76d6e..82b3d8935da 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/RolesUpdated.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/events/RolesUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RolesUpdated" event. @@ -40,8 +40,8 @@ export type RolesUpdatedEventFilters = Partial<{ */ export function rolesUpdatedEvent(filters: RolesUpdatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RolesUpdated(address indexed user, uint256 indexed roles)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAllRoles.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAllRoles.ts index 0bdde11a759..b838128393f 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAllRoles.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAllRoles.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "hasAllRoles" function. @@ -17,12 +17,12 @@ export type HasAllRolesParams = { export const FN_SELECTOR = "0x1cd64df4" as const; const FN_INPUTS = [ { - name: "user", type: "address", + name: "user", }, { - name: "roles", type: "uint256", + name: "roles", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAnyRole.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAnyRole.ts index a11783f7b72..d9d0e18c144 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAnyRole.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/hasAnyRole.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "hasAnyRole" function. @@ -17,12 +17,12 @@ export type HasAnyRoleParams = { export const FN_SELECTOR = "0x514e62fc" as const; const FN_INPUTS = [ { - name: "user", type: "address", + name: "user", }, { - name: "roles", type: "uint256", + name: "roles", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/owner.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/owner.ts index 26e37a619e0..94949dba052 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/owner.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/owner.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x8da5cb5b" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "result", type: "address", + name: "result", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/ownershipHandoverExpiresAt.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/ownershipHandoverExpiresAt.ts index 8fe37830db0..10e84ec3171 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/ownershipHandoverExpiresAt.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/ownershipHandoverExpiresAt.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "ownershipHandoverExpiresAt" function. @@ -19,14 +19,14 @@ export type OwnershipHandoverExpiresAtParams = { export const FN_SELECTOR = "0xfee81cf4" as const; const FN_INPUTS = [ { - name: "pendingOwner", type: "address", + name: "pendingOwner", }, ] as const; const FN_OUTPUTS = [ { - name: "result", type: "uint256", + name: "result", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/rolesOf.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/rolesOf.ts index 5450af081eb..0079ccfea7e 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/rolesOf.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/read/rolesOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "rolesOf" function. @@ -16,14 +16,14 @@ export type RolesOfParams = { export const FN_SELECTOR = "0x2de94807" as const; const FN_INPUTS = [ { - name: "user", type: "address", + name: "user", }, ] as const; const FN_OUTPUTS = [ { - name: "roles", type: "uint256", + name: "roles", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/cancelOwnershipHandover.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/cancelOwnershipHandover.ts index 5508806b5ba..603d57d63fc 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/cancelOwnershipHandover.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/cancelOwnershipHandover.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/completeOwnershipHandover.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/completeOwnershipHandover.ts index fbd54080592..84cd06bad6e 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/completeOwnershipHandover.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/completeOwnershipHandover.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "completeOwnershipHandover" function. @@ -21,8 +21,8 @@ export type CompleteOwnershipHandoverParams = WithOverrides<{ export const FN_SELECTOR = "0xf04e283e" as const; const FN_INPUTS = [ { - name: "pendingOwner", type: "address", + name: "pendingOwner", }, ] as const; const FN_OUTPUTS = [] as const; @@ -126,23 +126,23 @@ export function completeOwnershipHandover( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.pendingOwner] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/grantRoles.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/grantRoles.ts index 9a024670bd9..aa00ee8e415 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/grantRoles.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/grantRoles.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "grantRoles" function. @@ -19,12 +19,12 @@ export type GrantRolesParams = WithOverrides<{ export const FN_SELECTOR = "0x1c10893f" as const; const FN_INPUTS = [ { - name: "user", type: "address", + name: "user", }, { - name: "roles", type: "uint256", + name: "roles", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function grantRoles( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.user, resolvedOptions.roles] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceOwnership.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceOwnership.ts index 5371c300c7b..28fa4ef4566 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceOwnership.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceOwnership.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceRoles.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceRoles.ts index f9d7616b494..eb705776b19 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceRoles.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/renounceRoles.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "renounceRoles" function. @@ -18,8 +18,8 @@ export type RenounceRolesParams = WithOverrides<{ export const FN_SELECTOR = "0x183a4f6e" as const; const FN_INPUTS = [ { - name: "roles", type: "uint256", + name: "roles", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function renounceRoles( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.roles] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/requestOwnershipHandover.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/requestOwnershipHandover.ts index e368991836c..fd1aab1c092 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/requestOwnershipHandover.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/requestOwnershipHandover.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/revokeRoles.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/revokeRoles.ts index 2ce4e70aca2..61079b5f6b9 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/revokeRoles.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/revokeRoles.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "revokeRoles" function. @@ -19,12 +19,12 @@ export type RevokeRolesParams = WithOverrides<{ export const FN_SELECTOR = "0x4a4ee7b1" as const; const FN_INPUTS = [ { - name: "user", type: "address", + name: "user", }, { - name: "roles", type: "uint256", + name: "roles", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function revokeRoles( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.user, resolvedOptions.roles] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/transferOwnership.ts b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/transferOwnership.ts index 72369738307..c02c49a5685 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/transferOwnership.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/OwnableRoles/write/transferOwnership.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "transferOwnership" function. @@ -18,8 +18,8 @@ export type TransferOwnershipParams = WithOverrides<{ export const FN_SELECTOR = "0xf2fde38b" as const; const FN_INPUTS = [ { - name: "newOwner", type: "address", + name: "newOwner", }, ] as const; const FN_OUTPUTS = [] as const; @@ -119,23 +119,23 @@ export function transferOwnership( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newOwner] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/encode/encodeBytesOnInstall.ts index 3930834c6e1..f38917a3864 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/encode/encodeBytesOnInstall.ts @@ -23,16 +23,16 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x2fbb2623" as const; const FN_INPUTS = [ { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint16", + name: "royaltyBps", }, { - name: "transferValidator", type: "address", + name: "transferValidator", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/DefaultRoyaltyUpdated.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/DefaultRoyaltyUpdated.ts index 333242c3936..25bc5945a14 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/DefaultRoyaltyUpdated.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/DefaultRoyaltyUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "DefaultRoyaltyUpdated" event. @@ -36,8 +36,8 @@ export function defaultRoyaltyUpdatedEvent( filters: DefaultRoyaltyUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event DefaultRoyaltyUpdated(address indexed recipient, uint16 bps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/TokenRoyaltyUpdated.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/TokenRoyaltyUpdated.ts index 4f783777de5..f90f117f6e3 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/TokenRoyaltyUpdated.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/events/TokenRoyaltyUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokenRoyaltyUpdated" event. @@ -42,8 +42,8 @@ export function tokenRoyaltyUpdatedEvent( filters: TokenRoyaltyUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokenRoyaltyUpdated(uint256 indexed tokenId, address indexed recipient, uint16 bps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/module/install.ts index 62f4448a2a3..b7717a9d368 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "RoyaltyERC1155"; @@ -57,8 +57,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -96,8 +96,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getDefaultRoyaltyInfo.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getDefaultRoyaltyInfo.ts index 79bb9aec7ea..161877a044f 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getDefaultRoyaltyInfo.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getDefaultRoyaltyInfo.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xb24f2d39" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getRoyaltyInfoForToken.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getRoyaltyInfoForToken.ts index 394b63003af..106c526e719 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getRoyaltyInfoForToken.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getRoyaltyInfoForToken.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoyaltyInfoForToken" function. @@ -16,8 +16,8 @@ export type GetRoyaltyInfoForTokenParams = { export const FN_SELECTOR = "0x4cc157df" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidationFunction.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidationFunction.ts index 776b7cf96b2..79049e5fc58 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidationFunction.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidationFunction.ts @@ -1,19 +1,20 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x0d705df6" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "functionSignature", type: "bytes4", + name: "functionSignature", }, { - name: "isViewFunction", type: "bool", + name: "isViewFunction", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidator.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidator.ts index dc5f443de9c..218f32e8641 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidator.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidator.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x098144d4" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "validator", type: "address", + name: "validator", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/royaltyInfo.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/royaltyInfo.ts index c3b89ac1636..a8f3c6855f9 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/royaltyInfo.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/royaltyInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "royaltyInfo" function. @@ -20,22 +20,22 @@ export type RoyaltyInfoParams = { export const FN_SELECTOR = "0x2a55205a" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_salePrice", type: "uint256", + name: "_salePrice", }, ] as const; const FN_OUTPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "royaltyAmount", type: "uint256", + name: "royaltyAmount", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setDefaultRoyaltyInfo.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setDefaultRoyaltyInfo.ts index ce3acf2d779..561504fb0fe 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setDefaultRoyaltyInfo.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setDefaultRoyaltyInfo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setDefaultRoyaltyInfo" function. @@ -25,12 +25,12 @@ export type SetDefaultRoyaltyInfoParams = WithOverrides<{ export const FN_SELECTOR = "0x93d79445" as const; const FN_INPUTS = [ { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint16", + name: "_royaltyBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -138,19 +138,8 @@ export function setDefaultRoyaltyInfo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -159,5 +148,16 @@ export function setDefaultRoyaltyInfo( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setRoyaltyInfoForToken.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setRoyaltyInfoForToken.ts index bce879fd67d..e41fc809383 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setRoyaltyInfoForToken.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setRoyaltyInfoForToken.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setRoyaltyInfoForToken" function. @@ -23,16 +23,16 @@ export type SetRoyaltyInfoForTokenParams = WithOverrides<{ export const FN_SELECTOR = "0xab8e8c44" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_recipient", type: "address", + name: "_recipient", }, { - name: "_bps", type: "uint16", + name: "_bps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,19 +146,8 @@ export function setRoyaltyInfoForToken( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -168,5 +157,16 @@ export function setRoyaltyInfoForToken( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setTransferValidator.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setTransferValidator.ts index e0ebc01e101..2294f18888e 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setTransferValidator.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setTransferValidator.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferValidator" function. @@ -21,8 +21,8 @@ export type SetTransferValidatorParams = WithOverrides<{ export const FN_SELECTOR = "0xa9fc664e" as const; const FN_INPUTS = [ { - name: "validator", type: "address", + name: "validator", }, ] as const; const FN_OUTPUTS = [] as const; @@ -124,23 +124,23 @@ export function setTransferValidator( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.validator] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/encode/encodeBytesOnInstall.ts index 3930834c6e1..f38917a3864 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/encode/encodeBytesOnInstall.ts @@ -23,16 +23,16 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x2fbb2623" as const; const FN_INPUTS = [ { - name: "royaltyRecipient", type: "address", + name: "royaltyRecipient", }, { - name: "royaltyBps", type: "uint16", + name: "royaltyBps", }, { - name: "transferValidator", type: "address", + name: "transferValidator", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/DefaultRoyaltyUpdated.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/DefaultRoyaltyUpdated.ts index 445ff0cd1c6..4051647d5cc 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/DefaultRoyaltyUpdated.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/DefaultRoyaltyUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "DefaultRoyaltyUpdated" event. @@ -36,8 +36,8 @@ export function defaultRoyaltyUpdatedEvent( filters: DefaultRoyaltyUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event DefaultRoyaltyUpdated(address indexed recipient, uint256 bps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/TokenRoyaltyUpdated.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/TokenRoyaltyUpdated.ts index 1f9d3f1785b..75761816d99 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/TokenRoyaltyUpdated.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/events/TokenRoyaltyUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "TokenRoyaltyUpdated" event. @@ -42,8 +42,8 @@ export function tokenRoyaltyUpdatedEvent( filters: TokenRoyaltyUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event TokenRoyaltyUpdated(uint256 indexed tokenId, address indexed recipient, uint16 bps)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/module/install.ts index 5443b949f05..7061f2b4f41 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "RoyaltyERC721"; @@ -57,8 +57,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -96,8 +96,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getDefaultRoyaltyInfo.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getDefaultRoyaltyInfo.ts index ca55810873a..10575fe9af2 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getDefaultRoyaltyInfo.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getDefaultRoyaltyInfo.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xb24f2d39" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getRoyaltyInfoForToken.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getRoyaltyInfoForToken.ts index 3d4af24e62c..6718ff82997 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getRoyaltyInfoForToken.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getRoyaltyInfoForToken.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoyaltyInfoForToken" function. @@ -16,8 +16,8 @@ export type GetRoyaltyInfoForTokenParams = { export const FN_SELECTOR = "0x4cc157df" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidationFunction.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidationFunction.ts index e891734133a..8e50ecc5c12 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidationFunction.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidationFunction.ts @@ -1,19 +1,20 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x0d705df6" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "functionSignature", type: "bytes4", + name: "functionSignature", }, { - name: "isViewFunction", type: "bool", + name: "isViewFunction", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidator.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidator.ts index 178845eae52..a4c7f3198e9 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidator.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidator.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x098144d4" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "validator", type: "address", + name: "validator", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/royaltyInfo.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/royaltyInfo.ts index 474b1820f22..521ca3e83a4 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/royaltyInfo.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/royaltyInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "royaltyInfo" function. @@ -20,22 +20,22 @@ export type RoyaltyInfoParams = { export const FN_SELECTOR = "0x2a55205a" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_salePrice", type: "uint256", + name: "_salePrice", }, ] as const; const FN_OUTPUTS = [ { - name: "receiver", type: "address", + name: "receiver", }, { - name: "royaltyAmount", type: "uint256", + name: "royaltyAmount", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setDefaultRoyaltyInfo.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setDefaultRoyaltyInfo.ts index c795304efef..db307f59b19 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setDefaultRoyaltyInfo.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setDefaultRoyaltyInfo.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setDefaultRoyaltyInfo" function. @@ -25,12 +25,12 @@ export type SetDefaultRoyaltyInfoParams = WithOverrides<{ export const FN_SELECTOR = "0x93d79445" as const; const FN_INPUTS = [ { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint16", + name: "_royaltyBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -138,19 +138,8 @@ export function setDefaultRoyaltyInfo( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -159,5 +148,16 @@ export function setDefaultRoyaltyInfo( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setRoyaltyInfoForToken.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setRoyaltyInfoForToken.ts index 3596a985a30..cd56610879a 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setRoyaltyInfoForToken.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setRoyaltyInfoForToken.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setRoyaltyInfoForToken" function. @@ -23,16 +23,16 @@ export type SetRoyaltyInfoForTokenParams = WithOverrides<{ export const FN_SELECTOR = "0xab8e8c44" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, { - name: "_recipient", type: "address", + name: "_recipient", }, { - name: "_bps", type: "uint16", + name: "_bps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -146,19 +146,8 @@ export function setRoyaltyInfoForToken( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -168,5 +157,16 @@ export function setRoyaltyInfoForToken( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setTransferValidator.ts b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setTransferValidator.ts index f1a38cc3b14..10ec0919cb2 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setTransferValidator.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setTransferValidator.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferValidator" function. @@ -21,8 +21,8 @@ export type SetTransferValidatorParams = WithOverrides<{ export const FN_SELECTOR = "0xa9fc664e" as const; const FN_INPUTS = [ { - name: "validator", type: "address", + name: "validator", }, ] as const; const FN_OUTPUTS = [] as const; @@ -124,23 +124,23 @@ export function setTransferValidator( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.validator] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/encode/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/encode/encodeBytesOnInstall.ts index 715ef2901f7..308f4bc860a 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/encode/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/encode/encodeBytesOnInstall.ts @@ -15,8 +15,8 @@ export type EncodeBytesOnInstallParams = { export const FN_SELECTOR = "0x579a6021" as const; const FN_INPUTS = [ { - name: "startTokenId", type: "uint256", + name: "startTokenId", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/module/install.ts index 4259c6a152e..ce28b48f975 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/module/install.ts @@ -4,12 +4,12 @@ import type { ThirdwebContract } from "../../../../../contract/contract.js"; import type { PreparedTransaction } from "../../../../../transaction/prepare-transaction.js"; import type { Address } from "../../../../../utils/address.js"; import type { Account } from "../../../../../wallets/interfaces/wallet.js"; -import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; -import { installPublishedModule } from "../../../common/installPublishedModule.js"; import { type EncodeBytesOnInstallParams, encodeBytesOnInstallParams, } from "../encode/encodeBytesOnInstall.js"; +import { getOrDeployModule } from "../../../common/getOrDeployModule.js"; +import { installPublishedModule } from "../../../common/installPublishedModule.js"; const contractId = "SequentialTokenIdERC1155"; @@ -55,8 +55,8 @@ export function module( publisher: params?.publisher, }); return { - data: encodeInstall(params), module: moduleContract.address as Address, + data: encodeInstall(params), }; }; } @@ -92,8 +92,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: encodeInstall(options.params), moduleName: contractId, + moduleData: encodeInstall(options.params), publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getModuleConfig.ts b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getModuleConfig.ts index d9ce9b9a5b9..4750da4f484 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getModuleConfig.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getModuleConfig.ts @@ -1,53 +1,54 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x89e04e0e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "config", components: [ { - name: "registerInstallationCallback", type: "bool", + name: "registerInstallationCallback", }, { - name: "requiredInterfaces", type: "bytes4[]", + name: "requiredInterfaces", }, { - name: "supportedInterfaces", type: "bytes4[]", + name: "supportedInterfaces", }, { + type: "tuple[]", + name: "callbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, ], - name: "callbackFunctions", - type: "tuple[]", }, { + type: "tuple[]", + name: "fallbackFunctions", components: [ { - name: "selector", type: "bytes4", + name: "selector", }, { - name: "permissionBits", type: "uint256", + name: "permissionBits", }, ], - name: "fallbackFunctions", - type: "tuple[]", }, ], - name: "config", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getNextTokenId.ts b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getNextTokenId.ts index bd993363080..5f09bcb32ac 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getNextTokenId.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getNextTokenId.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcaa0f92a" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/write/updateTokenIdERC1155.ts b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/write/updateTokenIdERC1155.ts index eaa624292f0..698a143391c 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/write/updateTokenIdERC1155.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/write/updateTokenIdERC1155.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "updateTokenIdERC1155" function. @@ -18,8 +18,8 @@ export type UpdateTokenIdERC1155Params = WithOverrides<{ export const FN_SELECTOR = "0x034eb4dd" as const; const FN_INPUTS = [ { - name: "_tokenId", type: "uint256", + name: "_tokenId", }, ] as const; const FN_OUTPUTS = [ @@ -125,23 +125,23 @@ export function updateTokenIdERC1155( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.tokenId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/module/install.ts index 08bc5943cf9..5d31516a063 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/module/install.ts @@ -48,8 +48,8 @@ export function module(params?: { publisher?: string }) { publisher: params?.publisher, }); return { - data: "0x" as const, module: moduleContract.address as Address, + data: "0x" as const, }; }; } @@ -83,8 +83,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: "0x" as const, moduleName: contractId, + moduleData: "0x" as const, publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/encodeBytesOnInstall.ts index a96c96e2a66..5fe0ab63e3a 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/encodeBytesOnInstall.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfec7ff72" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabled.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabled.ts index 6b6d99356cf..5e91dbb0878 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabled.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabled.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcca5dcb6" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabledFor.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabledFor.ts index b148b098f53..9c3942e30e3 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabledFor.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabledFor.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isTransferEnabledFor" function. @@ -16,8 +16,8 @@ export type IsTransferEnabledForParams = { export const FN_SELECTOR = "0x735d0538" as const; const FN_INPUTS = [ { - name: "target", type: "address", + name: "target", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferable.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferable.ts index 931c64cc23c..586ec8163af 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferable.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferable.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferable" function. @@ -21,8 +21,8 @@ export type SetTransferableParams = WithOverrides<{ export const FN_SELECTOR = "0x9cd23707" as const; const FN_INPUTS = [ { - name: "enableTransfer", type: "bool", + name: "enableTransfer", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setTransferable( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.enableTransfer] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferableFor.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferableFor.ts index f09c0328a29..fc521da4fc5 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferableFor.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferableFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferableFor" function. @@ -22,12 +22,12 @@ export type SetTransferableForParams = WithOverrides<{ export const FN_SELECTOR = "0x4c297cbd" as const; const FN_INPUTS = [ { - name: "target", type: "address", + name: "target", }, { - name: "enableTransfer", type: "bool", + name: "enableTransfer", }, ] as const; const FN_OUTPUTS = [] as const; @@ -133,23 +133,23 @@ export function setTransferableFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.target, resolvedOptions.enableTransfer] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/module/install.ts index 565fe2593d5..c847d48cab4 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/module/install.ts @@ -48,8 +48,8 @@ export function module(params?: { publisher?: string }) { publisher: params?.publisher, }); return { - data: "0x" as const, module: moduleContract.address as Address, + data: "0x" as const, }; }; } @@ -83,8 +83,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: "0x" as const, moduleName: contractId, + moduleData: "0x" as const, publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/encodeBytesOnInstall.ts index 33d073e5146..f2282b92fe8 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/encodeBytesOnInstall.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfec7ff72" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabled.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabled.ts index 62ccbd551ab..03a1c407723 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabled.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabled.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcca5dcb6" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabledFor.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabledFor.ts index b6f36081ea6..370d8312c2e 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabledFor.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabledFor.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isTransferEnabledFor" function. @@ -16,8 +16,8 @@ export type IsTransferEnabledForParams = { export const FN_SELECTOR = "0x735d0538" as const; const FN_INPUTS = [ { - name: "target", type: "address", + name: "target", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferable.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferable.ts index b5096a9a7bd..893845f2478 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferable.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferable.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferable" function. @@ -21,8 +21,8 @@ export type SetTransferableParams = WithOverrides<{ export const FN_SELECTOR = "0x9cd23707" as const; const FN_INPUTS = [ { - name: "enableTransfer", type: "bool", + name: "enableTransfer", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setTransferable( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.enableTransfer] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferableFor.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferableFor.ts index 55ff5f1e4d3..b075bc48f49 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferableFor.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferableFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferableFor" function. @@ -22,12 +22,12 @@ export type SetTransferableForParams = WithOverrides<{ export const FN_SELECTOR = "0x4c297cbd" as const; const FN_INPUTS = [ { - name: "target", type: "address", + name: "target", }, { - name: "enableTransfer", type: "bool", + name: "enableTransfer", }, ] as const; const FN_OUTPUTS = [] as const; @@ -133,23 +133,23 @@ export function setTransferableFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.target, resolvedOptions.enableTransfer] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/module/install.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/module/install.ts index afd927bc4be..4f83bb4478d 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/module/install.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/module/install.ts @@ -48,8 +48,8 @@ export function module(params?: { publisher?: string }) { publisher: params?.publisher, }); return { - data: "0x" as const, module: moduleContract.address as Address, + data: "0x" as const, }; }; } @@ -83,8 +83,8 @@ export function install(options: { return installPublishedModule({ account: options.account, contract: options.contract, - moduleData: "0x" as const, moduleName: contractId, + moduleData: "0x" as const, publisher: options.params?.publisher, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/encodeBytesOnInstall.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/encodeBytesOnInstall.ts index 6e17d1c53f7..bf376a7ff49 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/encodeBytesOnInstall.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/encodeBytesOnInstall.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfec7ff72" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabled.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabled.ts index 19244f93174..d15e0f67619 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabled.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabled.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcca5dcb6" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabledFor.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabledFor.ts index 30f28d06d3c..7ce195f07a7 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabledFor.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabledFor.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "isTransferEnabledFor" function. @@ -16,8 +16,8 @@ export type IsTransferEnabledForParams = { export const FN_SELECTOR = "0x735d0538" as const; const FN_INPUTS = [ { - name: "target", type: "address", + name: "target", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferable.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferable.ts index 1a9467f6a60..6c553cf6db0 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferable.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferable.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferable" function. @@ -21,8 +21,8 @@ export type SetTransferableParams = WithOverrides<{ export const FN_SELECTOR = "0x9cd23707" as const; const FN_INPUTS = [ { - name: "enableTransfer", type: "bool", + name: "enableTransfer", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setTransferable( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.enableTransfer] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferableFor.ts b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferableFor.ts index fc9691076ff..27bb4135660 100644 --- a/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferableFor.ts +++ b/packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferableFor.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setTransferableFor" function. @@ -22,12 +22,12 @@ export type SetTransferableForParams = WithOverrides<{ export const FN_SELECTOR = "0x4c297cbd" as const; const FN_INPUTS = [ { - name: "target", type: "address", + name: "target", }, { - name: "enableTransfer", type: "bool", + name: "enableTransfer", }, ] as const; const FN_OUTPUTS = [] as const; @@ -133,23 +133,23 @@ export function setTransferableFor( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.target, resolvedOptions.enableTransfer] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBasefee.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBasefee.ts index 89315b85fd4..af544c422c1 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBasefee.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBasefee.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3e64a696" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "basefee", type: "uint256", + name: "basefee", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockHash.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockHash.ts index 1cae461b7f6..3884c555518 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockHash.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockHash.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getBlockHash" function. @@ -19,14 +19,14 @@ export type GetBlockHashParams = { export const FN_SELECTOR = "0xee82ac5e" as const; const FN_INPUTS = [ { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, ] as const; const FN_OUTPUTS = [ { - name: "blockHash", type: "bytes32", + name: "blockHash", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockNumber.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockNumber.ts index 1778d07fb55..c14e8ec22b4 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockNumber.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getBlockNumber.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x42cbb15c" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getChainId.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getChainId.ts index e838cdbbd89..13081555936 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getChainId.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getChainId.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3408e470" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "chainid", type: "uint256", + name: "chainid", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockCoinbase.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockCoinbase.ts index f0a479e8f6d..7f20ac5749c 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockCoinbase.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockCoinbase.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa8b0574e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "coinbase", type: "address", + name: "coinbase", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockDifficulty.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockDifficulty.ts index 54792ffa12e..38a3806a0cc 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockDifficulty.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockDifficulty.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x72425d9d" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "difficulty", type: "uint256", + name: "difficulty", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockGasLimit.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockGasLimit.ts index 101ac59bd58..7ce8741e849 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockGasLimit.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockGasLimit.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x86d516e8" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "gaslimit", type: "uint256", + name: "gaslimit", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockTimestamp.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockTimestamp.ts index 84891a0d046..02daf1735db 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockTimestamp.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getCurrentBlockTimestamp.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x0f28c97d" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "timestamp", type: "uint256", + name: "timestamp", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getEthBalance.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getEthBalance.ts index 0f5f3c88fae..30dca5d1fba 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getEthBalance.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getEthBalance.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getEthBalance" function. @@ -16,14 +16,14 @@ export type GetEthBalanceParams = { export const FN_SELECTOR = "0x4d2301cc" as const; const FN_INPUTS = [ { - name: "addr", type: "address", + name: "addr", }, ] as const; const FN_OUTPUTS = [ { - name: "balance", type: "uint256", + name: "balance", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getLastBlockHash.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getLastBlockHash.ts index 080524bd944..f1a2b78e80e 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getLastBlockHash.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/read/getLastBlockHash.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x27e86d6e" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "blockHash", type: "bytes32", + name: "blockHash", }, ] as const; diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate.ts index d12a1873521..f8dd64f3895 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "aggregate" function. @@ -25,28 +25,28 @@ export type AggregateParams = WithOverrides<{ export const FN_SELECTOR = "0x252dba42" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "callData", type: "bytes", + name: "callData", }, ], - name: "calls", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [ { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, { - name: "returnData", type: "bytes[]", + name: "returnData", }, ] as const; @@ -143,23 +143,23 @@ export function aggregate( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.calls] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3.ts index a996711c929..d93589faf77 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "aggregate3" function. @@ -26,38 +26,38 @@ export type Aggregate3Params = WithOverrides<{ export const FN_SELECTOR = "0x82ad56cb" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "allowFailure", type: "bool", + name: "allowFailure", }, { - name: "callData", type: "bytes", + name: "callData", }, ], - name: "calls", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "returnData", components: [ { - name: "success", type: "bool", + name: "success", }, { - name: "returnData", type: "bytes", + name: "returnData", }, ], - name: "returnData", - type: "tuple[]", }, ] as const; @@ -154,23 +154,23 @@ export function aggregate3( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.calls] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3Value.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3Value.ts index 51477184ea9..c08826f923c 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3Value.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/aggregate3Value.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "aggregate3Value" function. @@ -27,42 +27,42 @@ export type Aggregate3ValueParams = WithOverrides<{ export const FN_SELECTOR = "0x174dea71" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "allowFailure", type: "bool", + name: "allowFailure", }, { - name: "value", type: "uint256", + name: "value", }, { - name: "callData", type: "bytes", + name: "callData", }, ], - name: "calls", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "returnData", components: [ { - name: "success", type: "bool", + name: "success", }, { - name: "returnData", type: "bytes", + name: "returnData", }, ], - name: "returnData", - type: "tuple[]", }, ] as const; @@ -159,23 +159,23 @@ export function aggregate3Value( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.calls] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/blockAndAggregate.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/blockAndAggregate.ts index eff1237ea72..aaad8b8ba9d 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/blockAndAggregate.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/blockAndAggregate.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "blockAndAggregate" function. @@ -25,42 +25,42 @@ export type BlockAndAggregateParams = WithOverrides<{ export const FN_SELECTOR = "0xc3077fa9" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "callData", type: "bytes", + name: "callData", }, ], - name: "calls", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [ { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, { - name: "blockHash", type: "bytes32", + name: "blockHash", }, { + type: "tuple[]", + name: "returnData", components: [ { - name: "success", type: "bool", + name: "success", }, { - name: "returnData", type: "bytes", + name: "returnData", }, ], - name: "returnData", - type: "tuple[]", }, ] as const; @@ -159,23 +159,23 @@ export function blockAndAggregate( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.calls] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryAggregate.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryAggregate.ts index bf87fb34568..2e262064045 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryAggregate.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryAggregate.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tryAggregate" function. @@ -29,38 +29,38 @@ export type TryAggregateParams = WithOverrides<{ export const FN_SELECTOR = "0xbce38bd7" as const; const FN_INPUTS = [ { - name: "requireSuccess", type: "bool", + name: "requireSuccess", }, { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "callData", type: "bytes", + name: "callData", }, ], - name: "calls", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "returnData", components: [ { - name: "success", type: "bool", + name: "success", }, { - name: "returnData", type: "bytes", + name: "returnData", }, ], - name: "returnData", - type: "tuple[]", }, ] as const; @@ -163,23 +163,23 @@ export function tryAggregate( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.requireSuccess, resolvedOptions.calls] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryBlockAndAggregate.ts b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryBlockAndAggregate.ts index 2c750751ccd..148eb873fc5 100644 --- a/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryBlockAndAggregate.ts +++ b/packages/thirdweb/src/extensions/multicall3/__generated__/IMulticall3/write/tryBlockAndAggregate.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "tryBlockAndAggregate" function. @@ -29,46 +29,46 @@ export type TryBlockAndAggregateParams = WithOverrides<{ export const FN_SELECTOR = "0x399542e9" as const; const FN_INPUTS = [ { - name: "requireSuccess", type: "bool", + name: "requireSuccess", }, { + type: "tuple[]", + name: "calls", components: [ { - name: "target", type: "address", + name: "target", }, { - name: "callData", type: "bytes", + name: "callData", }, ], - name: "calls", - type: "tuple[]", }, ] as const; const FN_OUTPUTS = [ { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, { - name: "blockHash", type: "bytes32", + name: "blockHash", }, { + type: "tuple[]", + name: "returnData", components: [ { - name: "success", type: "bool", + name: "success", }, { - name: "returnData", type: "bytes", + name: "returnData", }, ], - name: "returnData", - type: "tuple[]", }, ] as const; @@ -175,23 +175,23 @@ export function tryBlockAndAggregate( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.requireSuccess, resolvedOptions.calls] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackCreated.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackCreated.ts index 7f7e59e4970..85a8404f8e8 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackCreated.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackCreated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackCreated" event. @@ -34,8 +34,8 @@ export type PackCreatedEventFilters = Partial<{ */ export function packCreatedEvent(filters: PackCreatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event PackCreated(uint256 indexed packId, address recipient, uint256 totalPacksCreated)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackOpened.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackOpened.ts index eb67785465c..34e6efaa1fe 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackOpened.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackOpened.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackOpened" event. @@ -40,8 +40,8 @@ export type PackOpenedEventFilters = Partial<{ */ export function packOpenedEvent(filters: PackOpenedEventFilters = {}) { return prepareEvent({ - filters, signature: "event PackOpened(uint256 indexed packId, address indexed opener, uint256 numOfPacksOpened, (address assetContract, uint8 tokenType, uint256 tokenId, uint256 totalAmount)[] rewardUnitsDistributed)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackUpdated.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackUpdated.ts index 27908200057..5858c8f0520 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackUpdated.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/events/PackUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackUpdated" event. @@ -34,8 +34,8 @@ export type PackUpdatedEventFilters = Partial<{ */ export function packUpdatedEvent(filters: PackUpdatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event PackUpdated(uint256 indexed packId, address recipient, uint256 totalPacksCreated)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/canUpdatePack.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/canUpdatePack.ts index 18d152fdf41..8f713d143a3 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/canUpdatePack.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/canUpdatePack.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "canUpdatePack" function. @@ -16,8 +16,8 @@ export type CanUpdatePackParams = { export const FN_SELECTOR = "0xb0381b08" as const; const FN_INPUTS = [ { - name: "_key", type: "uint256", + name: "_key", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getPackContents.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getPackContents.ts index f455965d931..233d0176ef1 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getPackContents.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getPackContents.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPackContents" function. @@ -16,36 +16,36 @@ export type GetPackContentsParams = { export const FN_SELECTOR = "0x8d4c446a" as const; const FN_INPUTS = [ { - name: "_packId", type: "uint256", + name: "_packId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "contents", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - name: "contents", - type: "tuple[]", }, { - name: "perUnitAmounts", type: "uint256[]", + name: "perUnitAmounts", }, ] as const; diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenCountOfBundle.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenCountOfBundle.ts index 6cca3c47cf2..63551a691f3 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenCountOfBundle.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenCountOfBundle.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getTokenCountOfBundle" function. @@ -16,8 +16,8 @@ export type GetTokenCountOfBundleParams = { export const FN_SELECTOR = "0xd0d2fe25" as const; const FN_INPUTS = [ { - name: "_bundleId", type: "uint256", + name: "_bundleId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenOfBundle.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenOfBundle.ts index 6129e13d9d4..6d3292d8791 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenOfBundle.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getTokenOfBundle.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getTokenOfBundle" function. @@ -17,35 +17,35 @@ export type GetTokenOfBundleParams = { export const FN_SELECTOR = "0x1da799c9" as const; const FN_INPUTS = [ { - name: "_bundleId", type: "uint256", + name: "_bundleId", }, { - name: "index", type: "uint256", + name: "index", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getUriOfBundle.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getUriOfBundle.ts index 5d808e4b42c..9991755461f 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getUriOfBundle.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/read/getUriOfBundle.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getUriOfBundle" function. @@ -16,8 +16,8 @@ export type GetUriOfBundleParams = { export const FN_SELECTOR = "0x61195e94" as const; const FN_INPUTS = [ { - name: "_bundleId", type: "uint256", + name: "_bundleId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/addPackContents.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/addPackContents.ts index c4a1a4dc21d..25f164cd723 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/addPackContents.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/addPackContents.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "addPackContents" function. @@ -36,48 +36,48 @@ export type AddPackContentsParams = WithOverrides<{ export const FN_SELECTOR = "0xa96b1438" as const; const FN_INPUTS = [ { - name: "_packId", type: "uint256", + name: "_packId", }, { + type: "tuple[]", + name: "_contents", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - name: "_contents", - type: "tuple[]", }, { - name: "_numOfRewardUnits", type: "uint256[]", + name: "_numOfRewardUnits", }, { - name: "_recipient", type: "address", + name: "_recipient", }, ] as const; const FN_OUTPUTS = [ { - name: "packTotalSupply", type: "uint256", + name: "packTotalSupply", }, { - name: "newSupplyAdded", type: "uint256", + name: "newSupplyAdded", }, ] as const; @@ -188,19 +188,8 @@ export function addPackContents( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -211,5 +200,16 @@ export function addPackContents( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/createPack.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/createPack.ts index be63061314e..b73f6efe6e4 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/createPack.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/createPack.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createPack" function. @@ -44,56 +44,56 @@ export type CreatePackParams = WithOverrides<{ export const FN_SELECTOR = "0x092e6075" as const; const FN_INPUTS = [ { + type: "tuple[]", + name: "contents", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - name: "contents", - type: "tuple[]", }, { - name: "numOfRewardUnits", type: "uint256[]", + name: "numOfRewardUnits", }, { - name: "packUri", type: "string", + name: "packUri", }, { - name: "openStartTimestamp", type: "uint128", + name: "openStartTimestamp", }, { - name: "amountDistributedPerOpen", type: "uint128", + name: "amountDistributedPerOpen", }, { - name: "recipient", type: "address", + name: "recipient", }, ] as const; const FN_OUTPUTS = [ { - name: "packId", type: "uint256", + name: "packId", }, { - name: "packTotalSupply", type: "uint256", + name: "packTotalSupply", }, ] as const; @@ -212,19 +212,8 @@ export function createPack( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -237,5 +226,16 @@ export function createPack( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/openPack.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/openPack.ts index 97ca8cb2c9d..cb086aedfcd 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/openPack.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPack/write/openPack.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "openPack" function. @@ -22,35 +22,35 @@ export type OpenPackParams = WithOverrides<{ export const FN_SELECTOR = "0x914e126a" as const; const FN_INPUTS = [ { - name: "packId", type: "uint256", + name: "packId", }, { - name: "amountToOpen", type: "uint256", + name: "amountToOpen", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - type: "tuple[]", }, ] as const; @@ -148,23 +148,23 @@ export function openPack( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.packId, resolvedOptions.amountToOpen] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackOpenRequested.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackOpenRequested.ts index 1c57f1ecb1b..dc0b6ac9be2 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackOpenRequested.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackOpenRequested.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackOpenRequested" event. @@ -42,8 +42,8 @@ export function packOpenRequestedEvent( filters: PackOpenRequestedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PackOpenRequested(address indexed opener, uint256 indexed packId, uint256 amountToOpen, uint256 requestId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts index 031826194c5..dac830eb692 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/events/PackRandomnessFulfilled.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PackRandomnessFulfilled" event. @@ -42,8 +42,8 @@ export function packRandomnessFulfilledEvent( filters: PackRandomnessFulfilledEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PackRandomnessFulfilled(uint256 indexed packId, uint256 indexed requestId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/read/canClaimRewards.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/read/canClaimRewards.ts index 80e8a798a58..cac29e8419e 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/read/canClaimRewards.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/read/canClaimRewards.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "canClaimRewards" function. @@ -16,8 +16,8 @@ export type CanClaimRewardsParams = { export const FN_SELECTOR = "0xa9b47a66" as const; const FN_INPUTS = [ { - name: "_opener", type: "address", + name: "_opener", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/claimRewards.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/claimRewards.ts index bdc6de9c6d2..381d4d1006c 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/claimRewards.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/claimRewards.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; @@ -7,26 +7,26 @@ export const FN_SELECTOR = "0x372500ab" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "rewardUnits", components: [ { - name: "assetContract", type: "address", + name: "assetContract", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "totalAmount", type: "uint256", + name: "totalAmount", }, ], - name: "rewardUnits", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts index ad89f183adb..bc954a62d72 100644 --- a/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts +++ b/packages/thirdweb/src/extensions/pack/__generated__/IPackVRFDirect/write/openPackAndClaimRewards.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "openPackAndClaimRewards" function. @@ -26,16 +26,16 @@ export type OpenPackAndClaimRewardsParams = WithOverrides<{ export const FN_SELECTOR = "0xac296b3f" as const; const FN_INPUTS = [ { - name: "_packId", type: "uint256", + name: "_packId", }, { - name: "_amountToOpen", type: "uint256", + name: "_amountToOpen", }, { - name: "_callBackGasLimit", type: "uint32", + name: "_callBackGasLimit", }, ] as const; const FN_OUTPUTS = [ @@ -153,19 +153,8 @@ export function openPackAndClaimRewards( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -175,5 +164,16 @@ export function openPackAndClaimRewards( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleAdminChanged.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleAdminChanged.ts index ee99c86ea03..01a5c361ce1 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleAdminChanged.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleAdminChanged.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoleAdminChanged" event. @@ -48,8 +48,8 @@ export function roleAdminChangedEvent( filters: RoleAdminChangedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleGranted.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleGranted.ts index b6b837ece97..91f566246e0 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleGranted.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleGranted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoleGranted" event. @@ -46,8 +46,8 @@ export type RoleGrantedEventFilters = Partial<{ */ export function roleGrantedEvent(filters: RoleGrantedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleRevoked.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleRevoked.ts index 601f4413c5d..91fcab84e65 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleRevoked.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/events/RoleRevoked.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoleRevoked" event. @@ -46,8 +46,8 @@ export type RoleRevokedEventFilters = Partial<{ */ export function roleRevokedEvent(filters: RoleRevokedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/getRoleAdmin.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/getRoleAdmin.ts index 47d44113063..142c73b479c 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/getRoleAdmin.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/getRoleAdmin.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoleAdmin" function. @@ -16,8 +16,8 @@ export type GetRoleAdminParams = { export const FN_SELECTOR = "0x248a9ca3" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/hasRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/hasRole.ts index f62f3380b91..44c5782708b 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/hasRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/read/hasRole.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "hasRole" function. @@ -17,12 +17,12 @@ export type HasRoleParams = { export const FN_SELECTOR = "0x91d14854" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/grantRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/grantRole.ts index 63cc21447cb..d1a4941ec7c 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/grantRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/grantRole.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "grantRole" function. @@ -19,12 +19,12 @@ export type GrantRoleParams = WithOverrides<{ export const FN_SELECTOR = "0x2f2ff15d" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function grantRole( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.role, resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/renounceRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/renounceRole.ts index e24baa2bb0c..c6e5e3be592 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/renounceRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/renounceRole.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "renounceRole" function. @@ -19,12 +19,12 @@ export type RenounceRoleParams = WithOverrides<{ export const FN_SELECTOR = "0x36568abe" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function renounceRole( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.role, resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/revokeRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/revokeRole.ts index 78c0b88ae38..114846fcd0d 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/revokeRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissions/write/revokeRole.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "revokeRole" function. @@ -19,12 +19,12 @@ export type RevokeRoleParams = WithOverrides<{ export const FN_SELECTOR = "0xd547741f" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function revokeRole( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.role, resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleAdminChanged.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleAdminChanged.ts index ee99c86ea03..01a5c361ce1 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleAdminChanged.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleAdminChanged.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoleAdminChanged" event. @@ -48,8 +48,8 @@ export function roleAdminChangedEvent( filters: RoleAdminChangedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleGranted.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleGranted.ts index b6b837ece97..91f566246e0 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleGranted.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleGranted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoleGranted" event. @@ -46,8 +46,8 @@ export type RoleGrantedEventFilters = Partial<{ */ export function roleGrantedEvent(filters: RoleGrantedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleRevoked.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleRevoked.ts index 601f4413c5d..91fcab84e65 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleRevoked.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/events/RoleRevoked.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RoleRevoked" event. @@ -46,8 +46,8 @@ export type RoleRevokedEventFilters = Partial<{ */ export function roleRevokedEvent(filters: RoleRevokedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleAdmin.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleAdmin.ts index 47d44113063..142c73b479c 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleAdmin.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleAdmin.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoleAdmin" function. @@ -16,8 +16,8 @@ export type GetRoleAdminParams = { export const FN_SELECTOR = "0x248a9ca3" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMember.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMember.ts index d07f9e82b32..c1eed901f0f 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMember.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMember.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoleMember" function. @@ -17,12 +17,12 @@ export type GetRoleMemberParams = { export const FN_SELECTOR = "0x9010d07c" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "index", type: "uint256", + name: "index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMemberCount.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMemberCount.ts index 2ef53c1b07c..d6255b64f06 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMemberCount.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/getRoleMemberCount.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getRoleMemberCount" function. @@ -16,8 +16,8 @@ export type GetRoleMemberCountParams = { export const FN_SELECTOR = "0xca15c873" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/hasRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/hasRole.ts index f62f3380b91..44c5782708b 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/hasRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/read/hasRole.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "hasRole" function. @@ -17,12 +17,12 @@ export type HasRoleParams = { export const FN_SELECTOR = "0x91d14854" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/grantRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/grantRole.ts index 63cc21447cb..d1a4941ec7c 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/grantRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/grantRole.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "grantRole" function. @@ -19,12 +19,12 @@ export type GrantRoleParams = WithOverrides<{ export const FN_SELECTOR = "0x2f2ff15d" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function grantRole( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.role, resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/renounceRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/renounceRole.ts index e24baa2bb0c..c6e5e3be592 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/renounceRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/renounceRole.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "renounceRole" function. @@ -19,12 +19,12 @@ export type RenounceRoleParams = WithOverrides<{ export const FN_SELECTOR = "0x36568abe" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function renounceRole( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.role, resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/revokeRole.ts b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/revokeRole.ts index 78c0b88ae38..114846fcd0d 100644 --- a/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/revokeRole.ts +++ b/packages/thirdweb/src/extensions/permissions/__generated__/IPermissionsEnumerable/write/revokeRole.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "revokeRole" function. @@ -19,12 +19,12 @@ export type RevokeRoleParams = WithOverrides<{ export const FN_SELECTOR = "0xd547741f" as const; const FN_INPUTS = [ { - name: "role", type: "bytes32", + name: "role", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -125,23 +125,23 @@ export function revokeRole( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.role, resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC1155/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC1155/write/initialize.ts index 52eae2fe169..c4c449c8056 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC1155/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC1155/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -51,44 +51,44 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xe1591634" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint128", + name: "_royaltyBps", }, { - name: "_platformFeeBps", type: "uint128", + name: "_platformFeeBps", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -224,19 +224,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -253,5 +242,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC20/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC20/write/initialize.ts index 274ea20dd28..9fccd394f82 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC20/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC20/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -43,36 +43,36 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x49c5c5b6" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, { - name: "_platformFeeBps", type: "uint128", + name: "_platformFeeBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -200,19 +200,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -227,5 +216,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC721/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC721/write/initialize.ts index 52eae2fe169..c4c449c8056 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC721/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/DropERC721/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -51,44 +51,44 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xe1591634" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint128", + name: "_royaltyBps", }, { - name: "_platformFeeBps", type: "uint128", + name: "_platformFeeBps", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -224,19 +224,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -253,5 +242,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/Marketplace/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/Marketplace/write/initialize.ts index afd8adc4244..926c5ad6b8c 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/Marketplace/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/Marketplace/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -37,24 +37,24 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xaaae5633" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, { - name: "_platformFeeBps", type: "uint16", + name: "_platformFeeBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -170,19 +170,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -194,5 +183,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/OpenEditionERC721/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/OpenEditionERC721/write/initialize.ts index 593b1a9ae8a..b5c91d37dd1 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/OpenEditionERC721/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/OpenEditionERC721/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -43,36 +43,36 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x49c5c5b6" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint128", + name: "_royaltyBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -200,19 +200,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -227,5 +216,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/Pack/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/Pack/write/initialize.ts index c91ceb8b30e..dd971b7f2f4 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/Pack/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/Pack/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -39,32 +39,32 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x754b8fe7" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint256", + name: "_royaltyBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -188,19 +188,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -214,5 +203,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/Split/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/Split/write/initialize.ts index 1eecf8ddaf0..898c849c688 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/Split/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/Split/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -31,24 +31,24 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xb1a14437" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_payees", type: "address[]", + name: "_payees", }, { - name: "_shares", type: "uint256[]", + name: "_shares", }, ] as const; const FN_OUTPUTS = [] as const; @@ -164,19 +164,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -188,5 +177,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC1155/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC1155/write/initialize.ts index e5c2007a36a..8159cb1cf0d 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC1155/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC1155/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -51,44 +51,44 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xe1591634" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint128", + name: "_royaltyBps", }, { - name: "_platformFeeBps", type: "uint128", + name: "_platformFeeBps", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -224,19 +224,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -253,5 +242,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC20/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC20/write/initialize.ts index d7bd411370f..68d91821e86 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC20/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC20/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -43,36 +43,36 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xdfad80a6" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_primarySaleRecipient", type: "address", + name: "_primarySaleRecipient", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, { - name: "_platformFeeBps", type: "uint256", + name: "_platformFeeBps", }, ] as const; const FN_OUTPUTS = [] as const; @@ -200,19 +200,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -227,5 +216,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC721/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC721/write/initialize.ts index 52eae2fe169..c4c449c8056 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC721/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/TokenERC721/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -51,44 +51,44 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0xe1591634" as const; const FN_INPUTS = [ { - name: "_defaultAdmin", type: "address", + name: "_defaultAdmin", }, { - name: "_name", type: "string", + name: "_name", }, { - name: "_symbol", type: "string", + name: "_symbol", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_saleRecipient", type: "address", + name: "_saleRecipient", }, { - name: "_royaltyRecipient", type: "address", + name: "_royaltyRecipient", }, { - name: "_royaltyBps", type: "uint128", + name: "_royaltyBps", }, { - name: "_platformFeeBps", type: "uint128", + name: "_platformFeeBps", }, { - name: "_platformFeeRecipient", type: "address", + name: "_platformFeeRecipient", }, ] as const; const FN_OUTPUTS = [] as const; @@ -224,19 +224,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -253,5 +242,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/prebuilts/__generated__/VoteERC20/write/initialize.ts b/packages/thirdweb/src/extensions/prebuilts/__generated__/VoteERC20/write/initialize.ts index 9e6fdd28aa3..2ce2e181c53 100644 --- a/packages/thirdweb/src/extensions/prebuilts/__generated__/VoteERC20/write/initialize.ts +++ b/packages/thirdweb/src/extensions/prebuilts/__generated__/VoteERC20/write/initialize.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "initialize" function. @@ -43,36 +43,36 @@ export type InitializeParams = WithOverrides<{ export const FN_SELECTOR = "0x7cf43f8d" as const; const FN_INPUTS = [ { - name: "_name", type: "string", + name: "_name", }, { - name: "_contractURI", type: "string", + name: "_contractURI", }, { - name: "_trustedForwarders", type: "address[]", + name: "_trustedForwarders", }, { - name: "_token", type: "address", + name: "_token", }, { - name: "_initialVotingDelay", type: "uint256", + name: "_initialVotingDelay", }, { - name: "_initialVotingPeriod", type: "uint256", + name: "_initialVotingPeriod", }, { - name: "_initialProposalThreshold", type: "uint256", + name: "_initialProposalThreshold", }, { - name: "_initialVoteQuorumFraction", type: "uint256", + name: "_initialVoteQuorumFraction", }, ] as const; const FN_OUTPUTS = [] as const; @@ -200,19 +200,8 @@ export function initialize( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -227,5 +216,16 @@ export function initialize( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/read/payee.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/read/payee.ts index 62e10b946de..78ca9f193c6 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/read/payee.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/read/payee.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "payee" function. @@ -16,8 +16,8 @@ export type PayeeParams = { export const FN_SELECTOR = "0x8b83209b" as const; const FN_INPUTS = [ { - name: "index", type: "uint256", + name: "index", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/read/payeeCount.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/read/payeeCount.ts index 3a1d7c9f2da..ca0a1d2018b 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/read/payeeCount.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/read/payeeCount.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x00dbe109" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/read/releasable.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/read/releasable.ts index c6de9aba5b8..5b08e87a951 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/read/releasable.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/read/releasable.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "releasable" function. @@ -16,8 +16,8 @@ export type ReleasableParams = { export const FN_SELECTOR = "0xa3f8eace" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/read/released.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/read/released.ts index 3563fa67f9d..6e4946af5fd 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/read/released.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/read/released.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "released" function. @@ -16,8 +16,8 @@ export type ReleasedParams = { export const FN_SELECTOR = "0x9852595c" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/read/shares.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/read/shares.ts index ab616ea8dc4..b8a0402e720 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/read/shares.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/read/shares.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "shares" function. @@ -16,8 +16,8 @@ export type SharesParams = { export const FN_SELECTOR = "0xce7c2ac2" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalReleased.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalReleased.ts index f83e68fedbb..ee0ae7881a6 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalReleased.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalReleased.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe33b7de3" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalShares.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalShares.ts index e36396a24c7..878318ebe64 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalShares.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/read/totalShares.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3a98ef39" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/write/distribute.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/write/distribute.ts index ae168c8df86..10c3a66ef3a 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/write/distribute.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/write/distribute.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/split/__generated__/Split/write/release.ts b/packages/thirdweb/src/extensions/split/__generated__/Split/write/release.ts index f8170be5ac4..b3bd48606b0 100644 --- a/packages/thirdweb/src/extensions/split/__generated__/Split/write/release.ts +++ b/packages/thirdweb/src/extensions/split/__generated__/Split/write/release.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "release" function. @@ -18,8 +18,8 @@ export type ReleaseParams = WithOverrides<{ export const FN_SELECTOR = "0x19165587" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function release( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.account] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/read/codehashVersion.ts b/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/read/codehashVersion.ts index 4dec920df54..ac53dea215b 100644 --- a/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/read/codehashVersion.ts +++ b/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/read/codehashVersion.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "codehashVersion" function. @@ -16,14 +16,14 @@ export type CodehashVersionParams = { export const FN_SELECTOR = "0xd70c0ca7" as const; const FN_INPUTS = [ { - name: "codehash", type: "bytes32", + name: "codehash", }, ] as const; const FN_OUTPUTS = [ { - name: "version", type: "uint16", + name: "version", }, ] as const; diff --git a/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/write/activateProgram.ts b/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/write/activateProgram.ts index bd2994597f1..1fb37500877 100644 --- a/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/write/activateProgram.ts +++ b/packages/thirdweb/src/extensions/stylus/__generated__/IArbWasm/write/activateProgram.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "activateProgram" function. @@ -18,8 +18,8 @@ export type ActivateProgramParams = WithOverrides<{ export const FN_SELECTOR = "0x58c780c2" as const; const FN_INPUTS = [ { - name: "program", type: "address", + name: "program", }, ] as const; const FN_OUTPUTS = [ @@ -124,23 +124,23 @@ export function activateProgram( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.program] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/stylus/__generated__/IStylusConstructor/write/stylus_constructor.ts b/packages/thirdweb/src/extensions/stylus/__generated__/IStylusConstructor/write/stylus_constructor.ts index ec91e868b68..619043655dc 100644 --- a/packages/thirdweb/src/extensions/stylus/__generated__/IStylusConstructor/write/stylus_constructor.ts +++ b/packages/thirdweb/src/extensions/stylus/__generated__/IStylusConstructor/write/stylus_constructor.ts @@ -1,5 +1,5 @@ -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; diff --git a/packages/thirdweb/src/extensions/stylus/__generated__/IStylusDeployer/write/deploy.ts b/packages/thirdweb/src/extensions/stylus/__generated__/IStylusDeployer/write/deploy.ts index bf1c111839f..76b4a890529 100644 --- a/packages/thirdweb/src/extensions/stylus/__generated__/IStylusDeployer/write/deploy.ts +++ b/packages/thirdweb/src/extensions/stylus/__generated__/IStylusDeployer/write/deploy.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "deploy" function. @@ -24,20 +24,20 @@ export type DeployParams = WithOverrides<{ export const FN_SELECTOR = "0xa9a8e4e9" as const; const FN_INPUTS = [ { - name: "bytecode", type: "bytes", + name: "bytecode", }, { - name: "initData", type: "bytes", + name: "initData", }, { - name: "initValue", type: "uint256", + name: "initValue", }, { - name: "salt", type: "bytes32", + name: "salt", }, ] as const; const FN_OUTPUTS = [ @@ -151,19 +151,8 @@ export function deploy( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -174,5 +163,16 @@ export function deploy( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/read/appURI.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/read/appURI.ts index ec59487b8e8..46f16ea3875 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/read/appURI.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/read/appURI.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x094ec830" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/write/setAppURI.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/write/setAppURI.ts index 73aa2497ff6..0432d51a0f9 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/write/setAppURI.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IAppURI/write/setAppURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setAppURI" function. @@ -18,8 +18,8 @@ export type SetAppURIParams = WithOverrides<{ export const FN_SELECTOR = "0xfea18082" as const; const FN_INPUTS = [ { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function setAppURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployed.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployed.ts index 281d0697df8..bc0db42d912 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployed.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ProxyDeployed" event. @@ -40,8 +40,8 @@ export type ProxyDeployedEventFilters = Partial<{ */ export function proxyDeployedEvent(filters: ProxyDeployedEventFilters = {}) { return prepareEvent({ - filters, signature: "event ProxyDeployed(address indexed implementation, address proxy, address indexed deployer)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployedV2.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployedV2.ts index 44cf4fe1793..ecf298f13a1 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployedV2.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/events/ProxyDeployedV2.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ProxyDeployedV2" event. @@ -48,8 +48,8 @@ export function proxyDeployedV2Event( filters: ProxyDeployedV2EventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ProxyDeployedV2(address indexed implementation, address indexed proxy, address indexed deployer, bytes32 inputSalt, bytes data, bytes extraData)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementation.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementation.ts index ce0d0a2c98e..c7eee5a47d3 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementation.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementation.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "deployProxyByImplementation" function. @@ -23,16 +23,16 @@ export type DeployProxyByImplementationParams = WithOverrides<{ export const FN_SELECTOR = "0x11b804ab" as const; const FN_INPUTS = [ { - name: "implementation", type: "address", + name: "implementation", }, { - name: "data", type: "bytes", + name: "data", }, { - name: "salt", type: "bytes32", + name: "salt", }, ] as const; const FN_OUTPUTS = [ @@ -150,19 +150,8 @@ export function deployProxyByImplementation( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -172,5 +161,16 @@ export function deployProxyByImplementation( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementationV2.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementationV2.ts index cf91f261d41..6918e6fc719 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementationV2.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractFactory/write/deployProxyByImplementationV2.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "deployProxyByImplementationV2" function. @@ -24,20 +24,20 @@ export type DeployProxyByImplementationV2Params = WithOverrides<{ export const FN_SELECTOR = "0xd057c8b1" as const; const FN_INPUTS = [ { - name: "implementation", type: "address", + name: "implementation", }, { - name: "data", type: "bytes", + name: "data", }, { - name: "salt", type: "bytes32", + name: "salt", }, { - name: "extraData", type: "bytes", + name: "extraData", }, ] as const; const FN_OUTPUTS = [ @@ -159,19 +159,8 @@ export function deployProxyByImplementationV2( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -182,5 +171,16 @@ export function deployProxyByImplementationV2( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractPublished.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractPublished.ts index 756cc6f3e75..a7581368a99 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractPublished.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractPublished.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ContractPublished" event. @@ -42,8 +42,8 @@ export function contractPublishedEvent( filters: ContractPublishedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ContractPublished(address indexed operator, address indexed publisher, (string contractId, uint256 publishTimestamp, string publishMetadataUri, bytes32 bytecodeHash, address implementation) publishedContract)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractUnpublished.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractUnpublished.ts index d5c0c6d5527..3fdc9a44132 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractUnpublished.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/ContractUnpublished.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ContractUnpublished" event. @@ -48,8 +48,8 @@ export function contractUnpublishedEvent( filters: ContractUnpublishedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ContractUnpublished(address indexed operator, address indexed publisher, string indexed contractId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/PublisherProfileUpdated.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/PublisherProfileUpdated.ts index f149393f44b..952bbb39f58 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/PublisherProfileUpdated.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/events/PublisherProfileUpdated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PublisherProfileUpdated" event. @@ -36,8 +36,8 @@ export function publisherProfileUpdatedEvent( filters: PublisherProfileUpdatedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event PublisherProfileUpdated(address indexed publisher, string prevURI, string newURI)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getAllPublishedContracts.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getAllPublishedContracts.ts index f8d9d8c3329..3ebf22f4d5a 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getAllPublishedContracts.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getAllPublishedContracts.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAllPublishedContracts" function. @@ -19,36 +19,36 @@ export type GetAllPublishedContractsParams = { export const FN_SELECTOR = "0xaf8db690" as const; const FN_INPUTS = [ { - name: "publisher", type: "address", + name: "publisher", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "published", components: [ { - name: "contractId", type: "string", + name: "contractId", }, { - name: "publishTimestamp", type: "uint256", + name: "publishTimestamp", }, { - name: "publishMetadataUri", type: "string", + name: "publishMetadataUri", }, { - name: "bytecodeHash", type: "bytes32", + name: "bytecodeHash", }, { - name: "implementation", type: "address", + name: "implementation", }, ], - name: "published", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContract.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContract.ts index 1779b66b970..f75744abb19 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContract.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContract.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPublishedContract" function. @@ -23,40 +23,40 @@ export type GetPublishedContractParams = { export const FN_SELECTOR = "0x7ec047fa" as const; const FN_INPUTS = [ { - name: "publisher", type: "address", + name: "publisher", }, { - name: "contractId", type: "string", + name: "contractId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple", + name: "published", components: [ { - name: "contractId", type: "string", + name: "contractId", }, { - name: "publishTimestamp", type: "uint256", + name: "publishTimestamp", }, { - name: "publishMetadataUri", type: "string", + name: "publishMetadataUri", }, { - name: "bytecodeHash", type: "bytes32", + name: "bytecodeHash", }, { - name: "implementation", type: "address", + name: "implementation", }, ], - name: "published", - type: "tuple", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContractVersions.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContractVersions.ts index 6a7f3ed3a73..40b31842870 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContractVersions.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedContractVersions.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPublishedContractVersions" function. @@ -23,40 +23,40 @@ export type GetPublishedContractVersionsParams = { export const FN_SELECTOR = "0x80251dac" as const; const FN_INPUTS = [ { - name: "publisher", type: "address", + name: "publisher", }, { - name: "contractId", type: "string", + name: "contractId", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "published", components: [ { - name: "contractId", type: "string", + name: "contractId", }, { - name: "publishTimestamp", type: "uint256", + name: "publishTimestamp", }, { - name: "publishMetadataUri", type: "string", + name: "publishMetadataUri", }, { - name: "bytecodeHash", type: "bytes32", + name: "bytecodeHash", }, { - name: "implementation", type: "address", + name: "implementation", }, ], - name: "published", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedUriFromCompilerUri.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedUriFromCompilerUri.ts index d5cefe1c3f3..e8506e61a6d 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedUriFromCompilerUri.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublishedUriFromCompilerUri.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPublishedUriFromCompilerUri" function. @@ -19,14 +19,14 @@ export type GetPublishedUriFromCompilerUriParams = { export const FN_SELECTOR = "0x819e992f" as const; const FN_INPUTS = [ { - name: "compilerMetadataUri", type: "string", + name: "compilerMetadataUri", }, ] as const; const FN_OUTPUTS = [ { - name: "publishedMetadataUris", type: "string[]", + name: "publishedMetadataUris", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublisherProfileUri.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublisherProfileUri.ts index 10f803b6e41..98a7af736c7 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublisherProfileUri.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/read/getPublisherProfileUri.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPublisherProfileUri" function. @@ -19,14 +19,14 @@ export type GetPublisherProfileUriParams = { export const FN_SELECTOR = "0x4f781675" as const; const FN_INPUTS = [ { - name: "publisher", type: "address", + name: "publisher", }, ] as const; const FN_OUTPUTS = [ { - name: "uri", type: "string", + name: "uri", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/publishContract.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/publishContract.ts index 8eb1035a5ca..27b37ddbe45 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/publishContract.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/publishContract.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "publishContract" function. @@ -41,28 +41,28 @@ export type PublishContractParams = WithOverrides<{ export const FN_SELECTOR = "0xd50299e6" as const; const FN_INPUTS = [ { - name: "publisher", type: "address", + name: "publisher", }, { - name: "contractId", type: "string", + name: "contractId", }, { - name: "publishMetadataUri", type: "string", + name: "publishMetadataUri", }, { - name: "compilerMetadataUri", type: "string", + name: "compilerMetadataUri", }, { - name: "bytecodeHash", type: "bytes32", + name: "bytecodeHash", }, { - name: "implementation", type: "address", + name: "implementation", }, ] as const; const FN_OUTPUTS = [] as const; @@ -182,19 +182,8 @@ export function publishContract( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -207,5 +196,16 @@ export function publishContract( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/setPublisherProfileUri.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/setPublisherProfileUri.ts index aa618eedd09..ed3e71f44a2 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/setPublisherProfileUri.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/setPublisherProfileUri.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setPublisherProfileUri" function. @@ -22,12 +22,12 @@ export type SetPublisherProfileUriParams = WithOverrides<{ export const FN_SELECTOR = "0x6e578e54" as const; const FN_INPUTS = [ { - name: "publisher", type: "address", + name: "publisher", }, { - name: "uri", type: "string", + name: "uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -134,23 +134,23 @@ export function setPublisherProfileUri( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.publisher, resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/unpublishContract.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/unpublishContract.ts index 9c835cfff23..5c5b15fdc91 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/unpublishContract.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IContractPublisher/write/unpublishContract.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "unpublishContract" function. @@ -25,12 +25,12 @@ export type UnpublishContractParams = WithOverrides<{ export const FN_SELECTOR = "0x06eb56cc" as const; const FN_INPUTS = [ { - name: "publisher", type: "address", + name: "publisher", }, { - name: "contractId", type: "string", + name: "contractId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -136,23 +136,23 @@ export function unpublishContract( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.publisher, resolvedOptions.contractId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleCreated.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleCreated.ts index 89bae55fec4..104a865aaff 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleCreated.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleCreated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RuleCreated" event. @@ -34,8 +34,8 @@ export type RuleCreatedEventFilters = Partial<{ */ export function ruleCreatedEvent(filters: RuleCreatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RuleCreated(bytes32 indexed ruleId, (bytes32 ruleId, address token, uint8 tokenType, uint256 tokenId, uint256 balance, uint256 score, uint8 ruleType) rule)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleDeleted.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleDeleted.ts index d49aa30069a..67e1736ab9b 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleDeleted.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RuleDeleted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RuleDeleted" event. @@ -34,7 +34,7 @@ export type RuleDeletedEventFilters = Partial<{ */ export function ruleDeletedEvent(filters: RuleDeletedEventFilters = {}) { return prepareEvent({ - filters, signature: "event RuleDeleted(bytes32 indexed ruleId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RulesEngineOverriden.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RulesEngineOverriden.ts index 3058ceb2afd..03a28920054 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RulesEngineOverriden.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/events/RulesEngineOverriden.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RulesEngineOverriden" event. @@ -36,7 +36,7 @@ export function rulesEngineOverridenEvent( filters: RulesEngineOverridenEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event RulesEngineOverriden(address indexed newRulesEngine)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getAllRules.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getAllRules.ts index ba836cf5188..a89a1d00220 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getAllRules.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getAllRules.ts @@ -1,45 +1,46 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x1184aef2" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "rules", components: [ { - name: "ruleId", type: "bytes32", + name: "ruleId", }, { - name: "token", type: "address", + name: "token", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "balance", type: "uint256", + name: "balance", }, { - name: "score", type: "uint256", + name: "score", }, { - name: "ruleType", type: "uint8", + name: "ruleType", }, ], - name: "rules", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getRulesEngineOverride.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getRulesEngineOverride.ts index 5258456d62a..f374d148564 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getRulesEngineOverride.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getRulesEngineOverride.ts @@ -1,15 +1,16 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa7145eb4" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { - name: "rulesEngineAddress", type: "address", + name: "rulesEngineAddress", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getScore.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getScore.ts index 118ea4765b4..5e5b14f615f 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getScore.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/read/getScore.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getScore" function. @@ -19,14 +19,14 @@ export type GetScoreParams = { export const FN_SELECTOR = "0xd47875d0" as const; const FN_INPUTS = [ { - name: "_tokenOwner", type: "address", + name: "_tokenOwner", }, ] as const; const FN_OUTPUTS = [ { - name: "score", type: "uint256", + name: "score", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleMultiplicative.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleMultiplicative.ts index 708421fe18d..8f2dde241dd 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleMultiplicative.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleMultiplicative.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createRuleMultiplicative" function. @@ -27,32 +27,32 @@ export type CreateRuleMultiplicativeParams = WithOverrides<{ export const FN_SELECTOR = "0x1e2e9cb5" as const; const FN_INPUTS = [ { + type: "tuple", + name: "rule", components: [ { - name: "token", type: "address", + name: "token", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "scorePerOwnedToken", type: "uint256", + name: "scorePerOwnedToken", }, ], - name: "rule", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "ruleId", type: "bytes32", + name: "ruleId", }, ] as const; @@ -155,23 +155,23 @@ export function createRuleMultiplicative( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.rule] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleThreshold.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleThreshold.ts index ea16c30dc1f..846a085d5b5 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleThreshold.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/createRuleThreshold.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createRuleThreshold" function. @@ -28,36 +28,36 @@ export type CreateRuleThresholdParams = WithOverrides<{ export const FN_SELECTOR = "0x1022a25e" as const; const FN_INPUTS = [ { + type: "tuple", + name: "rule", components: [ { - name: "token", type: "address", + name: "token", }, { - name: "tokenType", type: "uint8", + name: "tokenType", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, { - name: "balance", type: "uint256", + name: "balance", }, { - name: "score", type: "uint256", + name: "score", }, ], - name: "rule", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "ruleId", type: "bytes32", + name: "ruleId", }, ] as const; @@ -156,23 +156,23 @@ export function createRuleThreshold( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.rule] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/deleteRule.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/deleteRule.ts index 31f0de9b86c..605a10a3feb 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/deleteRule.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/deleteRule.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "deleteRule" function. @@ -18,8 +18,8 @@ export type DeleteRuleParams = WithOverrides<{ export const FN_SELECTOR = "0x9d907761" as const; const FN_INPUTS = [ { - name: "ruleId", type: "bytes32", + name: "ruleId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function deleteRule( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.ruleId] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/setRulesEngineOverride.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/setRulesEngineOverride.ts index b42aa90b0a3..704af13404f 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/setRulesEngineOverride.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IRulesEngine/write/setRulesEngineOverride.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setRulesEngineOverride" function. @@ -21,8 +21,8 @@ export type SetRulesEngineOverrideParams = WithOverrides<{ export const FN_SELECTOR = "0x0eb0adb6" as const; const FN_INPUTS = [ { - name: "_rulesEngineAddress", type: "address", + name: "_rulesEngineAddress", }, ] as const; const FN_OUTPUTS = [] as const; @@ -126,23 +126,23 @@ export function setRulesEngineOverride( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.rulesEngineAddress] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/events/RequestExecuted.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/events/RequestExecuted.ts index 103ba42602c..06a90ad62ff 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/events/RequestExecuted.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/events/RequestExecuted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "RequestExecuted" event. @@ -42,8 +42,8 @@ export function requestExecutedEvent( filters: RequestExecutedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event RequestExecuted(address indexed user, address indexed signer, (uint128 validityStartTimestamp, uint128 validityEndTimestamp, bytes32 uid, bytes data) _req)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/read/verify.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/read/verify.ts index 416b10cdeb4..fde6a54b1a7 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/read/verify.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ISignatureAction/read/verify.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "verify" function. @@ -26,40 +26,40 @@ export type VerifyParams = { export const FN_SELECTOR = "0xc4376dd7" as const; const FN_INPUTS = [ { + type: "tuple", + name: "req", components: [ { - name: "validityStartTimestamp", type: "uint128", + name: "validityStartTimestamp", }, { - name: "validityEndTimestamp", type: "uint128", + name: "validityEndTimestamp", }, { - name: "uid", type: "bytes32", + name: "uid", }, { - name: "data", type: "bytes", + name: "data", }, ], - name: "req", - type: "tuple", }, { - name: "signature", type: "bytes", + name: "signature", }, ] as const; const FN_OUTPUTS = [ { - name: "success", type: "bool", + name: "success", }, { - name: "signer", type: "address", + name: "signer", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWFee/read/getFeeInfo.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWFee/read/getFeeInfo.ts index 8ca983f087a..db4ca066a73 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWFee/read/getFeeInfo.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWFee/read/getFeeInfo.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getFeeInfo" function. @@ -17,22 +17,22 @@ export type GetFeeInfoParams = { export const FN_SELECTOR = "0x85b49ad0" as const; const FN_INPUTS = [ { - name: "_proxy", type: "address", + name: "_proxy", }, { - name: "_type", type: "uint256", + name: "_type", }, ] as const; const FN_OUTPUTS = [ { - name: "recipient", type: "address", + name: "recipient", }, { - name: "bps", type: "uint256", + name: "bps", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Added.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Added.ts index a7bd17c4176..40dd0fc17f8 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Added.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Added.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Added" event. @@ -46,8 +46,8 @@ export type AddedEventFilters = Partial<{ */ export function addedEvent(filters: AddedEventFilters = {}) { return prepareEvent({ - filters, signature: "event Added(address indexed deployer, address indexed deployment, uint256 indexed chainId, string metadataUri)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Deleted.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Deleted.ts index 8daf7a56c1b..66fb7bdc924 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Deleted.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/events/Deleted.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "Deleted" event. @@ -46,8 +46,8 @@ export type DeletedEventFilters = Partial<{ */ export function deletedEvent(filters: DeletedEventFilters = {}) { return prepareEvent({ - filters, signature: "event Deleted(address indexed deployer, address indexed deployment, uint256 indexed chainId)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/count.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/count.ts index d180091e31d..546a25e9dc1 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/count.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/count.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "count" function. @@ -16,14 +16,14 @@ export type CountParams = { export const FN_SELECTOR = "0x05d85eda" as const; const FN_INPUTS = [ { - name: "_deployer", type: "address", + name: "_deployer", }, ] as const; const FN_OUTPUTS = [ { - name: "deploymentCount", type: "uint256", + name: "deploymentCount", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getAll.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getAll.ts index d2e648e1b3c..43d29ec079f 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getAll.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getAll.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getAll" function. @@ -16,28 +16,28 @@ export type GetAllParams = { export const FN_SELECTOR = "0xeb077342" as const; const FN_INPUTS = [ { - name: "_deployer", type: "address", + name: "_deployer", }, ] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "allDeployments", components: [ { - name: "deploymentAddress", type: "address", + name: "deploymentAddress", }, { - name: "chainId", type: "uint256", + name: "chainId", }, { - name: "metadataURI", type: "string", + name: "metadataURI", }, ], - name: "allDeployments", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getMetadataUri.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getMetadataUri.ts index 7fa8bc8d256..b51c3652736 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getMetadataUri.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/read/getMetadataUri.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getMetadataUri" function. @@ -20,18 +20,18 @@ export type GetMetadataUriParams = { export const FN_SELECTOR = "0xf4c2012d" as const; const FN_INPUTS = [ { - name: "_chainId", type: "uint256", + name: "_chainId", }, { - name: "_deployment", type: "address", + name: "_deployment", }, ] as const; const FN_OUTPUTS = [ { - name: "metadataUri", type: "string", + name: "metadataUri", }, ] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/add.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/add.ts index 16f44e82e66..1de66810ea7 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/add.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/add.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "add" function. @@ -27,20 +27,20 @@ export type AddParams = WithOverrides<{ export const FN_SELECTOR = "0x26c5b516" as const; const FN_INPUTS = [ { - name: "_deployer", type: "address", + name: "_deployer", }, { - name: "_deployment", type: "address", + name: "_deployment", }, { - name: "_chainId", type: "uint256", + name: "_chainId", }, { - name: "metadataUri", type: "string", + name: "metadataUri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -150,19 +150,8 @@ export function add( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -173,5 +162,16 @@ export function add( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/remove.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/remove.ts index 49949360631..58b3d8ee112 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/remove.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/ITWMultichainRegistry/write/remove.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "remove" function. @@ -23,16 +23,16 @@ export type RemoveParams = WithOverrides<{ export const FN_SELECTOR = "0x59e5fd04" as const; const FN_INPUTS = [ { - name: "_deployer", type: "address", + name: "_deployer", }, { - name: "_deployment", type: "address", + name: "_deployment", }, { - name: "_chainId", type: "uint256", + name: "_chainId", }, ] as const; const FN_OUTPUTS = [] as const; @@ -138,19 +138,8 @@ export function remove( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -160,5 +149,16 @@ export function remove( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractType.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractType.ts index 0a11a4eda0d..e05dc87b740 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractType.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractType.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcb2ef6f7" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractURI.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractURI.ts index ff69d4ffd6b..23912c3e211 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractURI.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractURI.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xe8a3d485" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractVersion.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractVersion.ts index 3b6693d9579..9dcc8a6a8fa 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractVersion.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/read/contractVersion.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xa0a8e460" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/write/setContractURI.ts b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/write/setContractURI.ts index 005bdc41676..73284334c06 100644 --- a/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/write/setContractURI.ts +++ b/packages/thirdweb/src/extensions/thirdweb/__generated__/IThirdwebContract/write/setContractURI.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setContractURI" function. @@ -18,8 +18,8 @@ export type SetContractURIParams = WithOverrides<{ export const FN_SELECTOR = "0x938e3d7b" as const; const FN_INPUTS = [ { - name: "_uri", type: "string", + name: "_uri", }, ] as const; const FN_OUTPUTS = [] as const; @@ -117,23 +117,23 @@ export function setContractURI( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.uri] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInput.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInput.ts index 17b942605db..a5b2de9ba3d 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInput.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInput.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "quoteExactInput" function. @@ -19,18 +19,18 @@ export type QuoteExactInputParams = WithOverrides<{ export const FN_SELECTOR = "0xcdca1753" as const; const FN_INPUTS = [ { - name: "path", type: "bytes", + name: "path", }, { - name: "amountIn", type: "uint256", + name: "amountIn", }, ] as const; const FN_OUTPUTS = [ { - name: "amountOut", type: "uint256", + name: "amountOut", }, ] as const; @@ -130,23 +130,23 @@ export function quoteExactInput( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.path, resolvedOptions.amountIn] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInputSingle.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInputSingle.ts index d7c41d1dd30..e2f2bd0b25f 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInputSingle.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactInputSingle.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "quoteExactInputSingle" function. @@ -25,30 +25,30 @@ export type QuoteExactInputSingleParams = WithOverrides<{ export const FN_SELECTOR = "0xf7729d43" as const; const FN_INPUTS = [ { - name: "tokenIn", type: "address", + name: "tokenIn", }, { - name: "tokenOut", type: "address", + name: "tokenOut", }, { - name: "fee", type: "uint24", + name: "fee", }, { - name: "amountIn", type: "uint256", + name: "amountIn", }, { - name: "sqrtPriceLimitX96", type: "uint160", + name: "sqrtPriceLimitX96", }, ] as const; const FN_OUTPUTS = [ { - name: "amountOut", type: "uint256", + name: "amountOut", }, ] as const; @@ -167,19 +167,8 @@ export function quoteExactInputSingle( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -191,5 +180,16 @@ export function quoteExactInputSingle( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutput.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutput.ts index 256a91b26a4..e70abf27fa9 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutput.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutput.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "quoteExactOutput" function. @@ -22,18 +22,18 @@ export type QuoteExactOutputParams = WithOverrides<{ export const FN_SELECTOR = "0x2f80bb1d" as const; const FN_INPUTS = [ { - name: "path", type: "bytes", + name: "path", }, { - name: "amountOut", type: "uint256", + name: "amountOut", }, ] as const; const FN_OUTPUTS = [ { - name: "amountIn", type: "uint256", + name: "amountIn", }, ] as const; @@ -133,23 +133,23 @@ export function quoteExactOutput( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.path, resolvedOptions.amountOut] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutputSingle.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutputSingle.ts index 664bccb2532..40571bef183 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutputSingle.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IQuoter/write/quoteExactOutputSingle.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "quoteExactOutputSingle" function. @@ -28,30 +28,30 @@ export type QuoteExactOutputSingleParams = WithOverrides<{ export const FN_SELECTOR = "0x30d07f21" as const; const FN_INPUTS = [ { - name: "tokenIn", type: "address", + name: "tokenIn", }, { - name: "tokenOut", type: "address", + name: "tokenOut", }, { - name: "fee", type: "uint24", + name: "fee", }, { - name: "amountOut", type: "uint256", + name: "amountOut", }, { - name: "sqrtPriceLimitX96", type: "uint160", + name: "sqrtPriceLimitX96", }, ] as const; const FN_OUTPUTS = [ { - name: "amountIn", type: "uint256", + name: "amountIn", }, ] as const; @@ -172,19 +172,8 @@ export function quoteExactOutputSingle( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -196,5 +185,16 @@ export function quoteExactOutputSingle( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInput.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInput.ts index 2122be61c0b..62b9d01cce6 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInput.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInput.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "exactInput" function. @@ -28,36 +28,36 @@ export type ExactInputParams = WithOverrides<{ export const FN_SELECTOR = "0xc04b8d59" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "path", type: "bytes", + name: "path", }, { - name: "recipient", type: "address", + name: "recipient", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "amountIn", type: "uint256", + name: "amountIn", }, { - name: "amountOutMinimum", type: "uint256", + name: "amountOutMinimum", }, ], - name: "params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "amountOut", type: "uint256", + name: "amountOut", }, ] as const; @@ -154,23 +154,23 @@ export function exactInput( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInputSingle.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInputSingle.ts index 16ef0dc642e..7e3abba3449 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInputSingle.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactInputSingle.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "exactInputSingle" function. @@ -31,48 +31,48 @@ export type ExactInputSingleParams = WithOverrides<{ export const FN_SELECTOR = "0x414bf389" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "tokenIn", type: "address", + name: "tokenIn", }, { - name: "tokenOut", type: "address", + name: "tokenOut", }, { - name: "fee", type: "uint24", + name: "fee", }, { - name: "recipient", type: "address", + name: "recipient", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "amountIn", type: "uint256", + name: "amountIn", }, { - name: "amountOutMinimum", type: "uint256", + name: "amountOutMinimum", }, { - name: "sqrtPriceLimitX96", type: "uint160", + name: "sqrtPriceLimitX96", }, ], - name: "params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "amountOut", type: "uint256", + name: "amountOut", }, ] as const; @@ -169,23 +169,23 @@ export function exactInputSingle( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutput.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutput.ts index 940aa4c4349..dcbeb08a4a1 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutput.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutput.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "exactOutput" function. @@ -28,36 +28,36 @@ export type ExactOutputParams = WithOverrides<{ export const FN_SELECTOR = "0xf28c0498" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "path", type: "bytes", + name: "path", }, { - name: "recipient", type: "address", + name: "recipient", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "amountOut", type: "uint256", + name: "amountOut", }, { - name: "amountInMaximum", type: "uint256", + name: "amountInMaximum", }, ], - name: "params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "amountIn", type: "uint256", + name: "amountIn", }, ] as const; @@ -154,23 +154,23 @@ export function exactOutput( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutputSingle.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutputSingle.ts index ab60bfb7b4c..da33aaa7b58 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutputSingle.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/ISwapRouter/write/exactOutputSingle.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "exactOutputSingle" function. @@ -31,48 +31,48 @@ export type ExactOutputSingleParams = WithOverrides<{ export const FN_SELECTOR = "0xdb3e2198" as const; const FN_INPUTS = [ { + type: "tuple", + name: "params", components: [ { - name: "tokenIn", type: "address", + name: "tokenIn", }, { - name: "tokenOut", type: "address", + name: "tokenOut", }, { - name: "fee", type: "uint24", + name: "fee", }, { - name: "recipient", type: "address", + name: "recipient", }, { - name: "deadline", type: "uint256", + name: "deadline", }, { - name: "amountOut", type: "uint256", + name: "amountOut", }, { - name: "amountInMaximum", type: "uint256", + name: "amountInMaximum", }, { - name: "sqrtPriceLimitX96", type: "uint160", + name: "sqrtPriceLimitX96", }, ], - name: "params", - type: "tuple", }, ] as const; const FN_OUTPUTS = [ { - name: "amountIn", type: "uint256", + name: "amountIn", }, ] as const; @@ -171,23 +171,23 @@ export function exactOutputSingle( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.params] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/OwnerChanged.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/OwnerChanged.ts index 30f6cb7997e..7ecf70ce4c8 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/OwnerChanged.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/OwnerChanged.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "OwnerChanged" event. @@ -40,8 +40,8 @@ export type OwnerChangedEventFilters = Partial<{ */ export function ownerChangedEvent(filters: OwnerChangedEventFilters = {}) { return prepareEvent({ - filters, signature: "event OwnerChanged(address indexed oldOwner, address indexed newOwner)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/PoolCreated.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/PoolCreated.ts index 4cd77819ff1..e58a4baf468 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/PoolCreated.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/events/PoolCreated.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "PoolCreated" event. @@ -46,8 +46,8 @@ export type PoolCreatedEventFilters = Partial<{ */ export function poolCreatedEvent(filters: PoolCreatedEventFilters = {}) { return prepareEvent({ - filters, signature: "event PoolCreated(address indexed token0, address indexed token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, address indexed sender)", + filters, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/feeAmountTickSpacing.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/feeAmountTickSpacing.ts index feed9aec478..255f43c261a 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/feeAmountTickSpacing.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/feeAmountTickSpacing.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "feeAmountTickSpacing" function. @@ -16,8 +16,8 @@ export type FeeAmountTickSpacingParams = { export const FN_SELECTOR = "0x22afcccb" as const; const FN_INPUTS = [ { - name: "fee", type: "uint24", + name: "fee", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/getPool.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/getPool.ts index a176b876892..0ba8694755b 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/getPool.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/getPool.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getPool" function. @@ -18,22 +18,22 @@ export type GetPoolParams = { export const FN_SELECTOR = "0x1698ee82" as const; const FN_INPUTS = [ { - name: "tokenA", type: "address", + name: "tokenA", }, { - name: "tokenB", type: "address", + name: "tokenB", }, { - name: "fee", type: "uint24", + name: "fee", }, ] as const; const FN_OUTPUTS = [ { - name: "pool", type: "address", + name: "pool", }, ] as const; diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/owner.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/owner.ts index c4a193d970e..5c788ce980c 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/owner.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/read/owner.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x8da5cb5b" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/createPool.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/createPool.ts index 3a0e4d3e1bb..9fb6af4ed9a 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/createPool.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/createPool.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "createPool" function. @@ -20,22 +20,22 @@ export type CreatePoolParams = WithOverrides<{ export const FN_SELECTOR = "0xa1671295" as const; const FN_INPUTS = [ { - name: "tokenA", type: "address", + name: "tokenA", }, { - name: "tokenB", type: "address", + name: "tokenB", }, { - name: "fee", type: "uint24", + name: "fee", }, ] as const; const FN_OUTPUTS = [ { - name: "pool", type: "address", + name: "pool", }, ] as const; @@ -142,19 +142,8 @@ export function createPool( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -164,5 +153,16 @@ export function createPool( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/enableFeeAmount.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/enableFeeAmount.ts index c0f8917eedb..c8e4e71ccd4 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/enableFeeAmount.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/enableFeeAmount.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "enableFeeAmount" function. @@ -22,12 +22,12 @@ export type EnableFeeAmountParams = WithOverrides<{ export const FN_SELECTOR = "0x8a7c195f" as const; const FN_INPUTS = [ { - name: "fee", type: "uint24", + name: "fee", }, { - name: "tickSpacing", type: "int24", + name: "tickSpacing", }, ] as const; const FN_OUTPUTS = [] as const; @@ -128,23 +128,23 @@ export function enableFeeAmount( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.fee, resolvedOptions.tickSpacing] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/setOwner.ts b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/setOwner.ts index 95cdc0516de..6e4c1ba930b 100644 --- a/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/setOwner.ts +++ b/packages/thirdweb/src/extensions/uniswap/__generated__/IUniswapV3Factory/write/setOwner.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setOwner" function. @@ -18,8 +18,8 @@ export type SetOwnerParams = WithOverrides<{ export const FN_SELECTOR = "0x13af4035" as const; const FN_INPUTS = [ { - name: "newOwner", type: "address", + name: "newOwner", }, ] as const; const FN_OUTPUTS = [] as const; @@ -115,23 +115,23 @@ export function setOwner( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newOwner] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/exists.ts b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/exists.ts index b62fc51aefe..f4a9b84da2c 100644 --- a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/exists.ts +++ b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/exists.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "exists" function. @@ -16,8 +16,8 @@ export type ExistsParams = { export const FN_SELECTOR = "0x4f558e79" as const; const FN_INPUTS = [ { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/getMany.ts b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/getMany.ts index f4660917967..e108e47b49f 100644 --- a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/getMany.ts +++ b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/getMany.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getMany" function. @@ -17,18 +17,18 @@ export type GetManyParams = { export const FN_SELECTOR = "0x1bd8cc1a" as const; const FN_INPUTS = [ { - name: "keys", type: "string[]", + name: "keys", }, { - name: "tokenId", type: "uint256", + name: "tokenId", }, ] as const; const FN_OUTPUTS = [ { - name: "values", type: "string[]", + name: "values", }, ] as const; diff --git a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/namehash.ts b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/namehash.ts index 78b61ec5e6f..1f4ff5195b1 100644 --- a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/namehash.ts +++ b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/namehash.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "namehash" function. @@ -16,14 +16,14 @@ export type NamehashParams = { export const FN_SELECTOR = "0x276fabb1" as const; const FN_INPUTS = [ { - name: "labels", type: "string[]", + name: "labels", }, ] as const; const FN_OUTPUTS = [ { - name: "hash", type: "uint256", + name: "hash", }, ] as const; diff --git a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/reverseNameOf.ts b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/reverseNameOf.ts index b6e9564a151..b86c1c4bd8a 100644 --- a/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/reverseNameOf.ts +++ b/packages/thirdweb/src/extensions/unstoppable-domains/__generated__/UnstoppableDomains/read/reverseNameOf.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "reverseNameOf" function. @@ -16,14 +16,14 @@ export type ReverseNameOfParams = { export const FN_SELECTOR = "0xbebec6b4" as const; const FN_INPUTS = [ { - name: "addr", type: "address", + name: "addr", }, ] as const; const FN_OUTPUTS = [ { - name: "reverseUri", type: "string", + name: "reverseUri", }, ] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/BALLOT_TYPEHASH.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/BALLOT_TYPEHASH.ts index 060fe07c78a..ec04f2d479a 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/BALLOT_TYPEHASH.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/BALLOT_TYPEHASH.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xdeaaa7cc" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/COUNTING_MODE.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/COUNTING_MODE.ts index 1a0672fb8cc..6734c8b2303 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/COUNTING_MODE.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/COUNTING_MODE.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xdd4e2ba5" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getAllProposals.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getAllProposals.ts index 6f22db94aec..4325be6c282 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getAllProposals.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getAllProposals.ts @@ -1,53 +1,54 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xcceb68f5" as const; const FN_INPUTS = [] as const; const FN_OUTPUTS = [ { + type: "tuple[]", + name: "allProposals", components: [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "proposer", type: "address", + name: "proposer", }, { - name: "targets", type: "address[]", + name: "targets", }, { - name: "values", type: "uint256[]", + name: "values", }, { - name: "signatures", type: "string[]", + name: "signatures", }, { - name: "calldatas", type: "bytes[]", + name: "calldatas", }, { - name: "startBlock", type: "uint256", + name: "startBlock", }, { - name: "endBlock", type: "uint256", + name: "endBlock", }, { - name: "description", type: "string", + name: "description", }, ], - name: "allProposals", - type: "tuple[]", }, ] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotes.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotes.ts index 9a0da285da8..c2b66c0be2a 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotes.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotes.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getVotes" function. @@ -20,12 +20,12 @@ export type GetVotesParams = { export const FN_SELECTOR = "0xeb9019d4" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotesWithParams.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotesWithParams.ts index dfbae849b8b..f8eca80d4bf 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotesWithParams.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/getVotesWithParams.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "getVotesWithParams" function. @@ -21,16 +21,16 @@ export type GetVotesWithParamsParams = { export const FN_SELECTOR = "0x9a802a6d" as const; const FN_INPUTS = [ { - name: "account", type: "address", + name: "account", }, { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, { - name: "params", type: "bytes", + name: "params", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hasVoted.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hasVoted.ts index eacb9d77023..5815f1c8684 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hasVoted.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hasVoted.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "hasVoted" function. @@ -20,12 +20,12 @@ export type HasVotedParams = { export const FN_SELECTOR = "0x43859632" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "account", type: "address", + name: "account", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hashProposal.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hashProposal.ts index 5259840fe3c..87e81f3c2ec 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hashProposal.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/hashProposal.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "hashProposal" function. @@ -25,20 +25,20 @@ export type HashProposalParams = { export const FN_SELECTOR = "0xc59057e4" as const; const FN_INPUTS = [ { - name: "targets", type: "address[]", + name: "targets", }, { - name: "values", type: "uint256[]", + name: "values", }, { - name: "calldatas", type: "bytes[]", + name: "calldatas", }, { - name: "descriptionHash", type: "bytes32", + name: "descriptionHash", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalDeadline.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalDeadline.ts index aa55ad0e79c..e0640658526 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalDeadline.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalDeadline.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "proposalDeadline" function. @@ -19,8 +19,8 @@ export type ProposalDeadlineParams = { export const FN_SELECTOR = "0xc01f9e37" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalIndex.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalIndex.ts index d1b77a0eeca..a8d1ccb5c76 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalIndex.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalIndex.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x5977e0f2" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalSnapshot.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalSnapshot.ts index ecdd310f479..593f248d154 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalSnapshot.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalSnapshot.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "proposalSnapshot" function. @@ -19,8 +19,8 @@ export type ProposalSnapshotParams = { export const FN_SELECTOR = "0x2d63f693" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalThreshold.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalThreshold.ts index ced5cabd45f..098c4dc79c8 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalThreshold.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalThreshold.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xb58131b0" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalVotes.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalVotes.ts index 9220e63ab34..5bc8c234e58 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalVotes.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposalVotes.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "proposalVotes" function. @@ -19,22 +19,22 @@ export type ProposalVotesParams = { export const FN_SELECTOR = "0x544ffc9c" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, ] as const; const FN_OUTPUTS = [ { - name: "againstVotes", type: "uint256", + name: "againstVotes", }, { - name: "forVotes", type: "uint256", + name: "forVotes", }, { - name: "abstainVotes", type: "uint256", + name: "abstainVotes", }, ] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposals.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposals.ts index 04fe41b8e1b..3c89313b550 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposals.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/proposals.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "proposals" function. @@ -16,30 +16,30 @@ export type ProposalsParams = { export const FN_SELECTOR = "0x013cf08b" as const; const FN_INPUTS = [ { - name: "key", type: "uint256", + name: "key", }, ] as const; const FN_OUTPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "proposer", type: "address", + name: "proposer", }, { - name: "startBlock", type: "uint256", + name: "startBlock", }, { - name: "endBlock", type: "uint256", + name: "endBlock", }, { - name: "description", type: "string", + name: "description", }, ] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorum.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorum.ts index 8ca849b0c87..b2de58c41b0 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorum.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorum.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "quorum" function. @@ -19,8 +19,8 @@ export type QuorumParams = { export const FN_SELECTOR = "0xf8ce560a" as const; const FN_INPUTS = [ { - name: "blockNumber", type: "uint256", + name: "blockNumber", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorumDenominator.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorumDenominator.ts index cf3126a06d1..56636d20aee 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorumDenominator.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/quorumDenominator.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x97c3d334" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/state.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/state.ts index 57a47c9faa2..15bcb254830 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/state.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/state.ts @@ -1,10 +1,10 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "state" function. @@ -19,8 +19,8 @@ export type StateParams = { export const FN_SELECTOR = "0x3e4f49e6" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, ] as const; const FN_OUTPUTS = [ diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/token.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/token.ts index 60c0d33089b..02e70e2d6c7 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/token.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/token.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0xfc0c546a" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingDelay.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingDelay.ts index 51689a20a6c..eff242b13e6 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingDelay.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingDelay.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x3932abb1" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingPeriod.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingPeriod.ts index 5b96e7a33aa..35de8cb92c0 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingPeriod.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/read/votingPeriod.ts @@ -1,8 +1,9 @@ -import { decodeAbiParameters } from "viem"; import { readContract } from "../../../../../transaction/read-contract.js"; import type { BaseTransactionOptions } from "../../../../../transaction/types.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; + +import { decodeAbiParameters } from "viem"; import type { Hex } from "../../../../../utils/encoding/hex.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; export const FN_SELECTOR = "0x02a251a3" as const; const FN_INPUTS = [] as const; diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVote.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVote.ts index dab01bb13e5..f7c42629976 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVote.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVote.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "castVote" function. @@ -22,12 +22,12 @@ export type CastVoteParams = WithOverrides<{ export const FN_SELECTOR = "0x56781388" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "support", type: "uint8", + name: "support", }, ] as const; const FN_OUTPUTS = [ @@ -130,23 +130,23 @@ export function castVote( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.proposalId, resolvedOptions.support] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteBySig.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteBySig.ts index e09620b20f8..6322bdf5e39 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteBySig.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteBySig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "castVoteBySig" function. @@ -25,24 +25,24 @@ export type CastVoteBySigParams = WithOverrides<{ export const FN_SELECTOR = "0x3bccf4fd" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "support", type: "uint8", + name: "support", }, { - name: "v", type: "uint8", + name: "v", }, { - name: "r", type: "bytes32", + name: "r", }, { - name: "s", type: "bytes32", + name: "s", }, ] as const; const FN_OUTPUTS = [ @@ -162,19 +162,8 @@ export function castVoteBySig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -186,5 +175,16 @@ export function castVoteBySig( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReason.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReason.ts index 48027e963a1..4d5af34b63c 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReason.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReason.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "castVoteWithReason" function. @@ -23,16 +23,16 @@ export type CastVoteWithReasonParams = WithOverrides<{ export const FN_SELECTOR = "0x7b3c71d3" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "support", type: "uint8", + name: "support", }, { - name: "reason", type: "string", + name: "reason", }, ] as const; const FN_OUTPUTS = [ @@ -146,19 +146,8 @@ export function castVoteWithReason( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -168,5 +157,16 @@ export function castVoteWithReason( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParams.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParams.ts index 622e146f4e5..0c625832619 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParams.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParams.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "castVoteWithReasonAndParams" function. @@ -24,20 +24,20 @@ export type CastVoteWithReasonAndParamsParams = WithOverrides<{ export const FN_SELECTOR = "0x5f398a14" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "support", type: "uint8", + name: "support", }, { - name: "reason", type: "string", + name: "reason", }, { - name: "params", type: "bytes", + name: "params", }, ] as const; const FN_OUTPUTS = [ @@ -159,19 +159,8 @@ export function castVoteWithReasonAndParams( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -182,5 +171,16 @@ export function castVoteWithReasonAndParams( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParamsBySig.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParamsBySig.ts index 055e6ebb49f..20122e5859d 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParamsBySig.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/castVoteWithReasonAndParamsBySig.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "castVoteWithReasonAndParamsBySig" function. @@ -27,32 +27,32 @@ export type CastVoteWithReasonAndParamsBySigParams = WithOverrides<{ export const FN_SELECTOR = "0x03420181" as const; const FN_INPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, { - name: "support", type: "uint8", + name: "support", }, { - name: "reason", type: "string", + name: "reason", }, { - name: "params", type: "bytes", + name: "params", }, { - name: "v", type: "uint8", + name: "v", }, { - name: "r", type: "bytes32", + name: "r", }, { - name: "s", type: "bytes32", + name: "s", }, ] as const; const FN_OUTPUTS = [ @@ -186,19 +186,8 @@ export function castVoteWithReasonAndParamsBySig( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -212,5 +201,16 @@ export function castVoteWithReasonAndParamsBySig( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/execute.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/execute.ts index 74443dd4c8f..4f94b043506 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/execute.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/execute.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "execute" function. @@ -27,20 +27,20 @@ export type ExecuteParams = WithOverrides<{ export const FN_SELECTOR = "0x2656227d" as const; const FN_INPUTS = [ { - name: "targets", type: "address[]", + name: "targets", }, { - name: "values", type: "uint256[]", + name: "values", }, { - name: "calldatas", type: "bytes[]", + name: "calldatas", }, { - name: "descriptionHash", type: "bytes32", + name: "descriptionHash", }, ] as const; const FN_OUTPUTS = [ @@ -154,19 +154,8 @@ export function execute( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -177,5 +166,16 @@ export function execute( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/propose.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/propose.ts index 85ecd849904..abc8a1f168c 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/propose.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/propose.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "propose" function. @@ -27,26 +27,26 @@ export type ProposeParams = WithOverrides<{ export const FN_SELECTOR = "0x7d5e81e2" as const; const FN_INPUTS = [ { - name: "targets", type: "address[]", + name: "targets", }, { - name: "values", type: "uint256[]", + name: "values", }, { - name: "calldatas", type: "bytes[]", + name: "calldatas", }, { - name: "description", type: "string", + name: "description", }, ] as const; const FN_OUTPUTS = [ { - name: "proposalId", type: "uint256", + name: "proposalId", }, ] as const; @@ -155,19 +155,8 @@ export function propose( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -178,5 +167,16 @@ export function propose( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/relay.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/relay.ts index 2097326cb98..edd2ad5a3f3 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/relay.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/relay.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "relay" function. @@ -20,16 +20,16 @@ export type RelayParams = WithOverrides<{ export const FN_SELECTOR = "0xc28bc2fa" as const; const FN_INPUTS = [ { - name: "target", type: "address", + name: "target", }, { - name: "value", type: "uint256", + name: "value", }, { - name: "data", type: "bytes", + name: "data", }, ] as const; const FN_OUTPUTS = [] as const; @@ -135,19 +135,8 @@ export function relay( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [ @@ -157,5 +146,16 @@ export function relay( ] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setProposalThreshold.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setProposalThreshold.ts index d0456bd84d2..9eac196fd77 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setProposalThreshold.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setProposalThreshold.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setProposalThreshold" function. @@ -21,8 +21,8 @@ export type SetProposalThresholdParams = WithOverrides<{ export const FN_SELECTOR = "0xece40cc1" as const; const FN_INPUTS = [ { - name: "newProposalThreshold", type: "uint256", + name: "newProposalThreshold", }, ] as const; const FN_OUTPUTS = [] as const; @@ -124,23 +124,23 @@ export function setProposalThreshold( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newProposalThreshold] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingDelay.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingDelay.ts index 32a50d073d2..313d949b8c2 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingDelay.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingDelay.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setVotingDelay" function. @@ -21,8 +21,8 @@ export type SetVotingDelayParams = WithOverrides<{ export const FN_SELECTOR = "0x70b0f660" as const; const FN_INPUTS = [ { - name: "newVotingDelay", type: "uint256", + name: "newVotingDelay", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setVotingDelay( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newVotingDelay] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingPeriod.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingPeriod.ts index eae17976887..d74fc333fcb 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingPeriod.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/setVotingPeriod.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "setVotingPeriod" function. @@ -21,8 +21,8 @@ export type SetVotingPeriodParams = WithOverrides<{ export const FN_SELECTOR = "0xea0217cf" as const; const FN_INPUTS = [ { - name: "newVotingPeriod", type: "uint256", + name: "newVotingPeriod", }, ] as const; const FN_OUTPUTS = [] as const; @@ -120,23 +120,23 @@ export function setVotingPeriod( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newVotingPeriod] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/updateQuorumNumerator.ts b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/updateQuorumNumerator.ts index 3431c12a84b..819963e4608 100644 --- a/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/updateQuorumNumerator.ts +++ b/packages/thirdweb/src/extensions/vote/__generated__/Vote/write/updateQuorumNumerator.ts @@ -1,12 +1,12 @@ import type { AbiParameterToPrimitiveType } from "abitype"; -import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import type { BaseTransactionOptions, WithOverrides, } from "../../../../../transaction/types.js"; +import { prepareContractCall } from "../../../../../transaction/prepare-contract-call.js"; import { encodeAbiParameters } from "../../../../../utils/abi/encodeAbiParameters.js"; -import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; import { once } from "../../../../../utils/promise/once.js"; +import { detectMethod } from "../../../../../utils/bytecode/detectExtension.js"; /** * Represents the parameters for the "updateQuorumNumerator" function. @@ -21,8 +21,8 @@ export type UpdateQuorumNumeratorParams = WithOverrides<{ export const FN_SELECTOR = "0x06f3f9e6" as const; const FN_INPUTS = [ { - name: "newQuorumNumerator", type: "uint256", + name: "newQuorumNumerator", }, ] as const; const FN_OUTPUTS = [] as const; @@ -124,23 +124,23 @@ export function updateQuorumNumerator( }); return prepareContractCall({ - accessList: async () => (await asyncOptions()).overrides?.accessList, - authorizationList: async () => - (await asyncOptions()).overrides?.authorizationList, contract: options.contract, - erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, - extraGas: async () => (await asyncOptions()).overrides?.extraGas, - gas: async () => (await asyncOptions()).overrides?.gas, - gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, - maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, - maxPriorityFeePerGas: async () => - (await asyncOptions()).overrides?.maxPriorityFeePerGas, method: [FN_SELECTOR, FN_INPUTS, FN_OUTPUTS] as const, - nonce: async () => (await asyncOptions()).overrides?.nonce, params: async () => { const resolvedOptions = await asyncOptions(); return [resolvedOptions.newQuorumNumerator] as const; }, value: async () => (await asyncOptions()).overrides?.value, + accessList: async () => (await asyncOptions()).overrides?.accessList, + gas: async () => (await asyncOptions()).overrides?.gas, + gasPrice: async () => (await asyncOptions()).overrides?.gasPrice, + maxFeePerGas: async () => (await asyncOptions()).overrides?.maxFeePerGas, + maxPriorityFeePerGas: async () => + (await asyncOptions()).overrides?.maxPriorityFeePerGas, + nonce: async () => (await asyncOptions()).overrides?.nonce, + extraGas: async () => (await asyncOptions()).overrides?.extraGas, + erc20Value: async () => (await asyncOptions()).overrides?.erc20Value, + authorizationList: async () => + (await asyncOptions()).overrides?.authorizationList, }); } diff --git a/packages/thirdweb/src/extensions/zksync/__generated__/ContractDeployer/events/ContractDeployed.ts b/packages/thirdweb/src/extensions/zksync/__generated__/ContractDeployer/events/ContractDeployed.ts index 68fc917edd2..48964fd99a3 100644 --- a/packages/thirdweb/src/extensions/zksync/__generated__/ContractDeployer/events/ContractDeployed.ts +++ b/packages/thirdweb/src/extensions/zksync/__generated__/ContractDeployer/events/ContractDeployed.ts @@ -1,5 +1,5 @@ -import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; +import type { AbiParameterToPrimitiveType } from "abitype"; /** * Represents the filters for the "ContractDeployed" event. @@ -48,8 +48,8 @@ export function contractDeployedEvent( filters: ContractDeployedEventFilters = {}, ) { return prepareEvent({ - filters, signature: "event ContractDeployed(address indexed deployerAddress, bytes32 indexed bytecodeHash, address indexed contractAddress)", + filters, }); }