jsonrpc
and id
fields. The documentation below only specifies the method
and params
fields for requests, and the result
field for responses.Content-Type: application/json
and Authorization: Bearer YOUR_JWT_TOKEN
headers.mainnet
, ropsten
, rinkeby
) for <NETWORK>
and zone1
or zone2
for <ZONE>
. When transacting, the precise URL prefix (of the form https://<ZONE>.<NETWORK>.kchannels.io/client/
) should be obtained from the Client Information endpoint in the Supporting API .https://zone-manager.<NETWORK>.kchannels.io/client/channel/
create_channel_definition
[]
(empty array)ChannelDefinition
object with an empty signature_list
owner_address
, deposit_address
, and sender_address_list
. If one of these fields is incorrect, do not proceed. 2) If you want to, you can add additional addresses to the sender_address_list
. If you have a smart contract wallet, you can change the deposit_address
(which initially matches owner_address
) to the smart contract address. 3) Sign the object (excluding the signature_list
portion) using EIP-712 and append the signature to signature_list
. 4) Submit the signed draft of the channel definition, as follows:ChannelDefinition
to the backend, which is signed by the backend and returned. Once this happens, the client has an open channel with the backend.https://zone-manager.<NETWORK>.kchannels.io/client/channel/
update_and_complete_channel_definition
ChannelDefinition
objectsignature_list
. This is the authoritative channel definition, and should be saved away. The channel is now open, and you can send transactions through it.ChannelDefinition
object for your records. 2) You may start transacting through the channel.https://<ZONE>.<NETWORK>.kchannels.io/client/transaction/
create_new_transaction
TransactionValue
objects (these are the assets being transferred, and their amounts)true
to force an external transaction, otherwise false
. If the recipient doesn't have an open channel with Kchannels, the backend detects this situation and can send the transaction from the sender's channel to the recipient's address as an Layer1 (on-chain) transaction. However, even if the recipient has an open channel, an external transaction can be forced by setting this flag. This should default to false
.null
true
, fees will be subtracted from the amount sent, so that the amount received by the recipient is smaller than the nominal amount sent. This is useful for (among other things) completely "emptying out" a channel, without leaving behind any dust. The default should be false
(fees are added on top of the nominal amount sent).Transaction
object. The summary
fields under sender_party
and recipient_party
are each null
, and the signature_list
field under metadata
is empty.signature_list
field 3) Submit the signed transaction, as follows:https://<ZONE>.<NETWORK>.kchannels.io/client/transaction/
process_transaction
Transaction
objectTransaction
object, this time with 2 additional signatures in the top-level signature_list
object, and an additional signature in the metadata
field's signature_list
object.TransactionSummary
objectTransactionSummary
component using EIP-712 and append the signature to its signature_list
. 3) Submit the signed TransactionSummary
, as follows:https://<ZONE>.<NETWORK>.kchannels.io/client/transaction/
complete_transaction
TransactionSummary
objectTransactionSummary
object, this time with 2 additional signatures in the signature_list
fieldTransactionSummary
object for your records. This object shows your final state and can be used as a proof in case of any disputes. 3) Unless the status (Result[1]) indicates an error, the transaction is complete and final.https://<ZONE>.<NETWORK>.kchannels.io/client/transaction/
fail_transaction
TransactionSummary
objectTransactionSummary
objectTransactionSummary
object for your records. This object shows your final state and can be used as a proof in case of any disputes.https://<ZONE>.<NETWORK>.kchannels.io/client/transaction/
abandon_transactions
[]
(empty array)deposit_address
or owner_address
, or any address at all) and force the transaction to be an external transaction (Params[5] = true
). You may also want to set Params[7] = true
in case you want to easily withdraw every last wei.