Fetch real-time $DPSK token price data:
const response = await fetch('https://api.geckoterminal.com/api/v2/networks/polygon_pos/pools/0xbab9dfe80908ef83647899d49e7a211767a27ccd'); if (response.ok) { const data = await response.json(); const tokenPrice = data.data.attributes.base_token_price_usd; console.log(`Current $DPSK Price: $${tokenPrice}`); }
The GeckoTerminal API is free to use with no authentication required. Visit GeckoTerminal for more information.
function registerHandle(string calldata handle) external whenNotPaused nonReentrant { _validateHandleBlacklist(msg.sender); require(_isValidHandle(handle), "Handle must be 2-42 chars, lowercase alphanumeric only"); require(handleOwners[handle] == address(0), "Handle already taken"); require(balanceOf(msg.sender) >= minimumHandleTokens, "Must have minimum required tokens"); handleOwners[handle] = msg.sender; userHandles[msg.sender] = handle; }
function userHandles(address account) public view returns (string memory) { return userHandles[account]; }
function handleOwners(string memory handle) public view returns (address) { return handleOwners[handle]; }
function balanceOf(address account) public view returns (uint256)
[ { "inputs": [ {"internalType": "address", "name": "account", "type": "address"} ], "name": "balanceOf", "outputs": [ {"internalType": "uint256", "name": "", "type": "uint256"} ], "stateMutability": "view", "type": "function" }, { "inputs": [ {"internalType": "string", "name": "handle", "type": "string"} ], "name": "registerHandle", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ {"internalType": "address", "name": "", "type": "address"} ], "name": "userHandles", "outputs": [ {"internalType": "string", "name": "", "type": "string"} ], "stateMutability": "view", "type": "function" }, { "inputs": [ {"internalType": "string", "name": "", "type": "string"} ], "name": "handleOwners", "outputs": [ {"internalType": "address", "name": "", "type": "address"} ], "stateMutability": "view", "type": "function" } ]