feat(webhook): OKX transaction-status payload for callbackUrl#29
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Submit Intent Status webhook wire format from the OKX Relayer Integration API (HackMD):
POSTtocontext.callbackUrlwith a top-level JSON array (one element per delivery) using flattened fields (chainIndex,requestId,txHash,blockHeight/gasUsedas0xhex quantities for confirmed txs,errorMessage/errorDatafor failures).Details
taskId+relayer_getStatusfields) with the OKX mapping.chainIndicesinconfig.jsonto translate EIP-155chainIdstrings to OKXchainIndex; defaults to the decimal chain id when not configured.Configintofire_callbackso chain index resolution works from all call sites (send path, receipt monitor, background resubmit loop).200) payload and an error (400) payload.Documentation
README webhook section and sample
config.jsonupdated accordingly.Testing
cargo test(all green).