# SolanaAdapter

[SDK Reference](/developers/typescript-sdk/api.md) / SolanaAdapter

## SolanaAdapter

Solana Adapter for August SDK

### Classes

#### default

Solana Adapter for August SDK

**Example**

To access the Solana adapter instance

```
const sdk = new AugustSDK()
sdk.solana.getVaultState()
```

**Constructors**

**Constructor**

> **new default**(`endpoint`, `network`): [`default`](#default)

**Parameters**

| Parameter  | Type                      | Default value                 |
| ---------- | ------------------------- | ----------------------------- |
| `endpoint` | `` `https://${string}` `` | `undefined`                   |
| `network`  | `ISolanaNetwork`          | `SolanaUtils.fallbackNetwork` |

**Returns**

[`default`](#default)

**Accessors**

**connection**

**Get Signature**

> **get** **connection**(): `Connection`

**Returns**

`Connection`

**endpoint**

**Get Signature**

> **get** **endpoint**(): `` `https://${string}` ``

**Returns**

`` `https://${string}` ``

**network**

**Get Signature**

> **get** **network**(): `ISolanaNetwork`

**Returns**

`ISolanaNetwork`

**provider**

**Get Signature**

> **get** **provider**(): `AnchorProvider`

**Returns**

`AnchorProvider`

**Methods**

**fetchUserShareBalance()**

> **fetchUserShareBalance**(`publicKey`, `shareMint`): `Promise`<`any`>

**Parameters**

| Parameter   | Type                    |
| ----------- | ----------------------- |
| `publicKey` | `string` \| `PublicKey` |
| `shareMint` | `string` \| `PublicKey` |

**Returns**

`Promise`<`any`>

**fetchUserShareBalanceRaw()**

> **fetchUserShareBalanceRaw**(`publicKey`, `shareMint`): `Promise`<{ `amount`: `string`; `decimals`: `number` | `null`; }>

**Parameters**

| Parameter   | Type                    |
| ----------- | ----------------------- |
| `publicKey` | `string` \| `PublicKey` |
| `shareMint` | `string` \| `PublicKey` |

**Returns**

`Promise`<{ `amount`: `string`; `decimals`: `number` | `null`; }>

`decimals` is `null` when no token account exists, `tokenAmount` is missing from the parsed RPC response, an argument was omitted, or the RPC errored. Callers that need an `INormalizedNumber` must substitute a known decimals value (typically the deposit mint's decimals from backend metadata) before normalizing.

**fetchUserTokenBalance()**

> **fetchUserTokenBalance**(`publicKey`, `depositMint`): `Promise`<`any`>

**Parameters**

| Parameter     | Type                    |
| ------------- | ----------------------- |
| `publicKey`   | `string` \| `PublicKey` |
| `depositMint` | `string` \| `PublicKey` |

**Returns**

`Promise`<`any`>

**getProgram()**

> **getProgram**(`programIdl`): `Program`<`any`>

**Parameters**

| Parameter    | Type  |
| ------------ | ----- |
| `programIdl` | `any` |

**Returns**

`Program`<`any`>

**getProgramId()**

> **getProgramId**(`type`): `string`

**Parameters**

| Parameter | Type      |
| --------- | --------- |
| `type`    | `"vault"` |

**Returns**

`string`

**getToken()**

> **getToken**(`mintAddress`): `Promise`<{ `address`: `string`; `decimals`: `number`; `image`: `string`; `name`: `string`; `symbol`: `string`; }>

**Parameters**

| Parameter     | Type                    |
| ------------- | ----------------------- |
| `mintAddress` | `string` \| `PublicKey` |

**Returns**

`Promise`<{ `address`: `string`; `decimals`: `number`; `image`: `string`; `name`: `string`; `symbol`: `string`; }>

**getTokenSymbol()**

> **getTokenSymbol**(`mintAddress`): `Promise`<`string`>

**Parameters**

| Parameter     | Type                    |
| ------------- | ----------------------- |
| `mintAddress` | `string` \| `PublicKey` |

**Returns**

`Promise`<`string`>

**getVaultState()**

> **getVaultState**(`vaultProgramId`, `idl`, `vaultAddress?`): `Promise`<{ `depositMintDecimals`: `number`; `vaultState`: `unknown`; }>

**Parameters**

| Parameter        | Type                    |
| ---------------- | ----------------------- |
| `vaultProgramId` | `string` \| `PublicKey` |
| `idl`            | `any`                   |
| `vaultAddress?`  | `string` \| `PublicKey` |

**Returns**

`Promise`<{ `depositMintDecimals`: `number`; `vaultState`: `unknown`; }>

**getVaultStateReadOnly()**

> **getVaultStateReadOnly**(`vaultProgramId`, `idl`, `vaultAddress?`): `Promise`<{ `depositMintDecimals`: `number`; `vaultState`: `ISolanaVaultState`; }>

**Parameters**

| Parameter        | Type                    |
| ---------------- | ----------------------- |
| `vaultProgramId` | `string` \| `PublicKey` |
| `idl`            | `any`                   |
| `vaultAddress?`  | `string` \| `PublicKey` |

**Returns**

`Promise`<{ `depositMintDecimals`: `number`; `vaultState`: `ISolanaVaultState`; }>

**setWalletProvider()**

> **setWalletProvider**(`_publicKey`, `signTransaction`): `void`

**Parameters**

| Parameter         | Type                                   |
| ----------------- | -------------------------------------- |
| `_publicKey`      | `string` \| `PublicKey`                |
| `signTransaction` | <`T`>(`transaction`) => `Promise`<`T`> |

**Returns**

`void`

**vaultDeposit()**

> **vaultDeposit**(`vaultProgramId`, `idl`, `publicKey`, `depositAmount`, `sendTransaction`, `vaultAddress?`): `Promise`<`any`>

**Parameters**

| Parameter         | Type                                                             |
| ----------------- | ---------------------------------------------------------------- |
| `vaultProgramId`  | `string` \| `PublicKey`                                          |
| `idl`             | `any`                                                            |
| `publicKey`       | `string` \| `PublicKey`                                          |
| `depositAmount`   | `number`                                                         |
| `sendTransaction` | (`transaction`, `connection`, `options?`) => `Promise`<`string`> |
| `vaultAddress?`   | `string` \| `PublicKey`                                          |

**Returns**

`Promise`<`any`>

**vaultRedeem()**

> **vaultRedeem**(`vaultProgramId`, `idl`, `publicKey`, `redeemShares`, `sendTransaction`, `vaultAddress?`): `Promise`<`any`>

**Parameters**

| Parameter         | Type                                                             |
| ----------------- | ---------------------------------------------------------------- |
| `vaultProgramId`  | `string` \| `PublicKey`                                          |
| `idl`             | `any`                                                            |
| `publicKey`       | `string` \| `PublicKey`                                          |
| `redeemShares`    | `number`                                                         |
| `sendTransaction` | (`transaction`, `connection`, `options?`) => `Promise`<`string`> |
| `vaultAddress?`   | `string` \| `PublicKey`                                          |

**Returns**

`Promise`<`any`>

### Variables

#### Solana

> `const` **Solana**: `object`

**Type Declaration**

| Name                                  | Type                                                                                                                                        | Default value                                    |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `actions`                             | `__module`                                                                                                                                  | `SolanaActions`                                  |
| `constants`                           | `__module`                                                                                                                                  | `SolanaConstants`                                |
| `getters`                             | `__module`                                                                                                                                  | `SolanaGetters`                                  |
| `utils`                               | `object`                                                                                                                                    | `SolanaUtils`                                    |
| `utils.deriveShareMintPda()`          | (`vaultProgramId`) => `PublicKey`                                                                                                           | -                                                |
| `utils.deriveVaultStatePda()`         | (`vaultProgramId`) => `PublicKey`                                                                                                           | -                                                |
| `utils.deriveVaultTokenAtaPda()`      | (`vaultProgramId`, `depositMint`, `vaultVersion?`) => `PublicKey`                                                                           | -                                                |
| `utils.fallbackDecimals`              | `number`                                                                                                                                    | -                                                |
| `utils.fallbackNetwork`               | `ISolanaNetwork`                                                                                                                            | -                                                |
| `utils.fetchUserShareBalance()`       | (`__namedParameters`) => `Promise`<`any`>                                                                                                   | -                                                |
| `utils.fetchUserShareBalanceRaw()`    | (`__namedParameters`) => `Promise`<{ `amount`: `string`; `decimals`: `number` \| `null`; }>                                                 | -                                                |
| `utils.fetchUserTokenBalance()`       | (`__namedParameters`) => `Promise`<`any`>                                                                                                   | -                                                |
| `utils.getBestRpcEndpoint()`          | (`__namedParameters`) => `Promise`<`` `https://${string}` `` \| `"http://127.0.0.1:8899"`>                                                  | -                                                |
| `utils.getExplorerLink()`             | (`__namedParameters`) => `string`                                                                                                           | -                                                |
| `utils.getProgram()`                  | (`__namedParameters`) => `Program`<`any`>                                                                                                   | -                                                |
| `utils.getProvider()`                 | (`__namedParameters`) => `AnchorProvider`                                                                                                   | -                                                |
| `utils.getReadOnlyProvider()`         | (`__namedParameters`) => `AnchorProvider`                                                                                                   | -                                                |
| `utils.getToken()`                    | (`__namedParameters`) => `Promise`<{ `address`: `string`; `decimals`: `number`; `image`: `string`; `name`: `string`; `symbol`: `string`; }> | -                                                |
| `utils.getTokenSymbol()`              | (`__namedParameters`) => `Promise`<`string`>                                                                                                | -                                                |
| `utils.getVaultMints()`               | (`__namedParameters`) => `Promise`<{ `depositMint`: `string`; `shareMint`: `string`; `vaultVersion`: `number`; }>                           | -                                                |
| `utils.getVaultState()`               | (`__namedParameters`) => `Promise`<{ `depositMintDecimals`: `number`; `vaultState`: `unknown`; }>                                           | -                                                |
| `utils.getVaultStateReadOnly()`       | (`__namedParameters`) => `Promise`<{ `depositMintDecimals`: `number`; `vaultState`: `ISolanaVaultState`; }>                                 | -                                                |
| `utils.isSolana()`                    | (`signature`) => `boolean`                                                                                                                  | -                                                |
| `utils.isSolanaAddress()`             | (`address`) => `boolean`                                                                                                                    | -                                                |
| `utils.programIds`                    | `object`                                                                                                                                    | -                                                |
| `utils.programIds.devnet`             | `object`                                                                                                                                    | -                                                |
| `utils.programIds.devnet.vault`       | `string`                                                                                                                                    | `'7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq'` |
| `utils.programIds.localnet`           | `object`                                                                                                                                    | -                                                |
| `utils.programIds.localnet.vault`     | `string`                                                                                                                                    | `'7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq'` |
| `utils.programIds.mainnet-beta`       | `object`                                                                                                                                    | -                                                |
| `utils.programIds.mainnet-beta.vault` | `string`                                                                                                                                    | `'7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq'` |
| `utils.programIds.testnet`            | `object`                                                                                                                                    | -                                                |
| `utils.programIds.testnet.vault`      | `string`                                                                                                                                    | `'7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq'` |
| `utils.resolveProgramId()`            | (`vaultAddress`, `solanaMetadata?`) => `string`                                                                                             | -                                                |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augustdigital.io/developers/typescript-sdk/api/solanaadapter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
