Technical Overview
Integrations
Redeemable Trees API
3min
web2 projects can use treejer's redeem api or they can deploy a self hosted version of it this api gives developers the option to automate generating a unique token for an email and attaching a wallet address to that email treejer redeem api 1 create an account and get an access token 2 set webhook(optional) 3 fund tree import web3 from 'web3' import regularsale from ' /contracts/iregularsale' const web3 = new web3(); const regularsale = new web3 eth contract(regularsale abi, process env contracttreeregularsale) const account = "0x0000"; //funder wallet address const recipient = "0x0000000000000000000000000000000000000000"; const referrer = "0x0000000000000000000000000000000000000000"; const tx = regularsale methods fundtree(count, referrer, recipient); const data = tx encodeabi(); let gas = await regularsale methods fundtree(count, referrer, recipient) estimategas({from account}); const receipt = await web3 eth sendtransaction({ from account, to regularsale address, value 0, data data, gas gas, type "0x2", maxpriorityfeepergas null, maxfeepergas null, }) 4 request for a unique token for an email 5 receiver gets an email with a unique token after going to that page, the user claim and adds a wallet for that token 6 third party app receives a webhook consist of email, unique token, access token, and a wallet address 7 transfer the tree token to that wallet address import web3 from 'web3' import tree from ' /contracts/itree' const web3 = new web3(); const tree = new web3 eth contract(tree abi, process env contracttreeaddress) const account = "0x0000"; const recipient = "0x0000000000000000000000000000000000000000"; const tokenid = 1; const tx = tree methods transferfrom(account, recipient, tokenid); const data = tx encodeabi(); let gas = await tree methods transferfrom(account, recipient, tokenid) estimategas({from account}); const receipt = await web3 eth sendtransaction({ from account, to tree address, value 0, data data, gas gas, type "0x2", maxpriorityfeepergas null, maxfeepergas null, }) self hosted developers can set up their own version of treejer api1 clone redeem repository 1 clone redeem repository 2 set up an environment 3 run the apps 4 all the processes and requests same as treejer api