> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dzap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Enums & Constants

> Reference for SDK enums and constant values

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:

```typescript theme={null}
import { Services } from "@dzapio/sdk";

Services.trade;  // "trade" - swaps and bridges
Services.dca;    // "dca"  - DCA operations
Services.zap;    // "zap"  - Zap operations
```

There is no `Services.swap`; use `Services.trade` for swap/bridge.

## TxnStatus

Returned on transaction and approval results. Use for status checks:

```typescript theme={null}
import { TxnStatus } from "@dzapio/sdk";

TxnStatus.mining;
TxnStatus.success;
TxnStatus.rejected;
TxnStatus.error;
TxnStatus.reverted;
TxnStatus.pendingWalletConfirmation;
TxnStatus.partialSuccess;
TxnStatus.waitingForExecution;
```

Example: `if (result.status === TxnStatus.success) { ... }`

## ApprovalModes

Use with `getAllowance` and `approve` (parameter name is `mode`, not `permitType`):

```typescript theme={null}
import { ApprovalModes } from "@dzapio/sdk";

ApprovalModes.Default;                      // Standard ERC20 approval
ApprovalModes.PermitSingle;
ApprovalModes.PermitWitnessTransferFrom;
ApprovalModes.PermitBatchWitnessTransferFrom;
ApprovalModes.AutoPermit;                   // Recommended: auto-select best
```

## PermitTypes

Use with `sign()` for permit signatures (parameter name is `permitType`):

```typescript theme={null}
import { PermitTypes } from "@dzapio/sdk";

PermitTypes.PermitSingle;
PermitTypes.PermitWitnessTransferFrom;
PermitTypes.PermitBatchWitnessTransferFrom;
PermitTypes.EIP2612Permit;
PermitTypes.AutoPermit;
```

## contractErrorActions (trade failure actions)

When a trade fails, the response may include `action` with one of:

```typescript theme={null}
// From SDK types (contractErrorActions)
"TRY_ANOTHER_ROUTE";   // Retry with bestReturnSource
"INCREASE_SLIPPAGE";   // User should increase slippage
"INCREASE_ALLOWANCE";  // Allowance issue
```

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:

```text theme={null}
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
```

Filter it out before calling `getAllowance` or `approve`:

```typescript theme={null}
const NATIVE = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const tokensForApproval = tokens.filter(
  (t) => t.address.toLowerCase() !== NATIVE.toLowerCase()
);
```

## Next steps

* [Types reference](/sdk/reference/types) - Request/response interfaces
* [Errors reference](/sdk/reference/errors) - Status codes and error handling
