Skip to content

Commit

Permalink
Merge pull request #11 from TLX-Protocol/circulating
Browse files Browse the repository at this point in the history
Add Endpoints for Supply Data
  • Loading branch information
chase-manning authored Apr 14, 2024
2 parents fe781b5 + b4a15bd commit 72f581c
Show file tree
Hide file tree
Showing 11 changed files with 2,746 additions and 547 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ A collection of API endpoints in TS deployed on Firebase for use with the TLX Pr

## Endpoints

- `example` Just a read endpoint that returns "Hello world"
- `circulatingSupply` Returns the Circulating Supply of TLX
- `maxSupply` Returns the Max Supply of TLX
- `totalSupply` Returns the Total Supply of TLX
- `supply` Returns all Supply data of TLX
1 change: 1 addition & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Compiled JavaScript files
lib/**/*.js
lib/**/*.js.map
lib/**/*.json

# TypeScript v1 declaration files
typings/
Expand Down
4 changes: 2 additions & 2 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"main": "lib/index.js",
"dependencies": {
"cors": "^2.8.5",
"ethers": "^6.9.0",
"ethers": "^6.11.1",
"firebase-admin": "^11.8.0",
"firebase-functions": "^4.3.1",
"firebase-functions": "^4.9.0",
"node-fetch": "^2.7.0"
},
"devDependencies": {
Expand Down
128 changes: 128 additions & 0 deletions functions/src/abis/erc20-abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[
{
"type": "function",
"name": "allowance",
"inputs": [
{ "name": "owner", "type": "address", "internalType": "address" },
{ "name": "spender", "type": "address", "internalType": "address" }
],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "approve",
"inputs": [
{ "name": "spender", "type": "address", "internalType": "address" },
{ "name": "value", "type": "uint256", "internalType": "uint256" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "balanceOf",
"inputs": [{ "name": "account", "type": "address", "internalType": "address" }],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "decimals",
"inputs": [],
"outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "name",
"inputs": [],
"outputs": [{ "name": "", "type": "string", "internalType": "string" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "symbol",
"inputs": [],
"outputs": [{ "name": "", "type": "string", "internalType": "string" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "totalSupply",
"inputs": [],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "transfer",
"inputs": [
{ "name": "to", "type": "address", "internalType": "address" },
{ "name": "value", "type": "uint256", "internalType": "uint256" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "transferFrom",
"inputs": [
{ "name": "from", "type": "address", "internalType": "address" },
{ "name": "to", "type": "address", "internalType": "address" },
{ "name": "value", "type": "uint256", "internalType": "uint256" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "Approval",
"inputs": [
{
"name": "owner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "spender",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "value",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Transfer",
"inputs": [
{
"name": "from",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "to",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "value",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
}
]
233 changes: 233 additions & 0 deletions functions/src/abis/locker-abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
[
{
"type": "constructor",
"inputs": [
{
"name": "addressProvider_",
"type": "address",
"internalType": "address"
},
{ "name": "lockTime_", "type": "uint256", "internalType": "uint256" },
{ "name": "rewardToken_", "type": "address", "internalType": "address" }
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "activeBalanceOf",
"inputs": [{ "name": "account_", "type": "address", "internalType": "address" }],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "amountStreamed",
"inputs": [],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "balanceOf",
"inputs": [{ "name": "account_", "type": "address", "internalType": "address" }],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "claim",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "claimable",
"inputs": [{ "name": "account_", "type": "address", "internalType": "address" }],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "decimals",
"inputs": [],
"outputs": [{ "name": "", "type": "uint8", "internalType": "uint8" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "donateRewards",
"inputs": [{ "name": "amount_", "type": "uint256", "internalType": "uint256" }],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "isShutdown",
"inputs": [],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "lock",
"inputs": [{ "name": "amount_", "type": "uint256", "internalType": "uint256" }],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "lockTime",
"inputs": [],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "migrate",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "migrateFor",
"inputs": [{ "name": "receiver_", "type": "address", "internalType": "address" }],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "rewardToken",
"inputs": [],
"outputs": [{ "name": "", "type": "address", "internalType": "address" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "rewardsStartTime",
"inputs": [],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "shutdown",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "totalRewards",
"inputs": [],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "totalStaked",
"inputs": [],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "unlockTime",
"inputs": [{ "name": "", "type": "address", "internalType": "address" }],
"outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
"stateMutability": "view"
},
{
"type": "event",
"name": "Claimed",
"inputs": [
{
"name": "account",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "DonatedRewards",
"inputs": [
{
"name": "account",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Locked",
"inputs": [
{
"name": "account",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Migrated",
"inputs": [
{
"name": "account",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "receiver",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{ "type": "event", "name": "Shutdown", "inputs": [], "anonymous": false },
{ "type": "error", "name": "AlreadyShutdown", "inputs": [] },
{ "type": "error", "name": "InsufficientBalance", "inputs": [] },
{ "type": "error", "name": "NotAuthorized", "inputs": [] },
{ "type": "error", "name": "NotOwner", "inputs": [] },
{ "type": "error", "name": "NotUnlocked", "inputs": [] },
{ "type": "error", "name": "RewardsAlreadyDonated", "inputs": [] },
{ "type": "error", "name": "StakerNotDeployed", "inputs": [] },
{ "type": "error", "name": "ZeroAddress", "inputs": [] },
{ "type": "error", "name": "ZeroAmount", "inputs": [] }
]
Loading

0 comments on commit 72f581c

Please sign in to comment.