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

# executeWalletUpgrade

> Executes a wallet upgrade after the owner has signed the typed data from prepareWalletUpgrade.

<Warning>Server-only method. Requires API secret key.</Warning>

## Usage

```typescript theme={null}
const result = await sdk.executeWalletUpgrade(
  {
    walletAddress: "0x...",
    typedData: upgrade.typedData,
    signature: ["0xr", "0xs"],
  },
  bearerToken,
);
```

## Parameters

| Parameter       | Type        | Required | Description                                             |
| --------------- | ----------- | -------- | ------------------------------------------------------- |
| `walletAddress` | `string`    | Yes      | Wallet address being upgraded                           |
| `typedData`     | `TypedData` | Yes      | SNIP-12 typed data from `prepareWalletUpgrade`          |
| `signature`     | `string[]`  | Yes      | User signature over the typed data                      |
| `bearerToken`   | `string`    | No       | JWT token. Falls back to `apiSecretKey` if not provided |

## Return Value

Returns a `Promise<ExecuteWalletUpgradeResponse>`:

| Field             | Type         | Description                      |
| ----------------- | ------------ | -------------------------------- |
| `transactionHash` | `string`     | Transaction hash for the upgrade |
| `newClassHash`    | `string`     | New class hash after upgrade     |
| `newWalletType`   | `WalletType` | New wallet type after upgrade    |

## Example

See [`prepareWalletUpgrade`](/sdk/backend/methods/prepare-wallet-upgrade) for a complete upgrade flow.
