Ashish Bhintade’s Post

View profile for Ashish Bhintade, graphic

Frontend Developer @Bitquery

"𝗛𝗼𝘄 𝗱𝗼 𝗜 𝗴𝗲𝘁 𝘁𝗵𝗲 𝗹𝗮𝘁𝗲𝘀𝘁 𝗳𝘂𝗻𝗱𝘀 𝗮𝗽𝗽𝗿𝗼𝘃𝗲𝗱 𝗯𝘆 𝗮𝗻 𝗮𝗱𝗱𝗿𝗲𝘀𝘀?” Exploring Blockchain Data #74 In the previous post, we discussed how to obtain the latest approved funds. But what if you want to check the funds approved by a specific address? How would you retrieve that information? Today, we'll see how to do this using Bitquery’s API. ``` {   EVM(dataset: combined, network: eth) {     Calls(       limit: {count: 10}       where: {Call: {From: {is: "0x3b17056cc4439c61cea41fe1c9f517af75a978f7"}, Signature: {Signature: {is: "approve(address,uint256)"}}}}     ) {       Call {         Approver: From         Token: To       }       Transaction {         Hash       }       Arguments {         Name         Type         Value {           ... on EVM_ABI_Address_Value_Arg {             address           }           ... on EVM_ABI_BigInt_Value_Arg {             bigInteger           }           ... on EVM_ABI_String_Value_Arg {             string           }         }       }     }   } } ``` First, we define the address of our approver within the "𝘍𝘳𝘰𝘮" filter to isolate the approval calls from that address. Then, we specify the type of call we want in the "𝘚𝘪𝘨𝘯𝘢𝘵𝘶𝘳𝘦" filter, in this case, 𝘢𝘱𝘱𝘳𝘰𝘷𝘦. In the resultant data, Approver and Token as aliases for the "𝘍𝘳𝘰𝘮" and "𝘛𝘰" fields, respectively. These fields provide the address of the approver and the smart contract address of the token. Within the Arguments field, “𝘕𝘢𝘮𝘦” will provide the name of the argument and “𝘛𝘺𝘱𝘦” will provide the type of the argument. And within the Value field, we'll retrieve the argument's value based on its corresponding type. I hope you understood today’s query. To try out this query you can go to https://lnkd.in/d2ee2zyb & see the results by pressing the red play button. Today we saw how to get the latest funds approved by an address. Stay tuned for next post. (PS comment down what else you want to see in this series. I will try to add that too.)

  • No alternative text description for this image

To view or add a comment, sign in

Explore topics