Created
November 13, 2019 20:09
-
-
Save PaulRBerg/696201a8e0c0e87618b811cea0cbde2f 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
import gql from "graphql-tag"; | |
export const BUNDLE = ` | |
{ | |
cash | |
percentage | |
units | |
wei | |
} | |
`; | |
export const CANCELLATION = ` | |
cancellation { | |
id | |
recipientBalance | |
recipientInterest | |
sablierInterest | |
senderBalance | |
senderInterest | |
timeLabel @client | |
timestamp | |
txhash | |
} | |
`; | |
export const TIME_LABELS = ` | |
timeLabels @client { | |
passed | |
remaining | |
startTime | |
stopTime | |
} | |
`; | |
export const TOKEN = ` | |
token { | |
id | |
address @client | |
decimals | |
name | |
symbol | |
} | |
`; | |
const TXS = ` | |
txs(where: { event: "CreateStream" }) { | |
id | |
block | |
event | |
timestamp | |
} | |
`; | |
export const WITHDRAWALS = ` | |
withdrawals { | |
id | |
amount | |
} | |
`; | |
export const STREAM = ` | |
id | |
${CANCELLATION} | |
deposit | |
exchangeRateInitial | |
outstanding @client ${BUNDLE} | |
paid @client ${BUNDLE} | |
ratePerSecond | |
recipient | |
recipientSharePercentage | |
sender | |
senderSharePercentage | |
startTime | |
status @client | |
stopTime | |
${TIME_LABELS} | |
timestamp | |
${TOKEN} | |
${TXS} | |
${WITHDRAWALS} | |
withdrawn @client ${BUNDLE} | |
withdrawable @client ${BUNDLE} | |
`; | |
export const GET_RECIPIENT_STREAMS = gql` | |
query Streams($recipient: String!) { | |
streams(first: 100, orderBy: id, orderDirection: desc, where: { recipient: $recipient }) { | |
${STREAM} | |
} | |
} | |
`; | |
export const GET_SENDER_STREAMS = gql` | |
query Streams($sender: String!) { | |
streams(first: 100, orderBy: id, orderDirection: desc, where: { sender: $sender }) { | |
${STREAM} | |
} | |
} | |
`; | |
export const GET_STREAM = gql` | |
query Stream($id: ID!) { | |
stream(id: $id) { | |
${STREAM} | |
} | |
} | |
`; | |
export const GET_STREAM_DEPOSIT = gql` | |
query StreamDeposit($id: ID!) { | |
stream(id: $id) { | |
deposit | |
} | |
} | |
`; | |
export const GET_STREAM_PAID_BUNDLE = gql` | |
query StreamPaidBundle($id: ID!) { | |
stream(id: $id) { | |
paid @client ${BUNDLE} | |
} | |
} | |
`; | |
export const GET_STREAM_TOKEN = gql` | |
query StreamToken($id: ID!) { | |
stream(id: $id) { | |
${TOKEN} | |
} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment