Use these enums and constants from @dzapio/sdk to avoid typos and ensure correct values in API calls.
Services
Use with getAllowance, approve, and sign when specifying the DZap service:
There is no Services.swap; use Services.trade for swap/bridge.
TxnStatus
Returned on transaction and approval results. Use for status checks:
Example: if (result.status === TxnStatus.success) { ... }
ApprovalModes
Use with getAllowance and approve (parameter name is mode, not permitType):
PermitTypes
Use with sign() for permit signatures (parameter name is permitType):
contractErrorActions (trade failure actions)
When a trade fails, the response may include action with one of:
Handle TRY_ANOTHER_ROUTE by rebuilding the trade request with protocol: bestReturnSource and calling trade() again.
Native token address
Skip approval for the native token (e.g. ETH). Use this address for comparisons:
Filter it out before calling getAllowance or approve:
Next steps
Last modified on March 15, 2026