From 65ff26235ed3f3262e9344915e4c3210688bc477 Mon Sep 17 00:00:00 2001 From: Christian Nennemann Date: Wed, 4 Mar 2026 01:03:02 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Sprint=207=20=E2=80=94=20Go=20SDK=20wit?= =?UTF-8?q?h=20QUIC=20transport=20and=20Cap'n=20Proto=20RPC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First non-Rust client SDK for quicproquo ecosystem. - Cap'n Proto codegen: generated 6487-line Go types from node.capnp with all 24 RPC methods (NodeService, Auth, Envelope) - QUIC transport: quic-go + TLS 1.3, ALPN "capnp", single bidi stream, 300s idle timeout, InsecureSkipVerify for dev, custom CA cert support - High-level qpq package: Connect, Health, ResolveUser, CreateChannel, Send/SendWithTTL, Receive/ReceiveWait, DeleteAccount, OPAQUE wrappers - Auth management: session token storage, version/token/deviceID on all RPCs - Example program and README with API reference All tests pass: go test ./..., go vet, go build --- sdks/go/README.md | 118 + sdks/go/cmd/example/main.go | 55 + sdks/go/go.mod | 13 + sdks/go/go.sum | 16 + sdks/go/proto/node/node.capnp | 45 + sdks/go/proto/node/node.capnp.go | 6487 +++++++++++++++++++++++++++ sdks/go/qpq/client.go | 377 ++ sdks/go/qpq/client_test.go | 58 + sdks/go/transport/transport.go | 126 + sdks/go/transport/transport_test.go | 69 + 10 files changed, 7364 insertions(+) create mode 100644 sdks/go/README.md create mode 100644 sdks/go/cmd/example/main.go create mode 100644 sdks/go/go.mod create mode 100644 sdks/go/go.sum create mode 100644 sdks/go/proto/node/node.capnp create mode 100644 sdks/go/proto/node/node.capnp.go create mode 100644 sdks/go/qpq/client.go create mode 100644 sdks/go/qpq/client_test.go create mode 100644 sdks/go/transport/transport.go create mode 100644 sdks/go/transport/transport_test.go diff --git a/sdks/go/README.md b/sdks/go/README.md new file mode 100644 index 0000000..1eca810 --- /dev/null +++ b/sdks/go/README.md @@ -0,0 +1,118 @@ +# quicproquo Go SDK + +Go client library for the [quicproquo](https://github.com/nicholasgasior/quicproquo) E2E encrypted messenger. + +## Prerequisites + +- Go 1.21+ +- A running quicproquo server + +## Installation + +```sh +go get quicproquo.dev/sdk/go +``` + +## Quick Start + +```go +package main + +import ( + "context" + "fmt" + + "quicproquo.dev/sdk/go/qpq" +) + +func main() { + ctx := context.Background() + + // Connect to a local server (dev mode) + client, err := qpq.Connect(ctx, qpq.Options{ + Addr: "127.0.0.1:5001", + InsecureSkipVerify: true, + }) + if err != nil { + panic(err) + } + defer client.Close() + + // Check server health + status, err := client.Health(ctx) + fmt.Println("Server:", status) + + // Set a session token (obtained via OPAQUE login) + client.SetSessionToken(token) + + // Resolve a user + key, err := client.ResolveUser(ctx, "alice") + + // Create a DM channel + channelID, wasNew, err := client.CreateChannel(ctx, peerKey) + + // Send a message + seq, err := client.Send(ctx, recipientKey, []byte("hello")) + + // Receive messages + msgs, err := client.Receive(ctx, myKey) + + // Long-poll for messages (5s timeout) + msgs, err = client.ReceiveWait(ctx, myKey, 5000) +} +``` + +## API Reference + +### Connection + +| Method | Description | +|---|---| +| `qpq.Connect(ctx, opts)` | Connect to a server, returns `*Client` | +| `client.Close()` | Disconnect | + +### Authentication + +| Method | Description | +|---|---| +| `client.SetSessionToken(token)` | Set a pre-existing OPAQUE session token | +| `client.RegisterStart(ctx, username, request)` | Start OPAQUE registration | +| `client.RegisterFinish(ctx, username, upload, identityKey)` | Complete OPAQUE registration | +| `client.LoginStart(ctx, username, request)` | Start OPAQUE login | +| `client.LoginFinish(ctx, username, finalization, identityKey)` | Complete OPAQUE login (stores token) | + +### Messaging + +| Method | Description | +|---|---| +| `client.ResolveUser(ctx, username)` | Look up a user's identity key | +| `client.CreateChannel(ctx, peerKey)` | Create a 1:1 DM channel | +| `client.Send(ctx, recipientKey, payload)` | Send a message | +| `client.SendWithTTL(ctx, recipientKey, payload, ttlSecs)` | Send a disappearing message | +| `client.Receive(ctx, recipientKey)` | Fetch queued messages | +| `client.ReceiveWait(ctx, recipientKey, timeoutMs)` | Long-poll for messages | +| `client.DeleteAccount(ctx)` | Permanently delete account | +| `client.Health(ctx)` | Check server health | + +### OPAQUE Login + +Full OPAQUE login requires a Go OPAQUE client library to generate the cryptographic +messages. The SDK provides the RPC wrappers (`RegisterStart`/`RegisterFinish`, +`LoginStart`/`LoginFinish`), but you must supply the OPAQUE protocol bytes. + +For testing without OPAQUE, use `SetSessionToken` with a token obtained by other means. + +## Structure + +- `proto/node/` -- Generated Cap'n Proto Go types from `schemas/node.capnp` +- `transport/` -- QUIC + TLS 1.3 transport and Cap'n Proto RPC framing +- `qpq/` -- High-level client API (auth, messaging, channels) +- `cmd/example/` -- Example usage + +## Regenerating Proto Types + +```sh +capnp compile \ + -I "$(go env GOPATH)/pkg/mod/capnproto.org/go/capnp/v3@v3.1.0-alpha.2/std" \ + -ogo proto/node/node.capnp +``` diff --git a/sdks/go/cmd/example/main.go b/sdks/go/cmd/example/main.go new file mode 100644 index 0000000..e293ee4 --- /dev/null +++ b/sdks/go/cmd/example/main.go @@ -0,0 +1,55 @@ +// Command example demonstrates basic usage of the quicproquo Go SDK. +package main + +import ( + "context" + "fmt" + "os" + + "quicproquo.dev/sdk/go/qpq" +) + +func main() { + addr := "127.0.0.1:5001" + if len(os.Args) > 1 { + addr = os.Args[1] + } + + ctx := context.Background() + + client, err := qpq.Connect(ctx, qpq.Options{ + Addr: addr, + InsecureSkipVerify: true, + }) + if err != nil { + fmt.Fprintf(os.Stderr, "connect failed: %v\n", err) + os.Exit(1) + } + defer client.Close() + + status, err := client.Health(ctx) + if err != nil { + fmt.Fprintf(os.Stderr, "health check failed: %v\n", err) + os.Exit(1) + } + fmt.Printf("Server health: %s\n", status) + + fmt.Println("\nUsage:") + fmt.Println(" // Authenticate with a pre-existing session token") + fmt.Println(" client.SetSessionToken(token)") + fmt.Println() + fmt.Println(" // Resolve a user's identity key") + fmt.Println(" key, err := client.ResolveUser(ctx, \"alice\")") + fmt.Println() + fmt.Println(" // Create a DM channel") + fmt.Println(" chID, wasNew, err := client.CreateChannel(ctx, peerKey)") + fmt.Println() + fmt.Println(" // Send a message") + fmt.Println(" seq, err := client.Send(ctx, recipientKey, payload)") + fmt.Println() + fmt.Println(" // Receive messages") + fmt.Println(" msgs, err := client.Receive(ctx, recipientKey)") + fmt.Println() + fmt.Println(" // Long-poll for messages (5 second timeout)") + fmt.Println(" msgs, err := client.ReceiveWait(ctx, recipientKey, 5000)") +} diff --git a/sdks/go/go.mod b/sdks/go/go.mod new file mode 100644 index 0000000..cc58563 --- /dev/null +++ b/sdks/go/go.mod @@ -0,0 +1,13 @@ +module quicproquo.dev/sdk/go + +go 1.25.7 + +require ( + capnproto.org/go/capnp/v3 v3.1.0-alpha.2 // indirect + github.com/colega/zeropool v0.0.0-20230505084239-6fb4a4f75381 // indirect + github.com/quic-go/quic-go v0.59.0 // indirect + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/net v0.43.0 // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/sys v0.35.0 // indirect +) diff --git a/sdks/go/go.sum b/sdks/go/go.sum new file mode 100644 index 0000000..45b916d --- /dev/null +++ b/sdks/go/go.sum @@ -0,0 +1,16 @@ +capnproto.org/go/capnp/v3 v3.1.0-alpha.2 h1:93ISpqHf2/3WQlfrBP0tT8Dg/RQc3uq6DV36vN0ePWk= +capnproto.org/go/capnp/v3 v3.1.0-alpha.2/go.mod h1:2vT5D2dtG8sJGEoEKU17e+j7shdaYp1Myl8X03B3hmc= +github.com/colega/zeropool v0.0.0-20230505084239-6fb4a4f75381 h1:d5EKgQfRQvO97jnISfR89AiCCCJMwMFoSxUiU0OGCRU= +github.com/colega/zeropool v0.0.0-20230505084239-6fb4a4f75381/go.mod h1:OU76gHeRo8xrzGJU3F3I1CqX1ekM8dfJw0+wPeMwnp0= +github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw= +github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= diff --git a/sdks/go/proto/node/node.capnp b/sdks/go/proto/node/node.capnp new file mode 100644 index 0000000..10f8c2e --- /dev/null +++ b/sdks/go/proto/node/node.capnp @@ -0,0 +1,45 @@ +# node.capnp — Go-annotated copy of the quicproquo node schema. +# This adds Go package annotations needed by capnpc-go. +@0xd5ca5648a9cc1c28; + +using Go = import "/go.capnp"; +$Go.package("node"); +$Go.import("quicproquo.dev/sdk/go/proto/node"); + +interface NodeService { + uploadKeyPackage @0 (identityKey :Data, package :Data, auth :Auth) -> (fingerprint :Data); + fetchKeyPackage @1 (identityKey :Data, auth :Auth) -> (package :Data); + enqueue @2 (recipientKey :Data, payload :Data, channelId :Data, version :UInt16, auth :Auth, ttlSecs :UInt32) -> (seq :UInt64, deliveryProof :Data); + fetch @3 (recipientKey :Data, channelId :Data, version :UInt16, auth :Auth, limit :UInt32) -> (payloads :List(Envelope)); + fetchWait @4 (recipientKey :Data, channelId :Data, version :UInt16, timeoutMs :UInt64, auth :Auth, limit :UInt32) -> (payloads :List(Envelope)); + health @5 () -> (status :Text); + uploadHybridKey @6 (identityKey :Data, hybridPublicKey :Data, auth :Auth) -> (); + fetchHybridKey @7 (identityKey :Data, auth :Auth) -> (hybridPublicKey :Data); + opaqueRegisterStart @8 (username :Text, request :Data) -> (response :Data); + opaqueRegisterFinish @9 (username :Text, upload :Data, identityKey :Data) -> (success :Bool); + opaqueLoginStart @10 (username :Text, request :Data) -> (response :Data); + opaqueLoginFinish @11 (username :Text, finalization :Data, identityKey :Data) -> (sessionToken :Data); + publishEndpoint @12 (identityKey :Data, nodeAddr :Data, auth :Auth) -> (); + resolveEndpoint @13 (identityKey :Data, auth :Auth) -> (nodeAddr :Data); + peek @14 (recipientKey :Data, channelId :Data, version :UInt16, auth :Auth, limit :UInt32) -> (payloads :List(Envelope)); + ack @15 (recipientKey :Data, channelId :Data, version :UInt16, seqUpTo :UInt64, auth :Auth) -> (); + fetchHybridKeys @16 (identityKeys :List(Data), auth :Auth) -> (keys :List(Data)); + batchEnqueue @17 (recipientKeys :List(Data), payload :Data, channelId :Data, version :UInt16, auth :Auth, ttlSecs :UInt32) -> (seqs :List(UInt64)); + createChannel @18 (peerKey :Data, auth :Auth) -> (channelId :Data, wasNew :Bool); + resolveUser @19 (username :Text, auth :Auth) -> (identityKey :Data, inclusionProof :Data); + resolveIdentity @20 (identityKey :Data, auth :Auth) -> (username :Text); + uploadBlob @21 (auth :Auth, blobHash :Data, chunk :Data, offset :UInt64, totalSize :UInt64, mimeType :Text) -> (blobId :Data); + downloadBlob @22 (auth :Auth, blobId :Data, offset :UInt64, length :UInt32) -> (chunk :Data, totalSize :UInt64, mimeType :Text); + deleteAccount @23 (auth :Auth) -> (success :Bool); +} + +struct Auth { + version @0 :UInt16; + accessToken @1 :Data; + deviceId @2 :Data; +} + +struct Envelope { + seq @0 :UInt64; + data @1 :Data; +} diff --git a/sdks/go/proto/node/node.capnp.go b/sdks/go/proto/node/node.capnp.go new file mode 100644 index 0000000..fe05d83 --- /dev/null +++ b/sdks/go/proto/node/node.capnp.go @@ -0,0 +1,6487 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package node + +import ( + capnp "capnproto.org/go/capnp/v3" + text "capnproto.org/go/capnp/v3/encoding/text" + fc "capnproto.org/go/capnp/v3/flowcontrol" + schemas "capnproto.org/go/capnp/v3/schemas" + server "capnproto.org/go/capnp/v3/server" + context "context" +) + +type NodeService capnp.Client + +// NodeService_TypeID is the unique identifier for the type NodeService. +const NodeService_TypeID = 0xd0c8a4cd19599e78 + +func (c NodeService) UploadKeyPackage(ctx context.Context, params func(NodeService_uploadKeyPackage_Params) error) (NodeService_uploadKeyPackage_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 0, + InterfaceName: "node.capnp:NodeService", + MethodName: "uploadKeyPackage", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_uploadKeyPackage_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_uploadKeyPackage_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) FetchKeyPackage(ctx context.Context, params func(NodeService_fetchKeyPackage_Params) error) (NodeService_fetchKeyPackage_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 1, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchKeyPackage", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_fetchKeyPackage_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_fetchKeyPackage_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) Enqueue(ctx context.Context, params func(NodeService_enqueue_Params) error) (NodeService_enqueue_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 2, + InterfaceName: "node.capnp:NodeService", + MethodName: "enqueue", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 8, PointerCount: 4} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_enqueue_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_enqueue_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) Fetch(ctx context.Context, params func(NodeService_fetch_Params) error) (NodeService_fetch_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 3, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetch", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 8, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_fetch_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_fetch_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) FetchWait(ctx context.Context, params func(NodeService_fetchWait_Params) error) (NodeService_fetchWait_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 4, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchWait", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 16, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_fetchWait_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_fetchWait_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) Health(ctx context.Context, params func(NodeService_health_Params) error) (NodeService_health_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 5, + InterfaceName: "node.capnp:NodeService", + MethodName: "health", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 0} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_health_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_health_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) UploadHybridKey(ctx context.Context, params func(NodeService_uploadHybridKey_Params) error) (NodeService_uploadHybridKey_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 6, + InterfaceName: "node.capnp:NodeService", + MethodName: "uploadHybridKey", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_uploadHybridKey_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_uploadHybridKey_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) FetchHybridKey(ctx context.Context, params func(NodeService_fetchHybridKey_Params) error) (NodeService_fetchHybridKey_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 7, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchHybridKey", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_fetchHybridKey_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_fetchHybridKey_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) OpaqueRegisterStart(ctx context.Context, params func(NodeService_opaqueRegisterStart_Params) error) (NodeService_opaqueRegisterStart_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 8, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueRegisterStart", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_opaqueRegisterStart_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_opaqueRegisterStart_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) OpaqueRegisterFinish(ctx context.Context, params func(NodeService_opaqueRegisterFinish_Params) error) (NodeService_opaqueRegisterFinish_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 9, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueRegisterFinish", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_opaqueRegisterFinish_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_opaqueRegisterFinish_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) OpaqueLoginStart(ctx context.Context, params func(NodeService_opaqueLoginStart_Params) error) (NodeService_opaqueLoginStart_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 10, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueLoginStart", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_opaqueLoginStart_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_opaqueLoginStart_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) OpaqueLoginFinish(ctx context.Context, params func(NodeService_opaqueLoginFinish_Params) error) (NodeService_opaqueLoginFinish_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 11, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueLoginFinish", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_opaqueLoginFinish_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_opaqueLoginFinish_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) PublishEndpoint(ctx context.Context, params func(NodeService_publishEndpoint_Params) error) (NodeService_publishEndpoint_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 12, + InterfaceName: "node.capnp:NodeService", + MethodName: "publishEndpoint", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_publishEndpoint_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_publishEndpoint_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) ResolveEndpoint(ctx context.Context, params func(NodeService_resolveEndpoint_Params) error) (NodeService_resolveEndpoint_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 13, + InterfaceName: "node.capnp:NodeService", + MethodName: "resolveEndpoint", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_resolveEndpoint_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_resolveEndpoint_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) Peek(ctx context.Context, params func(NodeService_peek_Params) error) (NodeService_peek_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 14, + InterfaceName: "node.capnp:NodeService", + MethodName: "peek", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 8, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_peek_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_peek_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) Ack(ctx context.Context, params func(NodeService_ack_Params) error) (NodeService_ack_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 15, + InterfaceName: "node.capnp:NodeService", + MethodName: "ack", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 16, PointerCount: 3} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_ack_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_ack_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) FetchHybridKeys(ctx context.Context, params func(NodeService_fetchHybridKeys_Params) error) (NodeService_fetchHybridKeys_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 16, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchHybridKeys", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_fetchHybridKeys_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_fetchHybridKeys_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) BatchEnqueue(ctx context.Context, params func(NodeService_batchEnqueue_Params) error) (NodeService_batchEnqueue_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 17, + InterfaceName: "node.capnp:NodeService", + MethodName: "batchEnqueue", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 8, PointerCount: 4} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_batchEnqueue_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_batchEnqueue_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) CreateChannel(ctx context.Context, params func(NodeService_createChannel_Params) error) (NodeService_createChannel_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 18, + InterfaceName: "node.capnp:NodeService", + MethodName: "createChannel", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_createChannel_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_createChannel_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) ResolveUser(ctx context.Context, params func(NodeService_resolveUser_Params) error) (NodeService_resolveUser_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 19, + InterfaceName: "node.capnp:NodeService", + MethodName: "resolveUser", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_resolveUser_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_resolveUser_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) ResolveIdentity(ctx context.Context, params func(NodeService_resolveIdentity_Params) error) (NodeService_resolveIdentity_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 20, + InterfaceName: "node.capnp:NodeService", + MethodName: "resolveIdentity", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_resolveIdentity_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_resolveIdentity_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) UploadBlob(ctx context.Context, params func(NodeService_uploadBlob_Params) error) (NodeService_uploadBlob_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 21, + InterfaceName: "node.capnp:NodeService", + MethodName: "uploadBlob", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 16, PointerCount: 4} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_uploadBlob_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_uploadBlob_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) DownloadBlob(ctx context.Context, params func(NodeService_downloadBlob_Params) error) (NodeService_downloadBlob_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 22, + InterfaceName: "node.capnp:NodeService", + MethodName: "downloadBlob", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 16, PointerCount: 2} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_downloadBlob_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_downloadBlob_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) DeleteAccount(ctx context.Context, params func(NodeService_deleteAccount_Params) error) (NodeService_deleteAccount_Results_Future, capnp.ReleaseFunc) { + + s := capnp.Send{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 23, + InterfaceName: "node.capnp:NodeService", + MethodName: "deleteAccount", + }, + } + if params != nil { + s.ArgsSize = capnp.ObjectSize{DataSize: 0, PointerCount: 1} + s.PlaceArgs = func(s capnp.Struct) error { return params(NodeService_deleteAccount_Params(s)) } + } + + ans, release := capnp.Client(c).SendCall(ctx, s) + return NodeService_deleteAccount_Results_Future{Future: ans.Future()}, release + +} + +func (c NodeService) WaitStreaming() error { + return capnp.Client(c).WaitStreaming() +} + +// String returns a string that identifies this capability for debugging +// purposes. Its format should not be depended on: in particular, it +// should not be used to compare clients. Use IsSame to compare clients +// for equality. +func (c NodeService) String() string { + return "NodeService(" + capnp.Client(c).String() + ")" +} + +// AddRef creates a new Client that refers to the same capability as c. +// If c is nil or has resolved to null, then AddRef returns nil. +func (c NodeService) AddRef() NodeService { + return NodeService(capnp.Client(c).AddRef()) +} + +// Release releases a capability reference. If this is the last +// reference to the capability, then the underlying resources associated +// with the capability will be released. +// +// Release will panic if c has already been released, but not if c is +// nil or resolved to null. +func (c NodeService) Release() { + capnp.Client(c).Release() +} + +// Resolve blocks until the capability is fully resolved or the Context +// expires. +func (c NodeService) Resolve(ctx context.Context) error { + return capnp.Client(c).Resolve(ctx) +} + +func (c NodeService) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Client(c).EncodeAsPtr(seg) +} + +func (NodeService) DecodeFromPtr(p capnp.Ptr) NodeService { + return NodeService(capnp.Client{}.DecodeFromPtr(p)) +} + +// IsValid reports whether c is a valid reference to a capability. +// A reference is invalid if it is nil, has resolved to null, or has +// been released. +func (c NodeService) IsValid() bool { + return capnp.Client(c).IsValid() +} + +// IsSame reports whether c and other refer to a capability created by the +// same call to NewClient. This can return false negatives if c or other +// are not fully resolved: use Resolve if this is an issue. If either +// c or other are released, then IsSame panics. +func (c NodeService) IsSame(other NodeService) bool { + return capnp.Client(c).IsSame(capnp.Client(other)) +} + +// Update the flowcontrol.FlowLimiter used to manage flow control for +// this client. This affects all future calls, but not calls already +// waiting to send. Passing nil sets the value to flowcontrol.NopLimiter, +// which is also the default. +func (c NodeService) SetFlowLimiter(lim fc.FlowLimiter) { + capnp.Client(c).SetFlowLimiter(lim) +} + +// Get the current flowcontrol.FlowLimiter used to manage flow control +// for this client. +func (c NodeService) GetFlowLimiter() fc.FlowLimiter { + return capnp.Client(c).GetFlowLimiter() +} + +// A NodeService_Server is a NodeService with a local implementation. +type NodeService_Server interface { + UploadKeyPackage(context.Context, NodeService_uploadKeyPackage) error + + FetchKeyPackage(context.Context, NodeService_fetchKeyPackage) error + + Enqueue(context.Context, NodeService_enqueue) error + + Fetch(context.Context, NodeService_fetch) error + + FetchWait(context.Context, NodeService_fetchWait) error + + Health(context.Context, NodeService_health) error + + UploadHybridKey(context.Context, NodeService_uploadHybridKey) error + + FetchHybridKey(context.Context, NodeService_fetchHybridKey) error + + OpaqueRegisterStart(context.Context, NodeService_opaqueRegisterStart) error + + OpaqueRegisterFinish(context.Context, NodeService_opaqueRegisterFinish) error + + OpaqueLoginStart(context.Context, NodeService_opaqueLoginStart) error + + OpaqueLoginFinish(context.Context, NodeService_opaqueLoginFinish) error + + PublishEndpoint(context.Context, NodeService_publishEndpoint) error + + ResolveEndpoint(context.Context, NodeService_resolveEndpoint) error + + Peek(context.Context, NodeService_peek) error + + Ack(context.Context, NodeService_ack) error + + FetchHybridKeys(context.Context, NodeService_fetchHybridKeys) error + + BatchEnqueue(context.Context, NodeService_batchEnqueue) error + + CreateChannel(context.Context, NodeService_createChannel) error + + ResolveUser(context.Context, NodeService_resolveUser) error + + ResolveIdentity(context.Context, NodeService_resolveIdentity) error + + UploadBlob(context.Context, NodeService_uploadBlob) error + + DownloadBlob(context.Context, NodeService_downloadBlob) error + + DeleteAccount(context.Context, NodeService_deleteAccount) error +} + +// NodeService_NewServer creates a new Server from an implementation of NodeService_Server. +func NodeService_NewServer(s NodeService_Server) *server.Server { + c, _ := s.(server.Shutdowner) + return server.New(NodeService_Methods(nil, s), s, c) +} + +// NodeService_ServerToClient creates a new Client from an implementation of NodeService_Server. +// The caller is responsible for calling Release on the returned Client. +func NodeService_ServerToClient(s NodeService_Server) NodeService { + return NodeService(capnp.NewClient(NodeService_NewServer(s))) +} + +// NodeService_Methods appends Methods to a slice that invoke the methods on s. +// This can be used to create a more complicated Server. +func NodeService_Methods(methods []server.Method, s NodeService_Server) []server.Method { + if cap(methods) == 0 { + methods = make([]server.Method, 0, 24) + } + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 0, + InterfaceName: "node.capnp:NodeService", + MethodName: "uploadKeyPackage", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.UploadKeyPackage(ctx, NodeService_uploadKeyPackage{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 1, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchKeyPackage", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.FetchKeyPackage(ctx, NodeService_fetchKeyPackage{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 2, + InterfaceName: "node.capnp:NodeService", + MethodName: "enqueue", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.Enqueue(ctx, NodeService_enqueue{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 3, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetch", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.Fetch(ctx, NodeService_fetch{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 4, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchWait", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.FetchWait(ctx, NodeService_fetchWait{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 5, + InterfaceName: "node.capnp:NodeService", + MethodName: "health", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.Health(ctx, NodeService_health{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 6, + InterfaceName: "node.capnp:NodeService", + MethodName: "uploadHybridKey", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.UploadHybridKey(ctx, NodeService_uploadHybridKey{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 7, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchHybridKey", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.FetchHybridKey(ctx, NodeService_fetchHybridKey{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 8, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueRegisterStart", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.OpaqueRegisterStart(ctx, NodeService_opaqueRegisterStart{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 9, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueRegisterFinish", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.OpaqueRegisterFinish(ctx, NodeService_opaqueRegisterFinish{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 10, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueLoginStart", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.OpaqueLoginStart(ctx, NodeService_opaqueLoginStart{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 11, + InterfaceName: "node.capnp:NodeService", + MethodName: "opaqueLoginFinish", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.OpaqueLoginFinish(ctx, NodeService_opaqueLoginFinish{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 12, + InterfaceName: "node.capnp:NodeService", + MethodName: "publishEndpoint", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.PublishEndpoint(ctx, NodeService_publishEndpoint{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 13, + InterfaceName: "node.capnp:NodeService", + MethodName: "resolveEndpoint", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.ResolveEndpoint(ctx, NodeService_resolveEndpoint{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 14, + InterfaceName: "node.capnp:NodeService", + MethodName: "peek", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.Peek(ctx, NodeService_peek{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 15, + InterfaceName: "node.capnp:NodeService", + MethodName: "ack", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.Ack(ctx, NodeService_ack{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 16, + InterfaceName: "node.capnp:NodeService", + MethodName: "fetchHybridKeys", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.FetchHybridKeys(ctx, NodeService_fetchHybridKeys{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 17, + InterfaceName: "node.capnp:NodeService", + MethodName: "batchEnqueue", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.BatchEnqueue(ctx, NodeService_batchEnqueue{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 18, + InterfaceName: "node.capnp:NodeService", + MethodName: "createChannel", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.CreateChannel(ctx, NodeService_createChannel{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 19, + InterfaceName: "node.capnp:NodeService", + MethodName: "resolveUser", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.ResolveUser(ctx, NodeService_resolveUser{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 20, + InterfaceName: "node.capnp:NodeService", + MethodName: "resolveIdentity", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.ResolveIdentity(ctx, NodeService_resolveIdentity{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 21, + InterfaceName: "node.capnp:NodeService", + MethodName: "uploadBlob", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.UploadBlob(ctx, NodeService_uploadBlob{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 22, + InterfaceName: "node.capnp:NodeService", + MethodName: "downloadBlob", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.DownloadBlob(ctx, NodeService_downloadBlob{call}) + }, + }) + + methods = append(methods, server.Method{ + Method: capnp.Method{ + InterfaceID: 0xd0c8a4cd19599e78, + MethodID: 23, + InterfaceName: "node.capnp:NodeService", + MethodName: "deleteAccount", + }, + Impl: func(ctx context.Context, call *server.Call) error { + return s.DeleteAccount(ctx, NodeService_deleteAccount{call}) + }, + }) + + return methods +} + +// NodeService_uploadKeyPackage holds the state for a server call to NodeService.uploadKeyPackage. +// See server.Call for documentation. +type NodeService_uploadKeyPackage struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_uploadKeyPackage) Args() NodeService_uploadKeyPackage_Params { + return NodeService_uploadKeyPackage_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_uploadKeyPackage) AllocResults() (NodeService_uploadKeyPackage_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_uploadKeyPackage_Results(r), err +} + +// NodeService_fetchKeyPackage holds the state for a server call to NodeService.fetchKeyPackage. +// See server.Call for documentation. +type NodeService_fetchKeyPackage struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_fetchKeyPackage) Args() NodeService_fetchKeyPackage_Params { + return NodeService_fetchKeyPackage_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_fetchKeyPackage) AllocResults() (NodeService_fetchKeyPackage_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchKeyPackage_Results(r), err +} + +// NodeService_enqueue holds the state for a server call to NodeService.enqueue. +// See server.Call for documentation. +type NodeService_enqueue struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_enqueue) Args() NodeService_enqueue_Params { + return NodeService_enqueue_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_enqueue) AllocResults() (NodeService_enqueue_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return NodeService_enqueue_Results(r), err +} + +// NodeService_fetch holds the state for a server call to NodeService.fetch. +// See server.Call for documentation. +type NodeService_fetch struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_fetch) Args() NodeService_fetch_Params { + return NodeService_fetch_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_fetch) AllocResults() (NodeService_fetch_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetch_Results(r), err +} + +// NodeService_fetchWait holds the state for a server call to NodeService.fetchWait. +// See server.Call for documentation. +type NodeService_fetchWait struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_fetchWait) Args() NodeService_fetchWait_Params { + return NodeService_fetchWait_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_fetchWait) AllocResults() (NodeService_fetchWait_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchWait_Results(r), err +} + +// NodeService_health holds the state for a server call to NodeService.health. +// See server.Call for documentation. +type NodeService_health struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_health) Args() NodeService_health_Params { + return NodeService_health_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_health) AllocResults() (NodeService_health_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_health_Results(r), err +} + +// NodeService_uploadHybridKey holds the state for a server call to NodeService.uploadHybridKey. +// See server.Call for documentation. +type NodeService_uploadHybridKey struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_uploadHybridKey) Args() NodeService_uploadHybridKey_Params { + return NodeService_uploadHybridKey_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_uploadHybridKey) AllocResults() (NodeService_uploadHybridKey_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_uploadHybridKey_Results(r), err +} + +// NodeService_fetchHybridKey holds the state for a server call to NodeService.fetchHybridKey. +// See server.Call for documentation. +type NodeService_fetchHybridKey struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_fetchHybridKey) Args() NodeService_fetchHybridKey_Params { + return NodeService_fetchHybridKey_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_fetchHybridKey) AllocResults() (NodeService_fetchHybridKey_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchHybridKey_Results(r), err +} + +// NodeService_opaqueRegisterStart holds the state for a server call to NodeService.opaqueRegisterStart. +// See server.Call for documentation. +type NodeService_opaqueRegisterStart struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_opaqueRegisterStart) Args() NodeService_opaqueRegisterStart_Params { + return NodeService_opaqueRegisterStart_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_opaqueRegisterStart) AllocResults() (NodeService_opaqueRegisterStart_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueRegisterStart_Results(r), err +} + +// NodeService_opaqueRegisterFinish holds the state for a server call to NodeService.opaqueRegisterFinish. +// See server.Call for documentation. +type NodeService_opaqueRegisterFinish struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_opaqueRegisterFinish) Args() NodeService_opaqueRegisterFinish_Params { + return NodeService_opaqueRegisterFinish_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_opaqueRegisterFinish) AllocResults() (NodeService_opaqueRegisterFinish_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return NodeService_opaqueRegisterFinish_Results(r), err +} + +// NodeService_opaqueLoginStart holds the state for a server call to NodeService.opaqueLoginStart. +// See server.Call for documentation. +type NodeService_opaqueLoginStart struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_opaqueLoginStart) Args() NodeService_opaqueLoginStart_Params { + return NodeService_opaqueLoginStart_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_opaqueLoginStart) AllocResults() (NodeService_opaqueLoginStart_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueLoginStart_Results(r), err +} + +// NodeService_opaqueLoginFinish holds the state for a server call to NodeService.opaqueLoginFinish. +// See server.Call for documentation. +type NodeService_opaqueLoginFinish struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_opaqueLoginFinish) Args() NodeService_opaqueLoginFinish_Params { + return NodeService_opaqueLoginFinish_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_opaqueLoginFinish) AllocResults() (NodeService_opaqueLoginFinish_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueLoginFinish_Results(r), err +} + +// NodeService_publishEndpoint holds the state for a server call to NodeService.publishEndpoint. +// See server.Call for documentation. +type NodeService_publishEndpoint struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_publishEndpoint) Args() NodeService_publishEndpoint_Params { + return NodeService_publishEndpoint_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_publishEndpoint) AllocResults() (NodeService_publishEndpoint_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_publishEndpoint_Results(r), err +} + +// NodeService_resolveEndpoint holds the state for a server call to NodeService.resolveEndpoint. +// See server.Call for documentation. +type NodeService_resolveEndpoint struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_resolveEndpoint) Args() NodeService_resolveEndpoint_Params { + return NodeService_resolveEndpoint_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_resolveEndpoint) AllocResults() (NodeService_resolveEndpoint_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_resolveEndpoint_Results(r), err +} + +// NodeService_peek holds the state for a server call to NodeService.peek. +// See server.Call for documentation. +type NodeService_peek struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_peek) Args() NodeService_peek_Params { + return NodeService_peek_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_peek) AllocResults() (NodeService_peek_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_peek_Results(r), err +} + +// NodeService_ack holds the state for a server call to NodeService.ack. +// See server.Call for documentation. +type NodeService_ack struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_ack) Args() NodeService_ack_Params { + return NodeService_ack_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_ack) AllocResults() (NodeService_ack_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_ack_Results(r), err +} + +// NodeService_fetchHybridKeys holds the state for a server call to NodeService.fetchHybridKeys. +// See server.Call for documentation. +type NodeService_fetchHybridKeys struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_fetchHybridKeys) Args() NodeService_fetchHybridKeys_Params { + return NodeService_fetchHybridKeys_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_fetchHybridKeys) AllocResults() (NodeService_fetchHybridKeys_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchHybridKeys_Results(r), err +} + +// NodeService_batchEnqueue holds the state for a server call to NodeService.batchEnqueue. +// See server.Call for documentation. +type NodeService_batchEnqueue struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_batchEnqueue) Args() NodeService_batchEnqueue_Params { + return NodeService_batchEnqueue_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_batchEnqueue) AllocResults() (NodeService_batchEnqueue_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_batchEnqueue_Results(r), err +} + +// NodeService_createChannel holds the state for a server call to NodeService.createChannel. +// See server.Call for documentation. +type NodeService_createChannel struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_createChannel) Args() NodeService_createChannel_Params { + return NodeService_createChannel_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_createChannel) AllocResults() (NodeService_createChannel_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return NodeService_createChannel_Results(r), err +} + +// NodeService_resolveUser holds the state for a server call to NodeService.resolveUser. +// See server.Call for documentation. +type NodeService_resolveUser struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_resolveUser) Args() NodeService_resolveUser_Params { + return NodeService_resolveUser_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_resolveUser) AllocResults() (NodeService_resolveUser_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveUser_Results(r), err +} + +// NodeService_resolveIdentity holds the state for a server call to NodeService.resolveIdentity. +// See server.Call for documentation. +type NodeService_resolveIdentity struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_resolveIdentity) Args() NodeService_resolveIdentity_Params { + return NodeService_resolveIdentity_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_resolveIdentity) AllocResults() (NodeService_resolveIdentity_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_resolveIdentity_Results(r), err +} + +// NodeService_uploadBlob holds the state for a server call to NodeService.uploadBlob. +// See server.Call for documentation. +type NodeService_uploadBlob struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_uploadBlob) Args() NodeService_uploadBlob_Params { + return NodeService_uploadBlob_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_uploadBlob) AllocResults() (NodeService_uploadBlob_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_uploadBlob_Results(r), err +} + +// NodeService_downloadBlob holds the state for a server call to NodeService.downloadBlob. +// See server.Call for documentation. +type NodeService_downloadBlob struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_downloadBlob) Args() NodeService_downloadBlob_Params { + return NodeService_downloadBlob_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_downloadBlob) AllocResults() (NodeService_downloadBlob_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return NodeService_downloadBlob_Results(r), err +} + +// NodeService_deleteAccount holds the state for a server call to NodeService.deleteAccount. +// See server.Call for documentation. +type NodeService_deleteAccount struct { + *server.Call +} + +// Args returns the call's arguments. +func (c NodeService_deleteAccount) Args() NodeService_deleteAccount_Params { + return NodeService_deleteAccount_Params(c.Call.Args()) +} + +// AllocResults allocates the results struct. +func (c NodeService_deleteAccount) AllocResults() (NodeService_deleteAccount_Results, error) { + r, err := c.Call.AllocResults(capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return NodeService_deleteAccount_Results(r), err +} + +// NodeService_List is a list of NodeService. +type NodeService_List = capnp.CapList[NodeService] + +// NewNodeService_List creates a new list of NodeService. +func NewNodeService_List(s *capnp.Segment, sz int32) (NodeService_List, error) { + l, err := capnp.NewPointerList(s, sz) + return capnp.CapList[NodeService](l), err +} + +type NodeService_uploadKeyPackage_Params capnp.Struct + +// NodeService_uploadKeyPackage_Params_TypeID is the unique identifier for the type NodeService_uploadKeyPackage_Params. +const NodeService_uploadKeyPackage_Params_TypeID = 0x851f1eedf18841df + +func NewNodeService_uploadKeyPackage_Params(s *capnp.Segment) (NodeService_uploadKeyPackage_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_uploadKeyPackage_Params(st), err +} + +func NewRootNodeService_uploadKeyPackage_Params(s *capnp.Segment) (NodeService_uploadKeyPackage_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_uploadKeyPackage_Params(st), err +} + +func ReadRootNodeService_uploadKeyPackage_Params(msg *capnp.Message) (NodeService_uploadKeyPackage_Params, error) { + root, err := msg.Root() + return NodeService_uploadKeyPackage_Params(root.Struct()), err +} + +func (s NodeService_uploadKeyPackage_Params) String() string { + str, _ := text.Marshal(0x851f1eedf18841df, capnp.Struct(s)) + return str +} + +func (s NodeService_uploadKeyPackage_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_uploadKeyPackage_Params) DecodeFromPtr(p capnp.Ptr) NodeService_uploadKeyPackage_Params { + return NodeService_uploadKeyPackage_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_uploadKeyPackage_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_uploadKeyPackage_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_uploadKeyPackage_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_uploadKeyPackage_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_uploadKeyPackage_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_uploadKeyPackage_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_uploadKeyPackage_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_uploadKeyPackage_Params) Package() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_uploadKeyPackage_Params) HasPackage() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_uploadKeyPackage_Params) SetPackage(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_uploadKeyPackage_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(2) + return Auth(p.Struct()), err +} + +func (s NodeService_uploadKeyPackage_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_uploadKeyPackage_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(2, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_uploadKeyPackage_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(2, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_uploadKeyPackage_Params_List is a list of NodeService_uploadKeyPackage_Params. +type NodeService_uploadKeyPackage_Params_List = capnp.StructList[NodeService_uploadKeyPackage_Params] + +// NewNodeService_uploadKeyPackage_Params creates a new list of NodeService_uploadKeyPackage_Params. +func NewNodeService_uploadKeyPackage_Params_List(s *capnp.Segment, sz int32) (NodeService_uploadKeyPackage_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}, sz) + return capnp.StructList[NodeService_uploadKeyPackage_Params](l), err +} + +// NodeService_uploadKeyPackage_Params_Future is a wrapper for a NodeService_uploadKeyPackage_Params promised by a client call. +type NodeService_uploadKeyPackage_Params_Future struct{ *capnp.Future } + +func (f NodeService_uploadKeyPackage_Params_Future) Struct() (NodeService_uploadKeyPackage_Params, error) { + p, err := f.Future.Ptr() + return NodeService_uploadKeyPackage_Params(p.Struct()), err +} +func (p NodeService_uploadKeyPackage_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(2, nil)} +} + +type NodeService_uploadKeyPackage_Results capnp.Struct + +// NodeService_uploadKeyPackage_Results_TypeID is the unique identifier for the type NodeService_uploadKeyPackage_Results. +const NodeService_uploadKeyPackage_Results_TypeID = 0xf4a9b0e50476ab92 + +func NewNodeService_uploadKeyPackage_Results(s *capnp.Segment) (NodeService_uploadKeyPackage_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_uploadKeyPackage_Results(st), err +} + +func NewRootNodeService_uploadKeyPackage_Results(s *capnp.Segment) (NodeService_uploadKeyPackage_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_uploadKeyPackage_Results(st), err +} + +func ReadRootNodeService_uploadKeyPackage_Results(msg *capnp.Message) (NodeService_uploadKeyPackage_Results, error) { + root, err := msg.Root() + return NodeService_uploadKeyPackage_Results(root.Struct()), err +} + +func (s NodeService_uploadKeyPackage_Results) String() string { + str, _ := text.Marshal(0xf4a9b0e50476ab92, capnp.Struct(s)) + return str +} + +func (s NodeService_uploadKeyPackage_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_uploadKeyPackage_Results) DecodeFromPtr(p capnp.Ptr) NodeService_uploadKeyPackage_Results { + return NodeService_uploadKeyPackage_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_uploadKeyPackage_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_uploadKeyPackage_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_uploadKeyPackage_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_uploadKeyPackage_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_uploadKeyPackage_Results) Fingerprint() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_uploadKeyPackage_Results) HasFingerprint() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_uploadKeyPackage_Results) SetFingerprint(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_uploadKeyPackage_Results_List is a list of NodeService_uploadKeyPackage_Results. +type NodeService_uploadKeyPackage_Results_List = capnp.StructList[NodeService_uploadKeyPackage_Results] + +// NewNodeService_uploadKeyPackage_Results creates a new list of NodeService_uploadKeyPackage_Results. +func NewNodeService_uploadKeyPackage_Results_List(s *capnp.Segment, sz int32) (NodeService_uploadKeyPackage_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_uploadKeyPackage_Results](l), err +} + +// NodeService_uploadKeyPackage_Results_Future is a wrapper for a NodeService_uploadKeyPackage_Results promised by a client call. +type NodeService_uploadKeyPackage_Results_Future struct{ *capnp.Future } + +func (f NodeService_uploadKeyPackage_Results_Future) Struct() (NodeService_uploadKeyPackage_Results, error) { + p, err := f.Future.Ptr() + return NodeService_uploadKeyPackage_Results(p.Struct()), err +} + +type NodeService_fetchKeyPackage_Params capnp.Struct + +// NodeService_fetchKeyPackage_Params_TypeID is the unique identifier for the type NodeService_fetchKeyPackage_Params. +const NodeService_fetchKeyPackage_Params_TypeID = 0x98ec4fe26f14e6bf + +func NewNodeService_fetchKeyPackage_Params(s *capnp.Segment) (NodeService_fetchKeyPackage_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_fetchKeyPackage_Params(st), err +} + +func NewRootNodeService_fetchKeyPackage_Params(s *capnp.Segment) (NodeService_fetchKeyPackage_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_fetchKeyPackage_Params(st), err +} + +func ReadRootNodeService_fetchKeyPackage_Params(msg *capnp.Message) (NodeService_fetchKeyPackage_Params, error) { + root, err := msg.Root() + return NodeService_fetchKeyPackage_Params(root.Struct()), err +} + +func (s NodeService_fetchKeyPackage_Params) String() string { + str, _ := text.Marshal(0x98ec4fe26f14e6bf, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchKeyPackage_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchKeyPackage_Params) DecodeFromPtr(p capnp.Ptr) NodeService_fetchKeyPackage_Params { + return NodeService_fetchKeyPackage_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchKeyPackage_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchKeyPackage_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchKeyPackage_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchKeyPackage_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchKeyPackage_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_fetchKeyPackage_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchKeyPackage_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_fetchKeyPackage_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(1) + return Auth(p.Struct()), err +} + +func (s NodeService_fetchKeyPackage_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_fetchKeyPackage_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(1, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_fetchKeyPackage_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_fetchKeyPackage_Params_List is a list of NodeService_fetchKeyPackage_Params. +type NodeService_fetchKeyPackage_Params_List = capnp.StructList[NodeService_fetchKeyPackage_Params] + +// NewNodeService_fetchKeyPackage_Params creates a new list of NodeService_fetchKeyPackage_Params. +func NewNodeService_fetchKeyPackage_Params_List(s *capnp.Segment, sz int32) (NodeService_fetchKeyPackage_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_fetchKeyPackage_Params](l), err +} + +// NodeService_fetchKeyPackage_Params_Future is a wrapper for a NodeService_fetchKeyPackage_Params promised by a client call. +type NodeService_fetchKeyPackage_Params_Future struct{ *capnp.Future } + +func (f NodeService_fetchKeyPackage_Params_Future) Struct() (NodeService_fetchKeyPackage_Params, error) { + p, err := f.Future.Ptr() + return NodeService_fetchKeyPackage_Params(p.Struct()), err +} +func (p NodeService_fetchKeyPackage_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(1, nil)} +} + +type NodeService_fetchKeyPackage_Results capnp.Struct + +// NodeService_fetchKeyPackage_Results_TypeID is the unique identifier for the type NodeService_fetchKeyPackage_Results. +const NodeService_fetchKeyPackage_Results_TypeID = 0xbbcdc222f3a4d6e2 + +func NewNodeService_fetchKeyPackage_Results(s *capnp.Segment) (NodeService_fetchKeyPackage_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchKeyPackage_Results(st), err +} + +func NewRootNodeService_fetchKeyPackage_Results(s *capnp.Segment) (NodeService_fetchKeyPackage_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchKeyPackage_Results(st), err +} + +func ReadRootNodeService_fetchKeyPackage_Results(msg *capnp.Message) (NodeService_fetchKeyPackage_Results, error) { + root, err := msg.Root() + return NodeService_fetchKeyPackage_Results(root.Struct()), err +} + +func (s NodeService_fetchKeyPackage_Results) String() string { + str, _ := text.Marshal(0xbbcdc222f3a4d6e2, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchKeyPackage_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchKeyPackage_Results) DecodeFromPtr(p capnp.Ptr) NodeService_fetchKeyPackage_Results { + return NodeService_fetchKeyPackage_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchKeyPackage_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchKeyPackage_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchKeyPackage_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchKeyPackage_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchKeyPackage_Results) Package() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_fetchKeyPackage_Results) HasPackage() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchKeyPackage_Results) SetPackage(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_fetchKeyPackage_Results_List is a list of NodeService_fetchKeyPackage_Results. +type NodeService_fetchKeyPackage_Results_List = capnp.StructList[NodeService_fetchKeyPackage_Results] + +// NewNodeService_fetchKeyPackage_Results creates a new list of NodeService_fetchKeyPackage_Results. +func NewNodeService_fetchKeyPackage_Results_List(s *capnp.Segment, sz int32) (NodeService_fetchKeyPackage_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_fetchKeyPackage_Results](l), err +} + +// NodeService_fetchKeyPackage_Results_Future is a wrapper for a NodeService_fetchKeyPackage_Results promised by a client call. +type NodeService_fetchKeyPackage_Results_Future struct{ *capnp.Future } + +func (f NodeService_fetchKeyPackage_Results_Future) Struct() (NodeService_fetchKeyPackage_Results, error) { + p, err := f.Future.Ptr() + return NodeService_fetchKeyPackage_Results(p.Struct()), err +} + +type NodeService_enqueue_Params capnp.Struct + +// NodeService_enqueue_Params_TypeID is the unique identifier for the type NodeService_enqueue_Params. +const NodeService_enqueue_Params_TypeID = 0xaffe0489306a33e6 + +func NewNodeService_enqueue_Params(s *capnp.Segment) (NodeService_enqueue_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}) + return NodeService_enqueue_Params(st), err +} + +func NewRootNodeService_enqueue_Params(s *capnp.Segment) (NodeService_enqueue_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}) + return NodeService_enqueue_Params(st), err +} + +func ReadRootNodeService_enqueue_Params(msg *capnp.Message) (NodeService_enqueue_Params, error) { + root, err := msg.Root() + return NodeService_enqueue_Params(root.Struct()), err +} + +func (s NodeService_enqueue_Params) String() string { + str, _ := text.Marshal(0xaffe0489306a33e6, capnp.Struct(s)) + return str +} + +func (s NodeService_enqueue_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_enqueue_Params) DecodeFromPtr(p capnp.Ptr) NodeService_enqueue_Params { + return NodeService_enqueue_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_enqueue_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_enqueue_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_enqueue_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_enqueue_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_enqueue_Params) RecipientKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_enqueue_Params) HasRecipientKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_enqueue_Params) SetRecipientKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_enqueue_Params) Payload() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_enqueue_Params) HasPayload() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_enqueue_Params) SetPayload(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_enqueue_Params) ChannelId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(2) + return []byte(p.Data()), err +} + +func (s NodeService_enqueue_Params) HasChannelId() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_enqueue_Params) SetChannelId(v []byte) error { + return capnp.Struct(s).SetData(2, v) +} + +func (s NodeService_enqueue_Params) Version() uint16 { + return capnp.Struct(s).Uint16(0) +} + +func (s NodeService_enqueue_Params) SetVersion(v uint16) { + capnp.Struct(s).SetUint16(0, v) +} + +func (s NodeService_enqueue_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(3) + return Auth(p.Struct()), err +} + +func (s NodeService_enqueue_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(3) +} + +func (s NodeService_enqueue_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(3, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_enqueue_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(3, capnp.Struct(ss).ToPtr()) + return ss, err +} + +func (s NodeService_enqueue_Params) TtlSecs() uint32 { + return capnp.Struct(s).Uint32(4) +} + +func (s NodeService_enqueue_Params) SetTtlSecs(v uint32) { + capnp.Struct(s).SetUint32(4, v) +} + +// NodeService_enqueue_Params_List is a list of NodeService_enqueue_Params. +type NodeService_enqueue_Params_List = capnp.StructList[NodeService_enqueue_Params] + +// NewNodeService_enqueue_Params creates a new list of NodeService_enqueue_Params. +func NewNodeService_enqueue_Params_List(s *capnp.Segment, sz int32) (NodeService_enqueue_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}, sz) + return capnp.StructList[NodeService_enqueue_Params](l), err +} + +// NodeService_enqueue_Params_Future is a wrapper for a NodeService_enqueue_Params promised by a client call. +type NodeService_enqueue_Params_Future struct{ *capnp.Future } + +func (f NodeService_enqueue_Params_Future) Struct() (NodeService_enqueue_Params, error) { + p, err := f.Future.Ptr() + return NodeService_enqueue_Params(p.Struct()), err +} +func (p NodeService_enqueue_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(3, nil)} +} + +type NodeService_enqueue_Results capnp.Struct + +// NodeService_enqueue_Results_TypeID is the unique identifier for the type NodeService_enqueue_Results. +const NodeService_enqueue_Results_TypeID = 0xdca0b3a8fe2f5c93 + +func NewNodeService_enqueue_Results(s *capnp.Segment) (NodeService_enqueue_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return NodeService_enqueue_Results(st), err +} + +func NewRootNodeService_enqueue_Results(s *capnp.Segment) (NodeService_enqueue_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return NodeService_enqueue_Results(st), err +} + +func ReadRootNodeService_enqueue_Results(msg *capnp.Message) (NodeService_enqueue_Results, error) { + root, err := msg.Root() + return NodeService_enqueue_Results(root.Struct()), err +} + +func (s NodeService_enqueue_Results) String() string { + str, _ := text.Marshal(0xdca0b3a8fe2f5c93, capnp.Struct(s)) + return str +} + +func (s NodeService_enqueue_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_enqueue_Results) DecodeFromPtr(p capnp.Ptr) NodeService_enqueue_Results { + return NodeService_enqueue_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_enqueue_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_enqueue_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_enqueue_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_enqueue_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_enqueue_Results) Seq() uint64 { + return capnp.Struct(s).Uint64(0) +} + +func (s NodeService_enqueue_Results) SetSeq(v uint64) { + capnp.Struct(s).SetUint64(0, v) +} + +func (s NodeService_enqueue_Results) DeliveryProof() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_enqueue_Results) HasDeliveryProof() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_enqueue_Results) SetDeliveryProof(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_enqueue_Results_List is a list of NodeService_enqueue_Results. +type NodeService_enqueue_Results_List = capnp.StructList[NodeService_enqueue_Results] + +// NewNodeService_enqueue_Results creates a new list of NodeService_enqueue_Results. +func NewNodeService_enqueue_Results_List(s *capnp.Segment, sz int32) (NodeService_enqueue_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return capnp.StructList[NodeService_enqueue_Results](l), err +} + +// NodeService_enqueue_Results_Future is a wrapper for a NodeService_enqueue_Results promised by a client call. +type NodeService_enqueue_Results_Future struct{ *capnp.Future } + +func (f NodeService_enqueue_Results_Future) Struct() (NodeService_enqueue_Results, error) { + p, err := f.Future.Ptr() + return NodeService_enqueue_Results(p.Struct()), err +} + +type NodeService_fetch_Params capnp.Struct + +// NodeService_fetch_Params_TypeID is the unique identifier for the type NodeService_fetch_Params. +const NodeService_fetch_Params_TypeID = 0xfce4d13b87e27edd + +func NewNodeService_fetch_Params(s *capnp.Segment) (NodeService_fetch_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}) + return NodeService_fetch_Params(st), err +} + +func NewRootNodeService_fetch_Params(s *capnp.Segment) (NodeService_fetch_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}) + return NodeService_fetch_Params(st), err +} + +func ReadRootNodeService_fetch_Params(msg *capnp.Message) (NodeService_fetch_Params, error) { + root, err := msg.Root() + return NodeService_fetch_Params(root.Struct()), err +} + +func (s NodeService_fetch_Params) String() string { + str, _ := text.Marshal(0xfce4d13b87e27edd, capnp.Struct(s)) + return str +} + +func (s NodeService_fetch_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetch_Params) DecodeFromPtr(p capnp.Ptr) NodeService_fetch_Params { + return NodeService_fetch_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetch_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetch_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetch_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetch_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetch_Params) RecipientKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_fetch_Params) HasRecipientKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetch_Params) SetRecipientKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_fetch_Params) ChannelId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_fetch_Params) HasChannelId() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_fetch_Params) SetChannelId(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_fetch_Params) Version() uint16 { + return capnp.Struct(s).Uint16(0) +} + +func (s NodeService_fetch_Params) SetVersion(v uint16) { + capnp.Struct(s).SetUint16(0, v) +} + +func (s NodeService_fetch_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(2) + return Auth(p.Struct()), err +} + +func (s NodeService_fetch_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_fetch_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(2, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_fetch_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(2, capnp.Struct(ss).ToPtr()) + return ss, err +} + +func (s NodeService_fetch_Params) Limit() uint32 { + return capnp.Struct(s).Uint32(4) +} + +func (s NodeService_fetch_Params) SetLimit(v uint32) { + capnp.Struct(s).SetUint32(4, v) +} + +// NodeService_fetch_Params_List is a list of NodeService_fetch_Params. +type NodeService_fetch_Params_List = capnp.StructList[NodeService_fetch_Params] + +// NewNodeService_fetch_Params creates a new list of NodeService_fetch_Params. +func NewNodeService_fetch_Params_List(s *capnp.Segment, sz int32) (NodeService_fetch_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}, sz) + return capnp.StructList[NodeService_fetch_Params](l), err +} + +// NodeService_fetch_Params_Future is a wrapper for a NodeService_fetch_Params promised by a client call. +type NodeService_fetch_Params_Future struct{ *capnp.Future } + +func (f NodeService_fetch_Params_Future) Struct() (NodeService_fetch_Params, error) { + p, err := f.Future.Ptr() + return NodeService_fetch_Params(p.Struct()), err +} +func (p NodeService_fetch_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(2, nil)} +} + +type NodeService_fetch_Results capnp.Struct + +// NodeService_fetch_Results_TypeID is the unique identifier for the type NodeService_fetch_Results. +const NodeService_fetch_Results_TypeID = 0xb54ae617bd14f2fb + +func NewNodeService_fetch_Results(s *capnp.Segment) (NodeService_fetch_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetch_Results(st), err +} + +func NewRootNodeService_fetch_Results(s *capnp.Segment) (NodeService_fetch_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetch_Results(st), err +} + +func ReadRootNodeService_fetch_Results(msg *capnp.Message) (NodeService_fetch_Results, error) { + root, err := msg.Root() + return NodeService_fetch_Results(root.Struct()), err +} + +func (s NodeService_fetch_Results) String() string { + str, _ := text.Marshal(0xb54ae617bd14f2fb, capnp.Struct(s)) + return str +} + +func (s NodeService_fetch_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetch_Results) DecodeFromPtr(p capnp.Ptr) NodeService_fetch_Results { + return NodeService_fetch_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetch_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetch_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetch_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetch_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetch_Results) Payloads() (Envelope_List, error) { + p, err := capnp.Struct(s).Ptr(0) + return Envelope_List(p.List()), err +} + +func (s NodeService_fetch_Results) HasPayloads() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetch_Results) SetPayloads(v Envelope_List) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewPayloads sets the payloads field to a newly +// allocated Envelope_List, preferring placement in s's segment. +func (s NodeService_fetch_Results) NewPayloads(n int32) (Envelope_List, error) { + l, err := NewEnvelope_List(capnp.Struct(s).Segment(), n) + if err != nil { + return Envelope_List{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} + +// NodeService_fetch_Results_List is a list of NodeService_fetch_Results. +type NodeService_fetch_Results_List = capnp.StructList[NodeService_fetch_Results] + +// NewNodeService_fetch_Results creates a new list of NodeService_fetch_Results. +func NewNodeService_fetch_Results_List(s *capnp.Segment, sz int32) (NodeService_fetch_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_fetch_Results](l), err +} + +// NodeService_fetch_Results_Future is a wrapper for a NodeService_fetch_Results promised by a client call. +type NodeService_fetch_Results_Future struct{ *capnp.Future } + +func (f NodeService_fetch_Results_Future) Struct() (NodeService_fetch_Results, error) { + p, err := f.Future.Ptr() + return NodeService_fetch_Results(p.Struct()), err +} + +type NodeService_fetchWait_Params capnp.Struct + +// NodeService_fetchWait_Params_TypeID is the unique identifier for the type NodeService_fetchWait_Params. +const NodeService_fetchWait_Params_TypeID = 0xd252902b7f6a5c8d + +func NewNodeService_fetchWait_Params(s *capnp.Segment) (NodeService_fetchWait_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 3}) + return NodeService_fetchWait_Params(st), err +} + +func NewRootNodeService_fetchWait_Params(s *capnp.Segment) (NodeService_fetchWait_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 3}) + return NodeService_fetchWait_Params(st), err +} + +func ReadRootNodeService_fetchWait_Params(msg *capnp.Message) (NodeService_fetchWait_Params, error) { + root, err := msg.Root() + return NodeService_fetchWait_Params(root.Struct()), err +} + +func (s NodeService_fetchWait_Params) String() string { + str, _ := text.Marshal(0xd252902b7f6a5c8d, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchWait_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchWait_Params) DecodeFromPtr(p capnp.Ptr) NodeService_fetchWait_Params { + return NodeService_fetchWait_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchWait_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchWait_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchWait_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchWait_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchWait_Params) RecipientKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_fetchWait_Params) HasRecipientKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchWait_Params) SetRecipientKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_fetchWait_Params) ChannelId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_fetchWait_Params) HasChannelId() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_fetchWait_Params) SetChannelId(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_fetchWait_Params) Version() uint16 { + return capnp.Struct(s).Uint16(0) +} + +func (s NodeService_fetchWait_Params) SetVersion(v uint16) { + capnp.Struct(s).SetUint16(0, v) +} + +func (s NodeService_fetchWait_Params) TimeoutMs() uint64 { + return capnp.Struct(s).Uint64(8) +} + +func (s NodeService_fetchWait_Params) SetTimeoutMs(v uint64) { + capnp.Struct(s).SetUint64(8, v) +} + +func (s NodeService_fetchWait_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(2) + return Auth(p.Struct()), err +} + +func (s NodeService_fetchWait_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_fetchWait_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(2, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_fetchWait_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(2, capnp.Struct(ss).ToPtr()) + return ss, err +} + +func (s NodeService_fetchWait_Params) Limit() uint32 { + return capnp.Struct(s).Uint32(4) +} + +func (s NodeService_fetchWait_Params) SetLimit(v uint32) { + capnp.Struct(s).SetUint32(4, v) +} + +// NodeService_fetchWait_Params_List is a list of NodeService_fetchWait_Params. +type NodeService_fetchWait_Params_List = capnp.StructList[NodeService_fetchWait_Params] + +// NewNodeService_fetchWait_Params creates a new list of NodeService_fetchWait_Params. +func NewNodeService_fetchWait_Params_List(s *capnp.Segment, sz int32) (NodeService_fetchWait_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 3}, sz) + return capnp.StructList[NodeService_fetchWait_Params](l), err +} + +// NodeService_fetchWait_Params_Future is a wrapper for a NodeService_fetchWait_Params promised by a client call. +type NodeService_fetchWait_Params_Future struct{ *capnp.Future } + +func (f NodeService_fetchWait_Params_Future) Struct() (NodeService_fetchWait_Params, error) { + p, err := f.Future.Ptr() + return NodeService_fetchWait_Params(p.Struct()), err +} +func (p NodeService_fetchWait_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(2, nil)} +} + +type NodeService_fetchWait_Results capnp.Struct + +// NodeService_fetchWait_Results_TypeID is the unique identifier for the type NodeService_fetchWait_Results. +const NodeService_fetchWait_Results_TypeID = 0xab981881499ac54b + +func NewNodeService_fetchWait_Results(s *capnp.Segment) (NodeService_fetchWait_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchWait_Results(st), err +} + +func NewRootNodeService_fetchWait_Results(s *capnp.Segment) (NodeService_fetchWait_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchWait_Results(st), err +} + +func ReadRootNodeService_fetchWait_Results(msg *capnp.Message) (NodeService_fetchWait_Results, error) { + root, err := msg.Root() + return NodeService_fetchWait_Results(root.Struct()), err +} + +func (s NodeService_fetchWait_Results) String() string { + str, _ := text.Marshal(0xab981881499ac54b, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchWait_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchWait_Results) DecodeFromPtr(p capnp.Ptr) NodeService_fetchWait_Results { + return NodeService_fetchWait_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchWait_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchWait_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchWait_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchWait_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchWait_Results) Payloads() (Envelope_List, error) { + p, err := capnp.Struct(s).Ptr(0) + return Envelope_List(p.List()), err +} + +func (s NodeService_fetchWait_Results) HasPayloads() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchWait_Results) SetPayloads(v Envelope_List) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewPayloads sets the payloads field to a newly +// allocated Envelope_List, preferring placement in s's segment. +func (s NodeService_fetchWait_Results) NewPayloads(n int32) (Envelope_List, error) { + l, err := NewEnvelope_List(capnp.Struct(s).Segment(), n) + if err != nil { + return Envelope_List{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} + +// NodeService_fetchWait_Results_List is a list of NodeService_fetchWait_Results. +type NodeService_fetchWait_Results_List = capnp.StructList[NodeService_fetchWait_Results] + +// NewNodeService_fetchWait_Results creates a new list of NodeService_fetchWait_Results. +func NewNodeService_fetchWait_Results_List(s *capnp.Segment, sz int32) (NodeService_fetchWait_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_fetchWait_Results](l), err +} + +// NodeService_fetchWait_Results_Future is a wrapper for a NodeService_fetchWait_Results promised by a client call. +type NodeService_fetchWait_Results_Future struct{ *capnp.Future } + +func (f NodeService_fetchWait_Results_Future) Struct() (NodeService_fetchWait_Results, error) { + p, err := f.Future.Ptr() + return NodeService_fetchWait_Results(p.Struct()), err +} + +type NodeService_health_Params capnp.Struct + +// NodeService_health_Params_TypeID is the unique identifier for the type NodeService_health_Params. +const NodeService_health_Params_TypeID = 0xc38428f6c32bdd68 + +func NewNodeService_health_Params(s *capnp.Segment) (NodeService_health_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_health_Params(st), err +} + +func NewRootNodeService_health_Params(s *capnp.Segment) (NodeService_health_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_health_Params(st), err +} + +func ReadRootNodeService_health_Params(msg *capnp.Message) (NodeService_health_Params, error) { + root, err := msg.Root() + return NodeService_health_Params(root.Struct()), err +} + +func (s NodeService_health_Params) String() string { + str, _ := text.Marshal(0xc38428f6c32bdd68, capnp.Struct(s)) + return str +} + +func (s NodeService_health_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_health_Params) DecodeFromPtr(p capnp.Ptr) NodeService_health_Params { + return NodeService_health_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_health_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_health_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_health_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_health_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} + +// NodeService_health_Params_List is a list of NodeService_health_Params. +type NodeService_health_Params_List = capnp.StructList[NodeService_health_Params] + +// NewNodeService_health_Params creates a new list of NodeService_health_Params. +func NewNodeService_health_Params_List(s *capnp.Segment, sz int32) (NodeService_health_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz) + return capnp.StructList[NodeService_health_Params](l), err +} + +// NodeService_health_Params_Future is a wrapper for a NodeService_health_Params promised by a client call. +type NodeService_health_Params_Future struct{ *capnp.Future } + +func (f NodeService_health_Params_Future) Struct() (NodeService_health_Params, error) { + p, err := f.Future.Ptr() + return NodeService_health_Params(p.Struct()), err +} + +type NodeService_health_Results capnp.Struct + +// NodeService_health_Results_TypeID is the unique identifier for the type NodeService_health_Results. +const NodeService_health_Results_TypeID = 0xb973e21c950d720f + +func NewNodeService_health_Results(s *capnp.Segment) (NodeService_health_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_health_Results(st), err +} + +func NewRootNodeService_health_Results(s *capnp.Segment) (NodeService_health_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_health_Results(st), err +} + +func ReadRootNodeService_health_Results(msg *capnp.Message) (NodeService_health_Results, error) { + root, err := msg.Root() + return NodeService_health_Results(root.Struct()), err +} + +func (s NodeService_health_Results) String() string { + str, _ := text.Marshal(0xb973e21c950d720f, capnp.Struct(s)) + return str +} + +func (s NodeService_health_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_health_Results) DecodeFromPtr(p capnp.Ptr) NodeService_health_Results { + return NodeService_health_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_health_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_health_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_health_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_health_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_health_Results) Status() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s NodeService_health_Results) HasStatus() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_health_Results) StatusBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s NodeService_health_Results) SetStatus(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +// NodeService_health_Results_List is a list of NodeService_health_Results. +type NodeService_health_Results_List = capnp.StructList[NodeService_health_Results] + +// NewNodeService_health_Results creates a new list of NodeService_health_Results. +func NewNodeService_health_Results_List(s *capnp.Segment, sz int32) (NodeService_health_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_health_Results](l), err +} + +// NodeService_health_Results_Future is a wrapper for a NodeService_health_Results promised by a client call. +type NodeService_health_Results_Future struct{ *capnp.Future } + +func (f NodeService_health_Results_Future) Struct() (NodeService_health_Results, error) { + p, err := f.Future.Ptr() + return NodeService_health_Results(p.Struct()), err +} + +type NodeService_uploadHybridKey_Params capnp.Struct + +// NodeService_uploadHybridKey_Params_TypeID is the unique identifier for the type NodeService_uploadHybridKey_Params. +const NodeService_uploadHybridKey_Params_TypeID = 0xf4269c0bea281b62 + +func NewNodeService_uploadHybridKey_Params(s *capnp.Segment) (NodeService_uploadHybridKey_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_uploadHybridKey_Params(st), err +} + +func NewRootNodeService_uploadHybridKey_Params(s *capnp.Segment) (NodeService_uploadHybridKey_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_uploadHybridKey_Params(st), err +} + +func ReadRootNodeService_uploadHybridKey_Params(msg *capnp.Message) (NodeService_uploadHybridKey_Params, error) { + root, err := msg.Root() + return NodeService_uploadHybridKey_Params(root.Struct()), err +} + +func (s NodeService_uploadHybridKey_Params) String() string { + str, _ := text.Marshal(0xf4269c0bea281b62, capnp.Struct(s)) + return str +} + +func (s NodeService_uploadHybridKey_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_uploadHybridKey_Params) DecodeFromPtr(p capnp.Ptr) NodeService_uploadHybridKey_Params { + return NodeService_uploadHybridKey_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_uploadHybridKey_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_uploadHybridKey_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_uploadHybridKey_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_uploadHybridKey_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_uploadHybridKey_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_uploadHybridKey_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_uploadHybridKey_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_uploadHybridKey_Params) HybridPublicKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_uploadHybridKey_Params) HasHybridPublicKey() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_uploadHybridKey_Params) SetHybridPublicKey(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_uploadHybridKey_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(2) + return Auth(p.Struct()), err +} + +func (s NodeService_uploadHybridKey_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_uploadHybridKey_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(2, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_uploadHybridKey_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(2, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_uploadHybridKey_Params_List is a list of NodeService_uploadHybridKey_Params. +type NodeService_uploadHybridKey_Params_List = capnp.StructList[NodeService_uploadHybridKey_Params] + +// NewNodeService_uploadHybridKey_Params creates a new list of NodeService_uploadHybridKey_Params. +func NewNodeService_uploadHybridKey_Params_List(s *capnp.Segment, sz int32) (NodeService_uploadHybridKey_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}, sz) + return capnp.StructList[NodeService_uploadHybridKey_Params](l), err +} + +// NodeService_uploadHybridKey_Params_Future is a wrapper for a NodeService_uploadHybridKey_Params promised by a client call. +type NodeService_uploadHybridKey_Params_Future struct{ *capnp.Future } + +func (f NodeService_uploadHybridKey_Params_Future) Struct() (NodeService_uploadHybridKey_Params, error) { + p, err := f.Future.Ptr() + return NodeService_uploadHybridKey_Params(p.Struct()), err +} +func (p NodeService_uploadHybridKey_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(2, nil)} +} + +type NodeService_uploadHybridKey_Results capnp.Struct + +// NodeService_uploadHybridKey_Results_TypeID is the unique identifier for the type NodeService_uploadHybridKey_Results. +const NodeService_uploadHybridKey_Results_TypeID = 0xb43fee4e7f0a0124 + +func NewNodeService_uploadHybridKey_Results(s *capnp.Segment) (NodeService_uploadHybridKey_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_uploadHybridKey_Results(st), err +} + +func NewRootNodeService_uploadHybridKey_Results(s *capnp.Segment) (NodeService_uploadHybridKey_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_uploadHybridKey_Results(st), err +} + +func ReadRootNodeService_uploadHybridKey_Results(msg *capnp.Message) (NodeService_uploadHybridKey_Results, error) { + root, err := msg.Root() + return NodeService_uploadHybridKey_Results(root.Struct()), err +} + +func (s NodeService_uploadHybridKey_Results) String() string { + str, _ := text.Marshal(0xb43fee4e7f0a0124, capnp.Struct(s)) + return str +} + +func (s NodeService_uploadHybridKey_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_uploadHybridKey_Results) DecodeFromPtr(p capnp.Ptr) NodeService_uploadHybridKey_Results { + return NodeService_uploadHybridKey_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_uploadHybridKey_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_uploadHybridKey_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_uploadHybridKey_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_uploadHybridKey_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} + +// NodeService_uploadHybridKey_Results_List is a list of NodeService_uploadHybridKey_Results. +type NodeService_uploadHybridKey_Results_List = capnp.StructList[NodeService_uploadHybridKey_Results] + +// NewNodeService_uploadHybridKey_Results creates a new list of NodeService_uploadHybridKey_Results. +func NewNodeService_uploadHybridKey_Results_List(s *capnp.Segment, sz int32) (NodeService_uploadHybridKey_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz) + return capnp.StructList[NodeService_uploadHybridKey_Results](l), err +} + +// NodeService_uploadHybridKey_Results_Future is a wrapper for a NodeService_uploadHybridKey_Results promised by a client call. +type NodeService_uploadHybridKey_Results_Future struct{ *capnp.Future } + +func (f NodeService_uploadHybridKey_Results_Future) Struct() (NodeService_uploadHybridKey_Results, error) { + p, err := f.Future.Ptr() + return NodeService_uploadHybridKey_Results(p.Struct()), err +} + +type NodeService_fetchHybridKey_Params capnp.Struct + +// NodeService_fetchHybridKey_Params_TypeID is the unique identifier for the type NodeService_fetchHybridKey_Params. +const NodeService_fetchHybridKey_Params_TypeID = 0x9c09256e6f9501c2 + +func NewNodeService_fetchHybridKey_Params(s *capnp.Segment) (NodeService_fetchHybridKey_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_fetchHybridKey_Params(st), err +} + +func NewRootNodeService_fetchHybridKey_Params(s *capnp.Segment) (NodeService_fetchHybridKey_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_fetchHybridKey_Params(st), err +} + +func ReadRootNodeService_fetchHybridKey_Params(msg *capnp.Message) (NodeService_fetchHybridKey_Params, error) { + root, err := msg.Root() + return NodeService_fetchHybridKey_Params(root.Struct()), err +} + +func (s NodeService_fetchHybridKey_Params) String() string { + str, _ := text.Marshal(0x9c09256e6f9501c2, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchHybridKey_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchHybridKey_Params) DecodeFromPtr(p capnp.Ptr) NodeService_fetchHybridKey_Params { + return NodeService_fetchHybridKey_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchHybridKey_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchHybridKey_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchHybridKey_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchHybridKey_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchHybridKey_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_fetchHybridKey_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchHybridKey_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_fetchHybridKey_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(1) + return Auth(p.Struct()), err +} + +func (s NodeService_fetchHybridKey_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_fetchHybridKey_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(1, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_fetchHybridKey_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_fetchHybridKey_Params_List is a list of NodeService_fetchHybridKey_Params. +type NodeService_fetchHybridKey_Params_List = capnp.StructList[NodeService_fetchHybridKey_Params] + +// NewNodeService_fetchHybridKey_Params creates a new list of NodeService_fetchHybridKey_Params. +func NewNodeService_fetchHybridKey_Params_List(s *capnp.Segment, sz int32) (NodeService_fetchHybridKey_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_fetchHybridKey_Params](l), err +} + +// NodeService_fetchHybridKey_Params_Future is a wrapper for a NodeService_fetchHybridKey_Params promised by a client call. +type NodeService_fetchHybridKey_Params_Future struct{ *capnp.Future } + +func (f NodeService_fetchHybridKey_Params_Future) Struct() (NodeService_fetchHybridKey_Params, error) { + p, err := f.Future.Ptr() + return NodeService_fetchHybridKey_Params(p.Struct()), err +} +func (p NodeService_fetchHybridKey_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(1, nil)} +} + +type NodeService_fetchHybridKey_Results capnp.Struct + +// NodeService_fetchHybridKey_Results_TypeID is the unique identifier for the type NodeService_fetchHybridKey_Results. +const NodeService_fetchHybridKey_Results_TypeID = 0x812ea5d8346b415a + +func NewNodeService_fetchHybridKey_Results(s *capnp.Segment) (NodeService_fetchHybridKey_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchHybridKey_Results(st), err +} + +func NewRootNodeService_fetchHybridKey_Results(s *capnp.Segment) (NodeService_fetchHybridKey_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchHybridKey_Results(st), err +} + +func ReadRootNodeService_fetchHybridKey_Results(msg *capnp.Message) (NodeService_fetchHybridKey_Results, error) { + root, err := msg.Root() + return NodeService_fetchHybridKey_Results(root.Struct()), err +} + +func (s NodeService_fetchHybridKey_Results) String() string { + str, _ := text.Marshal(0x812ea5d8346b415a, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchHybridKey_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchHybridKey_Results) DecodeFromPtr(p capnp.Ptr) NodeService_fetchHybridKey_Results { + return NodeService_fetchHybridKey_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchHybridKey_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchHybridKey_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchHybridKey_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchHybridKey_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchHybridKey_Results) HybridPublicKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_fetchHybridKey_Results) HasHybridPublicKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchHybridKey_Results) SetHybridPublicKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_fetchHybridKey_Results_List is a list of NodeService_fetchHybridKey_Results. +type NodeService_fetchHybridKey_Results_List = capnp.StructList[NodeService_fetchHybridKey_Results] + +// NewNodeService_fetchHybridKey_Results creates a new list of NodeService_fetchHybridKey_Results. +func NewNodeService_fetchHybridKey_Results_List(s *capnp.Segment, sz int32) (NodeService_fetchHybridKey_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_fetchHybridKey_Results](l), err +} + +// NodeService_fetchHybridKey_Results_Future is a wrapper for a NodeService_fetchHybridKey_Results promised by a client call. +type NodeService_fetchHybridKey_Results_Future struct{ *capnp.Future } + +func (f NodeService_fetchHybridKey_Results_Future) Struct() (NodeService_fetchHybridKey_Results, error) { + p, err := f.Future.Ptr() + return NodeService_fetchHybridKey_Results(p.Struct()), err +} + +type NodeService_opaqueRegisterStart_Params capnp.Struct + +// NodeService_opaqueRegisterStart_Params_TypeID is the unique identifier for the type NodeService_opaqueRegisterStart_Params. +const NodeService_opaqueRegisterStart_Params_TypeID = 0xc644aedeed4d9281 + +func NewNodeService_opaqueRegisterStart_Params(s *capnp.Segment) (NodeService_opaqueRegisterStart_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_opaqueRegisterStart_Params(st), err +} + +func NewRootNodeService_opaqueRegisterStart_Params(s *capnp.Segment) (NodeService_opaqueRegisterStart_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_opaqueRegisterStart_Params(st), err +} + +func ReadRootNodeService_opaqueRegisterStart_Params(msg *capnp.Message) (NodeService_opaqueRegisterStart_Params, error) { + root, err := msg.Root() + return NodeService_opaqueRegisterStart_Params(root.Struct()), err +} + +func (s NodeService_opaqueRegisterStart_Params) String() string { + str, _ := text.Marshal(0xc644aedeed4d9281, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueRegisterStart_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueRegisterStart_Params) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueRegisterStart_Params { + return NodeService_opaqueRegisterStart_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueRegisterStart_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueRegisterStart_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueRegisterStart_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueRegisterStart_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueRegisterStart_Params) Username() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s NodeService_opaqueRegisterStart_Params) HasUsername() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_opaqueRegisterStart_Params) UsernameBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s NodeService_opaqueRegisterStart_Params) SetUsername(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +func (s NodeService_opaqueRegisterStart_Params) Request() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueRegisterStart_Params) HasRequest() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_opaqueRegisterStart_Params) SetRequest(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +// NodeService_opaqueRegisterStart_Params_List is a list of NodeService_opaqueRegisterStart_Params. +type NodeService_opaqueRegisterStart_Params_List = capnp.StructList[NodeService_opaqueRegisterStart_Params] + +// NewNodeService_opaqueRegisterStart_Params creates a new list of NodeService_opaqueRegisterStart_Params. +func NewNodeService_opaqueRegisterStart_Params_List(s *capnp.Segment, sz int32) (NodeService_opaqueRegisterStart_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_opaqueRegisterStart_Params](l), err +} + +// NodeService_opaqueRegisterStart_Params_Future is a wrapper for a NodeService_opaqueRegisterStart_Params promised by a client call. +type NodeService_opaqueRegisterStart_Params_Future struct{ *capnp.Future } + +func (f NodeService_opaqueRegisterStart_Params_Future) Struct() (NodeService_opaqueRegisterStart_Params, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueRegisterStart_Params(p.Struct()), err +} + +type NodeService_opaqueRegisterStart_Results capnp.Struct + +// NodeService_opaqueRegisterStart_Results_TypeID is the unique identifier for the type NodeService_opaqueRegisterStart_Results. +const NodeService_opaqueRegisterStart_Results_TypeID = 0xe8b5868ec5b8624d + +func NewNodeService_opaqueRegisterStart_Results(s *capnp.Segment) (NodeService_opaqueRegisterStart_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueRegisterStart_Results(st), err +} + +func NewRootNodeService_opaqueRegisterStart_Results(s *capnp.Segment) (NodeService_opaqueRegisterStart_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueRegisterStart_Results(st), err +} + +func ReadRootNodeService_opaqueRegisterStart_Results(msg *capnp.Message) (NodeService_opaqueRegisterStart_Results, error) { + root, err := msg.Root() + return NodeService_opaqueRegisterStart_Results(root.Struct()), err +} + +func (s NodeService_opaqueRegisterStart_Results) String() string { + str, _ := text.Marshal(0xe8b5868ec5b8624d, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueRegisterStart_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueRegisterStart_Results) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueRegisterStart_Results { + return NodeService_opaqueRegisterStart_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueRegisterStart_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueRegisterStart_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueRegisterStart_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueRegisterStart_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueRegisterStart_Results) Response() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueRegisterStart_Results) HasResponse() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_opaqueRegisterStart_Results) SetResponse(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_opaqueRegisterStart_Results_List is a list of NodeService_opaqueRegisterStart_Results. +type NodeService_opaqueRegisterStart_Results_List = capnp.StructList[NodeService_opaqueRegisterStart_Results] + +// NewNodeService_opaqueRegisterStart_Results creates a new list of NodeService_opaqueRegisterStart_Results. +func NewNodeService_opaqueRegisterStart_Results_List(s *capnp.Segment, sz int32) (NodeService_opaqueRegisterStart_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_opaqueRegisterStart_Results](l), err +} + +// NodeService_opaqueRegisterStart_Results_Future is a wrapper for a NodeService_opaqueRegisterStart_Results promised by a client call. +type NodeService_opaqueRegisterStart_Results_Future struct{ *capnp.Future } + +func (f NodeService_opaqueRegisterStart_Results_Future) Struct() (NodeService_opaqueRegisterStart_Results, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueRegisterStart_Results(p.Struct()), err +} + +type NodeService_opaqueRegisterFinish_Params capnp.Struct + +// NodeService_opaqueRegisterFinish_Params_TypeID is the unique identifier for the type NodeService_opaqueRegisterFinish_Params. +const NodeService_opaqueRegisterFinish_Params_TypeID = 0xaa9cf7014ed4b760 + +func NewNodeService_opaqueRegisterFinish_Params(s *capnp.Segment) (NodeService_opaqueRegisterFinish_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_opaqueRegisterFinish_Params(st), err +} + +func NewRootNodeService_opaqueRegisterFinish_Params(s *capnp.Segment) (NodeService_opaqueRegisterFinish_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_opaqueRegisterFinish_Params(st), err +} + +func ReadRootNodeService_opaqueRegisterFinish_Params(msg *capnp.Message) (NodeService_opaqueRegisterFinish_Params, error) { + root, err := msg.Root() + return NodeService_opaqueRegisterFinish_Params(root.Struct()), err +} + +func (s NodeService_opaqueRegisterFinish_Params) String() string { + str, _ := text.Marshal(0xaa9cf7014ed4b760, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueRegisterFinish_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueRegisterFinish_Params) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueRegisterFinish_Params { + return NodeService_opaqueRegisterFinish_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueRegisterFinish_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueRegisterFinish_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueRegisterFinish_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueRegisterFinish_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueRegisterFinish_Params) Username() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s NodeService_opaqueRegisterFinish_Params) HasUsername() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_opaqueRegisterFinish_Params) UsernameBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s NodeService_opaqueRegisterFinish_Params) SetUsername(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +func (s NodeService_opaqueRegisterFinish_Params) Upload() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueRegisterFinish_Params) HasUpload() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_opaqueRegisterFinish_Params) SetUpload(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_opaqueRegisterFinish_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(2) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueRegisterFinish_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_opaqueRegisterFinish_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(2, v) +} + +// NodeService_opaqueRegisterFinish_Params_List is a list of NodeService_opaqueRegisterFinish_Params. +type NodeService_opaqueRegisterFinish_Params_List = capnp.StructList[NodeService_opaqueRegisterFinish_Params] + +// NewNodeService_opaqueRegisterFinish_Params creates a new list of NodeService_opaqueRegisterFinish_Params. +func NewNodeService_opaqueRegisterFinish_Params_List(s *capnp.Segment, sz int32) (NodeService_opaqueRegisterFinish_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}, sz) + return capnp.StructList[NodeService_opaqueRegisterFinish_Params](l), err +} + +// NodeService_opaqueRegisterFinish_Params_Future is a wrapper for a NodeService_opaqueRegisterFinish_Params promised by a client call. +type NodeService_opaqueRegisterFinish_Params_Future struct{ *capnp.Future } + +func (f NodeService_opaqueRegisterFinish_Params_Future) Struct() (NodeService_opaqueRegisterFinish_Params, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueRegisterFinish_Params(p.Struct()), err +} + +type NodeService_opaqueRegisterFinish_Results capnp.Struct + +// NodeService_opaqueRegisterFinish_Results_TypeID is the unique identifier for the type NodeService_opaqueRegisterFinish_Results. +const NodeService_opaqueRegisterFinish_Results_TypeID = 0xd45280f14698321f + +func NewNodeService_opaqueRegisterFinish_Results(s *capnp.Segment) (NodeService_opaqueRegisterFinish_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return NodeService_opaqueRegisterFinish_Results(st), err +} + +func NewRootNodeService_opaqueRegisterFinish_Results(s *capnp.Segment) (NodeService_opaqueRegisterFinish_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return NodeService_opaqueRegisterFinish_Results(st), err +} + +func ReadRootNodeService_opaqueRegisterFinish_Results(msg *capnp.Message) (NodeService_opaqueRegisterFinish_Results, error) { + root, err := msg.Root() + return NodeService_opaqueRegisterFinish_Results(root.Struct()), err +} + +func (s NodeService_opaqueRegisterFinish_Results) String() string { + str, _ := text.Marshal(0xd45280f14698321f, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueRegisterFinish_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueRegisterFinish_Results) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueRegisterFinish_Results { + return NodeService_opaqueRegisterFinish_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueRegisterFinish_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueRegisterFinish_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueRegisterFinish_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueRegisterFinish_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueRegisterFinish_Results) Success() bool { + return capnp.Struct(s).Bit(0) +} + +func (s NodeService_opaqueRegisterFinish_Results) SetSuccess(v bool) { + capnp.Struct(s).SetBit(0, v) +} + +// NodeService_opaqueRegisterFinish_Results_List is a list of NodeService_opaqueRegisterFinish_Results. +type NodeService_opaqueRegisterFinish_Results_List = capnp.StructList[NodeService_opaqueRegisterFinish_Results] + +// NewNodeService_opaqueRegisterFinish_Results creates a new list of NodeService_opaqueRegisterFinish_Results. +func NewNodeService_opaqueRegisterFinish_Results_List(s *capnp.Segment, sz int32) (NodeService_opaqueRegisterFinish_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return capnp.StructList[NodeService_opaqueRegisterFinish_Results](l), err +} + +// NodeService_opaqueRegisterFinish_Results_Future is a wrapper for a NodeService_opaqueRegisterFinish_Results promised by a client call. +type NodeService_opaqueRegisterFinish_Results_Future struct{ *capnp.Future } + +func (f NodeService_opaqueRegisterFinish_Results_Future) Struct() (NodeService_opaqueRegisterFinish_Results, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueRegisterFinish_Results(p.Struct()), err +} + +type NodeService_opaqueLoginStart_Params capnp.Struct + +// NodeService_opaqueLoginStart_Params_TypeID is the unique identifier for the type NodeService_opaqueLoginStart_Params. +const NodeService_opaqueLoginStart_Params_TypeID = 0xfdfbf327ad5c186f + +func NewNodeService_opaqueLoginStart_Params(s *capnp.Segment) (NodeService_opaqueLoginStart_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_opaqueLoginStart_Params(st), err +} + +func NewRootNodeService_opaqueLoginStart_Params(s *capnp.Segment) (NodeService_opaqueLoginStart_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_opaqueLoginStart_Params(st), err +} + +func ReadRootNodeService_opaqueLoginStart_Params(msg *capnp.Message) (NodeService_opaqueLoginStart_Params, error) { + root, err := msg.Root() + return NodeService_opaqueLoginStart_Params(root.Struct()), err +} + +func (s NodeService_opaqueLoginStart_Params) String() string { + str, _ := text.Marshal(0xfdfbf327ad5c186f, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueLoginStart_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueLoginStart_Params) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueLoginStart_Params { + return NodeService_opaqueLoginStart_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueLoginStart_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueLoginStart_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueLoginStart_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueLoginStart_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueLoginStart_Params) Username() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s NodeService_opaqueLoginStart_Params) HasUsername() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_opaqueLoginStart_Params) UsernameBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s NodeService_opaqueLoginStart_Params) SetUsername(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +func (s NodeService_opaqueLoginStart_Params) Request() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueLoginStart_Params) HasRequest() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_opaqueLoginStart_Params) SetRequest(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +// NodeService_opaqueLoginStart_Params_List is a list of NodeService_opaqueLoginStart_Params. +type NodeService_opaqueLoginStart_Params_List = capnp.StructList[NodeService_opaqueLoginStart_Params] + +// NewNodeService_opaqueLoginStart_Params creates a new list of NodeService_opaqueLoginStart_Params. +func NewNodeService_opaqueLoginStart_Params_List(s *capnp.Segment, sz int32) (NodeService_opaqueLoginStart_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_opaqueLoginStart_Params](l), err +} + +// NodeService_opaqueLoginStart_Params_Future is a wrapper for a NodeService_opaqueLoginStart_Params promised by a client call. +type NodeService_opaqueLoginStart_Params_Future struct{ *capnp.Future } + +func (f NodeService_opaqueLoginStart_Params_Future) Struct() (NodeService_opaqueLoginStart_Params, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueLoginStart_Params(p.Struct()), err +} + +type NodeService_opaqueLoginStart_Results capnp.Struct + +// NodeService_opaqueLoginStart_Results_TypeID is the unique identifier for the type NodeService_opaqueLoginStart_Results. +const NodeService_opaqueLoginStart_Results_TypeID = 0xf05954c09a5c05aa + +func NewNodeService_opaqueLoginStart_Results(s *capnp.Segment) (NodeService_opaqueLoginStart_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueLoginStart_Results(st), err +} + +func NewRootNodeService_opaqueLoginStart_Results(s *capnp.Segment) (NodeService_opaqueLoginStart_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueLoginStart_Results(st), err +} + +func ReadRootNodeService_opaqueLoginStart_Results(msg *capnp.Message) (NodeService_opaqueLoginStart_Results, error) { + root, err := msg.Root() + return NodeService_opaqueLoginStart_Results(root.Struct()), err +} + +func (s NodeService_opaqueLoginStart_Results) String() string { + str, _ := text.Marshal(0xf05954c09a5c05aa, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueLoginStart_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueLoginStart_Results) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueLoginStart_Results { + return NodeService_opaqueLoginStart_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueLoginStart_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueLoginStart_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueLoginStart_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueLoginStart_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueLoginStart_Results) Response() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueLoginStart_Results) HasResponse() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_opaqueLoginStart_Results) SetResponse(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_opaqueLoginStart_Results_List is a list of NodeService_opaqueLoginStart_Results. +type NodeService_opaqueLoginStart_Results_List = capnp.StructList[NodeService_opaqueLoginStart_Results] + +// NewNodeService_opaqueLoginStart_Results creates a new list of NodeService_opaqueLoginStart_Results. +func NewNodeService_opaqueLoginStart_Results_List(s *capnp.Segment, sz int32) (NodeService_opaqueLoginStart_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_opaqueLoginStart_Results](l), err +} + +// NodeService_opaqueLoginStart_Results_Future is a wrapper for a NodeService_opaqueLoginStart_Results promised by a client call. +type NodeService_opaqueLoginStart_Results_Future struct{ *capnp.Future } + +func (f NodeService_opaqueLoginStart_Results_Future) Struct() (NodeService_opaqueLoginStart_Results, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueLoginStart_Results(p.Struct()), err +} + +type NodeService_opaqueLoginFinish_Params capnp.Struct + +// NodeService_opaqueLoginFinish_Params_TypeID is the unique identifier for the type NodeService_opaqueLoginFinish_Params. +const NodeService_opaqueLoginFinish_Params_TypeID = 0x8a33eb7c3acb8ef8 + +func NewNodeService_opaqueLoginFinish_Params(s *capnp.Segment) (NodeService_opaqueLoginFinish_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_opaqueLoginFinish_Params(st), err +} + +func NewRootNodeService_opaqueLoginFinish_Params(s *capnp.Segment) (NodeService_opaqueLoginFinish_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_opaqueLoginFinish_Params(st), err +} + +func ReadRootNodeService_opaqueLoginFinish_Params(msg *capnp.Message) (NodeService_opaqueLoginFinish_Params, error) { + root, err := msg.Root() + return NodeService_opaqueLoginFinish_Params(root.Struct()), err +} + +func (s NodeService_opaqueLoginFinish_Params) String() string { + str, _ := text.Marshal(0x8a33eb7c3acb8ef8, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueLoginFinish_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueLoginFinish_Params) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueLoginFinish_Params { + return NodeService_opaqueLoginFinish_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueLoginFinish_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueLoginFinish_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueLoginFinish_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueLoginFinish_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueLoginFinish_Params) Username() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s NodeService_opaqueLoginFinish_Params) HasUsername() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_opaqueLoginFinish_Params) UsernameBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s NodeService_opaqueLoginFinish_Params) SetUsername(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +func (s NodeService_opaqueLoginFinish_Params) Finalization() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueLoginFinish_Params) HasFinalization() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_opaqueLoginFinish_Params) SetFinalization(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_opaqueLoginFinish_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(2) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueLoginFinish_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_opaqueLoginFinish_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(2, v) +} + +// NodeService_opaqueLoginFinish_Params_List is a list of NodeService_opaqueLoginFinish_Params. +type NodeService_opaqueLoginFinish_Params_List = capnp.StructList[NodeService_opaqueLoginFinish_Params] + +// NewNodeService_opaqueLoginFinish_Params creates a new list of NodeService_opaqueLoginFinish_Params. +func NewNodeService_opaqueLoginFinish_Params_List(s *capnp.Segment, sz int32) (NodeService_opaqueLoginFinish_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}, sz) + return capnp.StructList[NodeService_opaqueLoginFinish_Params](l), err +} + +// NodeService_opaqueLoginFinish_Params_Future is a wrapper for a NodeService_opaqueLoginFinish_Params promised by a client call. +type NodeService_opaqueLoginFinish_Params_Future struct{ *capnp.Future } + +func (f NodeService_opaqueLoginFinish_Params_Future) Struct() (NodeService_opaqueLoginFinish_Params, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueLoginFinish_Params(p.Struct()), err +} + +type NodeService_opaqueLoginFinish_Results capnp.Struct + +// NodeService_opaqueLoginFinish_Results_TypeID is the unique identifier for the type NodeService_opaqueLoginFinish_Results. +const NodeService_opaqueLoginFinish_Results_TypeID = 0xc8d76e76267b75eb + +func NewNodeService_opaqueLoginFinish_Results(s *capnp.Segment) (NodeService_opaqueLoginFinish_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueLoginFinish_Results(st), err +} + +func NewRootNodeService_opaqueLoginFinish_Results(s *capnp.Segment) (NodeService_opaqueLoginFinish_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_opaqueLoginFinish_Results(st), err +} + +func ReadRootNodeService_opaqueLoginFinish_Results(msg *capnp.Message) (NodeService_opaqueLoginFinish_Results, error) { + root, err := msg.Root() + return NodeService_opaqueLoginFinish_Results(root.Struct()), err +} + +func (s NodeService_opaqueLoginFinish_Results) String() string { + str, _ := text.Marshal(0xc8d76e76267b75eb, capnp.Struct(s)) + return str +} + +func (s NodeService_opaqueLoginFinish_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_opaqueLoginFinish_Results) DecodeFromPtr(p capnp.Ptr) NodeService_opaqueLoginFinish_Results { + return NodeService_opaqueLoginFinish_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_opaqueLoginFinish_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_opaqueLoginFinish_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_opaqueLoginFinish_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_opaqueLoginFinish_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_opaqueLoginFinish_Results) SessionToken() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_opaqueLoginFinish_Results) HasSessionToken() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_opaqueLoginFinish_Results) SetSessionToken(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_opaqueLoginFinish_Results_List is a list of NodeService_opaqueLoginFinish_Results. +type NodeService_opaqueLoginFinish_Results_List = capnp.StructList[NodeService_opaqueLoginFinish_Results] + +// NewNodeService_opaqueLoginFinish_Results creates a new list of NodeService_opaqueLoginFinish_Results. +func NewNodeService_opaqueLoginFinish_Results_List(s *capnp.Segment, sz int32) (NodeService_opaqueLoginFinish_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_opaqueLoginFinish_Results](l), err +} + +// NodeService_opaqueLoginFinish_Results_Future is a wrapper for a NodeService_opaqueLoginFinish_Results promised by a client call. +type NodeService_opaqueLoginFinish_Results_Future struct{ *capnp.Future } + +func (f NodeService_opaqueLoginFinish_Results_Future) Struct() (NodeService_opaqueLoginFinish_Results, error) { + p, err := f.Future.Ptr() + return NodeService_opaqueLoginFinish_Results(p.Struct()), err +} + +type NodeService_publishEndpoint_Params capnp.Struct + +// NodeService_publishEndpoint_Params_TypeID is the unique identifier for the type NodeService_publishEndpoint_Params. +const NodeService_publishEndpoint_Params_TypeID = 0x8ddd3f961acd95e7 + +func NewNodeService_publishEndpoint_Params(s *capnp.Segment) (NodeService_publishEndpoint_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_publishEndpoint_Params(st), err +} + +func NewRootNodeService_publishEndpoint_Params(s *capnp.Segment) (NodeService_publishEndpoint_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return NodeService_publishEndpoint_Params(st), err +} + +func ReadRootNodeService_publishEndpoint_Params(msg *capnp.Message) (NodeService_publishEndpoint_Params, error) { + root, err := msg.Root() + return NodeService_publishEndpoint_Params(root.Struct()), err +} + +func (s NodeService_publishEndpoint_Params) String() string { + str, _ := text.Marshal(0x8ddd3f961acd95e7, capnp.Struct(s)) + return str +} + +func (s NodeService_publishEndpoint_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_publishEndpoint_Params) DecodeFromPtr(p capnp.Ptr) NodeService_publishEndpoint_Params { + return NodeService_publishEndpoint_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_publishEndpoint_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_publishEndpoint_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_publishEndpoint_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_publishEndpoint_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_publishEndpoint_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_publishEndpoint_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_publishEndpoint_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_publishEndpoint_Params) NodeAddr() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_publishEndpoint_Params) HasNodeAddr() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_publishEndpoint_Params) SetNodeAddr(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_publishEndpoint_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(2) + return Auth(p.Struct()), err +} + +func (s NodeService_publishEndpoint_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_publishEndpoint_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(2, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_publishEndpoint_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(2, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_publishEndpoint_Params_List is a list of NodeService_publishEndpoint_Params. +type NodeService_publishEndpoint_Params_List = capnp.StructList[NodeService_publishEndpoint_Params] + +// NewNodeService_publishEndpoint_Params creates a new list of NodeService_publishEndpoint_Params. +func NewNodeService_publishEndpoint_Params_List(s *capnp.Segment, sz int32) (NodeService_publishEndpoint_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}, sz) + return capnp.StructList[NodeService_publishEndpoint_Params](l), err +} + +// NodeService_publishEndpoint_Params_Future is a wrapper for a NodeService_publishEndpoint_Params promised by a client call. +type NodeService_publishEndpoint_Params_Future struct{ *capnp.Future } + +func (f NodeService_publishEndpoint_Params_Future) Struct() (NodeService_publishEndpoint_Params, error) { + p, err := f.Future.Ptr() + return NodeService_publishEndpoint_Params(p.Struct()), err +} +func (p NodeService_publishEndpoint_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(2, nil)} +} + +type NodeService_publishEndpoint_Results capnp.Struct + +// NodeService_publishEndpoint_Results_TypeID is the unique identifier for the type NodeService_publishEndpoint_Results. +const NodeService_publishEndpoint_Results_TypeID = 0x9f469f806813a4ad + +func NewNodeService_publishEndpoint_Results(s *capnp.Segment) (NodeService_publishEndpoint_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_publishEndpoint_Results(st), err +} + +func NewRootNodeService_publishEndpoint_Results(s *capnp.Segment) (NodeService_publishEndpoint_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_publishEndpoint_Results(st), err +} + +func ReadRootNodeService_publishEndpoint_Results(msg *capnp.Message) (NodeService_publishEndpoint_Results, error) { + root, err := msg.Root() + return NodeService_publishEndpoint_Results(root.Struct()), err +} + +func (s NodeService_publishEndpoint_Results) String() string { + str, _ := text.Marshal(0x9f469f806813a4ad, capnp.Struct(s)) + return str +} + +func (s NodeService_publishEndpoint_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_publishEndpoint_Results) DecodeFromPtr(p capnp.Ptr) NodeService_publishEndpoint_Results { + return NodeService_publishEndpoint_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_publishEndpoint_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_publishEndpoint_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_publishEndpoint_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_publishEndpoint_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} + +// NodeService_publishEndpoint_Results_List is a list of NodeService_publishEndpoint_Results. +type NodeService_publishEndpoint_Results_List = capnp.StructList[NodeService_publishEndpoint_Results] + +// NewNodeService_publishEndpoint_Results creates a new list of NodeService_publishEndpoint_Results. +func NewNodeService_publishEndpoint_Results_List(s *capnp.Segment, sz int32) (NodeService_publishEndpoint_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz) + return capnp.StructList[NodeService_publishEndpoint_Results](l), err +} + +// NodeService_publishEndpoint_Results_Future is a wrapper for a NodeService_publishEndpoint_Results promised by a client call. +type NodeService_publishEndpoint_Results_Future struct{ *capnp.Future } + +func (f NodeService_publishEndpoint_Results_Future) Struct() (NodeService_publishEndpoint_Results, error) { + p, err := f.Future.Ptr() + return NodeService_publishEndpoint_Results(p.Struct()), err +} + +type NodeService_resolveEndpoint_Params capnp.Struct + +// NodeService_resolveEndpoint_Params_TypeID is the unique identifier for the type NodeService_resolveEndpoint_Params. +const NodeService_resolveEndpoint_Params_TypeID = 0xb697835d0f54628d + +func NewNodeService_resolveEndpoint_Params(s *capnp.Segment) (NodeService_resolveEndpoint_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveEndpoint_Params(st), err +} + +func NewRootNodeService_resolveEndpoint_Params(s *capnp.Segment) (NodeService_resolveEndpoint_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveEndpoint_Params(st), err +} + +func ReadRootNodeService_resolveEndpoint_Params(msg *capnp.Message) (NodeService_resolveEndpoint_Params, error) { + root, err := msg.Root() + return NodeService_resolveEndpoint_Params(root.Struct()), err +} + +func (s NodeService_resolveEndpoint_Params) String() string { + str, _ := text.Marshal(0xb697835d0f54628d, capnp.Struct(s)) + return str +} + +func (s NodeService_resolveEndpoint_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_resolveEndpoint_Params) DecodeFromPtr(p capnp.Ptr) NodeService_resolveEndpoint_Params { + return NodeService_resolveEndpoint_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_resolveEndpoint_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_resolveEndpoint_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_resolveEndpoint_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_resolveEndpoint_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_resolveEndpoint_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_resolveEndpoint_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_resolveEndpoint_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_resolveEndpoint_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(1) + return Auth(p.Struct()), err +} + +func (s NodeService_resolveEndpoint_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_resolveEndpoint_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(1, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_resolveEndpoint_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_resolveEndpoint_Params_List is a list of NodeService_resolveEndpoint_Params. +type NodeService_resolveEndpoint_Params_List = capnp.StructList[NodeService_resolveEndpoint_Params] + +// NewNodeService_resolveEndpoint_Params creates a new list of NodeService_resolveEndpoint_Params. +func NewNodeService_resolveEndpoint_Params_List(s *capnp.Segment, sz int32) (NodeService_resolveEndpoint_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_resolveEndpoint_Params](l), err +} + +// NodeService_resolveEndpoint_Params_Future is a wrapper for a NodeService_resolveEndpoint_Params promised by a client call. +type NodeService_resolveEndpoint_Params_Future struct{ *capnp.Future } + +func (f NodeService_resolveEndpoint_Params_Future) Struct() (NodeService_resolveEndpoint_Params, error) { + p, err := f.Future.Ptr() + return NodeService_resolveEndpoint_Params(p.Struct()), err +} +func (p NodeService_resolveEndpoint_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(1, nil)} +} + +type NodeService_resolveEndpoint_Results capnp.Struct + +// NodeService_resolveEndpoint_Results_TypeID is the unique identifier for the type NodeService_resolveEndpoint_Results. +const NodeService_resolveEndpoint_Results_TypeID = 0x814258f2fea3d10c + +func NewNodeService_resolveEndpoint_Results(s *capnp.Segment) (NodeService_resolveEndpoint_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_resolveEndpoint_Results(st), err +} + +func NewRootNodeService_resolveEndpoint_Results(s *capnp.Segment) (NodeService_resolveEndpoint_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_resolveEndpoint_Results(st), err +} + +func ReadRootNodeService_resolveEndpoint_Results(msg *capnp.Message) (NodeService_resolveEndpoint_Results, error) { + root, err := msg.Root() + return NodeService_resolveEndpoint_Results(root.Struct()), err +} + +func (s NodeService_resolveEndpoint_Results) String() string { + str, _ := text.Marshal(0x814258f2fea3d10c, capnp.Struct(s)) + return str +} + +func (s NodeService_resolveEndpoint_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_resolveEndpoint_Results) DecodeFromPtr(p capnp.Ptr) NodeService_resolveEndpoint_Results { + return NodeService_resolveEndpoint_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_resolveEndpoint_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_resolveEndpoint_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_resolveEndpoint_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_resolveEndpoint_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_resolveEndpoint_Results) NodeAddr() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_resolveEndpoint_Results) HasNodeAddr() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_resolveEndpoint_Results) SetNodeAddr(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_resolveEndpoint_Results_List is a list of NodeService_resolveEndpoint_Results. +type NodeService_resolveEndpoint_Results_List = capnp.StructList[NodeService_resolveEndpoint_Results] + +// NewNodeService_resolveEndpoint_Results creates a new list of NodeService_resolveEndpoint_Results. +func NewNodeService_resolveEndpoint_Results_List(s *capnp.Segment, sz int32) (NodeService_resolveEndpoint_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_resolveEndpoint_Results](l), err +} + +// NodeService_resolveEndpoint_Results_Future is a wrapper for a NodeService_resolveEndpoint_Results promised by a client call. +type NodeService_resolveEndpoint_Results_Future struct{ *capnp.Future } + +func (f NodeService_resolveEndpoint_Results_Future) Struct() (NodeService_resolveEndpoint_Results, error) { + p, err := f.Future.Ptr() + return NodeService_resolveEndpoint_Results(p.Struct()), err +} + +type NodeService_peek_Params capnp.Struct + +// NodeService_peek_Params_TypeID is the unique identifier for the type NodeService_peek_Params. +const NodeService_peek_Params_TypeID = 0x9dacf0737086d8ec + +func NewNodeService_peek_Params(s *capnp.Segment) (NodeService_peek_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}) + return NodeService_peek_Params(st), err +} + +func NewRootNodeService_peek_Params(s *capnp.Segment) (NodeService_peek_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}) + return NodeService_peek_Params(st), err +} + +func ReadRootNodeService_peek_Params(msg *capnp.Message) (NodeService_peek_Params, error) { + root, err := msg.Root() + return NodeService_peek_Params(root.Struct()), err +} + +func (s NodeService_peek_Params) String() string { + str, _ := text.Marshal(0x9dacf0737086d8ec, capnp.Struct(s)) + return str +} + +func (s NodeService_peek_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_peek_Params) DecodeFromPtr(p capnp.Ptr) NodeService_peek_Params { + return NodeService_peek_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_peek_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_peek_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_peek_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_peek_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_peek_Params) RecipientKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_peek_Params) HasRecipientKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_peek_Params) SetRecipientKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_peek_Params) ChannelId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_peek_Params) HasChannelId() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_peek_Params) SetChannelId(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_peek_Params) Version() uint16 { + return capnp.Struct(s).Uint16(0) +} + +func (s NodeService_peek_Params) SetVersion(v uint16) { + capnp.Struct(s).SetUint16(0, v) +} + +func (s NodeService_peek_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(2) + return Auth(p.Struct()), err +} + +func (s NodeService_peek_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_peek_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(2, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_peek_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(2, capnp.Struct(ss).ToPtr()) + return ss, err +} + +func (s NodeService_peek_Params) Limit() uint32 { + return capnp.Struct(s).Uint32(4) +} + +func (s NodeService_peek_Params) SetLimit(v uint32) { + capnp.Struct(s).SetUint32(4, v) +} + +// NodeService_peek_Params_List is a list of NodeService_peek_Params. +type NodeService_peek_Params_List = capnp.StructList[NodeService_peek_Params] + +// NewNodeService_peek_Params creates a new list of NodeService_peek_Params. +func NewNodeService_peek_Params_List(s *capnp.Segment, sz int32) (NodeService_peek_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}, sz) + return capnp.StructList[NodeService_peek_Params](l), err +} + +// NodeService_peek_Params_Future is a wrapper for a NodeService_peek_Params promised by a client call. +type NodeService_peek_Params_Future struct{ *capnp.Future } + +func (f NodeService_peek_Params_Future) Struct() (NodeService_peek_Params, error) { + p, err := f.Future.Ptr() + return NodeService_peek_Params(p.Struct()), err +} +func (p NodeService_peek_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(2, nil)} +} + +type NodeService_peek_Results capnp.Struct + +// NodeService_peek_Results_TypeID is the unique identifier for the type NodeService_peek_Results. +const NodeService_peek_Results_TypeID = 0xc19ff4cf0dd1c4f9 + +func NewNodeService_peek_Results(s *capnp.Segment) (NodeService_peek_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_peek_Results(st), err +} + +func NewRootNodeService_peek_Results(s *capnp.Segment) (NodeService_peek_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_peek_Results(st), err +} + +func ReadRootNodeService_peek_Results(msg *capnp.Message) (NodeService_peek_Results, error) { + root, err := msg.Root() + return NodeService_peek_Results(root.Struct()), err +} + +func (s NodeService_peek_Results) String() string { + str, _ := text.Marshal(0xc19ff4cf0dd1c4f9, capnp.Struct(s)) + return str +} + +func (s NodeService_peek_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_peek_Results) DecodeFromPtr(p capnp.Ptr) NodeService_peek_Results { + return NodeService_peek_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_peek_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_peek_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_peek_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_peek_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_peek_Results) Payloads() (Envelope_List, error) { + p, err := capnp.Struct(s).Ptr(0) + return Envelope_List(p.List()), err +} + +func (s NodeService_peek_Results) HasPayloads() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_peek_Results) SetPayloads(v Envelope_List) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewPayloads sets the payloads field to a newly +// allocated Envelope_List, preferring placement in s's segment. +func (s NodeService_peek_Results) NewPayloads(n int32) (Envelope_List, error) { + l, err := NewEnvelope_List(capnp.Struct(s).Segment(), n) + if err != nil { + return Envelope_List{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} + +// NodeService_peek_Results_List is a list of NodeService_peek_Results. +type NodeService_peek_Results_List = capnp.StructList[NodeService_peek_Results] + +// NewNodeService_peek_Results creates a new list of NodeService_peek_Results. +func NewNodeService_peek_Results_List(s *capnp.Segment, sz int32) (NodeService_peek_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_peek_Results](l), err +} + +// NodeService_peek_Results_Future is a wrapper for a NodeService_peek_Results promised by a client call. +type NodeService_peek_Results_Future struct{ *capnp.Future } + +func (f NodeService_peek_Results_Future) Struct() (NodeService_peek_Results, error) { + p, err := f.Future.Ptr() + return NodeService_peek_Results(p.Struct()), err +} + +type NodeService_ack_Params capnp.Struct + +// NodeService_ack_Params_TypeID is the unique identifier for the type NodeService_ack_Params. +const NodeService_ack_Params_TypeID = 0xe9db52f622c9c77c + +func NewNodeService_ack_Params(s *capnp.Segment) (NodeService_ack_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 3}) + return NodeService_ack_Params(st), err +} + +func NewRootNodeService_ack_Params(s *capnp.Segment) (NodeService_ack_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 3}) + return NodeService_ack_Params(st), err +} + +func ReadRootNodeService_ack_Params(msg *capnp.Message) (NodeService_ack_Params, error) { + root, err := msg.Root() + return NodeService_ack_Params(root.Struct()), err +} + +func (s NodeService_ack_Params) String() string { + str, _ := text.Marshal(0xe9db52f622c9c77c, capnp.Struct(s)) + return str +} + +func (s NodeService_ack_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_ack_Params) DecodeFromPtr(p capnp.Ptr) NodeService_ack_Params { + return NodeService_ack_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_ack_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_ack_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_ack_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_ack_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_ack_Params) RecipientKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_ack_Params) HasRecipientKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_ack_Params) SetRecipientKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_ack_Params) ChannelId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_ack_Params) HasChannelId() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_ack_Params) SetChannelId(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_ack_Params) Version() uint16 { + return capnp.Struct(s).Uint16(0) +} + +func (s NodeService_ack_Params) SetVersion(v uint16) { + capnp.Struct(s).SetUint16(0, v) +} + +func (s NodeService_ack_Params) SeqUpTo() uint64 { + return capnp.Struct(s).Uint64(8) +} + +func (s NodeService_ack_Params) SetSeqUpTo(v uint64) { + capnp.Struct(s).SetUint64(8, v) +} + +func (s NodeService_ack_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(2) + return Auth(p.Struct()), err +} + +func (s NodeService_ack_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_ack_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(2, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_ack_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(2, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_ack_Params_List is a list of NodeService_ack_Params. +type NodeService_ack_Params_List = capnp.StructList[NodeService_ack_Params] + +// NewNodeService_ack_Params creates a new list of NodeService_ack_Params. +func NewNodeService_ack_Params_List(s *capnp.Segment, sz int32) (NodeService_ack_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 3}, sz) + return capnp.StructList[NodeService_ack_Params](l), err +} + +// NodeService_ack_Params_Future is a wrapper for a NodeService_ack_Params promised by a client call. +type NodeService_ack_Params_Future struct{ *capnp.Future } + +func (f NodeService_ack_Params_Future) Struct() (NodeService_ack_Params, error) { + p, err := f.Future.Ptr() + return NodeService_ack_Params(p.Struct()), err +} +func (p NodeService_ack_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(2, nil)} +} + +type NodeService_ack_Results capnp.Struct + +// NodeService_ack_Results_TypeID is the unique identifier for the type NodeService_ack_Results. +const NodeService_ack_Results_TypeID = 0xa9b2ba2ca8ce656b + +func NewNodeService_ack_Results(s *capnp.Segment) (NodeService_ack_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_ack_Results(st), err +} + +func NewRootNodeService_ack_Results(s *capnp.Segment) (NodeService_ack_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return NodeService_ack_Results(st), err +} + +func ReadRootNodeService_ack_Results(msg *capnp.Message) (NodeService_ack_Results, error) { + root, err := msg.Root() + return NodeService_ack_Results(root.Struct()), err +} + +func (s NodeService_ack_Results) String() string { + str, _ := text.Marshal(0xa9b2ba2ca8ce656b, capnp.Struct(s)) + return str +} + +func (s NodeService_ack_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_ack_Results) DecodeFromPtr(p capnp.Ptr) NodeService_ack_Results { + return NodeService_ack_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_ack_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_ack_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_ack_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_ack_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} + +// NodeService_ack_Results_List is a list of NodeService_ack_Results. +type NodeService_ack_Results_List = capnp.StructList[NodeService_ack_Results] + +// NewNodeService_ack_Results creates a new list of NodeService_ack_Results. +func NewNodeService_ack_Results_List(s *capnp.Segment, sz int32) (NodeService_ack_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz) + return capnp.StructList[NodeService_ack_Results](l), err +} + +// NodeService_ack_Results_Future is a wrapper for a NodeService_ack_Results promised by a client call. +type NodeService_ack_Results_Future struct{ *capnp.Future } + +func (f NodeService_ack_Results_Future) Struct() (NodeService_ack_Results, error) { + p, err := f.Future.Ptr() + return NodeService_ack_Results(p.Struct()), err +} + +type NodeService_fetchHybridKeys_Params capnp.Struct + +// NodeService_fetchHybridKeys_Params_TypeID is the unique identifier for the type NodeService_fetchHybridKeys_Params. +const NodeService_fetchHybridKeys_Params_TypeID = 0xee24b28dc81f6a06 + +func NewNodeService_fetchHybridKeys_Params(s *capnp.Segment) (NodeService_fetchHybridKeys_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_fetchHybridKeys_Params(st), err +} + +func NewRootNodeService_fetchHybridKeys_Params(s *capnp.Segment) (NodeService_fetchHybridKeys_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_fetchHybridKeys_Params(st), err +} + +func ReadRootNodeService_fetchHybridKeys_Params(msg *capnp.Message) (NodeService_fetchHybridKeys_Params, error) { + root, err := msg.Root() + return NodeService_fetchHybridKeys_Params(root.Struct()), err +} + +func (s NodeService_fetchHybridKeys_Params) String() string { + str, _ := text.Marshal(0xee24b28dc81f6a06, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchHybridKeys_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchHybridKeys_Params) DecodeFromPtr(p capnp.Ptr) NodeService_fetchHybridKeys_Params { + return NodeService_fetchHybridKeys_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchHybridKeys_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchHybridKeys_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchHybridKeys_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchHybridKeys_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchHybridKeys_Params) IdentityKeys() (capnp.DataList, error) { + p, err := capnp.Struct(s).Ptr(0) + return capnp.DataList(p.List()), err +} + +func (s NodeService_fetchHybridKeys_Params) HasIdentityKeys() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchHybridKeys_Params) SetIdentityKeys(v capnp.DataList) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewIdentityKeys sets the identityKeys field to a newly +// allocated capnp.DataList, preferring placement in s's segment. +func (s NodeService_fetchHybridKeys_Params) NewIdentityKeys(n int32) (capnp.DataList, error) { + l, err := capnp.NewDataList(capnp.Struct(s).Segment(), n) + if err != nil { + return capnp.DataList{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} +func (s NodeService_fetchHybridKeys_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(1) + return Auth(p.Struct()), err +} + +func (s NodeService_fetchHybridKeys_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_fetchHybridKeys_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(1, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_fetchHybridKeys_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_fetchHybridKeys_Params_List is a list of NodeService_fetchHybridKeys_Params. +type NodeService_fetchHybridKeys_Params_List = capnp.StructList[NodeService_fetchHybridKeys_Params] + +// NewNodeService_fetchHybridKeys_Params creates a new list of NodeService_fetchHybridKeys_Params. +func NewNodeService_fetchHybridKeys_Params_List(s *capnp.Segment, sz int32) (NodeService_fetchHybridKeys_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_fetchHybridKeys_Params](l), err +} + +// NodeService_fetchHybridKeys_Params_Future is a wrapper for a NodeService_fetchHybridKeys_Params promised by a client call. +type NodeService_fetchHybridKeys_Params_Future struct{ *capnp.Future } + +func (f NodeService_fetchHybridKeys_Params_Future) Struct() (NodeService_fetchHybridKeys_Params, error) { + p, err := f.Future.Ptr() + return NodeService_fetchHybridKeys_Params(p.Struct()), err +} +func (p NodeService_fetchHybridKeys_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(1, nil)} +} + +type NodeService_fetchHybridKeys_Results capnp.Struct + +// NodeService_fetchHybridKeys_Results_TypeID is the unique identifier for the type NodeService_fetchHybridKeys_Results. +const NodeService_fetchHybridKeys_Results_TypeID = 0xd716be5fe0ab54f6 + +func NewNodeService_fetchHybridKeys_Results(s *capnp.Segment) (NodeService_fetchHybridKeys_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchHybridKeys_Results(st), err +} + +func NewRootNodeService_fetchHybridKeys_Results(s *capnp.Segment) (NodeService_fetchHybridKeys_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_fetchHybridKeys_Results(st), err +} + +func ReadRootNodeService_fetchHybridKeys_Results(msg *capnp.Message) (NodeService_fetchHybridKeys_Results, error) { + root, err := msg.Root() + return NodeService_fetchHybridKeys_Results(root.Struct()), err +} + +func (s NodeService_fetchHybridKeys_Results) String() string { + str, _ := text.Marshal(0xd716be5fe0ab54f6, capnp.Struct(s)) + return str +} + +func (s NodeService_fetchHybridKeys_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_fetchHybridKeys_Results) DecodeFromPtr(p capnp.Ptr) NodeService_fetchHybridKeys_Results { + return NodeService_fetchHybridKeys_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_fetchHybridKeys_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_fetchHybridKeys_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_fetchHybridKeys_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_fetchHybridKeys_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_fetchHybridKeys_Results) Keys() (capnp.DataList, error) { + p, err := capnp.Struct(s).Ptr(0) + return capnp.DataList(p.List()), err +} + +func (s NodeService_fetchHybridKeys_Results) HasKeys() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_fetchHybridKeys_Results) SetKeys(v capnp.DataList) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewKeys sets the keys field to a newly +// allocated capnp.DataList, preferring placement in s's segment. +func (s NodeService_fetchHybridKeys_Results) NewKeys(n int32) (capnp.DataList, error) { + l, err := capnp.NewDataList(capnp.Struct(s).Segment(), n) + if err != nil { + return capnp.DataList{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} + +// NodeService_fetchHybridKeys_Results_List is a list of NodeService_fetchHybridKeys_Results. +type NodeService_fetchHybridKeys_Results_List = capnp.StructList[NodeService_fetchHybridKeys_Results] + +// NewNodeService_fetchHybridKeys_Results creates a new list of NodeService_fetchHybridKeys_Results. +func NewNodeService_fetchHybridKeys_Results_List(s *capnp.Segment, sz int32) (NodeService_fetchHybridKeys_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_fetchHybridKeys_Results](l), err +} + +// NodeService_fetchHybridKeys_Results_Future is a wrapper for a NodeService_fetchHybridKeys_Results promised by a client call. +type NodeService_fetchHybridKeys_Results_Future struct{ *capnp.Future } + +func (f NodeService_fetchHybridKeys_Results_Future) Struct() (NodeService_fetchHybridKeys_Results, error) { + p, err := f.Future.Ptr() + return NodeService_fetchHybridKeys_Results(p.Struct()), err +} + +type NodeService_batchEnqueue_Params capnp.Struct + +// NodeService_batchEnqueue_Params_TypeID is the unique identifier for the type NodeService_batchEnqueue_Params. +const NodeService_batchEnqueue_Params_TypeID = 0xbaa7ce3374792046 + +func NewNodeService_batchEnqueue_Params(s *capnp.Segment) (NodeService_batchEnqueue_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}) + return NodeService_batchEnqueue_Params(st), err +} + +func NewRootNodeService_batchEnqueue_Params(s *capnp.Segment) (NodeService_batchEnqueue_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}) + return NodeService_batchEnqueue_Params(st), err +} + +func ReadRootNodeService_batchEnqueue_Params(msg *capnp.Message) (NodeService_batchEnqueue_Params, error) { + root, err := msg.Root() + return NodeService_batchEnqueue_Params(root.Struct()), err +} + +func (s NodeService_batchEnqueue_Params) String() string { + str, _ := text.Marshal(0xbaa7ce3374792046, capnp.Struct(s)) + return str +} + +func (s NodeService_batchEnqueue_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_batchEnqueue_Params) DecodeFromPtr(p capnp.Ptr) NodeService_batchEnqueue_Params { + return NodeService_batchEnqueue_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_batchEnqueue_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_batchEnqueue_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_batchEnqueue_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_batchEnqueue_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_batchEnqueue_Params) RecipientKeys() (capnp.DataList, error) { + p, err := capnp.Struct(s).Ptr(0) + return capnp.DataList(p.List()), err +} + +func (s NodeService_batchEnqueue_Params) HasRecipientKeys() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_batchEnqueue_Params) SetRecipientKeys(v capnp.DataList) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewRecipientKeys sets the recipientKeys field to a newly +// allocated capnp.DataList, preferring placement in s's segment. +func (s NodeService_batchEnqueue_Params) NewRecipientKeys(n int32) (capnp.DataList, error) { + l, err := capnp.NewDataList(capnp.Struct(s).Segment(), n) + if err != nil { + return capnp.DataList{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} +func (s NodeService_batchEnqueue_Params) Payload() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_batchEnqueue_Params) HasPayload() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_batchEnqueue_Params) SetPayload(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_batchEnqueue_Params) ChannelId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(2) + return []byte(p.Data()), err +} + +func (s NodeService_batchEnqueue_Params) HasChannelId() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_batchEnqueue_Params) SetChannelId(v []byte) error { + return capnp.Struct(s).SetData(2, v) +} + +func (s NodeService_batchEnqueue_Params) Version() uint16 { + return capnp.Struct(s).Uint16(0) +} + +func (s NodeService_batchEnqueue_Params) SetVersion(v uint16) { + capnp.Struct(s).SetUint16(0, v) +} + +func (s NodeService_batchEnqueue_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(3) + return Auth(p.Struct()), err +} + +func (s NodeService_batchEnqueue_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(3) +} + +func (s NodeService_batchEnqueue_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(3, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_batchEnqueue_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(3, capnp.Struct(ss).ToPtr()) + return ss, err +} + +func (s NodeService_batchEnqueue_Params) TtlSecs() uint32 { + return capnp.Struct(s).Uint32(4) +} + +func (s NodeService_batchEnqueue_Params) SetTtlSecs(v uint32) { + capnp.Struct(s).SetUint32(4, v) +} + +// NodeService_batchEnqueue_Params_List is a list of NodeService_batchEnqueue_Params. +type NodeService_batchEnqueue_Params_List = capnp.StructList[NodeService_batchEnqueue_Params] + +// NewNodeService_batchEnqueue_Params creates a new list of NodeService_batchEnqueue_Params. +func NewNodeService_batchEnqueue_Params_List(s *capnp.Segment, sz int32) (NodeService_batchEnqueue_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}, sz) + return capnp.StructList[NodeService_batchEnqueue_Params](l), err +} + +// NodeService_batchEnqueue_Params_Future is a wrapper for a NodeService_batchEnqueue_Params promised by a client call. +type NodeService_batchEnqueue_Params_Future struct{ *capnp.Future } + +func (f NodeService_batchEnqueue_Params_Future) Struct() (NodeService_batchEnqueue_Params, error) { + p, err := f.Future.Ptr() + return NodeService_batchEnqueue_Params(p.Struct()), err +} +func (p NodeService_batchEnqueue_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(3, nil)} +} + +type NodeService_batchEnqueue_Results capnp.Struct + +// NodeService_batchEnqueue_Results_TypeID is the unique identifier for the type NodeService_batchEnqueue_Results. +const NodeService_batchEnqueue_Results_TypeID = 0x8e19455d44fa2478 + +func NewNodeService_batchEnqueue_Results(s *capnp.Segment) (NodeService_batchEnqueue_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_batchEnqueue_Results(st), err +} + +func NewRootNodeService_batchEnqueue_Results(s *capnp.Segment) (NodeService_batchEnqueue_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_batchEnqueue_Results(st), err +} + +func ReadRootNodeService_batchEnqueue_Results(msg *capnp.Message) (NodeService_batchEnqueue_Results, error) { + root, err := msg.Root() + return NodeService_batchEnqueue_Results(root.Struct()), err +} + +func (s NodeService_batchEnqueue_Results) String() string { + str, _ := text.Marshal(0x8e19455d44fa2478, capnp.Struct(s)) + return str +} + +func (s NodeService_batchEnqueue_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_batchEnqueue_Results) DecodeFromPtr(p capnp.Ptr) NodeService_batchEnqueue_Results { + return NodeService_batchEnqueue_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_batchEnqueue_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_batchEnqueue_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_batchEnqueue_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_batchEnqueue_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_batchEnqueue_Results) Seqs() (capnp.UInt64List, error) { + p, err := capnp.Struct(s).Ptr(0) + return capnp.UInt64List(p.List()), err +} + +func (s NodeService_batchEnqueue_Results) HasSeqs() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_batchEnqueue_Results) SetSeqs(v capnp.UInt64List) error { + return capnp.Struct(s).SetPtr(0, v.ToPtr()) +} + +// NewSeqs sets the seqs field to a newly +// allocated capnp.UInt64List, preferring placement in s's segment. +func (s NodeService_batchEnqueue_Results) NewSeqs(n int32) (capnp.UInt64List, error) { + l, err := capnp.NewUInt64List(capnp.Struct(s).Segment(), n) + if err != nil { + return capnp.UInt64List{}, err + } + err = capnp.Struct(s).SetPtr(0, l.ToPtr()) + return l, err +} + +// NodeService_batchEnqueue_Results_List is a list of NodeService_batchEnqueue_Results. +type NodeService_batchEnqueue_Results_List = capnp.StructList[NodeService_batchEnqueue_Results] + +// NewNodeService_batchEnqueue_Results creates a new list of NodeService_batchEnqueue_Results. +func NewNodeService_batchEnqueue_Results_List(s *capnp.Segment, sz int32) (NodeService_batchEnqueue_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_batchEnqueue_Results](l), err +} + +// NodeService_batchEnqueue_Results_Future is a wrapper for a NodeService_batchEnqueue_Results promised by a client call. +type NodeService_batchEnqueue_Results_Future struct{ *capnp.Future } + +func (f NodeService_batchEnqueue_Results_Future) Struct() (NodeService_batchEnqueue_Results, error) { + p, err := f.Future.Ptr() + return NodeService_batchEnqueue_Results(p.Struct()), err +} + +type NodeService_createChannel_Params capnp.Struct + +// NodeService_createChannel_Params_TypeID is the unique identifier for the type NodeService_createChannel_Params. +const NodeService_createChannel_Params_TypeID = 0xf6195fabb2410a83 + +func NewNodeService_createChannel_Params(s *capnp.Segment) (NodeService_createChannel_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_createChannel_Params(st), err +} + +func NewRootNodeService_createChannel_Params(s *capnp.Segment) (NodeService_createChannel_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_createChannel_Params(st), err +} + +func ReadRootNodeService_createChannel_Params(msg *capnp.Message) (NodeService_createChannel_Params, error) { + root, err := msg.Root() + return NodeService_createChannel_Params(root.Struct()), err +} + +func (s NodeService_createChannel_Params) String() string { + str, _ := text.Marshal(0xf6195fabb2410a83, capnp.Struct(s)) + return str +} + +func (s NodeService_createChannel_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_createChannel_Params) DecodeFromPtr(p capnp.Ptr) NodeService_createChannel_Params { + return NodeService_createChannel_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_createChannel_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_createChannel_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_createChannel_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_createChannel_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_createChannel_Params) PeerKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_createChannel_Params) HasPeerKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_createChannel_Params) SetPeerKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_createChannel_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(1) + return Auth(p.Struct()), err +} + +func (s NodeService_createChannel_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_createChannel_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(1, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_createChannel_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_createChannel_Params_List is a list of NodeService_createChannel_Params. +type NodeService_createChannel_Params_List = capnp.StructList[NodeService_createChannel_Params] + +// NewNodeService_createChannel_Params creates a new list of NodeService_createChannel_Params. +func NewNodeService_createChannel_Params_List(s *capnp.Segment, sz int32) (NodeService_createChannel_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_createChannel_Params](l), err +} + +// NodeService_createChannel_Params_Future is a wrapper for a NodeService_createChannel_Params promised by a client call. +type NodeService_createChannel_Params_Future struct{ *capnp.Future } + +func (f NodeService_createChannel_Params_Future) Struct() (NodeService_createChannel_Params, error) { + p, err := f.Future.Ptr() + return NodeService_createChannel_Params(p.Struct()), err +} +func (p NodeService_createChannel_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(1, nil)} +} + +type NodeService_createChannel_Results capnp.Struct + +// NodeService_createChannel_Results_TypeID is the unique identifier for the type NodeService_createChannel_Results. +const NodeService_createChannel_Results_TypeID = 0xf2da78ca4f9a7406 + +func NewNodeService_createChannel_Results(s *capnp.Segment) (NodeService_createChannel_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return NodeService_createChannel_Results(st), err +} + +func NewRootNodeService_createChannel_Results(s *capnp.Segment) (NodeService_createChannel_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return NodeService_createChannel_Results(st), err +} + +func ReadRootNodeService_createChannel_Results(msg *capnp.Message) (NodeService_createChannel_Results, error) { + root, err := msg.Root() + return NodeService_createChannel_Results(root.Struct()), err +} + +func (s NodeService_createChannel_Results) String() string { + str, _ := text.Marshal(0xf2da78ca4f9a7406, capnp.Struct(s)) + return str +} + +func (s NodeService_createChannel_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_createChannel_Results) DecodeFromPtr(p capnp.Ptr) NodeService_createChannel_Results { + return NodeService_createChannel_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_createChannel_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_createChannel_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_createChannel_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_createChannel_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_createChannel_Results) ChannelId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_createChannel_Results) HasChannelId() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_createChannel_Results) SetChannelId(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_createChannel_Results) WasNew() bool { + return capnp.Struct(s).Bit(0) +} + +func (s NodeService_createChannel_Results) SetWasNew(v bool) { + capnp.Struct(s).SetBit(0, v) +} + +// NodeService_createChannel_Results_List is a list of NodeService_createChannel_Results. +type NodeService_createChannel_Results_List = capnp.StructList[NodeService_createChannel_Results] + +// NewNodeService_createChannel_Results creates a new list of NodeService_createChannel_Results. +func NewNodeService_createChannel_Results_List(s *capnp.Segment, sz int32) (NodeService_createChannel_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return capnp.StructList[NodeService_createChannel_Results](l), err +} + +// NodeService_createChannel_Results_Future is a wrapper for a NodeService_createChannel_Results promised by a client call. +type NodeService_createChannel_Results_Future struct{ *capnp.Future } + +func (f NodeService_createChannel_Results_Future) Struct() (NodeService_createChannel_Results, error) { + p, err := f.Future.Ptr() + return NodeService_createChannel_Results(p.Struct()), err +} + +type NodeService_resolveUser_Params capnp.Struct + +// NodeService_resolveUser_Params_TypeID is the unique identifier for the type NodeService_resolveUser_Params. +const NodeService_resolveUser_Params_TypeID = 0xc773e44b4f078897 + +func NewNodeService_resolveUser_Params(s *capnp.Segment) (NodeService_resolveUser_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveUser_Params(st), err +} + +func NewRootNodeService_resolveUser_Params(s *capnp.Segment) (NodeService_resolveUser_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveUser_Params(st), err +} + +func ReadRootNodeService_resolveUser_Params(msg *capnp.Message) (NodeService_resolveUser_Params, error) { + root, err := msg.Root() + return NodeService_resolveUser_Params(root.Struct()), err +} + +func (s NodeService_resolveUser_Params) String() string { + str, _ := text.Marshal(0xc773e44b4f078897, capnp.Struct(s)) + return str +} + +func (s NodeService_resolveUser_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_resolveUser_Params) DecodeFromPtr(p capnp.Ptr) NodeService_resolveUser_Params { + return NodeService_resolveUser_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_resolveUser_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_resolveUser_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_resolveUser_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_resolveUser_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_resolveUser_Params) Username() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s NodeService_resolveUser_Params) HasUsername() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_resolveUser_Params) UsernameBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s NodeService_resolveUser_Params) SetUsername(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +func (s NodeService_resolveUser_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(1) + return Auth(p.Struct()), err +} + +func (s NodeService_resolveUser_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_resolveUser_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(1, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_resolveUser_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_resolveUser_Params_List is a list of NodeService_resolveUser_Params. +type NodeService_resolveUser_Params_List = capnp.StructList[NodeService_resolveUser_Params] + +// NewNodeService_resolveUser_Params creates a new list of NodeService_resolveUser_Params. +func NewNodeService_resolveUser_Params_List(s *capnp.Segment, sz int32) (NodeService_resolveUser_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_resolveUser_Params](l), err +} + +// NodeService_resolveUser_Params_Future is a wrapper for a NodeService_resolveUser_Params promised by a client call. +type NodeService_resolveUser_Params_Future struct{ *capnp.Future } + +func (f NodeService_resolveUser_Params_Future) Struct() (NodeService_resolveUser_Params, error) { + p, err := f.Future.Ptr() + return NodeService_resolveUser_Params(p.Struct()), err +} +func (p NodeService_resolveUser_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(1, nil)} +} + +type NodeService_resolveUser_Results capnp.Struct + +// NodeService_resolveUser_Results_TypeID is the unique identifier for the type NodeService_resolveUser_Results. +const NodeService_resolveUser_Results_TypeID = 0xaad03efac1c420b0 + +func NewNodeService_resolveUser_Results(s *capnp.Segment) (NodeService_resolveUser_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveUser_Results(st), err +} + +func NewRootNodeService_resolveUser_Results(s *capnp.Segment) (NodeService_resolveUser_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveUser_Results(st), err +} + +func ReadRootNodeService_resolveUser_Results(msg *capnp.Message) (NodeService_resolveUser_Results, error) { + root, err := msg.Root() + return NodeService_resolveUser_Results(root.Struct()), err +} + +func (s NodeService_resolveUser_Results) String() string { + str, _ := text.Marshal(0xaad03efac1c420b0, capnp.Struct(s)) + return str +} + +func (s NodeService_resolveUser_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_resolveUser_Results) DecodeFromPtr(p capnp.Ptr) NodeService_resolveUser_Results { + return NodeService_resolveUser_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_resolveUser_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_resolveUser_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_resolveUser_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_resolveUser_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_resolveUser_Results) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_resolveUser_Results) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_resolveUser_Results) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_resolveUser_Results) InclusionProof() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_resolveUser_Results) HasInclusionProof() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_resolveUser_Results) SetInclusionProof(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +// NodeService_resolveUser_Results_List is a list of NodeService_resolveUser_Results. +type NodeService_resolveUser_Results_List = capnp.StructList[NodeService_resolveUser_Results] + +// NewNodeService_resolveUser_Results creates a new list of NodeService_resolveUser_Results. +func NewNodeService_resolveUser_Results_List(s *capnp.Segment, sz int32) (NodeService_resolveUser_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_resolveUser_Results](l), err +} + +// NodeService_resolveUser_Results_Future is a wrapper for a NodeService_resolveUser_Results promised by a client call. +type NodeService_resolveUser_Results_Future struct{ *capnp.Future } + +func (f NodeService_resolveUser_Results_Future) Struct() (NodeService_resolveUser_Results, error) { + p, err := f.Future.Ptr() + return NodeService_resolveUser_Results(p.Struct()), err +} + +type NodeService_resolveIdentity_Params capnp.Struct + +// NodeService_resolveIdentity_Params_TypeID is the unique identifier for the type NodeService_resolveIdentity_Params. +const NodeService_resolveIdentity_Params_TypeID = 0xde2f0aaeba8f22af + +func NewNodeService_resolveIdentity_Params(s *capnp.Segment) (NodeService_resolveIdentity_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveIdentity_Params(st), err +} + +func NewRootNodeService_resolveIdentity_Params(s *capnp.Segment) (NodeService_resolveIdentity_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return NodeService_resolveIdentity_Params(st), err +} + +func ReadRootNodeService_resolveIdentity_Params(msg *capnp.Message) (NodeService_resolveIdentity_Params, error) { + root, err := msg.Root() + return NodeService_resolveIdentity_Params(root.Struct()), err +} + +func (s NodeService_resolveIdentity_Params) String() string { + str, _ := text.Marshal(0xde2f0aaeba8f22af, capnp.Struct(s)) + return str +} + +func (s NodeService_resolveIdentity_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_resolveIdentity_Params) DecodeFromPtr(p capnp.Ptr) NodeService_resolveIdentity_Params { + return NodeService_resolveIdentity_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_resolveIdentity_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_resolveIdentity_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_resolveIdentity_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_resolveIdentity_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_resolveIdentity_Params) IdentityKey() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_resolveIdentity_Params) HasIdentityKey() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_resolveIdentity_Params) SetIdentityKey(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_resolveIdentity_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(1) + return Auth(p.Struct()), err +} + +func (s NodeService_resolveIdentity_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_resolveIdentity_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(1, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_resolveIdentity_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(1, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_resolveIdentity_Params_List is a list of NodeService_resolveIdentity_Params. +type NodeService_resolveIdentity_Params_List = capnp.StructList[NodeService_resolveIdentity_Params] + +// NewNodeService_resolveIdentity_Params creates a new list of NodeService_resolveIdentity_Params. +func NewNodeService_resolveIdentity_Params_List(s *capnp.Segment, sz int32) (NodeService_resolveIdentity_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return capnp.StructList[NodeService_resolveIdentity_Params](l), err +} + +// NodeService_resolveIdentity_Params_Future is a wrapper for a NodeService_resolveIdentity_Params promised by a client call. +type NodeService_resolveIdentity_Params_Future struct{ *capnp.Future } + +func (f NodeService_resolveIdentity_Params_Future) Struct() (NodeService_resolveIdentity_Params, error) { + p, err := f.Future.Ptr() + return NodeService_resolveIdentity_Params(p.Struct()), err +} +func (p NodeService_resolveIdentity_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(1, nil)} +} + +type NodeService_resolveIdentity_Results capnp.Struct + +// NodeService_resolveIdentity_Results_TypeID is the unique identifier for the type NodeService_resolveIdentity_Results. +const NodeService_resolveIdentity_Results_TypeID = 0xa89c6c77f021438b + +func NewNodeService_resolveIdentity_Results(s *capnp.Segment) (NodeService_resolveIdentity_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_resolveIdentity_Results(st), err +} + +func NewRootNodeService_resolveIdentity_Results(s *capnp.Segment) (NodeService_resolveIdentity_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_resolveIdentity_Results(st), err +} + +func ReadRootNodeService_resolveIdentity_Results(msg *capnp.Message) (NodeService_resolveIdentity_Results, error) { + root, err := msg.Root() + return NodeService_resolveIdentity_Results(root.Struct()), err +} + +func (s NodeService_resolveIdentity_Results) String() string { + str, _ := text.Marshal(0xa89c6c77f021438b, capnp.Struct(s)) + return str +} + +func (s NodeService_resolveIdentity_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_resolveIdentity_Results) DecodeFromPtr(p capnp.Ptr) NodeService_resolveIdentity_Results { + return NodeService_resolveIdentity_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_resolveIdentity_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_resolveIdentity_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_resolveIdentity_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_resolveIdentity_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_resolveIdentity_Results) Username() (string, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.Text(), err +} + +func (s NodeService_resolveIdentity_Results) HasUsername() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_resolveIdentity_Results) UsernameBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return p.TextBytes(), err +} + +func (s NodeService_resolveIdentity_Results) SetUsername(v string) error { + return capnp.Struct(s).SetText(0, v) +} + +// NodeService_resolveIdentity_Results_List is a list of NodeService_resolveIdentity_Results. +type NodeService_resolveIdentity_Results_List = capnp.StructList[NodeService_resolveIdentity_Results] + +// NewNodeService_resolveIdentity_Results creates a new list of NodeService_resolveIdentity_Results. +func NewNodeService_resolveIdentity_Results_List(s *capnp.Segment, sz int32) (NodeService_resolveIdentity_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_resolveIdentity_Results](l), err +} + +// NodeService_resolveIdentity_Results_Future is a wrapper for a NodeService_resolveIdentity_Results promised by a client call. +type NodeService_resolveIdentity_Results_Future struct{ *capnp.Future } + +func (f NodeService_resolveIdentity_Results_Future) Struct() (NodeService_resolveIdentity_Results, error) { + p, err := f.Future.Ptr() + return NodeService_resolveIdentity_Results(p.Struct()), err +} + +type NodeService_uploadBlob_Params capnp.Struct + +// NodeService_uploadBlob_Params_TypeID is the unique identifier for the type NodeService_uploadBlob_Params. +const NodeService_uploadBlob_Params_TypeID = 0xc24f0481133e097d + +func NewNodeService_uploadBlob_Params(s *capnp.Segment) (NodeService_uploadBlob_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 4}) + return NodeService_uploadBlob_Params(st), err +} + +func NewRootNodeService_uploadBlob_Params(s *capnp.Segment) (NodeService_uploadBlob_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 4}) + return NodeService_uploadBlob_Params(st), err +} + +func ReadRootNodeService_uploadBlob_Params(msg *capnp.Message) (NodeService_uploadBlob_Params, error) { + root, err := msg.Root() + return NodeService_uploadBlob_Params(root.Struct()), err +} + +func (s NodeService_uploadBlob_Params) String() string { + str, _ := text.Marshal(0xc24f0481133e097d, capnp.Struct(s)) + return str +} + +func (s NodeService_uploadBlob_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_uploadBlob_Params) DecodeFromPtr(p capnp.Ptr) NodeService_uploadBlob_Params { + return NodeService_uploadBlob_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_uploadBlob_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_uploadBlob_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_uploadBlob_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_uploadBlob_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_uploadBlob_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(0) + return Auth(p.Struct()), err +} + +func (s NodeService_uploadBlob_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_uploadBlob_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(0, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_uploadBlob_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(0, capnp.Struct(ss).ToPtr()) + return ss, err +} + +func (s NodeService_uploadBlob_Params) BlobHash() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_uploadBlob_Params) HasBlobHash() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_uploadBlob_Params) SetBlobHash(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_uploadBlob_Params) Chunk() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(2) + return []byte(p.Data()), err +} + +func (s NodeService_uploadBlob_Params) HasChunk() bool { + return capnp.Struct(s).HasPtr(2) +} + +func (s NodeService_uploadBlob_Params) SetChunk(v []byte) error { + return capnp.Struct(s).SetData(2, v) +} + +func (s NodeService_uploadBlob_Params) Offset() uint64 { + return capnp.Struct(s).Uint64(0) +} + +func (s NodeService_uploadBlob_Params) SetOffset(v uint64) { + capnp.Struct(s).SetUint64(0, v) +} + +func (s NodeService_uploadBlob_Params) TotalSize() uint64 { + return capnp.Struct(s).Uint64(8) +} + +func (s NodeService_uploadBlob_Params) SetTotalSize(v uint64) { + capnp.Struct(s).SetUint64(8, v) +} + +func (s NodeService_uploadBlob_Params) MimeType() (string, error) { + p, err := capnp.Struct(s).Ptr(3) + return p.Text(), err +} + +func (s NodeService_uploadBlob_Params) HasMimeType() bool { + return capnp.Struct(s).HasPtr(3) +} + +func (s NodeService_uploadBlob_Params) MimeTypeBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(3) + return p.TextBytes(), err +} + +func (s NodeService_uploadBlob_Params) SetMimeType(v string) error { + return capnp.Struct(s).SetText(3, v) +} + +// NodeService_uploadBlob_Params_List is a list of NodeService_uploadBlob_Params. +type NodeService_uploadBlob_Params_List = capnp.StructList[NodeService_uploadBlob_Params] + +// NewNodeService_uploadBlob_Params creates a new list of NodeService_uploadBlob_Params. +func NewNodeService_uploadBlob_Params_List(s *capnp.Segment, sz int32) (NodeService_uploadBlob_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 4}, sz) + return capnp.StructList[NodeService_uploadBlob_Params](l), err +} + +// NodeService_uploadBlob_Params_Future is a wrapper for a NodeService_uploadBlob_Params promised by a client call. +type NodeService_uploadBlob_Params_Future struct{ *capnp.Future } + +func (f NodeService_uploadBlob_Params_Future) Struct() (NodeService_uploadBlob_Params, error) { + p, err := f.Future.Ptr() + return NodeService_uploadBlob_Params(p.Struct()), err +} +func (p NodeService_uploadBlob_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(0, nil)} +} + +type NodeService_uploadBlob_Results capnp.Struct + +// NodeService_uploadBlob_Results_TypeID is the unique identifier for the type NodeService_uploadBlob_Results. +const NodeService_uploadBlob_Results_TypeID = 0xbd061e2d5a4d357c + +func NewNodeService_uploadBlob_Results(s *capnp.Segment) (NodeService_uploadBlob_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_uploadBlob_Results(st), err +} + +func NewRootNodeService_uploadBlob_Results(s *capnp.Segment) (NodeService_uploadBlob_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_uploadBlob_Results(st), err +} + +func ReadRootNodeService_uploadBlob_Results(msg *capnp.Message) (NodeService_uploadBlob_Results, error) { + root, err := msg.Root() + return NodeService_uploadBlob_Results(root.Struct()), err +} + +func (s NodeService_uploadBlob_Results) String() string { + str, _ := text.Marshal(0xbd061e2d5a4d357c, capnp.Struct(s)) + return str +} + +func (s NodeService_uploadBlob_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_uploadBlob_Results) DecodeFromPtr(p capnp.Ptr) NodeService_uploadBlob_Results { + return NodeService_uploadBlob_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_uploadBlob_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_uploadBlob_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_uploadBlob_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_uploadBlob_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_uploadBlob_Results) BlobId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_uploadBlob_Results) HasBlobId() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_uploadBlob_Results) SetBlobId(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// NodeService_uploadBlob_Results_List is a list of NodeService_uploadBlob_Results. +type NodeService_uploadBlob_Results_List = capnp.StructList[NodeService_uploadBlob_Results] + +// NewNodeService_uploadBlob_Results creates a new list of NodeService_uploadBlob_Results. +func NewNodeService_uploadBlob_Results_List(s *capnp.Segment, sz int32) (NodeService_uploadBlob_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_uploadBlob_Results](l), err +} + +// NodeService_uploadBlob_Results_Future is a wrapper for a NodeService_uploadBlob_Results promised by a client call. +type NodeService_uploadBlob_Results_Future struct{ *capnp.Future } + +func (f NodeService_uploadBlob_Results_Future) Struct() (NodeService_uploadBlob_Results, error) { + p, err := f.Future.Ptr() + return NodeService_uploadBlob_Results(p.Struct()), err +} + +type NodeService_downloadBlob_Params capnp.Struct + +// NodeService_downloadBlob_Params_TypeID is the unique identifier for the type NodeService_downloadBlob_Params. +const NodeService_downloadBlob_Params_TypeID = 0xa763ae8e98375142 + +func NewNodeService_downloadBlob_Params(s *capnp.Segment) (NodeService_downloadBlob_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 2}) + return NodeService_downloadBlob_Params(st), err +} + +func NewRootNodeService_downloadBlob_Params(s *capnp.Segment) (NodeService_downloadBlob_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 2}) + return NodeService_downloadBlob_Params(st), err +} + +func ReadRootNodeService_downloadBlob_Params(msg *capnp.Message) (NodeService_downloadBlob_Params, error) { + root, err := msg.Root() + return NodeService_downloadBlob_Params(root.Struct()), err +} + +func (s NodeService_downloadBlob_Params) String() string { + str, _ := text.Marshal(0xa763ae8e98375142, capnp.Struct(s)) + return str +} + +func (s NodeService_downloadBlob_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_downloadBlob_Params) DecodeFromPtr(p capnp.Ptr) NodeService_downloadBlob_Params { + return NodeService_downloadBlob_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_downloadBlob_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_downloadBlob_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_downloadBlob_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_downloadBlob_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_downloadBlob_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(0) + return Auth(p.Struct()), err +} + +func (s NodeService_downloadBlob_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_downloadBlob_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(0, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_downloadBlob_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(0, capnp.Struct(ss).ToPtr()) + return ss, err +} + +func (s NodeService_downloadBlob_Params) BlobId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s NodeService_downloadBlob_Params) HasBlobId() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_downloadBlob_Params) SetBlobId(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +func (s NodeService_downloadBlob_Params) Offset() uint64 { + return capnp.Struct(s).Uint64(0) +} + +func (s NodeService_downloadBlob_Params) SetOffset(v uint64) { + capnp.Struct(s).SetUint64(0, v) +} + +func (s NodeService_downloadBlob_Params) Length() uint32 { + return capnp.Struct(s).Uint32(8) +} + +func (s NodeService_downloadBlob_Params) SetLength(v uint32) { + capnp.Struct(s).SetUint32(8, v) +} + +// NodeService_downloadBlob_Params_List is a list of NodeService_downloadBlob_Params. +type NodeService_downloadBlob_Params_List = capnp.StructList[NodeService_downloadBlob_Params] + +// NewNodeService_downloadBlob_Params creates a new list of NodeService_downloadBlob_Params. +func NewNodeService_downloadBlob_Params_List(s *capnp.Segment, sz int32) (NodeService_downloadBlob_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 2}, sz) + return capnp.StructList[NodeService_downloadBlob_Params](l), err +} + +// NodeService_downloadBlob_Params_Future is a wrapper for a NodeService_downloadBlob_Params promised by a client call. +type NodeService_downloadBlob_Params_Future struct{ *capnp.Future } + +func (f NodeService_downloadBlob_Params_Future) Struct() (NodeService_downloadBlob_Params, error) { + p, err := f.Future.Ptr() + return NodeService_downloadBlob_Params(p.Struct()), err +} +func (p NodeService_downloadBlob_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(0, nil)} +} + +type NodeService_downloadBlob_Results capnp.Struct + +// NodeService_downloadBlob_Results_TypeID is the unique identifier for the type NodeService_downloadBlob_Results. +const NodeService_downloadBlob_Results_TypeID = 0xefd2013069b2f3e4 + +func NewNodeService_downloadBlob_Results(s *capnp.Segment) (NodeService_downloadBlob_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return NodeService_downloadBlob_Results(st), err +} + +func NewRootNodeService_downloadBlob_Results(s *capnp.Segment) (NodeService_downloadBlob_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return NodeService_downloadBlob_Results(st), err +} + +func ReadRootNodeService_downloadBlob_Results(msg *capnp.Message) (NodeService_downloadBlob_Results, error) { + root, err := msg.Root() + return NodeService_downloadBlob_Results(root.Struct()), err +} + +func (s NodeService_downloadBlob_Results) String() string { + str, _ := text.Marshal(0xefd2013069b2f3e4, capnp.Struct(s)) + return str +} + +func (s NodeService_downloadBlob_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_downloadBlob_Results) DecodeFromPtr(p capnp.Ptr) NodeService_downloadBlob_Results { + return NodeService_downloadBlob_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_downloadBlob_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_downloadBlob_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_downloadBlob_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_downloadBlob_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_downloadBlob_Results) Chunk() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s NodeService_downloadBlob_Results) HasChunk() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_downloadBlob_Results) SetChunk(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s NodeService_downloadBlob_Results) TotalSize() uint64 { + return capnp.Struct(s).Uint64(0) +} + +func (s NodeService_downloadBlob_Results) SetTotalSize(v uint64) { + capnp.Struct(s).SetUint64(0, v) +} + +func (s NodeService_downloadBlob_Results) MimeType() (string, error) { + p, err := capnp.Struct(s).Ptr(1) + return p.Text(), err +} + +func (s NodeService_downloadBlob_Results) HasMimeType() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s NodeService_downloadBlob_Results) MimeTypeBytes() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return p.TextBytes(), err +} + +func (s NodeService_downloadBlob_Results) SetMimeType(v string) error { + return capnp.Struct(s).SetText(1, v) +} + +// NodeService_downloadBlob_Results_List is a list of NodeService_downloadBlob_Results. +type NodeService_downloadBlob_Results_List = capnp.StructList[NodeService_downloadBlob_Results] + +// NewNodeService_downloadBlob_Results creates a new list of NodeService_downloadBlob_Results. +func NewNodeService_downloadBlob_Results_List(s *capnp.Segment, sz int32) (NodeService_downloadBlob_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}, sz) + return capnp.StructList[NodeService_downloadBlob_Results](l), err +} + +// NodeService_downloadBlob_Results_Future is a wrapper for a NodeService_downloadBlob_Results promised by a client call. +type NodeService_downloadBlob_Results_Future struct{ *capnp.Future } + +func (f NodeService_downloadBlob_Results_Future) Struct() (NodeService_downloadBlob_Results, error) { + p, err := f.Future.Ptr() + return NodeService_downloadBlob_Results(p.Struct()), err +} + +type NodeService_deleteAccount_Params capnp.Struct + +// NodeService_deleteAccount_Params_TypeID is the unique identifier for the type NodeService_deleteAccount_Params. +const NodeService_deleteAccount_Params_TypeID = 0xec1d780f33bf2f15 + +func NewNodeService_deleteAccount_Params(s *capnp.Segment) (NodeService_deleteAccount_Params, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_deleteAccount_Params(st), err +} + +func NewRootNodeService_deleteAccount_Params(s *capnp.Segment) (NodeService_deleteAccount_Params, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return NodeService_deleteAccount_Params(st), err +} + +func ReadRootNodeService_deleteAccount_Params(msg *capnp.Message) (NodeService_deleteAccount_Params, error) { + root, err := msg.Root() + return NodeService_deleteAccount_Params(root.Struct()), err +} + +func (s NodeService_deleteAccount_Params) String() string { + str, _ := text.Marshal(0xec1d780f33bf2f15, capnp.Struct(s)) + return str +} + +func (s NodeService_deleteAccount_Params) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_deleteAccount_Params) DecodeFromPtr(p capnp.Ptr) NodeService_deleteAccount_Params { + return NodeService_deleteAccount_Params(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_deleteAccount_Params) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_deleteAccount_Params) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_deleteAccount_Params) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_deleteAccount_Params) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_deleteAccount_Params) Auth() (Auth, error) { + p, err := capnp.Struct(s).Ptr(0) + return Auth(p.Struct()), err +} + +func (s NodeService_deleteAccount_Params) HasAuth() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s NodeService_deleteAccount_Params) SetAuth(v Auth) error { + return capnp.Struct(s).SetPtr(0, capnp.Struct(v).ToPtr()) +} + +// NewAuth sets the auth field to a newly +// allocated Auth struct, preferring placement in s's segment. +func (s NodeService_deleteAccount_Params) NewAuth() (Auth, error) { + ss, err := NewAuth(capnp.Struct(s).Segment()) + if err != nil { + return Auth{}, err + } + err = capnp.Struct(s).SetPtr(0, capnp.Struct(ss).ToPtr()) + return ss, err +} + +// NodeService_deleteAccount_Params_List is a list of NodeService_deleteAccount_Params. +type NodeService_deleteAccount_Params_List = capnp.StructList[NodeService_deleteAccount_Params] + +// NewNodeService_deleteAccount_Params creates a new list of NodeService_deleteAccount_Params. +func NewNodeService_deleteAccount_Params_List(s *capnp.Segment, sz int32) (NodeService_deleteAccount_Params_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return capnp.StructList[NodeService_deleteAccount_Params](l), err +} + +// NodeService_deleteAccount_Params_Future is a wrapper for a NodeService_deleteAccount_Params promised by a client call. +type NodeService_deleteAccount_Params_Future struct{ *capnp.Future } + +func (f NodeService_deleteAccount_Params_Future) Struct() (NodeService_deleteAccount_Params, error) { + p, err := f.Future.Ptr() + return NodeService_deleteAccount_Params(p.Struct()), err +} +func (p NodeService_deleteAccount_Params_Future) Auth() Auth_Future { + return Auth_Future{Future: p.Future.Field(0, nil)} +} + +type NodeService_deleteAccount_Results capnp.Struct + +// NodeService_deleteAccount_Results_TypeID is the unique identifier for the type NodeService_deleteAccount_Results. +const NodeService_deleteAccount_Results_TypeID = 0xc3d5b3a894c75380 + +func NewNodeService_deleteAccount_Results(s *capnp.Segment) (NodeService_deleteAccount_Results, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return NodeService_deleteAccount_Results(st), err +} + +func NewRootNodeService_deleteAccount_Results(s *capnp.Segment) (NodeService_deleteAccount_Results, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return NodeService_deleteAccount_Results(st), err +} + +func ReadRootNodeService_deleteAccount_Results(msg *capnp.Message) (NodeService_deleteAccount_Results, error) { + root, err := msg.Root() + return NodeService_deleteAccount_Results(root.Struct()), err +} + +func (s NodeService_deleteAccount_Results) String() string { + str, _ := text.Marshal(0xc3d5b3a894c75380, capnp.Struct(s)) + return str +} + +func (s NodeService_deleteAccount_Results) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (NodeService_deleteAccount_Results) DecodeFromPtr(p capnp.Ptr) NodeService_deleteAccount_Results { + return NodeService_deleteAccount_Results(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s NodeService_deleteAccount_Results) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s NodeService_deleteAccount_Results) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s NodeService_deleteAccount_Results) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s NodeService_deleteAccount_Results) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s NodeService_deleteAccount_Results) Success() bool { + return capnp.Struct(s).Bit(0) +} + +func (s NodeService_deleteAccount_Results) SetSuccess(v bool) { + capnp.Struct(s).SetBit(0, v) +} + +// NodeService_deleteAccount_Results_List is a list of NodeService_deleteAccount_Results. +type NodeService_deleteAccount_Results_List = capnp.StructList[NodeService_deleteAccount_Results] + +// NewNodeService_deleteAccount_Results creates a new list of NodeService_deleteAccount_Results. +func NewNodeService_deleteAccount_Results_List(s *capnp.Segment, sz int32) (NodeService_deleteAccount_Results_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return capnp.StructList[NodeService_deleteAccount_Results](l), err +} + +// NodeService_deleteAccount_Results_Future is a wrapper for a NodeService_deleteAccount_Results promised by a client call. +type NodeService_deleteAccount_Results_Future struct{ *capnp.Future } + +func (f NodeService_deleteAccount_Results_Future) Struct() (NodeService_deleteAccount_Results, error) { + p, err := f.Future.Ptr() + return NodeService_deleteAccount_Results(p.Struct()), err +} + +type Auth capnp.Struct + +// Auth_TypeID is the unique identifier for the type Auth. +const Auth_TypeID = 0xd4c550ca8c26bfc9 + +func NewAuth(s *capnp.Segment) (Auth, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return Auth(st), err +} + +func NewRootAuth(s *capnp.Segment) (Auth, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return Auth(st), err +} + +func ReadRootAuth(msg *capnp.Message) (Auth, error) { + root, err := msg.Root() + return Auth(root.Struct()), err +} + +func (s Auth) String() string { + str, _ := text.Marshal(0xd4c550ca8c26bfc9, capnp.Struct(s)) + return str +} + +func (s Auth) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (Auth) DecodeFromPtr(p capnp.Ptr) Auth { + return Auth(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s Auth) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s Auth) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s Auth) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s Auth) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s Auth) Version() uint16 { + return capnp.Struct(s).Uint16(0) +} + +func (s Auth) SetVersion(v uint16) { + capnp.Struct(s).SetUint16(0, v) +} + +func (s Auth) AccessToken() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s Auth) HasAccessToken() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Auth) SetAccessToken(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +func (s Auth) DeviceId() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(1) + return []byte(p.Data()), err +} + +func (s Auth) HasDeviceId() bool { + return capnp.Struct(s).HasPtr(1) +} + +func (s Auth) SetDeviceId(v []byte) error { + return capnp.Struct(s).SetData(1, v) +} + +// Auth_List is a list of Auth. +type Auth_List = capnp.StructList[Auth] + +// NewAuth creates a new list of Auth. +func NewAuth_List(s *capnp.Segment, sz int32) (Auth_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}, sz) + return capnp.StructList[Auth](l), err +} + +// Auth_Future is a wrapper for a Auth promised by a client call. +type Auth_Future struct{ *capnp.Future } + +func (f Auth_Future) Struct() (Auth, error) { + p, err := f.Future.Ptr() + return Auth(p.Struct()), err +} + +type Envelope capnp.Struct + +// Envelope_TypeID is the unique identifier for the type Envelope. +const Envelope_TypeID = 0x9c48d98b94500b2a + +func NewEnvelope(s *capnp.Segment) (Envelope, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Envelope(st), err +} + +func NewRootEnvelope(s *capnp.Segment) (Envelope, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Envelope(st), err +} + +func ReadRootEnvelope(msg *capnp.Message) (Envelope, error) { + root, err := msg.Root() + return Envelope(root.Struct()), err +} + +func (s Envelope) String() string { + str, _ := text.Marshal(0x9c48d98b94500b2a, capnp.Struct(s)) + return str +} + +func (s Envelope) EncodeAsPtr(seg *capnp.Segment) capnp.Ptr { + return capnp.Struct(s).EncodeAsPtr(seg) +} + +func (Envelope) DecodeFromPtr(p capnp.Ptr) Envelope { + return Envelope(capnp.Struct{}.DecodeFromPtr(p)) +} + +func (s Envelope) ToPtr() capnp.Ptr { + return capnp.Struct(s).ToPtr() +} +func (s Envelope) IsValid() bool { + return capnp.Struct(s).IsValid() +} + +func (s Envelope) Message() *capnp.Message { + return capnp.Struct(s).Message() +} + +func (s Envelope) Segment() *capnp.Segment { + return capnp.Struct(s).Segment() +} +func (s Envelope) Seq() uint64 { + return capnp.Struct(s).Uint64(0) +} + +func (s Envelope) SetSeq(v uint64) { + capnp.Struct(s).SetUint64(0, v) +} + +func (s Envelope) Data() ([]byte, error) { + p, err := capnp.Struct(s).Ptr(0) + return []byte(p.Data()), err +} + +func (s Envelope) HasData() bool { + return capnp.Struct(s).HasPtr(0) +} + +func (s Envelope) SetData(v []byte) error { + return capnp.Struct(s).SetData(0, v) +} + +// Envelope_List is a list of Envelope. +type Envelope_List = capnp.StructList[Envelope] + +// NewEnvelope creates a new list of Envelope. +func NewEnvelope_List(s *capnp.Segment, sz int32) (Envelope_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return capnp.StructList[Envelope](l), err +} + +// Envelope_Future is a wrapper for a Envelope promised by a client call. +type Envelope_Future struct{ *capnp.Future } + +func (f Envelope_Future) Struct() (Envelope, error) { + p, err := f.Future.Ptr() + return Envelope(p.Struct()), err +} + +const schema_d5ca5648a9cc1c28 = "x\xda\xdcY\x7ft\x14\xd5\xf5\x7f\xf7M\xc2\x10\x92\xb0" + + "\xd9\xcc\x92\x80@\x96\xc4\xe8\x17\xa3(\x10=\xdf\x9a\x8a" + + "\x9bD\xe0\x90@ \x13B\x15\x0e\x1c\x99\xdd<\xd8I" + + "6\xbb\x9b\x9dY T\x1bA\xb1\xa0B\x85B\x05N" + + "\xa8?\x8aG\x02\xa2\x80\xa4Uj\xaa\xa8T\xb0b\xd5" + + "#UZ\xb1\x95c\xb5T\xf1\xb7\xb4\xd5\xea\xf6\xbc\xb7" + + "\xfbf\xdf&\xbbl\"\x1c{N\xffKf\xef\xbc\xfb" + + "\xfbs\xef\xfb\xcc\xf8\xa6\xec\xca\x8c\x09\xb9\x1f\xe5#\xac" + + "\xbe\x999(2\xaf\xaa\xe5\xca7\x1e\xbc|\x05\xb2\x17" + + "\x02B\x99 #T\xbe +\x04\x08\x14=\xcb\x85 " + + "\x92\xf3\xca/\xbe\xf9\xf4\x86\xea\x04\x81\xb5Y\xcb\xa9\xc0" + + "\x16&\xf0\xe7\xaa\xd5\x9f\x9c.r\xae\x8a\x09HT\xa0" + + "'*p$\xebQ\x04\x91\x7f\xae\xfb]\xc5M\xef\x97" + + "\xdf!\x0a\x90!+\xa9@\xdb\x10*\xf0\xde\xa6\xa3\x17" + + "\xfc\xccub\xad(0,\x9b\xd9P\x9cM\x05\x96\x95" + + "~9y\xc1\x94\x11\xebD\x1b\x0ef\xbb\xa9\xc0\xd1l" + + "j\xc3S\xef:\x02'g}\xb09&\x80\xa9\xc0\xd7" + + "\xd1\x13\xb2r\x96\"\x88<\x03\x9b\x02\xfe\x8b\xb2:E" + + "\x01=\xa7\x99\x0a\x84\x99@Yv\xfd\xc6;\x8fO\xeb" + + "Dj6@d\xec\xa8\x17\xbb\xa6\xfd\xe0\x85cQ]" + + "\xca\xb1\x9c\x07\x94\x139\xf4\xaf\xe3L\xf8\x837n\x0f" + + "\x1a\x1f?\xbc\x0d\xa9\x85`Y|U\xee\x05\x80\xa0|" + + "R\xae\x13\x10DvoW\xbc\xb7\xdc;\xf5\xde\xa8\xc2" + + "\x0c*0g\xe8r@\x19\x91j\xf5\xff7\xaf{\xc4" + + "\xf3\x10}\x19s[\xaa\x86\xce\xa3\xb6\xd4\x0d}\x0fA" + + "\xe4\xce\xeb\x8a?^\xea\xeb\xdc!\xba[lc\x11\x1d" + + "g\xa3\xee\xb6\x90\x97v\\v`_\x97p\xb8j\xbb" + + "\x80\x1e\xbe\xf0W\xaf\xcd\x84\x7ft\xee\x14Cy\xb5m" + + "+}\xb5\xc6FC\xb9g\xccs\x07\xbf\xbc\xf6\xe5\x9d" + + "b N\xd9\x98\xf2/l\xd4\xb7\xe9\x87\xb6\xd6\xac\x18" + + "\xbey\x97\xa8|n^-\x15 yT\xf9\xbb\xe5\xcd" + + "\xe3\xd7d|\xf3(w\x9e\xa9\xdf\x927\x91:\x7f\x7f" + + "\xde\xf5\xd4\xf9R\x18\xd21\xf3C\xd7~\xc1\xbe/\xec" + + "\xcc\xf9\xaf>u\xf4\x14\xbe[\xdb-\x9e\xfe\xb6\xbd\x8c" + + "\x9e~\xcaNO_\xebn\xb4-\xb8\xf5\x9e_\x8a\xf6" + + "\x8d\xceg\x99\xbc$\x9f\xdag\x0b\xe5n\x1au\xd2x" + + "B\xd5\xae\xac\xcf\xa7'L\x1d\xd3n\x96" + + "\xbf\xf4\xd0\x81\x04\xfb\xf6\xe6S\x17\xcb{\xf2\x99}'" + + "\xff\xb0\xfd\xb3\x92g\x8e\xfe:!\xc0\x8eh\x80\x1d\xf4" + + "\x8c\x9b\xae\xaa\x9b7\xaehP\x8f(P\xe7h\xa0\x02" + + "s\x99\xc0\xbf\x9e{%\xf7\xf7\x9f\xdf{P\x14hw" + + "\x94P\x81\x15L\xe0\xe6\xack\x95\x15\x19\xb3\x9e\xe1Y" + + "fVt;h\x1c\xcb\x0f:\x98\x15\xde\x13\x97>{" + + "f\xecm\xcf\x0aQ\x1aQPF\xa3t\xcb\xec\xe77" + + "\xeex\xec\xd8\xb31\x17\xd8OP\xc0\xaa5\xb7\x80\x9e" + + "\xbebC\xdd\xe9\xb7\x1e\x99\xfc[1J\xe3\x0a6P" + + "\x81I\x054J\xf7\xac\x96gM\x7f\xc7x^\x14\xd8" + + "V\xc0\x1c\xe8b\x02\xef\x87\x7fx\xf1\x12\xff\xeb\x87E" + + "\x07\xb2\x0a\xef\xa0\x02#\x0a\xa9\x8ae?\x9f;\xe2\xe8" + + "\xf6\xc3/#{\xb6\x14\xef\x07\xaa\xa0\xf0\x802\xa5\x90" + + "\x15m\xa1}<\xbc\xfa\x11w\x84I" + + "\xac\x1a\xc3\x8eX?\x86\xc6bg\xe6\xfc\xadO7\xce" + + "\xfdX\xd41\xa1\x98\x01\xec\xa4b\xa6\xc3\xdc:\xeb\x85" + + "e\x7f\xfc4!\x16Z1+\xa8\xd6b\xaa\xc4=r" + + "\xec\xdf\xb3;/\xfe\\\xc4\x8d\xa3\xc5\xcc\x8a\xe3\xc5T" + + "\xc7\x86]K2\xfe\xba\xa7\xeb\xf3\x84x\x970\x1d\xab" + + "J\xa8\x8e[\x87T\xed\xdbu\xe3\x883\xa2\x1f]%" + + "\xcc\xca\xee\x12\xaa\xe2\xc4\x8fN\xfe\xf8\xfb\xaf\xbc\xf3\xef" + + "\x04\xd0\xb4_H{\xa6|\xc4\x85,X\x81\xe1\xf3w" + + "\xff\xdfg_}-\x9e1\xa1\x94%uR\xe9R4" + + ".\xe2\x0f4\x91\xcb=Z0\xc3\x1f\xac\x98\x19h\"" + + "\xb3Ih\x89\xee!\x97/\"\xa6\xc7;\xad\xdd\x1d\xd2" + + "\x9b\xa6\x93\xf6\xd2\x06\xe24\xc2>\xd3P3\xa4\x0c\x84" + + "2\x00!{\xeeJ\x84\xd4\x1c\x09\xd4\xe1\x18\"^&" + + "Y\x1f\x06\xb7O\xf7L'\xed\x08r\x11\x86\\\x04)" + + "\x15\x84\x88\x11\xf0-!S\xfcM\xc1\x80\xee7K\x1b" + + "\\\xa4\x8f\x86ZA\x03=\xa7\xaa\xa9)\x84P\xfa\xb3" + + "\xc3A_@\xa3v\xd7k\x9e\x16m1)u\xd5k" + + "!\xad\xd5Ps\xac\xb3\xa7\xb8\x11R'K\xa0\xd6c" + + "\xb0\x038h\x00\xedu\xd5\x08\xa9\xd3$P\x1b1\xd8" + + "1v\xd0\x12\xb4\xabe\x08\xa93$Po\xc0\x10\xd1" + + "\x9b\x88\xdf\xd4\xcdv$O'\xed\xdc\x8e\x8e`T\x0d" + + "\xff\xdf\xa6\x85M/\xe4\xc5\xdb\x0f\x01\xe4\x09\xe6f\xf6" + + "27\x10\xd4\xda\xc2dF`\xb1\xee\x9f\xaa\xfbu\xc3" + + "[\x1a5\x17\x89\xf6\xd6&\xb3\xb79n\x9ae\xef\x1c" + + "\xeaY\xa3\x04\xeaB\x0c\x91\xb0AB~\xad\x95\xd0\xa8" + + "\xe5 \x0c9\x08\"\x8bt\xbf\xe6\xd3\x97k\xc8f\xea" + + "\x01\xbf\x15\xcc\xa4\xae\xa5\x0cq0\xec\xf6\xe9\x86\xd7J" + + "_\xbd\xb3\x7f\x11\xaeMf1\x8dp\xbd\x04\xea||" + + "63ze?]\x94{[\xec\xd6L\x8fw\x8a\xbf" + + "-L\xc2\xa4\xb4\x81\x18a\xb9W\xb5Q+\x06K\xa0" + + "\x96b\xb0\x19\xa4\xcd\x80\xa1\x08\xea%\x80,\x84\xe9\x9f" + + "go\x15\xa1\xd8x(\x06[G_BC1V\x02" + + "\xf5J!\x14\x13\xa8\xbe\xcb$P\xbf\x97\xca\xeb\x81z" + + "\xd8\xabg\xeb5\xdbwc\x07\xf8\x83\x15S\xfcK\x88" + + "O\x0e\x04I=\x80\xa8\xb1\x04!\xb5T\x02u<\x06" + + "\xaep\\Y\xdc\x0a\xd9 m,\xc0Y\x08lM\x9a" + + "\xa9\xf5)<\xa9w\xe1\x11\xd2\xc2\xfaCj5T\x87" + + "\xa5\xe8f\xda\x0a7I\xa0\xae\x16\\[\xd5\x80\x90z" + + "\x9b\x04\xea\xdd\x18 Vlki\x8f\xaf\x96@\xdd\x88" + + "\xc1.a\x07H\x08\xd9\xd7S\x93\xee\x92@\xdd\x8c\xc1" + + "\x9e\x01\x0e\xc8@\xc8\xbei\"B\xea\xdd\x12\xa8\x9d\x18" + + "\"!\xe2\xd1\x83:\xf1#\x9b)\xd6\xa5\xc7\xab\xf9\xfd" + + "\xc4W\x83\xa0\xc9B\x83%$d\xd0\xc6\x92\x11\x069" + + "e\xf4\x9c>\xbdU7a0\xc20x\x00}\xc6a" + + "2\xe5\x0bM\x81\xa5~\x8a~\xd5\xbe\x80\xdb\x8aS\x9e" + + "\x15'\x8dz:_\x02\xd5+\xc4\x89T \xa4.\x94" + + "@\xf5\xc5\xe3\xa4\xd3gM\x12\xa8A!N\xad\xf4\xa1" + + "W\x02\xd5\xc4\xa9\xfcr\xb9}\x01w\x8d\x15\x0dW`" + + "\xd1\"\x83\x98<\xc7.\x1f\xf1/6\xbdi\xdd\x8eM" + + "\x87\x9aX9\xa6\x9d\x0e\xc9p.U\x05i\x9e\x16\xd6" + + "\xff>I\x08crLn \x8bu\xc3$!\x01\x96" + + "\xa5D\x90K\x0a\xcb\x15\xc9\xc6\x88[\x00\xb9$\xe6\xba" + + "\xa2C\xeb[\xc2q,^s\x0c\x12\xb2|K\xdb\xf8" + + "\xcb\x11R\xc7K\xa0^\x93\x12vu\xbf\xc7\x176\xf4" + + "\x00r\xf9\xebC\x81\xc0\xa2\xb4v0\x08\xba^\xd3\xcd" + + "\xa8\x15\xa6\x81P\xb2\x94\x8d\xc5\x10\x09j\xed\xd4a\x83" + + "\xc6 \x86\xb4y\xf1K#\x82\x04\xcc\xed\x9dC\x12\xc3" + + "q\x8e\xb5\xc3-\x1d[(\x10l\x96@\xdd.\xb8z" + + "?m\xfaN\x09\xd4\x1dBF\x1e\xa4\xe8\xb0]\x02u" + + "\x0f\x06\x90\xa2\x05\xbe\x9b\x0a\xee\x90@\xddO\x81@\x8a" + + "\x02\xc1^\xda3\x0fK\xa0>\x8e\xc1\x9e\x09\x0e\xc8D" + + "\xc8\xdeM%\xf7H\xa0>\x99\x12\x1d:b.\x9e\x07" + + "\xb4\xe80M\xdfl\xe21\xd26N\xb4\x8a\x84\xc5\xad" + + "7^H\xc92F\xb3eK\xd5_\x03NV\xbaU" + + "\xef;\x1b\x90\xbd}\xf5\x12\xcdgz\x93.\xb3\x15\xb1" + + "\xe1\xef\xc0\xe02L\xcd\x0c\x1b}p\xe4\xac\x0b\x05\x87" + + "\x06\xa1\x10C\xb1B\xdc/\xf8\xb4\xb7Z(%^\x88" + + "\xdd\xb4\x10\xf7K\xa0>\x1d/\xc4\x1e*\xf8\xb8\x04\xea" + + "sB!\x1e\xa4\x11yR\x02\xf5\xb0P\x88\x87\xa8\xe4" + + "\xd3\x12\xa8/\x8a\x85\xe8\xa4\x85h\xad0\xb9\xd1\x15\xe6" + + "\xbfQ\x90\xbd\xb7\xa3dH^\x1d\x0f~\xef]:M" + + "\xa1\xb3)\x17\x85\x1aH\x99\xcf\xc4\x89t\xf6\xcd\"\xd9" + + "bx\xde\x1aA\xb09\xb6\xe1#\xb1`hv7J" + + "\xa0\xde'\x14\xcc\xb6\xdad\xc8E7\x93\xfb$P\x1f" + + "\x8e\x17LWE\x1c\xcd\xac\x15fw\x83\x88\\R\x0c" + + "\xb9j\xe3\xe5\x96\xaa\x83h\xc8\xa6i\x86W\xd8\xb7\x9d" + + "\x1eo\xd8\xdf\x92b\xaeG\xcc\x80\xa9\xf9f\xeb\xcb\x11" + + "\x10\xebY\xab\xdeJ\x1a\xdb\x83\xfd\x1a\xca\xb1\xd6\x8c\xed" + + "\xac\xa9\xb7\x1b\xe2#&\xa9\xf2x\x02a\xbf\x99\x14\xb5" + + "\xc4Z2\xc2\x1e\x0f1\x0c\x00\x84\x01\xd2^\xc0\xf8\xb0" + + "\x9fmj!3\x9a H\x00\xa9\xdad U-\x80" + + "T\x92\xb1\xde\x11\"mab\x98\x03\x9a\xe0\xfd\xd5]" + + "vv\xdd\xe7~\x0fM:\xc4\x9b\x85\xbd\xcb \x06\x05" + + "\x8bFd\x0b\xb4\x10\x7f\x1f'\x81kpEU\xd0\xcb" + + "\xc1B)\x13!\x8b\xe3\x06N\x83(\x9f\xe0;\x10V" + + "Nc\x19\xe2\xec3p^Qy\x1b\xafDX9\x8e" + + "e\xc0\x16_\x0a\x9c\x91R\x8e\xe2j\x84\x95\x83X\x06" + + "\xc9bE\x803\xa3J7\x9e\x88\xb0\xd2\x85e\xc8\xb0" + + "h5\xe0\xac\xac\xb2\x0d7 \xacl\xc22dZ\x04" + + "\"pNTY\x83+\x10Vn\xc62\x0c\xb2(\x1d" + + "\xe0l\xac\xd2\xc6\xac\xd2\xb1\x0c\xb2E\x88\x03\xff\x00\xa0" + + ",\xc0\xcb\x11V\xe6`\x19\x06[\xfc\"p\x0aL\xa9" + + "\xc1\x0f \xacL\xc12dY$3pJO\xb9\x1a" + + "\xefDX\xb9\x0a\xcb0\xc4\"q\x80\xd3R\xca%," + + "V\x17a\x19\xb2\xad\x8f\x01\xc0\x09He\x04\xde\x80\xb0" + + "2\x0c\xcb\x90c}\x09\x00N\x9f+Y\xccf\xc02" + + "\xe4Z\xdc0\xf0o\x12\xca\x17@\x7f=\x0d2\x0c\xb5" + + "Hy\xe0\xdc\xac\xf26\x94!\xac\x1c\x03\x19l\x16U" + + "\x07\x9c;W\x8e@\x09\xc2J\x0f\xc8\x90g\x91p\xc0" + + "iEe/;\xb9\x0bd\xb0[\x8c2\xf0\xef\x10\xca" + + "6h\xa6Y\x00\x19\xf2-\xe2\x0b8\xcb\xa6\xac\x81\x10" + + "\xc2\xca\x0a\x90A\xb1\x88X\xe0\xc4\xbb\x12\x067\xc2J" + + "+\xc8\xe0\xb0(H\xe0\x94\xbf\xa21\xbdsA\x86a" + + "\x16\x87\x0c\x9c\x8eV\xea`\x1e\xcd\x02\xc8P`}G" + + "\x00N\x10*W3\xab&\x80\x0c\x85\x16\xef\x08\x9cK" + + "V.bV\x8d\x069\xc2\x09'\xe0c\x0e\xa1J\x88" + + "\xf0\xd1\x07\xfca%t\xc4\x16\xd7Jp\xb2_\xb9\xd4" + + "\xf5\x9a\x8e\xc0\xac\x04W\x14\x07+!\xc2\x179\x88m" + + "r\xd6\x81\xd3\xda\xdd\xc8\x15}V\x09\x11\x0e]\xc0\xb1" + + "K\xd6Bf\xdf\xe7Su\x1bmh\xeb\x87\x19\x01X" + + "\xac\xfb\x19\xd21S\xc5\xa7\xac\xf7\x81\xca\xf2\xcb'\xc4" + + "67*\xc9\x979\xe1\x99\x8dN\xceJ\x905O\x8b" + + "`$Dm4\xe8K|UB\xb6\xa8\xf3\x11O\x88" + + "h&\xb9\xce\x8b\x9cl\x01\x89\x9f;\x07\xc9\x06\x09\xc5" + + "\xff\xaf\x01\xbe\xf8Y1\xa9\xf6!)\xe0\xae\x84\x08\xbf" + + "\xea\"\x1b\x1d\xa9\xf4Al: '\x9b\x0f\x95P\x0f" + + "\xfd\xb9\xaap\xb6-\xdd%\xa2A\x98\xba\xb1I\xdcU" + + "-L]\x09b\x97\x08q\xeaf\xe0\xe8(\xee.\x8b" + + "\xdf\x17\xac\xdd\xed\x89\x89\xf1Q|\x0e\x14C\xc4\xd4[" + + "I l\xd6!0,6e@\xb4C\xbf\xae\xbf\xc9" + + "v\xa3\xfe\x8c[:\x05\xaa\xc2\xa6\x17Q\xf8\x17\xee\xce" + + "\xf4\xddJ\x09\xd4\x19qn\xa8\xc6-^\x9d!vu" + + "\xae\x8d_\x9d\xfb\xb8\xae1\x9d\x8d\x01$\x8b\x03\xa8\x89" + + "P7j\x9a\xfa\xc3\x16'\xd2fF\xd2\x0dU\xe4\x06" + + "[\xfa.\xd6i\xef\xa9\xd6\x99i\xa8\xb1P|\xa2\x8b" + + "\xd4\x18\xadl}\x09\x09\xb5#g\xff\xee\xe1\xbd\xf9\x93" + + "\xef\xec\xca\xd5\x9f\xd5\xca\"(R\x909!b\x04\x03" + + "~\x83$K^22\x87\xafK\xe7\xcc\x06\xc6\xfaw" + + "}\xb5\xc8\x06\xc6\xfawS\xd9ya\x03;\x0c\xd26" + + "'\xd8\x18H\xd3\xa6\xfd\\\x80\xeb\xb5\x90L\xd3\x9a\xa4" + + "R\x1d\xf8\x1c\xf9c#Y\xd14\xc7\x8af\xb2\x10\xd7" + + "*\xaa\xf2\x1a\x09\xd4ib\xd1\xd8\x92\xdc?\x07\xec\xac" + + "\xc8eZ\xe8# \xc8\xc4$\x08\xd2\x90\x06A\x12\xef" + + "1\x03\xbe\xb8\x9cei\x16\xaa\xdb4\xd0\xb7\xa9\xee\xde" + + "\x01\xe0c\x92\x95U\xfc\xba#$\xa4!\xde\xc5V\x13" + + "W\x08M\x9c\xa4$]K5c&Y\xda\x07\xa6\xd3" + + "QI\xfd\xfd\xc4\xb3\xf2\xdb}\xe2I\xf9\x09q\xa0\x90" + + "\xd3\xe7\xeb_\xb2\x8c\xb8\x85\x8c,\xd2\xfd\x8bI(\x18" + + "B\xb2\xee7\x07\x98\x13\xde\x81BJ\xaa\xe3\xb8nO" + + "\xf6\xcd\xa3#HH\xe8\x1cX\xac(c\xc7\x15\xff\xef" + + "\x7f\x02\xe9\xd3a\xfck\xeey\xbe\x9a\xff'\x00\x00\xff" + + "\xff!M\xbc\xa7" + +func RegisterSchema(reg *schemas.Registry) { + reg.Register(&schemas.Schema{ + String: schema_d5ca5648a9cc1c28, + Nodes: []uint64{ + 0x812ea5d8346b415a, + 0x814258f2fea3d10c, + 0x851f1eedf18841df, + 0x8a33eb7c3acb8ef8, + 0x8ddd3f961acd95e7, + 0x8e19455d44fa2478, + 0x98ec4fe26f14e6bf, + 0x9c09256e6f9501c2, + 0x9c48d98b94500b2a, + 0x9dacf0737086d8ec, + 0x9f469f806813a4ad, + 0xa763ae8e98375142, + 0xa89c6c77f021438b, + 0xa9b2ba2ca8ce656b, + 0xaa9cf7014ed4b760, + 0xaad03efac1c420b0, + 0xab981881499ac54b, + 0xaffe0489306a33e6, + 0xb43fee4e7f0a0124, + 0xb54ae617bd14f2fb, + 0xb697835d0f54628d, + 0xb973e21c950d720f, + 0xbaa7ce3374792046, + 0xbbcdc222f3a4d6e2, + 0xbd061e2d5a4d357c, + 0xc19ff4cf0dd1c4f9, + 0xc24f0481133e097d, + 0xc38428f6c32bdd68, + 0xc3d5b3a894c75380, + 0xc644aedeed4d9281, + 0xc773e44b4f078897, + 0xc8d76e76267b75eb, + 0xd0c8a4cd19599e78, + 0xd252902b7f6a5c8d, + 0xd45280f14698321f, + 0xd4c550ca8c26bfc9, + 0xd716be5fe0ab54f6, + 0xdca0b3a8fe2f5c93, + 0xde2f0aaeba8f22af, + 0xe8b5868ec5b8624d, + 0xe9db52f622c9c77c, + 0xec1d780f33bf2f15, + 0xee24b28dc81f6a06, + 0xefd2013069b2f3e4, + 0xf05954c09a5c05aa, + 0xf2da78ca4f9a7406, + 0xf4269c0bea281b62, + 0xf4a9b0e50476ab92, + 0xf6195fabb2410a83, + 0xfce4d13b87e27edd, + 0xfdfbf327ad5c186f, + }, + Compressed: true, + }) +} diff --git a/sdks/go/qpq/client.go b/sdks/go/qpq/client.go new file mode 100644 index 0000000..847489c --- /dev/null +++ b/sdks/go/qpq/client.go @@ -0,0 +1,377 @@ +// Package qpq provides the high-level Go API for interacting with a quicproquo server. +// +// It wraps the generated Cap'n Proto types and transport layer into an +// ergonomic client that handles authentication, key management, and messaging. +package qpq + +import ( + "context" + "fmt" + + "quicproquo.dev/sdk/go/proto/node" + "quicproquo.dev/sdk/go/transport" +) + +// Options configures the connection to a quicproquo server. +type Options struct { + // Addr is the host:port of the server (e.g. "127.0.0.1:5001"). + Addr string + + // InsecureSkipVerify disables TLS certificate verification (dev mode only). + InsecureSkipVerify bool + + // CACertPath is the path to a PEM-encoded CA certificate for production use. + CACertPath string +} + +// Message represents a received message envelope. +type Message struct { + Seq uint64 + Data []byte +} + +// Client is the high-level quicproquo client. +type Client struct { + conn *transport.Connection + token []byte // session token from OPAQUE login + deviceID []byte // optional device ID +} + +// Connect establishes a connection to a qpq server. +func Connect(ctx context.Context, opts Options) (*Client, error) { + conn, err := transport.Connect(ctx, transport.ConnectOptions{ + Addr: opts.Addr, + InsecureSkipVerify: opts.InsecureSkipVerify, + CACertPath: opts.CACertPath, + }) + if err != nil { + return nil, fmt.Errorf("qpq: connect: %w", err) + } + return &Client{conn: conn}, nil +} + +// Close disconnects from the server. +func (c *Client) Close() error { + return c.conn.Close() +} + +// SetSessionToken sets a pre-existing session token for authentication. +// Use this when you have already performed OPAQUE login externally. +func (c *Client) SetSessionToken(token []byte) { + c.token = token +} + +// SetDeviceID sets the device ID sent with each authenticated RPC call. +func (c *Client) SetDeviceID(id []byte) { + c.deviceID = id +} + +// setAuth populates an Auth struct on an RPC params message. +func (c *Client) setAuth(auth node.Auth) error { + auth.SetVersion(1) + if err := auth.SetAccessToken(c.token); err != nil { + return fmt.Errorf("set access token: %w", err) + } + if len(c.deviceID) > 0 { + if err := auth.SetDeviceId(c.deviceID); err != nil { + return fmt.Errorf("set device id: %w", err) + } + } + return nil +} + +// Health checks server health and returns the status string. +func (c *Client) Health(ctx context.Context) (string, error) { + future, release := c.conn.Client().Health(ctx, nil) + defer release() + + res, err := future.Struct() + if err != nil { + return "", fmt.Errorf("qpq: health: %w", err) + } + status, err := res.Status() + if err != nil { + return "", fmt.Errorf("qpq: health: read status: %w", err) + } + return status, nil +} + +// ResolveUser looks up a username and returns their identity key. +func (c *Client) ResolveUser(ctx context.Context, username string) (identityKey []byte, err error) { + future, release := c.conn.Client().ResolveUser(ctx, func(p node.NodeService_resolveUser_Params) error { + if err := p.SetUsername(username); err != nil { + return err + } + auth, err := p.NewAuth() + if err != nil { + return err + } + return c.setAuth(auth) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return nil, fmt.Errorf("qpq: resolve user %q: %w", username, err) + } + key, err := res.IdentityKey() + if err != nil { + return nil, fmt.Errorf("qpq: resolve user %q: read identity key: %w", username, err) + } + // Copy the key out of the capnp message buffer. + out := make([]byte, len(key)) + copy(out, key) + return out, nil +} + +// CreateChannel creates a 1:1 DM channel with a peer identified by their identity key. +func (c *Client) CreateChannel(ctx context.Context, peerKey []byte) (channelID []byte, wasNew bool, err error) { + future, release := c.conn.Client().CreateChannel(ctx, func(p node.NodeService_createChannel_Params) error { + if err := p.SetPeerKey(peerKey); err != nil { + return err + } + auth, err := p.NewAuth() + if err != nil { + return err + } + return c.setAuth(auth) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return nil, false, fmt.Errorf("qpq: create channel: %w", err) + } + chID, err := res.ChannelId() + if err != nil { + return nil, false, fmt.Errorf("qpq: create channel: read channel id: %w", err) + } + out := make([]byte, len(chID)) + copy(out, chID) + return out, res.WasNew(), nil +} + +// Send enqueues a message payload to a recipient identified by their identity key. +func (c *Client) Send(ctx context.Context, recipientKey, payload []byte) (seq uint64, err error) { + return c.sendInternal(ctx, recipientKey, payload, 0) +} + +// SendWithTTL enqueues a disappearing message with a time-to-live in seconds. +func (c *Client) SendWithTTL(ctx context.Context, recipientKey, payload []byte, ttlSecs uint32) (seq uint64, err error) { + return c.sendInternal(ctx, recipientKey, payload, ttlSecs) +} + +func (c *Client) sendInternal(ctx context.Context, recipientKey, payload []byte, ttlSecs uint32) (uint64, error) { + future, release := c.conn.Client().Enqueue(ctx, func(p node.NodeService_enqueue_Params) error { + if err := p.SetRecipientKey(recipientKey); err != nil { + return err + } + if err := p.SetPayload(payload); err != nil { + return err + } + p.SetVersion(1) + if ttlSecs > 0 { + p.SetTtlSecs(ttlSecs) + } + auth, err := p.NewAuth() + if err != nil { + return err + } + return c.setAuth(auth) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return 0, fmt.Errorf("qpq: send: %w", err) + } + return res.Seq(), nil +} + +// Receive fetches queued messages for the given recipient key. +func (c *Client) Receive(ctx context.Context, recipientKey []byte) ([]Message, error) { + future, release := c.conn.Client().Fetch(ctx, func(p node.NodeService_fetch_Params) error { + if err := p.SetRecipientKey(recipientKey); err != nil { + return err + } + p.SetVersion(1) + auth, err := p.NewAuth() + if err != nil { + return err + } + return c.setAuth(auth) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return nil, fmt.Errorf("qpq: receive: %w", err) + } + return extractMessages(res.Payloads()) +} + +// ReceiveWait long-polls for messages with a timeout in milliseconds. +func (c *Client) ReceiveWait(ctx context.Context, recipientKey []byte, timeoutMs uint64) ([]Message, error) { + future, release := c.conn.Client().FetchWait(ctx, func(p node.NodeService_fetchWait_Params) error { + if err := p.SetRecipientKey(recipientKey); err != nil { + return err + } + p.SetVersion(1) + p.SetTimeoutMs(timeoutMs) + auth, err := p.NewAuth() + if err != nil { + return err + } + return c.setAuth(auth) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return nil, fmt.Errorf("qpq: receive wait: %w", err) + } + return extractMessages(res.Payloads()) +} + +// DeleteAccount permanently deletes the authenticated user's account. +func (c *Client) DeleteAccount(ctx context.Context) error { + future, release := c.conn.Client().DeleteAccount(ctx, func(p node.NodeService_deleteAccount_Params) error { + auth, err := p.NewAuth() + if err != nil { + return err + } + return c.setAuth(auth) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return fmt.Errorf("qpq: delete account: %w", err) + } + if !res.Success() { + return fmt.Errorf("qpq: delete account: server returned success=false") + } + return nil +} + +// RegisterStart initiates OPAQUE registration and returns the server's response bytes. +// +// The OPAQUE protocol requires client-side cryptographic operations. +// The request parameter must be the serialized OPAQUE RegistrationRequest +// generated by an OPAQUE client library (e.g. github.com/cloudflare/circl/opaque). +// Process the returned server response with your OPAQUE library to produce +// the upload bytes for RegisterFinish. +func (c *Client) RegisterStart(ctx context.Context, username string, request []byte) (serverResponse []byte, err error) { + future, release := c.conn.Client().OpaqueRegisterStart(ctx, func(p node.NodeService_opaqueRegisterStart_Params) error { + if err := p.SetUsername(username); err != nil { + return err + } + return p.SetRequest(request) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return nil, fmt.Errorf("qpq: register start: %w", err) + } + resp, err := res.Response() + if err != nil { + return nil, fmt.Errorf("qpq: register start: read response: %w", err) + } + out := make([]byte, len(resp)) + copy(out, resp) + return out, nil +} + +// RegisterFinish completes OPAQUE registration with the upload and identity key. +func (c *Client) RegisterFinish(ctx context.Context, username string, upload, identityKey []byte) error { + future, release := c.conn.Client().OpaqueRegisterFinish(ctx, func(p node.NodeService_opaqueRegisterFinish_Params) error { + if err := p.SetUsername(username); err != nil { + return err + } + if err := p.SetUpload(upload); err != nil { + return err + } + return p.SetIdentityKey(identityKey) + }) + defer release() + + _, err := future.Struct() + if err != nil { + return fmt.Errorf("qpq: register finish: %w", err) + } + return nil +} + +// LoginStart initiates OPAQUE login and returns the server's response bytes. +func (c *Client) LoginStart(ctx context.Context, username string, request []byte) (serverResponse []byte, err error) { + future, release := c.conn.Client().OpaqueLoginStart(ctx, func(p node.NodeService_opaqueLoginStart_Params) error { + if err := p.SetUsername(username); err != nil { + return err + } + return p.SetRequest(request) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return nil, fmt.Errorf("qpq: login start: %w", err) + } + resp, err := res.Response() + if err != nil { + return nil, fmt.Errorf("qpq: login start: read response: %w", err) + } + out := make([]byte, len(resp)) + copy(out, resp) + return out, nil +} + +// LoginFinish completes OPAQUE login and stores the session token. +// The finalization parameter is the OPAQUE finalization message from +// your OPAQUE client library. The identityKey is your public identity key. +func (c *Client) LoginFinish(ctx context.Context, username string, finalization, identityKey []byte) error { + future, release := c.conn.Client().OpaqueLoginFinish(ctx, func(p node.NodeService_opaqueLoginFinish_Params) error { + if err := p.SetUsername(username); err != nil { + return err + } + if err := p.SetFinalization(finalization); err != nil { + return err + } + return p.SetIdentityKey(identityKey) + }) + defer release() + + res, err := future.Struct() + if err != nil { + return fmt.Errorf("qpq: login finish: %w", err) + } + token, err := res.SessionToken() + if err != nil { + return fmt.Errorf("qpq: login finish: read session token: %w", err) + } + c.token = make([]byte, len(token)) + copy(c.token, token) + return nil +} + +// extractMessages converts a Cap'n Proto Envelope_List into a slice of Message. +func extractMessages(envList node.Envelope_List, listErr error) ([]Message, error) { + if listErr != nil { + return nil, listErr + } + msgs := make([]Message, envList.Len()) + for i := range msgs { + env := envList.At(i) + data, err := env.Data() + if err != nil { + return nil, fmt.Errorf("read message %d data: %w", i, err) + } + dataCopy := make([]byte, len(data)) + copy(dataCopy, data) + msgs[i] = Message{ + Seq: env.Seq(), + Data: dataCopy, + } + } + return msgs, nil +} diff --git a/sdks/go/qpq/client_test.go b/sdks/go/qpq/client_test.go new file mode 100644 index 0000000..4430226 --- /dev/null +++ b/sdks/go/qpq/client_test.go @@ -0,0 +1,58 @@ +package qpq + +import ( + "testing" +) + +func TestSetSessionToken(t *testing.T) { + c := &Client{} + token := []byte("test-session-token-abc123") + + c.SetSessionToken(token) + + if string(c.token) != string(token) { + t.Errorf("expected token %q, got %q", token, c.token) + } +} + +func TestSetDeviceID(t *testing.T) { + c := &Client{} + id := []byte{0x01, 0x02, 0x03, 0x04} + + c.SetDeviceID(id) + + if len(c.deviceID) != 4 { + t.Fatalf("expected 4-byte device ID, got %d bytes", len(c.deviceID)) + } + for i, b := range id { + if c.deviceID[i] != b { + t.Errorf("deviceID[%d]: expected %d, got %d", i, b, c.deviceID[i]) + } + } +} + +func TestMessageStruct(t *testing.T) { + m := Message{Seq: 42, Data: []byte("hello")} + if m.Seq != 42 { + t.Errorf("expected Seq 42, got %d", m.Seq) + } + if string(m.Data) != "hello" { + t.Errorf("expected Data %q, got %q", "hello", m.Data) + } +} + +func TestOptionsDefaults(t *testing.T) { + opts := Options{ + Addr: "127.0.0.1:5001", + InsecureSkipVerify: true, + } + if opts.Addr != "127.0.0.1:5001" { + t.Errorf("unexpected addr: %s", opts.Addr) + } + if !opts.InsecureSkipVerify { + t.Error("expected InsecureSkipVerify to be true") + } + if opts.CACertPath != "" { + t.Error("expected empty CACertPath") + } +} diff --git a/sdks/go/transport/transport.go b/sdks/go/transport/transport.go new file mode 100644 index 0000000..b20211b --- /dev/null +++ b/sdks/go/transport/transport.go @@ -0,0 +1,126 @@ +// Package transport provides the low-level QUIC+TLS connection to a quicproquo server +// and bootstraps the Cap'n Proto RPC client over a single bidirectional QUIC stream. +package transport + +import ( + "context" + "crypto/tls" + "crypto/x509" + "fmt" + "os" + "time" + + capnp "capnproto.org/go/capnp/v3" + "capnproto.org/go/capnp/v3/rpc" + "github.com/quic-go/quic-go" + + "quicproquo.dev/sdk/go/proto/node" +) + +// ConnectOptions configures the connection to a quicproquo server. +type ConnectOptions struct { + // Addr is the host:port of the server (e.g. "127.0.0.1:5001"). + Addr string + + // InsecureSkipVerify disables TLS certificate verification (dev mode only). + InsecureSkipVerify bool + + // CACertPath is the path to a PEM-encoded CA certificate for production use. + // When set, the server's certificate is verified against this CA. + CACertPath string + + // ConnectTimeout is the maximum time to wait for the QUIC handshake. + // Defaults to 10 seconds if zero. + ConnectTimeout time.Duration +} + +// Connection holds the QUIC connection, Cap'n Proto RPC state, and the +// bootstrapped NodeService client. +type Connection struct { + quicConn *quic.Conn + stream *quic.Stream + rpcConn *rpc.Conn + client node.NodeService +} + +// Connect establishes a QUIC+TLS 1.3 connection to the server, opens a single +// bidirectional stream, and bootstraps the Cap'n Proto RPC NodeService client. +func Connect(ctx context.Context, opts ConnectOptions) (*Connection, error) { + tlsCfg, err := buildTLSConfig(opts) + if err != nil { + return nil, fmt.Errorf("transport: build TLS config: %w", err) + } + + quicCfg := &quic.Config{ + MaxIdleTimeout: 300 * time.Second, + KeepAlivePeriod: 30 * time.Second, + } + + timeout := opts.ConnectTimeout + if timeout == 0 { + timeout = 10 * time.Second + } + dialCtx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + qConn, err := quic.DialAddr(dialCtx, opts.Addr, tlsCfg, quicCfg) + if err != nil { + return nil, fmt.Errorf("transport: QUIC dial %s: %w", opts.Addr, err) + } + + stream, err := qConn.OpenStream() + if err != nil { + qConn.CloseWithError(1, "failed to open stream") + return nil, fmt.Errorf("transport: open bidi stream: %w", err) + } + + capnpTransport := rpc.NewStreamTransport(stream) + rpcConn := rpc.NewConn(capnpTransport, nil) + + client := node.NodeService(rpcConn.Bootstrap(ctx)) + + return &Connection{ + quicConn: qConn, + stream: stream, + rpcConn: rpcConn, + client: client, + }, nil +} + +// Client returns the bootstrapped NodeService RPC client. +func (c *Connection) Client() node.NodeService { + return c.client +} + +// Close gracefully shuts down the RPC connection and underlying QUIC transport. +func (c *Connection) Close() error { + capnp.Client(c.client).Release() + c.rpcConn.Close() + return c.quicConn.CloseWithError(0, "client closed") +} + +func buildTLSConfig(opts ConnectOptions) (*tls.Config, error) { + cfg := &tls.Config{ + NextProtos: []string{"capnp"}, + MinVersion: tls.VersionTLS13, + } + + if opts.InsecureSkipVerify { + cfg.InsecureSkipVerify = true + return cfg, nil + } + + if opts.CACertPath != "" { + caPEM, err := os.ReadFile(opts.CACertPath) + if err != nil { + return nil, fmt.Errorf("read CA cert %s: %w", opts.CACertPath, err) + } + pool := x509.NewCertPool() + if !pool.AppendCertsFromPEM(caPEM) { + return nil, fmt.Errorf("CA cert %s: no valid PEM certificates found", opts.CACertPath) + } + cfg.RootCAs = pool + } + + return cfg, nil +} diff --git a/sdks/go/transport/transport_test.go b/sdks/go/transport/transport_test.go new file mode 100644 index 0000000..c816a48 --- /dev/null +++ b/sdks/go/transport/transport_test.go @@ -0,0 +1,69 @@ +package transport + +import ( + "testing" + "time" +) + +func TestConnectOptionsDefaults(t *testing.T) { + opts := ConnectOptions{ + Addr: "127.0.0.1:5001", + InsecureSkipVerify: true, + } + if opts.Addr != "127.0.0.1:5001" { + t.Errorf("unexpected addr: %s", opts.Addr) + } + if !opts.InsecureSkipVerify { + t.Error("expected InsecureSkipVerify=true") + } + if opts.ConnectTimeout != 0 { + t.Errorf("expected zero timeout, got %v", opts.ConnectTimeout) + } +} + +func TestBuildTLSConfigInsecure(t *testing.T) { + cfg, err := buildTLSConfig(ConnectOptions{InsecureSkipVerify: true}) + if err != nil { + t.Fatalf("buildTLSConfig: %v", err) + } + if !cfg.InsecureSkipVerify { + t.Error("expected InsecureSkipVerify=true in TLS config") + } + if len(cfg.NextProtos) != 1 || cfg.NextProtos[0] != "capnp" { + t.Errorf("expected ALPN [capnp], got %v", cfg.NextProtos) + } + if cfg.MinVersion != 0x0304 { // tls.VersionTLS13 + t.Errorf("expected TLS 1.3 min version (0x0304), got 0x%04x", cfg.MinVersion) + } +} + +func TestBuildTLSConfigWithMissingCA(t *testing.T) { + _, err := buildTLSConfig(ConnectOptions{CACertPath: "/nonexistent/ca.pem"}) + if err == nil { + t.Error("expected error for missing CA cert") + } +} + +func TestBuildTLSConfigDefault(t *testing.T) { + cfg, err := buildTLSConfig(ConnectOptions{}) + if err != nil { + t.Fatalf("buildTLSConfig: %v", err) + } + if cfg.InsecureSkipVerify { + t.Error("expected InsecureSkipVerify=false by default") + } + if cfg.NextProtos[0] != "capnp" { + t.Error("expected ALPN capnp") + } +} + +func TestConnectTimeoutDefault(t *testing.T) { + opts := ConnectOptions{Addr: "127.0.0.1:5001"} + timeout := opts.ConnectTimeout + if timeout == 0 { + timeout = 10 * time.Second + } + if timeout != 10*time.Second { + t.Errorf("expected 10s default timeout, got %v", timeout) + } +}