diff --git a/.github/workflows/test-ledger.yml b/.github/workflows/test-ledger.yml new file mode 100644 index 0000000..627ee23 --- /dev/null +++ b/.github/workflows/test-ledger.yml @@ -0,0 +1,13 @@ +on: + push: + paths: + - clients/ledger/** +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: '1.22.1' + - run: make test-ledger diff --git a/.github/workflows/test-registry.yml b/.github/workflows/test-registry.yml index 9ead23a..14a55cc 100644 --- a/.github/workflows/test-registry.yml +++ b/.github/workflows/test-registry.yml @@ -1,7 +1,7 @@ on: push: paths: - - registry/** + - clients/registry/** jobs: test: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 1bbe377..842ac93 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,10 @@ test: go test -v -cover ./... test-registry: - REGISTRY_TEST_ENABLE=true go test -v -cover ./registry/... + REGISTRY_TEST_ENABLE=true go test -v -cover ./clients/registry/... + +test-ledger: + REGISTRY_TEST_ENABLE=true go test -v -cover ./clients/ledger/... check-moc: find ic -type f -name '*.mo' -print0 | xargs -0 $(shell dfx cache show)/moc --check @@ -16,7 +19,8 @@ test-cover: gen: cd candid && go generate cd pocketic && go generate - cd registry && go generate + cd clients/ledger && go generate + cd clients/registry && go generate gen-ic: go run ic/testdata/gen.go diff --git a/agent.go b/agent.go index c596b67..c829798 100644 --- a/agent.go +++ b/agent.go @@ -1,6 +1,7 @@ package agent import ( + "context" "crypto/rand" "encoding/binary" "encoding/hex" @@ -10,11 +11,13 @@ import ( "reflect" "time" + "github.com/aviate-labs/agent-go/candid/idl" "github.com/aviate-labs/agent-go/certification" "github.com/aviate-labs/agent-go/certification/hashtree" "github.com/aviate-labs/agent-go/identity" "github.com/aviate-labs/agent-go/principal" "github.com/fxamacker/cbor/v2" + "google.golang.org/protobuf/proto" ) // DefaultConfig is the default configuration for an Agent. @@ -89,9 +92,67 @@ func uint64FromBytes(raw []byte) uint64 { } } +type APIRequest[In, Out any] struct { + a *Agent + unmarshal func([]byte, Out) error + typ RequestType + methodName string + effectiveCanisterID principal.Principal + requestID RequestID + data []byte +} + +func createAPIRequest[In, Out any]( + a *Agent, + marshal func(In) ([]byte, error), + unmarshal func([]byte, Out) error, + typ RequestType, + canisterID principal.Principal, + effectiveCanisterID principal.Principal, + methodName string, + in In, +) (*APIRequest[In, Out], error) { + rawArgs, err := marshal(in) + if err != nil { + return nil, err + } + nonce, err := newNonce() + if err != nil { + return nil, err + } + requestID, data, err := a.sign(Request{ + Type: typ, + Sender: a.Sender(), + CanisterID: canisterID, + MethodName: methodName, + Arguments: rawArgs, + IngressExpiry: a.expiryDate(), + Nonce: nonce, + }) + if err != nil { + return nil, err + } + return &APIRequest[In, Out]{ + a: a, + unmarshal: unmarshal, + typ: typ, + methodName: methodName, + effectiveCanisterID: effectiveCanisterID, + requestID: *requestID, + data: data, + }, nil +} + +// WithEffectiveCanisterID sets the effective canister ID for the Call. +func (c *APIRequest[In, Out]) WithEffectiveCanisterID(canisterID principal.Principal) *APIRequest[In, Out] { + c.effectiveCanisterID = canisterID + return c +} + // Agent is a client for the Internet Computer. type Agent struct { client Client + ctx context.Context identity identity.Identity ingressExpiry time.Duration rootKey []byte @@ -103,7 +164,7 @@ type Agent struct { // New returns a new Agent based on the given configuration. func New(cfg Config) (*Agent, error) { if cfg.IngressExpiry == 0 { - cfg.IngressExpiry = time.Minute + cfg.IngressExpiry = 5 * time.Minute } // By default, use the anonymous identity. var id identity.Identity = new(identity.AnonymousIdentity) @@ -139,6 +200,7 @@ func New(cfg Config) (*Agent, error) { } return &Agent{ client: client, + ctx: context.Background(), identity: id, ingressExpiry: cfg.IngressExpiry, rootKey: rootKey, @@ -154,6 +216,44 @@ func (a Agent) Client() *Client { return &a.client } +// CreateCandidAPIRequest creates a new api request to the given canister and method. +func (a *Agent) CreateCandidAPIRequest(typ RequestType, canisterID principal.Principal, methodName string, args ...any) (*CandidAPIRequest, error) { + return createAPIRequest[[]any, []any]( + a, + idl.Marshal, + idl.Unmarshal, + typ, + canisterID, + effectiveCanisterID(canisterID, args), + methodName, + args, + ) +} + +// CreateProtoAPIRequest creates a new api request to the given canister and method. +func (a *Agent) CreateProtoAPIRequest(typ RequestType, canisterID principal.Principal, methodName string, message proto.Message) (*ProtoAPIRequest, error) { + return createAPIRequest[proto.Message, proto.Message]( + a, + func(m proto.Message) ([]byte, error) { + raw, err := proto.Marshal(m) + if err != nil { + return nil, err + } + if len(raw) == 0 { + // Protobuf arg are not allowed to be empty. + return []byte{}, nil + } + return raw, nil + }, + proto.Unmarshal, + typ, + canisterID, + canisterID, + methodName, + message, + ) +} + // GetCanisterControllers returns the list of principals that can control the given canister. func (a Agent) GetCanisterControllers(canisterID principal.Principal) ([]principal.Principal, error) { resp, err := a.GetCanisterInfo(canisterID, "controllers") @@ -252,7 +352,9 @@ func (a Agent) Sender() principal.Principal { } func (a Agent) call(ecID principal.Principal, data []byte) ([]byte, error) { - return a.client.Call(ecID, data) + ctx, cancel := context.WithTimeout(a.ctx, a.ingressExpiry) + defer cancel() + return a.client.Call(ctx, ecID, data) } func (a Agent) expiryDate() uint64 { @@ -299,7 +401,9 @@ func (a Agent) poll(ecID principal.Principal, requestID RequestID) ([]byte, erro } func (a Agent) readState(ecID principal.Principal, data []byte) (map[string][]byte, error) { - resp, err := a.client.ReadState(ecID, data) + ctx, cancel := context.WithTimeout(a.ctx, a.ingressExpiry) + defer cancel() + resp, err := a.client.ReadState(ctx, ecID, data) if err != nil { return nil, err } @@ -336,7 +440,9 @@ func (a Agent) readStateCertificate(ecID principal.Principal, paths [][]hashtree } func (a Agent) readSubnetState(subnetID principal.Principal, data []byte) (map[string][]byte, error) { - resp, err := a.client.ReadSubnetState(subnetID, data) + ctx, cancel := context.WithTimeout(a.ctx, a.ingressExpiry) + defer cancel() + resp, err := a.client.ReadSubnetState(ctx, subnetID, data) if err != nil { return nil, err } @@ -385,12 +491,14 @@ func (a Agent) sign(request Request) (*RequestID, []byte, error) { return &requestID, data, nil } +type CandidAPIRequest = APIRequest[[]any, []any] + // Config is the configuration for an Agent. type Config struct { // Identity is the identity used by the Agent. Identity identity.Identity // IngressExpiry is the duration for which an ingress message is valid. - // The default is set to 1 minute. + // The default is set to 5 minutes. IngressExpiry time.Duration // ClientConfig is the configuration for the underlying Client. ClientConfig *ClientConfig @@ -405,3 +513,5 @@ type Config struct { // DisableSignedQueryVerification disables the verification of signed queries. DisableSignedQueryVerification bool } + +type ProtoAPIRequest = APIRequest[proto.Message, proto.Message] diff --git a/call.go b/call.go index 6d4ab34..e231ede 100644 --- a/call.go +++ b/call.go @@ -1,117 +1,48 @@ package agent import ( - "github.com/aviate-labs/agent-go/candid/idl" "github.com/aviate-labs/agent-go/principal" "google.golang.org/protobuf/proto" ) -// Call calls a method on a canister and unmarshals the result into the given values. -func (a Agent) Call(canisterID principal.Principal, methodName string, args []any, values []any) error { - call, err := a.CreateCall(canisterID, methodName, args...) - if err != nil { - return err - } - return call.CallAndWait(values...) -} - -// CallProto calls a method on a canister and unmarshals the result into the given proto message. -func (a Agent) CallProto(canisterID principal.Principal, methodName string, in, out proto.Message) error { - payload, err := proto.Marshal(in) - if err != nil { - return err - } - requestID, data, err := a.sign(Request{ - Type: RequestTypeCall, - Sender: a.Sender(), - IngressExpiry: a.expiryDate(), - CanisterID: canisterID, - MethodName: methodName, - Arguments: payload, - }) - if err != nil { - return err - } - if _, err := a.call(canisterID, data); err != nil { - return err - } - raw, err := a.poll(canisterID, *requestID) - if err != nil { - return err - } - return proto.Unmarshal(raw, out) -} - -// CreateCall creates a new Call to the given canister and method. -func (a *Agent) CreateCall(canisterID principal.Principal, methodName string, args ...any) (*Call, error) { - rawArgs, err := idl.Marshal(args) - if err != nil { - return nil, err - } - if len(args) == 0 { - // Default to the empty Candid argument list. - rawArgs = []byte{'D', 'I', 'D', 'L', 0, 0} - } - nonce, err := newNonce() - if err != nil { - return nil, err - } - requestID, data, err := a.sign(Request{ - Type: RequestTypeCall, - Sender: a.Sender(), - CanisterID: canisterID, - MethodName: methodName, - Arguments: rawArgs, - IngressExpiry: a.expiryDate(), - Nonce: nonce, - }) - if err != nil { - return nil, err - } - return &Call{ - a: a, - methodName: methodName, - effectiveCanisterID: effectiveCanisterID(canisterID, args), - requestID: *requestID, - data: data, - }, nil -} - -// Call is an intermediate representation of a Call to a canister. -type Call struct { - a *Agent - methodName string - effectiveCanisterID principal.Principal - requestID RequestID - data []byte -} - // Call calls a method on a canister, it does not wait for the result. -func (c Call) Call() error { +func (c APIRequest[_, _]) Call() error { c.a.logger.Printf("[AGENT] CALL %s %s (%x)", c.effectiveCanisterID, c.methodName, c.requestID) _, err := c.a.call(c.effectiveCanisterID, c.data) return err } // CallAndWait calls a method on a canister and waits for the result. -func (c Call) CallAndWait(values ...any) error { +func (c APIRequest[_, Out]) CallAndWait(out Out) error { if err := c.Call(); err != nil { return err } - return c.Wait(values...) + return c.Wait(out) } // Wait waits for the result of the Call and unmarshals it into the given values. -func (c Call) Wait(values ...any) error { +func (c APIRequest[_, Out]) Wait(out Out) error { raw, err := c.a.poll(c.effectiveCanisterID, c.requestID) if err != nil { return err } - return idl.Unmarshal(raw, values) + return c.unmarshal(raw, out) } -// WithEffectiveCanisterID sets the effective canister ID for the Call. -func (c *Call) WithEffectiveCanisterID(canisterID principal.Principal) *Call { - c.effectiveCanisterID = canisterID - return c +// Call calls a method on a canister and unmarshals the result into the given values. +func (a Agent) Call(canisterID principal.Principal, methodName string, in []any, out []any) error { + call, err := a.CreateCandidAPIRequest(RequestTypeCall, canisterID, methodName, in...) + if err != nil { + return err + } + return call.CallAndWait(out) +} + +// CallProto calls a method on a canister and unmarshals the result into the given proto message. +func (a Agent) CallProto(canisterID principal.Principal, methodName string, in, out proto.Message) error { + call, err := a.CreateProtoAPIRequest(RequestTypeCall, canisterID, methodName, in) + if err != nil { + return err + } + return call.CallAndWait(out) } diff --git a/client.go b/client.go index b45e57b..ffedc4b 100644 --- a/client.go +++ b/client.go @@ -2,6 +2,7 @@ package agent import ( "bytes" + "context" "fmt" "io" "net/http" @@ -40,10 +41,14 @@ func NewClientWithLogger(cfg ClientConfig, logger Logger) Client { } } -func (c Client) Call(canisterID principal.Principal, data []byte) ([]byte, error) { +func (c Client) Call(ctx context.Context, canisterID principal.Principal, data []byte) ([]byte, error) { u := c.url(fmt.Sprintf("/api/v2/canister/%s/call", canisterID.Encode())) c.logger.Printf("[CLIENT] CALL %s", u) - resp, err := c.client.Post(u, "application/cbor", bytes.NewBuffer(data)) + req, err := c.newRequest(ctx, "POST", u, bytes.NewBuffer(data)) + if err != nil { + return nil, err + } + resp, err := c.client.Do(req) if err != nil { return nil, err } @@ -63,16 +68,16 @@ func (c Client) Call(canisterID principal.Principal, data []byte) ([]byte, error } } -func (c Client) Query(canisterID principal.Principal, data []byte) ([]byte, error) { - return c.post("query", canisterID, data) +func (c Client) Query(ctx context.Context, canisterID principal.Principal, data []byte) ([]byte, error) { + return c.post(ctx, "query", canisterID, data) } -func (c Client) ReadState(canisterID principal.Principal, data []byte) ([]byte, error) { - return c.post("read_state", canisterID, data) +func (c Client) ReadState(ctx context.Context, canisterID principal.Principal, data []byte) ([]byte, error) { + return c.post(ctx, "read_state", canisterID, data) } -func (c Client) ReadSubnetState(subnetID principal.Principal, data []byte) ([]byte, error) { - return c.postSubnet("read_state", subnetID, data) +func (c Client) ReadSubnetState(ctx context.Context, subnetID principal.Principal, data []byte) ([]byte, error) { + return c.postSubnet(ctx, "read_state", subnetID, data) } // Status returns the status of the IC. @@ -94,10 +99,23 @@ func (c Client) get(path string) ([]byte, error) { return io.ReadAll(resp.Body) } -func (c Client) post(path string, canisterID principal.Principal, data []byte) ([]byte, error) { +func (c Client) newRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error) { + req, err := http.NewRequestWithContext(ctx, method, url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/cbor") + return req, nil +} + +func (c Client) post(ctx context.Context, path string, canisterID principal.Principal, data []byte) ([]byte, error) { u := c.url(fmt.Sprintf("/api/v2/canister/%s/%s", canisterID.Encode(), path)) c.logger.Printf("[CLIENT] POST %s", u) - resp, err := c.client.Post(u, "application/cbor", bytes.NewBuffer(data)) + req, err := c.newRequest(ctx, "POST", u, bytes.NewBuffer(data)) + if err != nil { + return nil, err + } + resp, err := c.client.Do(req) if err != nil { return nil, err } @@ -110,10 +128,14 @@ func (c Client) post(path string, canisterID principal.Principal, data []byte) ( } } -func (c Client) postSubnet(path string, subnetID principal.Principal, data []byte) ([]byte, error) { +func (c Client) postSubnet(ctx context.Context, path string, subnetID principal.Principal, data []byte) ([]byte, error) { u := c.url(fmt.Sprintf("/api/v2/subnet/%s/%s", subnetID.Encode(), path)) c.logger.Printf("[CLIENT] POST %s", u) - resp, err := c.client.Post(u, "application/cbor", bytes.NewBuffer(data)) + req, err := c.newRequest(ctx, "POST", u, bytes.NewBuffer(data)) + if err != nil { + return nil, err + } + resp, err := c.client.Do(req) if err != nil { return nil, err } diff --git a/clients/ledger/client.go b/clients/ledger/client.go new file mode 100644 index 0000000..d190348 --- /dev/null +++ b/clients/ledger/client.go @@ -0,0 +1 @@ +package ledger diff --git a/clients/ledger/client_test.go b/clients/ledger/client_test.go new file mode 100644 index 0000000..f74d1e5 --- /dev/null +++ b/clients/ledger/client_test.go @@ -0,0 +1,13 @@ +package ledger_test + +import ( + "os" + "testing" +) + +func checkEnabled(t *testing.T) { + // The reason for this is that the tests are very slow. + if os.Getenv("LEDGER_TEST_ENABLE") != "true" { + t.Skip("Skipping registry tests. Set LEDGER_TEST_ENABLE=true to enable.") + } +} diff --git a/clients/ledger/dataprovider.go b/clients/ledger/dataprovider.go new file mode 100644 index 0000000..3a45b6f --- /dev/null +++ b/clients/ledger/dataprovider.go @@ -0,0 +1,139 @@ +package ledger + +import ( + "fmt" + "github.com/aviate-labs/agent-go" + v1 "github.com/aviate-labs/agent-go/clients/ledger/proto/v1" + "github.com/aviate-labs/agent-go/ic" + "github.com/aviate-labs/agent-go/principal" +) + +const MaxBlocksPerRequest = 2000 + +type BlockIndex uint64 + +type DataProvider struct { + a *agent.Agent +} + +func NewDataProvider() (*DataProvider, error) { + a, err := agent.New(agent.DefaultConfig) + if err != nil { + return nil, fmt.Errorf("failed to create agent: %w", err) + } + return &DataProvider{a: a}, nil +} + +func (d DataProvider) GetArchiveIndex() ([]*v1.ArchiveIndexEntry, error) { + var resp v1.ArchiveIndexResponse + if err := d.a.QueryProto( + ic.LEDGER_PRINCIPAL, + "get_archive_index_pb", + nil, + &resp, + ); err != nil { + return nil, fmt.Errorf("failed to get archive index: %w", err) + } + return resp.Entries, nil +} + +func (d DataProvider) GetRawBlock(height BlockIndex) (*v1.EncodedBlock, error) { + var resp v1.BlockResponse + if err := d.a.QueryProto( + ic.LEDGER_PRINCIPAL, + "block_pb", + &v1.BlockRequest{ + BlockHeight: uint64(height), + }, + &resp, + ); err != nil { + return nil, fmt.Errorf("failed to get block: %w", err) + } + switch blockResponse := resp.BlockContent.(type) { + case *v1.BlockResponse_Block: + return blockResponse.Block, nil + case *v1.BlockResponse_CanisterId: + archiveCanisterID := principal.Principal{Raw: blockResponse.CanisterId.SerializedId} + var archiveResp v1.BlockResponse + if err := d.a.QueryProto( + archiveCanisterID, + "get_block_pb", + &v1.BlockRequest{ + BlockHeight: uint64(height), + }, + &archiveResp, + ); err != nil { + return nil, fmt.Errorf("failed to get blocks: %w", err) + } + // Will never return a CanisterId block. + return archiveResp.GetBlock(), nil + default: + return nil, fmt.Errorf("unexpected block content type: %T", blockResponse) + } +} + +func (d DataProvider) GetRawBlocks(start, end BlockIndex) ([]*v1.EncodedBlock, error) { + if end-start < 2000 { + blocks, err := d.GetRawBlocksRange(ic.LEDGER_PRINCIPAL, start, end) + if err == nil { + return blocks, nil + } + } + archives, err := d.GetArchiveIndex() + if err != nil { + return nil, fmt.Errorf("failed to get archive index: %w", err) + } + var blocks []*v1.EncodedBlock + for _, archive := range archives { + if archive.HeightTo < uint64(start) || uint64(end) < archive.HeightFrom { + continue + } + for start < min(BlockIndex(archive.HeightTo), end) { + archiveEnd := min(end, BlockIndex(archive.HeightTo), start+MaxBlocksPerRequest) + archiveBlocks, err := d.GetRawBlocksRange(principal.Principal{Raw: archive.CanisterId.SerializedId}, start, archiveEnd) + if err != nil { + return nil, fmt.Errorf("failed to get archive blocks: %w", err) + } + blocks = append(blocks, archiveBlocks...) + start += BlockIndex(len(archiveBlocks)) + } + } + return blocks, nil +} + +func (d DataProvider) GetRawBlocksRange(canisterID principal.Principal, start, end BlockIndex) ([]*v1.EncodedBlock, error) { + var resp v1.GetBlocksResponse + if err := d.a.QueryProto( + canisterID, + "get_blocks_pb", + &v1.GetBlocksRequest{ + Start: uint64(start), + Length: uint64(end - start), + }, + &resp, + ); err != nil { + return nil, fmt.Errorf("failed to get blocks: %w", err) + } + switch blocksResponse := resp.GetBlocksContent.(type) { + case *v1.GetBlocksResponse_Blocks: + return blocksResponse.Blocks.Blocks, nil + case *v1.GetBlocksResponse_Error: + return nil, fmt.Errorf("failed to get blocks: %s", blocksResponse.Error) + default: + return nil, fmt.Errorf("unexpected get block content type: %T", blocksResponse) + } +} + +func (d DataProvider) GetTipOfChain() (*BlockIndex, error) { + var resp v1.TipOfChainResponse + if err := d.a.QueryProto( + ic.LEDGER_PRINCIPAL, + "tip_of_chain_pb", + &v1.TipOfChainRequest{}, + &resp, + ); err != nil { + return nil, fmt.Errorf("failed to get tip of chain: %w", err) + } + height := BlockIndex(resp.ChainLength.Height) + return &height, nil +} diff --git a/clients/ledger/dataprovider_test.go b/clients/ledger/dataprovider_test.go new file mode 100644 index 0000000..6d16a39 --- /dev/null +++ b/clients/ledger/dataprovider_test.go @@ -0,0 +1,47 @@ +package ledger_test + +import ( + "github.com/aviate-labs/agent-go/clients/ledger" + "testing" +) + +func TestDataProvider_GetRawBlock(t *testing.T) { + checkEnabled(t) + + dp, err := ledger.NewDataProvider() + if err != nil { + t.Fatal(err) + } + if _, err := dp.GetRawBlock(0); err != nil { + t.Error(err) + } +} + +func TestDataProvider_GetRawBlocks(t *testing.T) { + checkEnabled(t) + + dp, err := ledger.NewDataProvider() + if err != nil { + t.Fatal(err) + } + n := 3 * ledger.MaxBlocksPerRequest + blocks, err := dp.GetRawBlocks(0, ledger.BlockIndex(n)) + if err != nil { + t.Error(err) + } + if len(blocks) != n { + t.Errorf("expected %d blocks, got %d", n, len(blocks)) + } +} + +func TestDataProvider_GetTipOfChain(t *testing.T) { + checkEnabled(t) + + dp, err := ledger.NewDataProvider() + if err != nil { + t.Fatal(err) + } + if _, err := dp.GetTipOfChain(); err != nil { + t.Error(err) + } +} diff --git a/clients/ledger/proto.go b/clients/ledger/proto.go new file mode 100644 index 0000000..71ae046 --- /dev/null +++ b/clients/ledger/proto.go @@ -0,0 +1,4 @@ +package ledger + +//go:generate go install google.golang.org/protobuf/cmd/protoc-gen-go@latest +//go:generate protoc -I=testdata --go_out=. testdata/ledger.proto diff --git a/clients/ledger/proto/v1/ledger.pb.go b/clients/ledger/proto/v1/ledger.pb.go new file mode 100644 index 0000000..6e0b8a2 --- /dev/null +++ b/clients/ledger/proto/v1/ledger.pb.go @@ -0,0 +1,4339 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.26.1 +// source: ledger.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var ( + file_ledger_proto_rawDescOnce sync.Once + file_ledger_proto_rawDescData = file_ledger_proto_rawDesc +) + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional bool tui_signed_display_q2_2021 = 20001; + E_TuiSignedDisplayQ2_2021 = &file_ledger_proto_extTypes[1] +) + +// Extension fields to descriptorpb.MessageOptions. +var ( + // optional bool tui_signed_message = 20000; + E_TuiSignedMessage = &file_ledger_proto_extTypes[0] +) + +var File_ledger_proto protoreflect.FileDescriptor + +var file_ledger_proto_depIdxs = []int32{ + 46, // 0: ic_ledger.pb.v1.LedgerInit.minting_account:type_name -> ic_ledger.pb.v1.AccountIdentifier + 39, // 1: ic_ledger.pb.v1.LedgerInit.initial_values:type_name -> ic_ledger.pb.v1.Account + 0, // 2: ic_ledger.pb.v1.LedgerInit.archive_canister:type_name -> ic_ledger.pb.v1.PrincipalId + 48, // 3: ic_ledger.pb.v1.SendRequest.memo:type_name -> ic_ledger.pb.v1.Memo + 35, // 4: ic_ledger.pb.v1.SendRequest.payment:type_name -> ic_ledger.pb.v1.Payment + 34, // 5: ic_ledger.pb.v1.SendRequest.max_fee:type_name -> ic_ledger.pb.v1.Tokens + 47, // 6: ic_ledger.pb.v1.SendRequest.from_subaccount:type_name -> ic_ledger.pb.v1.Subaccount + 46, // 7: ic_ledger.pb.v1.SendRequest.to:type_name -> ic_ledger.pb.v1.AccountIdentifier + 36, // 8: ic_ledger.pb.v1.SendRequest.created_at:type_name -> ic_ledger.pb.v1.BlockIndex + 50, // 9: ic_ledger.pb.v1.SendRequest.created_at_time:type_name -> ic_ledger.pb.v1.TimeStamp + 36, // 10: ic_ledger.pb.v1.SendResponse.resulting_height:type_name -> ic_ledger.pb.v1.BlockIndex + 36, // 11: ic_ledger.pb.v1.NotifyRequest.block_height:type_name -> ic_ledger.pb.v1.BlockIndex + 34, // 12: ic_ledger.pb.v1.NotifyRequest.max_fee:type_name -> ic_ledger.pb.v1.Tokens + 47, // 13: ic_ledger.pb.v1.NotifyRequest.from_subaccount:type_name -> ic_ledger.pb.v1.Subaccount + 0, // 14: ic_ledger.pb.v1.NotifyRequest.to_canister:type_name -> ic_ledger.pb.v1.PrincipalId + 47, // 15: ic_ledger.pb.v1.NotifyRequest.to_subaccount:type_name -> ic_ledger.pb.v1.Subaccount + 0, // 16: ic_ledger.pb.v1.TransactionNotificationRequest.from:type_name -> ic_ledger.pb.v1.PrincipalId + 47, // 17: ic_ledger.pb.v1.TransactionNotificationRequest.from_subaccount:type_name -> ic_ledger.pb.v1.Subaccount + 0, // 18: ic_ledger.pb.v1.TransactionNotificationRequest.to:type_name -> ic_ledger.pb.v1.PrincipalId + 47, // 19: ic_ledger.pb.v1.TransactionNotificationRequest.to_subaccount:type_name -> ic_ledger.pb.v1.Subaccount + 36, // 20: ic_ledger.pb.v1.TransactionNotificationRequest.block_height:type_name -> ic_ledger.pb.v1.BlockIndex + 34, // 21: ic_ledger.pb.v1.TransactionNotificationRequest.amount:type_name -> ic_ledger.pb.v1.Tokens + 48, // 22: ic_ledger.pb.v1.TransactionNotificationRequest.memo:type_name -> ic_ledger.pb.v1.Memo + 0, // 23: ic_ledger.pb.v1.CyclesNotificationResponse.created_canister_id:type_name -> ic_ledger.pb.v1.PrincipalId + 21, // 24: ic_ledger.pb.v1.CyclesNotificationResponse.refund:type_name -> ic_ledger.pb.v1.Refund + 22, // 25: ic_ledger.pb.v1.CyclesNotificationResponse.topped_up:type_name -> ic_ledger.pb.v1.ToppedUp + 46, // 26: ic_ledger.pb.v1.AccountBalanceRequest.account:type_name -> ic_ledger.pb.v1.AccountIdentifier + 34, // 27: ic_ledger.pb.v1.AccountBalanceResponse.balance:type_name -> ic_ledger.pb.v1.Tokens + 51, // 28: ic_ledger.pb.v1.TipOfChainResponse.certification:type_name -> ic_ledger.pb.v1.Certification + 36, // 29: ic_ledger.pb.v1.TipOfChainResponse.chain_length:type_name -> ic_ledger.pb.v1.BlockIndex + 34, // 30: ic_ledger.pb.v1.TotalSupplyResponse.total_supply:type_name -> ic_ledger.pb.v1.Tokens + 50, // 31: ic_ledger.pb.v1.LedgerArchiveRequest.timestamp:type_name -> ic_ledger.pb.v1.TimeStamp + 18, // 32: ic_ledger.pb.v1.BlockResponse.block:type_name -> ic_ledger.pb.v1.EncodedBlock + 0, // 33: ic_ledger.pb.v1.BlockResponse.canister_id:type_name -> ic_ledger.pb.v1.PrincipalId + 36, // 34: ic_ledger.pb.v1.Refund.refund:type_name -> ic_ledger.pb.v1.BlockIndex + 18, // 35: ic_ledger.pb.v1.EncodedBlocks.blocks:type_name -> ic_ledger.pb.v1.EncodedBlock + 23, // 36: ic_ledger.pb.v1.GetBlocksResponse.blocks:type_name -> ic_ledger.pb.v1.EncodedBlocks + 18, // 37: ic_ledger.pb.v1.IterBlocksResponse.blocks:type_name -> ic_ledger.pb.v1.EncodedBlock + 0, // 38: ic_ledger.pb.v1.ArchiveIndexEntry.canister_id:type_name -> ic_ledger.pb.v1.PrincipalId + 27, // 39: ic_ledger.pb.v1.ArchiveIndexResponse.entries:type_name -> ic_ledger.pb.v1.ArchiveIndexEntry + 37, // 40: ic_ledger.pb.v1.ArchiveAddRequest.blocks:type_name -> ic_ledger.pb.v1.Block + 0, // 41: ic_ledger.pb.v1.GetNodesResponse.nodes:type_name -> ic_ledger.pb.v1.PrincipalId + 34, // 42: ic_ledger.pb.v1.Payment.receiver_gets:type_name -> ic_ledger.pb.v1.Tokens + 38, // 43: ic_ledger.pb.v1.Block.parent_hash:type_name -> ic_ledger.pb.v1.Hash + 50, // 44: ic_ledger.pb.v1.Block.timestamp:type_name -> ic_ledger.pb.v1.TimeStamp + 40, // 45: ic_ledger.pb.v1.Block.transaction:type_name -> ic_ledger.pb.v1.Transaction + 46, // 46: ic_ledger.pb.v1.Account.identifier:type_name -> ic_ledger.pb.v1.AccountIdentifier + 34, // 47: ic_ledger.pb.v1.Account.balance:type_name -> ic_ledger.pb.v1.Tokens + 45, // 48: ic_ledger.pb.v1.Transaction.burn:type_name -> ic_ledger.pb.v1.Burn + 44, // 49: ic_ledger.pb.v1.Transaction.mint:type_name -> ic_ledger.pb.v1.Mint + 41, // 50: ic_ledger.pb.v1.Transaction.send:type_name -> ic_ledger.pb.v1.Send + 48, // 51: ic_ledger.pb.v1.Transaction.memo:type_name -> ic_ledger.pb.v1.Memo + 49, // 52: ic_ledger.pb.v1.Transaction.icrc1_memo:type_name -> ic_ledger.pb.v1.Icrc1Memo + 36, // 53: ic_ledger.pb.v1.Transaction.created_at:type_name -> ic_ledger.pb.v1.BlockIndex + 50, // 54: ic_ledger.pb.v1.Transaction.created_at_time:type_name -> ic_ledger.pb.v1.TimeStamp + 46, // 55: ic_ledger.pb.v1.Send.from:type_name -> ic_ledger.pb.v1.AccountIdentifier + 46, // 56: ic_ledger.pb.v1.Send.to:type_name -> ic_ledger.pb.v1.AccountIdentifier + 34, // 57: ic_ledger.pb.v1.Send.amount:type_name -> ic_ledger.pb.v1.Tokens + 34, // 58: ic_ledger.pb.v1.Send.max_fee:type_name -> ic_ledger.pb.v1.Tokens + 43, // 59: ic_ledger.pb.v1.Send.approve:type_name -> ic_ledger.pb.v1.Approve + 42, // 60: ic_ledger.pb.v1.Send.transfer_from:type_name -> ic_ledger.pb.v1.TransferFrom + 46, // 61: ic_ledger.pb.v1.TransferFrom.spender:type_name -> ic_ledger.pb.v1.AccountIdentifier + 34, // 62: ic_ledger.pb.v1.Approve.allowance:type_name -> ic_ledger.pb.v1.Tokens + 50, // 63: ic_ledger.pb.v1.Approve.expires_at:type_name -> ic_ledger.pb.v1.TimeStamp + 34, // 64: ic_ledger.pb.v1.Approve.expected_allowance:type_name -> ic_ledger.pb.v1.Tokens + 46, // 65: ic_ledger.pb.v1.Mint.to:type_name -> ic_ledger.pb.v1.AccountIdentifier + 34, // 66: ic_ledger.pb.v1.Mint.amount:type_name -> ic_ledger.pb.v1.Tokens + 46, // 67: ic_ledger.pb.v1.Burn.from:type_name -> ic_ledger.pb.v1.AccountIdentifier + 34, // 68: ic_ledger.pb.v1.Burn.amount:type_name -> ic_ledger.pb.v1.Tokens + 46, // 69: ic_ledger.pb.v1.Burn.spender:type_name -> ic_ledger.pb.v1.AccountIdentifier + 34, // 70: ic_ledger.pb.v1.TransferFeeResponse.transfer_fee:type_name -> ic_ledger.pb.v1.Tokens + 54, // 71: ic_ledger.pb.v1.tui_signed_message:extendee -> google.protobuf.MessageOptions + 55, // 72: ic_ledger.pb.v1.tui_signed_display_q2_2021:extendee -> google.protobuf.FieldOptions + 73, // [73:73] is the sub-list for method output_type + 73, // [73:73] is the sub-list for method input_type + 73, // [73:73] is the sub-list for extension type_name + 71, // [71:73] is the sub-list for extension extendee + 0, // [0:71] is the sub-list for field type_name +} + +var file_ledger_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 20000, + Name: "ic_ledger.pb.v1.tui_signed_message", + Tag: "varint,20000,opt,name=tui_signed_message", + Filename: "ledger.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 20001, + Name: "ic_ledger.pb.v1.tui_signed_display_q2_2021", + Tag: "varint,20001,opt,name=tui_signed_display_q2_2021", + Filename: "ledger.proto", + }, +} + +var file_ledger_proto_goTypes = []any{ + (*PrincipalId)(nil), // 0: ic_ledger.pb.v1.PrincipalId + (*LedgerInit)(nil), // 1: ic_ledger.pb.v1.LedgerInit + (*LedgerUpgrade)(nil), // 2: ic_ledger.pb.v1.LedgerUpgrade + (*SendRequest)(nil), // 3: ic_ledger.pb.v1.SendRequest + (*SendResponse)(nil), // 4: ic_ledger.pb.v1.SendResponse + (*NotifyRequest)(nil), // 5: ic_ledger.pb.v1.NotifyRequest + (*NotifyResponse)(nil), // 6: ic_ledger.pb.v1.NotifyResponse + (*TransactionNotificationRequest)(nil), // 7: ic_ledger.pb.v1.TransactionNotificationRequest + (*TransactionNotificationResponse)(nil), // 8: ic_ledger.pb.v1.TransactionNotificationResponse + (*CyclesNotificationResponse)(nil), // 9: ic_ledger.pb.v1.CyclesNotificationResponse + (*AccountBalanceRequest)(nil), // 10: ic_ledger.pb.v1.AccountBalanceRequest + (*AccountBalanceResponse)(nil), // 11: ic_ledger.pb.v1.AccountBalanceResponse + (*TipOfChainRequest)(nil), // 12: ic_ledger.pb.v1.TipOfChainRequest + (*TipOfChainResponse)(nil), // 13: ic_ledger.pb.v1.TipOfChainResponse + (*TotalSupplyRequest)(nil), // 14: ic_ledger.pb.v1.TotalSupplyRequest + (*TotalSupplyResponse)(nil), // 15: ic_ledger.pb.v1.TotalSupplyResponse + (*LedgerArchiveRequest)(nil), // 16: ic_ledger.pb.v1.LedgerArchiveRequest + (*BlockRequest)(nil), // 17: ic_ledger.pb.v1.BlockRequest + (*EncodedBlock)(nil), // 18: ic_ledger.pb.v1.EncodedBlock + (*BlockResponse)(nil), // 19: ic_ledger.pb.v1.BlockResponse + (*GetBlocksRequest)(nil), // 20: ic_ledger.pb.v1.GetBlocksRequest + (*Refund)(nil), // 21: ic_ledger.pb.v1.Refund + (*ToppedUp)(nil), // 22: ic_ledger.pb.v1.ToppedUp + (*EncodedBlocks)(nil), // 23: ic_ledger.pb.v1.EncodedBlocks + (*GetBlocksResponse)(nil), // 24: ic_ledger.pb.v1.GetBlocksResponse + (*IterBlocksRequest)(nil), // 25: ic_ledger.pb.v1.IterBlocksRequest + (*IterBlocksResponse)(nil), // 26: ic_ledger.pb.v1.IterBlocksResponse + (*ArchiveIndexEntry)(nil), // 27: ic_ledger.pb.v1.ArchiveIndexEntry + (*ArchiveIndexResponse)(nil), // 28: ic_ledger.pb.v1.ArchiveIndexResponse + (*ArchiveInit)(nil), // 29: ic_ledger.pb.v1.ArchiveInit + (*ArchiveAddRequest)(nil), // 30: ic_ledger.pb.v1.ArchiveAddRequest + (*ArchiveAddResponse)(nil), // 31: ic_ledger.pb.v1.ArchiveAddResponse + (*GetNodesRequest)(nil), // 32: ic_ledger.pb.v1.GetNodesRequest + (*GetNodesResponse)(nil), // 33: ic_ledger.pb.v1.GetNodesResponse + (*Tokens)(nil), // 34: ic_ledger.pb.v1.Tokens + (*Payment)(nil), // 35: ic_ledger.pb.v1.Payment + (*BlockIndex)(nil), // 36: ic_ledger.pb.v1.BlockIndex + (*Block)(nil), // 37: ic_ledger.pb.v1.Block + (*Hash)(nil), // 38: ic_ledger.pb.v1.Hash + (*Account)(nil), // 39: ic_ledger.pb.v1.Account + (*Transaction)(nil), // 40: ic_ledger.pb.v1.Transaction + (*Send)(nil), // 41: ic_ledger.pb.v1.Send + (*TransferFrom)(nil), // 42: ic_ledger.pb.v1.TransferFrom + (*Approve)(nil), // 43: ic_ledger.pb.v1.Approve + (*Mint)(nil), // 44: ic_ledger.pb.v1.Mint + (*Burn)(nil), // 45: ic_ledger.pb.v1.Burn + (*AccountIdentifier)(nil), // 46: ic_ledger.pb.v1.AccountIdentifier + (*Subaccount)(nil), // 47: ic_ledger.pb.v1.Subaccount + (*Memo)(nil), // 48: ic_ledger.pb.v1.Memo + (*Icrc1Memo)(nil), // 49: ic_ledger.pb.v1.Icrc1Memo + (*TimeStamp)(nil), // 50: ic_ledger.pb.v1.TimeStamp + (*Certification)(nil), // 51: ic_ledger.pb.v1.Certification + (*TransferFeeRequest)(nil), // 52: ic_ledger.pb.v1.TransferFeeRequest + (*TransferFeeResponse)(nil), // 53: ic_ledger.pb.v1.TransferFeeResponse + (*descriptorpb.MessageOptions)(nil), // 54: google.protobuf.MessageOptions + (*descriptorpb.FieldOptions)(nil), // 55: google.protobuf.FieldOptions +} + +var file_ledger_proto_msgTypes = make([]protoimpl.MessageInfo, 54) + +var file_ledger_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x3e, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, + 0x12, 0x29, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x0c, 0x73, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x49, 0x64, 0x3a, 0x04, 0x80, 0xe2, 0x09, + 0x01, 0x22, 0x98, 0x02, 0x0a, 0x0a, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, + 0x12, 0x4b, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0e, 0x6d, + 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3f, 0x0a, + 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, + 0x0a, 0x10, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, + 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, + 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x52, 0x0f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x43, + 0x61, 0x6e, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x0f, 0x0a, 0x0d, + 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x22, 0xbc, 0x03, + 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, + 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, + 0x6d, 0x6f, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x38, + 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, + 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, + 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, + 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x73, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x0e, 0x66, 0x72, + 0x6f, 0x6d, 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x02, + 0x74, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, + 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x42, 0x04, 0x88, 0xe2, + 0x09, 0x01, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x42, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x04, 0x80, 0xe2, 0x09, 0x01, 0x22, 0x56, 0x0a, 0x0c, + 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x10, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x22, 0xec, 0x02, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, + 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x36, 0x0a, 0x07, + 0x6d, 0x61, 0x78, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x06, 0x6d, 0x61, + 0x78, 0x46, 0x65, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x73, 0x75, 0x62, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, + 0x52, 0x0e, 0x66, 0x72, 0x6f, 0x6d, 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x43, 0x0a, 0x0b, 0x74, 0x6f, 0x5f, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, + 0x6c, 0x49, 0x64, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x0a, 0x74, 0x6f, 0x43, 0x61, 0x6e, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0d, 0x74, 0x6f, 0x5f, 0x73, 0x75, 0x62, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, + 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, + 0x0c, 0x74, 0x6f, 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0x80, + 0xe2, 0x09, 0x01, 0x22, 0x10, 0x0a, 0x0e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa4, 0x03, 0x0a, 0x1e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, + 0x61, 0x6c, 0x49, 0x64, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x44, 0x0a, 0x0f, 0x66, 0x72, + 0x6f, 0x6d, 0x5f, 0x73, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, + 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x0e, 0x66, 0x72, 0x6f, 0x6d, 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x2c, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, + 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x40, + 0x0a, 0x0d, 0x74, 0x6f, 0x5f, 0x73, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x0c, 0x74, 0x6f, 0x53, 0x75, 0x62, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x3e, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x2f, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x29, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x3d, 0x0a, 0x1f, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe5, 0x01, 0x0a, 0x1a, + 0x43, 0x79, 0x63, 0x6c, 0x65, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x13, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, + 0x70, 0x61, 0x6c, 0x49, 0x64, 0x48, 0x00, 0x52, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x43, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x65, + 0x66, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x66, + 0x75, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x12, 0x38, 0x0a, + 0x09, 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x55, 0x70, 0x48, 0x00, 0x52, 0x08, 0x74, + 0x6f, 0x70, 0x70, 0x65, 0x64, 0x55, 0x70, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x55, 0x0a, 0x15, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x07, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x4b, 0x0a, 0x16, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x07, + 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x54, 0x69, 0x70, 0x4f, 0x66, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x9a, 0x01, 0x0a, + 0x12, 0x54, 0x69, 0x70, 0x4f, 0x66, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x63, 0x5f, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0c, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x14, 0x0a, 0x12, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x51, 0x0a, 0x13, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, + 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x22, 0x50, 0x0a, 0x14, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x41, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x22, 0x31, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x24, 0x0a, 0x0c, 0x45, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x98, 0x01, + 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x35, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, + 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3f, 0x0a, 0x0b, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x61, 0x6e, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x42, 0x0f, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x40, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x53, 0x0a, 0x06, 0x52, 0x65, + 0x66, 0x75, 0x6e, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x06, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, + 0x0a, 0x0a, 0x08, 0x54, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x55, 0x70, 0x22, 0x46, 0x0a, 0x0d, 0x45, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x35, 0x0a, 0x06, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, + 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x45, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x22, 0x7b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, + 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x48, 0x00, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x14, 0x0a, 0x12, 0x67, 0x65, + 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x22, 0x41, 0x0a, 0x11, 0x49, 0x74, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x22, 0x4b, 0x0a, 0x12, 0x49, 0x74, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x22, 0x90, 0x01, 0x0a, 0x11, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x68, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x54, 0x6f, 0x12, 0x3d, 0x0a, 0x0b, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, + 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x52, 0x0a, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x14, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x65, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, + 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x7e, 0x0a, 0x0b, 0x41, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x3a, 0x0a, 0x1a, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x6e, 0x6f, + 0x64, 0x65, 0x4d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x16, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x53, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x11, 0x41, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, + 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x14, + 0x0a, 0x12, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x46, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x6e, + 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x63, 0x5f, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, + 0x26, 0x0a, 0x06, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x16, 0x0a, 0x03, 0x65, 0x38, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x03, 0x65, 0x38, + 0x73, 0x3a, 0x04, 0x80, 0xe2, 0x09, 0x01, 0x22, 0x53, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x67, + 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x72, 0x47, 0x65, 0x74, 0x73, 0x3a, 0x04, 0x80, 0xe2, 0x09, 0x01, 0x22, 0x30, 0x0a, 0x0a, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1c, 0x0a, 0x06, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, + 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x04, 0x80, 0xe2, 0x09, 0x01, 0x22, 0xb9, + 0x01, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x36, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x48, 0x61, 0x73, 0x68, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, + 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3e, 0x0a, 0x0b, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1a, 0x0a, 0x04, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x80, 0x01, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x86, 0x03, 0x0a, 0x0b, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x62, 0x75, 0x72, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x72, 0x6e, 0x48, 0x00, + 0x52, 0x04, 0x62, 0x75, 0x72, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x6d, 0x69, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x04, 0x6d, + 0x69, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x04, 0x73, 0x65, 0x6e, 0x64, + 0x12, 0x29, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x39, 0x0a, 0x0a, 0x69, + 0x63, 0x72, 0x63, 0x31, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x49, 0x63, 0x72, 0x63, 0x31, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x09, 0x69, 0x63, 0x72, + 0x63, 0x31, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x3a, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x63, 0x5f, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x42, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x22, 0xde, 0x02, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x36, 0x0a, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x12, 0x32, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x2f, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, + 0x66, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x61, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x48, 0x00, 0x52, 0x07, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x12, 0x44, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x6f, + 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x0b, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x22, 0x4c, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, + 0x72, 0x6f, 0x6d, 0x12, 0x3c, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x22, 0xc3, 0x01, 0x0a, 0x07, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x35, 0x0a, + 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x61, 0x6e, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, + 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, + 0x46, 0x0a, 0x12, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x11, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x6c, + 0x6c, 0x6f, 0x77, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x6b, 0x0a, 0x04, 0x4d, 0x69, 0x6e, 0x74, 0x12, + 0x32, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, + 0x02, 0x74, 0x6f, 0x12, 0x2f, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, + 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xad, 0x01, 0x0a, 0x04, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x36, 0x0a, + 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, + 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, + 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x2f, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x63, 0x5f, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x07, 0x73, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x22, 0x33, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x3a, 0x04, 0x80, 0xe2, 0x09, 0x01, 0x22, 0x39, 0x0a, 0x0a, 0x53, 0x75, 0x62, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0x88, 0xe2, + 0x09, 0x01, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, + 0x80, 0xe2, 0x09, 0x01, 0x22, 0x26, 0x0a, 0x04, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x18, 0x0a, 0x04, + 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x3a, 0x04, 0x80, 0xe2, 0x09, 0x01, 0x22, 0x2b, 0x0a, 0x09, + 0x49, 0x63, 0x72, 0x63, 0x31, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x18, 0x0a, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0x88, 0xe2, 0x09, 0x01, 0x52, 0x04, 0x6d, + 0x65, 0x6d, 0x6f, 0x3a, 0x04, 0x80, 0xe2, 0x09, 0x01, 0x22, 0x34, 0x0a, 0x09, 0x54, 0x69, 0x6d, + 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x22, + 0x35, 0x0a, 0x0d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x14, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x46, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x13, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, + 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x63, 0x5f, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x65, 0x65, 0x3a, + 0x4f, 0x0a, 0x12, 0x74, 0x75, 0x69, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa0, 0x9c, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, + 0x74, 0x75, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x3a, 0x5b, 0x0a, 0x1a, 0x74, 0x75, 0x69, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x71, 0x32, 0x5f, 0x32, 0x30, 0x32, 0x31, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa1, 0x9c, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x74, 0x75, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x51, 0x32, 0x32, 0x30, 0x32, 0x31, 0x42, 0x0a, 0x5a, + 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +func file_ledger_proto_init() { + if File_ledger_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ledger_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*PrincipalId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*LedgerInit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*LedgerUpgrade); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*SendRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*SendResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*NotifyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*NotifyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*TransactionNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*TransactionNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*CyclesNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*AccountBalanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*AccountBalanceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*TipOfChainRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*TipOfChainResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[14].Exporter = func(v any, i int) any { + switch v := v.(*TotalSupplyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[15].Exporter = func(v any, i int) any { + switch v := v.(*TotalSupplyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[16].Exporter = func(v any, i int) any { + switch v := v.(*LedgerArchiveRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[17].Exporter = func(v any, i int) any { + switch v := v.(*BlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[18].Exporter = func(v any, i int) any { + switch v := v.(*EncodedBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[19].Exporter = func(v any, i int) any { + switch v := v.(*BlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[20].Exporter = func(v any, i int) any { + switch v := v.(*GetBlocksRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[21].Exporter = func(v any, i int) any { + switch v := v.(*Refund); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[22].Exporter = func(v any, i int) any { + switch v := v.(*ToppedUp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[23].Exporter = func(v any, i int) any { + switch v := v.(*EncodedBlocks); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[24].Exporter = func(v any, i int) any { + switch v := v.(*GetBlocksResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[25].Exporter = func(v any, i int) any { + switch v := v.(*IterBlocksRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[26].Exporter = func(v any, i int) any { + switch v := v.(*IterBlocksResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[27].Exporter = func(v any, i int) any { + switch v := v.(*ArchiveIndexEntry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[28].Exporter = func(v any, i int) any { + switch v := v.(*ArchiveIndexResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[29].Exporter = func(v any, i int) any { + switch v := v.(*ArchiveInit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[30].Exporter = func(v any, i int) any { + switch v := v.(*ArchiveAddRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[31].Exporter = func(v any, i int) any { + switch v := v.(*ArchiveAddResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[32].Exporter = func(v any, i int) any { + switch v := v.(*GetNodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[33].Exporter = func(v any, i int) any { + switch v := v.(*GetNodesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[34].Exporter = func(v any, i int) any { + switch v := v.(*Tokens); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[35].Exporter = func(v any, i int) any { + switch v := v.(*Payment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[36].Exporter = func(v any, i int) any { + switch v := v.(*BlockIndex); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[37].Exporter = func(v any, i int) any { + switch v := v.(*Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[38].Exporter = func(v any, i int) any { + switch v := v.(*Hash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[39].Exporter = func(v any, i int) any { + switch v := v.(*Account); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[40].Exporter = func(v any, i int) any { + switch v := v.(*Transaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[41].Exporter = func(v any, i int) any { + switch v := v.(*Send); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[42].Exporter = func(v any, i int) any { + switch v := v.(*TransferFrom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[43].Exporter = func(v any, i int) any { + switch v := v.(*Approve); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[44].Exporter = func(v any, i int) any { + switch v := v.(*Mint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[45].Exporter = func(v any, i int) any { + switch v := v.(*Burn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[46].Exporter = func(v any, i int) any { + switch v := v.(*AccountIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[47].Exporter = func(v any, i int) any { + switch v := v.(*Subaccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[48].Exporter = func(v any, i int) any { + switch v := v.(*Memo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[49].Exporter = func(v any, i int) any { + switch v := v.(*Icrc1Memo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[50].Exporter = func(v any, i int) any { + switch v := v.(*TimeStamp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[51].Exporter = func(v any, i int) any { + switch v := v.(*Certification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[52].Exporter = func(v any, i int) any { + switch v := v.(*TransferFeeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_proto_msgTypes[53].Exporter = func(v any, i int) any { + switch v := v.(*TransferFeeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_ledger_proto_msgTypes[9].OneofWrappers = []any{ + (*CyclesNotificationResponse_CreatedCanisterId)(nil), + (*CyclesNotificationResponse_Refund)(nil), + (*CyclesNotificationResponse_ToppedUp)(nil), + } + file_ledger_proto_msgTypes[19].OneofWrappers = []any{ + (*BlockResponse_Block)(nil), + (*BlockResponse_CanisterId)(nil), + } + file_ledger_proto_msgTypes[24].OneofWrappers = []any{ + (*GetBlocksResponse_Blocks)(nil), + (*GetBlocksResponse_Error)(nil), + } + file_ledger_proto_msgTypes[40].OneofWrappers = []any{ + (*Transaction_Burn)(nil), + (*Transaction_Mint)(nil), + (*Transaction_Send)(nil), + } + file_ledger_proto_msgTypes[41].OneofWrappers = []any{ + (*Send_Approve)(nil), + (*Send_TransferFrom)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ledger_proto_rawDesc, + NumEnums: 0, + NumMessages: 54, + NumExtensions: 2, + NumServices: 0, + }, + GoTypes: file_ledger_proto_goTypes, + DependencyIndexes: file_ledger_proto_depIdxs, + MessageInfos: file_ledger_proto_msgTypes, + ExtensionInfos: file_ledger_proto_extTypes, + }.Build() + File_ledger_proto = out.File + file_ledger_proto_rawDesc = nil + file_ledger_proto_goTypes = nil + file_ledger_proto_depIdxs = nil +} + +func file_ledger_proto_rawDescGZIP() []byte { + file_ledger_proto_rawDescOnce.Do(func() { + file_ledger_proto_rawDescData = protoimpl.X.CompressGZIP(file_ledger_proto_rawDescData) + }) + return file_ledger_proto_rawDescData +} + +func init() { file_ledger_proto_init() } + +type Account struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier *AccountIdentifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + Balance *Tokens `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"` +} + +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{39} +} + +func (x *Account) GetBalance() *Tokens { + if x != nil { + return x.Balance + } + return nil +} + +func (x *Account) GetIdentifier() *AccountIdentifier { + if x != nil { + return x.Identifier + } + return nil +} + +func (*Account) ProtoMessage() {} + +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Account) Reset() { + *x = Account{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Account) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Get the balance of an account +type AccountBalanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Account *AccountIdentifier `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +} + +// Deprecated: Use AccountBalanceRequest.ProtoReflect.Descriptor instead. +func (*AccountBalanceRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{10} +} + +func (x *AccountBalanceRequest) GetAccount() *AccountIdentifier { + if x != nil { + return x.Account + } + return nil +} + +func (*AccountBalanceRequest) ProtoMessage() {} + +func (x *AccountBalanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AccountBalanceRequest) Reset() { + *x = AccountBalanceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountBalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type AccountBalanceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Balance *Tokens `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` +} + +// Deprecated: Use AccountBalanceResponse.ProtoReflect.Descriptor instead. +func (*AccountBalanceResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{11} +} + +func (x *AccountBalanceResponse) GetBalance() *Tokens { + if x != nil { + return x.Balance + } + return nil +} + +func (*AccountBalanceResponse) ProtoMessage() {} + +func (x *AccountBalanceResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AccountBalanceResponse) Reset() { + *x = AccountBalanceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountBalanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type AccountIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Can contain either: + // - the 32 byte identifier (4 byte checksum + 28 byte hash) + // - the 28 byte hash + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +// Deprecated: Use AccountIdentifier.ProtoReflect.Descriptor instead. +func (*AccountIdentifier) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{46} +} + +func (x *AccountIdentifier) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (*AccountIdentifier) ProtoMessage() {} + +func (x *AccountIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[46] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *AccountIdentifier) Reset() { + *x = AccountIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Approve struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Allowance *Tokens `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` + ExpiresAt *TimeStamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + ExpectedAllowance *Tokens `protobuf:"bytes,3,opt,name=expected_allowance,json=expectedAllowance,proto3" json:"expected_allowance,omitempty"` +} + +// Deprecated: Use Approve.ProtoReflect.Descriptor instead. +func (*Approve) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{43} +} + +func (x *Approve) GetAllowance() *Tokens { + if x != nil { + return x.Allowance + } + return nil +} + +func (x *Approve) GetExpectedAllowance() *Tokens { + if x != nil { + return x.ExpectedAllowance + } + return nil +} + +func (x *Approve) GetExpiresAt() *TimeStamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (*Approve) ProtoMessage() {} + +func (x *Approve) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Approve) Reset() { + *x = Approve{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Approve) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Add blocks to the archive canister +type ArchiveAddRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks []*Block `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +// Deprecated: Use ArchiveAddRequest.ProtoReflect.Descriptor instead. +func (*ArchiveAddRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{30} +} + +func (x *ArchiveAddRequest) GetBlocks() []*Block { + if x != nil { + return x.Blocks + } + return nil +} + +func (*ArchiveAddRequest) ProtoMessage() {} + +func (x *ArchiveAddRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ArchiveAddRequest) Reset() { + *x = ArchiveAddRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveAddRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type ArchiveAddResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use ArchiveAddResponse.ProtoReflect.Descriptor instead. +func (*ArchiveAddResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{31} +} + +func (*ArchiveAddResponse) ProtoMessage() {} + +func (x *ArchiveAddResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ArchiveAddResponse) Reset() { + *x = ArchiveAddResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveAddResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type ArchiveIndexEntry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HeightFrom uint64 `protobuf:"varint,1,opt,name=height_from,json=heightFrom,proto3" json:"height_from,omitempty"` + HeightTo uint64 `protobuf:"varint,2,opt,name=height_to,json=heightTo,proto3" json:"height_to,omitempty"` + CanisterId *PrincipalId `protobuf:"bytes,3,opt,name=canister_id,json=canisterId,proto3" json:"canister_id,omitempty"` +} + +// Deprecated: Use ArchiveIndexEntry.ProtoReflect.Descriptor instead. +func (*ArchiveIndexEntry) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{27} +} + +func (x *ArchiveIndexEntry) GetCanisterId() *PrincipalId { + if x != nil { + return x.CanisterId + } + return nil +} + +func (x *ArchiveIndexEntry) GetHeightFrom() uint64 { + if x != nil { + return x.HeightFrom + } + return 0 +} + +func (x *ArchiveIndexEntry) GetHeightTo() uint64 { + if x != nil { + return x.HeightTo + } + return 0 +} + +func (*ArchiveIndexEntry) ProtoMessage() {} + +func (x *ArchiveIndexEntry) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ArchiveIndexEntry) Reset() { + *x = ArchiveIndexEntry{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveIndexEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type ArchiveIndexResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Entries []*ArchiveIndexEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +// Deprecated: Use ArchiveIndexResponse.ProtoReflect.Descriptor instead. +func (*ArchiveIndexResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{28} +} + +func (x *ArchiveIndexResponse) GetEntries() []*ArchiveIndexEntry { + if x != nil { + return x.Entries + } + return nil +} + +func (*ArchiveIndexResponse) ProtoMessage() {} + +func (x *ArchiveIndexResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ArchiveIndexResponse) Reset() { + *x = ArchiveIndexResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveIndexResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// * Archive canister * +// Init the archive canister +type ArchiveInit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeMaxMemorySizeBytes uint32 `protobuf:"varint,1,opt,name=node_max_memory_size_bytes,json=nodeMaxMemorySizeBytes,proto3" json:"node_max_memory_size_bytes,omitempty"` + MaxMessageSizeBytes uint32 `protobuf:"varint,2,opt,name=max_message_size_bytes,json=maxMessageSizeBytes,proto3" json:"max_message_size_bytes,omitempty"` +} + +// Deprecated: Use ArchiveInit.ProtoReflect.Descriptor instead. +func (*ArchiveInit) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{29} +} + +func (x *ArchiveInit) GetMaxMessageSizeBytes() uint32 { + if x != nil { + return x.MaxMessageSizeBytes + } + return 0 +} + +func (x *ArchiveInit) GetNodeMaxMemorySizeBytes() uint32 { + if x != nil { + return x.NodeMaxMemorySizeBytes + } + return 0 +} + +func (*ArchiveInit) ProtoMessage() {} + +func (x *ArchiveInit) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ArchiveInit) Reset() { + *x = ArchiveInit{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveInit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// This is the +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ParentHash *Hash `protobuf:"bytes,1,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` + Timestamp *TimeStamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Transaction *Transaction `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"` +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{37} +} + +func (x *Block) GetParentHash() *Hash { + if x != nil { + return x.ParentHash + } + return nil +} + +func (x *Block) GetTimestamp() *TimeStamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *Block) GetTransaction() *Transaction { + if x != nil { + return x.Transaction + } + return nil +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type BlockIndex struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +// Deprecated: Use BlockIndex.ProtoReflect.Descriptor instead. +func (*BlockIndex) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{36} +} + +func (x *BlockIndex) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (*BlockIndex) ProtoMessage() {} + +func (x *BlockIndex) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BlockIndex) Reset() { + *x = BlockIndex{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockIndex) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Get a single block +type BlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` +} + +// Deprecated: Use BlockRequest.ProtoReflect.Descriptor instead. +func (*BlockRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{17} +} + +func (x *BlockRequest) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (*BlockRequest) ProtoMessage() {} + +func (x *BlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BlockRequest) Reset() { + *x = BlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type BlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to BlockContent: + // + // *BlockResponse_Block + // *BlockResponse_CanisterId + BlockContent isBlockResponse_BlockContent `protobuf_oneof:"block_content"` +} + +// Deprecated: Use BlockResponse.ProtoReflect.Descriptor instead. +func (*BlockResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{19} +} + +func (x *BlockResponse) GetBlock() *EncodedBlock { + if x, ok := x.GetBlockContent().(*BlockResponse_Block); ok { + return x.Block + } + return nil +} + +func (m *BlockResponse) GetBlockContent() isBlockResponse_BlockContent { + if m != nil { + return m.BlockContent + } + return nil +} + +func (x *BlockResponse) GetCanisterId() *PrincipalId { + if x, ok := x.GetBlockContent().(*BlockResponse_CanisterId); ok { + return x.CanisterId + } + return nil +} + +func (*BlockResponse) ProtoMessage() {} + +func (x *BlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *BlockResponse) Reset() { + *x = BlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type BlockResponse_Block struct { + Block *EncodedBlock `protobuf:"bytes,1,opt,name=block,proto3,oneof"` +} + +func (*BlockResponse_Block) isBlockResponse_BlockContent() {} + +type BlockResponse_CanisterId struct { + CanisterId *PrincipalId `protobuf:"bytes,2,opt,name=canister_id,json=canisterId,proto3,oneof"` +} + +func (*BlockResponse_CanisterId) isBlockResponse_BlockContent() {} + +type Burn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + From *AccountIdentifier `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + Amount *Tokens `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + Spender *AccountIdentifier `protobuf:"bytes,4,opt,name=spender,proto3" json:"spender,omitempty"` +} + +// Deprecated: Use Burn.ProtoReflect.Descriptor instead. +func (*Burn) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{45} +} + +func (x *Burn) GetAmount() *Tokens { + if x != nil { + return x.Amount + } + return nil +} + +func (x *Burn) GetFrom() *AccountIdentifier { + if x != nil { + return x.From + } + return nil +} + +func (x *Burn) GetSpender() *AccountIdentifier { + if x != nil { + return x.Spender + } + return nil +} + +func (*Burn) ProtoMessage() {} + +func (x *Burn) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[45] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Burn) Reset() { + *x = Burn{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Burn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Certification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Certification []byte `protobuf:"bytes,1,opt,name=certification,proto3" json:"certification,omitempty"` +} + +// Deprecated: Use Certification.ProtoReflect.Descriptor instead. +func (*Certification) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{51} +} + +func (x *Certification) GetCertification() []byte { + if x != nil { + return x.Certification + } + return nil +} + +func (*Certification) ProtoMessage() {} + +func (x *Certification) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[51] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Certification) Reset() { + *x = Certification{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Certification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type CyclesNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *CyclesNotificationResponse_CreatedCanisterId + // *CyclesNotificationResponse_Refund + // *CyclesNotificationResponse_ToppedUp + Response isCyclesNotificationResponse_Response `protobuf_oneof:"response"` +} + +// Deprecated: Use CyclesNotificationResponse.ProtoReflect.Descriptor instead. +func (*CyclesNotificationResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{9} +} + +func (x *CyclesNotificationResponse) GetCreatedCanisterId() *PrincipalId { + if x, ok := x.GetResponse().(*CyclesNotificationResponse_CreatedCanisterId); ok { + return x.CreatedCanisterId + } + return nil +} + +func (x *CyclesNotificationResponse) GetRefund() *Refund { + if x, ok := x.GetResponse().(*CyclesNotificationResponse_Refund); ok { + return x.Refund + } + return nil +} + +func (m *CyclesNotificationResponse) GetResponse() isCyclesNotificationResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *CyclesNotificationResponse) GetToppedUp() *ToppedUp { + if x, ok := x.GetResponse().(*CyclesNotificationResponse_ToppedUp); ok { + return x.ToppedUp + } + return nil +} + +func (*CyclesNotificationResponse) ProtoMessage() {} + +func (x *CyclesNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *CyclesNotificationResponse) Reset() { + *x = CyclesNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CyclesNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type CyclesNotificationResponse_CreatedCanisterId struct { + CreatedCanisterId *PrincipalId `protobuf:"bytes,1,opt,name=created_canister_id,json=createdCanisterId,proto3,oneof"` +} + +func (*CyclesNotificationResponse_CreatedCanisterId) isCyclesNotificationResponse_Response() {} + +type CyclesNotificationResponse_Refund struct { + Refund *Refund `protobuf:"bytes,2,opt,name=refund,proto3,oneof"` +} + +func (*CyclesNotificationResponse_Refund) isCyclesNotificationResponse_Response() {} + +type CyclesNotificationResponse_ToppedUp struct { + ToppedUp *ToppedUp `protobuf:"bytes,3,opt,name=topped_up,json=toppedUp,proto3,oneof"` +} + +func (*CyclesNotificationResponse_ToppedUp) isCyclesNotificationResponse_Response() {} + +type EncodedBlock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Block []byte `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` +} + +// Deprecated: Use EncodedBlock.ProtoReflect.Descriptor instead. +func (*EncodedBlock) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{18} +} + +func (x *EncodedBlock) GetBlock() []byte { + if x != nil { + return x.Block + } + return nil +} + +func (*EncodedBlock) ProtoMessage() {} + +func (x *EncodedBlock) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EncodedBlock) Reset() { + *x = EncodedBlock{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncodedBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type EncodedBlocks struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks []*EncodedBlock `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +// Deprecated: Use EncodedBlocks.ProtoReflect.Descriptor instead. +func (*EncodedBlocks) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{23} +} + +func (x *EncodedBlocks) GetBlocks() []*EncodedBlock { + if x != nil { + return x.Blocks + } + return nil +} + +func (*EncodedBlocks) ProtoMessage() {} + +func (x *EncodedBlocks) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *EncodedBlocks) Reset() { + *x = EncodedBlocks{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EncodedBlocks) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Get a set of blocks +type GetBlocksRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + Length uint64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` +} + +// Deprecated: Use GetBlocksRequest.ProtoReflect.Descriptor instead. +func (*GetBlocksRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{20} +} + +func (x *GetBlocksRequest) GetLength() uint64 { + if x != nil { + return x.Length + } + return 0 +} + +func (x *GetBlocksRequest) GetStart() uint64 { + if x != nil { + return x.Start + } + return 0 +} + +func (*GetBlocksRequest) ProtoMessage() {} + +func (x *GetBlocksRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetBlocksRequest) Reset() { + *x = GetBlocksRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlocksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type GetBlocksResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to GetBlocksContent: + // + // *GetBlocksResponse_Blocks + // *GetBlocksResponse_Error + GetBlocksContent isGetBlocksResponse_GetBlocksContent `protobuf_oneof:"get_blocks_content"` +} + +// Deprecated: Use GetBlocksResponse.ProtoReflect.Descriptor instead. +func (*GetBlocksResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{24} +} + +func (x *GetBlocksResponse) GetBlocks() *EncodedBlocks { + if x, ok := x.GetGetBlocksContent().(*GetBlocksResponse_Blocks); ok { + return x.Blocks + } + return nil +} + +func (x *GetBlocksResponse) GetError() string { + if x, ok := x.GetGetBlocksContent().(*GetBlocksResponse_Error); ok { + return x.Error + } + return "" +} + +func (m *GetBlocksResponse) GetGetBlocksContent() isGetBlocksResponse_GetBlocksContent { + if m != nil { + return m.GetBlocksContent + } + return nil +} + +func (*GetBlocksResponse) ProtoMessage() {} + +func (x *GetBlocksResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetBlocksResponse) Reset() { + *x = GetBlocksResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlocksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type GetBlocksResponse_Blocks struct { + Blocks *EncodedBlocks `protobuf:"bytes,1,opt,name=blocks,proto3,oneof"` +} + +func (*GetBlocksResponse_Blocks) isGetBlocksResponse_GetBlocksContent() {} + +type GetBlocksResponse_Error struct { + Error string `protobuf:"bytes,2,opt,name=error,proto3,oneof"` +} + +func (*GetBlocksResponse_Error) isGetBlocksResponse_GetBlocksContent() {} + +// Fetch a list of all of the archive nodes +type GetNodesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use GetNodesRequest.ProtoReflect.Descriptor instead. +func (*GetNodesRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{32} +} + +func (*GetNodesRequest) ProtoMessage() {} + +func (x *GetNodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetNodesRequest) Reset() { + *x = GetNodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type GetNodesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*PrincipalId `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` +} + +// Deprecated: Use GetNodesResponse.ProtoReflect.Descriptor instead. +func (*GetNodesResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{33} +} + +func (x *GetNodesResponse) GetNodes() []*PrincipalId { + if x != nil { + return x.Nodes + } + return nil +} + +func (*GetNodesResponse) ProtoMessage() {} + +func (x *GetNodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *GetNodesResponse) Reset() { + *x = GetNodesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Hash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +// Deprecated: Use Hash.ProtoReflect.Descriptor instead. +func (*Hash) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{38} +} + +func (x *Hash) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (*Hash) ProtoMessage() {} + +func (x *Hash) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Hash) Reset() { + *x = Hash{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Hash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Icrc1Memo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Memo []byte `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` +} + +// Deprecated: Use Icrc1Memo.ProtoReflect.Descriptor instead. +func (*Icrc1Memo) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{49} +} + +func (x *Icrc1Memo) GetMemo() []byte { + if x != nil { + return x.Memo + } + return nil +} + +func (*Icrc1Memo) ProtoMessage() {} + +func (x *Icrc1Memo) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Icrc1Memo) Reset() { + *x = Icrc1Memo{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Icrc1Memo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Iterate through blocks +type IterBlocksRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + Length uint64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` +} + +// Deprecated: Use IterBlocksRequest.ProtoReflect.Descriptor instead. +func (*IterBlocksRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{25} +} + +func (x *IterBlocksRequest) GetLength() uint64 { + if x != nil { + return x.Length + } + return 0 +} + +func (x *IterBlocksRequest) GetStart() uint64 { + if x != nil { + return x.Start + } + return 0 +} + +func (*IterBlocksRequest) ProtoMessage() {} + +func (x *IterBlocksRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *IterBlocksRequest) Reset() { + *x = IterBlocksRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IterBlocksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type IterBlocksResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks []*EncodedBlock `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +// Deprecated: Use IterBlocksResponse.ProtoReflect.Descriptor instead. +func (*IterBlocksResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{26} +} + +func (x *IterBlocksResponse) GetBlocks() []*EncodedBlock { + if x != nil { + return x.Blocks + } + return nil +} + +func (*IterBlocksResponse) ProtoMessage() {} + +func (x *IterBlocksResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *IterBlocksResponse) Reset() { + *x = IterBlocksResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IterBlocksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Archive any blocks older than this +type LedgerArchiveRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp *TimeStamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +// Deprecated: Use LedgerArchiveRequest.ProtoReflect.Descriptor instead. +func (*LedgerArchiveRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{16} +} + +func (x *LedgerArchiveRequest) GetTimestamp() *TimeStamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (*LedgerArchiveRequest) ProtoMessage() {} + +func (x *LedgerArchiveRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *LedgerArchiveRequest) Reset() { + *x = LedgerArchiveRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LedgerArchiveRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Initialise the ledger canister +type LedgerInit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MintingAccount *AccountIdentifier `protobuf:"bytes,1,opt,name=minting_account,json=mintingAccount,proto3" json:"minting_account,omitempty"` + InitialValues []*Account `protobuf:"bytes,2,rep,name=initial_values,json=initialValues,proto3" json:"initial_values,omitempty"` + ArchiveCanister *PrincipalId `protobuf:"bytes,3,opt,name=archive_canister,json=archiveCanister,proto3" json:"archive_canister,omitempty"` + MaxMessageSizeBytes uint32 `protobuf:"varint,4,opt,name=max_message_size_bytes,json=maxMessageSizeBytes,proto3" json:"max_message_size_bytes,omitempty"` +} + +// Deprecated: Use LedgerInit.ProtoReflect.Descriptor instead. +func (*LedgerInit) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{1} +} + +func (x *LedgerInit) GetArchiveCanister() *PrincipalId { + if x != nil { + return x.ArchiveCanister + } + return nil +} + +func (x *LedgerInit) GetInitialValues() []*Account { + if x != nil { + return x.InitialValues + } + return nil +} + +func (x *LedgerInit) GetMaxMessageSizeBytes() uint32 { + if x != nil { + return x.MaxMessageSizeBytes + } + return 0 +} + +func (x *LedgerInit) GetMintingAccount() *AccountIdentifier { + if x != nil { + return x.MintingAccount + } + return nil +} + +func (*LedgerInit) ProtoMessage() {} + +func (x *LedgerInit) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *LedgerInit) Reset() { + *x = LedgerInit{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LedgerInit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// The format of values serialized to/from the stable memory during and upgrade +type LedgerUpgrade struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use LedgerUpgrade.ProtoReflect.Descriptor instead. +func (*LedgerUpgrade) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{2} +} + +func (*LedgerUpgrade) ProtoMessage() {} + +func (x *LedgerUpgrade) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *LedgerUpgrade) Reset() { + *x = LedgerUpgrade{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LedgerUpgrade) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Memo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Memo uint64 `protobuf:"varint,1,opt,name=memo,proto3" json:"memo,omitempty"` +} + +// Deprecated: Use Memo.ProtoReflect.Descriptor instead. +func (*Memo) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{48} +} + +func (x *Memo) GetMemo() uint64 { + if x != nil { + return x.Memo + } + return 0 +} + +func (*Memo) ProtoMessage() {} + +func (x *Memo) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[48] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Memo) Reset() { + *x = Memo{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Memo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Mint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + To *AccountIdentifier `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + Amount *Tokens `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +// Deprecated: Use Mint.ProtoReflect.Descriptor instead. +func (*Mint) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{44} +} + +func (x *Mint) GetAmount() *Tokens { + if x != nil { + return x.Amount + } + return nil +} + +func (x *Mint) GetTo() *AccountIdentifier { + if x != nil { + return x.To + } + return nil +} + +func (*Mint) ProtoMessage() {} + +func (x *Mint) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Mint) Reset() { + *x = Mint{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Notify a canister that it has received a payment +type NotifyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHeight *BlockIndex `protobuf:"bytes,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + MaxFee *Tokens `protobuf:"bytes,2,opt,name=max_fee,json=maxFee,proto3" json:"max_fee,omitempty"` + FromSubaccount *Subaccount `protobuf:"bytes,3,opt,name=from_subaccount,json=fromSubaccount,proto3" json:"from_subaccount,omitempty"` + ToCanister *PrincipalId `protobuf:"bytes,4,opt,name=to_canister,json=toCanister,proto3" json:"to_canister,omitempty"` + ToSubaccount *Subaccount `protobuf:"bytes,5,opt,name=to_subaccount,json=toSubaccount,proto3" json:"to_subaccount,omitempty"` +} + +// Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead. +func (*NotifyRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{5} +} + +func (x *NotifyRequest) GetBlockHeight() *BlockIndex { + if x != nil { + return x.BlockHeight + } + return nil +} + +func (x *NotifyRequest) GetFromSubaccount() *Subaccount { + if x != nil { + return x.FromSubaccount + } + return nil +} + +func (x *NotifyRequest) GetMaxFee() *Tokens { + if x != nil { + return x.MaxFee + } + return nil +} + +func (x *NotifyRequest) GetToCanister() *PrincipalId { + if x != nil { + return x.ToCanister + } + return nil +} + +func (x *NotifyRequest) GetToSubaccount() *Subaccount { + if x != nil { + return x.ToSubaccount + } + return nil +} + +func (*NotifyRequest) ProtoMessage() {} + +func (x *NotifyRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NotifyRequest) Reset() { + *x = NotifyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type NotifyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use NotifyResponse.ProtoReflect.Descriptor instead. +func (*NotifyResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{6} +} + +func (*NotifyResponse) ProtoMessage() {} + +func (x *NotifyResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *NotifyResponse) Reset() { + *x = NotifyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Payment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReceiverGets *Tokens `protobuf:"bytes,1,opt,name=receiver_gets,json=receiverGets,proto3" json:"receiver_gets,omitempty"` +} + +// Deprecated: Use Payment.ProtoReflect.Descriptor instead. +func (*Payment) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{35} +} + +func (x *Payment) GetReceiverGets() *Tokens { + if x != nil { + return x.ReceiverGets + } + return nil +} + +func (*Payment) ProtoMessage() {} + +func (x *Payment) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Payment) Reset() { + *x = Payment{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// A PB container for a PrincipalId, which uniquely identifies +// a principal. +type PrincipalId struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SerializedId []byte `protobuf:"bytes,1,opt,name=serialized_id,json=serializedId,proto3" json:"serialized_id,omitempty"` +} + +// Deprecated: Use PrincipalId.ProtoReflect.Descriptor instead. +func (*PrincipalId) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{0} +} + +func (x *PrincipalId) GetSerializedId() []byte { + if x != nil { + return x.SerializedId + } + return nil +} + +func (*PrincipalId) ProtoMessage() {} + +func (x *PrincipalId) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *PrincipalId) Reset() { + *x = PrincipalId{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrincipalId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Refund struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Refund *BlockIndex `protobuf:"bytes,2,opt,name=refund,proto3" json:"refund,omitempty"` + Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` +} + +// Deprecated: Use Refund.ProtoReflect.Descriptor instead. +func (*Refund) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{21} +} + +func (x *Refund) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *Refund) GetRefund() *BlockIndex { + if x != nil { + return x.Refund + } + return nil +} + +func (*Refund) ProtoMessage() {} + +func (x *Refund) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Refund) Reset() { + *x = Refund{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Refund) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Send struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The meaning of the [from] field depends on the transaction type: + // - Transfer: [from] is the source account. + // - TransferFrom: [from] is the approver. + // - Approve: [from] is the approver. + From *AccountIdentifier `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + // The meaning of the [to] field depends on the transaction type: + // - Transfer: [to] is the destination account. + // - TransferFrom: [to] is the destination account. + // - Approve: [to] is the default account id of the approved principal. + To *AccountIdentifier `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + // If the transaction type is Approve, the amount must be zero. + Amount *Tokens `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + MaxFee *Tokens `protobuf:"bytes,4,opt,name=max_fee,json=maxFee,proto3" json:"max_fee,omitempty"` + // We represent metadata of new operation types as submessages for + // backward compatibility with old clients. + // + // Types that are assignable to Extension: + // + // *Send_Approve + // *Send_TransferFrom + Extension isSend_Extension `protobuf_oneof:"extension"` +} + +// Deprecated: Use Send.ProtoReflect.Descriptor instead. +func (*Send) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{41} +} + +func (x *Send) GetAmount() *Tokens { + if x != nil { + return x.Amount + } + return nil +} + +func (x *Send) GetApprove() *Approve { + if x, ok := x.GetExtension().(*Send_Approve); ok { + return x.Approve + } + return nil +} + +func (m *Send) GetExtension() isSend_Extension { + if m != nil { + return m.Extension + } + return nil +} + +func (x *Send) GetFrom() *AccountIdentifier { + if x != nil { + return x.From + } + return nil +} + +func (x *Send) GetMaxFee() *Tokens { + if x != nil { + return x.MaxFee + } + return nil +} + +func (x *Send) GetTo() *AccountIdentifier { + if x != nil { + return x.To + } + return nil +} + +func (x *Send) GetTransferFrom() *TransferFrom { + if x, ok := x.GetExtension().(*Send_TransferFrom); ok { + return x.TransferFrom + } + return nil +} + +func (*Send) ProtoMessage() {} + +func (x *Send) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Send) Reset() { + *x = Send{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Send) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Make a payment +type SendRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Memo *Memo `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` + Payment *Payment `protobuf:"bytes,2,opt,name=payment,proto3" json:"payment,omitempty"` + MaxFee *Tokens `protobuf:"bytes,3,opt,name=max_fee,json=maxFee,proto3" json:"max_fee,omitempty"` + FromSubaccount *Subaccount `protobuf:"bytes,4,opt,name=from_subaccount,json=fromSubaccount,proto3" json:"from_subaccount,omitempty"` + To *AccountIdentifier `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"` + CreatedAt *BlockIndex `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + CreatedAtTime *TimeStamp `protobuf:"bytes,7,opt,name=created_at_time,json=createdAtTime,proto3" json:"created_at_time,omitempty"` +} + +// Deprecated: Use SendRequest.ProtoReflect.Descriptor instead. +func (*SendRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{3} +} + +func (x *SendRequest) GetCreatedAt() *BlockIndex { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *SendRequest) GetCreatedAtTime() *TimeStamp { + if x != nil { + return x.CreatedAtTime + } + return nil +} + +func (x *SendRequest) GetFromSubaccount() *Subaccount { + if x != nil { + return x.FromSubaccount + } + return nil +} + +func (x *SendRequest) GetMaxFee() *Tokens { + if x != nil { + return x.MaxFee + } + return nil +} + +func (x *SendRequest) GetMemo() *Memo { + if x != nil { + return x.Memo + } + return nil +} + +func (x *SendRequest) GetPayment() *Payment { + if x != nil { + return x.Payment + } + return nil +} + +func (x *SendRequest) GetTo() *AccountIdentifier { + if x != nil { + return x.To + } + return nil +} + +func (*SendRequest) ProtoMessage() {} + +func (x *SendRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SendRequest) Reset() { + *x = SendRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type SendResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultingHeight *BlockIndex `protobuf:"bytes,1,opt,name=resulting_height,json=resultingHeight,proto3" json:"resulting_height,omitempty"` +} + +// Deprecated: Use SendResponse.ProtoReflect.Descriptor instead. +func (*SendResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{4} +} + +func (x *SendResponse) GetResultingHeight() *BlockIndex { + if x != nil { + return x.ResultingHeight + } + return nil +} + +func (*SendResponse) ProtoMessage() {} + +func (x *SendResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *SendResponse) Reset() { + *x = SendResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Send_Approve struct { + Approve *Approve `protobuf:"bytes,5,opt,name=approve,proto3,oneof"` +} + +func (*Send_Approve) isSend_Extension() {} + +type Send_TransferFrom struct { + TransferFrom *TransferFrom `protobuf:"bytes,6,opt,name=transfer_from,json=transferFrom,proto3,oneof"` +} + +func (*Send_TransferFrom) isSend_Extension() {} + +type Subaccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubAccount []byte `protobuf:"bytes,1,opt,name=sub_account,json=subAccount,proto3" json:"sub_account,omitempty"` +} + +// Deprecated: Use Subaccount.ProtoReflect.Descriptor instead. +func (*Subaccount) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{47} +} + +func (x *Subaccount) GetSubAccount() []byte { + if x != nil { + return x.SubAccount + } + return nil +} + +func (*Subaccount) ProtoMessage() {} + +func (x *Subaccount) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[47] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Subaccount) Reset() { + *x = Subaccount{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Subaccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type TimeStamp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimestampNanos uint64 `protobuf:"varint,1,opt,name=timestamp_nanos,json=timestampNanos,proto3" json:"timestamp_nanos,omitempty"` +} + +// Deprecated: Use TimeStamp.ProtoReflect.Descriptor instead. +func (*TimeStamp) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{50} +} + +func (x *TimeStamp) GetTimestampNanos() uint64 { + if x != nil { + return x.TimestampNanos + } + return 0 +} + +func (*TimeStamp) ProtoMessage() {} + +func (x *TimeStamp) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TimeStamp) Reset() { + *x = TimeStamp{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeStamp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// Get the length of the chain with a certification +type TipOfChainRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use TipOfChainRequest.ProtoReflect.Descriptor instead. +func (*TipOfChainRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{12} +} + +func (*TipOfChainRequest) ProtoMessage() {} + +func (x *TipOfChainRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TipOfChainRequest) Reset() { + *x = TipOfChainRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TipOfChainRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type TipOfChainResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Certification *Certification `protobuf:"bytes,1,opt,name=certification,proto3" json:"certification,omitempty"` + ChainLength *BlockIndex `protobuf:"bytes,2,opt,name=chain_length,json=chainLength,proto3" json:"chain_length,omitempty"` +} + +// Deprecated: Use TipOfChainResponse.ProtoReflect.Descriptor instead. +func (*TipOfChainResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{13} +} + +func (x *TipOfChainResponse) GetCertification() *Certification { + if x != nil { + return x.Certification + } + return nil +} + +func (x *TipOfChainResponse) GetChainLength() *BlockIndex { + if x != nil { + return x.ChainLength + } + return nil +} + +func (*TipOfChainResponse) ProtoMessage() {} + +func (x *TipOfChainResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TipOfChainResponse) Reset() { + *x = TipOfChainResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TipOfChainResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// ** BASIC TYPES ** +type Tokens struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + E8S uint64 `protobuf:"varint,1,opt,name=e8s,proto3" json:"e8s,omitempty"` +} + +// Deprecated: Use Tokens.ProtoReflect.Descriptor instead. +func (*Tokens) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{34} +} + +func (x *Tokens) GetE8S() uint64 { + if x != nil { + return x.E8S + } + return 0 +} + +func (*Tokens) ProtoMessage() {} + +func (x *Tokens) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Tokens) Reset() { + *x = Tokens{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Tokens) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type ToppedUp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use ToppedUp.ProtoReflect.Descriptor instead. +func (*ToppedUp) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{22} +} + +func (*ToppedUp) ProtoMessage() {} + +func (x *ToppedUp) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ToppedUp) Reset() { + *x = ToppedUp{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ToppedUp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +// How many Tokens are there not in the minting account +type TotalSupplyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use TotalSupplyRequest.ProtoReflect.Descriptor instead. +func (*TotalSupplyRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{14} +} + +func (*TotalSupplyRequest) ProtoMessage() {} + +func (x *TotalSupplyRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TotalSupplyRequest) Reset() { + *x = TotalSupplyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TotalSupplyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type TotalSupplyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TotalSupply *Tokens `protobuf:"bytes,1,opt,name=total_supply,json=totalSupply,proto3" json:"total_supply,omitempty"` +} + +// Deprecated: Use TotalSupplyResponse.ProtoReflect.Descriptor instead. +func (*TotalSupplyResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{15} +} + +func (x *TotalSupplyResponse) GetTotalSupply() *Tokens { + if x != nil { + return x.TotalSupply + } + return nil +} + +func (*TotalSupplyResponse) ProtoMessage() {} + +func (x *TotalSupplyResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TotalSupplyResponse) Reset() { + *x = TotalSupplyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TotalSupplyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Transaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Transfer: + // + // *Transaction_Burn + // *Transaction_Mint + // *Transaction_Send + Transfer isTransaction_Transfer `protobuf_oneof:"transfer"` + Memo *Memo `protobuf:"bytes,4,opt,name=memo,proto3" json:"memo,omitempty"` + Icrc1Memo *Icrc1Memo `protobuf:"bytes,7,opt,name=icrc1_memo,json=icrc1Memo,proto3" json:"icrc1_memo,omitempty"` + CreatedAt *BlockIndex `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // obsolete + CreatedAtTime *TimeStamp `protobuf:"bytes,6,opt,name=created_at_time,json=createdAtTime,proto3" json:"created_at_time,omitempty"` +} + +// Deprecated: Use Transaction.ProtoReflect.Descriptor instead. +func (*Transaction) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{40} +} + +func (x *Transaction) GetBurn() *Burn { + if x, ok := x.GetTransfer().(*Transaction_Burn); ok { + return x.Burn + } + return nil +} + +func (x *Transaction) GetCreatedAt() *BlockIndex { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Transaction) GetCreatedAtTime() *TimeStamp { + if x != nil { + return x.CreatedAtTime + } + return nil +} + +func (x *Transaction) GetIcrc1Memo() *Icrc1Memo { + if x != nil { + return x.Icrc1Memo + } + return nil +} + +func (x *Transaction) GetMemo() *Memo { + if x != nil { + return x.Memo + } + return nil +} + +func (x *Transaction) GetMint() *Mint { + if x, ok := x.GetTransfer().(*Transaction_Mint); ok { + return x.Mint + } + return nil +} + +func (x *Transaction) GetSend() *Send { + if x, ok := x.GetTransfer().(*Transaction_Send); ok { + return x.Send + } + return nil +} + +func (m *Transaction) GetTransfer() isTransaction_Transfer { + if m != nil { + return m.Transfer + } + return nil +} + +func (*Transaction) ProtoMessage() {} + +func (x *Transaction) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Transaction) Reset() { + *x = Transaction{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Transaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type TransactionNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + From *PrincipalId `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + FromSubaccount *Subaccount `protobuf:"bytes,2,opt,name=from_subaccount,json=fromSubaccount,proto3" json:"from_subaccount,omitempty"` + To *PrincipalId `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + ToSubaccount *Subaccount `protobuf:"bytes,4,opt,name=to_subaccount,json=toSubaccount,proto3" json:"to_subaccount,omitempty"` + BlockHeight *BlockIndex `protobuf:"bytes,5,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Amount *Tokens `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` + Memo *Memo `protobuf:"bytes,7,opt,name=memo,proto3" json:"memo,omitempty"` +} + +// Deprecated: Use TransactionNotificationRequest.ProtoReflect.Descriptor instead. +func (*TransactionNotificationRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{7} +} + +func (x *TransactionNotificationRequest) GetAmount() *Tokens { + if x != nil { + return x.Amount + } + return nil +} + +func (x *TransactionNotificationRequest) GetBlockHeight() *BlockIndex { + if x != nil { + return x.BlockHeight + } + return nil +} + +func (x *TransactionNotificationRequest) GetFrom() *PrincipalId { + if x != nil { + return x.From + } + return nil +} + +func (x *TransactionNotificationRequest) GetFromSubaccount() *Subaccount { + if x != nil { + return x.FromSubaccount + } + return nil +} + +func (x *TransactionNotificationRequest) GetMemo() *Memo { + if x != nil { + return x.Memo + } + return nil +} + +func (x *TransactionNotificationRequest) GetTo() *PrincipalId { + if x != nil { + return x.To + } + return nil +} + +func (x *TransactionNotificationRequest) GetToSubaccount() *Subaccount { + if x != nil { + return x.ToSubaccount + } + return nil +} + +func (*TransactionNotificationRequest) ProtoMessage() {} + +func (x *TransactionNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TransactionNotificationRequest) Reset() { + *x = TransactionNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type TransactionNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response []byte `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` +} + +// Deprecated: Use TransactionNotificationResponse.ProtoReflect.Descriptor instead. +func (*TransactionNotificationResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{8} +} + +func (x *TransactionNotificationResponse) GetResponse() []byte { + if x != nil { + return x.Response + } + return nil +} + +func (*TransactionNotificationResponse) ProtoMessage() {} + +func (x *TransactionNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TransactionNotificationResponse) Reset() { + *x = TransactionNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type Transaction_Burn struct { + Burn *Burn `protobuf:"bytes,1,opt,name=burn,proto3,oneof"` +} + +func (*Transaction_Burn) isTransaction_Transfer() {} + +type Transaction_Mint struct { + Mint *Mint `protobuf:"bytes,2,opt,name=mint,proto3,oneof"` +} + +func (*Transaction_Mint) isTransaction_Transfer() {} + +type Transaction_Send struct { + Send *Send `protobuf:"bytes,3,opt,name=send,proto3,oneof"` +} + +func (*Transaction_Send) isTransaction_Transfer() {} + +type TransferFeeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +// Deprecated: Use TransferFeeRequest.ProtoReflect.Descriptor instead. +func (*TransferFeeRequest) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{52} +} + +func (*TransferFeeRequest) ProtoMessage() {} + +func (x *TransferFeeRequest) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[52] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TransferFeeRequest) Reset() { + *x = TransferFeeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferFeeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type TransferFeeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransferFee *Tokens `protobuf:"bytes,1,opt,name=transfer_fee,json=transferFee,proto3" json:"transfer_fee,omitempty"` +} + +// Deprecated: Use TransferFeeResponse.ProtoReflect.Descriptor instead. +func (*TransferFeeResponse) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{53} +} + +func (x *TransferFeeResponse) GetTransferFee() *Tokens { + if x != nil { + return x.TransferFee + } + return nil +} + +func (*TransferFeeResponse) ProtoMessage() {} + +func (x *TransferFeeResponse) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[53] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TransferFeeResponse) Reset() { + *x = TransferFeeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferFeeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type TransferFrom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The default account id of the principal who sent the transaction. + Spender *AccountIdentifier `protobuf:"bytes,1,opt,name=spender,proto3" json:"spender,omitempty"` +} + +// Deprecated: Use TransferFrom.ProtoReflect.Descriptor instead. +func (*TransferFrom) Descriptor() ([]byte, []int) { + return file_ledger_proto_rawDescGZIP(), []int{42} +} + +func (x *TransferFrom) GetSpender() *AccountIdentifier { + if x != nil { + return x.Spender + } + return nil +} + +func (*TransferFrom) ProtoMessage() {} + +func (x *TransferFrom) ProtoReflect() protoreflect.Message { + mi := &file_ledger_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *TransferFrom) Reset() { + *x = TransferFrom{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferFrom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +type isBlockResponse_BlockContent interface { + isBlockResponse_BlockContent() +} +type isCyclesNotificationResponse_Response interface { + isCyclesNotificationResponse_Response() +} +type isGetBlocksResponse_GetBlocksContent interface { + isGetBlocksResponse_GetBlocksContent() +} + +type isSend_Extension interface { + isSend_Extension() +} +type isTransaction_Transfer interface { + isTransaction_Transfer() +} diff --git a/clients/ledger/testdata/ledger.proto b/clients/ledger/testdata/ledger.proto new file mode 100644 index 0000000..737d760 --- /dev/null +++ b/clients/ledger/testdata/ledger.proto @@ -0,0 +1,333 @@ +syntax = "proto3"; + +package ic_ledger.pb.v1; +option go_package = "proto/v1"; + +import "google/protobuf/descriptor.proto"; + +// The annotated message is supported by hardware wallet signing. +// The numbering was chosen as the range 19000-19999 is anyway reserved in protobuf. +extend google.protobuf.MessageOptions { + bool tui_signed_message = 20000; +} + +// The annotated field is displayed on the hardware wallet in the specification +// used by launch of the Internet Computer. +extend google.protobuf.FieldOptions { + bool tui_signed_display_q2_2021 = 20001; +} + +// A PB container for a PrincipalId, which uniquely identifies +// a principal. +message PrincipalId { + option (tui_signed_message) = true; + bytes serialized_id = 1 [(tui_signed_display_q2_2021) = true]; +} +// Annotations related to the use of hardware wallets. The annotated messages are +// parsed on hardware wallets and marked fields are displayed in a trusted user +// interface (TUI). We must not, for instance, add fields that would change the +// semantics of the message such that old hardware wallets would not display +// appropriate information to users. + +// ** LEDGER CANISTER ENDPOINTS + +// Initialise the ledger canister +message LedgerInit { + AccountIdentifier minting_account = 1; + repeated Account initial_values = 2; + PrincipalId archive_canister = 3; + uint32 max_message_size_bytes = 4; +} + +// The format of values serialized to/from the stable memory during and upgrade +message LedgerUpgrade {} + +// Make a payment +message SendRequest { + option (tui_signed_message) = true; + Memo memo = 1 [(tui_signed_display_q2_2021) = true]; + Payment payment = 2 [(tui_signed_display_q2_2021) = true]; + Tokens max_fee = 3 [(tui_signed_display_q2_2021) = true]; + Subaccount from_subaccount = 4 [(tui_signed_display_q2_2021) = true]; + AccountIdentifier to = 5 [(tui_signed_display_q2_2021) = true]; + BlockIndex created_at = 6; + TimeStamp created_at_time = 7; +} + +message SendResponse { + BlockIndex resulting_height = 1; +} + +// Notify a canister that it has received a payment +message NotifyRequest { + option (tui_signed_message) = true; + BlockIndex block_height = 1 [(tui_signed_display_q2_2021) = true]; + Tokens max_fee = 2 [(tui_signed_display_q2_2021) = true]; + Subaccount from_subaccount = 3 [(tui_signed_display_q2_2021) = true]; + PrincipalId to_canister = 4 [(tui_signed_display_q2_2021) = true]; + Subaccount to_subaccount = 5 [(tui_signed_display_q2_2021) = true]; +} + +message NotifyResponse {} + +message TransactionNotificationRequest { + PrincipalId from = 1; + Subaccount from_subaccount = 2; + PrincipalId to = 3; + Subaccount to_subaccount = 4; + BlockIndex block_height = 5; + Tokens amount = 6; + Memo memo = 7; +} + +message TransactionNotificationResponse { + bytes response = 1; +} + +message CyclesNotificationResponse { + oneof response { + PrincipalId created_canister_id = 1; + Refund refund = 2; + ToppedUp topped_up = 3; + } +} + +// Get the balance of an account +message AccountBalanceRequest { + AccountIdentifier account = 1; +} + +message AccountBalanceResponse { + Tokens balance = 1; +} + +// Get the length of the chain with a certification +message TipOfChainRequest {} + +message TipOfChainResponse { + Certification certification = 1; + BlockIndex chain_length = 2; +} + +// How many Tokens are there not in the minting account +message TotalSupplyRequest {} + +message TotalSupplyResponse { + Tokens total_supply = 1; +} + +// Archive any blocks older than this +message LedgerArchiveRequest { + TimeStamp timestamp = 1; +} + +// * Shared Endpoints * + +// Get a single block +message BlockRequest { + uint64 block_height = 1; +} + +message EncodedBlock { + bytes block = 1; +} + +message BlockResponse { + oneof block_content { + EncodedBlock block = 1; + PrincipalId canister_id = 2; + } +} + +// Get a set of blocks +message GetBlocksRequest { + uint64 start = 1; + uint64 length = 2; +} + +message Refund { + BlockIndex refund = 2; + string error = 3; +} + +message ToppedUp {} + +message EncodedBlocks { + repeated EncodedBlock blocks = 1; +} + +message GetBlocksResponse { + oneof get_blocks_content { + EncodedBlocks blocks = 1; + string error = 2; + } +} + +// Iterate through blocks +message IterBlocksRequest { + uint64 start = 1; + uint64 length = 2; +} + +message IterBlocksResponse { + repeated EncodedBlock blocks = 1; +} + +message ArchiveIndexEntry { + uint64 height_from = 1; + uint64 height_to = 2; + PrincipalId canister_id = 3; +} + +message ArchiveIndexResponse { + repeated ArchiveIndexEntry entries = 1; +} + +// ** ARCHIVE CANISTER ENDPOINTS ** + +// * Archive canister * +// Init the archive canister +message ArchiveInit { + uint32 node_max_memory_size_bytes = 1; + uint32 max_message_size_bytes = 2; +} + +// Add blocks to the archive canister +message ArchiveAddRequest { + repeated Block blocks = 1; +} + +message ArchiveAddResponse {} + +// Fetch a list of all of the archive nodes +message GetNodesRequest {} + +message GetNodesResponse { + repeated PrincipalId nodes = 1; +} + +// ** BASIC TYPES ** +message Tokens { + option (tui_signed_message) = true; + uint64 e8s = 1 [(tui_signed_display_q2_2021) = true]; +} + +message Payment { + option (tui_signed_message) = true; + Tokens receiver_gets = 1 [(tui_signed_display_q2_2021) = true]; +} + +message BlockIndex { + option (tui_signed_message) = true; + uint64 height = 1 [(tui_signed_display_q2_2021) = true]; +} + +// This is the +message Block { + Hash parent_hash = 1; + TimeStamp timestamp = 2; + Transaction transaction = 3; +} + +message Hash { + bytes hash = 1; +} + +message Account { + AccountIdentifier identifier = 1; + Tokens balance = 2; +} + +message Transaction { + oneof transfer { + Burn burn = 1; + Mint mint = 2; + Send send = 3; + } + Memo memo = 4; + Icrc1Memo icrc1_memo = 7; + BlockIndex created_at = 5; // obsolete + TimeStamp created_at_time = 6; +} + +message Send { + // The meaning of the [from] field depends on the transaction type: + // - Transfer: [from] is the source account. + // - TransferFrom: [from] is the approver. + // - Approve: [from] is the approver. + AccountIdentifier from = 1; + // The meaning of the [to] field depends on the transaction type: + // - Transfer: [to] is the destination account. + // - TransferFrom: [to] is the destination account. + // - Approve: [to] is the default account id of the approved principal. + AccountIdentifier to = 2; + // If the transaction type is Approve, the amount must be zero. + Tokens amount = 3; + Tokens max_fee = 4; + + // We represent metadata of new operation types as submessages for + // backward compatibility with old clients. + oneof extension { + Approve approve = 5; + TransferFrom transfer_from = 6; + } +} + +message TransferFrom { + // The default account id of the principal who sent the transaction. + AccountIdentifier spender = 1; +} + +message Approve { + Tokens allowance = 1; + TimeStamp expires_at = 2; + Tokens expected_allowance = 3; +} + +message Mint { + AccountIdentifier to = 2; + Tokens amount = 3; +} + +message Burn { + AccountIdentifier from = 1; + Tokens amount = 3; + AccountIdentifier spender = 4; +} + +message AccountIdentifier { + option (tui_signed_message) = true; + // Can contain either: + // * the 32 byte identifier (4 byte checksum + 28 byte hash) + // * the 28 byte hash + bytes hash = 1 [(tui_signed_display_q2_2021) = true]; +} + +message Subaccount { + option (tui_signed_message) = true; + bytes sub_account = 1 [(tui_signed_display_q2_2021) = true]; +} + +message Memo { + option (tui_signed_message) = true; + uint64 memo = 1 [(tui_signed_display_q2_2021) = true]; +} + +message Icrc1Memo { + option (tui_signed_message) = true; + bytes memo = 1 [(tui_signed_display_q2_2021) = true]; +} + +message TimeStamp { + uint64 timestamp_nanos = 1; +} + +message Certification { + bytes certification = 1; +} + +message TransferFeeRequest {} + +message TransferFeeResponse { + Tokens transfer_fee = 1; +} diff --git a/registry/README.md b/clients/registry/README.md similarity index 100% rename from registry/README.md rename to clients/registry/README.md diff --git a/registry/client.go b/clients/registry/client.go similarity index 99% rename from registry/client.go rename to clients/registry/client.go index c2591b5..f81dfe2 100644 --- a/registry/client.go +++ b/clients/registry/client.go @@ -3,8 +3,8 @@ package registry import ( "fmt" "github.com/aviate-labs/agent-go/certification" + v1 "github.com/aviate-labs/agent-go/clients/registry/proto/v1" "github.com/aviate-labs/agent-go/principal" - v1 "github.com/aviate-labs/agent-go/registry/proto/v1" "google.golang.org/protobuf/proto" "strings" ) diff --git a/registry/client_test.go b/clients/registry/client_test.go similarity index 91% rename from registry/client_test.go rename to clients/registry/client_test.go index 61c0129..f2c3685 100644 --- a/registry/client_test.go +++ b/clients/registry/client_test.go @@ -1,7 +1,7 @@ package registry_test import ( - "github.com/aviate-labs/agent-go/registry" + "github.com/aviate-labs/agent-go/clients/registry" "os" "testing" ) diff --git a/registry/dataprovider.go b/clients/registry/dataprovider.go similarity index 98% rename from registry/dataprovider.go rename to clients/registry/dataprovider.go index 2a01c4a..89eb96e 100644 --- a/registry/dataprovider.go +++ b/clients/registry/dataprovider.go @@ -7,8 +7,8 @@ import ( "github.com/aviate-labs/agent-go" "github.com/aviate-labs/agent-go/certification" "github.com/aviate-labs/agent-go/certification/hashtree" + "github.com/aviate-labs/agent-go/clients/registry/proto/v1" "github.com/aviate-labs/agent-go/ic" - "github.com/aviate-labs/agent-go/registry/proto/v1" "github.com/aviate-labs/leb128" "github.com/fxamacker/cbor/v2" "google.golang.org/protobuf/proto" diff --git a/registry/dataprovider_test.go b/clients/registry/dataprovider_test.go similarity index 83% rename from registry/dataprovider_test.go rename to clients/registry/dataprovider_test.go index 98031e5..2a4da23 100644 --- a/registry/dataprovider_test.go +++ b/clients/registry/dataprovider_test.go @@ -1,7 +1,7 @@ package registry_test import ( - "github.com/aviate-labs/agent-go/registry" + "github.com/aviate-labs/agent-go/clients/registry" "testing" ) diff --git a/registry/hashtree.go b/clients/registry/hashtree.go similarity index 94% rename from registry/hashtree.go rename to clients/registry/hashtree.go index cc2337e..84ac231 100644 --- a/registry/hashtree.go +++ b/clients/registry/hashtree.go @@ -3,7 +3,7 @@ package registry import ( "fmt" "github.com/aviate-labs/agent-go/certification/hashtree" - v1 "github.com/aviate-labs/agent-go/registry/proto/v1" + v1 "github.com/aviate-labs/agent-go/clients/registry/proto/v1" ) func NewHashTree(tree *v1.MixedHashTree) (*hashtree.HashTree, error) { diff --git a/registry/proto.go b/clients/registry/proto.go similarity index 100% rename from registry/proto.go rename to clients/registry/proto.go diff --git a/registry/proto/v1/local.pb.go b/clients/registry/proto/v1/local.pb.go similarity index 97% rename from registry/proto/v1/local.pb.go rename to clients/registry/proto/v1/local.pb.go index 5de8427..0c95201 100644 --- a/registry/proto/v1/local.pb.go +++ b/clients/registry/proto/v1/local.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v5.26.1 // source: local.proto @@ -56,7 +56,7 @@ var file_local_proto_depIdxs = []int32{ var file_local_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_local_proto_goTypes = []interface{}{ +var file_local_proto_goTypes = []any{ (MutationType)(0), // 0: ic_registry_common.pb.local_store.v1.MutationType (*ChangelogEntry)(nil), // 1: ic_registry_common.pb.local_store.v1.ChangelogEntry (*KeyMutation)(nil), // 2: ic_registry_common.pb.local_store.v1.KeyMutation @@ -375,7 +375,7 @@ func file_local_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_local_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_local_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*ChangelogEntry); i { case 0: return &v.state @@ -387,7 +387,7 @@ func file_local_proto_init() { return nil } } - file_local_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_local_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*KeyMutation); i { case 0: return &v.state @@ -399,7 +399,7 @@ func file_local_proto_init() { return nil } } - file_local_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_local_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*CertifiedTime); i { case 0: return &v.state @@ -411,7 +411,7 @@ func file_local_proto_init() { return nil } } - file_local_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_local_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*Delta); i { case 0: return &v.state diff --git a/registry/proto/v1/node.pb.go b/clients/registry/proto/v1/node.pb.go similarity index 97% rename from registry/proto/v1/node.pb.go rename to clients/registry/proto/v1/node.pb.go index 0d9fc22..f8e70a8 100644 --- a/registry/proto/v1/node.pb.go +++ b/clients/registry/proto/v1/node.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v5.26.1 // source: node.proto @@ -38,7 +38,7 @@ var file_node_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -var file_node_proto_goTypes = []interface{}{ +var file_node_proto_goTypes = []any{ (*ConnectionEndpoint)(nil), // 0: registry.node.v1.ConnectionEndpoint (*IPv4InterfaceConfig)(nil), // 1: registry.node.v1.IPv4InterfaceConfig (*NodeRecord)(nil), // 2: registry.node.v1.NodeRecord @@ -115,7 +115,7 @@ func file_node_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_node_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*ConnectionEndpoint); i { case 0: return &v.state @@ -127,7 +127,7 @@ func file_node_proto_init() { return nil } } - file_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_node_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*IPv4InterfaceConfig); i { case 0: return &v.state @@ -139,7 +139,7 @@ func file_node_proto_init() { return nil } } - file_node_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_node_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*NodeRecord); i { case 0: return &v.state @@ -152,7 +152,7 @@ func file_node_proto_init() { } } } - file_node_proto_msgTypes[2].OneofWrappers = []interface{}{} + file_node_proto_msgTypes[2].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/registry/proto/v1/operator.pb.go b/clients/registry/proto/v1/operator.pb.go similarity index 97% rename from registry/proto/v1/operator.pb.go rename to clients/registry/proto/v1/operator.pb.go index 13a63a9..430bc94 100644 --- a/registry/proto/v1/operator.pb.go +++ b/clients/registry/proto/v1/operator.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v5.26.1 // source: operator.proto @@ -36,7 +36,7 @@ var file_operator_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -var file_operator_proto_goTypes = []interface{}{ +var file_operator_proto_goTypes = []any{ (*NodeOperatorRecord)(nil), // 0: registry.node_operator.v1.NodeOperatorRecord (*RemoveNodeOperatorsPayload)(nil), // 1: registry.node_operator.v1.RemoveNodeOperatorsPayload nil, // 2: registry.node_operator.v1.NodeOperatorRecord.RewardableNodesEntry @@ -244,7 +244,7 @@ func file_operator_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_operator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_operator_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*NodeOperatorRecord); i { case 0: return &v.state @@ -256,7 +256,7 @@ func file_operator_proto_init() { return nil } } - file_operator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_operator_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*RemoveNodeOperatorsPayload); i { case 0: return &v.state @@ -269,7 +269,7 @@ func file_operator_proto_init() { } } } - file_operator_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_operator_proto_msgTypes[0].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/registry/proto/v1/registry.pb.go b/clients/registry/proto/v1/registry.pb.go similarity index 96% rename from registry/proto/v1/registry.pb.go rename to clients/registry/proto/v1/registry.pb.go index 08380d2..a401912 100644 --- a/registry/proto/v1/registry.pb.go +++ b/clients/registry/proto/v1/registry.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v5.26.1 // source: registry.proto @@ -38,7 +38,7 @@ var file_registry_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -var file_registry_proto_goTypes = []interface{}{ +var file_registry_proto_goTypes = []any{ (*ProtoRegistry)(nil), // 0: ic_registry_common.pb.proto_registry.v1.ProtoRegistry (*ProtoRegistryRecord)(nil), // 1: ic_registry_common.pb.proto_registry.v1.ProtoRegistryRecord (*wrapperspb.BytesValue)(nil), // 2: google.protobuf.BytesValue @@ -70,56 +70,6 @@ var file_registry_proto_rawDesc = []byte{ 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func file_registry_proto_init() { - if File_registry_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoRegistry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoRegistryRecord); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_registry_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_registry_proto_goTypes, - DependencyIndexes: file_registry_proto_depIdxs, - MessageInfos: file_registry_proto_msgTypes, - }.Build() - File_registry_proto = out.File - file_registry_proto_rawDesc = nil - file_registry_proto_goTypes = nil - file_registry_proto_depIdxs = nil -} - func file_registry_proto_rawDescGZIP() []byte { file_registry_proto_rawDescOnce.Do(func() { file_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_registry_proto_rawDescData) @@ -127,8 +77,6 @@ func file_registry_proto_rawDescGZIP() []byte { return file_registry_proto_rawDescData } -func init() { file_registry_proto_init() } - type ProtoRegistry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -211,7 +159,9 @@ func (x *ProtoRegistryRecord) GetVersion() uint64 { } return 0 } + func (*ProtoRegistryRecord) ProtoMessage() {} + func (x *ProtoRegistryRecord) ProtoReflect() protoreflect.Message { mi := &file_registry_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { @@ -223,7 +173,6 @@ func (x *ProtoRegistryRecord) ProtoReflect() protoreflect.Message { } return mi.MessageOf(x) } - func (x *ProtoRegistryRecord) Reset() { *x = ProtoRegistryRecord{} if protoimpl.UnsafeEnabled { @@ -235,3 +184,54 @@ func (x *ProtoRegistryRecord) Reset() { func (x *ProtoRegistryRecord) String() string { return protoimpl.X.MessageStringOf(x) } + +func init() { file_registry_proto_init() } +func file_registry_proto_init() { + if File_registry_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_registry_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*ProtoRegistry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_registry_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*ProtoRegistryRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_registry_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_registry_proto_goTypes, + DependencyIndexes: file_registry_proto_depIdxs, + MessageInfos: file_registry_proto_msgTypes, + }.Build() + File_registry_proto = out.File + file_registry_proto_rawDesc = nil + file_registry_proto_goTypes = nil + file_registry_proto_depIdxs = nil +} diff --git a/registry/proto/v1/subnet.pb.go b/clients/registry/proto/v1/subnet.pb.go similarity index 98% rename from registry/proto/v1/subnet.pb.go rename to clients/registry/proto/v1/subnet.pb.go index 0b67deb..c345e10 100644 --- a/registry/proto/v1/subnet.pb.go +++ b/clients/registry/proto/v1/subnet.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v5.26.1 // source: subnet.proto @@ -214,7 +214,7 @@ var file_subnet_proto_depIdxs = []int32{ var file_subnet_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_subnet_proto_goTypes = []interface{}{ +var file_subnet_proto_goTypes = []any{ (EcdsaCurve)(0), // 0: registry.subnet.v1.EcdsaCurve (NiDkgTag)(0), // 1: registry.subnet.v1.NiDkgTag (AlgorithmId)(0), // 2: registry.subnet.v1.AlgorithmId @@ -3414,7 +3414,7 @@ func file_subnet_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_subnet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*SubnetRecord); i { case 0: return &v.state @@ -3426,7 +3426,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*EcdsaKeyId); i { case 0: return &v.state @@ -3438,7 +3438,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*EcdsaInitialization); i { case 0: return &v.state @@ -3450,7 +3450,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*CatchUpPackageContents); i { case 0: return &v.state @@ -3462,7 +3462,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*RegistryStoreUri); i { case 0: return &v.state @@ -3474,7 +3474,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*SubnetListRecord); i { case 0: return &v.state @@ -3486,7 +3486,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*NiDkgId); i { case 0: return &v.state @@ -3498,7 +3498,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*InitialNiDkgTranscriptRecord); i { case 0: return &v.state @@ -3510,7 +3510,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*PrincipalId); i { case 0: return &v.state @@ -3522,7 +3522,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*SubnetId); i { case 0: return &v.state @@ -3534,7 +3534,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*IDkgTranscriptId); i { case 0: return &v.state @@ -3546,7 +3546,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*VerifiedIDkgDealing); i { case 0: return &v.state @@ -3558,7 +3558,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*NodeId); i { case 0: return &v.state @@ -3570,7 +3570,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*PublicKey); i { case 0: return &v.state @@ -3582,7 +3582,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*IDkgTranscript); i { case 0: return &v.state @@ -3594,7 +3594,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*DealerTuple); i { case 0: return &v.state @@ -3606,7 +3606,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*SignatureTuple); i { case 0: return &v.state @@ -3618,7 +3618,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*IDkgTranscriptParams); i { case 0: return &v.state @@ -3630,7 +3630,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*IDkgDealing); i { case 0: return &v.state @@ -3642,7 +3642,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*IDkgSignedDealingTuple); i { case 0: return &v.state @@ -3654,7 +3654,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*InitialIDkgDealings); i { case 0: return &v.state @@ -3666,7 +3666,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*IDkgComplaint); i { case 0: return &v.state @@ -3678,7 +3678,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*IDkgOpening); i { case 0: return &v.state @@ -3690,7 +3690,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*ExtendedDerivationPath); i { case 0: return &v.state @@ -3702,7 +3702,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*GossipConfig); i { case 0: return &v.state @@ -3714,7 +3714,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*SubnetFeatures); i { case 0: return &v.state @@ -3726,7 +3726,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[26].Exporter = func(v any, i int) any { switch v := v.(*EcdsaConfig); i { case 0: return &v.state @@ -3738,7 +3738,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[27].Exporter = func(v any, i int) any { switch v := v.(*SchnorrKeyId); i { case 0: return &v.state @@ -3750,7 +3750,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[28].Exporter = func(v any, i int) any { switch v := v.(*MasterPublicKeyId); i { case 0: return &v.state @@ -3762,7 +3762,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[29].Exporter = func(v any, i int) any { switch v := v.(*KeyConfig); i { case 0: return &v.state @@ -3774,7 +3774,7 @@ func file_subnet_proto_init() { return nil } } - file_subnet_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_subnet_proto_msgTypes[30].Exporter = func(v any, i int) any { switch v := v.(*ChainKeyConfig); i { case 0: return &v.state @@ -3787,15 +3787,15 @@ func file_subnet_proto_init() { } } } - file_subnet_proto_msgTypes[0].OneofWrappers = []interface{}{} - file_subnet_proto_msgTypes[25].OneofWrappers = []interface{}{} - file_subnet_proto_msgTypes[26].OneofWrappers = []interface{}{} - file_subnet_proto_msgTypes[28].OneofWrappers = []interface{}{ + file_subnet_proto_msgTypes[0].OneofWrappers = []any{} + file_subnet_proto_msgTypes[25].OneofWrappers = []any{} + file_subnet_proto_msgTypes[26].OneofWrappers = []any{} + file_subnet_proto_msgTypes[28].OneofWrappers = []any{ (*MasterPublicKeyId_Ecdsa)(nil), (*MasterPublicKeyId_Schnorr)(nil), } - file_subnet_proto_msgTypes[29].OneofWrappers = []interface{}{} - file_subnet_proto_msgTypes[30].OneofWrappers = []interface{}{} + file_subnet_proto_msgTypes[29].OneofWrappers = []any{} + file_subnet_proto_msgTypes[30].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/registry/proto/v1/transport.pb.go b/clients/registry/proto/v1/transport.pb.go similarity index 97% rename from registry/proto/v1/transport.pb.go rename to clients/registry/proto/v1/transport.pb.go index 26c43d9..899fb15 100644 --- a/registry/proto/v1/transport.pb.go +++ b/clients/registry/proto/v1/transport.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.1 +// protoc-gen-go v1.34.2 // protoc v5.26.1 // source: transport.proto @@ -117,7 +117,7 @@ var file_transport_proto_depIdxs = []int32{ var file_transport_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_transport_proto_goTypes = []interface{}{ +var file_transport_proto_goTypes = []any{ (RegistryError_Code)(0), // 0: ic_registry_transport.pb.v1.RegistryError.Code (RegistryMutation_Type)(0), // 1: ic_registry_transport.pb.v1.RegistryMutation.Type (*RegistryError)(nil), // 2: ic_registry_transport.pb.v1.RegistryError @@ -305,7 +305,7 @@ func file_transport_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_transport_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*RegistryError); i { case 0: return &v.state @@ -317,7 +317,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*RegistryValue); i { case 0: return &v.state @@ -329,7 +329,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*RegistryDelta); i { case 0: return &v.state @@ -341,7 +341,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*RegistryGetChangesSinceRequest); i { case 0: return &v.state @@ -353,7 +353,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*RegistryGetChangesSinceResponse); i { case 0: return &v.state @@ -365,7 +365,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*RegistryGetValueRequest); i { case 0: return &v.state @@ -377,7 +377,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*RegistryGetValueResponse); i { case 0: return &v.state @@ -389,7 +389,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*RegistryGetLatestVersionResponse); i { case 0: return &v.state @@ -401,7 +401,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*RegistryMutation); i { case 0: return &v.state @@ -413,7 +413,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*Precondition); i { case 0: return &v.state @@ -425,7 +425,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*RegistryAtomicMutateRequest); i { case 0: return &v.state @@ -437,7 +437,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*RegistryAtomicMutateResponse); i { case 0: return &v.state @@ -449,7 +449,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*MixedHashTree); i { case 0: return &v.state @@ -461,7 +461,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*CertifiedResponse); i { case 0: return &v.state @@ -473,7 +473,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*MixedHashTree_Fork); i { case 0: return &v.state @@ -485,7 +485,7 @@ func file_transport_proto_init() { return nil } } - file_transport_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_transport_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*MixedHashTree_Labeled); i { case 0: return &v.state @@ -498,7 +498,7 @@ func file_transport_proto_init() { } } } - file_transport_proto_msgTypes[12].OneofWrappers = []interface{}{ + file_transport_proto_msgTypes[12].OneofWrappers = []any{ (*MixedHashTree_Empty)(nil), (*MixedHashTree_Fork_)(nil), (*MixedHashTree_Labeled_)(nil), diff --git a/registry/testdata/local.proto b/clients/registry/testdata/local.proto similarity index 100% rename from registry/testdata/local.proto rename to clients/registry/testdata/local.proto diff --git a/registry/testdata/node.proto b/clients/registry/testdata/node.proto similarity index 100% rename from registry/testdata/node.proto rename to clients/registry/testdata/node.proto diff --git a/registry/testdata/operator.proto b/clients/registry/testdata/operator.proto similarity index 100% rename from registry/testdata/operator.proto rename to clients/registry/testdata/operator.proto diff --git a/registry/testdata/registry.proto b/clients/registry/testdata/registry.proto similarity index 100% rename from registry/testdata/registry.proto rename to clients/registry/testdata/registry.proto diff --git a/registry/testdata/subnet.proto b/clients/registry/testdata/subnet.proto similarity index 100% rename from registry/testdata/subnet.proto rename to clients/registry/testdata/subnet.proto diff --git a/registry/testdata/transport.proto b/clients/registry/testdata/transport.proto similarity index 100% rename from registry/testdata/transport.proto rename to clients/registry/testdata/transport.proto diff --git a/gen/templates/agent_indirect.gotmpl b/gen/templates/agent_indirect.gotmpl index 5f5a9a2..cc4c63d 100644 --- a/gen/templates/agent_indirect.gotmpl +++ b/gen/templates/agent_indirect.gotmpl @@ -49,8 +49,9 @@ func (a {{ $.AgentName }}Agent) {{ .Name }}({{ range $i, $e := .ArgumentTypes }} } // {{ .Name }}{{ .Type }} creates an indirect representation of the "{{ .RawName }}" method on the "{{ $.CanisterName }}" canister. -func (a {{ $.AgentName }}Agent) {{ .Name }}{{ .Type }}({{ range $i, $e := .ArgumentTypes }}{{ if $i }}, {{ end }}{{ $e.Name }} {{ $e.Type }}{{ end }}) (*agent.{{ .Type }},error) { - return a.Agent.Create{{ .Type }}( +func (a {{ $.AgentName }}Agent) {{ .Name }}{{ .Type }}({{ range $i, $e := .ArgumentTypes }}{{ if $i }}, {{ end }}{{ $e.Name }} {{ $e.Type }}{{ end }}) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestType{{ .Type }}, a.CanisterId, "{{ .RawName }}",{{ range $i, $e := .ArgumentTypes }} {{ $e.Name }},{{ end }} diff --git a/ic/ic/agent.go b/ic/ic/agent.go index 563ed56..3ef4537 100755 --- a/ic/ic/agent.go +++ b/ic/ic/agent.go @@ -41,8 +41,9 @@ func (a Agent) BitcoinGetBalance(arg0 BitcoinGetBalanceArgs) (*BitcoinGetBalance } // BitcoinGetBalanceCall creates an indirect representation of the "bitcoin_get_balance" method on the "ic" canister. -func (a Agent) BitcoinGetBalanceCall(arg0 BitcoinGetBalanceArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) BitcoinGetBalanceCall(arg0 BitcoinGetBalanceArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "bitcoin_get_balance", arg0, @@ -64,8 +65,9 @@ func (a Agent) BitcoinGetBalanceQuery(arg0 BitcoinGetBalanceQueryArgs) (*Bitcoin } // BitcoinGetBalanceQueryQuery creates an indirect representation of the "bitcoin_get_balance_query" method on the "ic" canister. -func (a Agent) BitcoinGetBalanceQueryQuery(arg0 BitcoinGetBalanceQueryArgs) (*agent.Query, error) { - return a.Agent.CreateQuery( +func (a Agent) BitcoinGetBalanceQueryQuery(arg0 BitcoinGetBalanceQueryArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeQuery, a.CanisterId, "bitcoin_get_balance_query", arg0, @@ -87,8 +89,9 @@ func (a Agent) BitcoinGetCurrentFeePercentiles(arg0 BitcoinGetCurrentFeePercenti } // BitcoinGetCurrentFeePercentilesCall creates an indirect representation of the "bitcoin_get_current_fee_percentiles" method on the "ic" canister. -func (a Agent) BitcoinGetCurrentFeePercentilesCall(arg0 BitcoinGetCurrentFeePercentilesArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) BitcoinGetCurrentFeePercentilesCall(arg0 BitcoinGetCurrentFeePercentilesArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "bitcoin_get_current_fee_percentiles", arg0, @@ -110,8 +113,9 @@ func (a Agent) BitcoinGetUtxos(arg0 BitcoinGetUtxosArgs) (*BitcoinGetUtxosResult } // BitcoinGetUtxosCall creates an indirect representation of the "bitcoin_get_utxos" method on the "ic" canister. -func (a Agent) BitcoinGetUtxosCall(arg0 BitcoinGetUtxosArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) BitcoinGetUtxosCall(arg0 BitcoinGetUtxosArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "bitcoin_get_utxos", arg0, @@ -133,8 +137,9 @@ func (a Agent) BitcoinGetUtxosQuery(arg0 BitcoinGetUtxosQueryArgs) (*BitcoinGetU } // BitcoinGetUtxosQueryQuery creates an indirect representation of the "bitcoin_get_utxos_query" method on the "ic" canister. -func (a Agent) BitcoinGetUtxosQueryQuery(arg0 BitcoinGetUtxosQueryArgs) (*agent.Query, error) { - return a.Agent.CreateQuery( +func (a Agent) BitcoinGetUtxosQueryQuery(arg0 BitcoinGetUtxosQueryArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeQuery, a.CanisterId, "bitcoin_get_utxos_query", arg0, @@ -155,8 +160,9 @@ func (a Agent) BitcoinSendTransaction(arg0 BitcoinSendTransactionArgs) error { } // BitcoinSendTransactionCall creates an indirect representation of the "bitcoin_send_transaction" method on the "ic" canister. -func (a Agent) BitcoinSendTransactionCall(arg0 BitcoinSendTransactionArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) BitcoinSendTransactionCall(arg0 BitcoinSendTransactionArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "bitcoin_send_transaction", arg0, @@ -178,8 +184,9 @@ func (a Agent) CanisterInfo(arg0 CanisterInfoArgs) (*CanisterInfoResult, error) } // CanisterInfoCall creates an indirect representation of the "canister_info" method on the "ic" canister. -func (a Agent) CanisterInfoCall(arg0 CanisterInfoArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) CanisterInfoCall(arg0 CanisterInfoArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "canister_info", arg0, @@ -201,8 +208,9 @@ func (a Agent) CanisterStatus(arg0 CanisterStatusArgs) (*CanisterStatusResult, e } // CanisterStatusCall creates an indirect representation of the "canister_status" method on the "ic" canister. -func (a Agent) CanisterStatusCall(arg0 CanisterStatusArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) CanisterStatusCall(arg0 CanisterStatusArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "canister_status", arg0, @@ -223,8 +231,9 @@ func (a Agent) ClearChunkStore(arg0 ClearChunkStoreArgs) error { } // ClearChunkStoreCall creates an indirect representation of the "clear_chunk_store" method on the "ic" canister. -func (a Agent) ClearChunkStoreCall(arg0 ClearChunkStoreArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) ClearChunkStoreCall(arg0 ClearChunkStoreArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "clear_chunk_store", arg0, @@ -246,8 +255,9 @@ func (a Agent) CreateCanister(arg0 CreateCanisterArgs) (*CreateCanisterResult, e } // CreateCanisterCall creates an indirect representation of the "create_canister" method on the "ic" canister. -func (a Agent) CreateCanisterCall(arg0 CreateCanisterArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) CreateCanisterCall(arg0 CreateCanisterArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "create_canister", arg0, @@ -268,8 +278,9 @@ func (a Agent) DeleteCanister(arg0 DeleteCanisterArgs) error { } // DeleteCanisterCall creates an indirect representation of the "delete_canister" method on the "ic" canister. -func (a Agent) DeleteCanisterCall(arg0 DeleteCanisterArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) DeleteCanisterCall(arg0 DeleteCanisterArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "delete_canister", arg0, @@ -290,8 +301,9 @@ func (a Agent) DepositCycles(arg0 DepositCyclesArgs) error { } // DepositCyclesCall creates an indirect representation of the "deposit_cycles" method on the "ic" canister. -func (a Agent) DepositCyclesCall(arg0 DepositCyclesArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) DepositCyclesCall(arg0 DepositCyclesArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "deposit_cycles", arg0, @@ -313,8 +325,9 @@ func (a Agent) EcdsaPublicKey(arg0 EcdsaPublicKeyArgs) (*EcdsaPublicKeyResult, e } // EcdsaPublicKeyCall creates an indirect representation of the "ecdsa_public_key" method on the "ic" canister. -func (a Agent) EcdsaPublicKeyCall(arg0 EcdsaPublicKeyArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) EcdsaPublicKeyCall(arg0 EcdsaPublicKeyArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "ecdsa_public_key", arg0, @@ -336,8 +349,9 @@ func (a Agent) FetchCanisterLogs(arg0 FetchCanisterLogsArgs) (*FetchCanisterLogs } // FetchCanisterLogsQuery creates an indirect representation of the "fetch_canister_logs" method on the "ic" canister. -func (a Agent) FetchCanisterLogsQuery(arg0 FetchCanisterLogsArgs) (*agent.Query, error) { - return a.Agent.CreateQuery( +func (a Agent) FetchCanisterLogsQuery(arg0 FetchCanisterLogsArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeQuery, a.CanisterId, "fetch_canister_logs", arg0, @@ -359,8 +373,9 @@ func (a Agent) HttpRequest(arg0 HttpRequestArgs) (*HttpRequestResult, error) { } // HttpRequestCall creates an indirect representation of the "http_request" method on the "ic" canister. -func (a Agent) HttpRequestCall(arg0 HttpRequestArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) HttpRequestCall(arg0 HttpRequestArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "http_request", arg0, @@ -381,8 +396,9 @@ func (a Agent) InstallChunkedCode(arg0 InstallChunkedCodeArgs) error { } // InstallChunkedCodeCall creates an indirect representation of the "install_chunked_code" method on the "ic" canister. -func (a Agent) InstallChunkedCodeCall(arg0 InstallChunkedCodeArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) InstallChunkedCodeCall(arg0 InstallChunkedCodeArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "install_chunked_code", arg0, @@ -403,8 +419,9 @@ func (a Agent) InstallCode(arg0 InstallCodeArgs) error { } // InstallCodeCall creates an indirect representation of the "install_code" method on the "ic" canister. -func (a Agent) InstallCodeCall(arg0 InstallCodeArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) InstallCodeCall(arg0 InstallCodeArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "install_code", arg0, @@ -426,8 +443,9 @@ func (a Agent) NodeMetricsHistory(arg0 NodeMetricsHistoryArgs) (*NodeMetricsHist } // NodeMetricsHistoryCall creates an indirect representation of the "node_metrics_history" method on the "ic" canister. -func (a Agent) NodeMetricsHistoryCall(arg0 NodeMetricsHistoryArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) NodeMetricsHistoryCall(arg0 NodeMetricsHistoryArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "node_metrics_history", arg0, @@ -449,8 +467,9 @@ func (a Agent) ProvisionalCreateCanisterWithCycles(arg0 ProvisionalCreateCaniste } // ProvisionalCreateCanisterWithCyclesCall creates an indirect representation of the "provisional_create_canister_with_cycles" method on the "ic" canister. -func (a Agent) ProvisionalCreateCanisterWithCyclesCall(arg0 ProvisionalCreateCanisterWithCyclesArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) ProvisionalCreateCanisterWithCyclesCall(arg0 ProvisionalCreateCanisterWithCyclesArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "provisional_create_canister_with_cycles", arg0, @@ -471,8 +490,9 @@ func (a Agent) ProvisionalTopUpCanister(arg0 ProvisionalTopUpCanisterArgs) error } // ProvisionalTopUpCanisterCall creates an indirect representation of the "provisional_top_up_canister" method on the "ic" canister. -func (a Agent) ProvisionalTopUpCanisterCall(arg0 ProvisionalTopUpCanisterArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) ProvisionalTopUpCanisterCall(arg0 ProvisionalTopUpCanisterArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "provisional_top_up_canister", arg0, @@ -494,8 +514,9 @@ func (a Agent) RawRand() (*RawRandResult, error) { } // RawRandCall creates an indirect representation of the "raw_rand" method on the "ic" canister. -func (a Agent) RawRandCall() (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) RawRandCall() (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "raw_rand", ) @@ -516,8 +537,9 @@ func (a Agent) SignWithEcdsa(arg0 SignWithEcdsaArgs) (*SignWithEcdsaResult, erro } // SignWithEcdsaCall creates an indirect representation of the "sign_with_ecdsa" method on the "ic" canister. -func (a Agent) SignWithEcdsaCall(arg0 SignWithEcdsaArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) SignWithEcdsaCall(arg0 SignWithEcdsaArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "sign_with_ecdsa", arg0, @@ -538,8 +560,9 @@ func (a Agent) StartCanister(arg0 StartCanisterArgs) error { } // StartCanisterCall creates an indirect representation of the "start_canister" method on the "ic" canister. -func (a Agent) StartCanisterCall(arg0 StartCanisterArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) StartCanisterCall(arg0 StartCanisterArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "start_canister", arg0, @@ -560,8 +583,9 @@ func (a Agent) StopCanister(arg0 StopCanisterArgs) error { } // StopCanisterCall creates an indirect representation of the "stop_canister" method on the "ic" canister. -func (a Agent) StopCanisterCall(arg0 StopCanisterArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) StopCanisterCall(arg0 StopCanisterArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "stop_canister", arg0, @@ -583,8 +607,9 @@ func (a Agent) StoredChunks(arg0 StoredChunksArgs) (*StoredChunksResult, error) } // StoredChunksCall creates an indirect representation of the "stored_chunks" method on the "ic" canister. -func (a Agent) StoredChunksCall(arg0 StoredChunksArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) StoredChunksCall(arg0 StoredChunksArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "stored_chunks", arg0, @@ -605,8 +630,9 @@ func (a Agent) UninstallCode(arg0 UninstallCodeArgs) error { } // UninstallCodeCall creates an indirect representation of the "uninstall_code" method on the "ic" canister. -func (a Agent) UninstallCodeCall(arg0 UninstallCodeArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) UninstallCodeCall(arg0 UninstallCodeArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "uninstall_code", arg0, @@ -627,8 +653,9 @@ func (a Agent) UpdateSettings(arg0 UpdateSettingsArgs) error { } // UpdateSettingsCall creates an indirect representation of the "update_settings" method on the "ic" canister. -func (a Agent) UpdateSettingsCall(arg0 UpdateSettingsArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) UpdateSettingsCall(arg0 UpdateSettingsArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "update_settings", arg0, @@ -650,8 +677,9 @@ func (a Agent) UploadChunk(arg0 UploadChunkArgs) (*UploadChunkResult, error) { } // UploadChunkCall creates an indirect representation of the "upload_chunk" method on the "ic" canister. -func (a Agent) UploadChunkCall(arg0 UploadChunkArgs) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) UploadChunkCall(arg0 UploadChunkArgs) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "upload_chunk", arg0, @@ -765,6 +793,7 @@ type CanisterSettings struct { FreezingThreshold *idl.Nat `ic:"freezing_threshold,omitempty" json:"freezing_threshold,omitempty"` ReservedCyclesLimit *idl.Nat `ic:"reserved_cycles_limit,omitempty" json:"reserved_cycles_limit,omitempty"` LogVisibility *LogVisibility `ic:"log_visibility,omitempty" json:"log_visibility,omitempty"` + WasmMemoryLimit *idl.Nat `ic:"wasm_memory_limit,omitempty" json:"wasm_memory_limit,omitempty"` } type CanisterStatusArgs struct { @@ -850,6 +879,7 @@ type DefiniteCanisterSettings struct { FreezingThreshold idl.Nat `ic:"freezing_threshold" json:"freezing_threshold"` ReservedCyclesLimit idl.Nat `ic:"reserved_cycles_limit" json:"reserved_cycles_limit"` LogVisibility LogVisibility `ic:"log_visibility" json:"log_visibility"` + WasmMemoryLimit idl.Nat `ic:"wasm_memory_limit" json:"wasm_memory_limit"` } type DeleteCanisterArgs struct { diff --git a/ic/registry/agent.go b/ic/registry/agent.go index 8319f60..7592519 100755 --- a/ic/registry/agent.go +++ b/ic/registry/agent.go @@ -219,19 +219,6 @@ func (a Agent) CreateSubnet(arg0 CreateSubnetPayload) error { return nil } -// DeleteSubnet calls the "delete_subnet" method on the "registry" canister. -func (a Agent) DeleteSubnet(arg0 DeleteSubnetPayload) error { - if err := a.Agent.Call( - a.CanisterId, - "delete_subnet", - []any{arg0}, - []any{}, - ); err != nil { - return err - } - return nil -} - // DeployGuestosToAllSubnetNodes calls the "deploy_guestos_to_all_subnet_nodes" method on the "registry" canister. func (a Agent) DeployGuestosToAllSubnetNodes(arg0 DeployGuestosToAllSubnetNodesPayload) error { if err := a.Agent.Call( diff --git a/ic/sns/ledger/agent.go b/ic/sns/ledger/agent.go index 9f0704a..ae5e401 100755 --- a/ic/sns/ledger/agent.go +++ b/ic/sns/ledger/agent.go @@ -87,6 +87,26 @@ func (a Agent) GetTransactions(arg0 GetTransactionsRequest) (*GetTransactionsRes return &r0, nil } +// Icrc10SupportedStandards calls the "icrc10_supported_standards" method on the "ledger" canister. +func (a Agent) Icrc10SupportedStandards() (*[]struct { + Name string `ic:"name" json:"name"` + Url string `ic:"url" json:"url"` +}, error) { + var r0 []struct { + Name string `ic:"name" json:"name"` + Url string `ic:"url" json:"url"` + } + if err := a.Agent.Query( + a.CanisterId, + "icrc10_supported_standards", + []any{}, + []any{&r0}, + ); err != nil { + return nil, err + } + return &r0, nil +} + // Icrc1BalanceOf calls the "icrc1_balance_of" method on the "ledger" canister. func (a Agent) Icrc1BalanceOf(arg0 Account) (*Tokens, error) { var r0 Tokens @@ -233,6 +253,20 @@ func (a Agent) Icrc1Transfer(arg0 TransferArg) (*TransferResult, error) { return &r0, nil } +// Icrc21CanisterCallConsentMessage calls the "icrc21_canister_call_consent_message" method on the "ledger" canister. +func (a Agent) Icrc21CanisterCallConsentMessage(arg0 Icrc21ConsentMessageRequest) (*Icrc21ConsentMessageResponse, error) { + var r0 Icrc21ConsentMessageResponse + if err := a.Agent.Call( + a.CanisterId, + "icrc21_canister_call_consent_message", + []any{arg0}, + []any{&r0}, + ); err != nil { + return nil, err + } + return &r0, nil +} + // Icrc2Allowance calls the "icrc2_allowance" method on the "ledger" canister. func (a Agent) Icrc2Allowance(arg0 AllowanceArgs) (*Allowance, error) { var r0 Allowance @@ -542,6 +576,60 @@ type ICRC3Value struct { } `ic:"Map,variant"` } +type Icrc21ConsentInfo struct { + ConsentMessage Icrc21ConsentMessage `ic:"consent_message" json:"consent_message"` + Metadata Icrc21ConsentMessageMetadata `ic:"metadata" json:"metadata"` +} + +type Icrc21ConsentMessage struct { + GenericDisplayMessage *string `ic:"GenericDisplayMessage,variant"` + LineDisplayMessage *struct { + Pages []struct { + Lines []string `ic:"lines" json:"lines"` + } `ic:"pages" json:"pages"` + } `ic:"LineDisplayMessage,variant"` +} + +type Icrc21ConsentMessageMetadata struct { + Language string `ic:"language" json:"language"` +} + +type Icrc21ConsentMessageRequest struct { + Method string `ic:"method" json:"method"` + Arg []byte `ic:"arg" json:"arg"` + UserPreferences Icrc21ConsentMessageSpec `ic:"user_preferences" json:"user_preferences"` +} + +type Icrc21ConsentMessageResponse struct { + Ok *Icrc21ConsentInfo `ic:"Ok,variant"` + Err *Icrc21Error `ic:"Err,variant"` +} + +type Icrc21ConsentMessageSpec struct { + Metadata Icrc21ConsentMessageMetadata `ic:"metadata" json:"metadata"` + DeviceSpec *struct { + GenericDisplay *idl.Null `ic:"GenericDisplay,variant"` + LineDisplay *struct { + CharactersPerLine uint16 `ic:"characters_per_line" json:"characters_per_line"` + LinesPerPage uint16 `ic:"lines_per_page" json:"lines_per_page"` + } `ic:"LineDisplay,variant"` + } `ic:"device_spec,omitempty" json:"device_spec,omitempty"` +} + +type Icrc21Error struct { + UnsupportedCanisterCall *Icrc21ErrorInfo `ic:"UnsupportedCanisterCall,variant"` + ConsentMessageUnavailable *Icrc21ErrorInfo `ic:"ConsentMessageUnavailable,variant"` + InsufficientPayment *Icrc21ErrorInfo `ic:"InsufficientPayment,variant"` + GenericError *struct { + ErrorCode idl.Nat `ic:"error_code" json:"error_code"` + Description string `ic:"description" json:"description"` + } `ic:"GenericError,variant"` +} + +type Icrc21ErrorInfo struct { + Description string `ic:"description" json:"description"` +} + type InitArgs struct { MintingAccount Account `ic:"minting_account" json:"minting_account"` FeeCollectorAccount *Account `ic:"fee_collector_account,omitempty" json:"fee_collector_account,omitempty"` diff --git a/ic/sns/swap/agent.go b/ic/sns/swap/agent.go index 1501fad..17708d5 100755 --- a/ic/sns/swap/agent.go +++ b/ic/sns/swap/agent.go @@ -305,21 +305,6 @@ func (a Agent) RefreshBuyerTokens(arg0 RefreshBuyerTokensRequest) (*RefreshBuyer return &r0, nil } -// RestoreDappControllers calls the "restore_dapp_controllers" method on the "swap" canister. -func (a Agent) RestoreDappControllers(arg0 struct { -}) (*SetDappControllersCallResult, error) { - var r0 SetDappControllersCallResult - if err := a.Agent.Call( - a.CanisterId, - "restore_dapp_controllers", - []any{arg0}, - []any{&r0}, - ); err != nil { - return nil, err - } - return &r0, nil -} - type BuyerState struct { Icp *TransferableAmount `ic:"icp,omitempty" json:"icp,omitempty"` HasCreatedNeuronRecipes *bool `ic:"has_created_neuron_recipes,omitempty" json:"has_created_neuron_recipes,omitempty"` diff --git a/ic/sns/testdata/gen.go b/ic/sns/testdata/gen.go index 42230b1..df863a0 100644 --- a/ic/sns/testdata/gen.go +++ b/ic/sns/testdata/gen.go @@ -16,6 +16,9 @@ import ( var ( //go:embed did dids embed.FS + + ICVersion = "release-2024-06-05_23-01-base" + SDKVersion = "0.20.1" ) func checkLatest() error { @@ -25,27 +28,27 @@ func checkLatest() error { }{ { filepath: "ic/sns/testdata/did/sns.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/nns/sns-wasm/canister/sns-wasm.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/nns/sns-wasm/canister/sns-wasm.did", ICVersion), }, { filepath: "ic/sns/testdata/did/governance.did", - remote: "https://raw.githubusercontent.com/dfinity/sdk/master/src/distributed/assetstorage.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/sdk/%s/src/distributed/assetstorage.did", SDKVersion), }, { filepath: "ic/sns/testdata/did/root.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/sns/root/canister/root.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/sns/root/canister/root.did", ICVersion), }, { filepath: "ic/sns/testdata/did/swap.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/sns/swap/canister/swap.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/sns/swap/canister/swap.did", ICVersion), }, { filepath: "ic/sns/testdata/did/ledger.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/rosetta-api/icrc1/ledger/ledger.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/rosetta-api/icrc1/ledger/ledger.did", ICVersion), }, { filepath: "ic/sns/testdata/did/index.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/rosetta-api/icrc1/index/index.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/rosetta-api/icrc1/index/index.did", ICVersion), }, } { raw, err := http.Get(f.remote) diff --git a/ic/testdata/did/ic.did b/ic/testdata/did/ic.did index 3b634a6..6085b24 100644 --- a/ic/testdata/did/ic.did +++ b/ic/testdata/did/ic.did @@ -1,18 +1,12 @@ type canister_id = principal; type wasm_module = blob; -type log_visibility = variant { - controllers; - public; -}; - type canister_settings = record { controllers : opt vec principal; compute_allocation : opt nat; memory_allocation : opt nat; freezing_threshold : opt nat; reserved_cycles_limit : opt nat; - log_visibility : opt log_visibility; }; type definite_canister_settings = record { @@ -21,7 +15,6 @@ type definite_canister_settings = record { memory_allocation : nat; freezing_threshold : nat; reserved_cycles_limit : nat; - log_visibility : log_visibility; }; type change_origin = variant { @@ -55,9 +48,7 @@ type change = record { details : change_details; }; -type chunk_hash = record { - hash : blob; -}; +type chunk_hash = blob; type http_header = record { name : text; @@ -153,7 +144,7 @@ type millisatoshi_per_byte = nat64; type node_metrics = record { node_id : principal; - num_blocks_proposed_total : nat64; + num_blocks_total : nat64; num_block_failures_total : nat64; }; @@ -185,20 +176,14 @@ type stored_chunks_args = record { canister_id : canister_id; }; -type canister_install_mode = variant { - install; - reinstall; - upgrade : opt record { - skip_pre_upgrade : opt bool; - wasm_memory_persistence : opt variant { - keep; - replace; +type install_code_args = record { + mode : variant { + install; + reinstall; + upgrade : opt record { + skip_pre_upgrade : opt bool; }; }; -}; - -type install_code_args = record { - mode : canister_install_mode; canister_id : canister_id; wasm_module : wasm_module; arg : blob; @@ -206,9 +191,15 @@ type install_code_args = record { }; type install_chunked_code_args = record { - mode : canister_install_mode; + mode : variant { + install; + reinstall; + upgrade : opt record { + skip_pre_upgrade : opt bool; + }; + }; target_canister : canister_id; - store_canister : opt canister_id; + storage_canister : opt canister_id; chunk_hashes_list : vec chunk_hash; wasm_module_hash : blob; arg : blob; @@ -240,12 +231,6 @@ type canister_status_result = record { cycles : nat; reserved_cycles : nat; idle_cycles_burned_per_day : nat; - query_stats: record { - num_calls_total: nat; - num_instructions_total: nat; - request_payload_bytes_total: nat; - response_payload_bytes_total: nat; - }; }; type canister_info_args = record { @@ -339,20 +324,6 @@ type bitcoin_get_balance_query_result = satoshi; type bitcoin_get_current_fee_percentiles_result = vec millisatoshi_per_byte; -type fetch_canister_logs_args = record { - canister_id : canister_id; -}; - -type canister_log_record = record { - idx: nat64; - timestamp_nanos: nat64; - content: blob; -}; - -type fetch_canister_logs_result = record { - canister_log_records: vec canister_log_record; -}; - service ic : { create_canister : (create_canister_args) -> (create_canister_result); update_settings : (update_settings_args) -> (); @@ -389,7 +360,4 @@ service ic : { // provisional interfaces for the pre-ledger world provisional_create_canister_with_cycles : (provisional_create_canister_with_cycles_args) -> (provisional_create_canister_with_cycles_result); provisional_top_up_canister : (provisional_top_up_canister_args) -> (); - - // canister logging - fetch_canister_logs : (fetch_canister_logs_args) -> (fetch_canister_logs_result) query; }; diff --git a/ic/testdata/gen.go b/ic/testdata/gen.go index fa91f3b..19b6aee 100644 --- a/ic/testdata/gen.go +++ b/ic/testdata/gen.go @@ -16,6 +16,10 @@ import ( var ( //go:embed did dids embed.FS + + ICVersion = "release-2024-06-05_23-01-base" + InterfaceSpecVersion = "0.23.0" + SDKVersion = "0.20.1" ) func checkLatest() error { @@ -25,31 +29,31 @@ func checkLatest() error { }{ { filepath: "ic/testdata/did/assetstorage.did", - remote: "https://raw.githubusercontent.com/dfinity/sdk/master/src/distributed/assetstorage.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/sdk/%s/src/distributed/assetstorage.did", SDKVersion), }, { filepath: "ic/testdata/did/cmc.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/nns/cmc/cmc.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/nns/cmc/cmc.did", ICVersion), }, { filepath: "ic/testdata/did/ic.did", - remote: "https://raw.githubusercontent.com/dfinity/interface-spec/master/spec/_attachments/ic.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/interface-spec/%s/spec/_attachments/ic.did", InterfaceSpecVersion), }, { filepath: "ic/testdata/did/registry.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/registry/canister/canister/registry.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/registry/canister/canister/registry.did", ICVersion), }, { filepath: "ic/testdata/did/governance.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/nns/governance/canister/governance.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/nns/governance/canister/governance.did", ICVersion), }, { filepath: "ic/testdata/did/icparchive.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/rosetta-api/icp_ledger/ledger_archive.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/rosetta-api/icp_ledger/ledger_archive.did", ICVersion), }, { filepath: "ic/testdata/did/icpledger.did", - remote: "https://raw.githubusercontent.com/dfinity/ic/master/rs/rosetta-api/icp_ledger/ledger.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/ic/%s/rs/rosetta-api/icp_ledger/ledger.did", ICVersion), }, { filepath: "ic/testdata/did/icrc1.did", @@ -57,7 +61,7 @@ func checkLatest() error { }, { filepath: "ic/testdata/did/wallet.did", - remote: "https://raw.githubusercontent.com/dfinity/sdk/master/src/distributed/wallet.did", + remote: fmt.Sprintf("https://raw.githubusercontent.com/dfinity/sdk/%s/src/distributed/wallet.did", SDKVersion), }, } { raw, err := http.Get(f.remote) diff --git a/pocketic/agent_test.go b/pocketic/agent_test.go index bfcb1f1..e517e34 100755 --- a/pocketic/agent_test.go +++ b/pocketic/agent_test.go @@ -41,8 +41,9 @@ func (a Agent) HelloQuery(arg0 string) (*string, error) { } // HelloQueryQuery creates an indirect representation of the "helloQuery" method on the "hello" canister. -func (a Agent) HelloQueryQuery(arg0 string) (*agent.Query, error) { - return a.Agent.CreateQuery( +func (a Agent) HelloQueryQuery(arg0 string) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeQuery, a.CanisterId, "helloQuery", arg0, @@ -64,8 +65,9 @@ func (a Agent) HelloUpdate(arg0 string) (*string, error) { } // HelloUpdateCall creates an indirect representation of the "helloUpdate" method on the "hello" canister. -func (a Agent) HelloUpdateCall(arg0 string) (*agent.Call, error) { - return a.Agent.CreateCall( +func (a Agent) HelloUpdateCall(arg0 string) (*agent.CandidAPIRequest, error) { + return a.Agent.CreateCandidAPIRequest( + agent.RequestTypeCall, a.CanisterId, "helloUpdate", arg0, diff --git a/pocketic/endpoints_test.go b/pocketic/endpoints_test.go index 7e748a4..c336301 100644 --- a/pocketic/endpoints_test.go +++ b/pocketic/endpoints_test.go @@ -16,7 +16,7 @@ func TestEndpoints(t *testing.T) { pocketic.WithApplicationSubnet(), ) if err != nil { - t.Skipf("skipping test: %v", err) + t.Skip(err) } t.Run("status", func(t *testing.T) { diff --git a/pocketic/pocketic_test.go b/pocketic/pocketic_test.go index 7758a19..3bba2b2 100644 --- a/pocketic/pocketic_test.go +++ b/pocketic/pocketic_test.go @@ -21,7 +21,7 @@ import ( func TestConcurrentCalls(t *testing.T) { pic, err := pocketic.New(pocketic.WithPollingDelay(10*time.Millisecond, 10*time.Second)) if err != nil { - t.Skipf("skipping test: %v", err) + t.Skip(err) } var wg sync.WaitGroup for i := 0; i < 10; i++ { @@ -47,7 +47,7 @@ func TestConcurrentCalls(t *testing.T) { func TestCreateCanister(t *testing.T) { pic, err := pocketic.New(pocketic.WithLogger(new(testLogger))) if err != nil { - t.Skipf("skipping test: %v", err) + t.Skip(err) } canisterID, err := pic.CreateCanister() @@ -66,7 +66,7 @@ func TestHttpGateway(t *testing.T) { pocketic.WithApplicationSubnet(), ) if err != nil { - t.Skipf("skipping test: %v", err) + t.Skip(err) } endpoint, err := pic.MakeLive(nil) @@ -101,7 +101,7 @@ func TestHttpGateway(t *testing.T) { if err != nil { t.Fatal(err) } - if err := createCall.WithEffectiveCanisterID(ecID).CallAndWait(&result); err != nil { + if err := createCall.WithEffectiveCanisterID(ecID).CallAndWait([]any{&result}); err != nil { t.Fatal(err) } diff --git a/query.go b/query.go index c61c5cf..1be94b6 100644 --- a/query.go +++ b/query.go @@ -1,113 +1,25 @@ package agent import ( + "context" "crypto/ed25519" "fmt" - "github.com/aviate-labs/agent-go/candid/idl" + "math/big" + "github.com/aviate-labs/agent-go/certification" "github.com/aviate-labs/agent-go/certification/hashtree" "github.com/aviate-labs/agent-go/principal" "github.com/aviate-labs/leb128" "github.com/fxamacker/cbor/v2" "google.golang.org/protobuf/proto" - "math/big" ) -// CreateQuery creates a new Query to the given canister and method. -func (a *Agent) CreateQuery(canisterID principal.Principal, methodName string, args ...any) (*Query, error) { - rawArgs, err := idl.Marshal(args) - if err != nil { - return nil, err - } - if len(args) == 0 { - // Default to the empty Candid argument list. - rawArgs = []byte{'D', 'I', 'D', 'L', 0, 0} - } - nonce, err := newNonce() - if err != nil { - return nil, err - } - requestID, data, err := a.sign(Request{ - Type: RequestTypeQuery, - Sender: a.Sender(), - CanisterID: canisterID, - MethodName: methodName, - Arguments: rawArgs, - IngressExpiry: a.expiryDate(), - Nonce: nonce, - }) - if err != nil { - return nil, err - } - return &Query{ - a: a, - methodName: methodName, - effectiveCanisterID: effectiveCanisterID(canisterID, args), - requestID: *requestID, - data: data, - }, nil -} - // Query calls a method on a canister and unmarshals the result into the given values. -func (a Agent) Query(canisterID principal.Principal, methodName string, args, values []any) error { - query, err := a.CreateQuery(canisterID, methodName, args...) - if err != nil { - return err - } - return query.Query(values...) -} - -// QueryProto calls a method on a canister and unmarshals the result into the given proto message. -func (a Agent) QueryProto(canisterID principal.Principal, methodName string, in, out proto.Message) error { - payload, err := proto.Marshal(in) - if err != nil { - return err - } - if len(payload) == 0 { - payload = []byte{} - } - _, data, err := a.sign(Request{ - Type: RequestTypeQuery, - Sender: a.Sender(), - IngressExpiry: a.expiryDate(), - CanisterID: canisterID, - MethodName: methodName, - Arguments: payload, - }) - if err != nil { - return err - } - resp, err := a.client.Query(canisterID, data) - if err != nil { - return err - } - var response Response - if err := cbor.Unmarshal(resp, &response); err != nil { - return err - } - if response.Status != "replied" { - return fmt.Errorf("status: %s", response.Status) - } - var reply map[string][]byte - if err := cbor.Unmarshal(response.Reply, &reply); err != nil { - return err - } - return proto.Unmarshal(reply["arg"], out) -} - -// Query is an intermediate representation of a Query to a canister. -type Query struct { - a *Agent - methodName string - effectiveCanisterID principal.Principal - requestID RequestID - data []byte -} - -// Query calls a method on a canister and unmarshals the result into the given values. -func (q Query) Query(values ...any) error { +func (q APIRequest[In, Out]) Query(out Out, skipVerification bool) error { q.a.logger.Printf("[AGENT] QUERY %s %s", q.effectiveCanisterID, q.methodName) - rawResp, err := q.a.client.Query(q.effectiveCanisterID, q.data) + ctx, cancel := context.WithTimeout(q.a.ctx, q.a.ingressExpiry) + defer cancel() + rawResp, err := q.a.client.Query(ctx, q.effectiveCanisterID, q.data) if err != nil { return err } @@ -117,7 +29,7 @@ func (q Query) Query(values ...any) error { } // Verify query signatures. - if q.a.verifySignatures { + if !skipVerification && q.a.verifySignatures { if len(resp.Signatures) == 0 { return fmt.Errorf("no signatures") } @@ -166,7 +78,7 @@ func (q Query) Query(values ...any) error { append([]byte("\x0Bic-response"), sig[:]...), signature.Signature, ) { - return fmt.Errorf("invalid signature") + return fmt.Errorf("invalid replied signature") } case "rejected": code, err := leb128.EncodeUnsigned(big.NewInt(int64(resp.RejectCode))) @@ -191,7 +103,7 @@ func (q Query) Query(values ...any) error { append([]byte("\x0Bic-response"), sig[:]...), signature.Signature, ) { - return fmt.Errorf("invalid signature") + return fmt.Errorf("invalid rejected signature") } default: panic("unreachable") @@ -200,14 +112,34 @@ func (q Query) Query(values ...any) error { } switch resp.Status { case "replied": - var reply map[string][]byte + var reply struct { + Arg []byte `ic:"arg"` + } if err := cbor.Unmarshal(resp.Reply, &reply); err != nil { return err } - return idl.Unmarshal(reply["arg"], values) + return q.unmarshal(reply.Arg, out) case "rejected": return fmt.Errorf("(%d) %s: %s", resp.RejectCode, resp.ErrorCode, resp.RejectMsg) default: panic("unreachable") } } + +// Query calls a method on a canister and unmarshals the result into the given values. +func (a Agent) Query(canisterID principal.Principal, methodName string, in, out []any) error { + query, err := a.CreateCandidAPIRequest(RequestTypeQuery, canisterID, methodName, in...) + if err != nil { + return err + } + return query.Query(out, false) +} + +// QueryProto calls a method on a canister and unmarshals the result into the given proto message. +func (a Agent) QueryProto(canisterID principal.Principal, methodName string, in, out proto.Message) error { + query, err := a.CreateProtoAPIRequest(RequestTypeQuery, canisterID, methodName, in) + if err != nil { + return err + } + return query.Query(out, true) +}