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

# getSponsorAddress

> Reads the address that signs as fee payer for sponsored Solana transactions in your environment

## Function Signature

```typescript theme={"system"}
getSponsorAddress(params?: {
  traceContext?: TraceContext;
}): Promise<string>
```

## Description

Returns the address that signs as fee payer for sponsored Solana transactions in your environment. Use it to build transactions that already name the sponsor as fee payer, for example by passing it to a swap API such as LI.FI as `svmSponsor`, before you pass the transaction to [`sponsorTransaction()`](https://www.dynamic.xyz/docs/node/reference/svm/sponsor-transaction).

Gas sponsorship must be enabled for your environment in the Dynamic Console before calling this method. The method needs `@dynamic-labs-wallet/node-svm` version 1.1.64 or later.

## Parameters

### Optional Parameters

* **`traceContext`** (`TraceContext`): Distributed tracing context for observability.

## Returns

**`Promise<string>`**: The sponsor's Solana address as a base58 string.

## Example

```typescript theme={"system"}
import { DynamicSvmWalletClient } from '@dynamic-labs-wallet/node-svm';

const svmClient = await authenticatedSvmClient();

const sponsorAddress = await svmClient.getSponsorAddress();
```

## Error Handling

The method throws when gas sponsorship is not enabled for the environment:

```typescript theme={"system"}
try {
  const sponsorAddress = await svmClient.getSponsorAddress();
} catch (error) {
  if (error.message.includes('400')) {
    console.error('Gas sponsorship is not enabled for this environment');
  } else {
    console.error('Could not read the sponsor address:', error.message);
  }
}
```

## Related

* [`sponsorTransaction()`](https://www.dynamic.xyz/docs/node/reference/svm/sponsor-transaction): Sponsor a transaction, optionally for an end user
* [SVM Server-Controlled Sponsorship](https://www.dynamic.xyz/docs/recipes/integrations/svm-server-controlled-sponsorship.md): Build and validate the transaction on your backend before sponsoring it


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.