Skip to content

fix: enhance RelayChain and SwapQuoteInfo models with new httpRpcUrl#3725

Open
ice-erebus wants to merge 1 commit into
masterfrom
bugfix/tx-confirmation-after-approve-on-dex-and-bridge
Open

fix: enhance RelayChain and SwapQuoteInfo models with new httpRpcUrl#3725
ice-erebus wants to merge 1 commit into
masterfrom
bugfix/tx-confirmation-after-approve-on-dex-and-bridge

Conversation

@ice-erebus

Copy link
Copy Markdown
Contributor

Description

  • Wait for approve txs confirmation from blockchain by itself

Additional Notes

  • NA

Task ID

  • ION-5844

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation
  • Chore

Screenshots (if applicable)

  • NA

@ice-erebus ice-erebus requested review from a team as code owners March 19, 2026 09:55
@ice-morpheus ice-morpheus enabled auto-merge (squash) March 19, 2026 09:55
@ice-morpheus ice-morpheus force-pushed the bugfix/tx-confirmation-after-approve-on-dex-and-bridge branch from 240a3ca to d00bb31 Compare March 19, 2026 10:10
@ice-morpheus ice-morpheus force-pushed the bugfix/tx-confirmation-after-approve-on-dex-and-bridge branch 4 times, most recently from 4ce2648 to 6ac09fe Compare March 19, 2026 11:28
return;
}

throw IonSwapException(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is it worth make it more general, not only for swap? If so we could move it from swap client package and use IonIdentityTransactionException instead of IonSwapException

throw IonSwapException('Failed to approve token allowance, tx hash: $txHash');
final rcpUrl = swapQuoteInfo.sellBlockchainRcpUrl;
if (rcpUrl == null) {
await Future<void>.delayed(SwapConstants.delayAfterApproveDuration);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so if rcpURL is null we are not having allowance check. is it ok?

int maxTries = 20,
Duration pollInterval = const Duration(seconds: 3),
}) async {
if (!txHash.startsWith('0x') || txHash.length != 66) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't we want to raise an exception in this case?

mixin WaitForConfirmationMixin {
Future<void> waitForConfirmation({
required String txHash,
required String rpcUrl,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is some places i can see rpc and others rcp. is this a typo or two different things?

@ice-morpheus ice-morpheus force-pushed the bugfix/tx-confirmation-after-approve-on-dex-and-bridge branch from 6ac09fe to bf336b9 Compare March 19, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants