> For the complete documentation index, see [llms.txt](https://erc1000-docs.polarise.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://erc1000-docs.polarise.org/erc-1000-eip/2.-external-interfaces.md).

# 2. External Interfaces

| No. | Interface Name                              | Description                                                                                                                                                                                                                                                                                                |
| --- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1   | totalSupply()                               | Returns the total number of ERC-721 NFTs                                                                                                                                                                                                                                                                   |
| 2   | balanceOf(address)                          | Returns the number of ERC-20 tokens owned by an account                                                                                                                                                                                                                                                    |
| 3   | ownerOf(uint256)                            | Returns the owner of the ERC-721 NFT                                                                                                                                                                                                                                                                       |
| 4   | transfer(address, uint256)                  | Sends ERC-20 tokens to a specific address                                                                                                                                                                                                                                                                  |
| 5   | allowance(address, address)                 | Returns the authorised limit                                                                                                                                                                                                                                                                               |
| 6   | approve(address, uint256)                   | Approves a quantity of ERC-20 tokens for a specified address by checking the uint256 input parameter; if the quantity exceeds the total number of NFTs, it approves the specified quantity of ERC-20 tokens; otherwise, it approves the ERC-721 NFT for the specified address.                             |
| 7   | transferFrom(address, address, uint256)     | Sends the approved quantity of ERC-20 tokens or ERC-721 NFTs to a specified address, based on the uint256 input parameter; if the quantity exceeds the total number of ERC-721 NFTs, it indicates sending the approved quantity of ERC-20 tokens; otherwise, it indicates sending the approved ERC-721 NFT |
| 8   | safeTransferFrom(address, address, uint256) | Sends the approved quantity of ERC-20 tokens or ERC-721 NFTs to a specified address safely, based on the uint256 input parameter; if the quantity exceeds the total ERC-721 NFTs, it indicates sending the approved quantity of ERC-20 tokens; otherwise, it indicates sending the approved ERC-721 NFT    |
| 9   | setApprovalForAll(address, bool)            | Approves a specified address to take ownership of all ERC-721 NFTs                                                                                                                                                                                                                                         |
| 10  | getApproved(uint256)                        | Returns the address approved for a specific ERC-721 NFT                                                                                                                                                                                                                                                    |
| 11  | isApprovedForAll(address, address)          | Determines whether a specified address has been approved to take ownership of all ERC-721 NFTs                                                                                                                                                                                                             |
| 12  | randomTrade(uint256)                        | Randomly trades a certain quantity of ERC-721 NFTs                                                                                                                                                                                                                                                         |
| 13  | specificTrade(uint256\[ ])                  | Trades specific ERC-721 NFTs                                                                                                                                                                                                                                                                               |
| 14  | borrow(uint256\[ ], uint256, uint256)       | Using ERC-721 NFTs as collateral for a loan and sets loan terms to receive ERC-20 tokens, with added support for quoted orders                                                                                                                                                                             |
| 15  | redeemOrPurchase(uint256\[ ])               | Redeems collaterised ERC-721 NFTs; if the ERC-721 NFT is used as collateral for consignment, it is purchased through the listing                                                                                                                                                                           |
| 16  | outstandingLoanBalance(uint256)             | Returns the borrowed amount                                                                                                                                                                                                                                                                                |
