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

# GridClient

Grid SDK client for account management, authentication, and transactions

## Example

```typescript theme={null}
import { GridClient } from '@sqds/grid';

const client = new GridClient({
  apiKey: 'your-api-key',
  environment: 'sandbox'
});

const state = client.account.get();
client.account.on('change', (state) => console.log('Changed:', state));
```

## Properties

| Property                         | Modifier    | Type                                                                                           |
| -------------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
| <a id="apiconfig" /> `apiConfig` | `protected` | [`GridApiConfig`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridApiConfig) |

## Accessors

### Account Management

#### account

##### Get Signature

```ts theme={null}
get account(): AccountManager;
```

Account manager for reactive state management

Provides access to account state and event subscriptions for reactive updates.
Subscribe to the 'change' event to receive notifications when the account state changes.

###### Example

```typescript theme={null}
client.account.on('change', (account) => {
  console.log('Account updated:', account);
});

const current = client.account.get();
console.log(current.accountAddress, current.isConnected);

client.account.set('account-address', 'grid-user-id');

client.account.disconnect();
```

###### Returns

`AccountManager`

## Methods

### Account Management

#### getAccount()

```ts theme={null}
getAccount(accountAddress): Promise<GetAccountResponse>;
```

Retrieves comprehensive account details including account type, policies,
signers, thresholds, and metadata.

##### Parameters

| Parameter        | Type     | Description                                     |
| ---------------- | -------- | ----------------------------------------------- |
| `accountAddress` | `string` | The account address to retrieve information for |

##### Returns

`Promise`\<[`GetAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetAccountResponse)>

Promise resolving to account details or error information

##### Example

```typescript theme={null}
const account = await gridClient.getAccount('account-address');
```

***

#### updateAccount()

```ts theme={null}
updateAccount(
   accountAddress,
   request,
admin?): Promise<TransactionResponse>;
```

Update account settings and configuration such as policies, signers, thresholds, and metadata.

##### Parameters

| Parameter        | Type                                                                                                         | Description                                                    |
| ---------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| `accountAddress` | `string`                                                                                                     | The account address to update                                  |
| `request`        | [`UpdateAccountRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UpdateAccountRequest) | Update request containing the fields to modify                 |
| `admin?`         | `boolean`                                                                                                    | Whether to perform the update with admin privileges (optional) |

##### Returns

`Promise`\<[`TransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionResponse)>

Promise resolving to transaction response for the update operation

##### Example

```typescript theme={null}
const updateTx = await gridClient.updateAccount(accountAddress, {
  policies: {
    threshold: 2
  }
});

const adminUpdateTx = await gridClient.updateAccount(
  accountAddress,
  { policies: { threshold: 1 } },
  true
);
```

***

#### getTransfers()

```ts theme={null}
getTransfers(accountAddress, options?): Promise<TransferResponse>;
```

Retrieves the transaction history for an account, including incoming and
outgoing transfers. Supports filtering by date range, token type, and pagination.

##### Parameters

| Parameter        | Type                                                                                                       | Description                               |
| ---------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `accountAddress` | `string`                                                                                                   | The account address to get transfers for  |
| `options?`       | [`GetTransfersOptions`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetTransfersOptions) | Optional filtering and pagination options |

##### Returns

`Promise`\<[`TransferResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransferResponse)>

Promise resolving to transfers response with transaction history

##### Example

```typescript theme={null}
const transfers = await gridClient.getTransfers(accountAddress);
```

***

#### getTransactions()

```ts theme={null}
getTransactions(accountAddress): Promise<GetTransactionsResponse>;
```

Retrieves the blockchain transaction history for an account

Returns a list of Solana blockchain transactions associated with the account,
including transaction signatures, statuses, and timestamps. This includes all
on-chain activity for the account.

##### Parameters

| Parameter        | Type     | Description                                 |
| ---------------- | -------- | ------------------------------------------- |
| `accountAddress` | `string` | The account address to get transactions for |

##### Returns

`Promise`\<[`GetTransactionsResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetTransactionsResponse)>

Promise resolving to transaction history response

##### Example

```typescript theme={null}
const response = await gridClient.getTransactions(accountAddress);
if (response.data?.transactions) {
  response.data.transactions.forEach(tx => {
    console.log(tx.signature, tx.status);
  });
}
```

### Authentication

#### initAuth()

```ts theme={null}
initAuth(request): Promise<InitAuthResponse>;
```

Initialize authentication for an existing user.
This is the first step in the authentication process.

<Note>
  Note: For new users, you must call createAccount first to create an account before initializing authentication. This method is only for authenticating existing users.
</Note>

##### Parameters

| Parameter | Type                                                                                                                                                                                                                    | Description                                                              |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `request` | \| [`InitAuthRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/InitAuthRequest) \| [`AuthenticationRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AuthenticationRequest) | Authentication request containing email, keypair, or passkey information |

##### Returns

`Promise`\<[`InitAuthResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/InitAuthResponse)>

Promise resolving to authentication initialization response with OTP details

##### Example

```typescript theme={null}
const response = await gridClient.initAuth({
  email: 'user@example.com'
});
```

***

#### completeAuth()

```ts theme={null}
completeAuth(request): Promise<CompleteAuthResponse>;
```

This is the second step in email-based authentication. Verifies the OTP
code received via email and establishes an authenticated session.

<Note>
  Note: For new users who need to create an account, use completeAuthAndCreateAccount instead, which completes authentication and creates the account in one step.
</Note>

##### Parameters

| Parameter | Type                                                                                                                     | Description                                                    |
| --------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| `request` | [`CompleteAuthRequestWithOtp`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthRequestWithOtp) | Complete authentication request with OTP code and user context |

##### Returns

`Promise`\<[`CompleteAuthResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthResponse)>

Promise resolving to authentication completion response with session data

##### Example

```typescript theme={null}
const sessionSecrets = await gridClient.generateSessionSecrets();
const response = await gridClient.completeAuth({
  otpCode: '123456',
  user: <user object received from initAuth>,
  sessionSecrets: sessionSecrets
});
```

***

#### completeAuthAndCreateAccount()

```ts theme={null}
completeAuthAndCreateAccount(request): Promise<CompleteAuthAndCreateAccountResponse>;
```

Complete authentication and create account (streamlined onboarding)

##### Parameters

| Parameter | Type                                                                                                                                       | Description                                  |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- |
| `request` | [`CompleteAuthAndCreateAccountRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthAndCreateAccountRequest) | Auth completion and account creation request |

##### Returns

`Promise`\<[`CompleteAuthAndCreateAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthAndCreateAccountResponse)>

Created account information

##### Example

```typescript theme={null}
const sessionSecrets = await gridClient.generateSessionSecrets();
const account = await gridClient.completeAuthAndCreateAccount({
  otpCode: '123456',
  user,
  sessionSecrets
});
```

***

#### refreshSession()

```ts theme={null}
refreshSession(request): Promise<RefreshSessionResponse>;
```

Refresh MPC provider session to extend lifetime

<Note>
  Note: Currently supports Privy only. Turnkey refresh not yet implemented.
</Note>

##### Parameters

| Parameter | Type                                                                                                           | Description             |
| --------- | -------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `request` | [`RefreshSessionRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionRequest) | Session refresh request |

##### Returns

`Promise`\<[`RefreshSessionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionResponse)>

Refreshed session data

##### Example

```typescript theme={null}
const refreshed = await gridClient.refreshSession({
  kmsPayload: { provider: 'privy', session: currentSession },
  encryptionPublicKey: encryptionKey
});
```

***

#### createAccount()

```ts theme={null}
createAccount(input): Promise<CreateAccountResponse>;
```

Creates either an email-based account (requires OTP verification)
or a signer-based account (immediately active).

##### Parameters

| Parameter | Type                                                                                                                                                                                                                          | Description                                                              |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `input`   | \| [`CreateAccountRequest`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/CreateAccountRequest) \| [`CreateAccountInput`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateAccountInput) | Account creation input (simplified) or full request object with policies |

##### Returns

`Promise`\<[`CreateAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/CreateAccountResponse)>

Promise resolving to created account information

<Note>
  Note: When passing AccountPolicies with signers, role defaults to 'primary' and provider defaults to 'external' if not specified.
</Note>

##### Examples

```typescript theme={null}
const emailAccount = await gridClient.createAccount({
  email: 'user@example.com'
});
```

```typescript theme={null}
const signerAccount = await gridClient.createAccount({
  signer: 'BKKjHs7kKsWFm8GKuFz3HzNKBjH4K4HhjhwxDHrRfKjj'
});
```

```typescript theme={null}
const signerAccount = await gridClient.createAccount({
  signers: [
    {
      address: 'BKKjHs7kKsWFm8GKuFz3HzNKBjH4K4HhjhwxDHrRfKjj',
      permissions: ['CAN_INITIATE', 'CAN_VOTE']
    }
  ],
  threshold: 1,
  timeLock: null,
  adminAddress: null
});
```

### Configuration

#### getConfig()

```ts theme={null}
getConfig(): GridApiConfig;
```

Get client configuration

##### Returns

[`GridApiConfig`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridApiConfig)

##### Example

```typescript theme={null}
const config = client.getConfig();
console.log(config.environment, config.baseUrl);
```

### KYC Verification

#### requestKycLink()

```ts theme={null}
requestKycLink(accountAddress, request): Promise<KycLinkResponse>;
```

Generates a link for Know Your Customer (KYC) identity verification.
Users complete the verification process through the provided link.

##### Parameters

| Parameter        | Type                                                                                                           | Description                                     |
| ---------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `accountAddress` | `string`                                                                                                       | The account address to associate with KYC       |
| `request`        | [`RequestKycLinkRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RequestKycLinkRequest) | KYC link request with verification requirements |

##### Returns

`Promise`\<[`KycLinkResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycLinkResponse)>

Promise resolving to KYC link response with verification URL

##### Example

```typescript theme={null}
const kycLink = await gridClient.requestKycLink(accountAddress, {
  gridUserId: user.gridUserId,
  type: 'individual',
  email: 'user@example.com',
  fullName: 'John Doe',
  endorsements: [],
  redirectUri: 'your-redirect-uri'
});
```

***

#### getKycStatus()

```ts theme={null}
getKycStatus(accountAddress, kycId): Promise<KycStatusResponse>;
```

Get KYC verification status

Retrieves the current status of a KYC verification process, including
completion status, verification level, and any required actions.

##### Parameters

| Parameter        | Type     | Description                             |
| ---------------- | -------- | --------------------------------------- |
| `accountAddress` | `string` | The account address associated with KYC |
| `kycId`          | `string` | The KYC verification identifier         |

##### Returns

`Promise`\<[`KycStatusResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycStatusResponse)>

Promise resolving to KYC status response

##### Example

```typescript theme={null}
const kycStatus = await gridClient.getKycStatus(accountAddress, kycId);
if (kycStatus.success) {
  console.log(kycStatus.data.status); / 'pending', 'approved', 'rejected'
  console.log(kycStatus.data.verificationLevel); / Verification tier achieved
}
```

### Key Management

#### generateSessionSecrets()

```ts theme={null}
generateSessionSecrets(): Promise<SessionSecrets>;
```

Generate session secrets for all supported providers

##### Returns

`Promise`\<`SessionSecrets`>

##### Example

```typescript theme={null}
const sessionSecrets = await gridClient.generateSessionSecrets();
```

### Other

#### extractSignableTransaction()

```ts theme={null}
extractSignableTransaction(transactionData): VersionedTransaction;
```

Extract a Solana VersionedTransaction ready to be signed using solana web3.js

##### Parameters

| Parameter         | Type                                                                                                     | Description                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `transactionData` | [`TransactionPayload`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionPayload) | Grid transaction response containing the transaction |

##### Returns

`VersionedTransaction`

Deserialized VersionedTransaction ready for signing

##### Example

```typescript theme={null}
const preparedTx = await gridClient.prepareArbitraryTransaction(accountAddress, prepareRequest);
const signableTransaction = gridClient.extractSignableTransaction(preparedTx);
```

***

#### setExternallySignedTransaction()

```ts theme={null}
setExternallySignedTransaction(transactionData, externallySignedTransaction): TransactionPayload;
```

Set an externally signed transaction into Grid transaction object so you can submit it via grid api.

##### Parameters

| Parameter                     | Type                                                                                                     | Description                     |
| ----------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `transactionData`             | [`TransactionPayload`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionPayload) | Original Grid transaction data  |
| `externallySignedTransaction` | `VersionedTransaction`                                                                                   | The signed VersionedTransaction |

##### Returns

[`TransactionPayload`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionPayload)

Updated Grid transaction response with signed transaction data

##### Example

```typescript theme={null}
transaction.sign([externalSigner]);

const signedTxData = gridClient.setExternallySignedTransaction(
  originalTxData,
  transaction
);
```

***

#### getAccountBalances()

```ts theme={null}
getAccountBalances(accountAddress, queryParams?): Promise<AccountBalancesResponse>;
```

Get account token balances

Retrieves the current token balances for an account, including both
native SOL and SPL token balances. Supports filtering and pagination.

##### Parameters

| Parameter        | Type                                                                                                                           | Description                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ |
| `accountAddress` | `string`                                                                                                                       | The account address to get balances for                |
| `queryParams?`   | [`GetAccountBalancesQueryParams`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetAccountBalancesQueryParams) | Optional query parameters for filtering and pagination |

##### Returns

`Promise`\<[`AccountBalancesResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountBalancesResponse)>

Promise resolving to account balances response

##### Example

```typescript theme={null}
const balances = await gridClient.getAccountBalances(accountAddress);
```

### Passkey Management

#### getPasskeys()

```ts theme={null}
getPasskeys(accountAddress): Promise<GetPasskeysResponse>;
```

Retrieves all passkeys for an account

##### Parameters

| Parameter        | Type     | Description                             |
| ---------------- | -------- | --------------------------------------- |
| `accountAddress` | `string` | The account address to get passkeys for |

##### Returns

`Promise`\<[`GetPasskeysResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeysResponse)>

Promise resolving to passkeys response with credential details

##### Example

```typescript theme={null}
const passkeys = await gridClient.getPasskeys(accountAddress);
```

***

#### addPasskey()

```ts theme={null}
addPasskey(
   accountAddress,
   request,
queryParams?): Promise<AddPasskeyResponse>;
```

Registers a new passkey for an account.

##### Parameters

| Parameter        | Type                                                                                                           | Description                                       |
| ---------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| `accountAddress` | `string`                                                                                                       | The account address to add the passkey to         |
| `request`        | [`AddPasskeyRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AddPasskeyRequest)         | Passkey registration request with credential data |
| `queryParams?`   | [`AddPasskeyQueryParams`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AddPasskeyQueryParams) | Optional query parameters for the registration    |

##### Returns

`Promise`\<[`AddPasskeyResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AddPasskeyResponse)>

Promise resolving to passkey addition response

##### Example

```typescript theme={null}
const passkeyResponse = await gridClient.addPasskey(accountAddress, {
  passkey: {
    address: "2W6cUhpELHYhTi3Cn6SmHfVhJFKgqmUJLJ5V2DQNcaXE",
    role: "secondary",
    permissions: ["CAN_INITIATE", "CAN_VOTE", "CAN_EXECUTE"]
  }
});
```

***

#### removePasskey()

```ts theme={null}
removePasskey(
   accountAddress,
   passkeyAddress,
   transactionSigners?,
queryParams?): Promise<RemovePasskeyResponse>;
```

Removes an existing passkey credential from an account, revoking its
ability to authorize transactions.

##### Parameters

| Parameter             | Type                                                                                                                 | Description                               |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `accountAddress`      | `string`                                                                                                             | The account address that owns the passkey |
| `passkeyAddress`      | `string`                                                                                                             | The address of the passkey to remove      |
| `transactionSigners?` | `string`\[]                                                                                                          | -                                         |
| `queryParams?`        | [`RemovePasskeyQueryParams`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RemovePasskeyQueryParams) | Optional query parameters for the removal |

##### Returns

`Promise`\<[`RemovePasskeyResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RemovePasskeyResponse)>

Promise resolving to passkey removal response

##### Example

```typescript theme={null}
const removeResponse = await gridClient.removePasskey(
  accountAddress,
  passkeyAddress
);
```

***

#### createPasskeyCredentials()

```ts theme={null}
createPasskeyCredentials(params): Promise<PasskeyCredentialData>;
```

Initiates the WebAuthn credential creation process, prompting the user
to register a new passkey using their device's authenticator (fingerprint,
face recognition, or security key).

##### Parameters

| Parameter | Type                                                                                             | Description                                                   |
| --------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
| `params`  | [`PasskeyRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyRequest) | Passkey creation parameters including challenge and user info |

##### Returns

`Promise`\<[`PasskeyCredentialData`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyCredentialData)>

Promise resolving to credential data with public key and credential ID

##### Example

```typescript theme={null}
const credentialData = await gridClient.createPasskeyCredentials({
  env: 'production',
  challenge: 'base64-encoded-challenge',
  slotNumber: '123',
  sessionKey: 'session-public-key-base58',
  expirationInSeconds: '3600',
  appName: 'My App',
  userId: 'user-identifier',
  redirectUrl: 'your-redirect-url'
});
```

Note: You can use extractPasskeyCreateParams to extract the parameters from the URL.

***

#### getPasskeyCredentials()

```ts theme={null}
getPasskeyCredentials(params, credentialData?): Promise<PasskeyAssertionResponse>;
```

Initiates the WebAuthn authentication process, prompting the user to
authenticate using their previously registered passkey.

##### Parameters

| Parameter         | Type                                                                                                           | Description                                           |
| ----------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `params`          | [`PasskeyRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyRequest)               | Passkey authentication parameters including challenge |
| `credentialData?` | [`PasskeyCredentialData`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyCredentialData) | Optional specific credential to authenticate with     |

##### Returns

`Promise`\<[`PasskeyAssertionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyAssertionResponse)>

Promise resolving to assertion response with signature and authentication data

##### Example

```typescript theme={null}
const assertion = await gridClient.getPasskeyCredentials({
  env: 'production',
  challenge: 'base64-encoded-challenge',
  slotNumber: '123',
  sessionKey: 'session-public-key-base58',
  expirationInSeconds: '3600',
  appName: 'My App',
  userId: 'user-identifier',
  redirectUrl: 'your-redirect-url'
});
console.log(assertion.response.signature);
```

Note: You can use extractPasskeyAuthParams to extract the parameters from the URL.

***

#### extractPasskeyCreateParams()

```ts theme={null}
extractPasskeyCreateParams(query): PasskeyRequest;
```

Parses URL search parameters to extract the necessary information
for passkey credential creation.

##### Parameters

| Parameter | Type              | Description                                                   |
| --------- | ----------------- | ------------------------------------------------------------- |
| `query`   | `URLSearchParams` | URLSearchParams object containing passkey creation parameters |

##### Returns

[`PasskeyRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyRequest)

Parsed passkey request object ready for credential creation

##### Example

```typescript theme={null}
const urlParams = new URLSearchParams(window.location.search);
const passkeyParams = gridClient.extractPasskeyCreateParams(urlParams);

const credentials = await gridClient.createPasskeyCredentials(passkeyParams);
```

***

#### extractPasskeyAuthParams()

```ts theme={null}
extractPasskeyAuthParams(query): PasskeyRequest;
```

Parses URL search parameters to extract the necessary information
for passkey authentication.

##### Parameters

| Parameter | Type              | Description                                                         |
| --------- | ----------------- | ------------------------------------------------------------------- |
| `query`   | `URLSearchParams` | URLSearchParams object containing passkey authentication parameters |

##### Returns

[`PasskeyRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyRequest)

Parsed passkey request object ready for authentication

##### Example

```typescript theme={null}
const urlParams = new URLSearchParams(window.location.search);
const authParams = gridClient.extractPasskeyAuthParams(urlParams);

const assertion = await gridClient.getPasskeyCredentials(authParams);
```

***

#### createPasskeyAccount()

```ts theme={null}
createPasskeyAccount(params, environment): Promise<CreatePasskeyAccountResponse>;
```

Creates both a passkey account (externally signed account) and smart account in one call.
This combines the passkey creation ceremony with smart account initialization.
Creates a 1/1 smart account with the passkey having full permissions.

##### Parameters

| Parameter     | Type                                                                                                                       | Description                                                                          |
| ------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| `params`      | [`CreatePasskeyAccountRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePasskeyAccountRequest) | Passkey account creation parameters including session key and authenticator response |
| `environment` | `string`                                                                                                                   | Target environment ('sandbox' or 'production')                                       |

##### Returns

`Promise`\<[`CreatePasskeyAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePasskeyAccountResponse)>

Promise resolving to the created smart account details including passkey info

##### Example

```typescript theme={null}
const sessionKeyObject = {
  key: sessionKeyPubkey,
  expiration: Date.now() + 900000
};

const account = await gridClient.createPasskeyAccount({
  sessionKey: sessionKeyObject,
  slotNumber: 123,
  authenticatorResponse: webauthnResponse,
  adminAddress: 'admin-public-key',
  memo: 'My passkey account'
}, 'sandbox');
console.log('Smart account address:', account.data.address);
console.log('Passkey account:', account.data.passkey.passkeyAccount);
console.log('Session key:', account.data.passkey.sessionKey);
```

### Passkey Sessions

#### createPasskeySession()

```ts theme={null}
createPasskeySession(params, environment): Promise<CreatePasskeySessionResponse>;
```

Initiates a new passkey authentication session, preparing the necessary
challenge and session data for WebAuthn authentication flow.

##### Parameters

| Parameter     | Type                          | Description                                    |
| ------------- | ----------------------------- | ---------------------------------------------- |
| `params`      | `CreatePasskeySessionRequest` | Passkey session creation parameters            |
| `environment` | `string`                      | Target environment ('sandbox' or 'production') |

##### Returns

`Promise`\<`CreatePasskeySessionResponse`>

Promise resolving to passkey session creation response

##### Example

```typescript theme={null}
await gridClient.createPasskeySession({
  action: 'create',
  sessionKey: 'session-public-key-base58',
  env: 'production',
}, 'production');
```

***

#### authorizePasskeySession()

```ts theme={null}
authorizePasskeySession(params, environment): Promise<AuthorizePasskeySessionResponse>;
```

Submits passkey authentication data to authorize an existing session,
completing the WebAuthn authentication flow.

##### Parameters

| Parameter     | Type                                                                                                                             | Description                                                       |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `params`      | [`AuthorizePasskeySessionRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AuthorizePasskeySessionRequest) | Passkey session authorization parameters with authentication data |
| `environment` | `string`                                                                                                                         | Target environment ('sandbox' or 'production')                    |

##### Returns

`Promise`\<[`AuthorizePasskeySessionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AuthorizePasskeySessionResponse)>

Promise resolving to session authorization response

##### Example

```typescript theme={null}
const authorization = await gridClient.authorizePasskeySession({
  sessionKey: 'public-key-base58',
  metaInfo: {
    appName: 'My App',
    redirectUrl: 'https:/myapp.com/callback'
  },
  baseUrl: 'base-url'
}, 'sandbox');
```

***

#### submitPasskeySession()

```ts theme={null}
submitPasskeySession(params, environment): Promise<SubmitPasskeySessionResponse>;
```

Finalizes a passkey authentication session, generating the final
session tokens and account access credentials.

##### Parameters

| Parameter     | Type                                                                                                                       | Description                                    |
| ------------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `params`      | [`SubmitPasskeySessionRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SubmitPasskeySessionRequest) | Passkey session submission parameters          |
| `environment` | `string`                                                                                                                   | Target environment ('sandbox' or 'production') |

##### Returns

`Promise`\<[`SubmitPasskeySessionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SubmitPasskeySessionResponse)>

Promise resolving to session submission response with account details

##### Example

```typescript theme={null}
const result = await gridClient.submitPasskeySession({
  authenticatorResponse: <attestationObject from getPasskeySession>,
  sessionKey: 'public-key-base58',
  ceremonyType: 'auth',
  slotNumber: 123
}, 'sandbox');
```

***

#### findPasskeyAccount()

```ts theme={null}
findPasskeyAccount(params, environment): Promise<FindPasskeyAccountResponse>;
```

Searches for an existing passkey account using credential information,
allowing users to recover access to their accounts.

##### Parameters

| Parameter     | Type                                                                                                                   | Description                                            |
| ------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `params`      | [`FindPasskeyAccountRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FindPasskeyAccountRequest) | Passkey account search parameters with credential data |
| `environment` | `string`                                                                                                               | Target environment ('sandbox' or 'production')         |

##### Returns

`Promise`\<[`FindPasskeyAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FindPasskeyAccountResponse)>

Promise resolving to found passkey account information

##### Example

```typescript theme={null}
const account = await gridClient.findPasskeyAccount({
  sessionKey: 'public-key-base58',
  authenticatorResponse: <attestationObject from getPasskeySession>
}, 'sandbox');
```

***

#### getPasskeyAccount()

```ts theme={null}
getPasskeyAccount(passkeyAddress, environment): Promise<GetPasskeyAccountResponse>;
```

Retrieves detailed information about a specific passkey account,
including relying party ID, public key, and optional session key if not expired.

##### Parameters

| Parameter        | Type     | Description                                                 |
| ---------------- | -------- | ----------------------------------------------------------- |
| `passkeyAddress` | `string` | The passkey account address (Solana public key) to retrieve |
| `environment`    | `string` | Target environment ('sandbox' or 'production')              |

##### Returns

`Promise`\<[`GetPasskeyAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeyAccountResponse)>

Promise resolving to passkey account details with relying party ID, public key, and optional session key

##### Example

```typescript theme={null}
const account = await gridClient.getPasskeyAccount(
  'passkey-account-address',
  'sandbox'
);
console.log(account.data.relyingPartyId);
console.log(account.data.pubkey);
if (account.data.sessionKey) {
  console.log('Session key:', account.data.sessionKey.key);
  console.log('Expires:', account.data.sessionKey.expiration);
}
```

### Payment Processing

#### createPaymentIntent()

```ts theme={null}
createPaymentIntent(accountAddress, request): Promise<CreatePaymentIntentResponse>;
```

Initiates a payment intent that allows users to deposit fiat currency
and receive cryptocurrency in their account. Handles the complete
fiat-to-crypto conversion process.

<Note>
  Note: Non-Enterprise customers must provide a `feeConfig` in the request.
</Note>

Enterprise customers may omit it as fees are handled by their plan.

##### Parameters

| Parameter        | Type                                                                                                                     | Description                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
| `accountAddress` | `string`                                                                                                                 | The account address to receive the converted crypto              |
| `request`        | [`CreatePaymentIntentRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePaymentIntentRequest) | Payment intent request with amount, currency, and payment method |

##### Returns

`Promise`\<[`CreatePaymentIntentResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePaymentIntentResponse)>

Promise resolving to payment intent response with transaction details

##### Example

```typescript theme={null}
const paymentIntent = await gridClient.createPaymentIntent(accountAddress, {
  amount: "100000",
  source: {
    account: accountAddress,
    currency: "usdc"
  },
  destination: {
    address: "3ciascNndLTBrDQXvs8nzZgWAiaL33tGM6fx3zzM7Fxt",
    currency: "usdc"
  },
  feeConfig: {
    currency: "usdc",
    payerAddress: accountAddress
  }
});
console.log(paymentIntent.data.paymentUrl);
```

### Proposal

#### createProposal()

```ts theme={null}
createProposal(accountAddress, request): Promise<CreateProposalResponse>;
```

Create a proposal

##### Parameters

| Parameter        | Type                                                                                                           | Description             |
| ---------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `accountAddress` | `string`                                                                                                       | Account address         |
| `request`        | [`CreateProposalRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateProposalRequest) | Create proposal request |

##### Returns

`Promise`\<[`CreateProposalResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateProposalResponse)>

Promise resolving to create proposal response

##### Example

```typescript theme={null}
const proposal = await client.createProposal(accountAddress, {
  transaction: 'base64-encoded-solana-transaction',
  signer: 'signer-pubkey',
  rentPayer: 'rent-payer-pubkey'
});
```

***

#### voteProposal()

```ts theme={null}
voteProposal(
   accountAddress,
   proposalAddress,
request): Promise<VoteProposalResponse>;
```

Vote on a proposal

Vote to approve, reject, or cancel a proposal on a smart account.

##### Parameters

| Parameter         | Type                                                                                                       | Description                                         |
| ----------------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `accountAddress`  | `string`                                                                                                   | Smart account address                               |
| `proposalAddress` | `string`                                                                                                   | Proposal address                                    |
| `request`         | [`VoteProposalRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VoteProposalRequest) | Vote proposal request containing signers and action |

##### Returns

`Promise`\<[`VoteProposalResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VoteProposalResponse)>

Promise resolving to vote proposal response with unsigned transaction

##### Example

```typescript theme={null}
const voteResult = await client.voteProposal(
  accountAddress,
  proposalAddress,
  {
    signers: ['signer-pubkey-1', 'signer-pubkey-2'],
    action: 'approve'
  }
);
console.log('Transaction:', voteResult.data.transaction);
console.log('Signers needed:', voteResult.data.transactionSigners);
```

***

#### executeProposal()

```ts theme={null}
executeProposal(
   accountAddress,
   proposalAddress,
request): Promise<ExecuteProposalResponse>;
```

Execute a proposal

Execute an approved proposal on a smart account.

Important:

* Signer must have CAN\_EXECUTE permission
* Proposal must be in Approved state
* Returns unsigned transaction with signatures
* The transactionSignatures array can contain multiple signatures

##### Parameters

| Parameter         | Type                                                                                                             | Description                          |
| ----------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| `accountAddress`  | `string`                                                                                                         | Smart account address                |
| `proposalAddress` | `string`                                                                                                         | Proposal address                     |
| `request`         | [`ExecuteProposalRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/ExecuteProposalRequest) | Execute proposal request with signer |

##### Returns

`Promise`\<[`ExecuteProposalResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/ExecuteProposalResponse)>

Promise resolving to execute proposal response with unsigned transaction

##### Example

```typescript theme={null}
const executeResult = await client.executeProposal(
  accountAddress,
  proposalAddress,
  { signer: 'executor-pubkey' }
);
console.log('Transaction:', executeResult.data.transaction);
console.log('Signatures:', executeResult.data.transactionSignatures);
```

### Spending Limits

#### createSpendingLimit()

```ts theme={null}
createSpendingLimit(smartAccountAddress, request): Promise<CreateSpendingLimitResponse>;
```

Creates a new spending limit.

##### Parameters

| Parameter             | Type                                                                                                         | Description                                                      |
| --------------------- | ------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
| `smartAccountAddress` | `string`                                                                                                     | The account address to create spending limit for                 |
| `request`             | [`SpendingLimitRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitRequest) | Spending limit configuration including amount, token, and period |

##### Returns

`Promise`\<[`CreateSpendingLimitResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateSpendingLimitResponse)>

Promise resolving to transaction response for spending limit creation

##### Example

```typescript theme={null}
const spendingLimitTx = await gridClient.createSpendingLimit(accountAddress, {
  amount: 10000000,
  mint: '4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU',
  period: 'daily',
  spendingLimitSigners: ['limit-signer-address']
});
```

***

#### updateSpendingLimit()

```ts theme={null}
updateSpendingLimit(
   accountAddress,
   spendingLimitAddress,
request): Promise<SpendingLimitTransactionResponse>;
```

Modifies the parameters of an existing spending limit, such as the amount,
time period, or associated signers.

##### Parameters

| Parameter              | Type                                                                                                                     | Description                                       |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- |
| `accountAddress`       | `string`                                                                                                                 | The account address that owns the spending limit  |
| `spendingLimitAddress` | `string`                                                                                                                 | The address of the spending limit to update       |
| `request`              | [`UpdateSpendingLimitRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UpdateSpendingLimitRequest) | Update request with new spending limit parameters |

##### Returns

`Promise`\<[`SpendingLimitTransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitTransactionResponse)>

Promise resolving to transaction response for the update

##### Example

```typescript theme={null}
const updateTx = await gridClient.updateSpendingLimit(
  amount: "5000000",
  spendingLimitSigners: ['signer-address']
);
```

***

#### deleteSpendingLimit()

```ts theme={null}
deleteSpendingLimit(accountAddress, spendingLimitAddress): Promise<SpendingLimitTransactionResponse>;
```

Delete a spending limit

Removes an existing spending limit from an account, allowing unrestricted
spending for the associated token type.

##### Parameters

| Parameter              | Type     | Description                                      |
| ---------------------- | -------- | ------------------------------------------------ |
| `accountAddress`       | `string` | The account address that owns the spending limit |
| `spendingLimitAddress` | `string` | The address of the spending limit to delete      |

##### Returns

`Promise`\<[`SpendingLimitTransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitTransactionResponse)>

Promise resolving to transaction response for the deletion

##### Example

```typescript theme={null}
const deleteTx = await gridClient.deleteSpendingLimit(
  accountAddress,
  spendingLimitAddress
);
```

***

#### useSpendingLimit()

```ts theme={null}
useSpendingLimit(
   accountAddress,
   spendingLimitAddress,
request): Promise<SpendingLimitTransactionResponse>;
```

Use a spending limit for a transaction

Utilizes an existing spending limit to authorize a transaction, automatically
checking that the transaction amount is within the limit constraints.

##### Parameters

| Parameter              | Type                                                                                                               | Description                                                 |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------- |
| `accountAddress`       | `string`                                                                                                           | The account address that owns the spending limit            |
| `spendingLimitAddress` | `string`                                                                                                           | The address of the spending limit to use                    |
| `request`              | [`UseSpendingLimitRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UseSpendingLimitRequest) | Transaction request to authorize against the spending limit |

##### Returns

`Promise`\<[`SpendingLimitTransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitTransactionResponse)>

Promise resolving to transaction response for the authorized transaction

##### Example

```typescript theme={null}
const limitTx = await gridClient.useSpendingLimit(
  accountAddress,
  spendingLimitAddress,
  {
    amount: 500000000,
    signerAddress: "signer-address",
    recipientAddress: "recipient-address"
  }
);
```

***

#### getSpendingLimit()

```ts theme={null}
getSpendingLimit(accountAddress, spendingLimitAddress): Promise<SpendingLimitResponse>;
```

Retrieves a spending limit by its address

##### Parameters

| Parameter              | Type     | Description                                      |
| ---------------------- | -------- | ------------------------------------------------ |
| `accountAddress`       | `string` | The account address that owns the spending limit |
| `spendingLimitAddress` | `string` | The address of the spending limit to retrieve    |

##### Returns

`Promise`\<[`SpendingLimitResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitResponse)>

Promise resolving to spending limit data

##### Example

```typescript theme={null}
const spendingLimit = await gridClient.getSpendingLimit(
  accountAddress,
  spendingLimitAddress
);
console.log(spendingLimit.amount);
console.log(spendingLimit.remainingAmount);
```

***

#### getSpendingLimits()

```ts theme={null}
getSpendingLimits(accountAddress): Promise<SpendingLimitsResponse>;
```

Retrieves all spending limits for an account

##### Parameters

| Parameter        | Type     | Description                                    |
| ---------------- | -------- | ---------------------------------------------- |
| `accountAddress` | `string` | The account address to get spending limits for |

##### Returns

`Promise`\<[`SpendingLimitsResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitsResponse)>

Promise resolving to array of spending limit data

##### Example

```typescript theme={null}
const limits = await gridClient.getSpendingLimits(accountAddress);
limits.forEach(limit => {
  console.log(`Limit: ${limit.amount}, Remaining: ${limit.remainingAmount}`);
});
```

### Standing Orders

#### createStandingOrder()

```ts theme={null}
createStandingOrder(accountAddress, request): Promise<CreateStandingOrderResponse>;
```

Create a standing order.

##### Parameters

| Parameter        | Type                                                                                                                     | Description                                               |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| `accountAddress` | `string`                                                                                                                 | The account address that will make the recurring payments |
| `request`        | [`CreateStandingOrderRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateStandingOrderRequest) | Standing order request with payment details and schedule  |

##### Returns

`Promise`\<[`CreateStandingOrderResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateStandingOrderResponse)>

Promise resolving to standing order creation response

##### Example

```typescript theme={null}
const standingOrder = await gridClient.createStandingOrder(accountAddress, {
  amount: "500000",
  gridUserId: "grid-user-id",
  source: {
    account: "source-address",
    currency: "usdc"
  },
  destination: {
    address: "destination-address",
    currency: "usdc"
  },
  frequency: "weekly",
  startDate: "2024-12-02T10:00:00Z",
  endDate: "2025-12-31T23:59:59Z"
});
```

***

#### getStandingOrders()

```ts theme={null}
getStandingOrders(accountAddress, queryParams?): Promise<StandingOrdersResponse>;
```

Retrieves all standing orders associated with an account, including
active, paused, and completed recurring payment schedules.

##### Parameters

| Parameter        | Type                                                                                                                         | Description                                            |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `accountAddress` | `string`                                                                                                                     | The account address to get standing orders for         |
| `queryParams?`   | [`GetStandingOrdersQueryParams`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetStandingOrdersQueryParams) | Optional query parameters for filtering and pagination |

##### Returns

`Promise`\<[`StandingOrdersResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/StandingOrdersResponse)>

Promise resolving to standing orders response

##### Example

```typescript theme={null}
const standingOrders = await gridClient.getStandingOrders(accountAddress);
```

***

#### getStandingOrder()

```ts theme={null}
getStandingOrder(accountAddress, standingOrderId): Promise<StandingOrderResponse>;
```

Retrieves detailed information about a specific standing order,
including its current status, execution history, and next payment date.

##### Parameters

| Parameter         | Type     | Description                                      |
| ----------------- | -------- | ------------------------------------------------ |
| `accountAddress`  | `string` | The account address that owns the standing order |
| `standingOrderId` | `string` | The unique identifier of the standing order      |

##### Returns

`Promise`\<[`StandingOrderResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/StandingOrderResponse)>

Promise resolving to standing order details response

##### Example

```typescript theme={null}
const order = await gridClient.getStandingOrder(accountAddress, orderId);
```

### Transaction Processing

#### prepareArbitraryTransaction()

```ts theme={null}
prepareArbitraryTransaction(
   accountAddress,
   request,
queryParams?): Promise<TransactionResponse>;
```

Prepares any Solana transaction for signing by adding necessary account
metadata, fee calculations, and smart account integration.

##### Parameters

| Parameter        | Type                                                                                                                                             | Description                                              |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| `accountAddress` | `string`                                                                                                                                         | The account address that will sign the transaction       |
| `request`        | [`PrepareArbitraryTransactionRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PrepareArbitraryTransactionRequest)         | Transaction preparation request with the raw transaction |
| `queryParams?`   | [`PrepareArbitraryTransactionQueryParams`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PrepareArbitraryTransactionQueryParams) | Optional query parameters for transaction preparation    |

##### Returns

`Promise`\<[`TransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionResponse)>

Promise resolving to prepared transaction response ready for signing

##### Example

```typescript theme={null}
const preparedTx = await gridClient.prepareArbitraryTransaction(accountAddress, {
  transaction: 'base64-encoded-solana-transaction'
});

const signedTx = await gridClient.sign({
  sessionSecrets: sessionSecrets,
  transactionPayload: preparedTx
});
```

### Transaction Signing

#### sign()

```ts theme={null}
sign(request): Promise<TransactionResult>;
```

Automatically selects the appropriate authentication provider based on the
session context and available session secrets.

##### Parameters

| Parameter | Type                                                                                       | Description                                                     |
| --------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
| `request` | [`SignRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SignRequest) | Sign request containing transaction payload and session secrets |

##### Returns

`Promise`\<[`TransactionResult`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionResult)>

Promise resolving to transaction result with signatures and metadata

##### Example

```typescript theme={null}
const authResult = await gridClient.completeAuth(payload);
const preparedTx = await gridClient.prepareArbitraryTransaction(accountAddress, {
  transaction: 'base64-encoded-transaction'
});

const signResult = await gridClient.sign({
  sessionSecrets: sessionSecrets,
  transactionPayload: preparedTx,
  session: authResult.authentication
});
```

***

#### signAndSend()

```ts theme={null}
signAndSend(request): Promise<TransactionSubmissionResponse>;
```

Sign and send a transaction. Automatically selects the appropriate authentication provider based on the
session context and available session secrets

##### Parameters

| Parameter | Type                                                                                                     | Description                                                              |
| --------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `request` | [`SignAndSendRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SignAndSendRequest) | Sign and send request containing transaction payload and session secrets |

##### Returns

`Promise`\<[`TransactionSubmissionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionSubmissionResponse)>

Promise resolving to transaction submission result with blockchain signature

##### Example

```typescript theme={null}
const authResult = await gridClient.completeAuth(payload);
const preparedTx = await gridClient.prepareArbitraryTransaction(accountAddress, {
  transaction: 'base64-encoded-transaction'
});

const result = await gridClient.signAndSend({
  sessionSecrets: sessionSecrets,
  transactionPayload: preparedTx,
  session: authResult.authentication,
  address: accountAddress
});

```

***

#### send()

```ts theme={null}
send(request): Promise<TransactionSubmissionResponse>;
```

Submits a previously signed transaction to the Solana blockchain through
the Grid API.

##### Parameters

| Parameter | Type                                                                                                             | Description                                                        |
| --------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `request` | [`SendTransactionRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SendTransactionRequest) | Send request containing the signed transaction and account address |

##### Returns

`Promise`\<[`TransactionSubmissionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionSubmissionResponse)>

Promise resolving to transaction submission result with signature

##### Example

```typescript theme={null}
const signedTx = await gridClient.sign({ ... });
const result = await gridClient.send({
  signedTransactionPayload: signedTx,
  address: 'account-address'
});
```

### Utilities

#### getSessionKeyObject()

```ts theme={null}
getSessionKeyObject(sessionKeyString, expirationInSeconds): SessionKey;
```

Helper function to create session key object from string and expiration

##### Parameters

| Parameter             | Type     | Description                                       |
| --------------------- | -------- | ------------------------------------------------- |
| `sessionKeyString`    | `string` | Base58-encoded session key string                 |
| `expirationInSeconds` | `string` | Expiration time as a string (seconds since epoch) |

##### Returns

[`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey)

SessionKey object with decoded key bytes and parsed expiration

##### Example

```typescript theme={null}
const sessionKey = gridClient.getSessionKeyObject(
  'base58-encoded-key',
  '900'
);
```

***

#### getEnvironment()

```ts theme={null}
getEnvironment(): "sandbox" | "production";
```

Get the current environment configuration

Returns the environment the SDK is configured to use.
This is useful for determining which network (devnet/mainnet) operations are targeting.

##### Returns

`"sandbox"` | `"production"`

The current environment ('sandbox' for devnet, 'production' for mainnet)

##### Example

```typescript theme={null}
const env = gridClient.getEnvironment();
console.log(env); / 'sandbox' or 'production'
```

### Virtual Accounts

#### requestVirtualAccount()

```ts theme={null}
requestVirtualAccount(accountAddress, request): Promise<VirtualAccountResponse>;
```

Creates a virtual bank account that allows users to receive fiat deposits
which are automatically converted to cryptocurrency in their Grid account.

##### Parameters

| Parameter        | Type                                                                                                                         | Description                                                  |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| `accountAddress` | `string`                                                                                                                     | The account address to associate with the virtual account    |
| `request`        | [`RequestVirtualAccountRequest`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RequestVirtualAccountRequest) | Virtual account request with banking details and preferences |

##### Returns

`Promise`\<[`VirtualAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VirtualAccountResponse)>

Promise resolving to virtual account response with banking details

##### Example

```typescript theme={null}
const virtualAccount = await gridClient.requestVirtualAccount(accountAddress, {
  gridUserId: 'grid-user-id',
  currency: 'usd' as const
});
```

***

#### getVirtualAccounts()

```ts theme={null}
getVirtualAccounts(accountAddress, queryParams?): Promise<VirtualAccountsResponse>;
```

Retrieves all virtual bank accounts associated with a Grid account,
including their status, balances, and transaction history.

##### Parameters

| Parameter        | Type                                                                                                                           | Description                                            |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ |
| `accountAddress` | `string`                                                                                                                       | The account address to get virtual accounts for        |
| `queryParams?`   | [`GetVirtualAccountsQueryParams`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetVirtualAccountsQueryParams) | Optional query parameters for filtering and pagination |

##### Returns

`Promise`\<[`VirtualAccountsResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VirtualAccountsResponse)>

Promise resolving to virtual accounts response

##### Example

```typescript theme={null}
const virtualAccounts = await gridClient.getVirtualAccounts(accountAddress);
```
