Skip to main content
Function Signature
Description Generates a trace ID for request correlation. This is a free function on the PortalSwift module — it is not a method on Portal, so no wallet or client is required to call it. The returned value is a lowercased UUID v4. It is the same generator the SDK uses internally when you do not supply a trace ID, so IDs you generate with it match the format Portal’s logs are indexed by. Pass the result to RequestOptions(traceId:), SendAssetParams(traceId:), or portal.rawSign(message:chainId:signatureApprovalMemo:traceId:) to have the SDK send it as the X-Portal-Trace-Id header. Parameters
  • None.
Returns
  • String — a lowercased UUID v4, for example "3f2b8a1c-9d4e-4c7f-b6a2-15e8d0c34f9b".
Throws
  • Nothing. This function cannot fail.
Related Constant
The header name the SDK uses when attaching a trace ID. It is exposed so you can reference the header in your own networking code or test assertions rather than hard-coding the string. Example Usage
Notes
  • Generate one trace ID per user-facing action, not per request. Every request the operation makes reuses the ID you pass, which is what makes it useful for correlation.
  • If you omit a trace ID, the SDK generates one per request. Those IDs are never returned to you, so supply your own whenever you want to correlate with your logs.
  • MPC operations (generate, backup, recover, eject) and upgradeTo7702 generate their own trace IDs and do not accept one.
Related Documentation