Last active
November 15, 2023 20:17
-
-
Save robbestad/d6ac8cc87de2c2b84876e3199e6e5e22 to your computer and use it in GitHub Desktop.
Revisions
-
robbestad revised this gist
Nov 15, 2023 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,7 @@ def check(pubkey): jsondata = response.json() amount = jsondata.get('amount') if amount: print(pubkey, amount) return int(amount) else: return None -
robbestad revised this gist
Nov 15, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def main(): amount = check(pubkey) if amount is not None: total += amount print(f"------\ntotal: {total}") if __name__ =="__main__": main() -
robbestad created this gist
Nov 15, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ import requests def check(pubkey): url = f"https://airdrop.pyth.network/api/grant/v1/amount_and_proof?ecosystem=solana&identity={pubkey}" response = requests.get(url) if response.status_code == 200: jsondata = response.json() amount = jsondata.get('amount') if amount: return int(amount) else: return None else: return None def main(): pubkeys=[ ] total = 0 for pubkey in pubkeys: amount = check(pubkey) if amount is not None: total += amount print(f"------\ntotal: {total}") if __name__ =="__main__": main()