Skip to content

feat(webhook): OKX transaction-status payload for callbackUrl#29

Merged
ch4r10t33r merged 2 commits into
masterfrom
feat/okx-transaction-status-webhook
May 12, 2026
Merged

feat(webhook): OKX transaction-status payload for callbackUrl#29
ch4r10t33r merged 2 commits into
masterfrom
feat/okx-transaction-status-webhook

Conversation

@ch4r10t33r
Copy link
Copy Markdown
Member

Summary

Implements the Submit Intent Status webhook wire format from the OKX Relayer Integration API (HackMD): POST to context.callbackUrl with a top-level JSON array (one element per delivery) using flattened fields (chainIndex, requestId, txHash, blockHeight / gasUsed as 0x hex quantities for confirmed txs, errorMessage / errorData for failures).

Details

  • Replaces the previous EIP-shaped single object (taskId + relayer_getStatus fields) with the OKX mapping.
  • Adds optional chainIndices in config.json to translate EIP-155 chainId strings to OKX chainIndex; defaults to the decimal chain id when not configured.
  • Passes Config into fire_callback so chain index resolution works from all call sites (send path, receipt monitor, background resubmit loop).
  • Adds unit tests for a successful (200) payload and an error (400) payload.

Documentation

README webhook section and sample config.json updated accordingly.

Testing

cargo test (all green).

POST bodies are now a JSON array of flattened status rows per the OKX
Relayer Integration API (Submit Intent Status), including string
timestamps/status, hex blockHeight/gasUsed from receipts, and
errorMessage/errorData for terminal failures.

Add optional config chainIndices to map EIP-155 chainId to OKX
chainIndex; default to decimal chainId when unset.

Update README and wire Config through fire_callback call sites.
Replace from_str_radix(10) with parse, use map(fn) instead of redundant
closure, and drop needless borrow in serde_json::to_value test.
Copy link
Copy Markdown
Member

@nikhilkumar1612 nikhilkumar1612 left a comment

Choose a reason for hiding this comment

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

lgtm

@ch4r10t33r ch4r10t33r merged commit 1d75e2f into master May 12, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants