diff --git a/app/(general)/integration/unlock/page.tsx b/app/(general)/integration/unlock/page.tsx
index ad15a3a0..5dd10e72 100644
--- a/app/(general)/integration/unlock/page.tsx
+++ b/app/(general)/integration/unlock/page.tsx
@@ -1,3 +1,5 @@
+'use client'
+
import { WalletConnect } from '@/components/blockchain/wallet-connect'
import { IsWalletConnected } from '@/components/shared/is-wallet-connected'
import { IsWalletDisconnected } from '@/components/shared/is-wallet-disconnected'
@@ -5,26 +7,37 @@ import { Button } from '@/components/ui/button'
import FormDeployLock from '@/integrations/unlock/components/form-deploy-lock'
import UserKeys from '@/integrations/unlock/components/user-keys'
import UserLocks from '@/integrations/unlock/components/user-locks'
+import useUnlockSuppertedNetworks from '@/integrations/unlock/hooks/use-unlock-supported-networks'
export default function UnlockIntegration() {
+ const { isSupported } = useUnlockSuppertedNetworks()
+
return (
-
+
- Create a Lock
-
- Created Locks
-
- Owned Keys
-
+ {isSupported ? (
+ <>
+ Create a Lock
+
+ Created Locks
+
+ Owned Keys
+
+ >
+ ) : (
+ Unsupported Network
+ )}
-
+
+
+
)
diff --git a/integrations/unlock/README.md b/integrations/unlock/README.md
index 9c775355..b65acc66 100644
--- a/integrations/unlock/README.md
+++ b/integrations/unlock/README.md
@@ -12,13 +12,17 @@ The also includes an example of using a lock as a paywall, and will require the
- Paywall example with an already deployed example lock
- View lock statistics, and purchase keys from created locks.
+## Abis
+`publicLicV13Abi` and `unlockV12Abi` are abis for the unlock protocol contracts for
+generating typesafe wagmi hooks
+
## Components
`ButtonKeyCheckout()`
Opens the checkout modal for a specified key.
'FromDeployLock()'
-For to create and deploy new locks.
+For creating and deploying new locks.
'KeyPreview()'
Simply a preview card for the user keys list.
@@ -38,10 +42,14 @@ Displays all keys owned by the user for the connected chain.
`UserLocks()`
Displays all locks owned by the user for the connected chain.
+## Generated
+Contains typesafe hooks generated by wagmi cli for unlock protocol contracts
+
## Hooks
-`UseDeployLock()`
-React hook to interact with unlock protocol smart contracts.
+`UseUnlockSupportedNetworks()`
+React hook to return is network is supported by unlock, and some unlock data for
+that network
`UseUnlockSubgraph()`
React hook to interact with The Graph protocol, and query information
diff --git a/integrations/unlock/abis/public-lock-v13-abi.ts b/integrations/unlock/abis/public-lock-v13-abi.ts
new file mode 100644
index 00000000..e4c3eb54
--- /dev/null
+++ b/integrations/unlock/abis/public-lock-v13-abi.ts
@@ -0,0 +1,934 @@
+export const publicLockV13Abi = [
+ { type: 'error', inputs: [], name: 'CANNOT_APPROVE_SELF' },
+ { type: 'error', inputs: [], name: 'CANT_BE_SMALLER_THAN_SUPPLY' },
+ { type: 'error', inputs: [], name: 'CANT_EXTEND_NON_EXPIRING_KEY' },
+ { type: 'error', inputs: [], name: 'GAS_REFUND_FAILED' },
+ { type: 'error', inputs: [], name: 'INSUFFICIENT_ERC20_VALUE' },
+ { type: 'error', inputs: [], name: 'INSUFFICIENT_VALUE' },
+ { type: 'error', inputs: [], name: 'INVALID_ADDRESS' },
+ { type: 'error', inputs: [{ name: 'hookIndex', internalType: 'uint8', type: 'uint8' }], name: 'INVALID_HOOK' },
+ { type: 'error', inputs: [], name: 'INVALID_LENGTH' },
+ { type: 'error', inputs: [], name: 'INVALID_TOKEN' },
+ { type: 'error', inputs: [], name: 'KEY_NOT_VALID' },
+ { type: 'error', inputs: [], name: 'KEY_TRANSFERS_DISABLED' },
+ { type: 'error', inputs: [], name: 'LOCK_HAS_CHANGED' },
+ { type: 'error', inputs: [], name: 'LOCK_SOLD_OUT' },
+ { type: 'error', inputs: [], name: 'MAX_KEYS_REACHED' },
+ { type: 'error', inputs: [], name: 'MIGRATION_REQUIRED' },
+ { type: 'error', inputs: [], name: 'NON_COMPLIANT_ERC721_RECEIVER' },
+ { type: 'error', inputs: [], name: 'NON_RENEWABLE_LOCK' },
+ { type: 'error', inputs: [], name: 'NOT_ENOUGH_FUNDS' },
+ { type: 'error', inputs: [], name: 'NOT_ENOUGH_TIME' },
+ { type: 'error', inputs: [], name: 'NOT_READY_FOR_RENEWAL' },
+ { type: 'error', inputs: [], name: 'NO_SUCH_KEY' },
+ { type: 'error', inputs: [], name: 'NULL_VALUE' },
+ { type: 'error', inputs: [], name: 'ONLY_KEY_MANAGER_OR_APPROVED' },
+ { type: 'error', inputs: [], name: 'ONLY_LOCK_MANAGER' },
+ { type: 'error', inputs: [], name: 'ONLY_LOCK_MANAGER_OR_KEY_GRANTER' },
+ { type: 'error', inputs: [], name: 'OUT_OF_RANGE' },
+ { type: 'error', inputs: [], name: 'OWNER_CANT_BE_ADDRESS_ZERO' },
+ { type: 'error', inputs: [], name: 'SCHEMA_VERSION_NOT_CORRECT' },
+ { type: 'error', inputs: [], name: 'TRANSFER_TO_SELF' },
+ { type: 'error', inputs: [], name: 'TransferFailed' },
+ { type: 'error', inputs: [], name: 'UNAUTHORIZED' },
+ { type: 'error', inputs: [], name: 'UNAUTHORIZED_KEY_MANAGER_UPDATE' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'owner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'approved', internalType: 'address', type: 'address', indexed: true },
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ ],
+ name: 'Approval',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'owner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'operator', internalType: 'address', type: 'address', indexed: true },
+ { name: 'approved', internalType: 'bool', type: 'bool', indexed: false },
+ ],
+ name: 'ApprovalForAll',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: 'owner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'sendTo', internalType: 'address', type: 'address', indexed: true },
+ { name: 'refund', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'CancelKey',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'onKeyPurchaseHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyCancelHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onValidKeyHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onTokenURIHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyTransferHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyExtendHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyGrantHook', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'EventHooksUpdated',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: 'newExpiration', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'timeAdded', internalType: 'bool', type: 'bool', indexed: false },
+ ],
+ name: 'ExpirationChanged',
+ },
+ { type: 'event', anonymous: false, inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }], name: 'ExpireKey' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'refundValue', internalType: 'uint256', type: 'uint256', indexed: false }],
+ name: 'GasRefundValueChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'receiver', internalType: 'address', type: 'address', indexed: true },
+ { name: 'refundedAmount', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'GasRefunded',
+ },
+ { type: 'event', anonymous: false, inputs: [{ name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }], name: 'Initialized' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: 'newTimestamp', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'KeyExtended',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'KeyGranterAdded',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'KeyGranterRemoved',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: '_newManager', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'KeyManagerChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'updatedRecordsCount', internalType: 'uint256', type: 'uint256', indexed: false }],
+ name: 'KeysMigrated',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'expirationDuration', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'maxNumberOfKeys', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'maxKeysPerAcccount', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'LockConfig',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'LockManagerAdded',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'LockManagerRemoved',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'name', internalType: 'string', type: 'string', indexed: false },
+ { name: 'symbol', internalType: 'string', type: 'string', indexed: false },
+ { name: 'baseTokenURI', internalType: 'string', type: 'string', indexed: false },
+ ],
+ name: 'LockMetadata',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'previousOwner', internalType: 'address', type: 'address', indexed: false },
+ { name: 'newOwner', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'OwnershipTransferred',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'oldKeyPrice', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'keyPrice', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'oldTokenAddress', internalType: 'address', type: 'address', indexed: false },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'PricingChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'referrer', internalType: 'address', type: 'address', indexed: true },
+ { name: 'fee', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'ReferrerFee',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'freeTrialLength', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'refundPenaltyBasisPoints', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'RefundPenaltyChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'previousAdminRole', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'newAdminRole', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ ],
+ name: 'RoleAdminChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'account', internalType: 'address', type: 'address', indexed: true },
+ { name: 'sender', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'RoleGranted',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'account', internalType: 'address', type: 'address', indexed: true },
+ { name: 'sender', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'RoleRevoked',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'from', internalType: 'address', type: 'address', indexed: true },
+ { name: 'to', internalType: 'address', type: 'address', indexed: true },
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ ],
+ name: 'Transfer',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'transferFeeBasisPoints', internalType: 'uint256', type: 'uint256', indexed: false }],
+ name: 'TransferFeeChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'lockAddress', internalType: 'address', type: 'address', indexed: true },
+ { name: 'unlockAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'UnlockCallFailed',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'sender', internalType: 'address', type: 'address', indexed: true },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: true },
+ { name: 'recipient', internalType: 'address', type: 'address', indexed: true },
+ { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'Withdrawal',
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'DEFAULT_ADMIN_ROLE',
+ outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'addLockManager',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_approved', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'approve',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_keyOwner', internalType: 'address', type: 'address' }],
+ name: 'balanceOf',
+ outputs: [{ name: 'balance', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'burn',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'cancelAndRefund',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'expirationDuration',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'expireAndRefundFor',
+ outputs: [],
+ },
+ {
+ stateMutability: 'payable',
+ type: 'function',
+ inputs: [
+ { name: '_value', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ { name: '_data', internalType: 'bytes', type: 'bytes' },
+ ],
+ name: 'extend',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'freeTrialLength',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'gasRefundValue',
+ outputs: [{ name: '_refundValue', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'getApproved',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'getCancelAndRefundValue',
+ outputs: [{ name: 'refund', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_keyOwner', internalType: 'address', type: 'address' }],
+ name: 'getHasValidKey',
+ outputs: [{ name: 'isValid', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'role', internalType: 'bytes32', type: 'bytes32' }],
+ name: 'getRoleAdmin',
+ outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_time', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'getTransferFee',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_duration', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'grantKeyExtension',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_recipients', internalType: 'address[]', type: 'address[]' },
+ { name: '_expirationTimestamps', internalType: 'uint256[]', type: 'uint256[]' },
+ { name: '_keyManagers', internalType: 'address[]', type: 'address[]' },
+ ],
+ name: 'grantKeys',
+ outputs: [{ name: '', internalType: 'uint256[]', type: 'uint256[]' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'grantRole',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'hasRole',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_lockCreator', internalType: 'address payable', type: 'address' },
+ { name: '_expirationDuration', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_keyPrice', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxNumberOfKeys', internalType: 'uint256', type: 'uint256' },
+ { name: '_lockName', internalType: 'string', type: 'string' },
+ ],
+ name: 'initialize',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_owner', internalType: 'address', type: 'address' },
+ { name: '_operator', internalType: 'address', type: 'address' },
+ ],
+ name: 'isApprovedForAll',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'isLockManager',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'isOwner',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ ],
+ name: 'isRenewable',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'isValidKey',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'keyExpirationTimestampFor',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ name: 'keyManagerOf',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'keyPrice', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'lendKey',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'maxKeysPerAddress',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'maxNumberOfKeys',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenIdFrom', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenIdTo', internalType: 'uint256', type: 'uint256' },
+ { name: '_amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'mergeKeys',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [{ name: '', internalType: 'bytes', type: 'bytes' }], name: 'migrate', outputs: [] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'name', outputs: [{ name: '', internalType: 'string', type: 'string' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'numberOfOwners',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyCancelHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyCancelHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyExtendHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyExtendHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyGrantHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyGrantHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyPurchaseHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyPurchaseHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyTransferHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyTransferHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onTokenURIHook',
+ outputs: [{ name: '', internalType: 'contract ILockTokenURIHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onValidKeyHook',
+ outputs: [{ name: '', internalType: 'contract ILockValidKeyHook', type: 'address' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'owner', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'ownerOf',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'pure',
+ type: 'function',
+ inputs: [],
+ name: 'publicLockVersion',
+ outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }],
+ },
+ {
+ stateMutability: 'payable',
+ type: 'function',
+ inputs: [
+ { name: '_values', internalType: 'uint256[]', type: 'uint256[]' },
+ { name: '_recipients', internalType: 'address[]', type: 'address[]' },
+ { name: '_referrers', internalType: 'address[]', type: 'address[]' },
+ { name: '_keyManagers', internalType: 'address[]', type: 'address[]' },
+ { name: '_data', internalType: 'bytes[]', type: 'bytes[]' },
+ ],
+ name: 'purchase',
+ outputs: [{ name: '', internalType: 'uint256[]', type: 'uint256[]' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ { name: '_data', internalType: 'bytes', type: 'bytes' },
+ ],
+ name: 'purchasePriceFor',
+ outputs: [{ name: 'minKeyPrice', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'address', type: 'address' }],
+ name: 'referrerFees',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'refundPenaltyBasisPoints',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ ],
+ name: 'renewMembershipFor',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'renounceLockManager', outputs: [] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'renounceRole',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'revokeRole',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'safeTransferFrom',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_data', internalType: 'bytes', type: 'bytes' },
+ ],
+ name: 'safeTransferFrom',
+ outputs: [],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'schemaVersion', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_approved', internalType: 'bool', type: 'bool' },
+ ],
+ name: 'setApprovalForAll',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_onKeyPurchaseHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyCancelHook', internalType: 'address', type: 'address' },
+ { name: '_onValidKeyHook', internalType: 'address', type: 'address' },
+ { name: '_onTokenURIHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyTransferHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyExtendHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyGrantHook', internalType: 'address', type: 'address' },
+ ],
+ name: 'setEventHooks',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_refundValue', internalType: 'uint256', type: 'uint256' }],
+ name: 'setGasRefundValue',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_keyManager', internalType: 'address', type: 'address' },
+ ],
+ name: 'setKeyManagerOf',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_lockName', internalType: 'string', type: 'string' },
+ { name: '_lockSymbol', internalType: 'string', type: 'string' },
+ { name: '_baseTokenURI', internalType: 'string', type: 'string' },
+ ],
+ name: 'setLockMetadata',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'setOwner',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ { name: '_feeBasisPoint', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'setReferrerFee',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_tokenIdFrom', internalType: 'uint256', type: 'uint256' },
+ { name: '_timeShared', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'shareKey',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }],
+ name: 'supportsInterface',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'symbol', outputs: [{ name: '', internalType: 'string', type: 'string' }] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'tokenAddress', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_index', internalType: 'uint256', type: 'uint256' }],
+ name: 'tokenByIndex',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_keyOwner', internalType: 'address', type: 'address' },
+ { name: '_index', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'tokenOfOwnerByIndex',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'tokenURI',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_keyOwner', internalType: 'address', type: 'address' }],
+ name: 'totalKeys',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'totalSupply',
+ outputs: [{ name: '_totalKeysCreated', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'transferFeeBasisPoints',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'transferFrom',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'unlendKey',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'unlockProtocol',
+ outputs: [{ name: '', internalType: 'contract IUnlock', type: 'address' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_keyPrice', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ ],
+ name: 'updateKeyPricing',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_newExpirationDuration', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxNumberOfKeys', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxKeysPerAcccount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'updateLockConfig',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_freeTrialLength', internalType: 'uint256', type: 'uint256' },
+ { name: '_refundPenaltyBasisPoints', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'updateRefundPenalty',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'updateSchemaVersion', outputs: [] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_transferFeeBasisPoints', internalType: 'uint256', type: 'uint256' }],
+ name: 'updateTransferFee',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_recipient', internalType: 'address payable', type: 'address' },
+ { name: '_amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'withdraw',
+ outputs: [],
+ },
+ { stateMutability: 'payable', type: 'receive' },
+] as const
diff --git a/integrations/unlock/abis/unlock-v12-abi.ts b/integrations/unlock/abis/unlock-v12-abi.ts
new file mode 100644
index 00000000..f9e8d9b6
--- /dev/null
+++ b/integrations/unlock/abis/unlock-v12-abi.ts
@@ -0,0 +1,378 @@
+export const unlockV12Abi = [
+ { type: 'error', inputs: [], name: 'Unlock__ALREADY_DEPLOYED' },
+ { type: 'error', inputs: [], name: 'Unlock__INVALID_AMOUNT' },
+ { type: 'error', inputs: [], name: 'Unlock__MANAGER_ONLY' },
+ { type: 'error', inputs: [{ name: 'lockAddress', internalType: 'address', type: 'address' }], name: 'Unlock__MISSING_LOCK' },
+ { type: 'error', inputs: [], name: 'Unlock__MISSING_LOCK_TEMPLATE' },
+ { type: 'error', inputs: [], name: 'Unlock__MISSING_PROXY_ADMIN' },
+ { type: 'error', inputs: [], name: 'Unlock__MISSING_TEMPLATE' },
+ { type: 'error', inputs: [], name: 'Unlock__VERSION_TOO_HIGH' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'udt', internalType: 'address', type: 'address', indexed: false },
+ { name: 'weth', internalType: 'address', type: 'address', indexed: false },
+ { name: 'estimatedGasForPurchase', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'globalTokenSymbol', internalType: 'string', type: 'string', indexed: false },
+ { name: 'globalTokenURI', internalType: 'string', type: 'string', indexed: false },
+ { name: 'chainId', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'ConfigUnlock',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'grossNetworkProduct', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: '_valueInETH', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: false },
+ { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'lockAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'GNPChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'lockAddress', internalType: 'address', type: 'address', indexed: false },
+ { name: 'version', internalType: 'uint16', type: 'uint16', indexed: false },
+ ],
+ name: 'LockUpgraded',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'lockOwner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'newLockAddress', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'NewLock',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'previousOwner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'newOwner', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'OwnershipTransferred',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'grossNetworkProduct', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'totalDiscountGranted', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'ResetTrackedValue',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'publicLockAddress', internalType: 'address', type: 'address', indexed: false }],
+ name: 'SetLockTemplate',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'impl', internalType: 'address', type: 'address', indexed: true },
+ { name: 'version', internalType: 'uint16', type: 'uint16', indexed: true },
+ ],
+ name: 'UnlockTemplateAdded',
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'sender', internalType: 'address', type: 'address' }],
+ name: '__initializeOwnable',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'impl', internalType: 'address', type: 'address' },
+ { name: 'version', internalType: 'uint16', type: 'uint16' },
+ ],
+ name: 'addLockTemplate',
+ outputs: [],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'chainId', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'pure',
+ type: 'function',
+ inputs: [
+ { name: '', internalType: 'address', type: 'address' },
+ { name: '', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'computeAvailableDiscountFor',
+ outputs: [
+ { name: 'discount', internalType: 'uint256', type: 'uint256' },
+ { name: 'tokens', internalType: 'uint256', type: 'uint256' },
+ ],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_udt', internalType: 'address', type: 'address' },
+ { name: '_weth', internalType: 'address', type: 'address' },
+ { name: '_estimatedGasForPurchase', internalType: 'uint256', type: 'uint256' },
+ { name: '_symbol', internalType: 'string', type: 'string' },
+ { name: '_URI', internalType: 'string', type: 'string' },
+ { name: '_chainId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'configUnlock',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_expirationDuration', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_keyPrice', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxNumberOfKeys', internalType: 'uint256', type: 'uint256' },
+ { name: '_lockName', internalType: 'string', type: 'string' },
+ { name: '', internalType: 'bytes12', type: 'bytes12' },
+ ],
+ name: 'createLock',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'data', internalType: 'bytes', type: 'bytes' }],
+ name: 'createUpgradeableLock',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'data', internalType: 'bytes', type: 'bytes' },
+ { name: '_lockVersion', internalType: 'uint16', type: 'uint16' },
+ ],
+ name: 'createUpgradeableLockAtVersion',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'estimatedGasForPurchase',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'getAdmin', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'getGlobalBaseTokenURI',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'getGlobalTokenSymbol',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'globalBaseTokenURI',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'globalTokenSymbol',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'grossNetworkProduct',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_unlockOwner', internalType: 'address', type: 'address' }],
+ name: 'initialize',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'initializeProxyAdmin', outputs: [] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'isOwner', outputs: [{ name: '', internalType: 'bool', type: 'bool' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'address', type: 'address' }],
+ name: 'locks',
+ outputs: [
+ { name: 'deployed', internalType: 'bool', type: 'bool' },
+ { name: 'totalSales', internalType: 'uint256', type: 'uint256' },
+ { name: 'yieldedDiscountTokens', internalType: 'uint256', type: 'uint256' },
+ ],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'networkBaseFee',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'owner', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'postLockUpgrade', outputs: [] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'protocolFee', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'proxyAdminAddress',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'publicLockAddress',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_version', internalType: 'uint16', type: 'uint16' }],
+ name: 'publicLockImpls',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'publicLockLatestVersion',
+ outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_impl', internalType: 'address', type: 'address' }],
+ name: 'publicLockVersions',
+ outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '', internalType: 'uint256', type: 'uint256' },
+ { name: '', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'recordConsumedDiscount',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_value', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ ],
+ name: 'recordKeyPurchase',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'lock', internalType: 'address', type: 'address' }],
+ name: 'removeLock',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'renounceOwnership', outputs: [] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_grossNetworkProduct', internalType: 'uint256', type: 'uint256' },
+ { name: '_totalDiscountGranted', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'resetTrackedValue',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_publicLockAddress', internalType: 'address', type: 'address' }],
+ name: 'setLockTemplate',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_oracleAddress', internalType: 'address', type: 'address' },
+ ],
+ name: 'setOracle',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_protocolFee', internalType: 'uint256', type: 'uint256' }],
+ name: 'setProtocolFee',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'totalDiscountGranted',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }],
+ name: 'transferOwnership',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'token', internalType: 'address', type: 'address' },
+ { name: 'to', internalType: 'address', type: 'address' },
+ { name: 'amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'transferTokens',
+ outputs: [],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'udt', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'address', type: 'address' }],
+ name: 'uniswapOracles',
+ outputs: [{ name: '', internalType: 'contract IUniswapOracleV3', type: 'address' }],
+ },
+ { stateMutability: 'pure', type: 'function', inputs: [], name: 'unlockVersion', outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'lockAddress', internalType: 'address payable', type: 'address' },
+ { name: 'version', internalType: 'uint16', type: 'uint16' },
+ ],
+ name: 'upgradeLock',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'weth', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ { stateMutability: 'payable', type: 'receive' },
+] as const
diff --git a/integrations/unlock/components/button-key-checkout.tsx b/integrations/unlock/components/button-key-checkout.tsx
index 596b2e25..099d2782 100644
--- a/integrations/unlock/components/button-key-checkout.tsx
+++ b/integrations/unlock/components/button-key-checkout.tsx
@@ -1,27 +1,19 @@
-/* eslint-disable @typescript-eslint/no-unsafe-member-access */
-/* eslint-disable @typescript-eslint/no-unsafe-argument */
'use client'
-import { useEffect, useState } from 'react'
-
import networks from '@unlock-protocol/networks'
import { Paywall } from '@unlock-protocol/paywall'
import { useNetwork } from 'wagmi'
import { useAccount } from 'wagmi'
import { Button } from '@/components/ui/button'
-import useUnlockSubgraph from '@/integrations/unlock/hooks/use-unlock-subgraph'
export default function ButtonKeyCheckout({ lockId }: { lockId: string }) {
const { chain } = useNetwork()
- const { getLockStats } = useUnlockSubgraph()
- const [lockAddress, setLockAddress] = useState
('')
const { connector } = useAccount()
- const baseUrl = 'https://app.unlock-protocol.com/checkout?'
const paywallConfig = {
locks: {
- [lockAddress]: {
+ [lockId]: {
network: chain?.id,
},
},
@@ -36,13 +28,5 @@ export default function ButtonKeyCheckout({ lockId }: { lockId: string }) {
}
}
- useEffect(() => {
- async function fetchLockAddress() {
- const stats = await getLockStats({ lockId })
- setLockAddress(stats.locks[0].address)
- }
- void fetchLockAddress()
- }, [lockId])
-
- return {lockAddress && }
+ return {}
}
diff --git a/integrations/unlock/components/form-deploy-lock.tsx b/integrations/unlock/components/form-deploy-lock.tsx
index 5bb01c2d..a7076cd6 100644
--- a/integrations/unlock/components/form-deploy-lock.tsx
+++ b/integrations/unlock/components/form-deploy-lock.tsx
@@ -2,11 +2,14 @@
import { useState } from 'react'
+import { ethers } from 'ethers'
+
+import { TransactionStatus } from '@/components/blockchain/transaction-status'
import { Button } from '@/components/ui/button'
-import { Input } from '@/components/ui/input'
import { Switch } from '@/components/ui/switch'
-import { useDeployLock } from '../hooks/use-deploy-lock'
+import { usePrepareUnlockV12CreateLock, useUnlockV12CreateLock } from '../generated/unlock-wagmi'
+import useUnlockSuppertedNetworks from '../hooks/use-unlock-supported-networks'
export default function FormDeployLock() {
const [lockName, setLockName] = useState('test lock')
@@ -18,16 +21,23 @@ export default function FormDeployLock() {
const [unlimitedKeys, setUnlimitedKeys] = useState(false)
const [unlimitedDuration, setUnlimitedDuration] = useState(false)
- const { data, isLoading, isSuccess, deployLock } = useDeployLock()
+ const { isSupported, networkData } = useUnlockSuppertedNetworks()
+
+ const { config } = usePrepareUnlockV12CreateLock({
+ address: networkData.unlockAddress,
+ args: [
+ duration === 0 ? BigInt(ethers.constants.MaxUint256.toString()) : BigInt(duration * 60 * 60 * 24),
+ ethers.constants.AddressZero, // token address defaults to ETH, can be any ERC20
+ BigInt(ethers.utils.parseUnits(keyPrice, 18).toString()), // key price in ETH
+ maxKeys === 0 ? BigInt(ethers.constants.MaxUint256.toString()) : BigInt(maxKeys),
+ lockName,
+ '0x000000000000000000000000',
+ ],
+ })
+ const { write, isLoading, isSuccess, isError } = useUnlockV12CreateLock(config)
function handleDeploy() {
- deployLock(duration, keyPrice, maxKeys, lockName)
- .then(() => {
- console.log('deploying lock...')
- })
- .catch((e) => {
- console.log('error deploying lock', e)
- })
+ isSupported && write?.()
}
function handleUnlimitedKeys(e: boolean) {
@@ -54,13 +64,13 @@ export default function FormDeployLock() {
-
setLockName(e.target.value)} />
+
setLockName(e.target.value)} />
{unlimitedKeys ? (
-
+
) : (
-
setMaxKeys(Number(e.target.value))} />
+
setMaxKeys(Number(e.target.value))} />
)}
unlimited:
@@ -71,9 +81,9 @@ export default function FormDeployLock() {
diff --git a/integrations/unlock/components/key-preview.tsx b/integrations/unlock/components/key-preview.tsx
index a0d4dddf..f726492c 100644
--- a/integrations/unlock/components/key-preview.tsx
+++ b/integrations/unlock/components/key-preview.tsx
@@ -1,12 +1,15 @@
interface KeyPreviewProps {
lockName: string | undefined | null
+ lockId: string
}
-export default function KeyPreview({ lockName }: KeyPreviewProps) {
+export default function KeyPreview({ lockName, lockId }: KeyPreviewProps) {
return (
-
-
+
)
}
diff --git a/integrations/unlock/components/lock-preview.tsx b/integrations/unlock/components/lock-preview.tsx
index a97c5784..036e292e 100644
--- a/integrations/unlock/components/lock-preview.tsx
+++ b/integrations/unlock/components/lock-preview.tsx
@@ -5,7 +5,7 @@ interface LockPreviewProps {
export default function LockPreview({ lockId, lockName }: LockPreviewProps) {
return (
-
+
diff --git a/integrations/unlock/components/lock-stats.tsx b/integrations/unlock/components/lock-stats.tsx
index 3c70f3bf..d0ee9824 100644
--- a/integrations/unlock/components/lock-stats.tsx
+++ b/integrations/unlock/components/lock-stats.tsx
@@ -14,7 +14,7 @@ export default function LockStats({ lockId }: { lockId: string }) {
useEffect(() => {
async function fetchLockStats() {
- const stats: LockStatsQueryQuery = await getLockStats({ lockId })
+ const stats: LockStatsQueryQuery = (await getLockStats({ lockId })) as LockStatsQueryQuery
setLockStats(stats)
}
void fetchLockStats()
diff --git a/integrations/unlock/components/paywall-demo.tsx b/integrations/unlock/components/paywall-demo.tsx
index b867c85d..b60fd992 100644
--- a/integrations/unlock/components/paywall-demo.tsx
+++ b/integrations/unlock/components/paywall-demo.tsx
@@ -1,5 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unsafe-member-access */
-/* eslint-disable @typescript-eslint/no-unsafe-argument */
'use client'
import { useEffect, useState } from 'react'
@@ -11,7 +9,7 @@ import { useAccount } from 'wagmi'
import { Button } from '@/components/ui/button'
export default function PaywallDemo() {
- const [unlockStatus, setUnlockStatus] = useState
('locked')
+ const [unlockStatus, setUnlockStatus] = useState('locked')
const { connector } = useAccount()
const paywall = new Paywall(networks)
@@ -26,9 +24,9 @@ export default function PaywallDemo() {
},
}
- function handleUnlock(e: any) {
- console.log(e.detail)
- setUnlockStatus(e.detail)
+ function handleUnlock(e: CustomEvent) {
+ const detail: string | undefined = e.detail
+ setUnlockStatus(detail)
}
useEffect(() => {
@@ -41,13 +39,13 @@ export default function PaywallDemo() {
script.async = true
document.body.appendChild(script)
- window.addEventListener('unlockProtocol', handleUnlock)
+ window.addEventListener('unlockProtocol', handleUnlock as EventListener)
return () => {
// remove script when component is unmounted
document.body.removeChild(script)
if ('unlockProtocolConfig' in window) delete window.unlockProtocolConfig
- window.removeEventListener('unlockProtocol', handleUnlock)
+ window.removeEventListener('unlockProtocol', handleUnlock as EventListener)
}
}, [])
@@ -61,9 +59,16 @@ export default function PaywallDemo() {
return (
<>
-
Status: {unlockStatus}
- {unlockStatus === 'locked' &&
}
- {unlockStatus === 'unlocked' &&
Access Granted!
}
+
Status: {unlockStatus}
+ {unlockStatus === 'locked' && (
+
+
This webpage is currently locked by Unlock Protocol. Purchase a key below to unlock the page.
+
+
+ )}
+ {unlockStatus === 'unlocked' &&
Access Granted!
}
>
)
diff --git a/integrations/unlock/components/user-keys.tsx b/integrations/unlock/components/user-keys.tsx
index 6222a9c3..c292554a 100644
--- a/integrations/unlock/components/user-keys.tsx
+++ b/integrations/unlock/components/user-keys.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unsafe-argument */
'use client'
import { useEffect, useState } from 'react'
@@ -18,8 +17,7 @@ export default function UserKeys() {
useEffect(() => {
async function fetchUserKeys() {
- const keys = await getUserKeys()
- console.log(keys)
+ const keys: UserKeysQueryQuery | undefined = (await getUserKeys()) as UserKeysQueryQuery
setUserKeys(keys)
}
void fetchUserKeys()
@@ -31,12 +29,12 @@ export default function UserKeys() {
{userKeys.keys.map((key) => (
-
+
))}
) : (
- No Keys Found
+ No Keys Found
)}
)
diff --git a/integrations/unlock/components/user-locks.tsx b/integrations/unlock/components/user-locks.tsx
index e4016643..0d5a830e 100644
--- a/integrations/unlock/components/user-locks.tsx
+++ b/integrations/unlock/components/user-locks.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unsafe-argument */
'use client'
import { useEffect, useState } from 'react'
@@ -18,7 +17,7 @@ export default function UserLocks() {
useEffect(() => {
async function fetchUserLocks() {
- const locks = await getUserLocks()
+ const locks = (await getUserLocks()) as UserLocksQueryQuery
setUserLocks(locks)
}
void fetchUserLocks()
@@ -33,7 +32,7 @@ export default function UserLocks() {
))}
) : (
- No Locks Found
+ No Locks Found
)}
)
diff --git a/integrations/unlock/generated/unlock-wagmi.ts b/integrations/unlock/generated/unlock-wagmi.ts
new file mode 100644
index 00000000..27a0d35b
--- /dev/null
+++ b/integrations/unlock/generated/unlock-wagmi.ts
@@ -0,0 +1,4454 @@
+// Generated by @wagmi/cli@1.1.0 on 9/5/2023 at 5:15:18 PM
+import {
+ useContractRead,
+ UseContractReadConfig,
+ useContractWrite,
+ UseContractWriteConfig,
+ usePrepareContractWrite,
+ UsePrepareContractWriteConfig,
+ useContractEvent,
+ UseContractEventConfig,
+} from 'wagmi'
+import { ReadContractResult, WriteContractMode, PrepareWriteContractResult } from 'wagmi/actions'
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// UnlockV12
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+export const unlockV12ABI = [
+ { type: 'error', inputs: [], name: 'Unlock__ALREADY_DEPLOYED' },
+ { type: 'error', inputs: [], name: 'Unlock__INVALID_AMOUNT' },
+ { type: 'error', inputs: [], name: 'Unlock__MANAGER_ONLY' },
+ { type: 'error', inputs: [{ name: 'lockAddress', internalType: 'address', type: 'address' }], name: 'Unlock__MISSING_LOCK' },
+ { type: 'error', inputs: [], name: 'Unlock__MISSING_LOCK_TEMPLATE' },
+ { type: 'error', inputs: [], name: 'Unlock__MISSING_PROXY_ADMIN' },
+ { type: 'error', inputs: [], name: 'Unlock__MISSING_TEMPLATE' },
+ { type: 'error', inputs: [], name: 'Unlock__VERSION_TOO_HIGH' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'udt', internalType: 'address', type: 'address', indexed: false },
+ { name: 'weth', internalType: 'address', type: 'address', indexed: false },
+ { name: 'estimatedGasForPurchase', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'globalTokenSymbol', internalType: 'string', type: 'string', indexed: false },
+ { name: 'globalTokenURI', internalType: 'string', type: 'string', indexed: false },
+ { name: 'chainId', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'ConfigUnlock',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'grossNetworkProduct', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: '_valueInETH', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: false },
+ { name: 'value', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'lockAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'GNPChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'lockAddress', internalType: 'address', type: 'address', indexed: false },
+ { name: 'version', internalType: 'uint16', type: 'uint16', indexed: false },
+ ],
+ name: 'LockUpgraded',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'lockOwner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'newLockAddress', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'NewLock',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'previousOwner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'newOwner', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'OwnershipTransferred',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'grossNetworkProduct', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'totalDiscountGranted', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'ResetTrackedValue',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'publicLockAddress', internalType: 'address', type: 'address', indexed: false }],
+ name: 'SetLockTemplate',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'impl', internalType: 'address', type: 'address', indexed: true },
+ { name: 'version', internalType: 'uint16', type: 'uint16', indexed: true },
+ ],
+ name: 'UnlockTemplateAdded',
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'sender', internalType: 'address', type: 'address' }],
+ name: '__initializeOwnable',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'impl', internalType: 'address', type: 'address' },
+ { name: 'version', internalType: 'uint16', type: 'uint16' },
+ ],
+ name: 'addLockTemplate',
+ outputs: [],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'chainId', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'pure',
+ type: 'function',
+ inputs: [
+ { name: '', internalType: 'address', type: 'address' },
+ { name: '', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'computeAvailableDiscountFor',
+ outputs: [
+ { name: 'discount', internalType: 'uint256', type: 'uint256' },
+ { name: 'tokens', internalType: 'uint256', type: 'uint256' },
+ ],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_udt', internalType: 'address', type: 'address' },
+ { name: '_weth', internalType: 'address', type: 'address' },
+ { name: '_estimatedGasForPurchase', internalType: 'uint256', type: 'uint256' },
+ { name: '_symbol', internalType: 'string', type: 'string' },
+ { name: '_URI', internalType: 'string', type: 'string' },
+ { name: '_chainId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'configUnlock',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_expirationDuration', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_keyPrice', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxNumberOfKeys', internalType: 'uint256', type: 'uint256' },
+ { name: '_lockName', internalType: 'string', type: 'string' },
+ { name: '', internalType: 'bytes12', type: 'bytes12' },
+ ],
+ name: 'createLock',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'data', internalType: 'bytes', type: 'bytes' }],
+ name: 'createUpgradeableLock',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'data', internalType: 'bytes', type: 'bytes' },
+ { name: '_lockVersion', internalType: 'uint16', type: 'uint16' },
+ ],
+ name: 'createUpgradeableLockAtVersion',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'estimatedGasForPurchase',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'getAdmin', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'getGlobalBaseTokenURI',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'getGlobalTokenSymbol',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'globalBaseTokenURI',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'globalTokenSymbol',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'grossNetworkProduct',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_unlockOwner', internalType: 'address', type: 'address' }],
+ name: 'initialize',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'initializeProxyAdmin', outputs: [] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'isOwner', outputs: [{ name: '', internalType: 'bool', type: 'bool' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'address', type: 'address' }],
+ name: 'locks',
+ outputs: [
+ { name: 'deployed', internalType: 'bool', type: 'bool' },
+ { name: 'totalSales', internalType: 'uint256', type: 'uint256' },
+ { name: 'yieldedDiscountTokens', internalType: 'uint256', type: 'uint256' },
+ ],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'networkBaseFee',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'owner', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'postLockUpgrade', outputs: [] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'protocolFee', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'proxyAdminAddress',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'publicLockAddress',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_version', internalType: 'uint16', type: 'uint16' }],
+ name: 'publicLockImpls',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'publicLockLatestVersion',
+ outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_impl', internalType: 'address', type: 'address' }],
+ name: 'publicLockVersions',
+ outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '', internalType: 'uint256', type: 'uint256' },
+ { name: '', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'recordConsumedDiscount',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_value', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ ],
+ name: 'recordKeyPurchase',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'lock', internalType: 'address', type: 'address' }],
+ name: 'removeLock',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'renounceOwnership', outputs: [] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_grossNetworkProduct', internalType: 'uint256', type: 'uint256' },
+ { name: '_totalDiscountGranted', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'resetTrackedValue',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_publicLockAddress', internalType: 'address', type: 'address' }],
+ name: 'setLockTemplate',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_oracleAddress', internalType: 'address', type: 'address' },
+ ],
+ name: 'setOracle',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_protocolFee', internalType: 'uint256', type: 'uint256' }],
+ name: 'setProtocolFee',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'totalDiscountGranted',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }],
+ name: 'transferOwnership',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'token', internalType: 'address', type: 'address' },
+ { name: 'to', internalType: 'address', type: 'address' },
+ { name: 'amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'transferTokens',
+ outputs: [],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'udt', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'address', type: 'address' }],
+ name: 'uniswapOracles',
+ outputs: [{ name: '', internalType: 'contract IUniswapOracleV3', type: 'address' }],
+ },
+ { stateMutability: 'pure', type: 'function', inputs: [], name: 'unlockVersion', outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'lockAddress', internalType: 'address payable', type: 'address' },
+ { name: 'version', internalType: 'uint16', type: 'uint16' },
+ ],
+ name: 'upgradeLock',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'weth', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ { stateMutability: 'payable', type: 'receive' },
+] as const
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// PublicLockV13
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+export const publicLockV13ABI = [
+ { type: 'error', inputs: [], name: 'CANNOT_APPROVE_SELF' },
+ { type: 'error', inputs: [], name: 'CANT_BE_SMALLER_THAN_SUPPLY' },
+ { type: 'error', inputs: [], name: 'CANT_EXTEND_NON_EXPIRING_KEY' },
+ { type: 'error', inputs: [], name: 'GAS_REFUND_FAILED' },
+ { type: 'error', inputs: [], name: 'INSUFFICIENT_ERC20_VALUE' },
+ { type: 'error', inputs: [], name: 'INSUFFICIENT_VALUE' },
+ { type: 'error', inputs: [], name: 'INVALID_ADDRESS' },
+ { type: 'error', inputs: [{ name: 'hookIndex', internalType: 'uint8', type: 'uint8' }], name: 'INVALID_HOOK' },
+ { type: 'error', inputs: [], name: 'INVALID_LENGTH' },
+ { type: 'error', inputs: [], name: 'INVALID_TOKEN' },
+ { type: 'error', inputs: [], name: 'KEY_NOT_VALID' },
+ { type: 'error', inputs: [], name: 'KEY_TRANSFERS_DISABLED' },
+ { type: 'error', inputs: [], name: 'LOCK_HAS_CHANGED' },
+ { type: 'error', inputs: [], name: 'LOCK_SOLD_OUT' },
+ { type: 'error', inputs: [], name: 'MAX_KEYS_REACHED' },
+ { type: 'error', inputs: [], name: 'MIGRATION_REQUIRED' },
+ { type: 'error', inputs: [], name: 'NON_COMPLIANT_ERC721_RECEIVER' },
+ { type: 'error', inputs: [], name: 'NON_RENEWABLE_LOCK' },
+ { type: 'error', inputs: [], name: 'NOT_ENOUGH_FUNDS' },
+ { type: 'error', inputs: [], name: 'NOT_ENOUGH_TIME' },
+ { type: 'error', inputs: [], name: 'NOT_READY_FOR_RENEWAL' },
+ { type: 'error', inputs: [], name: 'NO_SUCH_KEY' },
+ { type: 'error', inputs: [], name: 'NULL_VALUE' },
+ { type: 'error', inputs: [], name: 'ONLY_KEY_MANAGER_OR_APPROVED' },
+ { type: 'error', inputs: [], name: 'ONLY_LOCK_MANAGER' },
+ { type: 'error', inputs: [], name: 'ONLY_LOCK_MANAGER_OR_KEY_GRANTER' },
+ { type: 'error', inputs: [], name: 'OUT_OF_RANGE' },
+ { type: 'error', inputs: [], name: 'OWNER_CANT_BE_ADDRESS_ZERO' },
+ { type: 'error', inputs: [], name: 'SCHEMA_VERSION_NOT_CORRECT' },
+ { type: 'error', inputs: [], name: 'TRANSFER_TO_SELF' },
+ { type: 'error', inputs: [], name: 'TransferFailed' },
+ { type: 'error', inputs: [], name: 'UNAUTHORIZED' },
+ { type: 'error', inputs: [], name: 'UNAUTHORIZED_KEY_MANAGER_UPDATE' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'owner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'approved', internalType: 'address', type: 'address', indexed: true },
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ ],
+ name: 'Approval',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'owner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'operator', internalType: 'address', type: 'address', indexed: true },
+ { name: 'approved', internalType: 'bool', type: 'bool', indexed: false },
+ ],
+ name: 'ApprovalForAll',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: 'owner', internalType: 'address', type: 'address', indexed: true },
+ { name: 'sendTo', internalType: 'address', type: 'address', indexed: true },
+ { name: 'refund', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'CancelKey',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'onKeyPurchaseHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyCancelHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onValidKeyHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onTokenURIHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyTransferHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyExtendHook', internalType: 'address', type: 'address', indexed: false },
+ { name: 'onKeyGrantHook', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'EventHooksUpdated',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: 'newExpiration', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'timeAdded', internalType: 'bool', type: 'bool', indexed: false },
+ ],
+ name: 'ExpirationChanged',
+ },
+ { type: 'event', anonymous: false, inputs: [{ name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true }], name: 'ExpireKey' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'refundValue', internalType: 'uint256', type: 'uint256', indexed: false }],
+ name: 'GasRefundValueChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'receiver', internalType: 'address', type: 'address', indexed: true },
+ { name: 'refundedAmount', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'GasRefunded',
+ },
+ { type: 'event', anonymous: false, inputs: [{ name: 'version', internalType: 'uint8', type: 'uint8', indexed: false }], name: 'Initialized' },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: 'newTimestamp', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'KeyExtended',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'KeyGranterAdded',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'KeyGranterRemoved',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ { name: '_newManager', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'KeyManagerChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'updatedRecordsCount', internalType: 'uint256', type: 'uint256', indexed: false }],
+ name: 'KeysMigrated',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'expirationDuration', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'maxNumberOfKeys', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'maxKeysPerAcccount', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'LockConfig',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'LockManagerAdded',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'account', internalType: 'address', type: 'address', indexed: true }],
+ name: 'LockManagerRemoved',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'name', internalType: 'string', type: 'string', indexed: false },
+ { name: 'symbol', internalType: 'string', type: 'string', indexed: false },
+ { name: 'baseTokenURI', internalType: 'string', type: 'string', indexed: false },
+ ],
+ name: 'LockMetadata',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'previousOwner', internalType: 'address', type: 'address', indexed: false },
+ { name: 'newOwner', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'OwnershipTransferred',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'oldKeyPrice', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'keyPrice', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'oldTokenAddress', internalType: 'address', type: 'address', indexed: false },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'PricingChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'referrer', internalType: 'address', type: 'address', indexed: true },
+ { name: 'fee', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'ReferrerFee',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'freeTrialLength', internalType: 'uint256', type: 'uint256', indexed: false },
+ { name: 'refundPenaltyBasisPoints', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'RefundPenaltyChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'previousAdminRole', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'newAdminRole', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ ],
+ name: 'RoleAdminChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'account', internalType: 'address', type: 'address', indexed: true },
+ { name: 'sender', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'RoleGranted',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32', indexed: true },
+ { name: 'account', internalType: 'address', type: 'address', indexed: true },
+ { name: 'sender', internalType: 'address', type: 'address', indexed: true },
+ ],
+ name: 'RoleRevoked',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'from', internalType: 'address', type: 'address', indexed: true },
+ { name: 'to', internalType: 'address', type: 'address', indexed: true },
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256', indexed: true },
+ ],
+ name: 'Transfer',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [{ name: 'transferFeeBasisPoints', internalType: 'uint256', type: 'uint256', indexed: false }],
+ name: 'TransferFeeChanged',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'lockAddress', internalType: 'address', type: 'address', indexed: true },
+ { name: 'unlockAddress', internalType: 'address', type: 'address', indexed: false },
+ ],
+ name: 'UnlockCallFailed',
+ },
+ {
+ type: 'event',
+ anonymous: false,
+ inputs: [
+ { name: 'sender', internalType: 'address', type: 'address', indexed: true },
+ { name: 'tokenAddress', internalType: 'address', type: 'address', indexed: true },
+ { name: 'recipient', internalType: 'address', type: 'address', indexed: true },
+ { name: 'amount', internalType: 'uint256', type: 'uint256', indexed: false },
+ ],
+ name: 'Withdrawal',
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'DEFAULT_ADMIN_ROLE',
+ outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'addLockManager',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_approved', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'approve',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_keyOwner', internalType: 'address', type: 'address' }],
+ name: 'balanceOf',
+ outputs: [{ name: 'balance', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'burn',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'cancelAndRefund',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'expirationDuration',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'expireAndRefundFor',
+ outputs: [],
+ },
+ {
+ stateMutability: 'payable',
+ type: 'function',
+ inputs: [
+ { name: '_value', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ { name: '_data', internalType: 'bytes', type: 'bytes' },
+ ],
+ name: 'extend',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'freeTrialLength',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'gasRefundValue',
+ outputs: [{ name: '_refundValue', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'getApproved',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'getCancelAndRefundValue',
+ outputs: [{ name: 'refund', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_keyOwner', internalType: 'address', type: 'address' }],
+ name: 'getHasValidKey',
+ outputs: [{ name: 'isValid', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'role', internalType: 'bytes32', type: 'bytes32' }],
+ name: 'getRoleAdmin',
+ outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_time', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'getTransferFee',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_duration', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'grantKeyExtension',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_recipients', internalType: 'address[]', type: 'address[]' },
+ { name: '_expirationTimestamps', internalType: 'uint256[]', type: 'uint256[]' },
+ { name: '_keyManagers', internalType: 'address[]', type: 'address[]' },
+ ],
+ name: 'grantKeys',
+ outputs: [{ name: '', internalType: 'uint256[]', type: 'uint256[]' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'grantRole',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'hasRole',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_lockCreator', internalType: 'address payable', type: 'address' },
+ { name: '_expirationDuration', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_keyPrice', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxNumberOfKeys', internalType: 'uint256', type: 'uint256' },
+ { name: '_lockName', internalType: 'string', type: 'string' },
+ ],
+ name: 'initialize',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_owner', internalType: 'address', type: 'address' },
+ { name: '_operator', internalType: 'address', type: 'address' },
+ ],
+ name: 'isApprovedForAll',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'isLockManager',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'isOwner',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ ],
+ name: 'isRenewable',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'isValidKey',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'keyExpirationTimestampFor',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ name: 'keyManagerOf',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'keyPrice', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'lendKey',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'maxKeysPerAddress',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'maxNumberOfKeys',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenIdFrom', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenIdTo', internalType: 'uint256', type: 'uint256' },
+ { name: '_amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'mergeKeys',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [{ name: '', internalType: 'bytes', type: 'bytes' }], name: 'migrate', outputs: [] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'name', outputs: [{ name: '', internalType: 'string', type: 'string' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'numberOfOwners',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyCancelHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyCancelHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyExtendHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyExtendHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyGrantHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyGrantHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyPurchaseHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyPurchaseHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onKeyTransferHook',
+ outputs: [{ name: '', internalType: 'contract ILockKeyTransferHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onTokenURIHook',
+ outputs: [{ name: '', internalType: 'contract ILockTokenURIHook', type: 'address' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'onValidKeyHook',
+ outputs: [{ name: '', internalType: 'contract ILockValidKeyHook', type: 'address' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'owner', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'ownerOf',
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
+ },
+ {
+ stateMutability: 'pure',
+ type: 'function',
+ inputs: [],
+ name: 'publicLockVersion',
+ outputs: [{ name: '', internalType: 'uint16', type: 'uint16' }],
+ },
+ {
+ stateMutability: 'payable',
+ type: 'function',
+ inputs: [
+ { name: '_values', internalType: 'uint256[]', type: 'uint256[]' },
+ { name: '_recipients', internalType: 'address[]', type: 'address[]' },
+ { name: '_referrers', internalType: 'address[]', type: 'address[]' },
+ { name: '_keyManagers', internalType: 'address[]', type: 'address[]' },
+ { name: '_data', internalType: 'bytes[]', type: 'bytes[]' },
+ ],
+ name: 'purchase',
+ outputs: [{ name: '', internalType: 'uint256[]', type: 'uint256[]' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ { name: '_data', internalType: 'bytes', type: 'bytes' },
+ ],
+ name: 'purchasePriceFor',
+ outputs: [{ name: 'minKeyPrice', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '', internalType: 'address', type: 'address' }],
+ name: 'referrerFees',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'refundPenaltyBasisPoints',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ ],
+ name: 'renewMembershipFor',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'renounceLockManager', outputs: [] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'renounceRole',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: 'role', internalType: 'bytes32', type: 'bytes32' },
+ { name: 'account', internalType: 'address', type: 'address' },
+ ],
+ name: 'revokeRole',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'safeTransferFrom',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_data', internalType: 'bytes', type: 'bytes' },
+ ],
+ name: 'safeTransferFrom',
+ outputs: [],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'schemaVersion', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_approved', internalType: 'bool', type: 'bool' },
+ ],
+ name: 'setApprovalForAll',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_onKeyPurchaseHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyCancelHook', internalType: 'address', type: 'address' },
+ { name: '_onValidKeyHook', internalType: 'address', type: 'address' },
+ { name: '_onTokenURIHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyTransferHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyExtendHook', internalType: 'address', type: 'address' },
+ { name: '_onKeyGrantHook', internalType: 'address', type: 'address' },
+ ],
+ name: 'setEventHooks',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_refundValue', internalType: 'uint256', type: 'uint256' }],
+ name: 'setGasRefundValue',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ { name: '_keyManager', internalType: 'address', type: 'address' },
+ ],
+ name: 'setKeyManagerOf',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_lockName', internalType: 'string', type: 'string' },
+ { name: '_lockSymbol', internalType: 'string', type: 'string' },
+ { name: '_baseTokenURI', internalType: 'string', type: 'string' },
+ ],
+ name: 'setLockMetadata',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: 'account', internalType: 'address', type: 'address' }],
+ name: 'setOwner',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_referrer', internalType: 'address', type: 'address' },
+ { name: '_feeBasisPoint', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'setReferrerFee',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_to', internalType: 'address', type: 'address' },
+ { name: '_tokenIdFrom', internalType: 'uint256', type: 'uint256' },
+ { name: '_timeShared', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'shareKey',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: 'interfaceId', internalType: 'bytes4', type: 'bytes4' }],
+ name: 'supportsInterface',
+ outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
+ },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'symbol', outputs: [{ name: '', internalType: 'string', type: 'string' }] },
+ { stateMutability: 'view', type: 'function', inputs: [], name: 'tokenAddress', outputs: [{ name: '', internalType: 'address', type: 'address' }] },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_index', internalType: 'uint256', type: 'uint256' }],
+ name: 'tokenByIndex',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [
+ { name: '_keyOwner', internalType: 'address', type: 'address' },
+ { name: '_index', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'tokenOfOwnerByIndex',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_tokenId', internalType: 'uint256', type: 'uint256' }],
+ name: 'tokenURI',
+ outputs: [{ name: '', internalType: 'string', type: 'string' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [{ name: '_keyOwner', internalType: 'address', type: 'address' }],
+ name: 'totalKeys',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'totalSupply',
+ outputs: [{ name: '_totalKeysCreated', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'transferFeeBasisPoints',
+ outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_from', internalType: 'address', type: 'address' },
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'transferFrom',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_recipient', internalType: 'address', type: 'address' },
+ { name: '_tokenId', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'unlendKey',
+ outputs: [],
+ },
+ {
+ stateMutability: 'view',
+ type: 'function',
+ inputs: [],
+ name: 'unlockProtocol',
+ outputs: [{ name: '', internalType: 'contract IUnlock', type: 'address' }],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_keyPrice', internalType: 'uint256', type: 'uint256' },
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ ],
+ name: 'updateKeyPricing',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_newExpirationDuration', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxNumberOfKeys', internalType: 'uint256', type: 'uint256' },
+ { name: '_maxKeysPerAcccount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'updateLockConfig',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_freeTrialLength', internalType: 'uint256', type: 'uint256' },
+ { name: '_refundPenaltyBasisPoints', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'updateRefundPenalty',
+ outputs: [],
+ },
+ { stateMutability: 'nonpayable', type: 'function', inputs: [], name: 'updateSchemaVersion', outputs: [] },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [{ name: '_transferFeeBasisPoints', internalType: 'uint256', type: 'uint256' }],
+ name: 'updateTransferFee',
+ outputs: [],
+ },
+ {
+ stateMutability: 'nonpayable',
+ type: 'function',
+ inputs: [
+ { name: '_tokenAddress', internalType: 'address', type: 'address' },
+ { name: '_recipient', internalType: 'address payable', type: 'address' },
+ { name: '_amount', internalType: 'uint256', type: 'uint256' },
+ ],
+ name: 'withdraw',
+ outputs: [],
+ },
+ { stateMutability: 'payable', type: 'receive' },
+] as const
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// React
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__.
+ */
+export function useUnlockV12Read
>(
+ config: Omit, 'abi'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, ...config } as UseContractReadConfig)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"chainId"`.
+ */
+export function useUnlockV12ChainId>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'chainId', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"computeAvailableDiscountFor"`.
+ */
+export function useUnlockV12ComputeAvailableDiscountFor<
+ TFunctionName extends 'computeAvailableDiscountFor',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'computeAvailableDiscountFor', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"estimatedGasForPurchase"`.
+ */
+export function useUnlockV12EstimatedGasForPurchase<
+ TFunctionName extends 'estimatedGasForPurchase',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'estimatedGasForPurchase', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"getAdmin"`.
+ */
+export function useUnlockV12GetAdmin>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'getAdmin', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"getGlobalBaseTokenURI"`.
+ */
+export function useUnlockV12GetGlobalBaseTokenUri<
+ TFunctionName extends 'getGlobalBaseTokenURI',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'getGlobalBaseTokenURI', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"getGlobalTokenSymbol"`.
+ */
+export function useUnlockV12GetGlobalTokenSymbol<
+ TFunctionName extends 'getGlobalTokenSymbol',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'getGlobalTokenSymbol', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"globalBaseTokenURI"`.
+ */
+export function useUnlockV12GlobalBaseTokenUri<
+ TFunctionName extends 'globalBaseTokenURI',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'globalBaseTokenURI', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"globalTokenSymbol"`.
+ */
+export function useUnlockV12GlobalTokenSymbol<
+ TFunctionName extends 'globalTokenSymbol',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'globalTokenSymbol', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"grossNetworkProduct"`.
+ */
+export function useUnlockV12GrossNetworkProduct<
+ TFunctionName extends 'grossNetworkProduct',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'grossNetworkProduct', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"isOwner"`.
+ */
+export function useUnlockV12IsOwner>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'isOwner', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"locks"`.
+ */
+export function useUnlockV12Locks>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'locks', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"networkBaseFee"`.
+ */
+export function useUnlockV12NetworkBaseFee<
+ TFunctionName extends 'networkBaseFee',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'networkBaseFee', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"owner"`.
+ */
+export function useUnlockV12Owner>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'owner', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"protocolFee"`.
+ */
+export function useUnlockV12ProtocolFee>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'protocolFee', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"proxyAdminAddress"`.
+ */
+export function useUnlockV12ProxyAdminAddress<
+ TFunctionName extends 'proxyAdminAddress',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'proxyAdminAddress', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"publicLockAddress"`.
+ */
+export function useUnlockV12PublicLockAddress<
+ TFunctionName extends 'publicLockAddress',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'publicLockAddress', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"publicLockImpls"`.
+ */
+export function useUnlockV12PublicLockImpls<
+ TFunctionName extends 'publicLockImpls',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'publicLockImpls', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"publicLockLatestVersion"`.
+ */
+export function useUnlockV12PublicLockLatestVersion<
+ TFunctionName extends 'publicLockLatestVersion',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'publicLockLatestVersion', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"publicLockVersions"`.
+ */
+export function useUnlockV12PublicLockVersions<
+ TFunctionName extends 'publicLockVersions',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'publicLockVersions', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"recordConsumedDiscount"`.
+ */
+export function useUnlockV12RecordConsumedDiscount<
+ TFunctionName extends 'recordConsumedDiscount',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'recordConsumedDiscount', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"totalDiscountGranted"`.
+ */
+export function useUnlockV12TotalDiscountGranted<
+ TFunctionName extends 'totalDiscountGranted',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'totalDiscountGranted', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"udt"`.
+ */
+export function useUnlockV12Udt>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'udt', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"uniswapOracles"`.
+ */
+export function useUnlockV12UniswapOracles<
+ TFunctionName extends 'uniswapOracles',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'uniswapOracles', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"unlockVersion"`.
+ */
+export function useUnlockV12UnlockVersion<
+ TFunctionName extends 'unlockVersion',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'unlockVersion', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"weth"`.
+ */
+export function useUnlockV12Weth>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: unlockV12ABI, functionName: 'weth', ...config } as UseContractReadConfig<
+ typeof unlockV12ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__.
+ */
+export function useUnlockV12Write(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], TFunctionName, TMode>
+ : UseContractWriteConfig & {
+ abi?: never
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"__initializeOwnable"`.
+ */
+export function useUnlockV12InitializeOwnable(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig<
+ PrepareWriteContractResult['request']['abi'],
+ '__initializeOwnable',
+ TMode
+ > & { functionName?: '__initializeOwnable' }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: '__initializeOwnable'
+ } = {} as any
+) {
+ return useContractWrite({
+ abi: unlockV12ABI,
+ functionName: '__initializeOwnable',
+ ...config,
+ } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"addLockTemplate"`.
+ */
+export function useUnlockV12AddLockTemplate(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'addLockTemplate', TMode> & {
+ functionName?: 'addLockTemplate'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'addLockTemplate'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'addLockTemplate', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"configUnlock"`.
+ */
+export function useUnlockV12ConfigUnlock(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'configUnlock', TMode> & {
+ functionName?: 'configUnlock'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'configUnlock'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'configUnlock', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"createLock"`.
+ */
+export function useUnlockV12CreateLock(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'createLock', TMode> & {
+ functionName?: 'createLock'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'createLock'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'createLock', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"createUpgradeableLock"`.
+ */
+export function useUnlockV12CreateUpgradeableLock(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig<
+ PrepareWriteContractResult['request']['abi'],
+ 'createUpgradeableLock',
+ TMode
+ > & { functionName?: 'createUpgradeableLock' }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'createUpgradeableLock'
+ } = {} as any
+) {
+ return useContractWrite({
+ abi: unlockV12ABI,
+ functionName: 'createUpgradeableLock',
+ ...config,
+ } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"createUpgradeableLockAtVersion"`.
+ */
+export function useUnlockV12CreateUpgradeableLockAtVersion(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig<
+ PrepareWriteContractResult['request']['abi'],
+ 'createUpgradeableLockAtVersion',
+ TMode
+ > & { functionName?: 'createUpgradeableLockAtVersion' }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'createUpgradeableLockAtVersion'
+ } = {} as any
+) {
+ return useContractWrite({
+ abi: unlockV12ABI,
+ functionName: 'createUpgradeableLockAtVersion',
+ ...config,
+ } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"initialize"`.
+ */
+export function useUnlockV12Initialize(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'initialize', TMode> & {
+ functionName?: 'initialize'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'initialize'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'initialize', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"initializeProxyAdmin"`.
+ */
+export function useUnlockV12InitializeProxyAdmin(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig<
+ PrepareWriteContractResult['request']['abi'],
+ 'initializeProxyAdmin',
+ TMode
+ > & { functionName?: 'initializeProxyAdmin' }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'initializeProxyAdmin'
+ } = {} as any
+) {
+ return useContractWrite({
+ abi: unlockV12ABI,
+ functionName: 'initializeProxyAdmin',
+ ...config,
+ } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"postLockUpgrade"`.
+ */
+export function useUnlockV12PostLockUpgrade(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'postLockUpgrade', TMode> & {
+ functionName?: 'postLockUpgrade'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'postLockUpgrade'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'postLockUpgrade', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"recordKeyPurchase"`.
+ */
+export function useUnlockV12RecordKeyPurchase(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'recordKeyPurchase', TMode> & {
+ functionName?: 'recordKeyPurchase'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'recordKeyPurchase'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'recordKeyPurchase', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"removeLock"`.
+ */
+export function useUnlockV12RemoveLock(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'removeLock', TMode> & {
+ functionName?: 'removeLock'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'removeLock'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'removeLock', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"renounceOwnership"`.
+ */
+export function useUnlockV12RenounceOwnership(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'renounceOwnership', TMode> & {
+ functionName?: 'renounceOwnership'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'renounceOwnership'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'renounceOwnership', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"resetTrackedValue"`.
+ */
+export function useUnlockV12ResetTrackedValue(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'resetTrackedValue', TMode> & {
+ functionName?: 'resetTrackedValue'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'resetTrackedValue'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'resetTrackedValue', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"setLockTemplate"`.
+ */
+export function useUnlockV12SetLockTemplate(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'setLockTemplate', TMode> & {
+ functionName?: 'setLockTemplate'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'setLockTemplate'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'setLockTemplate', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"setOracle"`.
+ */
+export function useUnlockV12SetOracle(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'setOracle', TMode> & {
+ functionName?: 'setOracle'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'setOracle'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'setOracle', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"setProtocolFee"`.
+ */
+export function useUnlockV12SetProtocolFee(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'setProtocolFee', TMode> & {
+ functionName?: 'setProtocolFee'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'setProtocolFee'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'setProtocolFee', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"transferOwnership"`.
+ */
+export function useUnlockV12TransferOwnership(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'transferOwnership', TMode> & {
+ functionName?: 'transferOwnership'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'transferOwnership'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'transferOwnership', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"transferTokens"`.
+ */
+export function useUnlockV12TransferTokens(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'transferTokens', TMode> & {
+ functionName?: 'transferTokens'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'transferTokens'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'transferTokens', ...config } as any)
+}
+
+/**
+ * Wraps __{@link useContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"upgradeLock"`.
+ */
+export function useUnlockV12UpgradeLock(
+ config: TMode extends 'prepared'
+ ? UseContractWriteConfig['request']['abi'], 'upgradeLock', TMode> & {
+ functionName?: 'upgradeLock'
+ }
+ : UseContractWriteConfig & {
+ abi?: never
+ functionName?: 'upgradeLock'
+ } = {} as any
+) {
+ return useContractWrite({ abi: unlockV12ABI, functionName: 'upgradeLock', ...config } as any)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__.
+ */
+export function usePrepareUnlockV12Write(
+ config: Omit, 'abi'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, ...config } as UsePrepareContractWriteConfig)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"__initializeOwnable"`.
+ */
+export function usePrepareUnlockV12InitializeOwnable(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: '__initializeOwnable', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ '__initializeOwnable'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"addLockTemplate"`.
+ */
+export function usePrepareUnlockV12AddLockTemplate(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'addLockTemplate', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'addLockTemplate'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"configUnlock"`.
+ */
+export function usePrepareUnlockV12ConfigUnlock(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'configUnlock', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'configUnlock'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"createLock"`.
+ */
+export function usePrepareUnlockV12CreateLock(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'createLock', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'createLock'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"createUpgradeableLock"`.
+ */
+export function usePrepareUnlockV12CreateUpgradeableLock(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'createUpgradeableLock', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'createUpgradeableLock'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"createUpgradeableLockAtVersion"`.
+ */
+export function usePrepareUnlockV12CreateUpgradeableLockAtVersion(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'createUpgradeableLockAtVersion', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'createUpgradeableLockAtVersion'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"initialize"`.
+ */
+export function usePrepareUnlockV12Initialize(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'initialize', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'initialize'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"initializeProxyAdmin"`.
+ */
+export function usePrepareUnlockV12InitializeProxyAdmin(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'initializeProxyAdmin', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'initializeProxyAdmin'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"postLockUpgrade"`.
+ */
+export function usePrepareUnlockV12PostLockUpgrade(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'postLockUpgrade', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'postLockUpgrade'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"recordKeyPurchase"`.
+ */
+export function usePrepareUnlockV12RecordKeyPurchase(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'recordKeyPurchase', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'recordKeyPurchase'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"removeLock"`.
+ */
+export function usePrepareUnlockV12RemoveLock(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'removeLock', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'removeLock'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"renounceOwnership"`.
+ */
+export function usePrepareUnlockV12RenounceOwnership(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'renounceOwnership', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'renounceOwnership'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"resetTrackedValue"`.
+ */
+export function usePrepareUnlockV12ResetTrackedValue(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'resetTrackedValue', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'resetTrackedValue'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"setLockTemplate"`.
+ */
+export function usePrepareUnlockV12SetLockTemplate(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'setLockTemplate', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'setLockTemplate'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"setOracle"`.
+ */
+export function usePrepareUnlockV12SetOracle(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'setOracle', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'setOracle'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"setProtocolFee"`.
+ */
+export function usePrepareUnlockV12SetProtocolFee(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'setProtocolFee', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'setProtocolFee'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"transferOwnership"`.
+ */
+export function usePrepareUnlockV12TransferOwnership(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'transferOwnership', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'transferOwnership'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"transferTokens"`.
+ */
+export function usePrepareUnlockV12TransferTokens(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'transferTokens', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'transferTokens'
+ >)
+}
+
+/**
+ * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link unlockV12ABI}__ and `functionName` set to `"upgradeLock"`.
+ */
+export function usePrepareUnlockV12UpgradeLock(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return usePrepareContractWrite({ abi: unlockV12ABI, functionName: 'upgradeLock', ...config } as UsePrepareContractWriteConfig<
+ typeof unlockV12ABI,
+ 'upgradeLock'
+ >)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__.
+ */
+export function useUnlockV12Event(
+ config: Omit, 'abi'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, ...config } as UseContractEventConfig)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"ConfigUnlock"`.
+ */
+export function useUnlockV12ConfigUnlockEvent(
+ config: Omit, 'abi' | 'eventName'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'ConfigUnlock', ...config } as UseContractEventConfig)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"GNPChanged"`.
+ */
+export function useUnlockV12GnpChangedEvent(
+ config: Omit, 'abi' | 'eventName'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'GNPChanged', ...config } as UseContractEventConfig)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"LockUpgraded"`.
+ */
+export function useUnlockV12LockUpgradedEvent(
+ config: Omit, 'abi' | 'eventName'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'LockUpgraded', ...config } as UseContractEventConfig)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"NewLock"`.
+ */
+export function useUnlockV12NewLockEvent(config: Omit, 'abi' | 'eventName'> = {} as any) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'NewLock', ...config } as UseContractEventConfig)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"OwnershipTransferred"`.
+ */
+export function useUnlockV12OwnershipTransferredEvent(
+ config: Omit, 'abi' | 'eventName'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'OwnershipTransferred', ...config } as UseContractEventConfig<
+ typeof unlockV12ABI,
+ 'OwnershipTransferred'
+ >)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"ResetTrackedValue"`.
+ */
+export function useUnlockV12ResetTrackedValueEvent(
+ config: Omit, 'abi' | 'eventName'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'ResetTrackedValue', ...config } as UseContractEventConfig<
+ typeof unlockV12ABI,
+ 'ResetTrackedValue'
+ >)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"SetLockTemplate"`.
+ */
+export function useUnlockV12SetLockTemplateEvent(
+ config: Omit, 'abi' | 'eventName'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'SetLockTemplate', ...config } as UseContractEventConfig<
+ typeof unlockV12ABI,
+ 'SetLockTemplate'
+ >)
+}
+
+/**
+ * Wraps __{@link useContractEvent}__ with `abi` set to __{@link unlockV12ABI}__ and `eventName` set to `"UnlockTemplateAdded"`.
+ */
+export function useUnlockV12UnlockTemplateAddedEvent(
+ config: Omit, 'abi' | 'eventName'> = {} as any
+) {
+ return useContractEvent({ abi: unlockV12ABI, eventName: 'UnlockTemplateAdded', ...config } as UseContractEventConfig<
+ typeof unlockV12ABI,
+ 'UnlockTemplateAdded'
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__.
+ */
+export function usePublicLockV13Read>(
+ config: Omit, 'abi'> = {} as any
+) {
+ return useContractRead({ abi: publicLockV13ABI, ...config } as UseContractReadConfig)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"DEFAULT_ADMIN_ROLE"`.
+ */
+export function usePublicLockV13DefaultAdminRole<
+ TFunctionName extends 'DEFAULT_ADMIN_ROLE',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'DEFAULT_ADMIN_ROLE', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"balanceOf"`.
+ */
+export function usePublicLockV13BalanceOf<
+ TFunctionName extends 'balanceOf',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'balanceOf', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"expirationDuration"`.
+ */
+export function usePublicLockV13ExpirationDuration<
+ TFunctionName extends 'expirationDuration',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'expirationDuration', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"freeTrialLength"`.
+ */
+export function usePublicLockV13FreeTrialLength<
+ TFunctionName extends 'freeTrialLength',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'freeTrialLength', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"gasRefundValue"`.
+ */
+export function usePublicLockV13GasRefundValue<
+ TFunctionName extends 'gasRefundValue',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'gasRefundValue', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"getApproved"`.
+ */
+export function usePublicLockV13GetApproved<
+ TFunctionName extends 'getApproved',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'getApproved', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"getCancelAndRefundValue"`.
+ */
+export function usePublicLockV13GetCancelAndRefundValue<
+ TFunctionName extends 'getCancelAndRefundValue',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'getCancelAndRefundValue', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"getHasValidKey"`.
+ */
+export function usePublicLockV13GetHasValidKey<
+ TFunctionName extends 'getHasValidKey',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'getHasValidKey', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"getRoleAdmin"`.
+ */
+export function usePublicLockV13GetRoleAdmin<
+ TFunctionName extends 'getRoleAdmin',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'getRoleAdmin', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"getTransferFee"`.
+ */
+export function usePublicLockV13GetTransferFee<
+ TFunctionName extends 'getTransferFee',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'getTransferFee', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"hasRole"`.
+ */
+export function usePublicLockV13HasRole>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'hasRole', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"isApprovedForAll"`.
+ */
+export function usePublicLockV13IsApprovedForAll<
+ TFunctionName extends 'isApprovedForAll',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'isApprovedForAll', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"isLockManager"`.
+ */
+export function usePublicLockV13IsLockManager<
+ TFunctionName extends 'isLockManager',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'isLockManager', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"isOwner"`.
+ */
+export function usePublicLockV13IsOwner>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'isOwner', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"isRenewable"`.
+ */
+export function usePublicLockV13IsRenewable<
+ TFunctionName extends 'isRenewable',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'isRenewable', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"isValidKey"`.
+ */
+export function usePublicLockV13IsValidKey<
+ TFunctionName extends 'isValidKey',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'isValidKey', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"keyExpirationTimestampFor"`.
+ */
+export function usePublicLockV13KeyExpirationTimestampFor<
+ TFunctionName extends 'keyExpirationTimestampFor',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'keyExpirationTimestampFor', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"keyManagerOf"`.
+ */
+export function usePublicLockV13KeyManagerOf<
+ TFunctionName extends 'keyManagerOf',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'keyManagerOf', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"keyPrice"`.
+ */
+export function usePublicLockV13KeyPrice>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'keyPrice', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"maxKeysPerAddress"`.
+ */
+export function usePublicLockV13MaxKeysPerAddress<
+ TFunctionName extends 'maxKeysPerAddress',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'maxKeysPerAddress', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"maxNumberOfKeys"`.
+ */
+export function usePublicLockV13MaxNumberOfKeys<
+ TFunctionName extends 'maxNumberOfKeys',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'maxNumberOfKeys', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"name"`.
+ */
+export function usePublicLockV13Name>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'name', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"numberOfOwners"`.
+ */
+export function usePublicLockV13NumberOfOwners<
+ TFunctionName extends 'numberOfOwners',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'numberOfOwners', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"onKeyCancelHook"`.
+ */
+export function usePublicLockV13OnKeyCancelHook<
+ TFunctionName extends 'onKeyCancelHook',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'onKeyCancelHook', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"onKeyExtendHook"`.
+ */
+export function usePublicLockV13OnKeyExtendHook<
+ TFunctionName extends 'onKeyExtendHook',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'onKeyExtendHook', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"onKeyGrantHook"`.
+ */
+export function usePublicLockV13OnKeyGrantHook<
+ TFunctionName extends 'onKeyGrantHook',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'onKeyGrantHook', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"onKeyPurchaseHook"`.
+ */
+export function usePublicLockV13OnKeyPurchaseHook<
+ TFunctionName extends 'onKeyPurchaseHook',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'onKeyPurchaseHook', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"onKeyTransferHook"`.
+ */
+export function usePublicLockV13OnKeyTransferHook<
+ TFunctionName extends 'onKeyTransferHook',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'onKeyTransferHook', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"onTokenURIHook"`.
+ */
+export function usePublicLockV13OnTokenUriHook<
+ TFunctionName extends 'onTokenURIHook',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'onTokenURIHook', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"onValidKeyHook"`.
+ */
+export function usePublicLockV13OnValidKeyHook<
+ TFunctionName extends 'onValidKeyHook',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'onValidKeyHook', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"owner"`.
+ */
+export function usePublicLockV13Owner>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'owner', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"ownerOf"`.
+ */
+export function usePublicLockV13OwnerOf>(
+ config: Omit, 'abi' | 'functionName'> = {} as any
+) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'ownerOf', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"publicLockVersion"`.
+ */
+export function usePublicLockV13PublicLockVersion<
+ TFunctionName extends 'publicLockVersion',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'publicLockVersion', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"purchasePriceFor"`.
+ */
+export function usePublicLockV13PurchasePriceFor<
+ TFunctionName extends 'purchasePriceFor',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'purchasePriceFor', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"referrerFees"`.
+ */
+export function usePublicLockV13ReferrerFees<
+ TFunctionName extends 'referrerFees',
+ TSelectData = ReadContractResult
+>(config: Omit, 'abi' | 'functionName'> = {} as any) {
+ return useContractRead({ abi: publicLockV13ABI, functionName: 'referrerFees', ...config } as UseContractReadConfig<
+ typeof publicLockV13ABI,
+ TFunctionName,
+ TSelectData
+ >)
+}
+
+/**
+ * Wraps __{@link useContractRead}__ with `abi` set to __{@link publicLockV13ABI}__ and `functionName` set to `"refundPenaltyBasisPoints"`.
+ */
+export function usePublicLockV13RefundPenaltyBasisPoints<
+ TFunctionName extends 'refundPenaltyBasisPoints',
+ TSelectData = ReadContractResult
+>(config: Omit