Read
idOf
Returns the fid (uint256) owned by an address, or returns zero if the address does not own an fid.
custodyOf
Returns the custody address (address) that owns a specific fid. Returns the zero address if the fid does not exist.
recoveryOf
Returns the recovery address (address) of an fid. Returns the zero address if the fid does not exist.
idCounter
Returns the highest registered fid (uint256) so far.
verifyFidSignature
Checks that a message was signed by the current custody address of an fid. Returns abool.
nonces
Returns the next unused nonce (uint256) for an address. Used for generating EIP-712 signatures.
Write
register
Will revert if called directly. Must be called via the ID Gateway.changeRecoveryAddress
Change the recovery address for the caller’s fid.transfer
Transfer the caller’s fid to a new address. Theto address must sign an EIP-712 Transfer
message accepting the transfer. The to address must not already own an fid.
Transfer signature
To transfer an fid to another account, the caller must provide an EIP-712 typed signature from the receiving address in the following format:Transfer(uint256 fid,address to,uint256 nonce,uint256 deadline)
[@farcaster/hub-web]
[Viem]
[helpers.ts]
[clients.ts]
transferAndChangeRecovery
Transfer the fid of the caller to a new address and change the fid’s recovery address. This can be used to safely receive an fid transfer from an untrusted address. The receiving address must sign an EIP-712TransferAndChangeRecovery message
accepting the transfer. The to address must not already own an fid.
TransferAndChangeRecovery signature
To transfer an fid to another account and change recovery, you must provide an EIP-712 typed signature from theto
address in the following format:
TransferAndChangeRecovery(uint256 fid,address to,address recovery,uint256 nonce,uint256 deadline)
[@farcaster/hub-web]
[Viem]
[helpers.ts]
[clients.ts]
recover
Transfer an fid to a new address if caller is the recovery address. Theto address must sign an
EIP-712 Transfer message accepting the transfer.
The to address must not already own an fid.
changeRecoveryAddressFor
Change the recovery address of an fid on behalf of the owner by providing a signature. The owner must sign an EIP-712ChangeRecoveryAddress signature approving the change.
ChangeRecoveryAddress signature
To change a recovery address on behalf of an fid owner, the caller must provide an EIP-712 typed signature from theowner address in the following format:
ChangeRecoveryAddress(uint256 fid,address from,address to,uint256 nonce,uint256 deadline)
[@farcaster/hub-web]
[Viem]
[helpers.ts]
[clients.ts]
transferFor
Transfer the fid owned by thefrom address to the to address. The caller must provide two
EIP-712 Transfer signatures: one from the from address authorizing the transfer out and one
from the to address accepting the transfer in. These messages have the same format. The to
address must not already own an fid.
transferAndChangeRecoveryFor
Transfer the fid owned by thefrom address to the to address, and change the fid’s recovery address. This can be
used to safely receive an fid transfer from an untrusted address.
The caller must provide two EIP-712 TransferAndChangeRecovery signatures: one
from the from address authorizing the transfer out and one from the to address accepting the transfer in. These
messages have the same format. The to address must not already own an fid.
recoverFor
Transfer an fid to a new address with a signature from the fid’s recovery address. The caller must provide two EIP-712Transfer signatures: one from the recovery address authorizing the transfer out and one
from the to address accepting the transfer in. These messages have the same format.
The to address must not already own an fid.
Errors
Source
IdRegistry.sol