Skip to content

Instantly share code, notes, and snippets.

@robbestad
Last active November 15, 2023 20:17
Show Gist options
  • Select an option

  • Save robbestad/d6ac8cc87de2c2b84876e3199e6e5e22 to your computer and use it in GitHub Desktop.

Select an option

Save robbestad/d6ac8cc87de2c2b84876e3199e6e5e22 to your computer and use it in GitHub Desktop.

Revisions

  1. robbestad revised this gist Nov 15, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions pyth.py
    Original 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
  2. robbestad revised this gist Nov 15, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pyth.py
    Original 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}")
    print(f"------\ntotal: {total}")

    if __name__ =="__main__":
    main()
  3. robbestad created this gist Nov 15, 2023.
    28 changes: 28 additions & 0 deletions pyth.py
    Original 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()