- the UI connects to MetaMask and gets your xGRAM and TON balances
- when you click 'Swap' this triggers a token burn of xGRAM
- server listens to burn events and sends back TON to the burner's address
truffle
ganache-cli
MetaMask
pointing to Ganache
npm i
cd server
npm i
cd ../client
yarn
- have a ganache-cli instance running
- write down the first 2 accounts
- import the first account into MetaMask
- replace the value of
account
inserver/server.js
with the second - run
truffle migrate
in the main directory - run
node server
in theserver
directory - run
yarn start
in theclient
directory - hopefully the app will run and you will see a non-zero xGRAM balance
- click swap and watch the (almost) magic happen