Expand description
State machine types.
Structs§
- Action
Cancel Payment - The user requests the transfer to be cancelled. This state change can fail, it depends on the node’s role and the current state of the transfer.
- Action
Channel Close - User is closing an existing channel.
- Action
Channel Coop Settle - Cooperatively withdraw funds from channel back to both parties and close the channel in a single operation.
- Action
Channel SetReveal Timeout - Change the reveal timeout value of a given channel.
- Action
Channel Withdraw - Withdraw funds from channel.
- Action
Init Chain - Transition to initialize chain state
- Action
Init Initiator - Initial state of a new mediated transfer.
- Action
Init Mediator - Initial state for a new mediator.
- Action
Init Target - Initial state for a new target.
- Action
Transfer Reroute - A transfer will be rerouted.
- Balance
Proof State - Proof of a channel balance that can be used on-chain to resolve disputes.
- Block
- Transition used when a new block is mined.
- Chain
State - Umbrella object that stores the per blockchain state. For each registry smart contract there must be a token network registry. Within the token network registry the existing token networks and channels are registered.
- Channel
EndState - The state of one of the nodes in a two party channel.
- Channel
State - The state of a channel.“”“
- Contract
Receive Channel Batch Unlock - All the locks were claimed via the blockchain.
Used when all the hash time locks were unlocked and a log ChannelUnlocked is emitted
by the token network contract.
Note:
For this state change the contract caller is not important but only the
receiving address.
receiveris the address to which theunlocked_amountwas transferred.returned_tokenswas transferred to the channel partner. - Contract
Receive Channel Closed - A channel to which this node IS a participant was closed.
- Contract
Receive Channel Deposit - A channel to which this node IS a participant had a deposit.
- Contract
Receive Channel Opened - A new channel was created and this node IS a participant.
- Contract
Receive Channel Settled - A channel to which this node IS a participant was settled.
- Contract
Receive Channel Withdraw - A channel to which this node IS a participant had a withdraw.
- Contract
Receive Route New - New channel was created and this node is NOT a participant.
- Contract
Receive Secret Reveal - A new secret was registered with the SecretRegistry contract.
- Contract
Receive Token Network Created - A new token was registered with the token network registry.
- Contract
Receive Token Network Registry - Registers a new token network registry. A token network registry corresponds to a registry smart contract.
- Contract
Receive Update Transfer - Participant updated the latest balance proof on-chain.
- Contract
Send Channel Batch Unlock - Look for unlocks that we should do after settlement
- Contract
Send Channel Close - Event emitted to close the netting channel. This event is used when a node needs to prepare the channel to unlock on-chain.
- Contract
Send Channel Coop Settle - Event emitted if node wants to cooperatively settle a channel.
- Contract
Send Channel Settle - Event emitted if the netting channel must be settled.
- Contract
Send Channel Update Transfer - Event emitted if the netting channel balance proof must be updated.
- Contract
Send Channel Withdraw - Event emitted if node wants to withdraw from current channel balance.
- Contract
Send Event Inner - Common attributes of events which represent on-chain transactions.
- Contract
Send Secret Reveal - Event emitted when the lock must be claimed on-chain.
- Coop
Settle State - The state of a pending cooperative settle underway.
- Decrypted
Secret - Type to hold a decrypted secret with metadata.
- Error
Invalid Action Coop Settle - Event emitted when an invalid coop-settle is initiated.
- Error
Invalid Action SetReveal Timeout - Event emitted when an invalid withdraw is initiated.
- Error
Invalid Action Withdraw - Event emitted when an invalid withdraw is initiated.
- Error
Invalid Received Lock Expired - Event emitted when an invalid lock expired message is received.
- Error
Invalid Received Locked Transfer - Event emitted when an invalid locked transfer is received.
- Error
Invalid Received Transfer Refund - Event emitted when an invalid refund transfer is received.
- Error
Invalid Received Unlock - Event emitted when an invalid unlock message is received.
- Error
Invalid Received Withdraw Confirmation - Event emitted when an invalid withdraw confirmation is received.
- Error
Invalid Received Withdraw Expired - Event emitted when an invalid withdraw expired event is received.
- Error
Invalid Received Withdraw Request - Event emitted when an invalid withdraw request is received.
- Error
Invalid Secret Request - Event emitted when an invalid SecretRequest is received.
- Error
Payment Sent Failed - Event emitted by the payer when a transfer has failed.
- Error
Route Failed - Event emitted when a route failed. As a payment can try different routes to reach the intended target some of the routes can fail. This event is emitted when a route failed. This means that multiple EventRouteFailed for a given payment and it’s therefore different to EventPaymentSentFailed. A route can fail for two reasons:
- Error
Unexpected Reveal - Event emitted when an unexpected secret reveal message is received.
- Error
Unlock Claim Failed - Event emitted when a lock claim failed.
- Error
Unlock Failed - Event emitted when a lock unlock failed.
- Expired
Withdraw State - State of an expired withdraw.
- FeeSchedule
State - Mediation fee schedule parameters.
- Hash
Time Lock State - Represents a hash time lock.
- HopState
- Information about the next hop.
- Initiator
Payment State - State of a payment for the initiator node. A single payment may have multiple transfers. E.g. because if one of the transfers fails or timeouts another transfer will be started with a different secrethash.
- Initiator
Task - An initiator task.
- Initiator
Transfer State - State of a transfer for the initiator node.
- Interpolate
- Linear interpolation of a function with given points
- Locked
Transfer State - A pending transfer state.
- Mediation
FeeConfig - Configuration parameters of the mediator fee.
- Mediation
Pair State - State for a mediated transfer. A mediator will pay payee node knowing that there is a payer node to cover the token expenses. This state keeps track of transfers for the payer and payee, and the current state of the payment.
- Mediator
Task - A mediator task.
- Mediator
Transfer State - State of a transfer for the mediator node. A mediator may manage multiple channels because of refunds, but all these channels will be used for the same transfer (not for different payments).
- PFSUpdate
- PFS state update notification.
- Payment
Mapping State - Global map from secrethash to a transfer task. This mapping is used to quickly dispatch state changes by secrethash, for those that don’t have a balance proof, e.g. SecretReveal. This mapping forces one task per secrethash, assuming that secrethash collision is unlikely. Features like token swaps, that span multiple networks, must be encapsulated in a single task to work with this structure.
- Payment
Received Success - Event emitted when a payee has received a payment.
- Payment
Sent Success - Event emitted by the initiator when a transfer is considered successful.
- Pending
Locks State - List of encoded locks.
- Pending
Withdraw State - State of a pending withdraw.
- Random
- The channel’s pseudo random number generator.
- Receive
Delivered - A Delivered message was received.
- Receive
Lock Expired - A LockExpired message received.
- Receive
Processed - A processed message was received.
- Receive
Secret Request - A SecretRequest message received.
- Receive
Secret Reveal - A SecretReveal message received.
- Receive
Transfer Cancel Route - A mediator sends us a refund due to a failed route.
- Receive
Transfer Refund - A RefundTransfer message received.
- Receive
Unlock - An Unlock message received.
- Receive
Withdraw Confirmation - A Withdraw message was received.
- Receive
Withdraw Expired - A WithdrawExpired message was received.
- Receive
Withdraw Request - A Withdraw message received.
- Route
State - A possible route for a payment to a given target.
- Send
Lock Expired - Sends a LockExpired to another node.
- Send
Locked Transfer - A locked transfer that must be sent to
recipient. - Send
Message Event Inner - Common message attributes.
- Send
Processed - Send a Processed to another node.
- Send
Secret Request - Event used by a target node to request the secret from the initiator
(
recipient). - Send
Secret Reveal - Sends a SecretReveal to another node.
- Send
Unlock - Event to send a balance-proof to the counter-party, used after a lock is unlocked locally allowing the counter-party to claim it.
- Send
Withdraw Confirmation - Event used by node to confirm a withdraw for a channel’s partner.
- Send
Withdraw Expired - Event used by node to expire a withdraw request.
- Send
Withdraw Request - Event used by node to request a withdraw from channel partner.
- Target
Task - A target task.
- Target
Transfer State - State of a transfer for the target node.“”“
- Token
Network Registry State - Corresponds to a token network registry smart contract.“”“
- Token
Network State - Corresponds to a token network smart contract.“”“
- Transaction
Channel Deposit - Deposit transaction information.
- Transaction
Execution Status - The transaction execution status.
- Transfer
Description With Secret State - Describes a transfer (target, amount, and token) and contains an additional secret that can be used with a hash-time-lock.
- Unlock
Claim Success - Event emitted when a lock claim succeded.
- Unlock
Partial Proof State - Stores the lock along with its unlocking secret.
- Unlock
Success - Event emitted when a lock unlock succeded.
- Update
Services Addresses - A
RegisteredServicecontract event was received. - Updated
Services Addresses - Transition used when adding a new service address.
- Waiting
Transfer State - Waiting transfer state.
Enums§
- Channel
Status - Vairants of the channel status
- Contract
Send Event - An enum of the ContractSendEvent variants.
- Event
- An enum containing all possible event variants.
- Payee
State - Variants of the payee states.
- Payer
State - Variants of the payers states.
- Send
Message Event - An enum of the SendEvent variants.
- State
Change - An enum containing all possible state change variants.
- Target
State - Variants of the target states.
- Transaction
Result - Transaction result state.
- Transfer
Role - Determine the type of the transfer task.
- Transfer
State - Variants of the transfer states.
- Transfer
Task - Variants of transfer tasks.
- Waiting
Transfer Status - Variants of the waiting transfer status.