summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorbt <bt@rctt.net>2026-06-04 17:13:39 +0200
committerbt <bt@rctt.net>2026-06-04 17:13:39 +0200
commit6628f924ba4aefa8f8361ebc252fb225718359c2 (patch)
treef1337371a66546c5d87908b5fac682ff6b1b92f2 /core
parented2621c17f353878ea86ce2c16cac7cd04fb4c6a (diff)
downloadsolec-6628f924ba4aefa8f8361ebc252fb225718359c2.tar.gz
solec-6628f924ba4aefa8f8361ebc252fb225718359c2.zip
[common] Add channels list queryv0.6.0
Diffstat (limited to 'core')
-rw-r--r--core/data.go6
-rw-r--r--core/payload.go49
2 files changed, 55 insertions, 0 deletions
diff --git a/core/data.go b/core/data.go
index 6871a89..4705c75 100644
--- a/core/data.go
+++ b/core/data.go
@@ -25,6 +25,8 @@ const (
PayloadServerAuth = 0x06
PayloadUsermode = 0x07
PayloadHistory = 0x08
+ PayloadList = 0x09
+ PayloadListItem = 0x10
PayloadTest = 0xFF
)
@@ -146,6 +148,10 @@ func Decode(buf io.Reader) (any, error) {
return DecodeUsermode(buf)
case PayloadHistory:
return DecodeHistory(buf)
+ case PayloadList:
+ return DecodeList(buf)
+ case PayloadListItem:
+ return DecodeListItem(buf)
case PayloadTest:
return DecodeTest(buf)
default:
diff --git a/core/payload.go b/core/payload.go
index be9d844..aad21ee 100644
--- a/core/payload.go
+++ b/core/payload.go
@@ -226,6 +226,55 @@ func DecodeHistory(buf io.Reader) (History, error) {
return h, nil
}
+type List struct {
+ Count int64
+ Offset int64
+}
+
+func (l List) Wrap() (PayloadType, []any) {
+ return PayloadList, []any{
+ l.Count,
+ l.Offset,
+ }
+}
+
+func DecodeList(buf io.Reader) (List, error) {
+ var l List
+
+ err := decodeNumeric(buf, &l.Count)
+ if err != nil {
+ return l, err
+ }
+
+ err = decodeNumeric(buf, &l.Offset)
+ if err != nil {
+ return l, err
+ }
+
+ return l, nil
+}
+
+type ListItem struct {
+ Address string
+}
+
+func (l ListItem) Wrap() (PayloadType, []any) {
+ return PayloadListItem, []any{
+ l.Address,
+ }
+}
+
+func DecodeListItem(buf io.Reader) (ListItem, error) {
+ var l ListItem
+
+ err := decodeString(buf, &l.Address)
+ if err != nil {
+ return l, err
+ }
+
+ return l, nil
+}
+
type Test struct {
Num1 uint8
Time1 time.Time