LinkLib
Functions
linkCharacter
Links any characterId.
function linkCharacter(
uint256 fromCharacterId,
uint256 toCharacterId,
bytes32 linkType,
bytes memory data,
address linklist
) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor a link action. |
toCharacterId | uint256 | The character ID to be linked. |
linkType | bytes32 | linkType, like “follow”. |
data | bytes | The data to pass to the link module, if any. |
linklist | address | The linklist contract address. |
unlinkCharacter
Unlinks a given character.
function unlinkCharacter(uint256 fromCharacterId, uint256 toCharacterId, bytes32 linkType, address linklist) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor a unlink action. |
toCharacterId | uint256 | The character ID to be unlinked. |
linkType | bytes32 | linkType, like “follow”. |
linklist | address | The linklist contract address. |
linkNote
Links a given note.
function linkNote(
uint256 fromCharacterId,
uint256 toCharacterId,
uint256 toNoteId,
bytes32 linkType,
bytes calldata data,
address linklist
) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor a link action. |
toCharacterId | uint256 | The owner characterId of the note to link. |
toNoteId | uint256 | The id of the note to link. |
linkType | bytes32 | The linkType, like “follow”. |
data | bytes | The data to pass to the link module, if any. |
linklist | address | The linklist contract address. |
unlinkNote
Unlinks a given note.
function unlinkNote(
uint256 fromCharacterId,
uint256 toCharacterId,
uint256 toNoteId,
bytes32 linkType,
address linklist
) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor an unlink action. |
toCharacterId | uint256 | The character ID of note to unlink. |
toNoteId | uint256 | The id of note to unlink. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
linkLinklist
Links a linklist.
function linkLinklist(uint256 fromCharacterId, uint256 toLinkListId, bytes32 linkType, address linklist) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor an link action. |
toLinkListId | uint256 | The linklist if to link. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
unlinkLinklist
Unlinks a linklist.
function unlinkLinklist(uint256 fromCharacterId, uint256 toLinkListId, bytes32 linkType, address linklist) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor an unlink action. |
toLinkListId | uint256 | The linklist if to unlink. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
linkERC721
Links an ERC721 token.
function linkERC721(uint256 fromCharacterId, address tokenAddress, uint256 tokenId, bytes32 linkType, address linklist)
external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor an link action. |
tokenAddress | address | The token address of ERC721 to link. |
tokenId | uint256 | The token ID of ERC721 to link. |
linkType | bytes32 | linkType, like “follow”. |
linklist | address | The linklist contract address. |
unlinkERC721
Unlinks an ERC721 token.
function unlinkERC721(
uint256 fromCharacterId,
address tokenAddress,
uint256 tokenId,
bytes32 linkType,
address linklist
) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor an unlink action. |
tokenAddress | address | The token address of ERC721 to unlink. |
tokenId | uint256 | The token ID of ERC721 to unlink. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
linkAddress
Creates a link to a given address.
function linkAddress(uint256 fromCharacterId, address ethAddress, bytes32 linkType, address linklist) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to init the link. |
ethAddress | address | The address to link. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
unlinkAddress
Unlinks a given address.
function unlinkAddress(uint256 fromCharacterId, address ethAddress, bytes32 linkType, address linklist) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to init the unlink. |
ethAddress | address | The address to unlink. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
linkAnyUri
Links any uri.
function linkAnyUri(uint256 fromCharacterId, string calldata toUri, bytes32 linkType, address linklist) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor an link action. |
toUri | string | The uri to link. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
unlinkAnyUri
Unlinks any uri.
function unlinkAnyUri(uint256 fromCharacterId, string calldata toUri, bytes32 linkType, address linklist) external;
Parameters
Name | Type | Description |
---|---|---|
fromCharacterId | uint256 | The character ID to sponsor an unlink action. |
toUri | string | The uri to unlink. |
linkType | bytes32 | LinkType, like “follow”. |
linklist | address | The linklist contract address. |
_mintLinklist
Returns the linklistId if the linklist already exists, Otherwise, creates a new linklist and return its ID.
function _mintLinklist(uint256 fromCharacterId, bytes32 linkType, address linklist)
internal
returns (uint256 linklistId);
_ownerOf
function _ownerOf(uint256 characterId) internal view returns (address);