GraphQL SDK
![GitHub issues](https://img.shields.io/github/issues/livepeer/livepeerjs/graphql-sdk.svg?style=flat-square)
A GraphQL API that can be used to simplify protocol interaction. It can be used directly in the browser or in node.js applications.
Table of Contents
Installation
yarn add @livepeer/graphql-sdk
Schema Types
Table of Contents
Query
Contains all protocol data-fetching queries
Objects
Account
A type that describes a Livepeer account
Field | Argument | Type | Description |
---|
id | String! |
The ETH address for an account
|
ethBalance | String! |
The ETH balance for an account
|
tokenBalance | String! |
The Livepeer Token (LPTU) balance for an account
|
broadcaster | Broadcaster! |
The broadcaster info for an account
|
delegator | Delegator! |
The delegator info for an account
|
transcoder | Transcoder! |
The transcoder info for an account
|
Broadcaster
Submit transcode jobs for live video streams.
Field | Argument | Type | Description |
---|
id | String! |
The broadcaster's ETH address
|
deposit | String! |
The broadcaster's ETH deposit (required to create a Job)
|
withdrawBlock | String! |
The earliest ETH block at which the broadcaster is eligible to withdraw their deposited ETH
|
jobs | [Job!]! |
The jobs created by a broadcaster
|
skip | Int | |
limit | Int | |
Delegator
Users that bond tokens and delegate their bonded stake to other users, usually registered transcoders in exchange for shared rewards and fees.
Field | Argument | Type | Description |
---|
id | String! |
The ETH address of a delegator
|
status | DelegatorStatus! |
The status of a delegator
|
bondedAmount | String! |
The amount of Livepeer Token a delegator has bonded
|
fees | String! |
The amount of fees a delegator has collected
|
delegateAddress | String! |
The ETH address of the delegate (the one whom the delegator has bonded to)
|
delegatedAmount | String! |
The amount of Livepeer Token the delegator has delegated
|
lastClaimRound | String! |
The last round that the delegator claimed reward and fee pool shares
|
startRound | String! |
The round the delegator becomes bonded and delegated to its delegate
|
withdrawRound | String! |
The round the delegator can withdraw its stake.
|
Job
A transcode job, created by a broadcaster
Field | Argument | Type | Description |
---|
id | String! |
Unique identifer for job
|
broadcaster | String! |
Address of broadcaster that requested the transcoding job
|
profiles | [JobProfile!]! |
Transcoding profiles associated with the job
|
streamId | String! |
Unique identifier for the stream
|
JobProfile
A job's transcoding profile
Field | Argument | Type | Description |
---|
id | String! |
The hashcode for the transcoding profile
|
name | String! |
The name of the profile
|
bitrate | String! |
The profile bitrate
|
framerate | Int! |
The profile framerate
|
resolution | String! |
The screen resolution of the profile
|
Mutation
Contains all protocol transaction queries
Field | Argument | Type | Description |
---|
approve | Boolean |
Approve an amount for an ERC20 token transfer
|
type | String! | |
amount | String! | |
bond | Boolean |
Submits a bond transaction for a previously approved amount
|
to | String! | |
amount | String! | |
claimEarnings | Boolean |
Claims earnings from your last claim round through specified round
|
endRound | String! | |
unbond | Boolean |
Submits a bond transaction for a previously approved amount
|
Protocol
Field | Argument | Type | Description |
---|
paused | Boolean! |
Protocol paused
|
id | String! |
Protocol id
|
Round
Submit transcode jobs for live video streams.
Field | Argument | Type | Description |
---|
id | String! |
The round number
|
initialized | Boolean! |
Whether the round was initialized
|
lastInitializedRound | String! |
The last previously initialized round
|
length | String! |
The number of blocks this round lasts for
|
startBlock | String! |
When the round starts
|
Subscription
Field | Argument | Type | Description |
---|
transactionSubmitted | Transaction! |
A newly submitted transaction
|
transactionConfirmed | Transaction! |
A newly confirmed transaction
|
Transaction
An Ethereum transaction receipt
Transcoder
Perform transcoding work for the network. The transcoders with the most delegated stake are elected as active transcoders that process transcode jobs for the network.
Field | Argument | Type | Description |
---|
id | String! |
The transcoder's ETH address
|
active | Boolean! |
Whether or not the transcoder is active
|
status | TranscoderStatus! |
The status of the transcoder
|
lastRewardRound | String! |
Last round that the transcoder called reward
|
rewardCut | String! |
% of block reward cut paid to transcoder by a delegator
|
feeShare | String! |
% of fees paid to delegators by transcoder
|
pricePerSegment | String! |
Price per segment for a stream (LPTU)
|
pendingRewardCut | String! |
Pending block reward cut for next round if the transcoder is active
|
pendingFeeShare | String! |
Pending fee share for next round if the transcoder is active
|
pendingPricePerSegment | String! |
Pending price per segment for next round if the transcoder is active
|
totalStake | String! |
Total tokens delegated toward a transcoder (including their own)
|
Enums
DelegatorStatus
The possible statuses of a delegator
Value | Description |
---|
Pending | |
Bonded | |
Unbonding | |
Unbonded | |
TranscoderStatus
The possible statuses of a transcoder
Value | Description |
---|
NotRegistered | |
Registered | |
Resigned | |
Scalars
Boolean
The Boolean
scalar type represents true
or false
.
Int
The Int
scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
JSON
The JSON
scalar type represents JSON values as specified by ECMA-404.
String
The String
scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.