From d503989816fda2ff5d26eed83b466f4c3a7fe41b Mon Sep 17 00:00:00 2001 From: marino39 <722509+marino39@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:26:24 +0000 Subject: [PATCH 1/3] [AUTOMATED] Update: proto/clients/indexer*.gen.go --- services/indexer/indexer.gen.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/indexer/indexer.gen.go b/services/indexer/indexer.gen.go index 23e345b9..98a144d8 100644 --- a/services/indexer/indexer.gen.go +++ b/services/indexer/indexer.gen.go @@ -1,4 +1,4 @@ -// sequence-indexer v0.4.0 12ecb31178000c1165150b0ac0f3a304ccc5a88d +// sequence-indexer v0.4.0 d8832227c2ceb8924c810a6f6c2ebcfeb928cbdd // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -33,7 +33,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "12ecb31178000c1165150b0ac0f3a304ccc5a88d" + return "d8832227c2ceb8924c810a6f6c2ebcfeb928cbdd" } // @@ -985,6 +985,7 @@ type TokenBalancesByContractFilter struct { ContractAddresses []prototyp.Hash `json:"contractAddresses"` AccountAddresses []prototyp.Hash `json:"accountAddresses"` ContractStatus ContractVerificationStatus `json:"contractStatus"` + TokenIDs []prototyp.BigInt `json:"tokenIDs"` } type TokenBalancesFilter struct { @@ -995,6 +996,7 @@ type TokenBalancesFilter struct { ContractBlacklist []prototyp.Hash `json:"contractBlacklist"` OmitNativeBalances bool `json:"omitNativeBalances,omitempty"` OmitPrices bool `json:"omitPrices,omitempty"` + TokenIDs []prototyp.BigInt `json:"tokenIDs"` } // Token History From f220e7b3751f9808ba71ac866e3e88fa6bf6a953 Mon Sep 17 00:00:00 2001 From: marino39 <722509+marino39@users.noreply.github.com> Date: Tue, 3 Mar 2026 14:21:28 +0000 Subject: [PATCH 2/3] [AUTOMATED] Update: proto/clients/indexer*.gen.go --- services/indexer/indexer.gen.go | 84 ++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/services/indexer/indexer.gen.go b/services/indexer/indexer.gen.go index 98a144d8..e3fd1289 100644 --- a/services/indexer/indexer.gen.go +++ b/services/indexer/indexer.gen.go @@ -1,4 +1,4 @@ -// sequence-indexer v0.4.0 d8832227c2ceb8924c810a6f6c2ebcfeb928cbdd +// sequence-indexer v0.4.0 84ae41d7d7bbf2414cf42c51b157fb42464a9384 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -33,13 +33,18 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "d8832227c2ceb8924c810a6f6c2ebcfeb928cbdd" + return "84ae41d7d7bbf2414cf42c51b157fb42464a9384" } // // Client interface // +type AdminClient interface { + // Backup – starts bond DB backup in background. Only one backup at a time. Default mode incremental. + Backup(ctx context.Context, mode *BackupMode) error +} + type IndexerClient interface { AddWebhookListener(ctx context.Context, url string, filters *EventFilter, projectId *uint64) (bool, *WebhookListener, error) // Fetches a single receipt and then will stop the subscription @@ -278,6 +283,48 @@ type Asset struct { UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` } +type BackupMode uint8 + +const ( + BackupMode_INCREMENTAL BackupMode = 0 + BackupMode_COMPLETE BackupMode = 1 +) + +var BackupMode_name = map[uint8]string{ + 0: "INCREMENTAL", + 1: "COMPLETE", +} + +var BackupMode_value = map[string]uint8{ + "INCREMENTAL": 0, + "COMPLETE": 1, +} + +func (x BackupMode) String() string { + return BackupMode_name[uint8(x)] +} + +func (x BackupMode) MarshalText() ([]byte, error) { + return []byte(BackupMode_name[uint8(x)]), nil +} + +func (x *BackupMode) UnmarshalText(b []byte) error { + *x = BackupMode(BackupMode_value[string(b)]) + return nil +} + +func (x *BackupMode) Is(values ...BackupMode) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type BloomStats struct { HitRatio string `json:"hitRatio"` FalsePositivesPercent string `json:"falsePositivesPercent"` @@ -1303,9 +1350,42 @@ type WebhookListener struct { // Client // +const AdminPathPrefix = "/rpc/Admin/" const IndexerPathPrefix = "/rpc/Indexer/" const IndexerGatewayPathPrefix = "/rpc/IndexerGateway/" +type adminClient struct { + client HTTPClient + urls [1]string +} + +func NewAdminClient(addr string, client HTTPClient) AdminClient { + prefix := urlBase(addr) + AdminPathPrefix + urls := [1]string{ + prefix + "Backup", + } + return &adminClient{ + client: client, + urls: urls, + } +} + +func (c *adminClient) Backup(ctx context.Context, mode *BackupMode) error { + in := struct { + Arg0 *BackupMode `json:"mode"` + }{mode} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[0], in, nil) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return err +} + type indexerClient struct { client HTTPClient urls [36]string From d988f1c3950f9fbcb2a92955cf284cf9b0554293 Mon Sep 17 00:00:00 2001 From: marino39 <722509+marino39@users.noreply.github.com> Date: Wed, 10 Jun 2026 10:18:10 +0000 Subject: [PATCH 3/3] [AUTOMATED] Update: proto/clients/indexer*.gen.go --- services/indexer/indexer.gen.go | 119 +++++++++++++++++++++++++++----- 1 file changed, 102 insertions(+), 17 deletions(-) diff --git a/services/indexer/indexer.gen.go b/services/indexer/indexer.gen.go index e3fd1289..d9280317 100644 --- a/services/indexer/indexer.gen.go +++ b/services/indexer/indexer.gen.go @@ -1,4 +1,4 @@ -// sequence-indexer v0.4.0 84ae41d7d7bbf2414cf42c51b157fb42464a9384 +// sequence-indexer v0.4.0 4d157093ab69a43b01dc0721f28095acc32d3bd5 // -- // Code generated by webrpc-gen@v0.31.2 with golang generator. DO NOT EDIT. // @@ -33,7 +33,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "84ae41d7d7bbf2414cf42c51b157fb42464a9384" + return "4d157093ab69a43b01dc0721f28095acc32d3bd5" } // @@ -41,8 +41,10 @@ func WebRPCSchemaHash() string { // type AdminClient interface { - // Backup – starts bond DB backup in background. Only one backup at a time. Default mode incremental. - Backup(ctx context.Context, mode *BackupMode) error + // GetBackupProgress – returns the progress of a backup identified by backupId. + GetBackupProgress(ctx context.Context, backupId string) (*BackupProgress, error) + // StartBackup – starts bond DB backup in background. Only one backup at a time. Default mode incremental. + StartBackup(ctx context.Context, mode *BackupMode) (string, error) } type IndexerClient interface { @@ -325,6 +327,64 @@ func (x *BackupMode) Is(values ...BackupMode) bool { return false } +type BackupProgress struct { + ID string `json:"id"` + Status BackupStatus `json:"status"` + Mode BackupMode `json:"mode"` + StartedAt time.Time `json:"startedAt"` + CompletedAt *time.Time `json:"completedAt"` + FilesDone int `json:"filesDone"` + FilesTotal int `json:"filesTotal"` + BytesDone int64 `json:"bytesDone"` + BytesTotal int64 `json:"bytesTotal"` + Error *string `json:"error"` +} + +type BackupStatus uint8 + +const ( + BackupStatus_RUNNING BackupStatus = 0 + BackupStatus_COMPLETED BackupStatus = 1 + BackupStatus_FAILED BackupStatus = 2 +) + +var BackupStatus_name = map[uint8]string{ + 0: "RUNNING", + 1: "COMPLETED", + 2: "FAILED", +} + +var BackupStatus_value = map[string]uint8{ + "RUNNING": 0, + "COMPLETED": 1, + "FAILED": 2, +} + +func (x BackupStatus) String() string { + return BackupStatus_name[uint8(x)] +} + +func (x BackupStatus) MarshalText() ([]byte, error) { + return []byte(BackupStatus_name[uint8(x)]), nil +} + +func (x *BackupStatus) UnmarshalText(b []byte) error { + *x = BackupStatus(BackupStatus_value[string(b)]) + return nil +} + +func (x *BackupStatus) Is(values ...BackupStatus) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type BloomStats struct { HitRatio string `json:"hitRatio"` FalsePositivesPercent string `json:"falsePositivesPercent"` @@ -1337,13 +1397,15 @@ type WALWriterRuntimeStatus struct { } type WebhookListener struct { - ID uint64 `json:"id" db:"id"` - ProjectID uint64 `json:"projectID" db:"project_id"` - Url string `json:"url" db:"url"` - Filters *EventFilter `json:"filters" db:"filters"` - Name string `json:"name" db:"name"` - UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` - Active bool `json:"active" db:"active"` + ID uint64 `json:"id" db:"id"` + ProjectID uint64 `json:"projectID" db:"project_id"` + Url string `json:"url" db:"url"` + Filters *EventFilter `json:"filters" db:"filters"` + Name string `json:"name" db:"name"` + UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` + Active bool `json:"active" db:"active"` + DisabledAt *time.Time `json:"disabledAt" db:"disabled_at"` + DisabledReason *string `json:"disabledReason" db:"disabled_reason"` } // @@ -1356,13 +1418,14 @@ const IndexerGatewayPathPrefix = "/rpc/IndexerGateway/" type adminClient struct { client HTTPClient - urls [1]string + urls [2]string } func NewAdminClient(addr string, client HTTPClient) AdminClient { prefix := urlBase(addr) + AdminPathPrefix - urls := [1]string{ - prefix + "Backup", + urls := [2]string{ + prefix + "GetBackupProgress", + prefix + "StartBackup", } return &adminClient{ client: client, @@ -1370,12 +1433,34 @@ func NewAdminClient(addr string, client HTTPClient) AdminClient { } } -func (c *adminClient) Backup(ctx context.Context, mode *BackupMode) error { +func (c *adminClient) GetBackupProgress(ctx context.Context, backupId string) (*BackupProgress, error) { + in := struct { + Arg0 string `json:"backupId"` + }{backupId} + out := struct { + Ret0 *BackupProgress `json:"progress"` + }{} + + resp, err := doHTTPRequest(ctx, c.client, c.urls[0], in, &out) + if resp != nil { + cerr := resp.Body.Close() + if err == nil && cerr != nil { + err = ErrWebrpcRequestFailed.WithCausef("failed to close response body: %w", cerr) + } + } + + return out.Ret0, err +} + +func (c *adminClient) StartBackup(ctx context.Context, mode *BackupMode) (string, error) { in := struct { Arg0 *BackupMode `json:"mode"` }{mode} + out := struct { + Ret0 string `json:"backupId"` + }{} - resp, err := doHTTPRequest(ctx, c.client, c.urls[0], in, nil) + resp, err := doHTTPRequest(ctx, c.client, c.urls[1], in, &out) if resp != nil { cerr := resp.Body.Close() if err == nil && cerr != nil { @@ -1383,7 +1468,7 @@ func (c *adminClient) Backup(ctx context.Context, mode *BackupMode) error { } } - return err + return out.Ret0, err } type indexerClient struct {