orgreports

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package orgreports is the HTTP client for Bitwave organization reports. It is intentionally separate from the CLI ledger workspace client: these reports run against the organization's product data, not ledger journals.

Index

Constants

View Source
const (
	APIServiceCore    = "core"
	APIServiceApp     = "app"
	APIServiceReports = "reports"
)
View Source
const (
	TransactionStateIgnore   = "ignore"
	TransactionStateUnignore = "un-ignore"
)
View Source
const BalanceReportType = "balance-report"

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountingConnection

type AccountingConnection struct {
	ID       string `json:"id"`
	Name     string `json:"name,omitempty"`
	Type     string `json:"type"`
	Disabled bool   `json:"disabled"`
}

type ActionsExportInput

type ActionsExportInput struct {
	From           string
	To             string
	Inventory      []string
	SubsidiaryIDs  []string
	Actions        []string
	Statuses       []string
	TransactionIDs []string
	Assets         []string
	AssetIDs       []string
	LineErrors     []string
}

type BabelRollupRule

type BabelRollupRule struct {
	RuleName                   string            `json:"ruleName"`
	Classification             string            `json:"classification"`
	FingerPrint                string            `json:"fingerPrint"`
	RollupAction               string            `json:"rollupAction"`
	Cadence                    string            `json:"cadence"`
	Metadata                   map[string]string `json:"metadata,omitempty"`
	InvolvedAccounts           []string          `json:"involvedAccounts,omitempty"`
	CounterParties             []string          `json:"counterParties,omitempty"`
	CounterPartyExcludeFees    bool              `json:"counterPartyExcludeFees,omitempty"`
	StartSEC                   *int64            `json:"startSec,omitempty"`
	EndSEC                     *int64            `json:"endSec,omitempty"`
	SeparateByInvolvedAccounts bool              `json:"separateByInvolvedAccounts,omitempty"`
	SeparateByCounterParty     bool              `json:"separateByCounterParty,omitempty"`
	SeparateByTrade            string            `json:"separateByTrade,omitempty"`
	RoundPeriod                string            `json:"roundPeriod,omitempty"`
}

type BulkCategorizeResult

type BulkCategorizeResult struct {
	Success bool   `json:"success"`
	TxnID   string `json:"txnId"`
	Reason  string `json:"reason,omitempty"`
}

type BulkStateRequest

type BulkStateRequest struct {
	BulkActionID   string   `json:"bulkActionId,omitempty"`
	TransactionIDs []string `json:"transactionIds"`
	Update         string   `json:"update"`
}

type BulkStateResponse

type BulkStateResponse struct {
	WorkflowID   string               `json:"workflowId,omitempty"`
	BulkActionID string               `json:"bulkActionId,omitempty"`
	Status       string               `json:"status,omitempty"`
	Success      bool                 `json:"success"`
	Processed    int                  `json:"processed"`
	SuccessCount int                  `json:"successCount"`
	Failed       []TransactionFailure `json:"failed"`
	Transactions []struct {
		TransactionID string `json:"transactionId"`
		Status        string `json:"status"`
		Error         string `json:"error,omitempty"`
	} `json:"transactions,omitempty"`
}

type Category

type Category struct {
	ID                     string `json:"id"`
	Name                   string `json:"name"`
	Code                   string `json:"code,omitempty"`
	Enabled                bool   `json:"enabled"`
	Source                 string `json:"source,omitempty"`
	Type                   string `json:"type,omitempty"`
	AccountingConnectionID string `json:"accountingConnectionId,omitempty"`
}

type Client

type Client struct {
	BaseURL          string
	RulesQueryURL    string
	RulesMutationURL string
	TokenResolver    func() (string, error)
	HTTPClient       *http.Client
}

func New

func New(baseURL string, tokenResolver func() (string, error)) *Client

func (*Client) AccountingConnections

func (c *Client) AccountingConnections(ctx context.Context, orgID string) ([]AccountingConnection, error)

func (*Client) ActionColumnValues

func (c *Client) ActionColumnValues(ctx context.Context, orgID, inventoryViewID, column, from, to string) ([]string, error)

ActionColumnValues returns all unique values for one Actions column.

func (*Client) BulkCategorizeTransactions

func (c *Client) BulkCategorizeTransactions(ctx context.Context, orgID string, body json.RawMessage) ([]BulkCategorizeResult, error)

func (*Client) BulkTransactionStateStatus

func (c *Client) BulkTransactionStateStatus(ctx context.Context, orgID, workflowID string) (*BulkStateResponse, error)

func (*Client) BulkUpdateTransactionState

func (c *Client) BulkUpdateTransactionState(ctx context.Context, orgID string, input BulkStateRequest) (*BulkStateResponse, error)

func (*Client) CancelInventoryViewUpdate

func (c *Client) CancelInventoryViewUpdate(ctx context.Context, orgID, viewID, updateID string) (*InventoryMutationResult, error)

func (*Client) Categories

func (c *Client) Categories(ctx context.Context, orgID string) ([]Category, error)

func (*Client) CategorizeTransaction

func (c *Client) CategorizeTransaction(ctx context.Context, orgID, transactionID string, body json.RawMessage) error

CategorizeTransaction sends the complete Bitwave categorization DTO. The shape is deliberately json.RawMessage because it is a tagged union whose required fields depend on the transaction and categorization type.

func (*Client) Contacts

func (c *Client) Contacts(ctx context.Context, orgID string) ([]Contact, error)

func (*Client) CreateChartAccount

func (c *Client) CreateChartAccount(ctx context.Context, orgID string, input CreateChartAccountInput) (*CreateChartAccountResponse, error)

func (*Client) CreateContact

func (c *Client) CreateContact(ctx context.Context, orgID string, input CreateContactInput) (string, error)

func (*Client) CreateInternalTransfer

func (c *Client) CreateInternalTransfer(ctx context.Context, orgID string, input InternalTransferInput) (json.RawMessage, error)

func (*Client) CreateInventoryView

func (c *Client) CreateInventoryView(ctx context.Context, orgID string, input json.RawMessage) (*InventoryMutationResult, error)

func (*Client) CreateManualAccountingConnection

func (c *Client) CreateManualAccountingConnection(ctx context.Context, orgID string) (*CreateManualAccountingConnectionResponse, error)

func (*Client) CreateOrgWallet

func (c *Client) CreateOrgWallet(ctx context.Context, orgID string, wallet map[string]any, permissions []WalletPermission) (*OrgWallet, error)

func (*Client) CreateRule

func (c *Client) CreateRule(ctx context.Context, orgID string, rule json.RawMessage) (*RuleCreateResult, error)

func (*Client) CreateTransactions

func (c *Client) CreateTransactions(ctx context.Context, orgID string, input []CreateTransaction) (json.RawMessage, error)

func (*Client) DeleteInventoryView

func (c *Client) DeleteInventoryView(ctx context.Context, orgID, viewID string) error

func (*Client) DeleteRule

func (c *Client) DeleteRule(ctx context.Context, orgID, ruleID string) error

func (*Client) DisableCategories added in v0.3.1

func (c *Client) DisableCategories(ctx context.Context, orgID string) error

func (*Client) DisableContacts added in v0.3.1

func (c *Client) DisableContacts(ctx context.Context, orgID string) error

func (*Client) Download

func (c *Client) Download(ctx context.Context, orgID, runID string) ([]byte, error)
func (c *Client) DownloadLink(ctx context.Context, href string) ([]byte, error)

func (*Client) ExecuteBulkRules

func (c *Client) ExecuteBulkRules(ctx context.Context, orgID string, after, before int64) error

func (*Client) ExportDownloadURL

func (c *Client) ExportDownloadURL(ctx context.Context, orgID, exportID, exportType string) (string, error)

func (*Client) FindInvoiceForContact added in v0.4.0

func (c *Client) FindInvoiceForContact(ctx context.Context, orgID string, input FindInvoiceInput) (*Invoice, error)

func (*Client) FullWalletResync added in v0.3.1

func (c *Client) FullWalletResync(ctx context.Context, orgID, walletID string, execute bool) (*FullWalletResyncResponse, error)

func (*Client) InventoryViewUpdates

func (c *Client) InventoryViewUpdates(ctx context.Context, orgID, viewID string) ([]InventoryViewUpdate, error)

func (*Client) InventoryViews

func (c *Client) InventoryViews(ctx context.Context, orgID string) ([]InventoryView, error)

func (*Client) Invoice added in v0.4.0

func (c *Client) Invoice(ctx context.Context, orgID, invoiceID string) (*Invoice, error)

func (*Client) Invoices added in v0.4.0

func (c *Client) Invoices(ctx context.Context, orgID string, input InvoiceListInput) (*InvoicePage, error)

func (*Client) LegacyReport

func (c *Client) LegacyReport(ctx context.Context, orgID, runID string, includeDownloadURL bool) (*LegacyReport, error)

func (*Client) Org

func (c *Client) Org(ctx context.Context, orgID string) (*OrgDetails, error)

func (*Client) OrgWallets

func (c *Client) OrgWallets(ctx context.Context, orgID string) ([]OrgWallet, error)

func (*Client) RawEndpoint added in v0.3.1

func (c *Client) RawEndpoint(service, path string) (string, error)

RawEndpoint resolves a relative API path against a fixed Bitwave service. It is exported so the CLI can show the exact request during a dry run.

func (*Client) RawRequest added in v0.3.1

func (c *Client) RawRequest(ctx context.Context, service, method, path string, body any) ([]byte, error)

RawRequest sends an authenticated request to one of Bitwave's known API services. The path must be relative so an organization token can never be forwarded to an arbitrary host.

func (*Client) RawRequestBytes added in v0.3.1

func (c *Client) RawRequestBytes(ctx context.Context, service, method, path string, body []byte, headers http.Header) ([]byte, error)

RawRequestBytes sends an exact request body and caller-provided headers to a known Bitwave service. Authentication is still owned by the client.

func (*Client) Result

func (c *Client) Result(ctx context.Context, orgID, runID string) (*ReportData, error)

func (*Client) Rule

func (c *Client) Rule(ctx context.Context, orgID, ruleID string) (json.RawMessage, error)

func (*Client) Rules

func (c *Client) Rules(ctx context.Context, orgID string) ([]json.RawMessage, error)

func (*Client) RulesPage

func (c *Client) RulesPage(ctx context.Context, orgID string, pageLimit int, paginationToken string) (*RulesPage, error)

func (*Client) RunRules

func (c *Client) RunRules(ctx context.Context, orgID string) error

func (*Client) SearchContacts added in v0.4.0

func (c *Client) SearchContacts(ctx context.Context, orgID, query string, limit int) ([]Contact, error)

func (*Client) SearchTransactions

func (c *Client) SearchTransactions(ctx context.Context, orgID string, input TransactionSearchRequest) (*TransactionSearchResponse, error)

func (*Client) StartActionsExport

func (c *Client) StartActionsExport(ctx context.Context, orgID, inventoryViewID string, input ActionsExportInput) (*ExportResponse, error)

func (*Client) StartBalance

func (c *Client) StartBalance(ctx context.Context, orgID string, inputs []Input) (*Run, error)

func (*Client) StartLegacyBalance

func (c *Client) StartLegacyBalance(ctx context.Context, orgID string, input LegacyBalanceInput) (*LegacyRun, error)

StartLegacyBalance uses the production-stable report controller that backs the web application's default Balance Report path. The V3 report-run API is retained separately because some deployments expose start/status without yet exposing result/download.

func (*Client) Status

func (c *Client) Status(ctx context.Context, orgID, runID string) (*RunStatus, error)

func (*Client) StreamTransactionExport

func (c *Client) StreamTransactionExport(ctx context.Context, orgID string, input TransactionExportRequest, dst io.Writer) error

StreamTransactionExport writes the V3 Transaction Export CSV to dst. The request uses the same filter contract as transaction search; pagination fields are deliberately absent because the export endpoint streams all rows.

func (*Client) Subsidiaries

func (c *Client) Subsidiaries(ctx context.Context, orgID string) ([]Subsidiary, error)

func (*Client) ToggleRule

func (c *Client) ToggleRule(ctx context.Context, orgID, ruleID string, disabled bool) error

func (*Client) Transaction

func (c *Client) Transaction(ctx context.Context, orgID, transactionID string) (json.RawMessage, error)

func (*Client) TransactionAssetIDs

func (c *Client) TransactionAssetIDs(ctx context.Context, orgID string, input TransactionAssetRequest) ([]string, error)

TransactionAssetIDs returns the transaction search facet. Supplying wallet IDs or a date range makes this a dependent choice list without downloading transaction rows into the LLM context.

func (*Client) TransactionCategorizationContext added in v0.4.0

func (c *Client) TransactionCategorizationContext(ctx context.Context, orgID, transactionID string) (*TransactionCategorizationContext, error)

func (*Client) TransactionSummaryAddresses added in v0.3.1

func (c *Client) TransactionSummaryAddresses(ctx context.Context, orgID, walletID, from, to, sortField string, page, pageSize int) ([]TransactionSummaryAddressRecord, error)

func (*Client) TransactionSummaryAssets added in v0.3.1

func (c *Client) TransactionSummaryAssets(ctx context.Context, orgID string) ([]TransactionSummaryAsset, error)

func (*Client) TransactionSummaryWallets added in v0.3.1

func (c *Client) TransactionSummaryWallets(ctx context.Context, orgID, from, to string, page, pageSize int) ([]TransactionSummaryWalletRecord, error)

func (*Client) TransactionWithAccountingDetails added in v0.4.0

func (c *Client) TransactionWithAccountingDetails(ctx context.Context, orgID, transactionID string) (json.RawMessage, error)

TransactionWithAccountingDetails uses the legacy read representation because the v3 transaction endpoint intentionally omits saved accounting details.

func (*Client) TriggerInventoryViewUpdate

func (c *Client) TriggerInventoryViewUpdate(ctx context.Context, orgID, viewID string, input InventoryViewUpdateRequest) (*InventoryMutationResult, error)

func (*Client) UpdateCategoryEnabled added in v0.3.1

func (c *Client) UpdateCategoryEnabled(ctx context.Context, orgID, categoryID string, enabled bool) (json.RawMessage, error)

func (*Client) UpdateContact added in v0.3.1

func (c *Client) UpdateContact(ctx context.Context, orgID string, input json.RawMessage) (json.RawMessage, error)

func (*Client) UpdateRule

func (c *Client) UpdateRule(ctx context.Context, orgID, ruleID string, rule json.RawMessage) (*RuleCreateResult, error)

func (*Client) UpsertWalletRollup

func (c *Client) UpsertWalletRollup(ctx context.Context, orgID, walletID string, input WalletRollupRequest) error

func (*Client) ValidateRule

func (c *Client) ValidateRule(ctx context.Context, orgID, transactionID, ruleID string) (json.RawMessage, error)

func (*Client) WalletRollup

func (c *Client) WalletRollup(ctx context.Context, orgID, walletID string) (json.RawMessage, error)

func (*Client) Wallets

func (c *Client) Wallets(ctx context.Context, orgID string) ([]Wallet, error)

Wallets returns every enabled wallet, following the API's pagination token.

type ColumnUniqueValues

type ColumnUniqueValues struct {
	Values        []any  `json:"values"`
	NextPageToken string `json:"nextPageToken,omitempty"`
}

type Contact

type Contact struct {
	ID                       string           `json:"id"`
	Name                     string           `json:"name"`
	RemoteID                 string           `json:"remoteId,omitempty"`
	FirstName                string           `json:"firstName,omitempty"`
	LastName                 string           `json:"lastName,omitempty"`
	EmailAddress             string           `json:"emailAddress,omitempty"`
	Enabled                  bool             `json:"enabled"`
	Source                   string           `json:"source,omitempty"`
	Type                     string           `json:"type,omitempty"`
	AccountingConnectionID   string           `json:"accountingConnectionId,omitempty"`
	DefaultExpenseCategoryID string           `json:"defaultExpenseCategoryId,omitempty"`
	DefaultRevenueCategoryID string           `json:"defaultRevenueCategoryId,omitempty"`
	Metadata                 map[string]any   `json:"metadata,omitempty"`
	Addresses                []ContactAddress `json:"addresses,omitempty"`
}

type ContactAddress added in v0.3.1

type ContactAddress struct {
	Coin                     string `json:"coin,omitempty"`
	Address                  string `json:"address,omitempty"`
	Memo                     string `json:"memo,omitempty"`
	NetworkID                string `json:"networkId,omitempty"`
	DefaultExpenseCategoryID string `json:"defaultExpenseCategoryId,omitempty"`
	DefaultRevenueCategoryID string `json:"defaultRevenueCategoryId,omitempty"`
}

type ContactSearchResponse added in v0.4.0

type ContactSearchResponse struct {
	Items []Contact `json:"items"`
}

type CreateChartAccountInput

type CreateChartAccountInput struct {
	ConnectionID string `json:"connectionId"`
	Source       string `json:"source"`
	ID           string `json:"id"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	Code         string `json:"code"`
	Description  string `json:"description"`
}

CreateChartAccountInput is Bitwave's category creation contract. In a manual accounting connection these categories are the organization chart of accounts used by categorization and rules.

type CreateChartAccountResponse

type CreateChartAccountResponse struct {
	ID string `json:"id"`
}

type CreateContactInput

type CreateContactInput struct {
	ConnectionID string `json:"connectionId"`
	RemoteID     string `json:"remoteId,omitempty"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	FirstName    string `json:"firstName,omitempty"`
	LastName     string `json:"lastName,omitempty"`
	EmailAddress string `json:"emailAddress,omitempty"`
}

type CreateManualAccountingConnectionResponse

type CreateManualAccountingConnectionResponse struct {
	ConnectionID string `json:"connectionId"`
}

type CreateTransaction

type CreateTransaction struct {
	SystemID               string         `json:"systemId"`
	Time                   string         `json:"time"`
	AccountID              string         `json:"accountId"`
	Amount                 string         `json:"amount"`
	AmountTicker           string         `json:"amountTicker"`
	TransactionType        string         `json:"transactionType"`
	TradeID                string         `json:"tradeId,omitempty"`
	GroupID                string         `json:"groupId,omitempty"`
	BlockchainID           string         `json:"blockchainId,omitempty"`
	Cost                   string         `json:"cost,omitempty"`
	CostTicker             string         `json:"costTicker,omitempty"`
	Fee                    string         `json:"fee,omitempty"`
	FeeTicker              string         `json:"feeTicker,omitempty"`
	CategoryID             string         `json:"categoryId,omitempty"`
	ContactID              string         `json:"contactId,omitempty"`
	AccountingConnectionID string         `json:"accountingConnectionId,omitempty"`
	Memo                   string         `json:"memo,omitempty"`
	Description            string         `json:"description,omitempty"`
	FromAddress            string         `json:"fromAddress,omitempty"`
	ToAddress              string         `json:"toAddress,omitempty"`
	Metadata               map[string]any `json:"metadata,omitempty"`
}

CreateTransaction is the public transaction-ingest contract used by the Bitwave transaction UI. Numeric quantities remain strings to avoid losing precision in automation and LLM tool calls.

type ExportResponse

type ExportResponse struct {
	FileType  string   `json:"fileType,omitempty"`
	ExportID  string   `json:"exportId,omitempty"`
	Filename  string   `json:"filename,omitempty"`
	ExportIDs []string `json:"exportIds,omitempty"`
}

func (ExportResponse) IDs

func (r ExportResponse) IDs() []string

type FindInvoiceInput added in v0.4.0

type FindInvoiceInput struct {
	ContactID       string
	Title           string
	PageSize        int
	IncludeDisabled bool
}

FindInvoiceInput mirrors the contact-first invoice picker in the Bitwave UI. Title is matched exactly (case-insensitively) after fetching only the selected contact's invoices. This avoids enumerating an organization's full invoice population, which can contain hundreds of thousands of records.

type FullWalletResyncResponse added in v0.3.1

type FullWalletResyncResponse struct {
	Success      bool                      `json:"success"`
	DryRun       bool                      `json:"dryRun"`
	OrgID        string                    `json:"orgId"`
	WalletID     string                    `json:"walletId"`
	Syncer       string                    `json:"syncer,omitempty"`
	WorkflowHref string                    `json:"workflowHref,omitempty"`
	ClearedState []WalletResyncStateTarget `json:"clearedState,omitempty"`
	ExecutionID  string                    `json:"executionId,omitempty"`
	Message      string                    `json:"message,omitempty"`
}

type Input

type Input struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type InternalTransferInput

type InternalTransferInput struct {
	FromWalletID string `json:"fromWalletId"`
	ToWalletID   string `json:"toWalletId"`
	Coin         string `json:"coin"`
	Amount       string `json:"amount"`
	CreatedSEC   int64  `json:"createdSEC"`
	Memo         string `json:"memo,omitempty"`
}

type InventoryMutationResult

type InventoryMutationResult struct {
	Success bool   `json:"success"`
	ID      string `json:"id"`
	Error   string `json:"error,omitempty"`
}

type InventoryView

type InventoryView struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type InventoryViewUpdate

type InventoryViewUpdate struct {
	ID                       string   `json:"id"`
	Status                   string   `json:"status"`
	InventoryViewID          string   `json:"inventoryViewId"`
	UpdateRequestedSEC       int64    `json:"updateRequestedSEC"`
	UpdateCompletedSEC       int64    `json:"updateCompletedSEC,omitempty"`
	Errors                   []string `json:"errors,omitempty"`
	RunIDReference           string   `json:"runIdReference,omitempty"`
	StartingSEC              int64    `json:"startingSEC,omitempty"`
	EndingSEC                int64    `json:"endingSEC,omitempty"`
	TransferAtHistoricalCost bool     `json:"transferAtHistoricalCost,omitempty"`
}

type InventoryViewUpdateRequest

type InventoryViewUpdateRequest struct {
	RunIDReference           string `json:"runIdReference,omitempty"`
	StartingDate             string `json:"startingDate,omitempty"`
	EndingDate               string `json:"endingDate"`
	TransferAtHistoricalCost bool   `json:"transferAtHistoricalCost"`
}

type Invoice added in v0.4.0

type Invoice struct {
	ID                     string          `json:"id"`
	Title                  string          `json:"title,omitempty"`
	Type                   string          `json:"type,omitempty"`
	Status                 string          `json:"status,omitempty"`
	Date                   string          `json:"date,omitempty"`
	DueDate                string          `json:"dueDate,omitempty"`
	DueAmount              json.Number     `json:"dueAmount,omitempty"`
	TotalAmount            json.Number     `json:"totalAmount,omitempty"`
	Currency               string          `json:"currency,omitempty"`
	Source                 string          `json:"source,omitempty"`
	Enabled                bool            `json:"enabled"`
	ContactID              string          `json:"contactId,omitempty"`
	OrgID                  string          `json:"orgId,omitempty"`
	AccountingConnectionID string          `json:"accountingConnectionId,omitempty"`
	HasMatchedTransactions bool            `json:"hasMatchedTransactions"`
	ExchangeRate           json.Number     `json:"exchangeRate,omitempty"`
	LastUpdatedSEC         int64           `json:"lastUpdatedSEC,omitempty"`
	Lines                  json.RawMessage `json:"lines,omitempty"`
}

type InvoiceListInput added in v0.4.0

type InvoiceListInput struct {
	ContactID       string
	PageToken       string
	PageSize        int
	IncludeDisabled bool
}

type InvoicePage added in v0.4.0

type InvoicePage struct {
	Records           []Invoice `json:"records"`
	PreviousPageToken string    `json:"previousPageToken,omitempty"`
	NextPageToken     string    `json:"nextPageToken,omitempty"`
}

type LegacyBalanceInput

type LegacyBalanceInput struct {
	EndDate       string
	GroupBy       string
	SubsidiaryIDs []string
}

type LegacyReport

type LegacyReport struct {
	Data struct {
		ID     string `json:"id"`
		Status string `json:"status"`
	} `json:"data"`
	Links map[string]Link `json:"links"`
}

type LegacyRun

type LegacyRun struct {
	ID string `json:"id"`
}
type Link struct {
	Href   string `json:"href"`
	Method string `json:"method"`
}

type OrgDetails

type OrgDetails struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Timezone     string `json:"timezone"`
	BaseCurrency any    `json:"baseCurrency"`
}

type OrgWallet

type OrgWallet struct {
	ID                      string         `json:"id"`
	Name                    string         `json:"name"`
	Description             string         `json:"description,omitempty"`
	Type                    int            `json:"type,omitempty"`
	NetworkID               string         `json:"networkId,omitempty"`
	Address                 string         `json:"address,omitempty"`
	Addresses               []string       `json:"addresses,omitempty"`
	SubsidiaryID            string         `json:"subsidiaryId,omitempty"`
	IsBalanceMonitoringOnly bool           `json:"isBalanceMonitoringOnly,omitempty"`
	Metadata                map[string]any `json:"metadata,omitempty"`
}

OrgWallet is the complete discovery-safe wallet shape returned by the org GraphQL API. Address and Addresses are both retained because legacy watch wallets and modern account-based wallets expose different fields.

type ReportData

type ReportData struct {
	ReportType  string      `json:"reportType"`
	ReportRunID string      `json:"reportRunId"`
	Columns     []string    `json:"columns"`
	Rows        []ReportRow `json:"rows"`
}

ReportData is the deployed report-result representation. It provides the same columns and cell rows shown by the web application and is used as a compatibility download path when the dedicated CSV route is unavailable.

type ReportRow

type ReportRow struct {
	Cells []string    `json:"cells"`
	Rows  []ReportRow `json:"rows"`
}

type RuleCreateResult

type RuleCreateResult struct {
	Success bool            `json:"success"`
	Errors  json.RawMessage `json:"errors,omitempty"`
}

type RulesPage

type RulesPage struct {
	Items         []json.RawMessage `json:"items"`
	NextPageToken string            `json:"nextPageToken,omitempty"`
}

type Run

type Run struct {
	SuccessfullyStarted bool   `json:"successfullyStarted"`
	ReportRunID         string `json:"reportRunId"`
	Error               string `json:"error,omitempty"`
}

type RunStatus

type RunStatus struct {
	Status string `json:"status"`
}

type StartRequest

type StartRequest struct {
	ReportType string  `json:"reportType"`
	Inputs     []Input `json:"inputs"`
}

type Subsidiary

type Subsidiary struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	SubType string `json:"subType,omitempty"`
}

type TransactionAssetRequest

type TransactionAssetRequest struct {
	Timezone string                   `json:"timezone,omitempty"`
	Limit    int                      `json:"limit"`
	Filters  TransactionExportFilters `json:"filters"`
}

type TransactionAssetValue added in v0.4.0

type TransactionAssetValue struct {
	CurrencyID string `json:"currencyId"`
	Value      string `json:"value"`
}

type TransactionCategorizationContext added in v0.4.0

type TransactionCategorizationContext struct {
	State struct {
		State          string          `json:"state"`
		Categorization json.RawMessage `json:"categorization"`
		Price          struct {
			ExchangeRates           map[string]TransactionExchangeRate `json:"exchangeRates"`
			TransactionPriceVersion *int                               `json:"transactionPriceVersion"`
		} `json:"price"`
		Transaction struct {
			TransactionID   string                          `json:"transactionId"`
			TransactionType string                          `json:"txnType"`
			TimestampSEC    int64                           `json:"txnTimestampSEC"`
			Lines           []TransactionCategorizationLine `json:"txnLines"`
		} `json:"txn"`
	} `json:"state"`
	Assets []struct {
		CurrencyID string `json:"currencyId"`
		Ticker     string `json:"ticker"`
		Unit       string `json:"unit,omitempty"`
	} `json:"assets"`
}

type TransactionCategorizationLine added in v0.4.0

type TransactionCategorizationLine struct {
	ID           string                   `json:"id,omitempty"`
	TxnLineID    int                      `json:"txnLineId"`
	Operation    string                   `json:"operation"`
	Amount       TransactionAssetValue    `json:"amount"`
	Value        TransactionAssetValue    `json:"value"`
	WalletID     string                   `json:"walletId"`
	From         string                   `json:"from,omitempty"`
	To           string                   `json:"to,omitempty"`
	ExchangeRate *TransactionExchangeRate `json:"exchangeRate,omitempty"`
}

type TransactionDateRange

type TransactionDateRange struct {
	From string `json:"from,omitempty"`
	To   string `json:"to,omitempty"`
}

type TransactionExchangeRate added in v0.4.0

type TransactionExchangeRate struct {
	ID      string `json:"id,omitempty"`
	From    string `json:"from"`
	To      string `json:"to"`
	Type    string `json:"type"`
	PriceID string `json:"priceId,omitempty"`
	Rate    string `json:"rate,omitempty"`
	Reason  string `json:"reason,omitempty"`
}

type TransactionExportFilters

type TransactionExportFilters struct {
	DateRange                   *TransactionDateRange `json:"dateRange,omitempty"`
	WalletIDs                   []string              `json:"walletIds,omitempty"`
	SubsidiaryIDs               []string              `json:"subsidiaryIds,omitempty"`
	AssetIDs                    []string              `json:"assetIds,omitempty"`
	TransactionTypes            []string              `json:"transactionTypes,omitempty"`
	States                      []string              `json:"states,omitempty"`
	CategorizationStatuses      []string              `json:"categorizationStatuses,omitempty"`
	ReconciliationStatuses      []string              `json:"reconciliationStatuses,omitempty"`
	IgnoredStatuses             []string              `json:"ignoredStatuses,omitempty"`
	SearchTokens                []string              `json:"searchTokens,omitempty"`
	TransactionIDs              []string              `json:"transactionIds,omitempty"`
	FromAddresses               []string              `json:"fromAddresses,omitempty"`
	ToAddresses                 []string              `json:"toAddresses,omitempty"`
	Addresses                   []string              `json:"addresses,omitempty"`
	Operations                  []string              `json:"operations,omitempty"`
	IncludeCombinedTransactions bool                  `json:"includeCombinedTransactions,omitempty"`
}

type TransactionExportRequest

type TransactionExportRequest struct {
	Timezone      string                   `json:"timezone"`
	SortBy        string                   `json:"sortBy,omitempty"`
	SortDirection string                   `json:"sortDirection,omitempty"`
	Filters       TransactionExportFilters `json:"filters"`
}

type TransactionFailure

type TransactionFailure struct {
	TransactionID string `json:"transactionId"`
	Error         string `json:"error"`
}

type TransactionSearchRequest

type TransactionSearchRequest struct {
	Timezone      string                   `json:"timezone,omitempty"`
	Limit         int                      `json:"limit"`
	NextToken     string                   `json:"nextToken,omitempty"`
	SortBy        string                   `json:"sortBy,omitempty"`
	SortDirection string                   `json:"sortDirection,omitempty"`
	Filters       TransactionExportFilters `json:"filters"`
}

type TransactionSearchResponse

type TransactionSearchResponse struct {
	Transactions []json.RawMessage `json:"transactions"`
	NextToken    string            `json:"nextToken,omitempty"`
	PrevToken    string            `json:"prevToken,omitempty"`
	AssetIDs     []string          `json:"assetIds,omitempty"`
}

type TransactionSummaryAddressRecord added in v0.3.1

type TransactionSummaryAddressRecord struct {
	WalletID                    string  `json:"walletId"`
	InteractingAddress          string  `json:"interactingAddress"`
	DepositsTransactionCount    int     `json:"depositsTxnsCount"`
	DepositsUncategorized       int     `json:"depositsUncategorized"`
	DepositsFMV                 float64 `json:"depositsFmv"`
	WithdrawalsTransactionCount int     `json:"withdrawalsTxnsCount"`
	WithdrawalsUncategorized    int     `json:"withdrawalsUncategorized"`
	WithdrawalsFMV              float64 `json:"withdrawalsFmv"`
}

type TransactionSummaryAsset added in v0.3.1

type TransactionSummaryAsset struct {
	AssetID   string `json:"assetId"`
	AssetName string `json:"assetName"`
}

type TransactionSummaryWalletRecord added in v0.3.1

type TransactionSummaryWalletRecord struct {
	Wallet                      string  `json:"wallet"`
	WalletID                    string  `json:"walletId"`
	InteractingAddressesCount   int     `json:"interactingAddressesCount"`
	DepositsTransactionCount    int     `json:"depositsTxnsCount"`
	DepositsUncategorized       int     `json:"depositsUncategorized"`
	DepositsFMV                 float64 `json:"depositsFmv"`
	WithdrawalsTransactionCount int     `json:"withdrawalsTxnsCount"`
	WithdrawalsUncategorized    int     `json:"withdrawalsUncategorized"`
	WithdrawalsFMV              float64 `json:"withdrawalsFmv"`
	TotalTransactionCount       int     `json:"totalTxnsCount"`
	TotalUncategorized          int     `json:"totalUncategorized"`
	TotalUnreconciled           int     `json:"totalUnreconciled"`
	NetFMV                      float64 `json:"netFmv"`
	TotalFMV                    float64 `json:"totalFmv"`
}

type Wallet

type Wallet struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	NetworkID    string   `json:"networkId,omitempty"`
	Address      string   `json:"address,omitempty"`
	Addresses    []string `json:"addresses,omitempty"`
	SubsidiaryID string   `json:"subsidiaryId,omitempty"`
}

Wallet and Subsidiary intentionally contain only discovery-safe fields used to resolve human labels to stable report filter IDs.

type WalletPermission

type WalletPermission struct {
	UserID string `json:"userId"`
	Role   int    `json:"role"`
}

type WalletResyncStateTarget added in v0.3.1

type WalletResyncStateTarget struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

type WalletRollupRequest

type WalletRollupRequest struct {
	Address string            `json:"address"`
	Type    string            `json:"type"`
	Rules   []BabelRollupRule `json:"rules"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL