3. Transferring tokens from user's acc ➡️ receiver's acc ✅
4. Checking Available Token in one's acc ✅
Tried to deploy any such web app for the first time on Vercel and realized it's not the same as using it on localhost 😐
Facing some issues while interacting with Phantom wallet on the deployed website. Will try to find more about it and fix it.
It was quite fun, building the whole tx step-by-step. The fun part? viewing them on sol-explorer and closely understand what all happened. Good stuff 🤯
Used a bit of Chakra-UI to style my product. Will be quite helpful once I get a hold of it.
Until next time 🫡
Don't forget to check out the tweet below and share it with others. I am on this journey of learning and invite you all to be a part of it 🫴
The curious case of using offset values with data slice property 🤔 #Solana#Day8#offset
dataSlice is used to literally slice 🔪 the returned data buffer.
Let's say you have a dataBuffer in which the first 8bytes are storing data you don't need. So, we can slice that from all the data and then carry out operations on the remaining data. Optimized much? 🤌
Now, the no. of bytes, to slice from the beginning, is defined as an 'offset' value inside of it.
Or
using offset value in dataSlice defines how much bytes to slice, in the returned buffer.
Analogy: You can either buy all the potatoes and then decide what potatoes to use for making 🍟 or you can filter out the good potatoes while purchasing them. In either case the fries will be made of good 🥔 #Day7#Solana#filtering
Sorry 😛, stay with me. Here purchasing 🥔 refer to fetching accounts data using 2 approaches:
1. Fetching all acc. without any data (just their pubKeys) ~ (purchasing all)
2. Filtering what acc. to fetch, before fetching them without any data ~ (filtering before buying)
In the 1st approach, one is fetching accounts without any data.
Now what that means is, we have a pubkey with us.
Whenever a client demands for data, we will be using the pubkey we saved earlier to further fetch associated account data.