Skip to content

Instantly share code, notes, and snippets.

@patsissons
Created June 19, 2020 23:17
Show Gist options
  • Save patsissons/24a14c07caacdba4f40dc8337127b5bc to your computer and use it in GitHub Desktop.
Save patsissons/24a14c07caacdba4f40dc8337127b5bc to your computer and use it in GitHub Desktop.
the future of Libra & GraphQL
{
# fetch an account by its public address
accountState(address: "3584d309264da2a85991b2bcdc44b7c7") {
sequenceNumber
authenticationKey
# scan sent events for this addresss
sentEvents(limit: 1) {
sequenceNumber
data {
... on SentPaymentEventData {
amount {
amount
currency
}
# expand into receiver of the transaction
receiverAccountState {
sequenceNumber
balances {
amount
currency
}
}
}
}
}
# scan received events for this address
receivedEvents(limit: 1) {
sequenceNumber
data {
... on ReceivedPaymentEventData {
amount {
amount
currency
}
# expand into the sender of the transaction
senderAccountState {
sequenceNumber
balances {
amount
currency
}
}
}
}
}
# scan transactions for this address
transactions(limit: 1) {
version
data {
... on UserTransactionData {
# expand into the sender for a user initiated transaction
senderAccountState {
sequenceNumber
}
script {
... on PeerToPeerTransferScript {
# expand into the receiver for a p2p script
receiverAccountState {
sequenceNumber
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment