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.
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.
JS
|
import Web3 from'web3'import Tree from'~/contracts/ITree'const web3 =newWeb3();const Tree =newweb3.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