Created
May 9, 2023 18:59
-
-
Save jimscarver/6c1163d7bf382da35bd12ff3b3213a12 to your computer and use it in GitHub Desktop.
This file contains 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 characters
for k in $(cat addresses.txt); do | |
echo 'match ["'$k'"] { | |
[pubkey] => { | |
new | |
return, | |
revAddress(`rho:rev:address`), | |
lookup(`rho:registry:lookup`), | |
RevAddress(`rho:rev:address`), | |
stdout(`rho:io:stdout`), | |
revAddrCh, | |
RevVaultCh, | |
vaultCh, | |
balanceCh | |
in { | |
lookup!(`rho:rchain:revVault`, *RevVaultCh) | | |
RevAddress!("fromPublicKey", pubkey.hexToBytes(), *revAddrCh) | | |
for (@(_, RevVault) <- RevVaultCh; revAddr <- revAddrCh) { | |
@RevVault!("findOrCreate", *revAddr, *vaultCh) | | |
for (@(true, vault) <- vaultCh) { | |
@vault!("balance", *balanceCh) | | |
for (@balance <- balanceCh) { | |
return!(*revAddr ++ ",${bal}," %% {"bal": balance}, pubkey ) | |
} | |
} | |
} | |
} | |
} | |
} | |
' > /tmp/rho | |
curl -k -s -d @"/tmp/rho" https://observer.services.mainnet.rchain.coop/api/explore-deploy| | |
jq --raw-output '.expr[0].ExprString.data,.expr[1].ExprString.data'|sed '1{N;s/\n//;}' | |
#exit | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment