Skip to content

refactor: add format_max_gas_fee helper for type-safe MaxGasFee serialisation#242

Merged
frolvanya merged 6 commits intoNear-One:mainfrom
tom9000:UTXOChainMsg-MaxGasFee-PR
Feb 23, 2026
Merged

refactor: add format_max_gas_fee helper for type-safe MaxGasFee serialisation#242
frolvanya merged 6 commits intoNear-One:mainfrom
tom9000:UTXOChainMsg-MaxGasFee-PR

Conversation

@tom9000
Copy link
Copy Markdown
Contributor

@tom9000 tom9000 commented Jan 28, 2026

  • Add public format_max_gas_fee() helper function in btc.rs
  • Keep UTXOChainMsg enum private
  • Update CLI to use helper function instead of manual format string
  • Ensures serialization format stays consistent between producer and consumer
  • Improve --message help text with MaxGasFee JSON format example

For issue #241

…lization

- Add public format_max_gas_fee() helper function in btc.rs
- Keep UTXOChainMsg enum private for better encapsulation
- Update CLI to use helper function instead of manual format string
- Improve --message help text with MaxGasFee JSON format example
- Ensures serialization format stays consistent between producer and consumer
@frolvanya frolvanya requested a review from a team February 9, 2026 22:19
Copy link
Copy Markdown
Contributor

@frolvanya frolvanya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, sorry we've missed this PR

Comment thread bridge-cli/src/omni_connector_command.rs Outdated
Comment thread bridge-cli/src/omni_connector_command.rs Outdated
Comment thread bridge-cli/src/omni_connector_command.rs Outdated
tom9000 and others added 4 commits February 20, 2026 16:58
Co-authored-by: Ivan Frolov <59515280+frolvanya@users.noreply.github.com>
Co-authored-by: Ivan Frolov <59515280+frolvanya@users.noreply.github.com>
Co-authored-by: Ivan Frolov <59515280+frolvanya@users.noreply.github.com>
@tom9000
Copy link
Copy Markdown
Contributor Author

tom9000 commented Feb 20, 2026

Sorry about slow response. Thx for the suggested changes, they should be ready to go now.

@tom9000 tom9000 requested a review from frolvanya February 20, 2026 13:25
Copy link
Copy Markdown
Contributor

@frolvanya frolvanya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bump near-bridge-client and bridge-cli version in their toml files. Also, I think we need to have a similar logic for solana-init-transfer and evm-init-transfer, right? Because we can make sol/evm -> utxo (btc/zcash) transfer and we have to specify maxgasfee there as well. For now it's done like this:

bridge-cli testnet solana-init-transfer --token GGP2Ji7vB7sKYAoucUWm5fhvQZQu32kM8KbVzbbV53sT --amount 10000 --recipient btc:tb1qf408ptxk67glau9357mzycfgjjykmxxw9qsusl --message "{\"MaxGasFee\": \"400\"}" --fee 500 --native-fee 0

I think it would be nice to fetch gas_fee from api, since it's still available if sender is not near:
https://mainnet.api.bridge.nearone.org/api/v3/transfer-fee?sender=sol:BXss9YNCX2p6VPf2Em54pHXkXnC2FPBeZgbB9fY1cuBR&recipient=btc:tb1qf408ptxk67glau9357mzycfgjjykmxxw9qsusl&token=near:nbtc.bridge.near&amount=10000

@frolvanya frolvanya requested a review from a team February 22, 2026 21:23
@tom9000
Copy link
Copy Markdown
Contributor Author

tom9000 commented Feb 23, 2026

I pushed the version bumps. I'll create a new issue for the solana-init-transfer and evm-init-transfer maxgasfee API fetching, so we can merge this PR.

@frolvanya
Copy link
Copy Markdown
Contributor

I pushed the version bumps. I'll create a new issue for the solana-init-transfer and evm-init-transfer maxgasfee API fetching, so we can merge this PR.

Sounds good, thanks for the contribution!

@frolvanya frolvanya merged commit a71bda4 into Near-One:main Feb 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants