You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 26, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/API.md
+45-6Lines changed: 45 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -591,15 +591,54 @@ Balance updates are sent as unsolicited server messages with the "bu" method:
591
591
592
592
The balance update provides the latest balances for all assets in the participant's unified ledger, allowing clients to maintain an up-to-date view of available funds without explicitly requesting them.
593
593
594
+
### Open Channels
595
+
596
+
The server automatically sends all open channels as a batch update to clients after successful authentication.
597
+
598
+
```json
599
+
{
600
+
"res": [1234567890123, "channels", [[
601
+
{
602
+
"channel_id": "0xfedcba9876543210...",
603
+
"participant": "0x1234567890abcdef...",
604
+
"status": "open",
605
+
"token": "0xeeee567890abcdef...",
606
+
"amount": "100000",
607
+
"chain_id": 137,
608
+
"adjudicator": "0xAdjudicatorContractAddress...",
609
+
"challenge": 86400,
610
+
"nonce": 1,
611
+
"version": 2,
612
+
"created_at": "2023-05-01T12:00:00Z",
613
+
"updated_at": "2023-05-01T12:30:00Z"
614
+
},
615
+
{
616
+
"channel_id": "0xabcdef1234567890...",
617
+
"participant": "0x1234567890abcdef...",
618
+
"status": "open",
619
+
"token": "0xeeee567890abcdef...",
620
+
"amount": "50000",
621
+
"chain_id": 42220,
622
+
"adjudicator": "0xAdjudicatorContractAddress...",
623
+
"challenge": 86400,
624
+
"nonce": 1,
625
+
"version": 3,
626
+
"created_at": "2023-04-15T10:00:00Z",
627
+
"updated_at": "2023-04-20T14:30:00Z"
628
+
}
629
+
]], 1619123456789],
630
+
"sig": ["0xabcd1234..."]
631
+
}
632
+
```
633
+
594
634
### Channel Updates
595
635
596
-
The server automatically sends channel updates to clients in these scenarios:
597
-
1. After successful authentication (for all existing channels)
598
-
2. When a channel is created
599
-
3. When a channel's status changes (open, joined, closed)
600
-
4. When a channel is resized
636
+
For channel updates, the server sends them in these scenarios:
637
+
1. When a channel is created
638
+
2. When a channel's status changes (open, joined, closed)
639
+
3. When a channel is resized
601
640
602
-
Channel updates are sent as unsolicited server messages with the "cu" method:
641
+
Individual channel updates are sent as unsolicited server messages with the "cu" method:
0 commit comments