Files
motr/internal/db/network/query.sql.go

2584 lines
80 KiB
Go
Raw Permalink Normal View History

Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.28.0
Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
// source: query.sql
feat/ui (#11) * ui: improve visual consistency across components * feat: simplify task execution with consolidated commands * feat: enable account registration flow * feat: integrate price tracking functionality * feat: add metadata components for improved SEO and web crawling * refactor: improve code organization and consistency * fix: update login template package names * refactor: rename and restructure UI components for clarity * feat: introduce dynamic asset selection for transfer UI * chore: update dependencies and build process * feat: Add KVNamespace interface for Cloudflare KV store operations * refactor: Update JSON operations to use Golang generics with JSON Marshaller interface * feat: Add json import for KVNamespace generic JSON operations * refactor: Update PutJSON method to accept any type for JSON marshaling * refactor: migrate to modular architecture with domain-driven design * fix: directory structure for component routing * refactor: partial routes to htmx * docs: update documentation to reflect UI structure changes * refactor: relocate build artifacts for cleaner project structure * feat: integrate Cloudflare cache for improved performance * build: update import paths for middleware package * feat: implement core authentication flows * refactor: rename view handler to index handler for clarity * feat: introduce devbox for streamlined development environment * feat: introduce deployment and build scripts * feat: introduce radar and worker services with build automation * feat: introduce WASM-based worker and radar services * feat: migrate to standard go build process * fix: correct worker script path in wrangler configuration * feat: enhance service monitoring capabilities * refactor: migrate to new database and KV store context pattern * build: streamline worker builds using devbox scripts * feat: migrate to D1 database bindings for improved data access * feat: introduce session ID middleware * perf: optimize WASM build size by stripping debug information * feat: introduce process-compose for simplified local development * feat: enable direct wrangler commands and simplify deployment
2025-05-28 12:50:38 -04:00
package network
Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
import (
"context"
"database/sql"
"time"
)
const countBlockchainsByChainType = `-- name: CountBlockchainsByChainType :one
SELECT COUNT(*) as count FROM blockchains
WHERE chain_type LIKE '%' || ? || '%' AND deleted_at IS NULL
`
func (q *Queries) CountBlockchainsByChainType(ctx context.Context, dollar_1 sql.NullString) (int64, error) {
row := q.db.QueryRowContext(ctx, countBlockchainsByChainType, dollar_1)
var count int64
err := row.Scan(&count)
return count, err
}
const getAssetByChainAndSymbol = `-- name: GetAssetByChainAndSymbol :one
SELECT id, created_at, updated_at, deleted_at, name, symbol, decimals, chain_id, channel, asset_type, coingecko_id FROM assets
WHERE chain_id = ? AND symbol = ? AND deleted_at IS NULL
LIMIT 1
`
type GetAssetByChainAndSymbolParams struct {
ChainID string `json:"chain_id"`
Symbol string `json:"symbol"`
}
func (q *Queries) GetAssetByChainAndSymbol(ctx context.Context, arg GetAssetByChainAndSymbolParams) (Asset, error) {
row := q.db.QueryRowContext(ctx, getAssetByChainAndSymbol, arg.ChainID, arg.Symbol)
var i Asset
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
)
return i, err
}
const getAssetByID = `-- name: GetAssetByID :one
SELECT id, created_at, updated_at, deleted_at, name, symbol, decimals, chain_id, channel, asset_type, coingecko_id FROM assets
WHERE id = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetAssetByID(ctx context.Context, id string) (Asset, error) {
row := q.db.QueryRowContext(ctx, getAssetByID, id)
var i Asset
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
)
return i, err
}
const getAssetBySymbol = `-- name: GetAssetBySymbol :one
SELECT id, created_at, updated_at, deleted_at, name, symbol, decimals, chain_id, channel, asset_type, coingecko_id FROM assets
WHERE symbol = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetAssetBySymbol(ctx context.Context, symbol string) (Asset, error) {
row := q.db.QueryRowContext(ctx, getAssetBySymbol, symbol)
var i Asset
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
)
return i, err
}
const getAssetWithLatestPrice = `-- name: GetAssetWithLatestPrice :one
SELECT a.id, a.created_at, a.updated_at, a.deleted_at, a.name, a.symbol, a.decimals, a.chain_id, a.channel, a.asset_type, a.coingecko_id, p.price_usd, p.price_btc, p.volume_24h_usd, p.market_cap_usd,
p.available_supply, p.total_supply, p.max_supply,
p.percent_change_1h, p.percent_change_24h, p.percent_change_7d,
p.rank, p.last_updated
FROM assets a
LEFT JOIN (
SELECT p1.id, p1.created_at, p1.updated_at, p1.deleted_at, p1.asset_id, p1.price_usd, p1.price_btc, p1.volume_24h_usd, p1.market_cap_usd, p1.available_supply, p1.total_supply, p1.max_supply, p1.percent_change_1h, p1.percent_change_24h, p1.percent_change_7d, p1.rank, p1.last_updated
FROM prices p1
INNER JOIN (
SELECT asset_id, MAX(last_updated) as max_date
FROM prices
WHERE deleted_at IS NULL
GROUP BY asset_id
) p2 ON p1.asset_id = p2.asset_id AND p1.last_updated = p2.max_date
WHERE p1.deleted_at IS NULL
) p ON a.id = p.asset_id
WHERE a.id = ? AND a.deleted_at IS NULL
LIMIT 1
`
type GetAssetWithLatestPriceRow struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt sql.NullTime `json:"deleted_at"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals int64 `json:"decimals"`
ChainID string `json:"chain_id"`
Channel string `json:"channel"`
AssetType string `json:"asset_type"`
CoingeckoID sql.NullString `json:"coingecko_id"`
PriceUsd sql.NullFloat64 `json:"price_usd"`
PriceBtc sql.NullFloat64 `json:"price_btc"`
Volume24hUsd sql.NullFloat64 `json:"volume_24h_usd"`
MarketCapUsd sql.NullFloat64 `json:"market_cap_usd"`
AvailableSupply sql.NullFloat64 `json:"available_supply"`
TotalSupply sql.NullFloat64 `json:"total_supply"`
MaxSupply sql.NullFloat64 `json:"max_supply"`
PercentChange1h sql.NullFloat64 `json:"percent_change_1h"`
PercentChange24h sql.NullFloat64 `json:"percent_change_24h"`
PercentChange7d sql.NullFloat64 `json:"percent_change_7d"`
Rank sql.NullInt64 `json:"rank"`
LastUpdated time.Time `json:"last_updated"`
}
func (q *Queries) GetAssetWithLatestPrice(ctx context.Context, id string) (GetAssetWithLatestPriceRow, error) {
row := q.db.QueryRowContext(ctx, getAssetWithLatestPrice, id)
var i GetAssetWithLatestPriceRow
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
&i.PriceUsd,
&i.PriceBtc,
&i.Volume24hUsd,
&i.MarketCapUsd,
&i.AvailableSupply,
&i.TotalSupply,
&i.MaxSupply,
&i.PercentChange1h,
&i.PercentChange24h,
&i.PercentChange7d,
&i.Rank,
&i.LastUpdated,
)
return i, err
}
const getBlockchainByChainName = `-- name: GetBlockchainByChainName :one
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE chain_name = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetBlockchainByChainName(ctx context.Context, chainName string) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, getBlockchainByChainName, chainName)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const getBlockchainByCosmosChainID = `-- name: GetBlockchainByCosmosChainID :one
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE chain_id_cosmos = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetBlockchainByCosmosChainID(ctx context.Context, chainIDCosmos sql.NullString) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, getBlockchainByCosmosChainID, chainIDCosmos)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const getBlockchainByEvmChainID = `-- name: GetBlockchainByEvmChainID :one
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE chain_id_evm = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetBlockchainByEvmChainID(ctx context.Context, chainIDEvm sql.NullString) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, getBlockchainByEvmChainID, chainIDEvm)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const getBlockchainByID = `-- name: GetBlockchainByID :one
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE id = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetBlockchainByID(ctx context.Context, id string) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, getBlockchainByID, id)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const getBlockchainEndpoints = `-- name: GetBlockchainEndpoints :one
SELECT id, chain_name, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint
FROM blockchains
WHERE id = ? AND deleted_at IS NULL
LIMIT 1
`
type GetBlockchainEndpointsRow struct {
ID string `json:"id"`
ChainName string `json:"chain_name"`
LcdEndpoint sql.NullString `json:"lcd_endpoint"`
GrpcEndpoint sql.NullString `json:"grpc_endpoint"`
EvmRpcEndpoint sql.NullString `json:"evm_rpc_endpoint"`
}
func (q *Queries) GetBlockchainEndpoints(ctx context.Context, id string) (GetBlockchainEndpointsRow, error) {
row := q.db.QueryRowContext(ctx, getBlockchainEndpoints, id)
var i GetBlockchainEndpointsRow
err := row.Scan(
&i.ID,
&i.ChainName,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
)
return i, err
}
const getBlockchainExplorer = `-- name: GetBlockchainExplorer :one
SELECT id, chain_name, explorer
FROM blockchains
WHERE id = ? AND deleted_at IS NULL
LIMIT 1
`
type GetBlockchainExplorerRow struct {
ID string `json:"id"`
ChainName string `json:"chain_name"`
Explorer sql.NullString `json:"explorer"`
}
func (q *Queries) GetBlockchainExplorer(ctx context.Context, id string) (GetBlockchainExplorerRow, error) {
row := q.db.QueryRowContext(ctx, getBlockchainExplorer, id)
var i GetBlockchainExplorerRow
err := row.Scan(&i.ID, &i.ChainName, &i.Explorer)
return i, err
}
const getBlockchainWithAssetInfo = `-- name: GetBlockchainWithAssetInfo :one
SELECT b.id, b.created_at, b.updated_at, b.deleted_at, b.chain_name, b.chain_id_cosmos, b.chain_id_evm, b.api_name, b.bech_account_prefix, b.bech_validator_prefix, b.main_asset_symbol, b.main_asset_denom, b.staking_asset_symbol, b.staking_asset_denom, b.is_stake_enabled, b.chain_image, b.main_asset_image, b.staking_asset_image, b.chain_type, b.is_support_mobile_wallet, b.is_support_extension_wallet, b.is_support_erc20, b.description_en, b.description_ko, b.description_ja, b.origin_genesis_time, b.account_type, b.btc_staking, b.cosmos_fee_info, b.evm_fee_info, b.lcd_endpoint, b.grpc_endpoint, b.evm_rpc_endpoint, b.explorer, b.about, b.forum, a.id as asset_id, a.symbol, a.decimals, p.price_usd, p.price_btc
FROM blockchains b
LEFT JOIN assets a ON b.main_asset_symbol = a.symbol
LEFT JOIN (
SELECT p1.id, p1.created_at, p1.updated_at, p1.deleted_at, p1.asset_id, p1.price_usd, p1.price_btc, p1.volume_24h_usd, p1.market_cap_usd, p1.available_supply, p1.total_supply, p1.max_supply, p1.percent_change_1h, p1.percent_change_24h, p1.percent_change_7d, p1.rank, p1.last_updated
FROM prices p1
INNER JOIN (
SELECT asset_id, MAX(last_updated) as max_date
FROM prices
WHERE deleted_at IS NULL
GROUP BY asset_id
) p2 ON p1.asset_id = p2.asset_id AND p1.last_updated = p2.max_date
WHERE p1.deleted_at IS NULL
) p ON a.id = p.asset_id
WHERE b.id = ? AND b.deleted_at IS NULL
LIMIT 1
`
type GetBlockchainWithAssetInfoRow struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt sql.NullTime `json:"deleted_at"`
ChainName string `json:"chain_name"`
ChainIDCosmos sql.NullString `json:"chain_id_cosmos"`
ChainIDEvm sql.NullString `json:"chain_id_evm"`
ApiName sql.NullString `json:"api_name"`
BechAccountPrefix sql.NullString `json:"bech_account_prefix"`
BechValidatorPrefix sql.NullString `json:"bech_validator_prefix"`
MainAssetSymbol sql.NullString `json:"main_asset_symbol"`
MainAssetDenom sql.NullString `json:"main_asset_denom"`
StakingAssetSymbol sql.NullString `json:"staking_asset_symbol"`
StakingAssetDenom sql.NullString `json:"staking_asset_denom"`
IsStakeEnabled bool `json:"is_stake_enabled"`
ChainImage sql.NullString `json:"chain_image"`
MainAssetImage sql.NullString `json:"main_asset_image"`
StakingAssetImage sql.NullString `json:"staking_asset_image"`
ChainType string `json:"chain_type"`
IsSupportMobileWallet bool `json:"is_support_mobile_wallet"`
IsSupportExtensionWallet bool `json:"is_support_extension_wallet"`
IsSupportErc20 bool `json:"is_support_erc20"`
DescriptionEn sql.NullString `json:"description_en"`
DescriptionKo sql.NullString `json:"description_ko"`
DescriptionJa sql.NullString `json:"description_ja"`
OriginGenesisTime sql.NullTime `json:"origin_genesis_time"`
AccountType string `json:"account_type"`
BtcStaking sql.NullString `json:"btc_staking"`
CosmosFeeInfo sql.NullString `json:"cosmos_fee_info"`
EvmFeeInfo sql.NullString `json:"evm_fee_info"`
LcdEndpoint sql.NullString `json:"lcd_endpoint"`
GrpcEndpoint sql.NullString `json:"grpc_endpoint"`
EvmRpcEndpoint sql.NullString `json:"evm_rpc_endpoint"`
Explorer sql.NullString `json:"explorer"`
About sql.NullString `json:"about"`
Forum sql.NullString `json:"forum"`
AssetID sql.NullString `json:"asset_id"`
Symbol sql.NullString `json:"symbol"`
Decimals sql.NullInt64 `json:"decimals"`
PriceUsd sql.NullFloat64 `json:"price_usd"`
PriceBtc sql.NullFloat64 `json:"price_btc"`
}
func (q *Queries) GetBlockchainWithAssetInfo(ctx context.Context, id string) (GetBlockchainWithAssetInfoRow, error) {
row := q.db.QueryRowContext(ctx, getBlockchainWithAssetInfo, id)
var i GetBlockchainWithAssetInfoRow
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
&i.AssetID,
&i.Symbol,
&i.Decimals,
&i.PriceUsd,
&i.PriceBtc,
)
return i, err
}
const getPriceByAssetID = `-- name: GetPriceByAssetID :one
SELECT id, created_at, updated_at, deleted_at, asset_id, price_usd, price_btc, volume_24h_usd, market_cap_usd, available_supply, total_supply, max_supply, percent_change_1h, percent_change_24h, percent_change_7d, rank, last_updated FROM prices
WHERE asset_id = ? AND deleted_at IS NULL
ORDER BY last_updated DESC
LIMIT 1
`
func (q *Queries) GetPriceByAssetID(ctx context.Context, assetID string) (Price, error) {
row := q.db.QueryRowContext(ctx, getPriceByAssetID, assetID)
var i Price
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.AssetID,
&i.PriceUsd,
&i.PriceBtc,
&i.Volume24hUsd,
&i.MarketCapUsd,
&i.AvailableSupply,
&i.TotalSupply,
&i.MaxSupply,
&i.PercentChange1h,
&i.PercentChange24h,
&i.PercentChange7d,
&i.Rank,
&i.LastUpdated,
)
return i, err
}
const getPriceByID = `-- name: GetPriceByID :one
SELECT id, created_at, updated_at, deleted_at, asset_id, price_usd, price_btc, volume_24h_usd, market_cap_usd, available_supply, total_supply, max_supply, percent_change_1h, percent_change_24h, percent_change_7d, rank, last_updated FROM prices
WHERE id = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetPriceByID(ctx context.Context, id string) (Price, error) {
row := q.db.QueryRowContext(ctx, getPriceByID, id)
var i Price
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.AssetID,
&i.PriceUsd,
&i.PriceBtc,
&i.Volume24hUsd,
&i.MarketCapUsd,
&i.AvailableSupply,
&i.TotalSupply,
&i.MaxSupply,
&i.PercentChange1h,
&i.PercentChange24h,
&i.PercentChange7d,
&i.Rank,
&i.LastUpdated,
)
return i, err
}
const getPriceConversionByCurrency = `-- name: GetPriceConversionByCurrency :one
SELECT id, created_at, updated_at, deleted_at, price_id, currency_code, price, volume_24h, market_cap, last_updated FROM price_conversions
WHERE price_id = ? AND currency_code = ? AND deleted_at IS NULL
LIMIT 1
`
type GetPriceConversionByCurrencyParams struct {
PriceID string `json:"price_id"`
CurrencyCode string `json:"currency_code"`
}
func (q *Queries) GetPriceConversionByCurrency(ctx context.Context, arg GetPriceConversionByCurrencyParams) (PriceConversion, error) {
row := q.db.QueryRowContext(ctx, getPriceConversionByCurrency, arg.PriceID, arg.CurrencyCode)
var i PriceConversion
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.PriceID,
&i.CurrencyCode,
&i.Price,
&i.Volume24h,
&i.MarketCap,
&i.LastUpdated,
)
return i, err
}
const getPriceConversionByID = `-- name: GetPriceConversionByID :one
SELECT id, created_at, updated_at, deleted_at, price_id, currency_code, price, volume_24h, market_cap, last_updated FROM price_conversions
WHERE id = ? AND deleted_at IS NULL
LIMIT 1
`
func (q *Queries) GetPriceConversionByID(ctx context.Context, id string) (PriceConversion, error) {
row := q.db.QueryRowContext(ctx, getPriceConversionByID, id)
var i PriceConversion
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.PriceID,
&i.CurrencyCode,
&i.Price,
&i.Volume24h,
&i.MarketCap,
&i.LastUpdated,
)
return i, err
}
const getPriceConversionsByPriceID = `-- name: GetPriceConversionsByPriceID :many
SELECT id, created_at, updated_at, deleted_at, price_id, currency_code, price, volume_24h, market_cap, last_updated FROM price_conversions
WHERE price_id = ? AND deleted_at IS NULL
ORDER BY currency_code ASC
`
func (q *Queries) GetPriceConversionsByPriceID(ctx context.Context, priceID string) ([]PriceConversion, error) {
rows, err := q.db.QueryContext(ctx, getPriceConversionsByPriceID, priceID)
if err != nil {
return nil, err
}
defer rows.Close()
var items []PriceConversion
for rows.Next() {
var i PriceConversion
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.PriceID,
&i.CurrencyCode,
&i.Price,
&i.Volume24h,
&i.MarketCap,
&i.LastUpdated,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const insertAsset = `-- name: InsertAsset :one
INSERT INTO assets (
name,
symbol,
decimals,
chain_id,
channel,
asset_type,
coingecko_id
) VALUES (?, ?, ?, ?, ?, ?, ?)
RETURNING id, created_at, updated_at, deleted_at, name, symbol, decimals, chain_id, channel, asset_type, coingecko_id
`
type InsertAssetParams struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals int64 `json:"decimals"`
ChainID string `json:"chain_id"`
Channel string `json:"channel"`
AssetType string `json:"asset_type"`
CoingeckoID sql.NullString `json:"coingecko_id"`
}
// ASSET QUERIES
func (q *Queries) InsertAsset(ctx context.Context, arg InsertAssetParams) (Asset, error) {
row := q.db.QueryRowContext(ctx, insertAsset,
arg.Name,
arg.Symbol,
arg.Decimals,
arg.ChainID,
arg.Channel,
arg.AssetType,
arg.CoingeckoID,
)
var i Asset
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
)
return i, err
}
const insertBlockchain = `-- name: InsertBlockchain :one
INSERT INTO blockchains (
id,
chain_name,
chain_id_cosmos,
chain_id_evm,
api_name,
bech_account_prefix,
bech_validator_prefix,
main_asset_symbol,
main_asset_denom,
staking_asset_symbol,
staking_asset_denom,
is_stake_enabled,
chain_image,
main_asset_image,
staking_asset_image,
chain_type,
is_support_mobile_wallet,
is_support_extension_wallet,
is_support_erc20,
description_en,
description_ko,
description_ja,
origin_genesis_time,
account_type,
btc_staking,
cosmos_fee_info,
evm_fee_info,
lcd_endpoint,
grpc_endpoint,
evm_rpc_endpoint,
explorer,
about,
forum
) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
)
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type InsertBlockchainParams struct {
ID string `json:"id"`
ChainName string `json:"chain_name"`
ChainIDCosmos sql.NullString `json:"chain_id_cosmos"`
ChainIDEvm sql.NullString `json:"chain_id_evm"`
ApiName sql.NullString `json:"api_name"`
BechAccountPrefix sql.NullString `json:"bech_account_prefix"`
BechValidatorPrefix sql.NullString `json:"bech_validator_prefix"`
MainAssetSymbol sql.NullString `json:"main_asset_symbol"`
MainAssetDenom sql.NullString `json:"main_asset_denom"`
StakingAssetSymbol sql.NullString `json:"staking_asset_symbol"`
StakingAssetDenom sql.NullString `json:"staking_asset_denom"`
IsStakeEnabled bool `json:"is_stake_enabled"`
ChainImage sql.NullString `json:"chain_image"`
MainAssetImage sql.NullString `json:"main_asset_image"`
StakingAssetImage sql.NullString `json:"staking_asset_image"`
ChainType string `json:"chain_type"`
IsSupportMobileWallet bool `json:"is_support_mobile_wallet"`
IsSupportExtensionWallet bool `json:"is_support_extension_wallet"`
IsSupportErc20 bool `json:"is_support_erc20"`
DescriptionEn sql.NullString `json:"description_en"`
DescriptionKo sql.NullString `json:"description_ko"`
DescriptionJa sql.NullString `json:"description_ja"`
OriginGenesisTime sql.NullTime `json:"origin_genesis_time"`
AccountType string `json:"account_type"`
BtcStaking sql.NullString `json:"btc_staking"`
CosmosFeeInfo sql.NullString `json:"cosmos_fee_info"`
EvmFeeInfo sql.NullString `json:"evm_fee_info"`
LcdEndpoint sql.NullString `json:"lcd_endpoint"`
GrpcEndpoint sql.NullString `json:"grpc_endpoint"`
EvmRpcEndpoint sql.NullString `json:"evm_rpc_endpoint"`
Explorer sql.NullString `json:"explorer"`
About sql.NullString `json:"about"`
Forum sql.NullString `json:"forum"`
}
// BLOCKCHAIN QUERIES
func (q *Queries) InsertBlockchain(ctx context.Context, arg InsertBlockchainParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, insertBlockchain,
arg.ID,
arg.ChainName,
arg.ChainIDCosmos,
arg.ChainIDEvm,
arg.ApiName,
arg.BechAccountPrefix,
arg.BechValidatorPrefix,
arg.MainAssetSymbol,
arg.MainAssetDenom,
arg.StakingAssetSymbol,
arg.StakingAssetDenom,
arg.IsStakeEnabled,
arg.ChainImage,
arg.MainAssetImage,
arg.StakingAssetImage,
arg.ChainType,
arg.IsSupportMobileWallet,
arg.IsSupportExtensionWallet,
arg.IsSupportErc20,
arg.DescriptionEn,
arg.DescriptionKo,
arg.DescriptionJa,
arg.OriginGenesisTime,
arg.AccountType,
arg.BtcStaking,
arg.CosmosFeeInfo,
arg.EvmFeeInfo,
arg.LcdEndpoint,
arg.GrpcEndpoint,
arg.EvmRpcEndpoint,
arg.Explorer,
arg.About,
arg.Forum,
)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const insertPrice = `-- name: InsertPrice :one
INSERT INTO prices (
asset_id,
price_usd,
price_btc,
volume_24h_usd,
market_cap_usd,
available_supply,
total_supply,
max_supply,
percent_change_1h,
percent_change_24h,
percent_change_7d,
rank,
last_updated
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
RETURNING id, created_at, updated_at, deleted_at, asset_id, price_usd, price_btc, volume_24h_usd, market_cap_usd, available_supply, total_supply, max_supply, percent_change_1h, percent_change_24h, percent_change_7d, rank, last_updated
`
type InsertPriceParams struct {
AssetID string `json:"asset_id"`
PriceUsd sql.NullFloat64 `json:"price_usd"`
PriceBtc sql.NullFloat64 `json:"price_btc"`
Volume24hUsd sql.NullFloat64 `json:"volume_24h_usd"`
MarketCapUsd sql.NullFloat64 `json:"market_cap_usd"`
AvailableSupply sql.NullFloat64 `json:"available_supply"`
TotalSupply sql.NullFloat64 `json:"total_supply"`
MaxSupply sql.NullFloat64 `json:"max_supply"`
PercentChange1h sql.NullFloat64 `json:"percent_change_1h"`
PercentChange24h sql.NullFloat64 `json:"percent_change_24h"`
PercentChange7d sql.NullFloat64 `json:"percent_change_7d"`
Rank sql.NullInt64 `json:"rank"`
LastUpdated time.Time `json:"last_updated"`
}
// PRICE QUERIES (UPDATED)
func (q *Queries) InsertPrice(ctx context.Context, arg InsertPriceParams) (Price, error) {
row := q.db.QueryRowContext(ctx, insertPrice,
arg.AssetID,
arg.PriceUsd,
arg.PriceBtc,
arg.Volume24hUsd,
arg.MarketCapUsd,
arg.AvailableSupply,
arg.TotalSupply,
arg.MaxSupply,
arg.PercentChange1h,
arg.PercentChange24h,
arg.PercentChange7d,
arg.Rank,
arg.LastUpdated,
)
var i Price
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.AssetID,
&i.PriceUsd,
&i.PriceBtc,
&i.Volume24hUsd,
&i.MarketCapUsd,
&i.AvailableSupply,
&i.TotalSupply,
&i.MaxSupply,
&i.PercentChange1h,
&i.PercentChange24h,
&i.PercentChange7d,
&i.Rank,
&i.LastUpdated,
)
return i, err
}
const insertPriceConversion = `-- name: InsertPriceConversion :one
INSERT INTO price_conversions (
price_id,
currency_code,
price,
volume_24h,
market_cap,
last_updated
) VALUES (?, ?, ?, ?, ?, ?)
RETURNING id, created_at, updated_at, deleted_at, price_id, currency_code, price, volume_24h, market_cap, last_updated
`
type InsertPriceConversionParams struct {
PriceID string `json:"price_id"`
CurrencyCode string `json:"currency_code"`
Price sql.NullFloat64 `json:"price"`
Volume24h sql.NullFloat64 `json:"volume_24h"`
MarketCap sql.NullFloat64 `json:"market_cap"`
LastUpdated time.Time `json:"last_updated"`
}
// PRICE CONVERSION QUERIES (NEW)
func (q *Queries) InsertPriceConversion(ctx context.Context, arg InsertPriceConversionParams) (PriceConversion, error) {
row := q.db.QueryRowContext(ctx, insertPriceConversion,
arg.PriceID,
arg.CurrencyCode,
arg.Price,
arg.Volume24h,
arg.MarketCap,
arg.LastUpdated,
)
var i PriceConversion
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.PriceID,
&i.CurrencyCode,
&i.Price,
&i.Volume24h,
&i.MarketCap,
&i.LastUpdated,
)
return i, err
}
const listAllBlockchains = `-- name: ListAllBlockchains :many
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE deleted_at IS NULL
ORDER BY chain_name ASC
`
func (q *Queries) ListAllBlockchains(ctx context.Context) ([]Blockchain, error) {
rows, err := q.db.QueryContext(ctx, listAllBlockchains)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Blockchain
for rows.Next() {
var i Blockchain
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listAssetsByChain = `-- name: ListAssetsByChain :many
SELECT id, created_at, updated_at, deleted_at, name, symbol, decimals, chain_id, channel, asset_type, coingecko_id FROM assets
WHERE chain_id = ? AND deleted_at IS NULL
ORDER BY symbol ASC
`
func (q *Queries) ListAssetsByChain(ctx context.Context, chainID string) ([]Asset, error) {
rows, err := q.db.QueryContext(ctx, listAssetsByChain, chainID)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Asset
for rows.Next() {
var i Asset
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listAssetsWithLatestPrices = `-- name: ListAssetsWithLatestPrices :many
SELECT a.id, a.created_at, a.updated_at, a.deleted_at, a.name, a.symbol, a.decimals, a.chain_id, a.channel, a.asset_type, a.coingecko_id, p.price_usd, p.price_btc, p.volume_24h_usd, p.market_cap_usd,
p.available_supply, p.total_supply, p.max_supply,
p.percent_change_1h, p.percent_change_24h, p.percent_change_7d,
p.rank, p.last_updated
FROM assets a
LEFT JOIN (
SELECT p1.id, p1.created_at, p1.updated_at, p1.deleted_at, p1.asset_id, p1.price_usd, p1.price_btc, p1.volume_24h_usd, p1.market_cap_usd, p1.available_supply, p1.total_supply, p1.max_supply, p1.percent_change_1h, p1.percent_change_24h, p1.percent_change_7d, p1.rank, p1.last_updated
FROM prices p1
INNER JOIN (
SELECT asset_id, MAX(last_updated) as max_date
FROM prices
WHERE deleted_at IS NULL
GROUP BY asset_id
) p2 ON p1.asset_id = p2.asset_id AND p1.last_updated = p2.max_date
WHERE p1.deleted_at IS NULL
) p ON a.id = p.asset_id
WHERE a.deleted_at IS NULL
ORDER BY p.rank ASC, a.symbol ASC
LIMIT ? OFFSET ?
`
type ListAssetsWithLatestPricesParams struct {
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
}
type ListAssetsWithLatestPricesRow struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt sql.NullTime `json:"deleted_at"`
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals int64 `json:"decimals"`
ChainID string `json:"chain_id"`
Channel string `json:"channel"`
AssetType string `json:"asset_type"`
CoingeckoID sql.NullString `json:"coingecko_id"`
PriceUsd sql.NullFloat64 `json:"price_usd"`
PriceBtc sql.NullFloat64 `json:"price_btc"`
Volume24hUsd sql.NullFloat64 `json:"volume_24h_usd"`
MarketCapUsd sql.NullFloat64 `json:"market_cap_usd"`
AvailableSupply sql.NullFloat64 `json:"available_supply"`
TotalSupply sql.NullFloat64 `json:"total_supply"`
MaxSupply sql.NullFloat64 `json:"max_supply"`
PercentChange1h sql.NullFloat64 `json:"percent_change_1h"`
PercentChange24h sql.NullFloat64 `json:"percent_change_24h"`
PercentChange7d sql.NullFloat64 `json:"percent_change_7d"`
Rank sql.NullInt64 `json:"rank"`
LastUpdated time.Time `json:"last_updated"`
}
func (q *Queries) ListAssetsWithLatestPrices(ctx context.Context, arg ListAssetsWithLatestPricesParams) ([]ListAssetsWithLatestPricesRow, error) {
rows, err := q.db.QueryContext(ctx, listAssetsWithLatestPrices, arg.Limit, arg.Offset)
if err != nil {
return nil, err
}
defer rows.Close()
var items []ListAssetsWithLatestPricesRow
for rows.Next() {
var i ListAssetsWithLatestPricesRow
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
&i.PriceUsd,
&i.PriceBtc,
&i.Volume24hUsd,
&i.MarketCapUsd,
&i.AvailableSupply,
&i.TotalSupply,
&i.MaxSupply,
&i.PercentChange1h,
&i.PercentChange24h,
&i.PercentChange7d,
&i.Rank,
&i.LastUpdated,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listBlockchainsByChainType = `-- name: ListBlockchainsByChainType :many
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE chain_type LIKE '%' || ? || '%' AND deleted_at IS NULL
ORDER BY chain_name ASC
`
func (q *Queries) ListBlockchainsByChainType(ctx context.Context, dollar_1 sql.NullString) ([]Blockchain, error) {
rows, err := q.db.QueryContext(ctx, listBlockchainsByChainType, dollar_1)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Blockchain
for rows.Next() {
var i Blockchain
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listBlockchainsWithAssetInfo = `-- name: ListBlockchainsWithAssetInfo :many
SELECT b.id, b.created_at, b.updated_at, b.deleted_at, b.chain_name, b.chain_id_cosmos, b.chain_id_evm, b.api_name, b.bech_account_prefix, b.bech_validator_prefix, b.main_asset_symbol, b.main_asset_denom, b.staking_asset_symbol, b.staking_asset_denom, b.is_stake_enabled, b.chain_image, b.main_asset_image, b.staking_asset_image, b.chain_type, b.is_support_mobile_wallet, b.is_support_extension_wallet, b.is_support_erc20, b.description_en, b.description_ko, b.description_ja, b.origin_genesis_time, b.account_type, b.btc_staking, b.cosmos_fee_info, b.evm_fee_info, b.lcd_endpoint, b.grpc_endpoint, b.evm_rpc_endpoint, b.explorer, b.about, b.forum, a.id as asset_id, a.symbol, a.decimals, p.price_usd, p.price_btc
FROM blockchains b
LEFT JOIN assets a ON b.main_asset_symbol = a.symbol
LEFT JOIN (
SELECT p1.id, p1.created_at, p1.updated_at, p1.deleted_at, p1.asset_id, p1.price_usd, p1.price_btc, p1.volume_24h_usd, p1.market_cap_usd, p1.available_supply, p1.total_supply, p1.max_supply, p1.percent_change_1h, p1.percent_change_24h, p1.percent_change_7d, p1.rank, p1.last_updated
FROM prices p1
INNER JOIN (
SELECT asset_id, MAX(last_updated) as max_date
FROM prices
WHERE deleted_at IS NULL
GROUP BY asset_id
) p2 ON p1.asset_id = p2.asset_id AND p1.last_updated = p2.max_date
WHERE p1.deleted_at IS NULL
) p ON a.id = p.asset_id
WHERE b.deleted_at IS NULL
ORDER BY b.chain_name ASC
LIMIT ? OFFSET ?
`
type ListBlockchainsWithAssetInfoParams struct {
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
}
type ListBlockchainsWithAssetInfoRow struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt sql.NullTime `json:"deleted_at"`
ChainName string `json:"chain_name"`
ChainIDCosmos sql.NullString `json:"chain_id_cosmos"`
ChainIDEvm sql.NullString `json:"chain_id_evm"`
ApiName sql.NullString `json:"api_name"`
BechAccountPrefix sql.NullString `json:"bech_account_prefix"`
BechValidatorPrefix sql.NullString `json:"bech_validator_prefix"`
MainAssetSymbol sql.NullString `json:"main_asset_symbol"`
MainAssetDenom sql.NullString `json:"main_asset_denom"`
StakingAssetSymbol sql.NullString `json:"staking_asset_symbol"`
StakingAssetDenom sql.NullString `json:"staking_asset_denom"`
IsStakeEnabled bool `json:"is_stake_enabled"`
ChainImage sql.NullString `json:"chain_image"`
MainAssetImage sql.NullString `json:"main_asset_image"`
StakingAssetImage sql.NullString `json:"staking_asset_image"`
ChainType string `json:"chain_type"`
IsSupportMobileWallet bool `json:"is_support_mobile_wallet"`
IsSupportExtensionWallet bool `json:"is_support_extension_wallet"`
IsSupportErc20 bool `json:"is_support_erc20"`
DescriptionEn sql.NullString `json:"description_en"`
DescriptionKo sql.NullString `json:"description_ko"`
DescriptionJa sql.NullString `json:"description_ja"`
OriginGenesisTime sql.NullTime `json:"origin_genesis_time"`
AccountType string `json:"account_type"`
BtcStaking sql.NullString `json:"btc_staking"`
CosmosFeeInfo sql.NullString `json:"cosmos_fee_info"`
EvmFeeInfo sql.NullString `json:"evm_fee_info"`
LcdEndpoint sql.NullString `json:"lcd_endpoint"`
GrpcEndpoint sql.NullString `json:"grpc_endpoint"`
EvmRpcEndpoint sql.NullString `json:"evm_rpc_endpoint"`
Explorer sql.NullString `json:"explorer"`
About sql.NullString `json:"about"`
Forum sql.NullString `json:"forum"`
AssetID sql.NullString `json:"asset_id"`
Symbol sql.NullString `json:"symbol"`
Decimals sql.NullInt64 `json:"decimals"`
PriceUsd sql.NullFloat64 `json:"price_usd"`
PriceBtc sql.NullFloat64 `json:"price_btc"`
}
func (q *Queries) ListBlockchainsWithAssetInfo(ctx context.Context, arg ListBlockchainsWithAssetInfoParams) ([]ListBlockchainsWithAssetInfoRow, error) {
rows, err := q.db.QueryContext(ctx, listBlockchainsWithAssetInfo, arg.Limit, arg.Offset)
if err != nil {
return nil, err
}
defer rows.Close()
var items []ListBlockchainsWithAssetInfoRow
for rows.Next() {
var i ListBlockchainsWithAssetInfoRow
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
&i.AssetID,
&i.Symbol,
&i.Decimals,
&i.PriceUsd,
&i.PriceBtc,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listBlockchainsWithERC20Support = `-- name: ListBlockchainsWithERC20Support :many
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE is_support_erc20 = 1 AND deleted_at IS NULL
ORDER BY chain_name ASC
`
func (q *Queries) ListBlockchainsWithERC20Support(ctx context.Context) ([]Blockchain, error) {
rows, err := q.db.QueryContext(ctx, listBlockchainsWithERC20Support)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Blockchain
for rows.Next() {
var i Blockchain
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listBlockchainsWithExtensionSupport = `-- name: ListBlockchainsWithExtensionSupport :many
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE is_support_extension_wallet = 1 AND deleted_at IS NULL
ORDER BY chain_name ASC
`
func (q *Queries) ListBlockchainsWithExtensionSupport(ctx context.Context) ([]Blockchain, error) {
rows, err := q.db.QueryContext(ctx, listBlockchainsWithExtensionSupport)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Blockchain
for rows.Next() {
var i Blockchain
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listBlockchainsWithMobileSupport = `-- name: ListBlockchainsWithMobileSupport :many
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE is_support_mobile_wallet = 1 AND deleted_at IS NULL
ORDER BY chain_name ASC
`
func (q *Queries) ListBlockchainsWithMobileSupport(ctx context.Context) ([]Blockchain, error) {
rows, err := q.db.QueryContext(ctx, listBlockchainsWithMobileSupport)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Blockchain
for rows.Next() {
var i Blockchain
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const listBlockchainsWithStaking = `-- name: ListBlockchainsWithStaking :many
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE is_stake_enabled = 1 AND deleted_at IS NULL
ORDER BY chain_name ASC
`
func (q *Queries) ListBlockchainsWithStaking(ctx context.Context) ([]Blockchain, error) {
rows, err := q.db.QueryContext(ctx, listBlockchainsWithStaking)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Blockchain
for rows.Next() {
var i Blockchain
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
feat/ui (#11) * ui: improve visual consistency across components * feat: simplify task execution with consolidated commands * feat: enable account registration flow * feat: integrate price tracking functionality * feat: add metadata components for improved SEO and web crawling * refactor: improve code organization and consistency * fix: update login template package names * refactor: rename and restructure UI components for clarity * feat: introduce dynamic asset selection for transfer UI * chore: update dependencies and build process * feat: Add KVNamespace interface for Cloudflare KV store operations * refactor: Update JSON operations to use Golang generics with JSON Marshaller interface * feat: Add json import for KVNamespace generic JSON operations * refactor: Update PutJSON method to accept any type for JSON marshaling * refactor: migrate to modular architecture with domain-driven design * fix: directory structure for component routing * refactor: partial routes to htmx * docs: update documentation to reflect UI structure changes * refactor: relocate build artifacts for cleaner project structure * feat: integrate Cloudflare cache for improved performance * build: update import paths for middleware package * feat: implement core authentication flows * refactor: rename view handler to index handler for clarity * feat: introduce devbox for streamlined development environment * feat: introduce deployment and build scripts * feat: introduce radar and worker services with build automation * feat: introduce WASM-based worker and radar services * feat: migrate to standard go build process * fix: correct worker script path in wrangler configuration * feat: enhance service monitoring capabilities * refactor: migrate to new database and KV store context pattern * build: streamline worker builds using devbox scripts * feat: migrate to D1 database bindings for improved data access * feat: introduce session ID middleware * perf: optimize WASM build size by stripping debug information * feat: introduce process-compose for simplified local development * feat: enable direct wrangler commands and simplify deployment
2025-05-28 12:50:38 -04:00
const listPriceHistoryByAssetID = `-- name: ListPriceHistoryByAssetID :many
SELECT id, created_at, updated_at, deleted_at, asset_id, price_usd, price_btc, volume_24h_usd, market_cap_usd, available_supply, total_supply, max_supply, percent_change_1h, percent_change_24h, percent_change_7d, rank, last_updated FROM prices
WHERE asset_id = ? AND deleted_at IS NULL
ORDER BY last_updated DESC
LIMIT ? OFFSET ?
Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
`
feat/ui (#11) * ui: improve visual consistency across components * feat: simplify task execution with consolidated commands * feat: enable account registration flow * feat: integrate price tracking functionality * feat: add metadata components for improved SEO and web crawling * refactor: improve code organization and consistency * fix: update login template package names * refactor: rename and restructure UI components for clarity * feat: introduce dynamic asset selection for transfer UI * chore: update dependencies and build process * feat: Add KVNamespace interface for Cloudflare KV store operations * refactor: Update JSON operations to use Golang generics with JSON Marshaller interface * feat: Add json import for KVNamespace generic JSON operations * refactor: Update PutJSON method to accept any type for JSON marshaling * refactor: migrate to modular architecture with domain-driven design * fix: directory structure for component routing * refactor: partial routes to htmx * docs: update documentation to reflect UI structure changes * refactor: relocate build artifacts for cleaner project structure * feat: integrate Cloudflare cache for improved performance * build: update import paths for middleware package * feat: implement core authentication flows * refactor: rename view handler to index handler for clarity * feat: introduce devbox for streamlined development environment * feat: introduce deployment and build scripts * feat: introduce radar and worker services with build automation * feat: introduce WASM-based worker and radar services * feat: migrate to standard go build process * fix: correct worker script path in wrangler configuration * feat: enhance service monitoring capabilities * refactor: migrate to new database and KV store context pattern * build: streamline worker builds using devbox scripts * feat: migrate to D1 database bindings for improved data access * feat: introduce session ID middleware * perf: optimize WASM build size by stripping debug information * feat: introduce process-compose for simplified local development * feat: enable direct wrangler commands and simplify deployment
2025-05-28 12:50:38 -04:00
type ListPriceHistoryByAssetIDParams struct {
AssetID string `json:"asset_id"`
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
}
func (q *Queries) ListPriceHistoryByAssetID(ctx context.Context, arg ListPriceHistoryByAssetIDParams) ([]Price, error) {
rows, err := q.db.QueryContext(ctx, listPriceHistoryByAssetID, arg.AssetID, arg.Limit, arg.Offset)
Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
if err != nil {
return nil, err
}
defer rows.Close()
feat/ui (#11) * ui: improve visual consistency across components * feat: simplify task execution with consolidated commands * feat: enable account registration flow * feat: integrate price tracking functionality * feat: add metadata components for improved SEO and web crawling * refactor: improve code organization and consistency * fix: update login template package names * refactor: rename and restructure UI components for clarity * feat: introduce dynamic asset selection for transfer UI * chore: update dependencies and build process * feat: Add KVNamespace interface for Cloudflare KV store operations * refactor: Update JSON operations to use Golang generics with JSON Marshaller interface * feat: Add json import for KVNamespace generic JSON operations * refactor: Update PutJSON method to accept any type for JSON marshaling * refactor: migrate to modular architecture with domain-driven design * fix: directory structure for component routing * refactor: partial routes to htmx * docs: update documentation to reflect UI structure changes * refactor: relocate build artifacts for cleaner project structure * feat: integrate Cloudflare cache for improved performance * build: update import paths for middleware package * feat: implement core authentication flows * refactor: rename view handler to index handler for clarity * feat: introduce devbox for streamlined development environment * feat: introduce deployment and build scripts * feat: introduce radar and worker services with build automation * feat: introduce WASM-based worker and radar services * feat: migrate to standard go build process * fix: correct worker script path in wrangler configuration * feat: enhance service monitoring capabilities * refactor: migrate to new database and KV store context pattern * build: streamline worker builds using devbox scripts * feat: migrate to D1 database bindings for improved data access * feat: introduce session ID middleware * perf: optimize WASM build size by stripping debug information * feat: introduce process-compose for simplified local development * feat: enable direct wrangler commands and simplify deployment
2025-05-28 12:50:38 -04:00
var items []Price
Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
for rows.Next() {
feat/ui (#11) * ui: improve visual consistency across components * feat: simplify task execution with consolidated commands * feat: enable account registration flow * feat: integrate price tracking functionality * feat: add metadata components for improved SEO and web crawling * refactor: improve code organization and consistency * fix: update login template package names * refactor: rename and restructure UI components for clarity * feat: introduce dynamic asset selection for transfer UI * chore: update dependencies and build process * feat: Add KVNamespace interface for Cloudflare KV store operations * refactor: Update JSON operations to use Golang generics with JSON Marshaller interface * feat: Add json import for KVNamespace generic JSON operations * refactor: Update PutJSON method to accept any type for JSON marshaling * refactor: migrate to modular architecture with domain-driven design * fix: directory structure for component routing * refactor: partial routes to htmx * docs: update documentation to reflect UI structure changes * refactor: relocate build artifacts for cleaner project structure * feat: integrate Cloudflare cache for improved performance * build: update import paths for middleware package * feat: implement core authentication flows * refactor: rename view handler to index handler for clarity * feat: introduce devbox for streamlined development environment * feat: introduce deployment and build scripts * feat: introduce radar and worker services with build automation * feat: introduce WASM-based worker and radar services * feat: migrate to standard go build process * fix: correct worker script path in wrangler configuration * feat: enhance service monitoring capabilities * refactor: migrate to new database and KV store context pattern * build: streamline worker builds using devbox scripts * feat: migrate to D1 database bindings for improved data access * feat: introduce session ID middleware * perf: optimize WASM build size by stripping debug information * feat: introduce process-compose for simplified local development * feat: enable direct wrangler commands and simplify deployment
2025-05-28 12:50:38 -04:00
var i Price
Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
feat/ui (#11) * ui: improve visual consistency across components * feat: simplify task execution with consolidated commands * feat: enable account registration flow * feat: integrate price tracking functionality * feat: add metadata components for improved SEO and web crawling * refactor: improve code organization and consistency * fix: update login template package names * refactor: rename and restructure UI components for clarity * feat: introduce dynamic asset selection for transfer UI * chore: update dependencies and build process * feat: Add KVNamespace interface for Cloudflare KV store operations * refactor: Update JSON operations to use Golang generics with JSON Marshaller interface * feat: Add json import for KVNamespace generic JSON operations * refactor: Update PutJSON method to accept any type for JSON marshaling * refactor: migrate to modular architecture with domain-driven design * fix: directory structure for component routing * refactor: partial routes to htmx * docs: update documentation to reflect UI structure changes * refactor: relocate build artifacts for cleaner project structure * feat: integrate Cloudflare cache for improved performance * build: update import paths for middleware package * feat: implement core authentication flows * refactor: rename view handler to index handler for clarity * feat: introduce devbox for streamlined development environment * feat: introduce deployment and build scripts * feat: introduce radar and worker services with build automation * feat: introduce WASM-based worker and radar services * feat: migrate to standard go build process * fix: correct worker script path in wrangler configuration * feat: enhance service monitoring capabilities * refactor: migrate to new database and KV store context pattern * build: streamline worker builds using devbox scripts * feat: migrate to D1 database bindings for improved data access * feat: introduce session ID middleware * perf: optimize WASM build size by stripping debug information * feat: introduce process-compose for simplified local development * feat: enable direct wrangler commands and simplify deployment
2025-05-28 12:50:38 -04:00
&i.AssetID,
&i.PriceUsd,
&i.PriceBtc,
&i.Volume24hUsd,
&i.MarketCapUsd,
&i.AvailableSupply,
&i.TotalSupply,
&i.MaxSupply,
&i.PercentChange1h,
&i.PercentChange24h,
&i.PercentChange7d,
&i.Rank,
&i.LastUpdated,
Refactor/orm (#7) * feat/refactor-motr * feat/refactor-motr * feat: introduce Cloudflare Workers gateway application * chore: migrate build system from Makefile to Taskfile for improved automation * feat: streamline task management with Taskfile consolidation * feat: consolidate build and install tasks for simplified workflows * <no value> * feat: enable publishing for core packages * feat/refactor-motr * feat: integrate updated crypto library for enhanced security * ci: Configure CI/CD to build and test WASM signer * refactor: streamline build process using npm scripts * fix: Correct template file paths for accurate error reporting * refactor: standardize templ file paths for improved maintainability * chore: remove package documentation * build: exclude documentation artifacts from version control * feat: serve static assets from cloudflare worker * feat: introduce Motr controller service * refactor: move UI components to separate ui module * refactor: move resolver middleware to top-level middleware directory * feat: introduce modular middleware architecture * refactor: improve separation of concerns by relocating endpoint definitions * build: simplify codebase by deleting unused info types * refactor: decouple middleware configurations * feat: integrate request middleware for enhanced processing * feat: implement register and login pages * feat: integrate WASM signer for enhanced security * refactor: move type definitions to models package * refactor: rename ipfs middleware to vault middleware * feat: Add Dockerfile for controller service * feat: Add Dockerfile for controller with multi-stage build * chore: Update Golang version to 1.24.2 in Dockerfile * feat: introduce Docker support for application deployment * feat: Implement WASM-based signing service * feat: migrate build system to Taskfile for improved automation * feat: enable docker-based development for controller and resolver * feat: Add docker-compose services for resolver and controller workers * refactor: streamline build and deployment processes with Devbox * chore: standardize development environment with Devbox * chore: standardize container entrypoint for improved consistency * feat: introduce docker-compose setup for local development * feat: remove initial placeholder code * refactor: restructure project modules for improved organization * feat: integrate motr UI library for enhanced components * chore: upgrade motr dependency to v0.0.3 * refactor: restructure project layout for improved modularity * refactor: consolidate data models and options into directory * feat: integrate sqlc for database interaction * feat: integrate D1 database for improved data management * refactor: improve naming consistency across project * feat: enhance context with HTTP header utilities * refactor: restructure project layout for improved maintainability * refactor: centralize rendering logic into middleware * chore: update motr dependency to v0.0.5 to address data consistency issues * feat: consolidate handler logic into root * refactor: relocate handlers and middleware to internal packages * chore: update dependency to v0.9.0 * refactor: Improve code structure and add comprehensive documentation for WebAssembly signer module * feat: implement WASM-based signing functionality * chore: remove build system configuration * feat: integrate D1 database for persistent data storage * feat: enable D1 database integration for Cloudflare Workers * feat: enhance task execution with docker-compose integration * refactor: centralize database queries and models * refactor: improve sqlc code generation and project structure * docs: Update README with Docker support and new project architecture * refactor: centralize Sonr configuration via middleware * chore: improve build task definitions in Taskfile * chore: remove docker deployment configuration * feat: upgrade crypto module to v0.11.0 * refactor: migrate to a configuration-driven architecture * refactor: inject database common queries into index handler * feat: streamline worker initialization * refactor: standardize package versioning process * build: prepare vault package for public release * feat: enable WASM-based vault signing with durable objects * feat: introduce Vault service for enhanced security * feat: upgrade crypto library to v0.12.1 for enhanced security features * build: update middleware build constraints * feat: introduce struct-based handlers for improved organization * feat: centralize database configuration * build: update database seeding to target remote instance * feat: enhance asset handling with shared coin type * feat: decouple build process from database initialization * refactor: move base UI components to a dedicated directory * refactor: improve component structure for enhanced maintainability * refactor: rename binding for clarity and consistency * feat: introduce development task and environment configurations * feat: introduce mprocs for simplified local development * <no value> * refactor: rename Vault DB to Controller DB for clarity * refactor: simplify configuration loading and database connections * feat: introduce MotrMode configuration to differentiate service roles * refactor: restructure base components and consolidate metadata handling * feat: introduce session context middleware for request handling * feat: enhance task management with database migration support * feat: Add database controller middleware and context retrieval methods * refactor: Improve session context handling and add full database controller middleware * feat: integrate Helia and Extism for Vault durable object * refactor: rename resolver to frontend * feat: streamline infrastructure and data management * refactor: improve task management and dependency loading * fix: remove legacy fetch handler from vault worker * feat: integrate WebAuthn for secure authentication * build: add hx-trigger for enhanced interaction * refactor: centralize session ID handling in middleware * refactor: simplify session context initialization * feat/split workers (#6) * refactor: rename claim route to register for clarity * refactor: rename demo view to dashboard view * feat: automate build and publish process * refactor: unify database queries and models for vault operations * feat: implement WASM compatible server and routing * feat: introduce controller-based routing * feat: implement passkey-based authentication * feat: implement Cloudflare cache middleware for improved performance * refactor: move ui components to ui package * feat: add handler functions for login and registration * refactor: centralize route registration logic * feat: implement user registration and login with passkey support * refactor: restructure view components for improved organization * feat: enable handle-based authentication and session management * refactor: improve config access and remove unused dependencies * refactor: restructure middleware and configuration for clarity * refactor: Remove external libraries * docs: update architecture to reflect removal of WASM build * refactor: centralize metadata and coin info types * refactor: move auth types to auth package * refactor: remove session management from vault service * refactor: reorganize UI components and middleware for clarity * refactor: move UI components to internal directory * feat: add session expiry configuration * refactor: streamline Taskfile and remove deprecated options * feat: introduce account entities and UI components * refactor: streamline asset representation with entity interfaces * feat: introduce asset pricing and market data * feat: enhance radar with session and cache middleware * fix: update dependencies and resolve peer dependency conflicts * feat: add blockchain entity and data model * feat: introduce entity-specific query interfaces * feat: Implement transaction creation, signing, and broadcasting methods * feat: implement durable object vault with RPC and IPFS support * refactor: align protobuf imports with updated cosm-orc package * feat: simplify auth components by removing options * feat: enhance data models for comprehensive crypto analysis * feat: implement account lookup by handle * refactor: simplify account card rendering * feat: enhance UI rendering with middleware * feat: remove helia file operations * build: scaffold navigation component with templ * feat: introduce UI layout components and dependency management * feat: remove unused assets for templated html * feat: implement authentication flow with WebAuthn and handle registration * feat: remove radar cmd * feat: enhance application architecture with module-based structure * refactor: relocate config and middleware to internal packages * feat: integrate session management into landing page * feat: improve landing page handler setup and session handling * feat: streamline initial setup and configuration process * chore: reorganize project layout for clarity and maintainability * chore: reorganize project structure by moving workers to 'cmd' * refactor/orm * feat: enhance task automation with root directory task * refactor: relocate chart components to dedicated directory
2025-05-09 12:51:47 -04:00
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const searchBlockchains = `-- name: SearchBlockchains :many
SELECT id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum FROM blockchains
WHERE (
chain_name LIKE '%' || ? || '%' OR
main_asset_symbol LIKE '%' || ? || '%' OR
staking_asset_symbol LIKE '%' || ? || '%' OR
description_en LIKE '%' || ? || '%'
) AND deleted_at IS NULL
ORDER BY chain_name ASC
LIMIT ? OFFSET ?
`
type SearchBlockchainsParams struct {
Column1 sql.NullString `json:"column_1"`
Column2 sql.NullString `json:"column_2"`
Column3 sql.NullString `json:"column_3"`
Column4 sql.NullString `json:"column_4"`
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
}
func (q *Queries) SearchBlockchains(ctx context.Context, arg SearchBlockchainsParams) ([]Blockchain, error) {
rows, err := q.db.QueryContext(ctx, searchBlockchains,
arg.Column1,
arg.Column2,
arg.Column3,
arg.Column4,
arg.Limit,
arg.Offset,
)
if err != nil {
return nil, err
}
defer rows.Close()
var items []Blockchain
for rows.Next() {
var i Blockchain
if err := rows.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const softDeleteAsset = `-- name: SoftDeleteAsset :exec
UPDATE assets
SET deleted_at = CURRENT_TIMESTAMP
WHERE id = ?
`
func (q *Queries) SoftDeleteAsset(ctx context.Context, id string) error {
_, err := q.db.ExecContext(ctx, softDeleteAsset, id)
return err
}
const softDeleteBlockchain = `-- name: SoftDeleteBlockchain :exec
UPDATE blockchains
SET deleted_at = CURRENT_TIMESTAMP
WHERE id = ?
`
func (q *Queries) SoftDeleteBlockchain(ctx context.Context, id string) error {
_, err := q.db.ExecContext(ctx, softDeleteBlockchain, id)
return err
}
const softDeletePriceConversion = `-- name: SoftDeletePriceConversion :exec
UPDATE price_conversions
SET deleted_at = CURRENT_TIMESTAMP
WHERE id = ?
`
func (q *Queries) SoftDeletePriceConversion(ctx context.Context, id string) error {
_, err := q.db.ExecContext(ctx, softDeletePriceConversion, id)
return err
}
const updateAsset = `-- name: UpdateAsset :one
UPDATE assets
SET
name = ?,
decimals = ?,
channel = ?,
asset_type = ?,
coingecko_id = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, name, symbol, decimals, chain_id, channel, asset_type, coingecko_id
`
type UpdateAssetParams struct {
Name string `json:"name"`
Decimals int64 `json:"decimals"`
Channel string `json:"channel"`
AssetType string `json:"asset_type"`
CoingeckoID sql.NullString `json:"coingecko_id"`
ID string `json:"id"`
}
func (q *Queries) UpdateAsset(ctx context.Context, arg UpdateAssetParams) (Asset, error) {
row := q.db.QueryRowContext(ctx, updateAsset,
arg.Name,
arg.Decimals,
arg.Channel,
arg.AssetType,
arg.CoingeckoID,
arg.ID,
)
var i Asset
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.Name,
&i.Symbol,
&i.Decimals,
&i.ChainID,
&i.Channel,
&i.AssetType,
&i.CoingeckoID,
)
return i, err
}
const updateBlockchain = `-- name: UpdateBlockchain :one
UPDATE blockchains
SET
chain_name = ?,
chain_id_cosmos = ?,
chain_id_evm = ?,
api_name = ?,
bech_account_prefix = ?,
bech_validator_prefix = ?,
main_asset_symbol = ?,
main_asset_denom = ?,
staking_asset_symbol = ?,
staking_asset_denom = ?,
is_stake_enabled = ?,
chain_image = ?,
main_asset_image = ?,
staking_asset_image = ?,
chain_type = ?,
is_support_mobile_wallet = ?,
is_support_extension_wallet = ?,
is_support_erc20 = ?,
description_en = ?,
description_ko = ?,
description_ja = ?,
origin_genesis_time = ?,
account_type = ?,
btc_staking = ?,
cosmos_fee_info = ?,
evm_fee_info = ?,
lcd_endpoint = ?,
grpc_endpoint = ?,
evm_rpc_endpoint = ?,
explorer = ?,
about = ?,
forum = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type UpdateBlockchainParams struct {
ChainName string `json:"chain_name"`
ChainIDCosmos sql.NullString `json:"chain_id_cosmos"`
ChainIDEvm sql.NullString `json:"chain_id_evm"`
ApiName sql.NullString `json:"api_name"`
BechAccountPrefix sql.NullString `json:"bech_account_prefix"`
BechValidatorPrefix sql.NullString `json:"bech_validator_prefix"`
MainAssetSymbol sql.NullString `json:"main_asset_symbol"`
MainAssetDenom sql.NullString `json:"main_asset_denom"`
StakingAssetSymbol sql.NullString `json:"staking_asset_symbol"`
StakingAssetDenom sql.NullString `json:"staking_asset_denom"`
IsStakeEnabled bool `json:"is_stake_enabled"`
ChainImage sql.NullString `json:"chain_image"`
MainAssetImage sql.NullString `json:"main_asset_image"`
StakingAssetImage sql.NullString `json:"staking_asset_image"`
ChainType string `json:"chain_type"`
IsSupportMobileWallet bool `json:"is_support_mobile_wallet"`
IsSupportExtensionWallet bool `json:"is_support_extension_wallet"`
IsSupportErc20 bool `json:"is_support_erc20"`
DescriptionEn sql.NullString `json:"description_en"`
DescriptionKo sql.NullString `json:"description_ko"`
DescriptionJa sql.NullString `json:"description_ja"`
OriginGenesisTime sql.NullTime `json:"origin_genesis_time"`
AccountType string `json:"account_type"`
BtcStaking sql.NullString `json:"btc_staking"`
CosmosFeeInfo sql.NullString `json:"cosmos_fee_info"`
EvmFeeInfo sql.NullString `json:"evm_fee_info"`
LcdEndpoint sql.NullString `json:"lcd_endpoint"`
GrpcEndpoint sql.NullString `json:"grpc_endpoint"`
EvmRpcEndpoint sql.NullString `json:"evm_rpc_endpoint"`
Explorer sql.NullString `json:"explorer"`
About sql.NullString `json:"about"`
Forum sql.NullString `json:"forum"`
ID string `json:"id"`
}
func (q *Queries) UpdateBlockchain(ctx context.Context, arg UpdateBlockchainParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, updateBlockchain,
arg.ChainName,
arg.ChainIDCosmos,
arg.ChainIDEvm,
arg.ApiName,
arg.BechAccountPrefix,
arg.BechValidatorPrefix,
arg.MainAssetSymbol,
arg.MainAssetDenom,
arg.StakingAssetSymbol,
arg.StakingAssetDenom,
arg.IsStakeEnabled,
arg.ChainImage,
arg.MainAssetImage,
arg.StakingAssetImage,
arg.ChainType,
arg.IsSupportMobileWallet,
arg.IsSupportExtensionWallet,
arg.IsSupportErc20,
arg.DescriptionEn,
arg.DescriptionKo,
arg.DescriptionJa,
arg.OriginGenesisTime,
arg.AccountType,
arg.BtcStaking,
arg.CosmosFeeInfo,
arg.EvmFeeInfo,
arg.LcdEndpoint,
arg.GrpcEndpoint,
arg.EvmRpcEndpoint,
arg.Explorer,
arg.About,
arg.Forum,
arg.ID,
)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const updateBlockchainDescriptions = `-- name: UpdateBlockchainDescriptions :one
UPDATE blockchains
SET
description_en = ?,
description_ko = ?,
description_ja = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type UpdateBlockchainDescriptionsParams struct {
DescriptionEn sql.NullString `json:"description_en"`
DescriptionKo sql.NullString `json:"description_ko"`
DescriptionJa sql.NullString `json:"description_ja"`
ID string `json:"id"`
}
func (q *Queries) UpdateBlockchainDescriptions(ctx context.Context, arg UpdateBlockchainDescriptionsParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, updateBlockchainDescriptions,
arg.DescriptionEn,
arg.DescriptionKo,
arg.DescriptionJa,
arg.ID,
)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const updateBlockchainEndpoints = `-- name: UpdateBlockchainEndpoints :one
UPDATE blockchains
SET
lcd_endpoint = ?,
grpc_endpoint = ?,
evm_rpc_endpoint = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type UpdateBlockchainEndpointsParams struct {
LcdEndpoint sql.NullString `json:"lcd_endpoint"`
GrpcEndpoint sql.NullString `json:"grpc_endpoint"`
EvmRpcEndpoint sql.NullString `json:"evm_rpc_endpoint"`
ID string `json:"id"`
}
func (q *Queries) UpdateBlockchainEndpoints(ctx context.Context, arg UpdateBlockchainEndpointsParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, updateBlockchainEndpoints,
arg.LcdEndpoint,
arg.GrpcEndpoint,
arg.EvmRpcEndpoint,
arg.ID,
)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const updateBlockchainExplorer = `-- name: UpdateBlockchainExplorer :one
UPDATE blockchains
SET
explorer = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type UpdateBlockchainExplorerParams struct {
Explorer sql.NullString `json:"explorer"`
ID string `json:"id"`
}
func (q *Queries) UpdateBlockchainExplorer(ctx context.Context, arg UpdateBlockchainExplorerParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, updateBlockchainExplorer, arg.Explorer, arg.ID)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const updateBlockchainFeeInfo = `-- name: UpdateBlockchainFeeInfo :one
UPDATE blockchains
SET
cosmos_fee_info = ?,
evm_fee_info = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type UpdateBlockchainFeeInfoParams struct {
CosmosFeeInfo sql.NullString `json:"cosmos_fee_info"`
EvmFeeInfo sql.NullString `json:"evm_fee_info"`
ID string `json:"id"`
}
func (q *Queries) UpdateBlockchainFeeInfo(ctx context.Context, arg UpdateBlockchainFeeInfoParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, updateBlockchainFeeInfo, arg.CosmosFeeInfo, arg.EvmFeeInfo, arg.ID)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const updateBlockchainImages = `-- name: UpdateBlockchainImages :one
UPDATE blockchains
SET
chain_image = ?,
main_asset_image = ?,
staking_asset_image = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type UpdateBlockchainImagesParams struct {
ChainImage sql.NullString `json:"chain_image"`
MainAssetImage sql.NullString `json:"main_asset_image"`
StakingAssetImage sql.NullString `json:"staking_asset_image"`
ID string `json:"id"`
}
func (q *Queries) UpdateBlockchainImages(ctx context.Context, arg UpdateBlockchainImagesParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, updateBlockchainImages,
arg.ChainImage,
arg.MainAssetImage,
arg.StakingAssetImage,
arg.ID,
)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const updateBlockchainSocialLinks = `-- name: UpdateBlockchainSocialLinks :one
UPDATE blockchains
SET
about = ?,
forum = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, chain_name, chain_id_cosmos, chain_id_evm, api_name, bech_account_prefix, bech_validator_prefix, main_asset_symbol, main_asset_denom, staking_asset_symbol, staking_asset_denom, is_stake_enabled, chain_image, main_asset_image, staking_asset_image, chain_type, is_support_mobile_wallet, is_support_extension_wallet, is_support_erc20, description_en, description_ko, description_ja, origin_genesis_time, account_type, btc_staking, cosmos_fee_info, evm_fee_info, lcd_endpoint, grpc_endpoint, evm_rpc_endpoint, explorer, about, forum
`
type UpdateBlockchainSocialLinksParams struct {
About sql.NullString `json:"about"`
Forum sql.NullString `json:"forum"`
ID string `json:"id"`
}
func (q *Queries) UpdateBlockchainSocialLinks(ctx context.Context, arg UpdateBlockchainSocialLinksParams) (Blockchain, error) {
row := q.db.QueryRowContext(ctx, updateBlockchainSocialLinks, arg.About, arg.Forum, arg.ID)
var i Blockchain
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.ChainName,
&i.ChainIDCosmos,
&i.ChainIDEvm,
&i.ApiName,
&i.BechAccountPrefix,
&i.BechValidatorPrefix,
&i.MainAssetSymbol,
&i.MainAssetDenom,
&i.StakingAssetSymbol,
&i.StakingAssetDenom,
&i.IsStakeEnabled,
&i.ChainImage,
&i.MainAssetImage,
&i.StakingAssetImage,
&i.ChainType,
&i.IsSupportMobileWallet,
&i.IsSupportExtensionWallet,
&i.IsSupportErc20,
&i.DescriptionEn,
&i.DescriptionKo,
&i.DescriptionJa,
&i.OriginGenesisTime,
&i.AccountType,
&i.BtcStaking,
&i.CosmosFeeInfo,
&i.EvmFeeInfo,
&i.LcdEndpoint,
&i.GrpcEndpoint,
&i.EvmRpcEndpoint,
&i.Explorer,
&i.About,
&i.Forum,
)
return i, err
}
const updatePrice = `-- name: UpdatePrice :one
UPDATE prices
SET
price_usd = ?,
price_btc = ?,
volume_24h_usd = ?,
market_cap_usd = ?,
available_supply = ?,
total_supply = ?,
max_supply = ?,
percent_change_1h = ?,
percent_change_24h = ?,
percent_change_7d = ?,
rank = ?,
last_updated = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, asset_id, price_usd, price_btc, volume_24h_usd, market_cap_usd, available_supply, total_supply, max_supply, percent_change_1h, percent_change_24h, percent_change_7d, rank, last_updated
`
type UpdatePriceParams struct {
PriceUsd sql.NullFloat64 `json:"price_usd"`
PriceBtc sql.NullFloat64 `json:"price_btc"`
Volume24hUsd sql.NullFloat64 `json:"volume_24h_usd"`
MarketCapUsd sql.NullFloat64 `json:"market_cap_usd"`
AvailableSupply sql.NullFloat64 `json:"available_supply"`
TotalSupply sql.NullFloat64 `json:"total_supply"`
MaxSupply sql.NullFloat64 `json:"max_supply"`
PercentChange1h sql.NullFloat64 `json:"percent_change_1h"`
PercentChange24h sql.NullFloat64 `json:"percent_change_24h"`
PercentChange7d sql.NullFloat64 `json:"percent_change_7d"`
Rank sql.NullInt64 `json:"rank"`
LastUpdated time.Time `json:"last_updated"`
ID string `json:"id"`
}
func (q *Queries) UpdatePrice(ctx context.Context, arg UpdatePriceParams) (Price, error) {
row := q.db.QueryRowContext(ctx, updatePrice,
arg.PriceUsd,
arg.PriceBtc,
arg.Volume24hUsd,
arg.MarketCapUsd,
arg.AvailableSupply,
arg.TotalSupply,
arg.MaxSupply,
arg.PercentChange1h,
arg.PercentChange24h,
arg.PercentChange7d,
arg.Rank,
arg.LastUpdated,
arg.ID,
)
var i Price
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.AssetID,
&i.PriceUsd,
&i.PriceBtc,
&i.Volume24hUsd,
&i.MarketCapUsd,
&i.AvailableSupply,
&i.TotalSupply,
&i.MaxSupply,
&i.PercentChange1h,
&i.PercentChange24h,
&i.PercentChange7d,
&i.Rank,
&i.LastUpdated,
)
return i, err
}
const updatePriceConversion = `-- name: UpdatePriceConversion :one
UPDATE price_conversions
SET
price = ?,
volume_24h = ?,
market_cap = ?,
last_updated = ?,
updated_at = CURRENT_TIMESTAMP
WHERE id = ?
AND deleted_at IS NULL
RETURNING id, created_at, updated_at, deleted_at, price_id, currency_code, price, volume_24h, market_cap, last_updated
`
type UpdatePriceConversionParams struct {
Price sql.NullFloat64 `json:"price"`
Volume24h sql.NullFloat64 `json:"volume_24h"`
MarketCap sql.NullFloat64 `json:"market_cap"`
LastUpdated time.Time `json:"last_updated"`
ID string `json:"id"`
}
func (q *Queries) UpdatePriceConversion(ctx context.Context, arg UpdatePriceConversionParams) (PriceConversion, error) {
row := q.db.QueryRowContext(ctx, updatePriceConversion,
arg.Price,
arg.Volume24h,
arg.MarketCap,
arg.LastUpdated,
arg.ID,
)
var i PriceConversion
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.DeletedAt,
&i.PriceID,
&i.CurrencyCode,
&i.Price,
&i.Volume24h,
&i.MarketCap,
&i.LastUpdated,
)
return i, err
}