getGaslessWriteRequest
Resolve the transaction hash a transparently relayed write returned back to the GaslessQ request behind it.
import { getGaslessWriteRequest, confirmGaslessRequest } from "@symmio/trading-core";
const hash = await quote(config, { ...parameters });
const relayed = getGaslessWriteRequest(config, { hash });
if (relayed) {
const { txHash } = await confirmGaslessRequest(config, {
chainId: relayed.chainId,
requestId: relayed.requestId,
until: "receipt",
});
}When execution.mode sends a write through the relayer, the action still returns an ordinary-looking Hash so every consumer keeps working unchanged. That hash is the relayer’s first broadcast, and it is not durable: a gas bump or a stuck nonce makes the service replace it, and the replacement is the transaction that actually lands. Waiting for a receipt on a replaced hash waits forever.
This is the side channel that makes the hash recoverable. The dispatcher registers each relayed write the moment the relayer reports a broadcast, keyed by that hash; this reads the registration back. null means the write went through the wallet, which is what makes it usable as a branch — treat every write the same way, and follow the relay only when there is one.
React consumers do not call this: resolveWriteResult already does, so every relayed write hook resolves on the
request’s terminal hash and reports gasless: { requestId, broadcastHash } on its
WriteResult.
This is an in-memory hand-off, not a history. Registrations live per Config and only the most recent relayed writes
are kept, so read it right after the write — and persist the requestId if you need it to survive a reload. There is
no list-by-wallet endpoint to recover a lost id from.
Parameters
hashHashrequiredThe transaction hash the write returned.
Returns
GaslessWriteRequest | nullrequestIdstringStable service tracking id — poll it with getGaslessRequest.
service"operations"Which sub-service stores the request. A relayed write is always an operation relay.
chainIdnumberThe chain the relay was accepted on.
protocolInstancestring | nullProtocol instance the relay was accepted on, or null for a proxy base that names none.
broadcastHashHashThe relayer’s first broadcast — the hash the write returned, and the lookup key.
null when the hash was submitted by the wallet, or when the relay is no longer remembered.
Throws
Nothing. A lookup that finds no relay returns null.