Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for fetching a user’s UTXO deposit address via the bridge indexer (omni-api) instead of querying the NEAR contract directly, and wires the required base URL through the CLI and near-bridge-client configuration.
Changes:
- Add
bridge_indexer_api_urltoNearBridgeClientconfig and expose it via a getter. - Switch
NearBridgeClient::get_btc_addressto call the bridge indexer HTTP endpoint usingreqwest. - Bump
near-bridge-clientandbridge-cliversions (and update lockfile), plus minor formatting cleanup in the Starknet client.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.lock | Updates crate versions and adds reqwest dependency for near-bridge-client. |
| bridge-sdk/bridge-clients/starknet-bridge-client/src/starknet_bridge_client.rs | Formatting-only changes (no functional behavior change). |
| bridge-sdk/bridge-clients/near-bridge-client/src/near_bridge_client.rs | Adds bridge_indexer_api_url field and accessor. |
| bridge-sdk/bridge-clients/near-bridge-client/src/btc.rs | Replaces on-chain view call with HTTP POST to indexer to fetch deposit address. |
| bridge-sdk/bridge-clients/near-bridge-client/Cargo.toml | Adds reqwest dependency and bumps version. |
| bridge-cli/src/omni_connector_command.rs | Passes bridge_indexer_api_url into NearBridgeClientBuilder. |
| bridge-cli/Cargo.toml | Bumps CLI version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let api_url = self | ||
| .bridge_indexer_api_url()? | ||
| .join("api/v3/utxo/get_user_deposit_address") | ||
| .map_err(|e| { | ||
| BridgeSdkError::ConfigError(format!("Failed to construct api endpoint url: {e}")) | ||
| })?; |
There was a problem hiding this comment.
Url::join("api/v3/utxo/get_user_deposit_address") is sensitive to whether the configured base URL ends with a trailing / or contains a path segment (e.g., https://host/base). In those cases, join can drop the last path segment and produce an unexpected endpoint. Consider joining an absolute path (leading /) or normalizing the base URL to always end with / before joining, to make this configuration more robust.
|
Why are we switching from using the smart contract? To me this is a better source of truth than the API |
|
No, since in api we're still making view call, but the only difference is adding address in db directly without making a transaction and waiting for indexers |
No description provided.