GraphQL SDK
A GraphQL schema that can be used to simplify protocol interactions in the browser or node.js.
Table of Contents
Installation
yarn add @livepeer/graphql-sdk
Schema Types
Table of Contents
Query
Contains all protocol data-fetching queries
Mutation
Contains all protocol transaction queries
Field | Argument | Type | Description |
---|
approve | JSON |
Approve an amount for an ERC20 token transfer
|
type | String! | |
amount | String! | |
bond | JSON |
Submits a bond transaction for a previously approved amount
|
to | String! | |
amount | String! | |
claimEarnings | JSON |
Claims earnings from your last claim round through specified round
|
endRound | String! | |
sendTransaction | JSON |
Sends a transaction based on an input object
|
options | JSON! | |
unbond | JSON |
Submits a bond transaction for a previously approved amount
|
amount | String! | |
rebond | JSON |
Rebond tokens for an unbonding lock to a delegator's current delegate while a delegator is in the Bonded or Pending states
|
unbondingLockId | Int! | |
rebondFromUnbonded | JSON |
Rebond tokens for an unbonding lock to a delegate while a delegator is in the Unbonded state
|
delegate | String! | |
unbondingLockId | Int! | |
initializeRound | JSON |
Submits a round initialization transaction
|
Objects
Account
A type that describes a Livepeer account
Field | Argument | Type | Description |
---|
id | String! |
The ETH address for an account
|
ensName | String! |
The ENS name 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
|
unbondlocks | [UnbondLock]! |
The unbonding locks for an account
|
unbondlock | UnbondLock! |
An unbond lock for an account
|
lockId | String! | |
Block
Info about an Ethereum block.
Field | Argument | Type | Description |
---|
id | String! |
The block number
|
Broadcaster
Submit transcode jobs for live video streams.
Field | Argument | Type | Description |
---|
id | String! |
The broadcaster's ETH address
|
ensName | String! |
The ENS name for an account
|
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
|
ensName | String! |
The ENS name for an account
|
allowance | String! |
The delegator's token allowance
|
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
|
pendingFees | String! |
The total amount of ETH the delegator has earned through the current round
|
pendingStake | String! |
The total amount of tokens the delegator has earned through the current round
|
startRound | String! |
The round the delegator becomes bonded and delegated to its delegate
|
status | DelegatorStatus! |
The status of a delegator
|
withdrawAmount | String! |
The amount of Livepeer Token to withdraw for a delegator
|
withdrawRound | String! |
The round the delegator can withdraw its stake.
|
nextUnbondingLockId | String! |
The ID of the delegator's next unbonding lock
|
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
|
broadcasterENSName | String! |
The broadcaster's ENS name
|
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
|
Protocol
Field | Argument | Type | Description |
---|
id | String! |
Protocol id
|
paused | Boolean! |
Protocol paused
|
totalTokenSupply | String! |
Protocol totalTokenSupply
|
totalBondedToken | String! |
Protocol totalBondedToken
|
targetBondingRate | String! |
Protocol targetBondingRate
|
transcoderPoolMaxSize | String! |
Protocol transcoderPoolMaxSize
|
maxEarningsClaimsRounds | String! |
Protocol maxEarningsClaimsRounds
|
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
|
ensName | String! |
The ENS name for an account
|
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)
|
UnbondLock
Get an unbonding lock for a delegator
Field | Argument | Type | Description |
---|
id | String! |
unbonding lock id
|
delegator | String! |
The address of delegator unbonding from
|
amount | String! |
The amount being unbonded
|
withdrawRound | String! |
When the unbonding amount will be available for withdrawal
|
Enums
DelegatorStatus
The possible statuses of a delegator
Value | Description |
---|
Pending | |
Bonded | |
Unbonded | |
Unbonding | |
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.