Function: readShadowSubmitOutcome
Call Signature
readShadowSubmitOutcome(
method,signedBody,result):ShadowSubmitOutcome
Normalizes a shadow write's raw answer. For 'RequestTrade' the result is a
ShadowSubmitOutcome, whose success always has queued; any other method may also be a
ShadowSyncSuccess (no queued).
A 2xx envelope with error === false is a success when it is a queued RequestTrade that
acknowledges the EXACT signed uniqueKey, or a synchronous (mode: 'sync') liquidity write.
Everything else is classified as a failure from the status and the body's code.
signed body shadow submit outcome request trade unique key
Parameters
| Parameter | Type |
|---|---|
method | "RequestTrade" |
signedBody | Record<string, unknown> |
result | ShadowSubmitResult |
request trade signed body shadow submit result
Returns
shadow submit outcome
Throws
GSwapSDKError SHADOW_NOT_QUEUED when a RequestTrade success does not queue the
signed uniqueKey (a synchronous or mismatched answer must never be accepted as a swap).
unique key
Call Signature
readShadowSubmitOutcome(
method,signedBody,result):ShadowSubmitOutcome|ShadowSyncSuccess
Normalizes a shadow write's raw answer. For 'RequestTrade' the result is a
ShadowSubmitOutcome, whose success always has queued; any other method may also be a
ShadowSyncSuccess (no queued).
A 2xx envelope with error === false is a success when it is a queued RequestTrade that
acknowledges the EXACT signed uniqueKey, or a synchronous (mode: 'sync') liquidity write.
Everything else is classified as a failure from the status and the body's code.
signed body shadow submit outcome sync success request trade unique key
Parameters
| Parameter | Type |
|---|---|
method | string |
signedBody | Record<string, unknown> |
result | ShadowSubmitResult |
signed body shadow submit result
Returns
ShadowSubmitOutcome | ShadowSyncSuccess
shadow submit outcome sync success
Throws
GSwapSDKError SHADOW_NOT_QUEUED when a RequestTrade success does not queue the
signed uniqueKey (a synchronous or mismatched answer must never be accepted as a swap).
unique key