# Get apigridv1accounts
Source: https://developers.squads.so/api-reference/accounts/get-apigridv1accounts
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}
# Get apigridv1accounts balances
Source: https://developers.squads.so/api-reference/accounts/get-apigridv1accounts-balances
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/balances
# Get apigridv1accounts transfers
Source: https://developers.squads.so/api-reference/accounts/get-apigridv1accounts-transfers
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/transfers
# Patch apigridv1accounts
Source: https://developers.squads.so/api-reference/accounts/patch-apigridv1accounts
https://grid.squads.xyz/api-docs/openapi.json patch /api/grid/v1/accounts/{address}
# Post apigridv1accounts
Source: https://developers.squads.so/api-reference/accounts/post-apigridv1accounts
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts
# Post apigridv1accounts:custom
Source: https://developers.squads.so/api-reference/accounts/post-apigridv1accounts:custom
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts:custom
# Post apigridv1accountsverify
Source: https://developers.squads.so/api-reference/accounts/post-apigridv1accountsverify
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/verify
# Post apigridv1authrefresh session
Source: https://developers.squads.so/api-reference/accounts/post-apigridv1authrefresh-session
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/auth/refresh-session
# Initiate email authentication
Source: https://developers.squads.so/api-reference/auth/initiate-email-authentication
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/auth
Start the authentication process by sending an OTP to the provided email address. Includes automatic provider fallback: if the requested provider (default: Privy) is unavailable or times out, the endpoint falls back to the alternate provider. When a fallback occurs, the response includes `requested_provider` (the originally requested provider) and `fallback_reason` (`timeout` or `provider_error`).
# Verify OTP and complete authentication
Source: https://developers.squads.so/api-reference/auth/verify-otp-and-complete-authentication
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/auth/verify
Complete the authentication process by verifying the OTP code
# Accept Terms of Service
Source: https://developers.squads.so/api-reference/compliance/accept-terms-of-service
https://grid.squads.xyz/api-docs/openapi.json post /api/compliance/v1/entities/{id}/tos
Accepts the Terms of Service for an entity across all configured providers. Records client IP, user agent, and acceptance method for audit compliance. If KYB is already approved, auto-distribution to providers is triggered.
# Attach existing approved Bridge customer to an entity
Source: https://developers.squads.so/api-reference/compliance/attach-existing-approved-bridge-customer-to-an-entity
https://grid.squads.xyz/api-docs/openapi.json post /api/compliance/v1/entities/{id}/providers/bridge/import
Creates or updates the Bridge provider submission for an entity's compliance submission using an existing Bridge external_id. Marks the Bridge provider submission as approved and keeps the operation idempotent.
# Create a compliance entity
Source: https://developers.squads.so/api-reference/compliance/create-a-compliance-entity
https://grid.squads.xyz/api-docs/openapi.json post /api/compliance/v1/entities
Creates a new compliance entity for KYB/KYC verification. Use `?include=providers` to include provider details in the response.
# Create entity from existing Sumsub applicant
Source: https://developers.squads.so/api-reference/compliance/create-entity-from-existing-sumsub-applicant
https://grid.squads.xyz/api-docs/openapi.json post /api/compliance/v1/entities/import-sumsub
Creates or resolves a compliance entity from an existing Sumsub applicant ID. This operation is idempotent for applicant/customer/environment combinations and can include provider details with `?include=providers`.
# Generate KYB verification link
Source: https://developers.squads.so/api-reference/compliance/generate-kyb-verification-link
https://grid.squads.xyz/api-docs/openapi.json get /api/compliance/v1/entities/{id}/kyb-link
Generates a Sumsub WebSDK verification link for the entity. The link expires after 30 days. An optional redirect URL can be provided for post-completion navigation.
# Get a compliance entity
Source: https://developers.squads.so/api-reference/compliance/get-a-compliance-entity
https://grid.squads.xyz/api-docs/openapi.json get /api/compliance/v1/entities/{id}
Retrieves a compliance entity by ID. Use `?include=providers` to include per-provider verification details in the response.
# Get KYB verification status
Source: https://developers.squads.so/api-reference/compliance/get-kyb-verification-status
https://grid.squads.xyz/api-docs/openapi.json get /api/compliance/v1/entities/{id}/kyb
Returns the overall KYB verification status for an entity, including per-provider status breakdowns and Sumsub approval details.
# Get TOS acceptance status
Source: https://developers.squads.so/api-reference/compliance/get-tos-acceptance-status
https://grid.squads.xyz/api-docs/openapi.json get /api/compliance/v1/entities/{id}/tos
Returns the Terms of Service acceptance status for an entity across all configured providers, including version comparisons and acceptance timestamps.
# List compliance entities
Source: https://developers.squads.so/api-reference/compliance/list-compliance-entities
https://grid.squads.xyz/api-docs/openapi.json get /api/compliance/v1/entities
Returns a paginated list of compliance entities for the authenticated customer. Supports filtering by external ID.
# List Requests for Information
Source: https://developers.squads.so/api-reference/compliance/list-requests-for-information
https://grid.squads.xyz/api-docs/openapi.json get /api/compliance/v1/entities/{id}/rfis
Returns a paginated list of RFIs (Requests for Information) issued by providers for an entity. RFIs indicate additional data is needed to complete verification.
# Post apicompliancev1entities distribute
Source: https://developers.squads.so/api-reference/compliance/post-apicompliancev1entities-distribute
https://grid.squads.xyz/api-docs/openapi.json post /api/compliance/v1/entities/{id}/distribute
# Update a compliance entity
Source: https://developers.squads.so/api-reference/compliance/update-a-compliance-entity
https://grid.squads.xyz/api-docs/openapi.json patch /api/compliance/v1/entities/{id}
Updates one or more fields on an existing compliance entity. At least one of name, email, or external_id must be provided.
# Create an external account
Source: https://developers.squads.so/api-reference/external-accounts/create-an-external-account
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/external-accounts
Create canonical external account details and map to provider accounts
# Delete an external account
Source: https://developers.squads.so/api-reference/external-accounts/delete-an-external-account
https://grid.squads.xyz/api-docs/openapi.json delete /api/grid/v1/accounts/{address}/external-accounts/{account_id}
Soft deletes a single external account by ID
# Get an external account
Source: https://developers.squads.so/api-reference/external-accounts/get-an-external-account
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/external-accounts/{account_id}
Retrieve a single external account by ID
# List external accounts
Source: https://developers.squads.so/api-reference/external-accounts/list-external-accounts
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/external-accounts
List all external accounts linked to a smart account
# Get apigridv1accounts kyc
Source: https://developers.squads.so/api-reference/kyc/get-apigridv1accounts-kyc
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/kyc/{kyc_id}
# Post apigridv1accounts kyc
Source: https://developers.squads.so/api-reference/kyc/post-apigridv1accounts-kyc
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/kyc
# Authorize passkey session
Source: https://developers.squads.so/api-reference/passkeys/authorize-passkey-session
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/passkeys/auth
Authorize and refresh a passkey session. Requires a session key and returns a URL for session authorization flow with a challenge for session refresh.
# Create passkey session
Source: https://developers.squads.so/api-reference/passkeys/create-passkey-session
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/passkeys
Initiate a new passkey creation session. Returns a URL for the passkey creation flow with challenge and session parameters.
# Create smart account with passkey
Source: https://developers.squads.so/api-reference/passkeys/create-smart-account-with-passkey
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/passkeys/account
Create a new smart account with a passkey as the initial signer. The passkey account must already exist (created via POST /passkeys and POST /passkeys/submit). This creates a 1/1 smart account with the passkey having full permissions.
# Find passkey account
Source: https://developers.squads.so/api-reference/passkeys/find-passkey-account
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/passkeys/find
Find a passkey account using authenticator response. Returns the passkey account address and session key.
# Get passkey account
Source: https://developers.squads.so/api-reference/passkeys/get-passkey-account
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/passkeys/account/{passkey_account_address}
Retrieve passkey account details by address. Returns the relying party ID, public key, and optional session key if not expired.
# Get passkey information
Source: https://developers.squads.so/api-reference/passkeys/get-passkey-information
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/passkeys
Retrieve passkey information for a smart account
# Get passkey session
Source: https://developers.squads.so/api-reference/passkeys/get-passkey-session
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/passkeys/find
Retrieve existing passkey session information. Returns a session URL with challenge for passkey lookup.
# Post apigridv1accounts passkeystransaction
Source: https://developers.squads.so/api-reference/passkeys/post-apigridv1accounts-passkeystransaction
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/passkeys/transaction
# Remove a passkey from a smart account
Source: https://developers.squads.so/api-reference/passkeys/remove-a-passkey-from-a-smart-account
https://grid.squads.xyz/api-docs/openapi.json delete /api/grid/v1/accounts/{address}/passkeys/{passkey_address}/transaction
Generate a transaction to remove a passkey from a smart account. Supports both admin and multi-signature authorization.
# Submit passkey session
Source: https://developers.squads.so/api-reference/passkeys/submit-passkey-session
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/passkeys/submit
Submit passkey ceremony data (create or auth) to initialize or refresh a passkey account. Returns the passkey account address, session key, and optionally a smart account if the passkey is a signer on one.
# Create a payment intent
Source: https://developers.squads.so/api-reference/payments/create-a-payment-intent
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/payment-intent
Create a payment intent for transferring funds between accounts and external payment rails
# Create a payment intent (v2)
Source: https://developers.squads.so/api-reference/payments/create-a-payment-intent-v2
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/payment-intents
Create a provider-agnostic payment intent using a flat action shape.
Supported matrix:
- source: Grid account funding leg
- destination: synced external account for the internally selected provider
- rails: `SWIFT` destination rail
Action fields are top-level and stable across modes:
- `deposit`: funding instructions (address or bank fields)
- `sign_prebuilt_tx`: transaction to sign and broadcast
- `next_action`: optional follow-up hint for multi-step flows
# Create a payment intent (v2)
Source: https://developers.squads.so/api-reference/payments/create-a-payment-intent-v2-1
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v2/accounts/{address}/payment-intents
Versioned payment intent endpoint for integrations. Uses provider-agnostic request/response shapes with flat action fields.
# Get a payment intent (v2)
Source: https://developers.squads.so/api-reference/payments/get-a-payment-intent-v2
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v2/accounts/{address}/payment-intents/{payment_intent_id}
Fetches a payment intent by ID from the internally selected provider and returns the same normalized v2 response shape.
# Get a specific proposal
Source: https://developers.squads.so/api-reference/proposals/get-a-specific-proposal
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/proposals/{proposal_address}
Retrieve details for a specific proposal on a smart account
# List all proposals for an account
Source: https://developers.squads.so/api-reference/proposals/list-all-proposals-for-an-account
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/proposals
Retrieve all proposals for a smart account with optional filtering and pagination
# Post apigridv1accounts proposals
Source: https://developers.squads.so/api-reference/proposals/post-apigridv1accounts-proposals
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/proposals
# Post apigridv1accounts proposals vote and execute
Source: https://developers.squads.so/api-reference/proposals/post-apigridv1accounts-proposals-vote-and-execute
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/proposals/{proposal_address}/vote-and-execute
# Vote on a proposal
Source: https://developers.squads.so/api-reference/proposals/vote-on-a-proposal
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/proposals/{proposal_address}/vote
Vote to approve, reject, or cancel a proposal on a smart account
# Create a spending limit
Source: https://developers.squads.so/api-reference/spending-limits/create-a-spending-limit
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/spending-limit
Create a new spending limit for a smart account with specified amount, period, and destinations
# Delete a spending limit
Source: https://developers.squads.so/api-reference/spending-limits/delete-a-spending-limit
https://grid.squads.xyz/api-docs/openapi.json delete /api/grid/v1/accounts/{address}/spending-limit/{spending_limit_address}
Delete an existing spending limit from a smart account
# Get a specific spending limit
Source: https://developers.squads.so/api-reference/spending-limits/get-a-specific-spending-limit
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/spending-limit/{spending_limit_address}
Retrieve details of a specific spending limit by its address
# Get all spending limits for an account
Source: https://developers.squads.so/api-reference/spending-limits/get-all-spending-limits-for-an-account
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/spending-limits
Retrieve all spending limits for a smart account with optional filtering
# Update a spending limit
Source: https://developers.squads.so/api-reference/spending-limits/update-a-spending-limit
https://grid.squads.xyz/api-docs/openapi.json patch /api/grid/v1/accounts/{address}/spending-limit/{spending_limit_address}
Update an existing spending limit with new parameters
# Use a spending limit to transfer tokens
Source: https://developers.squads.so/api-reference/spending-limits/use-a-spending-limit-to-transfer-tokens
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/spending-limit/{spending_limit_address}/transactions
Execute a transaction using an existing spending limit
# Create a standing order intent
Source: https://developers.squads.so/api-reference/standing-orders/create-a-standing-order-intent
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/standing-order-intent
Create a new standing order for recurring payments from a smart account
# Delete a standing order
Source: https://developers.squads.so/api-reference/standing-orders/delete-a-standing-order
https://grid.squads.xyz/api-docs/openapi.json delete /api/grid/v1/accounts/{address}/standing-order/{standing_order_id}
Cancel an existing standing order
# Get a standing order
Source: https://developers.squads.so/api-reference/standing-orders/get-a-standing-order
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/standing-order/{standing_order_id}
Retrieve details of a specific standing order by ID
# Get all standing orders for an account
Source: https://developers.squads.so/api-reference/standing-orders/get-all-standing-orders-for-an-account
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/standing-orders
Retrieve all standing orders for a smart account with optional filtering
# Post apigridv1tradequote
Source: https://developers.squads.so/api-reference/trade/post-apigridv1tradequote
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/trade/quote
# Post apigridv1accounts submit
Source: https://developers.squads.so/api-reference/transactions/post-apigridv1accounts-submit
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/submit
# Post apigridv1accounts transactions
Source: https://developers.squads.so/api-reference/transactions/post-apigridv1accounts-transactions
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/transactions
# Get all virtual accounts for a smart account
Source: https://developers.squads.so/api-reference/virtual-accounts/get-all-virtual-accounts-for-a-smart-account
https://grid.squads.xyz/api-docs/openapi.json get /api/grid/v1/accounts/{address}/virtual-accounts
Retrieve all virtual accounts associated with a smart account with optional currency filtering
# Request a virtual account for a smart account
Source: https://developers.squads.so/api-reference/virtual-accounts/request-a-virtual-account-for-a-smart-account
https://grid.squads.xyz/api-docs/openapi.json post /api/grid/v1/accounts/{address}/virtual-account
Create a virtual account for off-chain transactions associated with a smart account
# Authentication Methods
Source: https://developers.squads.so/grid/v1/accounts/authentication-methods
Choose between email-based accounts or custom signer accounts
Grid supports two self-custodial authentication approaches to fit different team needs and workflows.
## Authentication Options
Fastest way to onboard. Sign up with email and OTP. Built-in fault
tolerance.
Use your own ed25519 keys or custom key management.
## Email-Based Accounts
Users sign up with their email and verify with a code. Grid automatically uses multiple industry leading key management service providers and handles key management behind the scenes while your users maintain full control.
### Key Benefits
* **Familiar Experience** - Users sign up just like any other app
* **No Wallet Required** - Everything works in-app, no external wallet needed
* **Built-in Fault Tolerance** - Automatic multi-vendor key redundancy protects against provider failures
* **Enterprise-Grade Security** - Multi-vendor key management architecture with automated failover systems
* **Email Recovery** - Users can recover accounts through email verification
* **Perfect for Getting Started** - Recommended for most teams
### Implementation
The SDK handles all the complex key generation and encryption behind the scenes:
```typescript theme={null}
import { GridClient } from "@sqds/grid";
const gridClient = new GridClient({
environment: "sandbox",
apiKey: process.env.GRID_API_KEY!,
});
// Create account with email
const user = await gridClient.createAccount({
email: "user@example.com",
});
// Generate session secrets
const sessionSecrets = await gridClient.generateSessionSecrets();
// Complete authentication with OTP
const account = await gridClient.completeAuthAndCreateAccount({
user,
otpCode: "123456",
sessionSecrets,
});
```
For REST API implementations, the email-based authentication flow requires several steps:
Initiate account creation by providing an email address.
```bash theme={null}
curl -X POST https://grid.squads.xyz/api/grid/v1/accounts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-grid-environment: sandbox" \
-H "Content-Type: application/json" \
-H "x-idempotency-key: $(uuidgen)" \
-d '{
"type": "email",
"email": "user@example.com",
"memo": "My Grid Account" // Optional
}'
```
The response will include the account creation status and metadata. An OTP will be sent to the provided email address.
Generate the necessary encryption keys and session secrets for secure key management service provider communication.
The session secret generation process involves complex cryptographic operations. See the [Account Verification API reference](/grid/v1/api-reference/endpoint/account-management/verify) for the complete implementation details and examples.
Verify the OTP code and complete account creation with the generated session secrets.
```bash theme={null}
curl -X POST https://grid.squads.xyz/api/grid/v1/accounts/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-grid-environment: sandbox" \
-H "Content-Type: application/json" \
-H "x-idempotency-key: $(uuidgen)" \
-d '{
"email": "user@example.com",
"otp_code": "123456",
"kms_provider_config": {
"encryption_public_key": "YOUR_SESSION_ENCRYPTION_PUBLIC_KEY"
}
}'
```
The response will include the verified account address and status.
For most use cases, we recommend using the SDK as it handles all the complex cryptographic operations automatically. The REST API approach is best suited for teams that need full control over the authentication flow or are using languages without SDK support. See the [Primary Provider Integration](/grid/v1/api-reference/advanced/privy-signing) guide for more details.
## Custom Signer Accounts
Use your own ed25519 keypairs directly with Grid accounts. Perfect if you already have keys or need custom key management flows.
### Key Benefits
* **Use Existing Keys** - Integrate keypairs you already have
* **Direct Control** - No key management service provider needed, you manage keys directly
* **Multi-Signature** - Configure threshold signing with multiple keys
* **Custom Flows** - Build exactly the signing experience you need
* **Flexible Custody** - Create custodial, non-custodial, or hybrid custody accounts
### Implementation
```typescript SDK (TypeScript) theme={null}
import { GridClient } from "@sqds/grid";
import { Keypair } from "@solana/web3.js";
const gridClient = new GridClient({
environment: "sandbox",
apiKey: process.env.GRID_API_KEY!,
});
// Generate your own ed25519 keypairs
const primaryKey = Keypair.generate();
const backupKey = Keypair.generate();
// Create account with your signers
const account = await gridClient.createAccount({
type: "signers",
policies: {
threshold: 1,
signers: [
{
address: primaryKey.publicKey.toBase58(),
permissions: ["Initiate", "Vote", "Execute"],
},
{
address: backupKey.publicKey.toBase58(),
permissions: ["Vote", "Execute"],
},
],
},
});
```
```javascript REST API theme={null}
// Generate your own ed25519 keypairs (using @solana/web3.js)
import { Keypair } from "@solana/web3.js";
const primaryKey = Keypair.generate();
const backupKey = Keypair.generate();
// Create account with custom signers (no key management service provider needed)
const response = await fetch("https://grid.squads.xyz/api/grid/v1/accounts", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"x-grid-environment": "sandbox",
"Content-Type": "application/json",
"x-idempotency-key": crypto.randomUUID(),
},
body: JSON.stringify({
type: "signers",
signers: [primaryKey.publicKey.toBase58(), backupKey.publicKey.toBase58()],
threshold: 1,
memo: "Multi-signature account",
}),
});
const account = await response.json();
console.log("Account created:", account.data.address);
// No key management service provider encryption - you sign transactions directly with your keys
```
## Comparison
| Feature | Email-Based Accounts | Custom Signer Accounts |
| ------------------ | --------------------- | -------------------------- |
| **Setup Time** | Minutes | Minutes |
| **Key Management** | Handled automatically | You provide and manage |
| **Recovery** | Email-based | Your responsibility |
| **Custom Flows** | Standard | Fully customizable |
| **Best For** | Quick start | Existing keys/custom needs |
## When to Choose Each Method
### Choose Email-Based Accounts When
* Getting started with Grid
* Want the quickest setup
* Building consumer-facing applications
* Prefer familiar email-based sign up flows
### Choose Custom Signer Accounts When
* Have existing ed25519 keypairs to use
* Need custom signing workflows
* Want to integrate with existing key management
* Building complex multi-signature setups
## Security Considerations
Both approaches are fully self-custodial and production-ready:
**Email-Based Accounts:**
* You control the accounts and all transactions
* Multi-vendor key management architecture provides built-in fault tolerance and vendor risk mitigation
* Automatic key redundancy across multiple providers protects against failures
* Email verification prevents unauthorized account creation
**Custom Signer Accounts:**
* You control both the keys and accounts
* Works with any ed25519 keypair generation method
* Full flexibility for multi-signature setups
## Next Steps
Complete walkthrough of email-based account creation and transaction
execution
Learn about the multi-vendor key management architecture built into
email-based accounts
# Automated Workflows
Source: https://developers.squads.so/grid/v1/accounts/automated-workflows
Automate money movement without custody using Grid's non-custodial architecture
Grid Accounts enable automated financial workflows without taking custody of user funds. Build recurring transfers, conditional payments, and smart automations while users maintain complete control.
**Non-Custodial Architecture**: Avoid expensive money transmission licenses
while offering competitive automation features through Grid's user-controlled
permission system.
## How It Works
Grid enables programmable financial policies through three key components:
Define automation policies with specific conditions and triggers
Users grant limited permissions while maintaining control and revocation
rights
Policies execute automatically with comprehensive monitoring and alerts
## Automation Features
### Recurring Transfers
* **Subscription payments**: Automated billing for services and products
* **Salary distributions**: Employee and contractor payment automation
* **Vendor payments**: Automated supplier and partner payments
## Security Features
* **User-controlled permissions**: Users grant specific automation rights with revocation capabilities.
* **Granular controls**: Set limits by amount, recipient and time period
* **Comprehensive auditing**: Detailed logs and transaction history
## Use Cases
### Consumer Applications
* Digital banking with automated bill pay and savings
* Personal finance apps with smart spending controls
* Investment platforms with automated portfolio management (coming soon)
### Business Applications
* Corporate treasury with automated payroll and vendor payments
* Expense management with dynamic approval workflows
* Multi-entity operations with cross-border automation
## Next Steps
Learn how to implement automated workflows in your Grid Account integration
Explore Grid's security features that enable safe automation
# Cost Efficiency
Source: https://developers.squads.so/grid/v1/accounts/cost-efficiency
Cost-effective financial applications at any scale
Grid delivers transaction fees under a penny through Solana's efficient blockchain, and state compression allows for low cost account creation and maintenance.
## How Grid Achieves Low Costs
Grid builds on Solana for high throughput at low cost, plus state compression to reduce per-transaction and per-account expenses further.
High-performance blockchain with thousands of transactions per second at
minimal cost
Grid's compression implementation reduces storage and deployment costs
## Gas Abstraction Options
Choose how users pay for transactions:
Users pay fees directly in USDC. No need to manage SOL tokens or volatile
gas costs.
Cover all user transaction costs. Users never see SOL or gas fees - perfect
for seamless onboarding.
## Use Cases Enabled
Tips, content payments, and small purchases become viable
Trading, lending, and yield farming without prohibitive fees
Automated transfers and recurring payments are cost-effective
## Next Steps
Start building with Grid Accounts
Learn about cost-effective automated operations
# Fault Tolerance
Source: https://developers.squads.so/grid/v1/accounts/fault-tolerance
Security without compromising on UX or DevEx through multi-vendor key redundancy and automated failover systems
Grid Accounts deliver enterprise-grade security without compromising on user experience or developer experience. Built on the fully open-source Squads Protocol, Grid provides a unique non-custodial architecture that virtually eliminates vendor lock-in while maintaining the simplicity and reliability that modern applications require.
## Fault Tolerance and Redundancy
Grid's non-custodial architecture provides unprecedented fault tolerance and redundancy:
Built on Squads Protocol, fully open source and auditable. No proprietary
custody mechanisms or hidden dependencies.
Simply prompt users to update signing keys on their accounts. No manual
backups.
You can implement Squads Protocol directly without Grid APIs if needed in
the future.
Users control their accounts directly through the blockchain. Grid provides
tooling, not custody.
## How Grid Works: Automated Multi-KMS Architecture
**Protection Against Catastrophic Scenarios** When you deploy a Grid Account,
keys are automatically created with your user's email address and deployed
across multiple KMS providers. This protects against vendor business failures,
security breaches, key loss, or extended service unavailability.
Every Grid account is deployed with 2 signer keys (1 of 2 threshold) across
different KMS providers using the user's email as the identifier.
If a KMS provider goes out of business, loses keys, or becomes permanently
unavailable, the backup key with another provider maintains full account
access.
Any compromised or lost key can be rotated without changing the user's
wallet address, since keys are purely for signing operations.
Your application remains operational even during extended vendor outages or
permanent provider changes.
## The Key Management Challenge
**Building Complete Solutions** Key management services provide excellent
security for individual keys, but building fault-tolerant applications
requires additional layers of redundancy and user ownership. Grid complements
KMS providers by adding the missing pieces for complete custody solutions.
When building robust applications, teams often need to address critical risk scenarios:
**Key Challenges:**
* **Vendor business failure**: What happens if a KMS provider goes out of business?
* **Permanent key loss**: How to maintain access if keys are irretrievably lost?
* **Security breaches**: Quick key rotation to mitigate risks during provider compromises
* **Extended outages**: Business continuity during prolonged service unavailability
* **Migration constraints**: Avoiding architectural lock-in that limits future flexibility
## How Grid Completes the Solution
**Complementary Architecture** Grid doesn't replace key management services –
it orchestrates them. By combining multiple KMS providers with non-custodial
account architecture, Grid delivers the complete custody, security, and user
experience solution that applications need.
## Enterprise-Grade Vendor Selection
Grid's fault tolerance relies on strategic partnerships with verified key management service providers:
**KMS Partner Criteria:**
* **Security certifications**: SOC 2 Type II, ISO 27001 compliance
* **Proven reliability**: Track record of uptime and security
## Key Benefits
Multi-vendor architecture solves for vendor risk mitigation and redundancy
Enterprise-grade security without managing backups
Protection against vendor failures, security breaches, or extended service
unavailability
**Integration Strategy** Grid's architecture lets you leverage the best key
management services while building complete, fault-tolerant applications. You
get enterprise-grade KMS security with the operational resilience and user
ownership that modern applications require.
## Next Steps
Learn how to integrate fault-tolerant Grid Accounts into your application
Explore Grid's authentication methods
# Introduction
Source: https://developers.squads.so/grid/v1/accounts/introduction
Introduction to Grid Accounts
Stablecoins revolutionize traditional financial systems by enabling new ways to hold and move value for the internet and AI era. Grid is a developer platform built around Grid Accounts, built on Squads Protocol, a powerful open source primitive that solves for safe custody, fault tolerance, programmability, and cost which are all required to deliver a modern fintech user experience.
Grid Accounts currently **support any Solana token** and are **compatible with
Solana-based programs**, providing a powerful base for composability.
## Key Features
Security without compromising on UX or DevEx through multi-vendor key
redundancy and automated failover systems
Everything you need to automate money movement without taking custody -
recurring transfers, savings, and compliance workflows
Transaction fees under a penny thanks to Solana's efficiency and Grid's
native account compression technology
Built-in on/off ramps and KYC capabilities connecting crypto and traditional
finance seamlessly
Grid Accounts provide all expected modern stablecoin capabilities while building a complete primitive for scalable applications without compromising security or cost-efficiency.
## The Problem with Traditional Solutions
Traditional blockchain-based financial applications face fundamental barriers to mainstream adoption:
* **Complex onboarding**: Users need manual key management
* **Single points of failure**: Dependence on individual key management services
* **Poor user experience**: Gas fees and limited non-custodial automation
Grid Accounts solve these problems by providing infrastructure capable of modern fintech applications.
## What Makes Grid Different
Email-based onboarding. No management of private keys required
Build fintech applications with powerful purpose-built REST APIs
Composability, programmability, and cost-efficiency in a single account
## How it works
Grid Accounts are built on top of Squads Protocol, a powerful open source primitive that solves for safe custody, fault tolerance, programmability, and cost which are all required to deliver a modern fintech user experience.
# Custom Domain
Source: https://developers.squads.so/grid/v1/accounts/passkeys/advanced-integration
Host passkey flows on your own custom domain using the Grid WebAuthn proxy.
The advanced integration approach allows you to host passkey flows on your own custom domain (e.g., `auth.yourcompany.com`) while leveraging the Grid API to proxy WebAuthn requests to the blockchain.
**Primary Use Case**: **Custom Domain** - Host passkey authentication on your own domain instead of the default Grid domain for branding, compliance, or security requirements.
This approach requires WebAuthn expertise and proper challenge handling. Only
use this if you need your own custom domain. For most applications, use the
[hosted UI approach](/grid/v1/accounts/passkeys/integration-guide) instead.
## When to Use Advanced Integration
Choose this approach when you need:
* **Custom Domain**: Host passkey flows on `auth.yourcompany.com` instead of the default Grid domain
* **Compliance Requirements**: Internal policies require authentication to happen on company domains
* **Brand Consistency**: Maintain your brand throughout the entire authentication flow
* **Security Policies**: Security requirements mandate own domain usage
## How It Works
### WebAuthn Proxy Flow
1. **Create Session**: Use the passkeys endpoint with your custom `baseUrl`
2. **Extract Challenge**: Parse the challenge from the returned URL
3. **WebAuthn Ceremony**: Implement WebAuthn protocol on your domain with proper ES256 support
4. **Submit Response**: Use the [submit endpoint](/grid/v1/api-reference/endpoint/passkeys/submit) to process the response
5. **Create Account**: Optionally use the [create account endpoint](/grid/v1/api-reference/endpoint/passkeys/create-account) to deploy a smart account
6. **Get Account**: Retrieve account details using the [get account endpoint](/grid/v1/api-reference/endpoint/passkeys/get-account)
### Custom UI Requirements
When implementing a custom passkey UI, your implementation must:
1. **Extract the challenge**: Parse the `challenge` parameter from the URL
2. **Use challenge directly**: Pass the challenge to the WebAuthn protocol as-is (already base64 encoded)
3. **Do NOT re-encode**: The challenge is already base64 encoded - additional encoding will cause errors
4. **Return complete response**: For authentication, return the entire WebAuthn authentication response object
5. **Time constraint**: The challenge is only valid for 60 seconds from URL generation
## Advanced API Endpoints
For custom UI implementations, use these endpoints:
* **[Create Passkey Session](/grid/v1/api-reference/endpoint/passkeys/post)** - Initialize passkey creation with custom baseUrl
* **[Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth)** - Authenticate with custom baseUrl
* **[Submit Passkey Session](/grid/v1/api-reference/endpoint/passkeys/submit)** - Process WebAuthn responses
* **[Create Smart Account](/grid/v1/api-reference/endpoint/passkeys/create-account)** - Deploy Grid account with passkey
* **[Get Passkey Account](/grid/v1/api-reference/endpoint/passkeys/get-account)** - Retrieve passkey details
* **[Find Passkey Account](/grid/v1/api-reference/endpoint/passkeys/find)** - Lookup passkey by authenticator
## MetaInfo and BaseURL Usage
### Default vs Custom BaseURL
* **Default baseUrl**: When not specified, Grid uses its default hosted UI which handles the `meta_info` fields
* **Custom baseUrl**: Use your custom domain (e.g., `https://auth.yourcompany.com`) - your UI handles passkey identification and naming
### Example Configuration
```json theme={null}
{
"meta_info": {
"appName": "YourCompany App",
"redirectUrl": "https://yourapp.com/auth-callback"
},
"sessionKey": {
"key": "your-session-key",
"expiration": 900
},
"baseUrl": "https://auth.yourcompany.com"
}
```
## WebAuthn Configuration Requirements
### Required Settings
The on-chain passkey program has specific requirements:
**User Presence Required**:
* `userPresent` must be `true` in the WebAuthn authenticator response
* The authenticator must verify user presence through biometric, PIN, or physical interaction
**Algorithm Requirement**:
* Only ES256 (algorithm `-7`) is supported
* No other cryptographic algorithms are accepted
**WebAuthn Configuration Example**:
```javascript theme={null}
// For passkey creation
const createOptions = {
publicKey: {
challenge: challenge, // From API URL - already base64 encoded
rp: { name: "Your Company" },
user: {
/* user info */
},
pubKeyCredParams: [{ alg: -7, type: "public-key" }], // REQUIRED: Only -7 (ES256) supported
authenticatorSelection: {
userVerification: "preferred", // Ensures user presence
requireResidentKey: true,
},
attestation: "direct",
},
};
// For authentication
const getOptions = {
publicKey: {
challenge: challenge, // From API URL - already base64 encoded
userVerification: "preferred", // Ensures user presence
timeout: 60000,
},
};
```
## Error Handling
### Common Errors
| Error Code | Description | Solution |
| --------------------------------------- | ------------------------------------- | ------------------------- |
| `MissingSessionKey` | Session key required for auth actions | Provide valid session key |
| `InvalidAuthenticatorResponse` | Malformed WebAuthn response | Validate WebAuthn data |
| `NoValidExternallySignedAccount` | Account not found | Verify account exists |
| `InvalidExternallySignedAccountAddress` | Invalid account address format | Use valid Solana address |
### Registration Failure Recovery
**If local passkey creation succeeds but submission fails:**
* The passkey exists locally but has no associated on-chain account
* **Solution**: Re-request a new URL and submit again
* The existing local passkey will work with the new challenge
* No need to recreate the local passkey
## Best Practices
### Challenge Handling
* Parse challenge from URL parameters
* Use challenge directly - it's already base64 encoded
* Never re-encode the challenge
* Complete WebAuthn ceremony within 60 seconds of URL generation
### Security
* Validate all inputs
* Use HTTPS for all communications
* Implement proper CORS policies
* Never expose API keys in client-side code
* Store session keys securely on client side
* Validate session expiration on blockchain clock
### Implementation
* Generate unique session keys for each authentication
* Implement comprehensive error handling
* Provide user-friendly error messages
* Use clear, recognizable app names
* Provide loading states during authentication
* Handle environment isolation (sandbox vs production)
### Smart Account Creation
* Use the dedicated create account endpoint after passkey submission
* Store both passkey address and smart account address
* Verify account creation before allowing transactions
* Handle devnet funding appropriately (sandbox only)
* Test account creation flow thoroughly in sandbox
## Getting Started
1. **Review Requirements**: Ensure you have WebAuthn expertise and need custom domain branding
2. **Set Up Domain**: Configure your custom domain for passkey flows
3. **Implement WebAuthn**: Build custom UI following the requirements above
4. **Test on Sandbox**: Thoroughly test your implementation before production
5. **Handle Errors**: Implement robust error handling and recovery
6. **Deploy Smart Accounts**: Use the create account endpoint to deploy Grid accounts
For most applications, consider using the [hosted UI approach](/grid/v1/accounts/passkeys/integration-guide) instead, which handles all this complexity for you including automatic smart account creation.
# Integration Guide
Source: https://developers.squads.so/grid/v1/accounts/passkeys/integration-guide
How to securely integrate the Passkey UI using iframes and browser sessions.
The hosted UI provides a production-ready passkey interface that handles all WebAuthn complexity. This guide covers implementation for web and mobile applications.
The **appName** determines how the passkey will be named when created on your
user's device. Use your application's name or a clear identifier so users can
easily recognize it.
### Web Integration (React/Next.js) - Hosted UI
Request a passkey session from your backend and receive a hosted UI URL. For creating new accounts, use the base `/passkeys` endpoint. For authentication with existing passkeys, use `/passkeys/auth`.
appName determines how the passkey will be named when it is created on your user's device. Use your application's name or a clear identifier so users can easily recognize it.
```tsx theme={null}
const requestPasskeySession = async (action: "create" | "auth") => {
const appName = "YourAppName";
// Generate a session key
const keypair = Keypair.generate();
const sessionKey = {
key: keypair.publicKey.toBase58(),
expiration: 900, // 15 minutes
};
const redirectUrl = encodeURIComponent(window.location.origin + "/");
// Use different endpoints for create vs auth
const endpoint = action === "create"
? "https://grid.squads.xyz/api/grid/v1/passkeys"
: "https://grid.squads.xyz/api/grid/v1/passkeys/auth";
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-grid-environment": "sandbox", // or 'production'
"Authorization": "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
meta_info: {
appName: appName,
redirectUrl: redirectUrl,
},
sessionKey,
}),
});
const data = await response.json();
setPasskeyUrl(data.url);
setShowIframe(true);
};
```
Add the hosted Passkey UI to your app using an iframe with the correct WebAuthn permissions.
```tsx theme={null}
Listen for messages from the iframe to receive the session token or handle errors, then use the session token as a signer in Grid account operations.
On successful authentication, the iframe will post a message of type authz\_complete containing a sessionToken and the passkey address. For account creation, you'll also receive smartAccountAddress. On error, a message of type authz\_error will be sent with an error description.
```tsx theme={null}
useEffect(() => {
const handleMessage = (event: MessageEvent) => {
if (event.data.type === "authz_complete") {
// event.data.sessionToken: Use this as a signer for Grid operations
// event.data.passkeyAddress: The onchain address of the passkey
// event.data.smartAccountAddress: The Grid smart account (for create action)
console.log("Authorization complete:", event.data);
const { sessionToken, passkeyAddress, smartAccountAddress } = event.data;
// For new accounts, store the smart account address
if (smartAccountAddress) {
console.log("New smart account created:", smartAccountAddress);
}
// Handle successful authentication
} else if (event.data.type === "authz_error") {
// event.data.error: Error description
console.log("Authorization error:", event.data.error);
// Handle authentication error
}
};
window.addEventListener("message", handleMessage);
return () => window.removeEventListener("message", handleMessage);
}, []);
```
### React Native Integration - Hosted UI
Request a passkey session from your backend and receive the hosted UI URL.
```javascript theme={null}
import { Linking } from 'react-native';
const appName = "YourAppName";
const action = "create"; // or "auth"
const apiKey = "YOUR_API_KEY";
const environment = "sandbox"; // or 'production'
const redirectUri = Linking.createURL("login");
// Generate a session key
const keypair = Keypair.generate();
const sessionKey = {
key: keypair.publicKey.toBase58(),
expiration: 900, // 15 minutes
};
// Use different endpoints for create vs auth
const endpoint = action === "create"
? "https://grid.squads.xyz/api/grid/v1/passkeys"
: "https://grid.squads.xyz/api/grid/v1/passkeys/auth";
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${apiKey}`,
"x-grid-environment": environment,
},
body: JSON.stringify({
meta_info: {
appName,
redirectUrl: redirectUri,
},
sessionKey,
}),
});
const data = await response.json();
```
Launch the Passkey UI in the device browser using WebBrowser.openAuthSessionAsync.
```javascript theme={null}
const result = await WebBrowser.openAuthSessionAsync(data.url, redirectUri);
```
Handle the redirect and extract the session token from the result for use as a signer in Grid operations.
```javascript theme={null}
// result is encoded in url
const parsed = LinkingExpo.parse(result.url);
const status = parsed.queryParams?.status;
if (status === "success") {
const passkeyAddress = parsed.queryParams?.passkeyAddress;
const smartAccountAddress = parsed.queryParams?.smartAccountAddress;
// Store account addresses for future transactions
if (smartAccountAddress) {
console.log("New Grid account created:", smartAccountAddress);
}
} else {
// handle error
console.error("Passkey error:", parsed.queryParams?.error);
}
```
## Smart Account Creation
When using the `create` action, Grid automatically:
1. **Creates Passkey**: Initiates WebAuthn ceremony on user's device
2. **Deploys Smart Account**: Creates a new 1/1 threshold smart account on Solana
3. **Sets Permissions**: Configures passkey with full permissions (mask=7)
4. **Stores in Database**: Registers account in Grid's database
5. **Funds Account** (Sandbox only): Adds 1 USDC to new sandbox accounts
The response includes both the passkey address and the smart account address that you can use immediately.
## WebAuthn Configuration Requirements
### Required Settings
The on-chain passkey program has specific requirements that must be met for successful registration and authentication:
**User Presence Required**:
* `userPresent` must be `true` in the WebAuthn authenticator response
* This applies to both passkey creation and subsequent authentications
* The authenticator must verify user presence through biometric, PIN, or physical interaction
**Algorithm Requirement**:
* Only ES256 (algorithm `-7`) is supported
* No other cryptographic algorithms are accepted by the on-chain program
**WebAuthn Configuration Example**:
```javascript theme={null}
// For passkey creation
const createOptions = {
publicKey: {
challenge: challenge, // From API URL
rp: { name: "Your App" },
user: {
/* user info */
},
pubKeyCredParams: [{ alg: -7, type: "public-key" }], // REQUIRED: Only -7 (ES256) supported
authenticatorSelection: {
userVerification: "preferred", // Ensures user presence
requireResidentKey: true,
},
attestation: "direct",
},
};
// For authentication
const getOptions = {
publicKey: {
challenge: challenge, // From API URL
userVerification: "preferred", // Ensures user presence
timeout: 60000,
},
};
```
## Handling Registration Failures
**If local passkey creation succeeds but submission fails:**
* The passkey exists locally but has no associated on-chain account
* **Solution**: Re-request a new URL with the create endpoint and submit again
* The existing local passkey will work with the new challenge
* No need to recreate the local passkey
**Common failure scenarios:**
* Challenge expired (60-second timeout)
* Network issues during submission
* Invalid WebAuthn response format
## Timing Constraints
Understanding the timing constraints helps avoid confusing errors:
| Operation | Time Limit | Reason |
| ------------------------- | ------------ | ------------------------------------------------ |
| API challenge (slot hash) | \~3 minutes | Solana's SlotHashes sysvar retains 512 entries |
| WebAuthn ceremony | No limit | Browser-only operation, not blockchain-dependent |
| Session key | User-defined | Set via `expiration` parameter (in seconds) |
The passkey *credential* on the user's device has no expiration. The timing constraint applies to the *challenge* (slot hash) used in API calls, not the credential itself. A passkey created months ago can sign fresh challenges.
**Why this matters:** If a user takes too long between requesting a passkey session and completing the flow, the slot hash becomes invalid. The solution is simple—request a new session URL with a fresh challenge.
## Best Practices
1. **Challenge Handling**:
* Parse challenge from URL parameters
* Use challenge directly - it's already base64 encoded
* Never re-encode the challenge
* Return complete WebAuthn response objects
* Complete WebAuthn ceremony within 60 seconds of URL generation
2. **Session Management**:
* Generate unique session keys for each authentication
* Implement proper expiration handling
* Securely store session tokens
* Never expose session keys
3. **Error Handling**:
* Implement comprehensive error handling
* Provide user-friendly error messages
* Log errors for debugging
* Handle both success and failure scenarios
4. **User Experience**:
* Use clear, recognizable app names
* Provide loading states during authentication
* Show clear feedback for success/failure
* Explain passkey benefits to users
5. **Security**:
* Validate all inputs
* Use HTTPS for all communications
* Implement proper CORS policies
* Never expose API keys in client-side code
* Store account addresses securely
* Never confuse sandbox and production addresses
6. **Environment Management**:
* Maintain separate accounts for sandbox and production
* Never send real funds to sandbox addresses
* Test thoroughly in sandbox before production deployment
For more details, see the API endpoint documentation:
* [Create Passkey Session](/grid/v1/api-reference/endpoint/passkeys/post)
* [Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth)
* [Submit Passkey Session](/grid/v1/api-reference/endpoint/passkeys/submit)
* [Create Smart Account](/grid/v1/api-reference/endpoint/passkeys/create-account)
## Advanced Integration
**Need Your Own Custom Domain?** If you need to host passkey flows on your own domain (e.g., `auth.yourcompany.com`) for branding or compliance requirements, see [Advanced Integration](/grid/v1/accounts/passkeys/advanced-integration).
# Introduction
Source: https://developers.squads.so/grid/v1/accounts/passkeys/introduction
Create and authenticate with passkeys for secure, passwordless Grid account transactions.
The Grid API provides passkey-based authentication for Grid accounts using the WebAuthn protocol. This enables secure, passwordless authentication with biometric or hardware-based passkeys, including seamless smart account creation.
## Hosted UI Integration
The Grid Passkey API provides a production-ready hosted interface that handles all WebAuthn complexity for you. This is the **recommended approach** for most applications.
**Key Benefits**:
* **Quick Integration**: Simple iframe or WebBrowser integration
* **Production-Ready**: Fully tested and optimized UI
* **Cross-Platform**: Works seamlessly on web and mobile
* **Handles Complexity**: WebAuthn protocol managed for you
* **No WebAuthn Expertise Required**: Just integrate the hosted interface
* **Smart Account Creation**: Automatically creates Grid smart accounts with passkeys
**Best For**: Most applications, rapid development, teams without WebAuthn expertise
## Key Features
* **WebAuthn Integration**: Industry-standard passkey creation and authentication
* **Smart Account Creation**: One-step account creation with pass key as initial signer
* **Session Management**: Secure session tokens for seamless transaction signing
* **Database Integration**: Full Grid account lifecycle management
* **Cross-Platform Support**: Works on web, mobile, and across devices
* **Hardware Security**: Support for hardware keys like Yubikey
* **Biometric Authentication**: Fingerprint, Face ID, and other biometric methods
* **Devnet Funding**: Automatic USDC funding for devnet accounts
## Platform Support
* **Web**: React/Next.js with iframe integration
* **Mobile**: React Native with WebBrowser API
* **Cross-Platform**: Works across devices and platforms
## Supported Password Managers
| Password Manager | Type | Notes | Supported |
| --------------------- | -------------- | ----------------------------------- | :-------: |
| Chrome | Browser Native | Built-in password manager | ✅ |
| Chrome Cross-Platform | Browser Sync | Works via QR code & Apple Passwords | ✅ |
| Apple Passwords | OS Native | Native iOS integration | ✅ |
| Yubikey | Hardware Key | Physical security key | ✅ |
| 1Password | Third Party | Cross-platform support | ✅ |
| Dashlane | Third Party | Cross-platform support | ✅ |
| NordPass | Third Party | Not currently supported | ❌ |
## API Access
### Base URL
**Production**: `https://grid.squads.xyz/api/grid/v1/`
### Required Headers
All endpoints require:
* **Authorization**: `Bearer YOUR_API_KEY` (UUID-based API key)
* **x-grid-environment**: `sandbox` or `production`
* **Content-Type**: `application/json`
## How It Works
### Smart Account Creation Flow
Grid passkeys automatically create complete smart accounts:
1. **Generate Session Key**: Create a client-side session key using `Keypair.generate()`
2. **Request Passkey Session**: Call the passkeys endpoint to get a hosted UI URL
3. **Complete WebAuthn Ceremony**: User creates passkey via hosted UI
4. **Create Smart Account**: Grid automatically creates a 1/1 threshold smart account with the passkey as signer
5. **Receive Account Details**: Get back smart account address, passkey address, and session key
6. **Use for Transactions**: The passkey can immediately sign transactions for the smart account
### Authentication Flow
For existing passkeys:
1. **Generate Session Key**: Create a new session key for authentication
2. **Request Auth Session**: Call the passkeys/auth endpoint
3. **Get Hosted UI URL**: Receive a secure URL for the WebAuthn ceremony (valid for 60 seconds)
4. **Load in iframe**: Display the URL in a hidden iframe to initiate the WebAuthn ceremony. On mobile devices, open the URL in a new window or tab instead of an iframe to ensure proper WebAuthn support.
5. **Handle Completion**: Listen for postMessage events or extract search params from the redirect URL containing the passkey address
6. **Use as Signer**: Include the passkey address as a transaction signer in Grid account operations
7. **Sign Requests**: Use the session key to sign subsequent transactions
### Session Key Management
**Input Format** (when creating sessions):
* **expiration**: Seconds from now (e.g., 900 for 15 minutes)
* **key**: Solana public key string
**Output Format** (in API responses):
* **expiration**: Unix timestamp
* **key**: Solana public key string
### Smart Account Properties
Accounts created with passkeys have these default properties:
* **Threshold**: 1/1 (single signer required)
* **Passkey Permissions**: Full permissions (mask=7: CAN\_INITIATE | CAN\_VOTE | CAN\_EXECUTE)
* **Database Integration**: Stored in Grid database with full lifecycle management
* **Devnet Funding**: Automatically funded with 1 USDC on sandbox environment
### Important Notes
* **Challenge Expiration**: WebAuthn challenges expire after 60 seconds
* **User Presence Required**: All operations require user presence verification
* **Algorithm Support**: Only ES256 (algorithm `-7`) is supported
* **Session Key Properties**: Temporary, scoped, refreshable, and secure
* **Environment-Specific**: Smart accounts have different addresses in sandbox vs production
## Error Handling
### Common Errors
| Error Code | Description | Solution |
| --------------------------------------- | ------------------------------------- | ------------------------- |
| `MissingSessionKey` | Session key required for auth actions | Provide valid session key |
| `InvalidAuthenticatorResponse` | Malformed WebAuthn response | Validate WebAuthn data |
| `NoValidExternallySignedAccount` | Account not found | Verify account exists |
| `InvalidExternallySignedAccountAddress` | Invalid account address format | Use valid Solana address |
### Error Response Format
```json theme={null}
{
"error": {
"code": "ERROR_CODE",
"message": "Human readable error message",
"details": "Additional context"
}
}
```
## Security Considerations
1. **Session Key Expiration**: Automatic validation of session timestamps
2. **RP ID Validation**: Relying Party IDs are limited to 32 bytes
3. **Slot Validation**: Solana slot numbers provide replay protection
4. **Challenge Expiration**: WebAuthn challenges expire after 60 seconds
5. **Secure Storage**: Store session keys securely on client side
6. **HTTPS Required**: All communications must use HTTPS
7. **Origin Validation**: Ensure proper origin/redirect URL configuration
8. **Environment Isolation**: Never send production funds to sandbox addresses
## API Endpoints
* **[Create Passkey Session](/grid/v1/api-reference/endpoint/passkeys/post)** - Initialize passkey creation
* **[Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth)** - Authenticate with existing passkey
* **[Submit Passkey Session](/grid/v1/api-reference/endpoint/passkeys/submit)** - Complete WebAuthn ceremony
* **[Create Smart Account](/grid/v1/api-reference/endpoint/passkeys/create-account)** - Create account with passkey
* **[Get Passkey Account](/grid/v1/api-reference/endpoint/passkeys/get-account)** - Retrieve passkey details
* **[Find Passkey Account](/grid/v1/api-reference/endpoint/passkeys/find)** - Lookup passkey by authenticator
* **[Get Passkey Session](/grid/v1/api-reference/endpoint/passkeys/get-session)** - Retrieve session URL
## Getting Started
**Hosted UI Integration**: See the [Passkey Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for complete implementation examples with iframe and WebBrowser integration.
**Need Your Own Custom Domain?** If you need to host passkey flows on your own domain (e.g., `auth.yourcompany.com`) for branding or compliance requirements, see [Advanced Integration](/grid/v1/accounts/passkeys/advanced-integration).
# Quickstart
Source: https://developers.squads.so/grid/v1/accounts/quickstart
Start building with Grid Accounts in minutes with step-by-step integration instructions
Grid Accounts make it simple to build modern fintech applications with email-based onboarding, programmable spending limits, and sub-penny transaction costs. This guide will get you up and running in minutes.
Grid Accounts currently **support any Solana token** and are **compatible with
Solana-based programs**, providing a powerful base for composability.
## Get API Keys
Before you can start building, you'll need API credentials from the Grid dashboard.
Visit the Grid dashboard to generate your sandbox and production API keys
Keep your API keys secure and never expose them in client-side code. Always
use environment variables or secure key management systems.
## Prerequisites
Before integrating Grid Accounts, ensure you have:
* **Node.js 18+** or another runtime environment
* **API credentials** from the Grid dashboard
* **Basic understanding** of REST APIs and async/await patterns
### SDK Installation
Install the official Grid SDK to get started quickly:
```bash theme={null}
npm install @sqds/grid
```
The Grid SDK provides TypeScript support out of the box and handles authentication, error handling, and API communication automatically.
View complete SDK documentation, API reference, and additional examples on NPM
**Migrating from grid-sdk?** The new @sqds/grid package provides enhanced
features including multi-provider support and React Native compatibility. View
our [migration guide](/grid/v1/accounts/migration-from-grid-sdk).
## SDK Initialization
Set up your Grid client using the official SDK:
```typescript theme={null}
import { GridClient } from "@sqds/grid";
// Initialize the Grid client
const gridClient = new GridClient({
environment: "sandbox", // Use 'production' for live applications
apiKey: process.env.GRID_API_KEY!, // Your API key from the dashboard
baseUrl: "https://grid.squads.xyz", // Base URL of the Grid API
});
// Verify the connection
console.log("Grid client initialized successfully");
```
```typescript theme={null}
// .env file
GRID_API_KEY = your_sandbox_api_key_here;
// For production:
// GRID_API_KEY=your_production_api_key_here
// GRID_ENVIRONMENT=production
// gridClient.ts
import { GridClient } from "@sqds/grid";
if (!process.env.GRID_API_KEY) {
throw new Error("GRID_API_KEY environment variable is required");
}
export const gridClient = new GridClient({
environment:
process.env.GRID_ENVIRONMENT === "production" ? "production" : "sandbox",
apiKey: process.env.GRID_API_KEY,
baseUrl: "https://grid.squads.xyz",
});
```
The Grid SDK automatically handles API authentication, request retries, and
error formatting. You don't need to build your own HTTP client.
## Complete Integration Example
Complete workflow from account creation through transaction execution:
Set up your Grid SDK client with API credentials:
```typescript theme={null}
import { GridClient } from '@sqds/grid';
const gridClient = new GridClient({
environment: 'sandbox', // Use 'production' for live applications
apiKey: process.env.GRID_API_KEY!,
baseUrl: "https://grid.squads.xyz",
});
```
Create cryptographic keypairs that will authorize all future transactions:
```typescript theme={null}
const sessionSecrets = await gridClient.generateSessionSecrets();
console.log('Session secrets generated - these contain private keys needed for signing!');
```
Session secrets contain private keys that enable transaction signing. Store them encrypted and never expose them in client-side code.
Create a new Grid account using email-based onboarding:
Grid accounts do not have the same address in sandbox and production. **DO NOT** send funds to the same address in both environments. Create unique accounts for each environment and ensure you use the correct address for your environment.
```typescript theme={null}
const user = await gridClient.createAccount({
email: 'user@example.com',
});
console.log('Account creation initiated for:', user.email);
console.log('OTP sent to email for verification');
```
Complete account verification using the OTP sent to the user's email:
```typescript theme={null}
const verifiedAccount = await gridClient.completeAuthAndCreateAccount({
user: user,
otpCode: '123456', // User receives this via email
sessionSecrets: sessionSecrets,
});
console.log('Account created successfully');
```
For users who already have a Grid account, use the authentication flow:
```typescript theme={null}
// Generate fresh session secrets for authentication
const authSessionSecrets = await gridClient.generateSessionSecrets();
// Initialize authentication for existing account
const authUser = await gridClient.initAuth({
email: 'existing@example.com',
});
console.log('Authentication initiated for:', authUser.email);
console.log('OTP sent to email for verification');
// Complete authentication with OTP
const authenticatedAccount = await gridClient.completeAuth({
user: authUser,
otpCode: '123456', // User receives this via email
sessionSecrets: authSessionSecrets,
});
console.log('Account authenticated successfully');
```
Use `initAuth` and `completeAuth` for existing accounts, or `createAccount` and `completeAuthAndCreateAccount` for new account creation. Always generate fresh session secrets for each authentication flow.
Before executing, prepare the transaction payload using the SDK:
```typescript theme={null}
const rawTransactionPayload = {
transaction: "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArc20SI/X2z8FPQhKgWWbWfXOTI3TDjuQQB8JfpF+1e4u3shfDGrJc7jvYd11DguvNKYg2PsUz7b7GZKwcAjMBoCAAECAAkDAAAAAMOhGsIAAAAA", // Your Solana transaction
transaction_signers: [verifiedAccount.address] // Optional: only needed when signing with local signers
};
// Prepare the transaction payload
const transactionPayload = await gridClient.prepareArbitraryTransaction(
verifiedAccount.address,
rawTransactionPayload
);
console.log('Transaction prepared successfully');
```
The `transaction_signers` field is optional and only required when you need to sign the transaction with additional local signers alongside Grid's signing.
Use the `signAndSend` method to execute the prepared transaction:
```typescript theme={null}
const executedTx = await gridClient.signAndSend({
sessionSecrets, // Private keys for cryptographic signing
session: verifiedAccount, // Authenticated account session
transactionPayload, // Prepared transaction payload
address: verifiedAccount.address
});
console.log('Transaction executed:', executedTx.signature);
```
The `signAndSend` method handles both cryptographic signing and network submission in a single call, simplifying transaction execution.
For production applications, implement proper error handling, retry logic, and secure secret management around each of these steps.
Comprehensive LLM prompts that provide complete implementation guidance for Grid Accounts integration:
Copy this comprehensive prompt to your LLM:
```markdown theme={null}
# IMPLEMENT GRID ACCOUNTS CLIENT SETUP
## TASK OVERVIEW
Set up Grid SDK client initialization in my application following my existing patterns.
## MY APPLICATION CONTEXT
**Tech Stack:**
- Framework: [React/Next.js/Express/Django/etc.]
- Environment management: [How you handle config/env vars]
- Service architecture: [How you organize API services]
- Error handling: [Your current error handling approach]
## GRID V1 CLIENT REQUIREMENTS
**Installation:** npm install @sqds/grid
**Import:** import { GridClient } from '@sqds/grid';
**Configuration Options:**
- environment: 'sandbox' | 'production'
- apiKey: string (from Grid dashboard at https://grid.squads.xyz/dashboard)
**Complete Initialization Example:**
const gridClient = new GridClient({
environment: process.env.NODE_ENV === 'production' ? 'production' : 'sandbox',
apiKey: process.env.GRID_API_KEY!,
baseUrl: "https://grid.squads.xyz",
});
## IMPLEMENTATION REQUEST
Create a Grid client service that:
1. Follows my application's service patterns
2. Handles environment configuration properly
3. Includes comprehensive error handling
4. Provides a clean interface for other parts of my app
5. Includes proper TypeScript types if I'm using TypeScript
Show me the complete implementation with file structure and code.
## DOCUMENTATION REFERENCES
- Grid SDK Documentation: https://www.npmjs.com/package/@sqds/grid
- API Dashboard: https://grid.squads.xyz/dashboard
```
Copy this comprehensive prompt to your LLM:
```markdown theme={null}
# IMPLEMENT GRID SESSION SECRETS MANAGEMENT
## TASK OVERVIEW
Implement secure generation and storage of Grid session secrets for transaction signing.
## MY APPLICATION CONTEXT
**Security Setup:**
- Current encryption library: [crypto/bcrypt/etc.]
- Database/storage: [PostgreSQL/MongoDB/Redis/etc.]
- User data storage patterns: [How you store user information]
- Environment variables: [Your env var management]
## GRID SESSION SECRETS EXPLAINED
Session secrets are cryptographic keypairs that authorize transaction signing. They contain:
- Private keys for signing transactions
- Public keys for verification
- CRITICAL: Must never be exposed in client-side code or logs
**Generation Method:**
const sessionSecrets = await gridClient.generateSessionSecrets();
// Returns object with signing keys - treat as highly sensitive
## SECURITY REQUIREMENTS
1. **Encrypt before storage** - Never store plaintext
2. **Server-side only** - Never send to client
3. **Secure key management** - Use environment variables for encryption keys
4. **Access logging** - Log when secrets are accessed
## IMPLEMENTATION REQUEST
Create a secure session secrets management system that:
1. Generates session secrets using Grid SDK
2. Encrypts them using my existing encryption approach
3. Stores encrypted secrets in my database
4. Provides secure retrieval and decryption
5. Includes proper error handling for encryption/decryption failures
6. Follows my application's security patterns
Show me the complete implementation including database schema, encryption/decryption functions, and service methods.
## DOCUMENTATION REFERENCES
- Grid SDK Documentation: https://www.npmjs.com/package/@sqds/grid
- Authentication Methods Guide: https://grid.squads.xyz/grid/v1/accounts/authentication-methods
```
Copy this comprehensive prompt to your LLM:
```markdown theme={null}
# IMPLEMENT GRID ACCOUNT CREATION WITH EMAIL AUTHENTICATION
## TASK OVERVIEW
Integrate Grid account creation into my user registration flow with email-based authentication.
## MY APPLICATION CONTEXT
**Current User Registration:**
- Registration flow: [Describe your signup process]
- User data model: [Your user schema/model]
- Email handling: [How you send emails/notifications]
- Database operations: [Your ORM/database pattern]
## GRID ACCOUNT CREATION PROCESS
**Step 1:** Generate session secrets (from previous step)
**Step 2:** Create account with email
**Step 3:** Handle OTP verification
**Account Creation Method:**
const accountData = await gridClient.createAccount({
email: 'user@example.com',
});
// Returns: { address: string, ... }
// Automatically sends OTP to email
**Account Verification Method:**
const verifiedAccount = await gridClient.completeAuthAndCreateAccount({
user: user,
otpCode: '123456', // From user email
sessionSecrets: sessionSecrets,
});
// Returns verified account session
**For Existing Accounts (Alternative):**
// Generate fresh session secrets for authentication
const authSessionSecrets = await gridClient.generateSessionSecrets();
// Initialize authentication for existing account
const authUser = await gridClient.initAuth({
email: 'existing@example.com',
});
// Complete authentication with OTP
const authenticatedAccount = await gridClient.completeAuth({
user: authUser,
otpCode: '123456', // From user email
sessionSecrets: authSessionSecrets,
});
// Returns authenticated account session
## INTEGRATION REQUIREMENTS
1. **Integrate with existing registration** - Add Grid account creation to my signup flow
2. **Handle existing users** - Support both new account creation and existing account authentication
3. **Store account data** - Save Grid address and session info
4. **Handle OTP flow** - Create UI/API for OTP verification
5. **Link to user records** - Associate Grid accounts with my user model
6. **Error handling** - Handle network failures, invalid emails, expired OTPs
## IMPLEMENTATION REQUEST
Show me how to:
1. Modify my user registration to include Grid account creation
2. Add existing user authentication flow using initAuth/completeAuth
3. Update my user model/schema to store Grid data
4. Create OTP verification endpoints/UI
5. Handle both new account creation and existing account authentication flows
6. Add appropriate error handling and user feedback
Provide complete code examples that integrate with my existing patterns.
## DOCUMENTATION REFERENCES
- Grid SDK Documentation: https://www.npmjs.com/package/@sqds/grid
- Authentication Methods Guide: https://grid.squads.xyz/grid/v1/accounts/authentication-methods
```
Copy this comprehensive prompt to your LLM:
```markdown theme={null}
# IMPLEMENT GRID TRANSACTION PREPARATION
## TASK OVERVIEW
Implement transaction preparation for executing Solana transactions through Grid accounts.
## MY APPLICATION CONTEXT
**Current Transaction Flow:**
- Payment/transaction handling: [How you process payments]
- Transaction data: [How you structure transaction info]
- Business logic: [Your transaction validation/processing]
## GRID TRANSACTION PREPARATION EXPLAINED
Before executing transactions, you must prepare the transaction payload:
**Raw Transaction Structure:**
const rawTransactionPayload = {
transaction: "BASE64_ENCODED_SOLANA_TRANSACTION", // Your Solana transaction
transaction_signers: [accountAddress] // Optional: additional local signers
};
**Preparation Method:**
const transactionPayload = await gridClient.prepareArbitraryTransaction(
accountAddress,
rawTransactionPayload
);
**Key Points:**
- `transaction`: Base64-encoded Solana transaction bytes
- `transaction_signers`: Optional array for additional signing requirements
- Returns prepared payload ready for signing and submission
## SOLANA TRANSACTION CONTEXT
Grid works with any Solana transaction including:
- Token transfers (SPL tokens, stablecoins)
- Program interactions (DeFi protocols, NFTs)
- Smart contract calls
- Multi-signature operations
## IMPLEMENTATION REQUEST
Create a transaction preparation service that:
1. Accepts transaction data from my application
2. Converts it to proper Solana transaction format
3. Uses Grid's prepareArbitraryTransaction method
4. Handles different transaction types I need
5. Includes validation and error handling
6. Integrates with my existing transaction flow
Show me:
- How to structure different types of transactions for Grid
- Complete transaction preparation implementation
- Integration with my existing payment/transaction system
- Error handling for invalid transactions
## DOCUMENTATION REFERENCES
- Grid SDK Documentation: https://www.npmjs.com/package/@sqds/grid
- Automated Workflows Guide: https://grid.squads.xyz/grid/v1/accounts/automated-workflows
```
Copy this comprehensive prompt to your LLM:
```markdown theme={null}
# IMPLEMENT GRID TRANSACTION EXECUTION
## TASK OVERVIEW
Implement the final step: executing prepared transactions using Grid's signAndSend method.
## MY APPLICATION CONTEXT
**Transaction Processing:**
- Current payment completion: [How you finalize transactions]
- Transaction logging: [How you track transaction history]
- User feedback: [How you notify users of transaction status]
## GRID TRANSACTION EXECUTION
**signAndSend Method Signature:**
const executedTx = await gridClient.signAndSend({
sessionSecrets, // Decrypted session secrets from secure storage
session: verifiedAccount, // Account session from authentication
transactionPayload, // Prepared transaction from previous step
address: accountAddress // Grid account address
});
// Returns: { signature: string, ... } - Solana transaction signature
**Complete Flow:**
1. Retrieve and decrypt user's session secrets
2. Get user's verified account session
3. Use prepared transaction payload
4. Execute with signAndSend
5. Handle success/failure and update user
## IMPLEMENTATION REQUIREMENTS
1. **Secure secret retrieval** - Get and decrypt session secrets safely
2. **Transaction execution** - Use signAndSend method properly
3. **Result handling** - Process success/failure responses
4. **Transaction tracking** - Log results in my system
5. **User feedback** - Notify users of transaction status
6. **Error recovery** - Handle network failures, signing errors
## COMMON TRANSACTION SCENARIOS
- **Stablecoin transfers** - Moving USDC/USDT between accounts
- **Payment processing** - Merchant payment acceptance
- **DeFi interactions** - Yield farming, swaps, lending
- **Batch operations** - Multiple transactions in sequence
## IMPLEMENTATION REQUEST
Create a complete transaction execution system that:
1. Integrates with my transaction preparation (previous step)
2. Handles secure session secret management
3. Executes transactions using Grid's signAndSend
4. Provides comprehensive error handling and retry logic
5. Updates my application state based on transaction results
6. Includes proper logging and user notifications
Show me the complete implementation with all error scenarios handled.
## DOCUMENTATION REFERENCES
- Grid SDK Documentation: https://www.npmjs.com/package/@sqds/grid
- Fault Tolerance Guide: https://grid.squads.xyz/grid/v1/accounts/fault-tolerance
```
Each prompt is self-contained with complete context, specifications, and documentation links. Copy any prompt to your LLM along with your specific technical details for comprehensive implementation guidance.
Ready to go live? Make sure to update your API endpoints to production URLs
and use your production API keys. Grid provides the same API structure across
sandbox and production environments.
# Traditional Finance Connectivity
Source: https://developers.squads.so/grid/v1/accounts/traditional-finance-connectivity
Built-in on/off ramps and KYC capabilities connecting crypto and traditional finance seamlessly
Built in traditional finance connectivity is available exclusively to Grid
Enterprise customers. Contact our team at [grid@sqds.io](mailto:grid@sqds.io)
for access.
Grid Accounts include native traditional finance connectivity through payment intents, virtual accounts, and compliance features, enabling seamless integration between crypto and traditional banking systems.
## Payment Intents
Payment intents enable secure traditional finance transfers through an authorization-based architecture:
### Supported Payment Rails
* **ACH**: Standard, push, and same-day US bank transfers
* **Wire**: Direct bank transfers with immediate settlement
* **SEPA**: European bank transfers (regular and instant)
* **SWIFT**: International wire transfers
### How It Works
1. Create a payment intent specifying amount, currency, and destination
2. Authorize the intent using your account's signing authorities
3. Grid executes the transfer through the appropriate payment rail
4. Receive real-time status updates via webhooks
## Virtual Accounts
Virtual accounts provide programmable bank account capabilities:
* **Receive traditional payments**: Accept ACH, wire, and SEPA transfers directly
* **Automatic conversion**: Incoming fiat automatically converts to stablecoins
* **Multi-currency support**: USD, EUR, and other supported currencies
* **Real-time notifications**: Instant alerts for incoming transfers
## KYC/KYB Integration
Built-in compliance features streamline customer verification:
* **Individual verification (KYC)**: Personal identification and address verification
* **Business verification (KYB)**: Business registration and beneficial ownership
* **Automated workflow**: Direct integration with verification providers
* **Compliance monitoring**: Ongoing status tracking and updates
## Key Benefits
Move between traditional finance and crypto without complex bridging
Built-in KYC/KYB ensures compliance with financial regulations
Support for multiple currencies and payment rails worldwide
Fast settlement times with immediate stablecoin availability
Traditional finance connectivity is automatically available with all Grid Accounts, requiring no additional setup or integration work.
# Get Account Balances
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/account-management/balances
GET /api/grid/v1/accounts/{address}/balances
Retrieve token balances for the specified account
# Create Account with Custom Signers
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/account-management/create-custom
POST /api/grid/v1/accounts:custom
Create a Grid smart account with custom signer configurations
Creates a smart account with email signers (MPC-managed via Turnkey/Privy) or pubkey signers (external keys you manage).
## Signer Types
**Email**: MPC-managed wallet created for the email address.
**Pubkey**: Existing Solana public key you control.
## Permissions
| Permission | Value | Description |
| -------------- | ----- | ----------------------------- |
| `CAN_INITIATE` | 1 | Create transaction proposals |
| `CAN_VOTE` | 2 | Approve or reject proposals |
| `CAN_EXECUTE` | 4 | Execute approved transactions |
Threshold cannot exceed the number of signers with `CAN_VOTE`.
## Example: 2-of-3 Treasury
```typescript theme={null}
const response = await grid.createCustomAccount({
policies: {
threshold: 2,
signers: [
{ type: "email", email: "cfo@co.com", provider: "turnkey", permissions: ["CAN_INITIATE", "CAN_VOTE", "CAN_EXECUTE"] },
{ type: "email", email: "ceo@co.com", provider: "turnkey", permissions: ["CAN_VOTE", "CAN_EXECUTE"] },
{ type: "pubkey", address: "7xK...abc", permissions: ["CAN_VOTE"] }
]
}
});
```
## Related Endpoints
* [Create Account](/grid/v1/api-reference/endpoint/account-management/post)
* [Get Account](/grid/v1/api-reference/endpoint/account-management/get)
# Get Account Details
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/account-management/get
GET /api/grid/v1/accounts/{address}
Retrieve detailed information about a specific account
# Update Account
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/account-management/patch
PATCH /api/grid/v1/accounts/{address}
Update account policies and settings
# Create Account
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/account-management/post
POST /api/grid/v1/accounts
Create a new Grid account using either email authentication or signer-based policies
There are two types of accounts that can be created with this endpoint:
* Email-based accounts
* Signer-based accounts
Learn more about the different authentication methods in the [Authentication Methods](/grid/v1/accounts/authentication-methods) guide.
Using the Grid API directly requires **advanced configurations**. Grid SDK is
the recommended way to create accounts. It handles account creation, key
management, authentication, automatic failover, and transaction signing. Learn
more about the Grid SDK in the [Grid SDK](/grid/v1/sdk-reference) guide.
## Implementation Guide
### Email-based Accounts Creation Flow
Use this endpoint to create the account specifying the email address of the
user.
Call the [Verify Account
OTP](/grid/v1/api-reference/endpoint/account-management/verify) endpoint to
complete the account creation process.
Grid accounts do not have the same address in sandbox and production. **DO NOT** send funds to the same address in both environments. Create unique accounts for each environment and ensure you use the correct address for your environment.
### Signer-based Accounts Creation Flow
Specify your own ed25519 public keys and the threshold for the account. Signer based accounts are immediately created and return the account address in the response.
```json theme={null}
{
"type": "signers",
"signers": ["publicKey1", "publicKey2", "..."],
"threshold": 2
}
```
Grid accounts do not have the same address in sandbox and production. **DO NOT** send funds to the same address in both environments. Create unique accounts for each environment and ensure you use the correct address for your environment.
# Verify Account OTP
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/account-management/verify
POST /api/grid/v1/accounts/verify
Verify OTP for email-based account creation and complete account setup
This endpoint verifies the OTP received via email and completes the account creation process by deploying a Grid Account on the Solana blockchain with TEE-encrypted authorization keys.
Using the Grid API directly requires **advanced configurations**. Grid SDK is
the recommended way to create accounts. It handles account creation, key
management, authentication, automatic failover, and transaction signing. Learn
more about the Grid SDK in the [Grid SDK](/grid/v1/sdk-reference) guide.
This is step 2 of the email-based Grid Account creation flow. You must have
called the [Create
Account](/grid/v1/api-reference/endpoint/account-management/post) endpoint to
initiate account creation before calling this endpoint.
### OTP Limits
* **Attempts**: Maximum 3 verification attempts per OTP
* **Expiration**: 15-minute window from account creation
* **Retry**: Must initiate new account creation if limits exceeded
The decrypted authorization key can be used to sign transactions on behalf of the Grid Account address.
### Required Configuration
When using Privy as the authentication provider (default), you must include a kms\_provider\_config with your HPKE public key to receive encrypted authorization keys. This enables secure transaction signing for your Grid Account.
## Complete Implementation Guide
For comprehensive implementation details including:
* **kms\_provider\_config creation**
* **HPKE keypair generation** with P-256 curve and DER formatting
* **Authorization key decryption** using ECDH + HKDF + ChaCha20-Poly1305
* **Transaction payload signing** with JSON canonicalization
* **Error handling** and security best practices
* **Language-agnostic examples**
See the [Primary Provider Integration](/grid/v1/api-reference/advanced/privy-signing) guide.
# Initiate Authentication
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/authentication/post
POST /api/grid/v1/auth
Start the authentication process by sending an OTP to the provided email address
This endpoint is for authenticating an existing user. For new users, use the
[Create Account](/grid/v1/api-reference/endpoint/account-management/post)
endpoint.
# Refresh Session
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/authentication/refresh-session
POST /api/grid/v1/auth/refresh-session
Refresh an expired authentication session and obtain new encrypted credentials
This endpoint refreshes expired authentication sessions for Grid Accounts and returns new encrypted credentials. It implements a two-tier approach to handle different expiration scenarios automatically.
Using the Grid API directly requires **advanced configurations**. Grid SDK is
the recommended way to authenticate accounts. It handles authentication, key
management, automatic failover, and transaction signing. Learn more about the
Grid SDK in the [Grid SDK](/grid/v1/sdk-reference) guide.
This endpoint requires an active bearer token from a previous authentication.
For initial authentication, use [Initiate
Authentication](/grid/v1/api-reference/endpoint/authentication/post) followed
by [Verify OTP](/grid/v1/api-reference/endpoint/authentication/verify).
## How Session Refresh Works
Grid automatically handles different token expiration states:
If the user token is still valid but the session needs refreshing, the
endpoint re-authenticates using the existing token to obtain new encrypted
credentials.
If the user token has expired, the endpoint uses the refresh token to obtain
a new user token, then re-authenticates to get new encrypted credentials.
## When to Use This Endpoint
Use this endpoint when:
* **Session credentials expire**: Your authentication session has expired and you need new credentials
* **Token rotation**: Implementing proactive token rotation for enhanced security
* **Long-running applications**: Maintaining continuous access without requiring user re-authentication
**Automatic Handling** The endpoint automatically determines which case of
refresh to use based on the token expiration state. You don't need to specify
which approach to use.
## Required Configuration
You must provide:
1. **kms\_payload**: Contains the current session information including tokens
2. **encryption\_public\_key**: Your HPKE public key for encrypting new credentials
The endpoint returns new encrypted credentials that can be decrypted using your private key.
## Complete Implementation Guide
For comprehensive implementation details including:
* **HPKE keypair generation** with P-256 curve and DER formatting
* **Encryption public key creation**
* **Authorization key decryption** using ECDH + HKDF + ChaCha20-Poly1305
* **Session management** and token handling
* **Error handling** and retry strategies
See the [Primary Provider Integration](/grid/v1/api-reference/advanced/privy-signing) guide.
## Response Data
Upon successful refresh, you receive:
* **New session credentials**: Encrypted with your public key
* **Updated tokens**: Fresh user token, access token, and refresh token
* **Provider information**: Current KMS provider details
The refreshed session remains valid until expiration, allowing you to continue making authenticated requests to Grid API endpoints.
## Supported Providers
Currently supported KMS providers:
* **Privy**: Full support for two-tier session refresh
* **Turnkey**: Coming soon
## Error Handling
Common error scenarios:
* **400 Bad Request**: Invalid encryption public key or malformed payload
* **401 Unauthorized**: Refresh token expired or invalid, user must re-authenticate
* **500 Internal Server Error**: Service error, retry with exponential backoff
# Verify OTP
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/authentication/verify
POST /api/grid/v1/auth/verify
Verify the OTP code sent to the email address and obtain authentication for existing account
This endpoint verifies the OTP received via email for an existing Grid Account and returns authentication credentials for API access.
Using the Grid API directly requires **advanced configurations**. Grid SDK is
the recommended way to authenticate accounts. It handles authentication, key
management, automatic failover, and transaction signing. Learn more about the
Grid SDK in the [Grid SDK](/grid/v1/sdk-reference) guide.
This endpoint is for authenticating existing Grid Accounts. For new account
creation, use the [Create
Account](/grid/v1/api-reference/endpoint/account-management/post) endpoint
followed by account verification.
### Authentication Flow
1. **Request OTP**: Call [Initiate Authentication](/grid/v1/api-reference/endpoint/authentication/post) with email address
2. **Generate HPKE Keypair**: Create client-side HPKE keys using P-256 curve while waiting for OTP
3. **Verify OTP**: Use this endpoint to verify the received OTP code with HPKE public key
4. **Use Credentials**: Utilize returned authentication tokens for API access
### OTP Limits
* **Attempts**: Maximum 3 verification attempts per OTP
* **Expiration**: 15-minute window from OTP generation
* **Retry**: Must request new OTP if limits exceeded
### Required Configuration
When using Privy as the authentication provider (default), you must include a `kms_provider_config` with your HPKE public key to receive encrypted authorization keys. This enables secure transaction signing for your Grid Account.
## Complete Implementation Guide
For comprehensive implementation details including:
* **kms\_provider\_config creation**
* **HPKE keypair generation** with P-256 curve and DER formatting
* **Authorization key decryption** using ECDH + HKDF + ChaCha20-Poly1305
* **Transaction payload signing** with JSON canonicalization
* **Error handling** and security best practices
* **Language-agnostic examples**
See the [Primary Provider Integration](/grid/v1/api-reference/advanced/privy-signing) guide.
### Response Data
Upon successful verification, you receive:
* **Authentication tokens** for API access
* **Account information** including Grid Account address
* **Session credentials** for subsequent API calls
The authentication session remains valid until expiration, allowing you to make authenticated requests to Grid API endpoints.
# Authorize Passkey Session
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/passkeys/auth
POST /api/grid/v1/passkeys/auth
Authenticate with an existing passkey and refresh session key for transaction signing.
The "Try It" feature is disabled for this endpoint because it initiates a WebAuthn ceremony that returns a URL. Testing requires completing the ceremony in a browser. Use the [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for implementation examples.
Creates an authentication session for an existing passkey. Returns a URL to the hosted UI where the WebAuthn authentication ceremony takes place.
The `session_key` parameter is **required** for authentication. The endpoint
will return an error if session\_key is missing or null.
## Key Features
* **Session Refresh**: Creates new session key for existing passkey
* **Hosted UI**: Returns pre-configured URL with embedded challenge
* **Custom Domains**: Support for custom baseUrl configuration
* **Cross-Platform**: Works on web, mobile, and across devices
## Request Body
### meta\_info (required)
Configuration for the hosted UI:
* **appName** (string): Display name shown to users during authentication
* **redirectUrl** (string, optional): URL to redirect after completion
### session\_key (required)
Session key configuration:
* **key** (string): Solana public key in base58 format
* **expiration** (number): Seconds from now until expiration (e.g., 900 for 15 minutes)
The session key is **mandatory** for authentication. The endpoint validates
that session\_key is not null and will throw a `MissingSessionKey` error if
omitted.
The session key format in the request uses **seconds from now** for
expiration, but the response returns a **Unix timestamp**. For example, if
you send `expiration: 900`, you'll receive back `expiration: 1234567890`
(current time + 900 seconds).
### baseUrl (optional)
* **baseUrl** (string): Custom domain for hosting the passkey flow (e.g., `https://auth.yourcompany.com`)
* If omitted, uses the default Grid hosted UI
## Response
Returns a URL for the passkey authentication ceremony:
```json theme={null}
{
"url": "https://passkey.grid.squads.xyz/auth?challenge=..."
}
```
The URL includes:
* **challenge**: Base64 encoded challenge for WebAuthn (valid for 60 seconds)
* **slot**: Solana slot number for replay protection
* **Other params**: Configuration for the hosted UI
## Implementation Flow
Create a new client-side session key using Solana's Keypair.generate()
POST to /passkeys/auth with meta\_info and session\_key (required)
Display the returned URL in an iframe (web) or WebBrowser (mobile)
Listen for postMessage events with the passkey address and session key
Use the refreshed session key to sign Grid transactions
## Important Notes
* **Session Key Required**: Unlike passkey creation, authentication **must** include a session\_key
* **Challenge Expiration**: URL is valid for 60 seconds from generation
* **Session Format**: Request uses relative seconds, response uses Unix timestamp
* **Algorithm**: Only ES256 (algorithm `-7`) is supported
* **User Presence**: WebAuthn must verify user presence
* **Session Validation**: Grid validates session expiration against Solana blockchain clock
## Error Handling
Common errors:
* **MissingSessionKey**: No session\_key provided (required for auth)
* **InvalidMetaInfo**: Missing or invalid appName
* **InvalidSessionKey**: Malformed session key format
* **InvalidBaseUrl**: Custom baseUrl format invalid
* **NoValidExternallySignedAccount**: Passkey not found
## Related Endpoints
* [Create Passkey Session](/grid/v1/api-reference/endpoint/passkeys/post) - Create new passkey
* [Submit Passkey Session](/grid/v1/api-reference/endpoint/passkeys/submit) - Submit WebAuthn response
* [Get Passkey Account](/grid/v1/api-reference/endpoint/passkeys/get-account) - Retrieve passkey details
# Create Smart Account
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/passkeys/create-account
POST /api/grid/v1/passkeys/account
Create a passkey and Grid smart account in one atomic operation.
The "Try It" feature is disabled because this endpoint requires a WebAuthn authenticator response. Use the [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for implementation examples.
Creates both a passkey account and a Grid smart account in a **single atomic transaction**. Pass the raw WebAuthn `authenticatorResponse` directly—the passkey does not need to exist beforehand.
This endpoint creates the passkey from your WebAuthn response. You do **not** need to call `/passkeys/submit` first.
## What Gets Created
In one transaction:
* **Passkey account** — derived from your WebAuthn public key
* **1/1 smart account** — with the passkey as sole signer (mask=7: full permissions)
* **Database records** — GridUser, GridSmartAccount, and audit trail
* **1 USDC funding** — sandbox only
## Implementation Flow (Direct API)
Create a Solana keypair for the session.
Fetch the current Solana slot number for replay protection.
Call `navigator.credentials.create()` to create the passkey on the user's device.
Pass the raw `authenticatorResponse` to create both accounts atomically.
```typescript theme={null}
// After WebAuthn ceremony completes
const response = await fetch("/passkeys/account", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
"x-grid-environment": "sandbox"
},
body: JSON.stringify({
sessionKey: { key: sessionPublicKey, expiration: 900 },
slotNumber: currentSlot,
authenticatorResponse: credential.response // raw WebAuthn response
})
});
```
## Timing Constraints
The `slotNumber` must be within Solana's SlotHashes window (\~3 minutes / 512 slots). If you encounter slot-related errors, fetch a fresh slot and retry.
**Environment Isolation**: Smart accounts have different addresses in sandbox vs production. Never send funds to the wrong environment.
## Related Endpoints
* [Create Passkey Session](/grid/v1/api-reference/endpoint/passkeys/post) — Hosted UI flow (alternative)
* [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) — Complete implementation examples
```json Response theme={null}
{
"address": "5nPmK...smartAccountAddress",
"type": "passkey",
"status": "active",
"policies": {
"threshold": 1,
"admin_address": null
},
"authentication": [
{
"provider": "passkey",
"session": {
"Passkey": {
"passkey_account": "7xK2...passkeyAddress",
"pubkey": "base58EncodedPublicKey",
"relying_party_id": "grid.squads.xyz",
"session_key": {
"key": "sessionPublicKey",
"expiration": 1706832000
}
}
}
}
],
"created_at": "2025-02-01T12:00:00Z",
"updated_at": "2025-02-01T12:00:00Z"
}
```
# Find Passkey Account
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/passkeys/find
POST /api/grid/v1/passkeys/find
Locate a passkey account using WebAuthn authenticator response data.
The "Try It" feature is disabled for this endpoint because it requires cryptographic WebAuthn authenticator response data that can only be generated during a browser WebAuthn ceremony. Use the [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for implementation examples.
Finds and retrieves a passkey account by submitting a WebAuthn authenticator response. Useful for account recovery flows and cross-device login where you have the authenticator credential but not the on-chain address.
## Use Cases
* **Account Recovery**: User forgot which account they used but has the passkey
* **Cross-Device Login**: User switches devices with synced passkeys
* **Multi-Passkey Management**: Select which passkey/account to use
## Implementation Flow
User triggers WebAuthn get() with appropriate challenge
Browser/device returns authenticator response
POST authenticator response to /passkeys/find
Continue with account operations using returned address and session key
This endpoint only finds existing accounts—it doesn't create new ones. The response includes a fresh session key regardless of existing session status.
## Related Endpoints
* [Get Passkey Account](/grid/v1/api-reference/endpoint/passkeys/get-account) - Get account by address
* [Get Passkey Session](/grid/v1/api-reference/endpoint/passkeys/get-session) - Get session URL for lookup
* [Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth) - Standard authentication flow
# Get Passkey Account
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/passkeys/get-account
GET /api/grid/v1/passkeys/account/{passkey_account_address}
Retrieve passkey account details including relying party ID, public key, and session key status.
Retrieves detailed information about a passkey account including its relying party ID, public key, and current session key if not expired.
## Path Parameters
* **passkey\_account\_address** (required): The on-chain Solana address of the passkey account
## Response
Returns passkey account details:
```json theme={null}
{
"relying_party_id": "example.com",
"pubkey": "9yM...def", // Passkey public key in base58
"session_key": {
// Optional: Only if session is still valid
"key": "3pQ...ghi",
"expiration": 1234567890 // Unix timestamp
}
}
```
## Session Key Validation
The endpoint performs session key expiration validation:
1. **Checks Blockchain Clock**: Queries Solana for current slot/timestamp
2. **Validates Expiration**: Compares session expiration against blockchain time
3. **Returns if Valid**: Includes session\_key in response if not expired
4. **Omits if Expired**: session\_key field not included if expired
Session validation is performed against the **Solana blockchain clock**, not
the API server time. This ensures consistent validation across all Grid
services.
## Use Cases
### Check Session Status
Determine if an existing session key is still valid:
```javascript theme={null}
const response = await fetch(
`https://grid.squads.xyz/api/grid/v1/passkeys/account/${passkeyAddress}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"x-grid-environment": "sandbox",
},
}
);
const data = await response.json();
if (data.session_key) {
console.log("Session is valid until:", new Date(data.session_key.expiration * 1000));
// Use existing session
} else {
console.log("Session expired, need to re-authenticate");
// Call /passkeys/auth to refresh
}
```
### Verify Passkey Existence
Check if a passkey account exists before operations:
```javascript theme={null}
try {
const response = await fetch(
`https://grid.squads.xyz/api/grid/v1/passkeys/account/${passkeyAddress}`,
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"x-grid-environment": "sandbox",
},
}
);
if (response.ok) {
console.log("Passkey exists");
}
} catch (error) {
console.error("Passkey not found");
}
```
### Get Relying Party Information
Retrieve the relying party ID for cross-origin validation:
```javascript theme={null}
const data = await response.json();
console.log("Relying Party:", data.relying_party_id);
// Use for WebAuthn RP configuration
```
## Response Fields
### relying\_party\_id
The WebAuthn relying party identifier associated with this passkey. Limited to 32 bytes. Used for validating WebAuthn operations.
### pubkey
The passkey's public key in base58 format. This is the cryptographic public key used to verify signatures from this passkey.
### session\_key (optional)
Only included if a session key exists and has not expired:
* **key**: Session public key in base58 format
* **expiration**: Unix timestamp when session expires
## Important Notes
* **Blockchain Validation**: Session expiration checked against Solana clock
* **Expired Sessions**: session\_key omitted if expired (not an error)
* **Passkey Persistence**: Passkey data persists even after session expiration
* **RP ID Limit**: Relying party IDs are limited to 32 bytes
* **Cross-Origin**: Relying party ID must match WebAuthn origin
## Error Handling
Common errors:
* **NoValidExternallySignedAccount**: Passkey address not found
* **InvalidExternallySignedAccountAddress**: Malformed address
* **NotFound**: Passkey account does not exist
## Related Endpoints
* [Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth) - Refresh expired session
* [Find Passkey Account](/grid/v1/api-reference/endpoint/passkeys/find) - Lookup by authenticator
* [Get Passkey Session](/grid/v1/api-reference/endpoint/passkeys/get-session) - Get session URL
# Get Passkey Session
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/passkeys/get-session
GET /api/grid/v1/passkeys/find
Retrieve a session URL with challenge for passkey account lookup operations.
The "Try It" feature is disabled for this endpoint because it initiates a WebAuthn ceremony that returns a URL. Testing requires completing the ceremony in a browser. Use the [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for implementation examples.
Generates a session URL containing a WebAuthn challenge for passkey account lookup operations. Use when you need to find a passkey account but don't have the authenticator response yet.
This endpoint returns a **URL** for initiating a passkey lookup ceremony, while [Find Passkey Account](/grid/v1/api-reference/endpoint/passkeys/find) (POST /passkeys/find) accepts an authenticator response and returns account details.
## Implementation Flow
GET /passkeys/find to retrieve session URL
Display URL in iframe (web) or WebBrowser (mobile)
User completes WebAuthn get() ceremony
Hosted UI returns passkey account address via postMessage or redirect
## GET vs POST Comparison
| Feature | GET /passkeys/find (This Endpoint) | POST /passkeys/find |
| ------------------- | ---------------------------------- | --------------------------------- |
| Purpose | Get session URL for lookup | Submit response to find account |
| Input | None (headers only) | Authenticator response |
| Output | URL with challenge | Passkey account address + session |
| Creates Session Key | No | Yes |
Challenge is valid for 60 seconds. This endpoint doesn't create a session key—use /passkeys/auth for that.
## Related Endpoints
* [Find Passkey Account](/grid/v1/api-reference/endpoint/passkeys/find) - Submit response to find account
* [Get Passkey Account](/grid/v1/api-reference/endpoint/passkeys/get-account) - Get account by address
* [Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth) - Standard authentication
# Create Passkey Session
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/passkeys/post
POST /api/grid/v1/passkeys
Initialize a passkey creation session and receive a hosted UI URL for WebAuthn ceremony.
The "Try It" feature is disabled for this endpoint because it initiates a WebAuthn ceremony that returns a URL. Testing requires completing the ceremony in a browser. Use the [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for implementation examples.
Creates a new passkey session for registering a passkey on a user's device. Returns a URL to the hosted UI where the WebAuthn passkey creation ceremony takes place.
## Key Features
* **Hosted UI**: Returns a pre-configured URL with embedded challenge
* **Session Management**: Associates session key for transaction signing
* **Custom Domains**: Support for custom baseUrl configuration
* **Cross-Platform**: Works on web, mobile, and across devices
## Request Body
### meta\_info (required)
Configuration for the hosted UI:
* **appName** (string): Display name shown to users during passkey creation
* **redirectUrl** (string, optional): URL to redirect after completion
### sessionKey (optional)
Session key configuration:
* **key** (string): Solana public key in base58 format
* **expiration** (number): Seconds from now until expiration (e.g., 900 for 15 minutes)
The session key format in the request uses **seconds from now** for
expiration, but the response returns a **Unix timestamp**. For example, if
you send `expiration: 900`, you'll receive back `expiration: 1234567890`
(current time + 900 seconds).
### baseUrl (optional)
* **baseUrl** (string): Custom domain for hosting the passkey flow (e.g., `https://auth.yourcompany.com`)
* If omitted, uses the default Grid hosted UI
## Response
Returns a URL for the passkey creation ceremony:
```json theme={null}
{
"url": "https://passkey.grid.squads.xyz/create?challenge=..."
}
```
The URL includes:
* **challenge**: Base64 encoded challenge for WebAuthn (valid for 60 seconds)
* **slot**: Solana slot number for replay protection
* **Other params**: Configuration for the hosted UI
## Implementation Flow
Create a client-side session key using Solana's Keypair.generate()
POST to /passkeys with meta\_info and sessionKey
Display the returned URL in an iframe (web) or WebBrowser (mobile)
Listen for postMessage events with the passkey address
Use the passkey address to create a Grid smart account
## Important Notes
* **Challenge Expiration**: URL is valid for 60 seconds from generation
* **Session Format**: Request uses relative seconds, response uses Unix timestamp
* **Algorithm**: Only ES256 (algorithm `-7`) is supported
* **User Presence**: WebAuthn must verify user presence
* **Next Step**: After successful passkey creation, use the [Create Smart Account](/grid/v1/api-reference/endpoint/passkeys/create-account) endpoint to deploy a Grid account
## Error Handling
Common errors:
* **InvalidMetaInfo**: Missing or invalid appName
* **InvalidSessionKey**: Malformed session key
* **InvalidBaseUrl**: Custom baseUrl format invalid
## Related Endpoints
* [Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth) - Authenticate with existing passkey
* [Submit Passkey Session](/grid/v1/api-reference/endpoint/passkeys/submit) - Submit WebAuthn response
* [Create Smart Account](/grid/v1/api-reference/endpoint/passkeys/create-account) - Deploy account with passkey
# Submit Passkey Session
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/passkeys/submit
POST /api/grid/v1/passkeys/submit
Submit WebAuthn ceremony data to complete passkey creation or authentication.
The "Try It" feature is disabled for this endpoint because it requires cryptographic WebAuthn authenticator response data that can only be generated during a browser WebAuthn ceremony. Use the [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for implementation examples.
Submits the WebAuthn authenticator response to complete passkey creation or authentication. Processes ceremony data and executes on-chain transaction to initialize or refresh the passkey.
Only ES256 (algorithm `-7`) signatures are supported. The authenticator response must verify user presence.
## Implementation Flow
User completes passkey creation or authentication in hosted UI or custom UI
Retrieve the complete authenticator response from the WebAuthn API
POST to /passkeys/submit with ceremony type, session key, slot, and response
Receive passkey\_account address and session\_key for transaction signing
## Related Endpoints
* [Create Passkey Session](/grid/v1/api-reference/endpoint/passkeys/post) - Initialize passkey creation
* [Authorize Passkey Session](/grid/v1/api-reference/endpoint/passkeys/auth) - Start authentication
* [Get Passkey Account](/grid/v1/api-reference/endpoint/passkeys/get-account) - Retrieve passkey details
# Delete Spending Limit
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/spending-limits/delete
DELETE /api/grid/v1/accounts/{address}/spending-limit/{spending_limit_address}
Delete an existing spending limit
# Update Spending Limit
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/spending-limits/patch
PATCH /api/grid/v1/accounts/{address}/spending-limit/{spending_limit_address}
Update an existing spending limit
# Create Spending Limit
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/spending-limits/post
POST /api/grid/v1/accounts/{address}/spending-limit
Create a new spending limit for the account
Create a spending limit to enable controlled, recurring payments without requiring full account authority signatures. Spending limits provide a secure way to delegate payment authority for specific tokens and amounts.
## Spending Limit Concepts
### Period Types
* **ONE\_TIME**: Single-use allowance
* **DAILY**: Resets every 24 hours
* **WEEKLY**: Resets every 7 days
* **MONTHLY**: Resets every 30 days
### Key Components
* **Amount**: Maximum spendable amount in smallest token units
* **Mint**: Token contract address (e.g., USDC, SOL)
* **Period**: How often the limit resets
* **Spending Limit Signers**: Authorized addresses that can use the limit
* **Destinations**: Optional list of allowed recipient addresses
* **Expiration**: Optional expiration timestamp
## Security Model
Spending limits operate with reduced security requirements compared to full account operations:
1. **Creation**: Requires full account authority signatures
2. **Usage**: Only requires spending limit signer authorization
3. **Updates**: Requires full account authority signatures
4. **Deletion**: Requires full account authority signatures
## Use Cases
* **Employee Expenses**: Allow employees to spend within limits
* **Subscription Payments**: Automate recurring payments
* **DeFi Operations**: Enable automated DeFi strategies
* **Bill Payments**: Simplify recurring bill payments
## Important Notes
* Amounts are specified in the token's smallest unit (e.g., 1 USDC = 1,000,000 units)
* Spending limits reset automatically based on the period
* Unused amounts don't carry over to the next period
* Multiple spending limits can exist for different tokens
* Spending limit addresses are generated deterministically
# Use Spending Limit
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/spending-limits/use
POST /api/grid/v1/accounts/{address}/spending-limit/{spending_limit_address}/transactions
Execute a transaction using the spending limit
# Delete Standing Order
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/standing-orders/delete
DELETE /api/grid/v1/accounts/{address}/standing-order/{standing_order_id}
Cancel a standing order and stop all future recurring payments
# Get Standing Order
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/standing-orders/get
GET /api/grid/v1/accounts/{address}/standing-order/{standing_order_id}
Retrieve details of a specific standing order
# List Standing Orders
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/standing-orders/list
GET /api/grid/v1/accounts/{address}/standing-orders
Retrieve all standing orders for the account
# Create Standing Order
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/standing-orders/post
POST /api/grid/v1/accounts/{address}/standing-order-intent
Create a new recurring standing order
# Changelog
Source: https://developers.squads.so/grid/v1/changelog
Track all notable changes to the Grid API
### Breaking Changes
* **Payment Intent Fee Config**: The `create_payment_intent` endpoint requires a `fee_config` field for non-enterprise tier customers. This field specifies who pays the transaction fee and in which currency. Requests without `fee_config` will return a `missing_fee_config` error.
* [Create Payment Intent - Fee Config Migration](/grid/v1/api-reference/endpoint/payment-intents/post#fee-config-breaking-change)
### Improvements
* **Proposals API Documentation**: Added comprehensive documentation for the Proposals API, including endpoint references for multi-signature proposals:
* [Create Proposal](/grid/v1/api-reference/endpoint/proposals/create) - Initiate new proposals
* [List Proposals](/grid/v1/api-reference/endpoint/proposals/list) - Query proposals by account
* [Get Proposal](/grid/v1/api-reference/endpoint/proposals/get) - Retrieve proposal details
* [Vote on Proposal](/grid/v1/api-reference/endpoint/proposals/vote) - Approve, reject, or cancel
* [Vote and Execute](/grid/v1/api-reference/endpoint/proposals/vote-and-execute) - Single-step approval and execution
* **Passkey Create Account**: Fixed outdated endpoint description and added accurate response examples showing passkey-based authentication data.
* [Create Passkey Account](/grid/v1/api-reference/endpoint/passkeys/create-account)
* **Passkey Timing Constraints**: Added documentation explaining the \~3 minute slot hash window for passkey challenges.
* [Integration Guide - Timing Constraints](/grid/v1/accounts/passkeys/integration-guide#timing-constraints)
* **Legacy Docs Navigation**: Restored visibility of legacy API documentation for users migrating from older versions.
### New Features
* **Custom Account Creation Endpoint**: New `/accounts/create:custom` endpoint allows creating accounts with custom policies directly. This enables advanced account configurations without requiring the standard account creation flow.
* [Create Custom Account](/grid/v1/api-reference/endpoint/account-management/create-custom)
### SDK Updates
* **TypeScript SDK**: Updated documentation to latest version with improved quickstart guide.
* [TypeScript SDK Quickstart](/grid/v1/sdk-reference/typescript/reference/latest/quickstart)
* **React SDK**: Promoted from experimental to latest stable version with full passkey authentication support.
* [React SDK Quickstart](/grid/v1/sdk-reference/react/reference/latest/quickstart)
* **React Native SDK**: Updated documentation with latest interfaces and quickstart improvements.
* [React Native SDK Quickstart](/grid/v1/sdk-reference/react-native/reference/latest/quickstart)
### New Features
* **Passkeys API Reference**: Complete API reference documentation for passkey-based authentication endpoints:
* [Create Passkey](/grid/v1/api-reference/endpoint/passkeys/post) - Register a new passkey
* [Authorize Session](/grid/v1/api-reference/endpoint/passkeys/auth) - Start WebAuthn authentication
* [Submit Session](/grid/v1/api-reference/endpoint/passkeys/submit) - Complete authentication flow
* [Create Account](/grid/v1/api-reference/endpoint/passkeys/create-account) - Create passkey + smart account atomically
* [Find Account](/grid/v1/api-reference/endpoint/passkeys/find) - Look up passkey accounts
* [Get Account](/grid/v1/api-reference/endpoint/passkeys/get-account) - Retrieve account details
* [Get Session](/grid/v1/api-reference/endpoint/passkeys/get-session) - Check session status
Note: Try-it functionality is disabled for passkey endpoints that require WebAuthn browser interaction.
* See [Passkeys Introduction](/grid/v1/accounts/passkeys/introduction) and [Integration Guide](/grid/v1/accounts/passkeys/integration-guide) for implementation details.
### Improvements
* **API Reference Structure**: Reorganized API reference endpoints for better discoverability.
* **OpenAPI Integration**: Improved OpenAPI schema positioning for accurate endpoint documentation.
# Grid for Neobanks
Source: https://developers.squads.so/grid/v1/examples/neobank
React Native reference implementation demonstrating Grid SDK integration for building a fintech neobank
Learn how to integrate the [@sqds/grid SDK](https://www.npmjs.com/package/@sqds/grid) to build a complete neobank experience.
**Demo Application:** This is intended for educational and demonstration
purposes only.
## Overview
The neobank reference implementation showcases a complete financial application built with React Native, TypeScript, and the Grid SDK. It demonstrates best practices for SDK integration and provides a foundation for building your own financial products.
Access the complete source code and documentation for the neobank example app
## Key Features
Email-based login with OTP verification for secure user access
Streamlined identity verification process
Create and manage user bank accounts programmatically
Fiat deposits, withdrawals, and USDC transfers with transaction history
## Technical Stack
* **Framework:** React Native with Expo
* **Language:** TypeScript
* **SDK:** @sqds/grid
* **Architecture:** Modern Expo Router structure
* **Backend:** Secure API routes with environment-based configuration
## Quick Start
Visit the [Grid Dashboard](https://dashboard.grid.squads.xyz) to generate your API keys and credentials.
```bash theme={null}
git clone https://github.com/Squads-Grid/neobank-example-app.git
```
```bash theme={null}
cd neobank-example-app
npm install
```
```bash theme={null}
cp example.env .env
```
Add your Grid SDK credentials from the dashboard to the `.env` file
```bash theme={null}
npx expo start
```
## What You'll Learn
* Secure Grid SDK integration patterns
* Singleton pattern for SDK client management
* Environment-based configuration
* Clean separation of frontend and backend concerns
* Best practices for financial application development
## Next Steps
Get started with Grid SDK integration
Learn fundamental Grid concepts
# Pricing
Source: https://developers.squads.so/grid/v1/pricing
Choose the plan that best fits your needs and scale your operations.
Grid is the stablecoin API for teams that need performance and reliability at scale. With a single API, you unlock:
* Fault-tolerant accounts
* Cross-rail payments (stablecoin, ACH, Wire, SEPA)
* Automated payments and workflows
* Yield integrations (coming soon)
* Read and write access to the chain, no RPCs required
All powered by infrastructure engineered for reliability, recovery, and performance.
## Pricing Plans
| Feature | **Basic** | **Pro** | **Enterprise** |
| ------------------------ | --------------------------------- | ----------------------------------------------- | ---------------------------------- |
| **Price** | **Free** | **\$499.00/month** | **Custom pricing** |
| **Description** | Get started building immediately | Fuel your app's growth | Custom plan for your product needs |
| **Monthly Active Users** | Up to 1k Grid Accounts MAUs | Up to 5k MAUs | Pricing per Grid Account MAUs |
| **Fault Tolerance** | Built-in | Everything in Basic | Everything in Pro |
| **Solana Assets** | Send and receive any Solana asset | Everything in Basic | Everything in Pro |
| **Transaction Fees** | Pay in USDC or SOL | Everything in Basic | Everything in Pro |
| **Automation Policies** | Create and manage | Everything in Basic + fully managed automations | Everything in Pro |
| **2FA Security** | Native onchain passkey signers | Everything in Basic | Everything in Pro |
| **Solana Support** | Arbitrary transaction support | Everything in Basic | Everything in Pro |
| **Fee Sponsorship** | Not available | Sponsor all fees for users, billed in arrears | Everything in Pro |
| **On/Off Ramp** | Not available | Not available | Send and receive on ACH/SEPA/Wire |
| **Virtual Accounts** | Not available | Not available | ACH/SEPA support |
| **KYC Operations** | Not available | Not available | KYC/KYB verification |
# Grid Developer Platform
Source: https://developers.squads.so/welcome
Ship with stablecoins 10x faster
The stablecoin API for accounts, payments, cards, and yield
Ship stablecoin products with confidence on infrastructure securing over \$15B
The stablecoin API for accounts, payments, cards, and yield
Ship stablecoin products with confidence on infrastructure securing over \$15B
Build with Grid
Create and manage programmable non-custodial accounts for your users at scale
Ship global products in weeks not months at a fraction of the cost
Enable your users to send, receive and hold stablecoins globally
Get Started
Generate an API key and start building. Manage your team and API keys on the
dashboard.
Make your first API call in minutes with our comprehensive getting started
guide.
Learn the fundamental concepts behind Grid's open finance platform.
# Primary Provider Integration
Source: https://developers.squads.so/grid/v1/api-reference/advanced/privy-signing
Language-agnostic implementation details for direct API integration with email-based Grid Accounts with Privy as the primary key management service.
Using the Grid API directly requires **advanced configurations**. Grid SDK is
the recommended way to create accounts. It handles account creation, key
management, authentication, automatic failover, and transaction signing. Learn
more about the Grid SDK in the [Grid SDK](/grid/v1/sdk-reference) guide.
Grid uses Privy as the default key management service for email-based accounts. This guide covers the complete implementation process for making direct API calls with default configuration email-based accounts.
Privy uses **TEE-based HPKE encryption** with specific cryptographic algorithms and requires **JSON canonicalization** for payload signing.
## Overview
Privy is Grid's **default provider** in a multi-provider authentication system
that includes Turnkey, Passkey, and optional external signers. To learn more
about the multi-provider authentication system, see how [Grid
Accounts](/grid/v1/accounts/fault-tolerance) work.
This guide provides language-agnostic implementation details for recreating the complete Grid SDK account creation and signing flow.
### Implementation Process
Call POST /accounts to start the account creation process
Create client-side HPKE keys using P-256 curve while waiting for OTP
Complete account creation via POST /accounts/verify with HPKE public key
Grid returns the authorization key encrypted with HPKE
Use your private key to decrypt the authorization key for transaction signing
Sign payloads using JSON canonicalization and ECDSA
### Implementation Responsibilities
**Client-side requirements:**
* Generate HPKE keypairs using P-256 curve and proper key formatting
* Decrypt authorization keys received from Privy using HPKE
* Sign transaction payloads with JSON canonicalization and ECDSA
**Server-side automation:**
* Creates Grid Accounts on Solana blockchain
* Generates authorization keys in Privy
* Returns encrypted authorization keys using your HPKE public key
* Submits signed transactions for payment intents, KYC operations, and other transactions
## Complete Implementation Flow
The Grid SDK account creation and transaction signing flow consists of **cryptographic key generation**, **2 API calls**, and **transaction signing**:
Use the [account creation endpoint](/grid/v1/api-reference/endpoint/account-management/post) to initiate the account creation process.
**What Happens**:
1. Server creates account record in pending state
2. Server generates and sends 6-digit OTP to email address
3. Server returns account metadata with 15-minute expiration
**While waiting for OTP**: Create P-256 HPKE keys with SPKI/PKCS#8 DER
formatting and store private key securely. See the [HPKE Keypair
Generation](#hpke-keypair-generation) section below for detailed
implementation.
Submit the OTP code to the [verification endpoint](/grid/v1/api-reference/endpoint/account-management/verify) to complete the account creation process.
**Request**:
```http theme={null}
POST /accounts/verify
Authorization: Bearer {apiKey}
Content-Type: application/json
{
"email": "user@example.com",
"otp_code": "123456",
"provider": "privy", // default provider
"kms_provider_config": {
"encryption_public_key": "MFkwEwYHKoZI..." // SPKI base64
},
"expiration": 1705408800 // Optional Unix timestamp
}
```
**Response**:
```json theme={null}
{
"address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"grid_user_id": "550e8400-e29b-41d4-a716-446655440000",
"policies": {
"spending_limits": [],
"transaction_filters": [],
"allowlists": []
},
"authentication": [
{
"provider": "Privy",
"session": {
"user_id": "did:privy:cm4abc123...",
"session": {
"encrypted_authorization_key": {
"encapsulated_key": "MFkwEwYHKoZI...", // Base64 ephemeral public key
"ciphertext": "A8B9C7D6E5F4..." // Base64 HPKE-encrypted auth key
}
}
}
}
]
}
```
**What Happens**:
1. Server verifies OTP code against email (15-minute window)
2. Server creates Grid Account on Solana blockchain
3. Privy generates authorization key in TEE using the HPKE keypair generated
4. Privy encrypts authorization key using client's HPKE public key
5. Grid returns Grid Account address and encrypted authorization key
Decrypt authorization key using ECDH + HKDF + ChaCha20-Poly1305 with your
private key. See the [Decrypting Authorization
Keys](#decrypting-authorization-keys) section below for detailed
implementation.
Remove "wallet-auth:" prefix from decrypted plaintext if present.
When making API calls that require signing, endpoints will return a KMS
payload that you need to sign with the authorization key.
Recursively sort all object keys in KMS payload alphabetically. See the [JSON
Canonicalization](#json-canonicalization) section for implementation details.
Find \[0x04, 0x20] pattern in auth key, extract 32 bytes following it. See the
[Extract Signing Key](#extract-signing-key) section for implementation.
ECDSA P-256 SHA-256 sign the canonicalized JSON string. See the [Sign the
Payload](#sign-the-payload) section for implementation.
Send signed transaction to Grid API to the [Transaction Submission endpoint](/grid/v1/api-reference/endpoint/transaction-operations/submit) with the signature.
### Existing Account Authentication
For existing accounts, use [POST /auth/verify](/grid/v1/api-reference/endpoint/authentication/verify) with the same encrypted authorization key format.
## HPKE Keypair Generation
**Before calling the verification endpoint**, you must generate an HPKE keypair client-side using **P-256 curve** with proper **DER formatting**.
### Required Cryptographic Libraries
* **Elliptic Curve Cryptography**: P-256 (secp256r1) curve support
* **HKDF**: HMAC-based Key Derivation Function (RFC 5869)
* **ChaCha20-Poly1305**: AEAD encryption (RFC 8439)
* **DER Encoding/Decoding**: PKCS#8 and SPKI format support
* **Base64 Encoding/Decoding**: Standard base64 operations
### Key Format Specifications
**SPKI Public Key Structure (DER-encoded)**:
```
SEQUENCE {
SEQUENCE {
OBJECT IDENTIFIER 1.2.840.10045.2.1 (ecPublicKey)
OBJECT IDENTIFIER 1.2.840.10045.3.1.7 (prime256v1)
}
BIT STRING (65 bytes: 0x04 + 32-byte X + 32-byte Y coordinates)
}
```
**PKCS#8 Private Key Structure (DER-encoded)**:
```
SEQUENCE {
INTEGER 0
SEQUENCE {
OBJECT IDENTIFIER 1.2.840.10045.2.1 (ecPublicKey)
OBJECT IDENTIFIER 1.2.840.10045.3.1.7 (prime256v1)
}
OCTET STRING {
SEQUENCE {
INTEGER 1
OCTET STRING (32-byte private key)
}
}
}
```
### Generate HPKE Keys
```typescript TypeScript theme={null}
import { p256 } from '@noble/curves/p256';
// Generate HPKE keypair for Privy
function generateHPKEKeyPair() {
// Generate random 32-byte private key
const privateKeyBytes = p256.utils.randomPrivateKey();
const publicKeyBytes = p256.getPublicKey(privateKeyBytes);
// Format as SPKI (public) and PKCS#8 (private)
const spkiPublicKey = createSPKIPublicKey(publicKeyBytes);
const pkcs8PrivateKey = createPKCS8PrivateKey(privateKeyBytes);
return {
publicKey: Buffer.from(spkiPublicKey).toString('base64'),
privateKey: Buffer.from(pkcs8PrivateKey).toString('base64')
};
}
// Algorithm:
// 1. Generate random 32-byte private key using P-256 curve
// 2. Compute public key: publicKey = privateKey \* G (curve point)
// 3. Wrap public key in SPKI DER format
// 4. Wrap private key in PKCS#8 DER format
// 5. Base64-encode both keys
// Store the private key securely - you'll need it to decrypt the response!
const keypair = generateHPKEKeyPair();
```
```python Python theme={null}
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
import base64
# Generate HPKE keypair for Privy
def generate_hpke_keypair():
# Generate P-256 private key
private_key = ec.generate_private_key(ec.SECP256R1())
public_key = private_key.public_key()
# Serialize to DER format
public_key_spki = public_key.public_key_bytes(
encoding=serialization.Encoding.DER,
format=serialization.PublicFormat.SubjectPublicKeyInfo
)
private_key_pkcs8 = private_key.private_bytes(
encoding=serialization.Encoding.DER,
format=serialization.PrivateFormat.PKCS8,
encryption_algorithm=serialization.NoEncryption()
)
return {
'public_key': base64.b64encode(public_key_spki).decode(),
'private_key': base64.b64encode(private_key_pkcs8).decode()
}
# Algorithm:
# 1. Generate random 32-byte private key using P-256 curve
# 2. Compute public key from private key
# 3. Serialize public key to SPKI DER format
# 4. Serialize private key to PKCS#8 DER format
# 5. Base64-encode both keys
# Store the private key securely - you'll need it to decrypt the response!
keypair = generate_hpke_keypair()
```
### Using the Public Key in API Calls
Include your **public key** in the `kms_provider_config` when calling:
**Account Verification:**
```http theme={null}
POST /accounts/verify
{
"email": "user@example.com",
"otp_code": "123456",
"provider": "privy",
"kms_provider_config": {
"encryption_public_key": "MFkwEwYHKoZI..." // Your generated public key
}
}
```
**Account Authentication:**
```http theme={null}
POST /auth/verify
{
"email": "user@example.com",
"otp_code": "123456",
"provider": "privy",
"kms_provider_config": {
"encryption_public_key": "MFkwEwYHKoZI..." // Your generated public key
}
}
```
**Critical**: Store your private key securely! You need it to decrypt the
`encrypted_authorization_key` that Grid returns. If you lose the private key,
you cannot decrypt the authorization key and will need to re-authenticate.
## Decrypting Authorization Keys
After receiving the encrypted response from either endpoint, use your private key to decrypt the authorization key.
```typescript TypeScript theme={null}
import { CipherSuite, KemId, KdfId, AeadId } from "@hpke/core";
async function decryptAuthorizationKey(
encryptedData: any,
privateKeyB64: string
): Promise {
// Configure HPKE suite for Privy
const suite = new CipherSuite({
kem: KemId.DhP256HkdfSha256,
kdf: KdfId.HkdfSha256,
aead: AeadId.Chacha20Poly1305
});
// Decode the encrypted data
const encapsulatedKey = Buffer.from(encryptedData.encapsulated_key, 'base64');
const ciphertext = Buffer.from(encryptedData.ciphertext, 'base64');
const privateKeyDer = Buffer.from(privateKeyB64, 'base64');
// Create recipient context
const recipient = await suite.createRecipientContext({
recipientKey: privateKeyDer,
enc: encapsulatedKey,
info: new Uint8Array(), // Empty info
});
// Decrypt the ciphertext
const plaintext = await recipient.open(ciphertext, new Uint8Array()); // Empty AAD
const authKey = new TextDecoder().decode(plaintext);
// Remove "wallet-auth:" prefix if present
return authKey.replace("wallet-auth:", "");
}
// Usage after API call
const privyAuth = response.authentication.find(auth => auth.provider === 'Privy');
const encryptedAuthKey = privyAuth.session.session.encrypted_authorization_key;
const decryptedAuthKey = await decryptAuthorizationKey(encryptedAuthKey, keypair.privateKey);
```
```python Python theme={null}
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
import base64
def decrypt_authorization_key(encrypted_data, private_key_b64):
# Import private key from PKCS#8 DER
private_key_der = base64.b64decode(private_key_b64)
private_key = serialization.load_der_private_key(private_key_der, password=None)
# Import ephemeral public key from SPKI DER
ephemeral_key_der = base64.b64decode(encrypted_data['encapsulated_key'])
ephemeral_key = serialization.load_der_public_key(ephemeral_key_der)
# Perform ECDH to get shared secret
shared_secret = private_key.exchange(ec.ECDH(), ephemeral_key)
# HPKE Suite IDs for key derivation context
KEM_SUITE_ID = b'KEM' + (0x0010).to_bytes(2, 'big') # 7 bytes
HPKE_SUITE_ID = (0x0010).to_bytes(2, 'big') + (0x0001).to_bytes(2, 'big') + (0x0003).to_bytes(2, 'big')
# HKDF key derivation following RFC 9180
# Step 1: Extract KEM shared secret
kem_hkdf = HKDF(
algorithm=hashes.SHA256(),
length=32,
salt=b'',
info=b'eae_prk' + KEM_SUITE_ID
)
kem_shared_secret = kem_hkdf.derive(shared_secret)
# Step 2: Expand to get decryption key
decrypt_hkdf = HKDF(
algorithm=hashes.SHA256(),
length=32,
salt=kem_shared_secret,
info=b'key' + HPKE_SUITE_ID
)
decrypt_key = decrypt_hkdf.derive(b'')
# Step 3: Expand to get base nonce
nonce_hkdf = HKDF(
algorithm=hashes.SHA256(),
length=12,
salt=kem_shared_secret,
info=b'base_nonce' + HPKE_SUITE_ID
)
base_nonce = nonce_hkdf.derive(b'')
# Decrypt with ChaCha20-Poly1305
cipher = ChaCha20Poly1305(decrypt_key)
ciphertext = base64.b64decode(encrypted_data['ciphertext'])
plaintext = cipher.decrypt(base_nonce, ciphertext, None) # No AAD
auth_key = plaintext.decode()
# Remove "wallet-auth:" prefix if present
return auth_key.replace("wallet-auth:", "")
# Usage after POST /accounts/verify response
privy_auth = next(auth for auth in response['authentication'] if auth['provider'] == 'Privy')
encrypted_auth_key = privy_auth['session']['session']['encrypted_authorization_key']
decrypted_auth_key = decrypt_authorization_key(encrypted_auth_key, keypair['private_key'])
```
## Signing Transaction Payloads
Now use the decrypted authorization key to sign Grid API transaction payloads.
### Extract Signing Key
First, extract the 32-byte ECDSA private key from the authorization key:
```typescript TypeScript theme={null}
function extractSigningKey(authKeyB64: string): Uint8Array {
const pkcs8Bytes = Buffer.from(authKeyB64, 'base64');
// Look for pattern [0x04, 0x20] followed by 32-byte key
const pattern = Buffer.from([0x04, 0x20]);
const patternIndex = pkcs8Bytes.indexOf(pattern);
if (patternIndex === -1) {
throw new Error('Private key marker not found');
}
const keyStart = patternIndex + 2;
return new Uint8Array(pkcs8Bytes.slice(keyStart, keyStart + 32));
}
```
```python Python theme={null}
def extract_signing_key(auth_key_b64):
pkcs8_bytes = base64.b64decode(auth_key_b64)
# Look for pattern [0x04, 0x20] followed by 32-byte key
pattern = bytes([0x04, 0x20])
pattern_index = pkcs8_bytes.find(pattern)
if pattern_index == -1:
raise ValueError('Private key marker not found')
key_start = pattern_index + 2
return pkcs8_bytes[key_start:key_start + 32]
```
### JSON Canonicalization
Privy requires recursive key sorting of all JSON objects:
```typescript TypeScript theme={null}
function canonicalizeJson(obj: any): any {
if (obj && typeof obj === 'object' && !Array.isArray(obj)) {
const sorted: any = {};
// Sort keys alphabetically
Object.keys(obj).sort().forEach(key => {
sorted[key] = canonicalizeJson(obj[key]);
});
return sorted;
} else if (Array.isArray(obj)) {
return obj.map(item => canonicalizeJson(item));
}
return obj;
}
function serializeCanonical(payload: any): string {
const canonical = canonicalizeJson(payload);
return JSON.stringify(canonical);
}
```
```python Python theme={null}
import json
def canonicalize_json(obj):
if isinstance(obj, dict):
# Sort keys alphabetically and recursively canonicalize values
return {k: canonicalize_json(v) for k, v in sorted(obj.items())}
elif isinstance(obj, list):
return [canonicalize_json(item) for item in obj]
else:
return obj
def serialize_canonical(payload):
canonical = canonicalize_json(payload)
return json.dumps(canonical, separators=(',', ':'))
```
### Sign the Payload
```typescript TypeScript theme={null}
import { p256 } from '@noble/curves/p256';
function signPayload(kmsPayloadB64: string, authKeyB64: string): string {
// Decode and parse the KMS payload
const payloadJson = Buffer.from(kmsPayloadB64, 'base64').toString('utf-8');
const payload = JSON.parse(payloadJson);
// Canonicalize the JSON
const canonicalPayload = serializeCanonical(payload);
// Extract the signing key
const privateKeyBytes = extractSigningKey(authKeyB64);
// Sign with ECDSA P-256
const signature = p256.sign(Buffer.from(canonicalPayload), privateKeyBytes);
// Return base64 DER signature
return Buffer.from(signature.toDERRawBytes()).toString('base64');
}
// Usage
const signature = signPayload(kmsPayload.payload, decryptedAuthKey);
```
```python Python theme={null}
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives import hashes
def sign_payload(kms_payload_b64, auth_key_b64):
# Decode and parse the KMS payload
payload_json = base64.b64decode(kms_payload_b64).decode('utf-8')
payload = json.loads(payload_json)
# Canonicalize the JSON
canonical_payload = serialize_canonical(payload)
# Extract the signing key
private_key_bytes = extract_signing_key(auth_key_b64)
# Create signing key
private_key = ec.derive_private_key(
int.from_bytes(private_key_bytes, 'big'),
ec.SECP256R1()
)
# Sign with ECDSA P-256
signature = private_key.sign(
canonical_payload.encode(),
ec.ECDSA(hashes.SHA256())
)
# Return base64 DER signature
return base64.b64encode(signature).decode()
# Usage with KMS payload from Grid API
signature = sign_payload(kms_payload['payload'], decrypted_auth_key)
```
# Get KYC Status
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/kyc-operations/get
GET /api/grid/v1/accounts/{address}/kyc/{kyc_id}
Retrieve the current status of a KYC verification
Check the current verification status of a KYC request. Use this endpoint to monitor progress and determine account compliance status.
## Verification Status Values
The verification process can result in these statuses:
* `not_started`: Verification link created but not accessed
* `under_review`: Documents submitted and being reviewed
* `incomplete`: Additional information required
* `approved`: Verification completed successfully
* `rejected`: Verification failed
## Terms of Service Status
Separate from KYC verification, terms of service acceptance is tracked:
* `pending`: Terms not yet accepted
* `approved`: Terms accepted
## Important Notes
* Status updates may take a few minutes to reflect
* Rejected verifications include detailed rejection reasons
* Incomplete verifications provide required next steps
* Some statuses trigger webhooks if configured
# Request KYC Link
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/kyc-operations/post
POST /api/grid/v1/accounts/{address}/kyc
Request a KYC verification link for the account
KYC (Know Your Customer) verification establishes compliance status for your account. This is a direct operation that doesn't require intents.
## Verification Flow
```mermaid theme={null}
sequenceDiagram
participant Client
participant Grid
participant KYC Provider
Client->>Grid: POST /accounts/{address}/kyc
Note over Client,Grid: Request KYC verification
Grid-->>Client: Return KYC verification link
Client->>KYC Provider: Open verification link
Note over Client,KYC Provider: Complete verification
KYC Provider->>Grid: Send verification results
Grid-->>Client: Update KYC status
```
## Customer Types
Grid supports two types of customer verification:
| Customer Type | Verification Requirements |
| ---------------- | ----------------------------------------------------------------------------------------- |
| Individual (KYC) | • Personal identification
• Address verification
• Basic information collection |
| Business (KYB) | • Business registration
• Beneficial ownership
• Business address verification |
## Important Notes
* KYC verification is required for fiat payment rails
* The verification link expires after 24 hours
* Verification typically takes 1-3 business days
* You can check status using the returned KYC ID
# Create Payment Intent
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/payment-intents/post
POST /api/grid/v1/accounts/{address}/payment-intent
Create a payment intent for various transfer types
## Fee Config Breaking Change
The `fee_config` field is required for non-enterprise tier customers. Requests without it return a `missing_fee_config` error.
### Migration
Add `fee_config` to your `create_payment_intent` request body:
```json theme={null}
{
"source": { "type": "smart_account" },
"destination": { "address": "", "network": "solana" },
"amount": "1000000",
"currency": "usdc",
"fee_config": {
"currency": "sol",
"payer_address": ""
}
}
```
Fee configuration specifying who pays the transaction fee and in which currency.
Token used to pay the transaction fee. Accepted values: `sol`, `usdc`.
Public key of the account that pays the fee.
### How Fees Work
1. You submit a payment intent with `fee_config`.
2. The API builds the transaction and calculates the fee (compute, signatures, and ATA rent if needed).
3. A repayment instruction is appended that transfers the fee from `payer_address` to the paymaster.
4. The response includes a `fee` object with the exact amount charged.
### Fee Payer Signing
The `payer_address` **must sign the transaction**. The API automatically adds it as a required signer.
* **SOL fees**: The payer needs enough SOL to cover the fee.
* **USDC fees**: The payer needs enough USDC in their associated token account.
### Response
When `fee_config` is provided, the response includes a `fee` field:
Breakdown of the transaction fee charged.
Fee amount in the smallest unit of the fee currency.
Human-readable fee amount.
Fee currency (`sol` or `usdc`).
Fee expressed in SOL for reference.
SOL amount in lamports.
Human-readable SOL amount.
### Errors
`missing_fee_config` — Request has no `fee_config` (required for non-enterprise tier).
# Create Proposal
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/proposals/create
POST /api/grid/v1/accounts/{address}/proposals
Create a new proposal for multi-signature approval
Creates a proposal that requires consensus from multiple signers before execution. Proposals enable coordinated multi-party approval for transactions and account settings changes.
Proposals are an **enterprise-tier feature**. Free and Pro tier accounts will receive a 403
Forbidden error.
## Proposal Types
### Custom Proposals
Execute arbitrary Solana transactions through your smart account:
```typescript theme={null}
const response = await grid.createProposal(accountAddress, {
type: "custom",
transaction: serializedVersionedTransaction,
signer: creatorPublicKey,
});
```
### Settings Proposals
Modify account configuration with up to 10 actions per proposal:
```typescript theme={null}
const response = await grid.createProposal(accountAddress, {
type: "settings",
actions: [
{ type: "AddSigner", newSigner: { address: newKey, mask: 7 } },
{ type: "ChangeThreshold", newThreshold: 2 },
],
signer: creatorPublicKey,
});
```
**Available actions**: `AddSigner`, `RemoveSigner`, `ChangeThreshold`, `SetTimeLock`, `AddSpendingLimit`, `RemoveSpendingLimit`, `SetArchivalAuthority`
### Transfer Proposals
Transfer tokens or SOL from your smart account through a proposal:
```typescript theme={null}
const response = await grid.createProposal(accountAddress, {
type: "transfer",
token: "usdc",
destination: recipientPublicKey,
rawAmount: 1000000,
signer: creatorPublicKey,
});
```
**Supported tokens**: `sol`, `usdc`, `usdt`, `pyusd`, `eurc`, or a custom mint
| Parameter | Type | Required | Description |
| -------------- | ------------------ | -------- | -------------------------------------------------------------------------- |
| `token` | `string \| object` | Yes | Standard token name or custom mint object |
| `destination` | `string` | Yes | Recipient's Solana address |
| `rawAmount` | `number` | Yes | Amount in the token's smallest unit (e.g. lamports for SOL, 10^6 for USDC) |
| `mintDecimals` | `number` | No | Override decimal precision; validated against on-chain mint data |
| `signer` | `string` | Yes | Public key of the proposal creator |
## Permission Requirements
The signer must have `CAN_INITIATE` permission (mask includes value 1). The signer address cannot be the smart account address itself.
## Transaction Splitting
Solana transactions have a 1232-byte limit. If your proposal exceeds this, the API returns multiple transactions that must be signed and submitted in order.
## Fee Configuration
By default, the Grid paymaster sponsors fees. Enterprise accounts can specify custom fee handling:
```typescript theme={null}
{
fee_config: {
currency: "SOL",
payer_address: payerPublicKey,
self_managed_fees: true // Skip simulation
}
}
```
## Implementation Flow
Build your transaction or define settings actions.
Call this endpoint. Returns unsigned transaction(s) and the proposal address.
Sign all returned transactions and submit to Solana in order.
The proposal is now `Active` and awaiting votes.
## Related Endpoints
* [Vote on Proposal](/grid/v1/api-reference/endpoint/proposals/vote)
* [Vote and Execute](/grid/v1/api-reference/endpoint/proposals/vote-and-execute)
# Get Proposal
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/proposals/get
GET /api/grid/v1/accounts/{address}/proposals/{proposal_address}
Retrieve details for a specific proposal
Retrieves detailed information about a specific proposal, including current status, voting state, and metadata.
By default, status is client-facing. For proposals that are internally closed on-chain, the API infers terminal outcome when possible (`executed`, `cancelled`, or `rejected`).
Use `showOnChainStatus=true` to return the raw on-chain status value (including `closed`).
The `{address}` parameter is your smart account address, and `{proposal_address}` is the specific proposal's on-chain address from [Create Proposal](/grid/v1/api-reference/endpoint/proposals/create) or [List Proposals](/grid/v1/api-reference/endpoint/proposals/list).
## Ownership Verification
The API verifies that the proposal belongs to the specified smart account. Requesting a proposal with the wrong account address returns 403 Forbidden.
## Understanding Voting State
The response includes `approved`, `rejected`, and `cancelled` arrays showing which signers have voted:
```typescript theme={null}
const proposal = await grid.getProposal(accountAddress, proposalAddress);
// Calculate remaining votes needed
const votesNeeded = account.threshold - proposal.approved.length;
// Check if specific signer has voted
const hasVoted = proposal.approved.includes(signerAddress) ||
proposal.rejected.includes(signerAddress);
```
## Related Endpoints
* [List Proposals](/grid/v1/api-reference/endpoint/proposals/list)
* [Vote on Proposal](/grid/v1/api-reference/endpoint/proposals/vote)
# List Proposals
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/proposals/list
GET /api/grid/v1/accounts/{address}/proposals
Retrieve all proposals for a Grid smart account
Lists all proposals associated with a Grid smart account. Use this endpoint to display pending proposals, track voting progress, or audit historical decisions.
The `{address}` parameter is your **smart account address**, not a proposal address. You can find this from the account creation response or [Get Account](/grid/v1/api-reference/endpoint/account-management/get).
## Proposal Status Values
* **Active**: Voting in progress, accepts `approve` or `reject` votes
* **Approved**: Threshold met, ready for execution or can be `cancelled`
* **Rejected**: Rejected by voters (terminal)
* **Cancelled**: Cancelled after approval (terminal)
By default, status is client-facing. For proposals that are internally closed on-chain, the API infers terminal outcome when possible (`executed`, `cancelled`, or `rejected`).
Use `showOnChainStatus=true` to return raw on-chain status values (including `closed`).
## Pagination
Results are paginated with a default limit of 50 (max 100). Use the `cursor` from a previous response to fetch the next page:
```typescript theme={null}
// First page
const proposals = await grid.listProposals(accountAddress, { limit: 20 });
// Next page
const nextPage = await grid.listProposals(accountAddress, {
limit: 20,
cursor: proposals.nextCursor
});
```
## Understanding the Response
Each proposal includes voting state arrays (`approved`, `rejected`, `cancelled`) showing which signers have voted. Use this to:
* Calculate remaining votes needed: `threshold - approved.length`
* Show which signers haven't voted yet
* Prevent duplicate vote attempts
## Related Endpoints
* [Create Proposal](/grid/v1/api-reference/endpoint/proposals/create)
* [Get Proposal](/grid/v1/api-reference/endpoint/proposals/get)
* [Vote on Proposal](/grid/v1/api-reference/endpoint/proposals/vote)
# Vote on Proposal
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/proposals/vote
POST /api/grid/v1/accounts/{address}/proposals/{proposal_address}/vote
Submit approval, rejection, or cancellation votes on a proposal
Submits votes on an existing proposal. Multiple signers can vote in a single request.
## Vote Actions
The available action depends on the proposal's current status:
| Status | Available Actions |
| ---------- | ------------------- |
| `Active` | `approve`, `reject` |
| `Approved` | `cancel` |
## Reject vs Cancel
`reject` and `cancel` are **not interchangeable**—they operate at different lifecycle stages.
**`reject`** — Block a proposal during voting (status: `Active`)
* Use when you disagree with the proposed action
* Prevents the proposal from reaching approval
**`cancel`** — Stop an already-approved proposal (status: `Approved`)
* Use when circumstances have changed after approval
* Prevents execution of an approved proposal
```
Active → approve/reject → Approved → cancel → Cancelled
↓ ↓
Rejected Executed
```
## Automatic Duplicate Filtering
The API filters out signers who have already voted with the same action. If all requested signers have already voted, the API returns an error.
```typescript theme={null}
// If signerA already approved, only signerB is included
const response = await grid.vote(accountAddress, proposalAddress, {
signers: [signerA, signerB],
action: "approve"
});
// response.signers = [signerB]
```
## Permission Requirements
All signers must have `CAN_VOTE` permission (mask includes value 2).
## Related Endpoints
* [Get Proposal](/grid/v1/api-reference/endpoint/proposals/get) — Check status before voting
* [Vote and Execute](/grid/v1/api-reference/endpoint/proposals/vote-and-execute) — Vote and execute combined
# Vote and Execute
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/proposals/vote-and-execute
POST /api/grid/v1/accounts/{address}/proposals/{proposal_address}/vote-and-execute
Vote to approve and immediately execute a proposal in one operation
Combines voting and execution into a single operation. More efficient than separate vote and execute calls when you want to finalize a proposal immediately.
At least one signer must have `CAN_EXECUTE` permission (mask includes value 4). Unlike the vote endpoint, this is required.
## How It Works
1. Validates proposal is `Active` or `Approved`
2. Filters signers who already approved
3. Selects minimum signers needed to reach threshold
4. First signer with `CAN_EXECUTE` becomes the executor
5. Returns transaction(s) for signing
## When Threshold Is Already Met
If the proposal already has enough approvals, the voting step becomes a no-op—only execution occurs.
```typescript theme={null}
// Proposal has 2/2 approvals (Approved status)
const response = await grid.voteAndExecute(accountAddress, proposalAddress, {
signers: [executorKey] // Only needs CAN_EXECUTE
});
// Returns execute transaction only
```
## Permission Requirements
* All signers need `CAN_VOTE` (2)
* At least one signer needs `CAN_EXECUTE` (4)
## Transaction Output
Returns 1-2 transactions depending on size:
* **Single transaction**: Vote + execute fit within 1232 bytes
* **Two transactions**: Submit vote first, then execute
```typescript theme={null}
const response = await grid.voteAndExecute(accountAddress, proposalAddress, {
signers: [signerWithExecute],
fee_config: { currency: "SOL", payer_address: payerKey }
});
// Sign and submit in order
for (const tx of response.transactions) {
await signAndSubmit(tx);
}
```
## When to Use Vote vs Vote-and-Execute
| Use Case | Endpoint |
| -------------------------------- | ---------------- |
| Approve and execute immediately | Vote-and-Execute |
| Approve without executing | Vote |
| Reject or cancel | Vote |
| No CAN\_EXECUTE signer available | Vote |
## Related Endpoints
* [Vote on Proposal](/grid/v1/api-reference/endpoint/proposals/vote) — Vote without executing
* [Get Proposal](/grid/v1/api-reference/endpoint/proposals/get) — Check current state
# Prepare Arbitrary Transaction
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/transaction-operations/post
POST /api/grid/v1/accounts/{address}/transactions
Prepare a custom transaction with specified instructions
# Submit Transaction
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/transaction-operations/submit
POST /api/grid/v1/accounts/{address}/submit
Submit a previously prepared transaction with required signatures
This endpoint submits a previously prepared transaction to the blockchain after verifying the required signatures from Grid Account authorization keys.
Using the Grid API directly requires **advanced configurations**. Grid SDK is the recommended
way to submit transactions. It handles transaction preparation, signing, automatic failover, and
submission. Learn more about the Grid SDK in the [Grid SDK](/grid/v1/sdk-reference) guide.
This endpoint requires a **prepared transaction** and **valid signatures**. Use transaction
preparation endpoints first, then sign the KMS payload with your decrypted authorization key
before calling this endpoint.
## Account Type Signing Flows
Grid supports two types of accounts with different signing requirements. Choose the appropriate flow based on how your account was created:
For accounts created with email authentication (using Privy):
### High-Level Process
1. **Prepare Transaction**: Call transaction preparation endpoints (payments, transfers, etc.)
2. **Receive KMS Payload**: Extract the `kms_payload` from the preparation response
3. **Sign Payload**: Use your decrypted Privy authorization key to sign the canonical JSON
4. **Submit Transaction**: Call this endpoint with the signature and transaction data
### Key Requirements
* **Authorization keys** from email account creation/authentication
* **JSON canonicalization** of the KMS payload (recursive key sorting)
* **ECDSA P-256 SHA-256** signature algorithm
### Complete Implementation Guide
For detailed implementation including HPKE keypair generation, authorization key decryption, JSON canonicalization, payload signing, and language-agnostic examples, see the [Primary Provider Integration](/grid/v1/api-reference/advanced/privy-signing) guide.
For accounts created with Ed25519 public keys:
### Signing Process
1. **Prepare Transaction**: Call transaction preparation endpoints (payments, transfers, etc.)
2. **Receive Transaction**: Extract the prepared Solana transaction from the response
3. **Sign Transaction**: Use your Ed25519 private keys with standard Solana transaction signing (e.g., web3.js)
4. **Submit Transaction**: Call this endpoint with the signed transaction
### Signature Requirements
* **Ed25519 private keys** corresponding to the public keys specified during account creation
* **Threshold signatures** meeting the account's signing threshold
* **Standard Solana transaction signing** (no KMS payload or JSON canonicalization required)
Signer-based accounts use regular Solana transaction signing with libraries like
web3.js. No KMS payload processing or JSON canonicalization is required.
The signed transaction proves you have access to the required number of Grid Account signing keys and authorizes the transaction execution.
### Implementation with web3.js
```typescript theme={null}
import { Transaction } from '@solana/web3.js';
import { Keypair } from '@solana/web3.js';
// Extract prepared transaction from API response
const preparedTransaction = Transaction.from(
Buffer.from(response.transaction, 'base64')
);
// Sign with your Ed25519 keypairs (threshold signatures required)
const signers = [keypair1, keypair2]; // Your Ed25519 keypairs
preparedTransaction.sign(...signers);
// Submit the signed transaction
const signedTransaction = preparedTransaction.serialize();
```
## KMS Payload Schema
The `kms_payloads` field contains the signed KMS payloads from your key management provider. Each payload has a `provider` and a `kms_signed_payload` whose shape depends on the provider. See the auto-generated request body schema below for full field details.
Turnkey accounts **must** use `kms_signed_payload`. The top-level `signature` field is only
supported for Privy as a legacy fallback.
### Request Examples
```json theme={null}
{
"transaction": "",
"kms_payloads": [
{
"provider": "privy",
"kms_signed_payload": {
"signature": ""
}
}
]
}
```
```json theme={null}
{
"transaction": "",
"kms_payloads": [
{
"provider": "turnkey",
"kms_signed_payload": {
"public_key": "",
"signature": "",
"timestamp_ms": ""
}
}
]
}
```
When submitting multiple transactions, use `transactions` (plural) and nest `kms_payloads` as an array of arrays — one inner array per transaction:
```json theme={null}
{
"transactions": ["", ""],
"kms_payloads": [
[
{
"provider": "privy",
"kms_signed_payload": {
"signature": ""
}
}
],
[
{
"provider": "privy",
"kms_signed_payload": {
"signature": ""
}
}
]
]
}
```
This format places the signature at the top level instead of inside `kms_signed_payload`. It is supported for backward compatibility with Privy accounts only.
```json theme={null}
{
"transaction": "",
"kms_payloads": [
{
"provider": "privy",
"signature": ""
}
]
}
```
# List Virtual Accounts
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/virtual-accounts/get
GET /api/grid/v1/accounts/{address}/virtual-accounts
Retrieve all virtual accounts for the smart account with optional currency filters
Retrieve all virtual accounts associated with your smart account. Use optional filters to narrow results by currency or payment rail.
## Filtering Options
You can filter virtual accounts by:
* **Source Currency**: USD, EUR, GBP
* **Destination Currency**: USDC, USDT, PYUSD, EURC
* **Status**: activated, deactivated
## Account Information
Each virtual account includes:
* Bank deposit instructions (routing number, account number)
* Supported payment rails (ACH, SEPA, Wire)
* Destination currency configuration
* Current activation status
* Developer fee percentage (if applicable)
## Important Notes
* Only activated virtual accounts can receive deposits
* Each currency combination requires a separate virtual account
* Virtual account details should be shared securely with depositors
* Monitor account status regularly for compliance updates
# Request Virtual Account
Source: https://developers.squads.so/grid/v1/api-reference/endpoint/virtual-accounts/post
POST /api/grid/v1/accounts/{address}/virtual-account
Create a new virtual account for fiat to crypto conversion
Virtual accounts provide a way to receive funds from traditional banking systems. They are automatically linked to your smart account and enable fiat-to-crypto conversion.
## Virtual Account Flow
```mermaid theme={null}
sequenceDiagram
participant Client
participant Grid
participant Bank
Client->>Grid: POST /accounts/{address}/virtual-account
Note over Client,Grid: Request virtual account
Grid-->>Client: Return account details
Bank->>Grid: Send funds
Note over Bank,Grid: Funds received
Grid-->>Client: Update balance
```
## Supported Features
* **Fiat Deposits**: Receive traditional currency deposits
* **Auto-Conversion**: Automatically convert to stablecoins
* **Multi-Currency**: Support for USD, EUR, and other currencies
* **Real-Time Updates**: Instant balance notifications
## Important Notes
* KYC verification is required before creating virtual accounts
* Each currency requires a separate virtual account
* Account details include routing and account numbers
* Deposits typically process within 1-3 business days
* Virtual accounts remain active until explicitly deactivated
# SDK Reference
Source: https://developers.squads.so/grid/v1/sdk-reference/index
Choose your SDK for seamless Grid integration
Select the SDK that matches your development environment to get started with Grid's blockchain account infrastructure.
Core SDK for Node.js, TypeScript, and JavaScript applications
Mobile SDK for iOS and Android applications
# TypeScript SDK Changelog
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/changelog
Release history for @sqds/grid
## 3.1.0
### Minor Changes
* a7bc52d: Add optional feeConfig to createPaymentIntent request
## 3.0.1
### Patch Changes
* 19375ab: bump dependencies
* Refactored main `grid` package - Now uses @grid/crypto instead of inline crypto code, reducing duplication
## 3.0.0
### Major Changes
* adaa877: BREAKING: All public types now use camelCase naming
Response and request fields have been renamed from snake\_case to camelCase for JavaScript/TypeScript consistency:
* `otp_sent` → `otpSent`
* `otp_id` → `otpId`
* `created_at` → `createdAt`
* `expires_at` → `expiresAt`
* `grid_user_id` → `gridUserId`
* `time_lock` → `timeLock`
* `admin_address` → `adminAddress`
* `transaction_signers` → `transactionSigners`
* `spending_limit_signers` → `spendingLimitSigners`
* `transaction_signature` → `transactionSignature`
* `confirmed_at` → `confirmedAt`
* `GridError.status_code` → `GridError.statusCode`
Internal API communication still uses snake\_case; transformation happens automatically.
### Minor Changes
* af4728b: Added TradeSmart transaction support: - createTradeSmartTransaction() - getTradeSmartTransactionQuote() - prepareTradeSmartTransaction() - getTradeSmartTransaction()
### Patch Changes
* ef7a902: Pin and update dependencies
* adaa877: - Fixed passkey session storage handling during account creation
* Exported AccountManager for direct access to account state
* 91b52af: Improve documentation and quickstart guides
## 2.0.0
### Major Changes
* c8d5fa1: Release stable 2.0.0 with monorepo structure:
**Typescript SDK Features:**
* Added event emitter system to AccountManager for real-time account state updates
* Added passkey account creation flow: createPasskeySession, authorizePasskeySession, submitPasskeySession, findPasskeyAccount, createPasskeyAccount
* Added automatic session refresh functionality with refreshSession method
* Service layer architecture: AccountService, AuthService, BankingService, PasskeyService, SpendingLimitService, TransactionService, UtilityService
**Breaking Changes:**
* Response structure now includes `headers` in success responses and `lastResponse` in errors
* Error handling: Methods now throw errors instead of returning `{ success: false }` objects
* Removed `grid_user_id` parameter from all request methods
### Minor Changes
* c8d5fa1: Add passkey account creation methods: createPasskeySession, authorizePasskeySession, submitPasskeySession, findPasskeyAccount, createPasskeyAccount
* c8d5fa1: Add automatic session refresh functionality with refreshSession method
# GridClient
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/classes/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 |
| ----------------- | ----------- | ---------------------------------------------------------------------------------------------- |
| `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;
```
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;
```
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;
```
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;
```
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;
```
Initialize authentication for an existing user.
This is the first step in the authentication process.
Note: For new users, you must call createAccount first to create an account before initializing authentication. This method is only for authenticating existing users.
##### 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;
```
This is the second step in email-based authentication. Verifies the OTP
code received via email and establishes an authenticated session.
Note: For new users who need to create an account, use completeAuthAndCreateAccount instead, which completes authentication and creates the account in one step.
##### 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: ,
sessionSecrets: sessionSecrets
});
```
***
#### completeAuthAndCreateAccount()
```ts theme={null}
completeAuthAndCreateAccount(request): Promise;
```
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;
```
Refresh MPC provider session to extend lifetime
Note: Currently supports Privy only. Turnkey refresh not yet implemented.
##### 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;
```
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: When passing AccountPolicies with signers, role defaults to 'primary' and provider defaults to 'external' if not specified.
##### 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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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: ,
sessionKey: 'public-key-base58',
ceremonyType: 'auth',
slotNumber: 123
}, 'sandbox');
```
***
#### findPasskeyAccount()
```ts theme={null}
findPasskeyAccount(params, environment): Promise;
```
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:
}, 'sandbox');
```
***
#### getPasskeyAccount()
```ts theme={null}
getPasskeyAccount(passkeyAddress, environment): Promise;
```
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;
```
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: Non-Enterprise customers must provide a `feeConfig` in the request.
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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;
```
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);
```
# AccountBalancesData
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountBalancesData
Account balances data with SOL and token balances
## Properties
| Property | Type |
| ---------------- | ----------------- |
| `address` | `string` |
| `lamports` | `bigint` |
| `sol` | `number` |
| `tokens` | `TokenBalance`\[] |
# AccountBalancesResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountBalancesResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# AccountPolicies
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountPolicies
Multi-signature account policies
Important: Signers range: 1-10, threshold must not exceed signers.length (range: 1-10)
## Properties
| Property | Type | Description |
| --------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `signers` | [`AccountSigner`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountSigner)\[] | Account signers (range: 1-10) |
| `threshold` | `number` | Required signatures (must not exceed signers.length) |
| `timeLock?` | `number` | Time lock in seconds (range: 1 to u32::MAX) |
| `adminAddress?` | `string` | Admin address for administrative functions |
# AccountSigner
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountSigner
Signer in multi-signature account
Note: role defaults to 'primary', provider defaults to 'external'
## Example
```typescript theme={null}
const signer: AccountSigner = {
address: '5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM',
permissions: ['CAN_INITIATE', 'CAN_EXECUTE', 'CAN_VOTE']
};
const backupSigner: AccountSigner = {
address: '...',
role: 'backup',
permissions: ['CAN_VOTE'],
provider: 'turnkey'
};
```
## Properties
| Property | Type | Description |
| ------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `address` | `string` | Public key address |
| `role?` | [`SignerRole`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/SignerRole) | Role (defaults to 'primary') |
| `permissions` | [`SignerPermission`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/SignerPermission)\[] | Permissions granted to signer |
| `provider?` | `string` | Authentication provider (defaults to 'external') |
# AccountTransaction
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountTransaction
Transaction in account history
## Properties
| Property | Type | Description |
| -------------------- | -------- | ---------------------------- |
| `id` | `string` | - |
| `signature` | `string` | Transaction signature hash |
| `status` | `string` | - |
| `createdAt` | `string` | ISO timestamp when created |
| `confirmedAt?` | `string` | ISO timestamp when confirmed |
# AddPasskeyQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AddPasskeyQueryParams
Query parameters for adding passkey
## Properties
| Property | Type | Description |
| -------------- | --------- | -------------------------------------------------- |
| `admin?` | `boolean` | Whether to add as admin signer (defaults to false) |
# AddPasskeyRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AddPasskeyRequest
Request to add passkey signer to account
## Properties
| Property | Type | Description |
| --------------------------- | -------------- | ------------------------------------------------ |
| `passkey` | `PasskeyInput` | Passkey configuration |
| `transactionSigners?` | `string`\[] | Required transaction signers (account addresses) |
# AddPasskeyResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AddPasskeyResponse
Add passkey response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ------------- | ------------------------------------------------------------------------------------------ | -------------------------------------- |
| `transaction` | `string` | - |
| `passkey` | [`PasskeyInfo`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyInfo) | - |
| `threshold` | `number` | - |
| `status` | `string` | - |
| `expiresAt` | `string` | ISO timestamp when transaction expires |
# AuthenticationRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AuthenticationRequest
Authentication request parameters for various providers.
## Properties
| Property | Type | Description |
| ------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| `email?` | `string` | User email for email-based authentication |
| `keypair?` | [`UniversalKeyPair`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UniversalKeyPair) | Key pair for cryptographic authentication |
| `passkeyId?` | `string` | Passkey identifier for passkey authentication |
| `provider?` | `SignerProvider` | Authentication provider type |
| `expiration?` | `number` | Authentication expiration timestamp |
# BaseResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BaseResponse
Base interface for all API responses with data and metadata
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Extended by
* [`TransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionResponse)
* [`InitAuthResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/InitAuthResponse)
* [`CompleteAuthResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthResponse)
* [`CompleteAuthAndCreateAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthAndCreateAccountResponse)
* [`GetAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetAccountResponse)
* [`AccountBalancesResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountBalancesResponse)
* [`GetTransactionsResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetTransactionsResponse)
* [`TransactionSubmissionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionSubmissionResponse)
* [`TransferResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransferResponse)
* [`CreateSpendingLimitResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateSpendingLimitResponse)
* [`SpendingLimitTransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitTransactionResponse)
* [`SpendingLimitResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitResponse)
* [`SpendingLimitsResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitsResponse)
* [`GetPasskeysResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeysResponse)
* [`AddPasskeyResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AddPasskeyResponse)
* [`RemovePasskeyResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RemovePasskeyResponse)
* [`CreatePaymentIntentResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePaymentIntentResponse)
* [`KycLinkResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycLinkResponse)
* [`KycStatusResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycStatusResponse)
* [`RefreshSessionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionResponse)
* [`CreateProposalResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateProposalResponse)
* [`VoteProposalResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VoteProposalResponse)
* [`ExecuteProposalResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/ExecuteProposalResponse)
* [`CreateTradeSmartTransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateTradeSmartTransactionResponse)
* [`GetTradeQuoteResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetTradeQuoteResponse)
* [`TradeSmartTransactionQuoteResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TradeSmartTransactionQuoteResponse)
* [`PrepareTradeSmartTransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PrepareTradeSmartTransactionResponse)
* [`GetTradeSmartTransactionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetTradeSmartTransactionResponse)
* [`VirtualAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VirtualAccountResponse)
* [`VirtualAccountsResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VirtualAccountsResponse)
* [`CreateStandingOrderResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateStandingOrderResponse)
* [`StandingOrderResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/StandingOrderResponse)
* [`StandingOrdersResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/StandingOrdersResponse)
* [`AuthorizePasskeySessionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AuthorizePasskeySessionResponse)
* [`SubmitPasskeySessionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SubmitPasskeySessionResponse)
* [`FindPasskeyAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FindPasskeyAccountResponse)
* [`GetPasskeySessionResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeySessionResponse)
* [`GetPasskeyAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeyAccountResponse)
* [`CreatePasskeyAccountResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePasskeyAccountResponse)
## Type Parameters
| Type Parameter | Default type | Description |
| -------------- | ------------ | --------------------- |
| `T` | `any` | Type of response data |
## Properties
| Property | Type | Description |
| --------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data` | `T` | Response data from API Contains the actual payload returned by the API endpoint. The type varies based on the specific response interface. |
| `lastResponse?` | [`LastResponse`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/LastResponse) | Response metadata with request ID and status code Useful for debugging and tracking requests. Contains: - requestId: Unique identifier for this request - statusCode: HTTP status code (200, 201, etc.) - headers: All response headers - idempotencyKey: Key for idempotent requests (if applicable) **See** LastResponse |
# BridgeTransferDestination
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransferDestination
## Properties
| Property | Type |
| -------------------------- | -------------------------------------------------------------------------------------------------- |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PaymentRail) |
| `externalAccountId?` | `string` |
| `bridgeWalletId?` | `string` |
| `fromAddress?` | `string` |
| `wireMessage?` | `string` |
| `sepaReference?` | `string` |
| `swiftReference?` | `string` |
# BridgeTransferSource
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransferSource
## Properties
| Property | Type |
| ---------------------------- | -------------------------------------------------------------------------------------------------- |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PaymentRail) |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
| `externalAccountId?` | `string` |
| `bridgeWalletId?` | `string` |
| `fromAddress?` | `string` |
| `omad?` | `string` |
| `imad?` | `string` |
| `bankBeneficiaryName?` | `string` |
# CompleteAuthAndCreateAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthAndCreateAccountRequest
## Properties
| Property | Type |
| ---------------------- | -------------------------------------------------------------------------------------------------------------- |
| `otpCode` | `string` |
| `otpId?` | `string` |
| `provider?` | `"privy"` \| `"turnkey"` |
| `user` | [`GridClientUserContext`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridClientUserContext) |
| `sessionSecrets` | `SessionSecrets` |
# CompleteAuthRequestWithOtp
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthRequestWithOtp
Complete authentication request with OTP verification
## Properties
| Property | Type | Description | Inherited from |
| ---------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------- |
| `expiration?` | `number` | - | `CompleteAuthRequest.expiration` |
| `otpCode` | `string` | OTP code received by user | - |
| `user` | [`GridClientUserContext`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridClientUserContext) | - | - |
| `sessionSecrets` | `SessionSecrets` | Session-specific cryptographic secrets | - |
# CompleteAuthResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
| `address` | `string` | - |
| `policies` | [`AccountPolicies`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountPolicies) | - |
| `gridUserId` | `string` | - |
| `authentication` | [`AuthenticationData`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/AuthenticationData) | - |
# CreateAccountInput
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateAccountInput
Simplified account creation input (provide email or signer)
## Example
```typescript theme={null}
const emailAccount: CreateAccountInput = { email: 'user@example.com' };
const signerAccount: CreateAccountInput = { signer: 'publicKeyString' };
```
## Properties
| Property | Type | Description |
| --------------- | -------- | ----------------------------------- |
| `email?` | `string` | Email for email-based account |
| `signer?` | `string` | Public key for signer-based account |
# CreatePaymentIntentRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePaymentIntentRequest
Create payment intent request
## Properties
| Property | Type | Description |
| ------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| `amount` | `string` | Transfer amount as a string (e.g., "100.00") |
| `source` | [`PaymentDetails`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PaymentDetails) | Source account details |
| `destination` | [`PaymentDetails`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PaymentDetails) | Destination account details |
| `feeConfig?` | [`FeeConfig`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FeeConfig) | Fee configuration. Required for non-Enterprise customers. Enterprise customers may omit this as fees are handled by their plan. |
# CreatePaymentIntentResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePaymentIntentResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# CreateProposalRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateProposalRequest
Create proposal request
## Properties
| Property | Type |
| ------------------- | -------- |
| `transaction` | `string` |
| `signer` | `string` |
| `rentPayer?` | `string` |
# CreateProposalResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateProposalResponse
Create proposal response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------- | ----------- | ----------- |
| `transactions` | `string`\[] | - |
| `signer` | `string` | - |
| `rentPayer?` | `string` | - |
# CreateSpendingLimitResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateSpendingLimitResponse
Create spending limit response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------------- | --------------- | ------------------------------------ |
| `spendingLimitAddress` | `string` | On-chain spending limit address |
| `transaction` | `string` | Serialized transaction for signing |
| `kmsPayloads` | `KmsPayload`\[] | KMS payloads for multi-party signing |
| `transactionSigners` | `string`\[] | - |
# EmailAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/EmailAccountRequest
Email-based account creation request
## Properties
| Property | Type |
| ------------- | --------- |
| `type` | `"email"` |
| `email` | `string` |
# ExecuteProposalRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/ExecuteProposalRequest
Execute proposal request
## Properties
| Property | Type | Description |
| -------------- | -------- | -------------------------------------------------------------------- |
| `signer` | `string` | Signer address that will execute (must have CAN\_EXECUTE permission) |
# ExecuteProposalResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/ExecuteProposalResponse
Execute proposal response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------- | ----------- | ------------------------------------ |
| `transactions` | `string`\[] | Base64-encoded unsigned transactions |
| `signer` | `string` | - |
# FeeConfig
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FeeConfig
Fee configuration. Required for non-Enterprise customers when creating payment intents or preparing transactions.
## Properties
| Property | Type | Description |
| ------------------------ | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `currency` | [`Currency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/Currency) | Currency used to pay fees |
| `payerAddress` | `string` | Public key address of the account paying fees |
| `selfManagedFees?` | `boolean` | When true, fees are deducted from the payer account rather than being handled by Grid |
# GetAccountBalancesQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetAccountBalancesQueryParams
Query parameters for paginated balance requests
## Properties
| Property | Type | Description |
| -------------- | -------- | ------------------------------ |
| `limit?` | `number` | Results per page (default: 10) |
| `page?` | `number` | Page number (default: 1) |
# GetAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetAccountResponse
Get account response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ------------ | -------------------------------------------------------------------------------------------------- | -------------------------------------- |
| `type` | `"email"` \| `"signers"` | |
| `address` | `string` | - |
| `policies?` | [`AccountPolicies`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountPolicies) | Policies (optional for email accounts) |
| `gridUserId` | `string` | - |
| `memo?` | `string` | - |
| `createdAt?` | `string` | - |
| `status?` | `string` | Status (for email accounts) |
# GetPasskeysResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeysResponse
Get passkeys response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------ | ----------- |
| `accountAddress` | `string` | - |
| `passkey` | [`PasskeyInfo`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyInfo) | - |
# GetTransactionsResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetTransactionsResponse
Get transactions response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| --------------- | ----------------------------------------------------------------------------------------------------------- | ----------- |
| `transactions?` | [`AccountTransaction`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountTransaction)\[] | - |
| `error?` | `string` | - |
# GridApiConfig
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridApiConfig
Grid API client configuration
Security:
* `apiKey`: Backend only - never expose in frontend code
* `appId`: Safe for frontend - requires domain whitelist configuration
## Properties
| Property | Type | Description |
| ---------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `apiKey?` | `string` | API key for backend authentication (never expose in frontend code) |
| `environment` | [`GridEnvironment`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/GridEnvironment) | Target environment (sandbox or production) |
| `baseUrl?` | `string` | Base URL for the Grid API |
| `appId?` | `string` | Application ID for frontend (safe to expose, whitelist domains in dashboard) |
| `timeout?` | `number` | Request timeout in milliseconds |
| `retryAttempts?` | `number` | Retry attempts for failed requests |
| `solanaRpcUrl?` | `string` | Solana RPC endpoint URL |
# GridErrorDetail
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridErrorDetail
Error detail from API validation failures
## Properties
| Property | Type | Description |
| ---------------------- | -------- | -------------------------------------- |
| `field` | `string` | Field that caused the validation error |
| `code` | `string` | Machine-readable error code |
| `message` | `string` | Human-readable error message |
| `suggestion?` | `string` | Suggestion for fixing the error |
| `documentation?` | `string` | Link to relevant documentation |
# InitAuthData
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/InitAuthData
Authentication initialization data for MPC providers (Privy, Turnkey, etc.)
## Properties
| Property | Type | Description |
| ----------------- | ---------------------------------------------------------------------- | --------------------------------- |
| `type` | `string` | - |
| `email` | `string` | - |
| `status` | `string` | - |
| `otpSent` | `boolean` | Whether OTP was sent successfully |
| `otpId?` | `string` | - |
| `provider` | `"privy"` \| `"turnkey"` \| `"passkey"` \| `"external"` \| `"dynamic"` | MPC provider type |
| `createdAt` | `string` | Creation timestamp (ISO string) |
| `expiresAt` | `string` | Expiration timestamp (ISO string) |
# InitAuthEOAData
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/InitAuthEOAData
Authentication initialization data for EOA/Solana wallets
## Properties
| Property | Type | Description |
| --------------------- | --------- | ---------------------------------- |
| `authenticated` | `boolean` | - |
| `provider` | `string` | Provider type (typically 'solana') |
| `publicKey` | `string` | Wallet public key |
# InitAuthRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/InitAuthRequest
## Properties
| Property | Type |
| ------------------- | -------- |
| `email?` | `string` |
| `expiration?` | `number` |
# InitAuthResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/InitAuthResponse
Authentication initialization response (data varies by provider type)
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# KycLink
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycLink
KYC verification link data
## Properties
| Property | Type | Description |
| -------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------- |
| `id` | `string` | - |
| `fullName` | `string` | - |
| `email` | `string` | - |
| `type` | [`KycType`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/KycType) | - |
| `kycLink` | `string` | URL for KYC identity verification |
| `tosLink` | `string` | URL for terms of service acceptance |
| `kycStatus` | `KycStatus` | - |
| `rejectionReasons` | `string`\[] | Rejection reasons if KYC was rejected |
| `tosStatus` | `TosStatus` | - |
| `createdAt` | `string` | ISO timestamp of creation |
| `customerId` | `string` | External customer ID in KYC provider system |
| `personaInquiryType` | `string` | Persona inquiry type |
# KycLinkResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycLinkResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# KycStatusData
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycStatusData
KYC verification status data
## Properties
| Property | Type | Description |
| ---------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------- |
| `id` | `string` | - |
| `account` | `string` | - |
| `type` | [`KycType`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/KycType) | - |
| `status` | `KycStatus` | - |
| `tosStatus` | `TosStatus` | - |
| `kycContinuationLink?` | `string` | Link to continue KYC if incomplete |
| `rejectionReasons` | `RejectionReason`\[] | Rejection reasons if rejected |
| `requirementsDue` | `string`\[] | Outstanding requirements to complete verification |
| `createdAt` | `string` | ISO timestamp of creation |
| `updatedAt` | `string` | ISO timestamp of last update |
# KycStatusResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/KycStatusResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# LastResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/LastResponse
API response metadata for request tracking and debugging
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
This provides metadata
about the API request for troubleshooting and support queries.
## Remarks
Use this metadata to:
* Track requests by requestId when contacting support
* Verify successful requests via statusCode
* Implement retry logic based on idempotencyKey
* Debug issues by inspecting response headers
## Example
```typescript theme={null}
const response = await gridClient.getAccount(address);
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('All headers:', response.lastResponse?.headers);
```
## Properties
| Property | Type | Description |
| ----------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `requestId` | `string` | Unique identifier from x-request-id header Use this when contacting support to help identify the specific request. |
| `statusCode` | `number` | HTTP status code (200, 201, 400, etc.) Indicates the success status of the request. |
| `idempotencyKey?` | `string` | Idempotency key from x-idempotency-key header Used to safely retry requests without duplicate effects. Only present if the request included an idempotency key. |
| `headers` | `Record`\<`string`, `string`> | All response headers as key-value pairs Contains all HTTP headers returned by the server. |
# PasskeyInfo
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyInfo
Passkey information
## Properties
| Property | Type | Description |
| ------------------- | ----------- | ------------------------------------ |
| `address` | `string` | - |
| `role` | `string` | - |
| `permissions` | `string`\[] | - |
| `provider` | `string` | - |
| `addedAt` | `string` | ISO timestamp when passkey was added |
# PaymentDetails
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PaymentDetails
Payment details for transfers
## Properties
| Property | Type | Description |
| -------------------------- | -------- | ------------------------------------------------------ |
| `account?` | `string` | Account (for source) |
| `address?` | `string` | Address (for crypto destination) |
| `currency` | `string` | - |
| `paymentRail?` | `string` | Payment rail (for fiat destination, e.g., "ach\_push") |
| `externalAccountId?` | `string` | External account ID (for fiat destination) |
# PolicyExpirationArgs
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PolicyExpirationArgs
Policy expiration arguments
## Properties
| Property | Type | Description |
| ------------------ | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `numPeriods` | `number` | Number of periods until expiration (e.g., 2 for "2 weeks" if period is Weekly) |
| `period` | [`Period`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/Period) | Period type for expiration calculation |
# PolicySigner
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PolicySigner
Policy signer configuration
## Properties
| Property | Type | Description |
| ------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| `address` | `string` | Public key address of the signer |
| `permissions` | [`PolicyPermission`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PolicyPermission)\[] | Permissions granted to this signer |
# PrepareArbitraryTransactionQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PrepareArbitraryTransactionQueryParams
Query parameters for preparing arbitrary transactions
## Properties
| Property | Type | Description |
| -------------- | --------- | ---------------------------------- |
| `debug?` | `boolean` | Enable debug mode (default: false) |
# PrepareArbitraryTransactionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PrepareArbitraryTransactionRequest
Prepare arbitrary transaction request
## Properties
| Property | Type | Description |
| ------------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------- |
| `transaction` | `string` | - |
| ~~`transactionSigners?`~~ | `string`\[] | **Deprecated** Use accountSigners instead |
| `accountSigners?` | `string`\[] | - |
| ~~`payerAddress?`~~ | `string` | **Deprecated** Use feeConfig instead |
| `feeConfig?` | [`FeeConfig`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FeeConfig) | - |
# Receipt
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/Receipt
## Properties
| Property | Type |
| ----------------- | -------- |
| `id` | `string` |
| `object` | `string` |
| `createdAt` | `string` |
# RemovePasskeyQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RemovePasskeyQueryParams
Remove Passkey Query Params
## Properties
| Property | Type |
| -------------- | --------- |
| `admin?` | `boolean` |
# RemovePasskeyRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RemovePasskeyRequest
Remove Passkey Request
## Properties
| Property | Type |
| --------------------------- | ----------- |
| `transactionSigners?` | `string`\[] |
# RemovePasskeyResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RemovePasskeyResponse
Remove Passkey Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------ | ----------- |
| `transaction` | `string` | - |
| `removedPasskey` | [`PasskeyInfo`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyInfo) | - |
| `threshold` | `number` | - |
| `status` | `string` | - |
| `expiresAt` | `string` | - |
# RequestKycLinkRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RequestKycLinkRequest
Request KYC link
## Properties
| Property | Type |
| --------------------- | ----------------------------------------------------------------------------------------------------- |
| `type` | [`KycType`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/KycType) |
| `email` | `string` |
| `fullName` | `string` |
| `endorsements?` | [`KycEndorsement`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/KycEndorsement)\[] |
| `redirectUri?` | `string` |
# SendTransactionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SendTransactionRequest
Transaction submission request
## Properties
| Property | Type | Description |
| -------------------------------- | ------------------------------------------------------------------------------------------------------ | -------------------------- |
| `signedTransactionPayload` | [`TransactionResult`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionResult) | Signed transaction payload |
| `address` | `string` | Target address |
# SignAndSendRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SignAndSendRequest
Request to sign and send a transaction to the blockchain.
## Properties
| Property | Type | Description |
| -------------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `sessionSecrets` | `TaggedKeyPair`\[] \| `Keypair`\[] | Cryptographic keys for signing |
| `session?` | `any`\[] | Optional session data from authentication |
| `transactionPayload` | [`TransactionPayload`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionPayload) | Transaction data to be signed and sent |
| `address` | `string` | Target address for the transaction |
# SignRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SignRequest
Sign Request
## Properties
| Property | Type | Description |
| -------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `sessionSecrets` | `TaggedKeyPair`\[] \| `Keypair`\[] | Secrets generated via generateSessionSecrets() |
| `session?` | `any`\[] | Optional session data from authentication via initAuth() |
| `transactionPayload` | [`TransactionPayload`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionPayload) | Transaction data to be signed and sent |
| `provider?` | `SignerProvider` | Provider to use for signing (privy, turnkey) |
# SignersAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SignersAccountRequest
Signer-based account creation request with full policy control
## Properties
| Property | Type | Description |
| ---------------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `type` | `"signers"` | - |
| `policies` | [`AccountPolicies`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountPolicies) | Account policies (signers, threshold, restrictions) |
| `memo?` | `string` | - |
# SpendingLimit
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimit
Spending limit data with configuration, usage, and metadata
## Properties
| Property | Type | Description |
| ----------------------------- | ----------- | ------------------------------------------------------- |
| `address` | `string` | On-chain spending limit address |
| `settingsAddress` | `string` | Settings account address |
| `mainAccountAddress` | `string` | Main smart account address |
| `environment` | `string` | Environment (sandbox or production) |
| `mint` | `string` | Token mint address |
| `amount` | `number` | Maximum amount per period |
| `period` | `number` | Period type (0=one\_time, 1=daily, 2=weekly, 3=monthly) |
| `remainingAmount` | `number` | Remaining amount in current period |
| `status` | `string` | - |
| `lastReset` | `number` | Unix timestamp of last reset |
| `signers` | `string`\[] | Authorized signer addresses |
| `destinations` | `string`\[] | Allowed destination addresses |
| `expiration` | `number` | Unix timestamp of expiration (0 for no expiration) |
| `slot` | `number` | Solana slot of last modification |
| `blockTime` | `string` | Block timestamp of last modification |
| `lastModifiedSignature` | `string` | Last modification transaction signature |
# SpendingLimitRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitRequest
Create spending limit request
## Properties
| Property | Type | Description |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------- |
| `amount` | `string` \| `number` | Amount (min: 1) |
| `mint` | `string` | Token mint address |
| `period` | [`SpendingLimitPeriod`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/SpendingLimitPeriod) | Spending limit period |
| `transactionSigners?` | `string`\[] | Signers required to approve transaction (account addresses) |
| `spendingLimitSigners` | `string`\[] | Signers authorized to use this limit (account addresses) |
| `destinations?` | `string`\[] | Allowed destination addresses (optional) |
| `expiration?` | `number` | Unix timestamp expiration (optional) |
# SpendingLimitResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitResponse
Get spending limit response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# SpendingLimitTransactionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitTransactionResponse
Spending limit transaction response (for update/delete operations)
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------------- | --------------- | ------------------------------------ |
| `transaction` | `string` | Serialized transaction for signing |
| `transactionSigners` | `string`\[] | - |
| `kmsPayloads` | `KmsPayload`\[] | KMS payloads for multi-party signing |
# SpendingLimitsResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SpendingLimitsResponse
Get spending limits response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# StandingOrderResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/StandingOrderResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# StandingOrdersResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/StandingOrdersResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# TransactionPayload
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionPayload
Transaction payload containing the transaction data and required signatures.
## Example
```typescript theme={null}
const payload: TransactionPayload = {
transaction: 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQABBCk...',
transactionSigners: ['5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM'],
kmsPayloads: [
{
provider: 'privy',
address: '5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM',
payload: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
}
]
};
```
## Properties
| Property | Type | Description |
| -------------------------- | --------------- | ------------------------------------------- |
| `transaction` | `string` | Serialized transaction data |
| `transactionSigners` | `string`\[] | Array of signer public keys |
| `kmsPayloads` | `KmsPayload`\[] | Key management service payloads for signing |
# TransactionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# TransactionResult
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionResult
Result of a transaction signing operation.
## Properties
| Property | Type | Description |
| ------------------- | ----------------- | ------------------------------- |
| `transaction` | `string` | The signed transaction data |
| `kmsPayloads` | `KmsSignature`\[] | Array of KMS signature payloads |
# TransactionSubmissionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionSubmissionResponse
Transaction submission response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------------- | -------- | ---------------------- |
| `transactionSignature` | `string` | Transaction signature |
| `confirmedAt` | `string` | Confirmation timestamp |
# UniversalKeyPair
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UniversalKeyPair
Key pair for cryptographic operations (publicKeyUncompressed required for Turnkey signing)
## Properties
| Property | Type |
| ------------------------------ | -------- |
| `publicKey` | `string` |
| `privateKey` | `string` |
| `publicKeyUncompressed?` | `string` |
# UpdateAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UpdateAccountRequest
Update account configuration (all fields optional)
## Example
```typescript theme={null}
const update: UpdateAccountRequest = {
threshold: 2,
transactionSigners: ['5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM']
};
const withSigners: UpdateAccountRequest = {
signers: [{
address: 'newSignerPublicKey',
role: 'backup',
permissions: ['CAN_VOTE']
}],
threshold: 2
};
```
## Properties
| Property | Type | Description |
| --------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `signers?` | [`AccountSigner`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountSigner)\[] | Signers (replaces existing if provided) |
| `threshold?` | `number` | Approval threshold (must not exceed signers.length, range: 1-10) |
| `timeLock?` | `number` | Time lock in seconds (range: 1 to u32::MAX) |
| `adminAddress?` | `string` | Admin address (pass null to remove) |
| `transactionSigners?` | `string`\[] | Signer addresses that must approve this update |
# UpdateSpendingLimitRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UpdateSpendingLimitRequest
Update spending limit request
## Properties
| Property | Type | Description |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------ | --------------- |
| `amount?` | `string` \| `number` | Amount (min: 1) |
| `mint?` | `string` | - |
| `period?` | [`SpendingLimitPeriod`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/SpendingLimitPeriod) | - |
| `spendingLimitSigners?` | `string`\[] | - |
| `destinations?` | `string`\[] | - |
| `expiration?` | `number` | - |
| `transactionSigners?` | `string`\[] | - |
# UseSpendingLimitRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/UseSpendingLimitRequest
Use spending limit request (consume from existing limit)
## Properties
| Property | Type | Description |
| ------------------------ | -------------------- | -------------------------------------- |
| `amount` | `string` \| `number` | Amount to use from limit (min: 1) |
| `signerAddress` | `string` | Signer address authorized to use limit |
| `recipientAddress` | `string` | Recipient address for transfer |
# VirtualAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VirtualAccountResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# VirtualAccountsResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VirtualAccountsResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# VoteProposalRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VoteProposalRequest
Vote on proposal request
## Properties
| Property | Type | Description |
| --------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
| `signers` | `string`\[] | Array of signer addresses that will vote (must have CAN\_VOTE permission) |
| `action` | [`VoteAction`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/VoteAction) | Vote action to perform |
# VoteProposalResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VoteProposalResponse
Vote on proposal response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------------- | ----------- | ----------------------------------------- |
| `transaction` | `string` | Base64-encoded unsigned transaction |
| `transactionSigners` | `string`\[] | Signers that need to sign the transaction |
# TypeScript SDK Quickstart
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/quickstart
## Installation
**Version:** 3.1.0 | [View on npm](https:/www.npmjs.com/package/@sqds/grid)
Grid SDK for typescript applications.
## Installation
```bash theme={null}
npm install @sqds/grid
```
## Features
* **Multi-provider**: Turnkey, Privy, and passkey authentication
* **Smart accounts**: Multi-sig policies, spending limits, time locks
* **Smart transactions**: Automated DCA, limit orders, and trading strategies
* **Fiat on/off-ramp**: ACH, SEPA, wire transfers with virtual accounts
* **KYC verification**: Identity verification for regulated operations
## Usage
```typescript theme={null}
import { GridClient } from '@sqds/grid';
const client = new GridClient({
apiKey: 'your-api-key',
environment: 'sandbox',
});
try {
const sessionSecrets = await client.generateSessionSecrets();
await client.createAccount({
email: 'user@example.com'
});
const otpCode = '123456';
const response = await client.completeAuthAndCreateAccount({
email: 'user@example.com',
code: otpCode,
sessionSecrets
});
const balances = await client.getBalances({
accountAddress: response.data.address,
});
console.log('Balances:', balances.data);
} catch (error) {
console.error('Error:', error.message);
}
```
**Note:** After calling `createAccount`, an OTP code will be sent to the user's email. The user must enter this code, which you then pass to `completeAuthAndCreateAccount` to complete the authentication flow.
# React Native SDK Changelog
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/changelog
Release history for @sqds/grid-react-native
## 1.0.3
### Patch Changes
* Updated dependencies \[a7bc52d]
* @sqds/grid\@3.1.0
## 1.0.2
### Patch Changes
* Updated dependencies \[19375ab]
* Updated dependencies \[706a20c]
* @sqds/grid\@3.0.1
## 1.0.1
### Patch Changes
* Updated dependencies \[adaa877]
* Updated dependencies \[ef7a902]
* Updated dependencies \[adaa877]
* Updated dependencies \[91b52af]
* Updated dependencies \[af4728b]
* @sqds/grid\@3.0.0
## 1.0.0
### Major Changes
* c8d5fa1: First release of `@sqds/grid-react-native` as a standalone package.
**Breaking Changes:**
* Error handling: Methods now throw errors instead of returning `{ success: false }` objects
* Removed `grid_user_id` parameter from all request methods
### Minor Changes
* c8d5fa1: Initial release with React Native support and AsyncStorage-based session persistence
### Patch Changes
* Updated dependencies \[c8d5fa1]
* Updated dependencies \[c8d5fa1]
* Updated dependencies \[c8d5fa1]
* @sqds/grid\@2.0.0
# GridClient
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/classes/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 |
| ----------------- | ----------- | ------------------------------------------------------------------------------------------------ |
| `apiConfig` | `protected` | [`GridApiConfig`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/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;
```
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/react-native/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/react-native/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;
```
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/react-native/reference/latest/interfaces/GetTransfersOptions) | Optional filtering and pagination options |
##### Returns
`Promise`\<[`TransferResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/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;
```
Initialize authentication for an existing user.
This is the first step in the authentication process.
Note: For new users, you must call createAccount first to create an account before initializing authentication. This method is only for authenticating existing users.
##### Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `request` | \| [`InitAuthRequest`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/InitAuthRequest) \| [`AuthenticationRequest`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AuthenticationRequest) | Authentication request containing email, keypair, or passkey information |
##### Returns
`Promise`\<[`InitAuthResponse`](/grid/v1/sdk-reference/react-native/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;
```
This is the second step in email-based authentication. Verifies the OTP
code received via email and establishes an authenticated session.
Note: For new users who need to create an account, use completeAuthAndCreateAccount instead, which completes authentication and creates the account in one step.
##### Parameters
| Parameter | Type | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `request` | [`CompleteAuthRequestWithOtp`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthRequestWithOtp) | Complete authentication request with OTP code and user context |
##### Returns
`Promise`\<[`CompleteAuthResponse`](/grid/v1/sdk-reference/react-native/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: ,
sessionSecrets: sessionSecrets
});
```
***
#### completeAuthAndCreateAccount()
```ts theme={null}
completeAuthAndCreateAccount(request): Promise;
```
Complete authentication and create account (streamlined onboarding)
##### Parameters
| Parameter | Type | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| `request` | [`CompleteAuthAndCreateAccountRequest`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthAndCreateAccountRequest) | Auth completion and account creation request |
##### Returns
`Promise`\<[`CompleteAuthAndCreateAccountResponse`](/grid/v1/sdk-reference/react-native/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;
```
Refresh MPC provider session to extend lifetime
Note: Currently supports Privy only. Turnkey refresh not yet implemented.
##### Parameters
| Parameter | Type | Description |
| --------- | ---------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `request` | [`RefreshSessionRequest`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RefreshSessionRequest) | Session refresh request |
##### Returns
`Promise`\<[`RefreshSessionResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/type-aliases/CreateAccountRequest) \| [`CreateAccountInput`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateAccountInput) | Account creation input (simplified) or full request object with policies |
##### Returns
`Promise`\<[`CreateAccountResponse`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/CreateAccountResponse)>
Promise resolving to created account information
Note: When passing AccountPolicies with signers, role defaults to 'primary' and provider defaults to 'external' if not specified.
##### 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/react-native/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;
```
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/react-native/reference/latest/interfaces/RequestKycLinkRequest) | KYC link request with verification requirements |
##### Returns
`Promise`\<[`KycLinkResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/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;
```
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/react-native/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/react-native/reference/latest/interfaces/TransactionPayload) | Original Grid transaction data |
| `externallySignedTransaction` | `VersionedTransaction` | The signed VersionedTransaction |
##### Returns
[`TransactionPayload`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/GetAccountBalancesQueryParams) | Optional query parameters for filtering and pagination |
##### Returns
`Promise`\<[`AccountBalancesResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/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;
```
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/react-native/reference/latest/interfaces/AddPasskeyRequest) | Passkey registration request with credential data |
| `queryParams?` | [`AddPasskeyQueryParams`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AddPasskeyQueryParams) | Optional query parameters for the registration |
##### Returns
`Promise`\<[`AddPasskeyResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/RemovePasskeyQueryParams) | Optional query parameters for the removal |
##### Returns
`Promise`\<[`RemovePasskeyResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/PasskeyRequest) | Passkey creation parameters including challenge and user info |
##### Returns
`Promise`\<[`PasskeyCredentialData`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/PasskeyRequest) | Passkey authentication parameters including challenge |
| `credentialData?` | [`PasskeyCredentialData`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyCredentialData) | Optional specific credential to authenticate with |
##### Returns
`Promise`\<[`PasskeyAssertionResponse`](/grid/v1/sdk-reference/react-native/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/react-native/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/react-native/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;
```
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/react-native/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/react-native/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;
```
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;
```
Submits passkey authentication data to authorize an existing session,
completing the WebAuthn authentication flow.
##### Parameters
| Parameter | Type | Description |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `params` | [`AuthorizePasskeySessionRequest`](/grid/v1/sdk-reference/react-native/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/react-native/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;
```
Finalizes a passkey authentication session, generating the final
session tokens and account access credentials.
##### Parameters
| Parameter | Type | Description |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `params` | [`SubmitPasskeySessionRequest`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SubmitPasskeySessionRequest) | Passkey session submission parameters |
| `environment` | `string` | Target environment ('sandbox' or 'production') |
##### Returns
`Promise`\<[`SubmitPasskeySessionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SubmitPasskeySessionResponse)>
Promise resolving to session submission response with account details
##### Example
```typescript theme={null}
const result = await gridClient.submitPasskeySession({
authenticatorResponse: ,
sessionKey: 'public-key-base58',
ceremonyType: 'auth',
slotNumber: 123
}, 'sandbox');
```
***
#### findPasskeyAccount()
```ts theme={null}
findPasskeyAccount(params, environment): Promise;
```
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/react-native/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/react-native/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:
}, 'sandbox');
```
***
#### getPasskeyAccount()
```ts theme={null}
getPasskeyAccount(passkeyAddress, environment): Promise;
```
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/react-native/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;
```
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: Non-Enterprise customers must provide a `feeConfig` in the request.
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/react-native/reference/latest/interfaces/CreatePaymentIntentRequest) | Payment intent request with amount, currency, and payment method |
##### Returns
`Promise`\<[`CreatePaymentIntentResponse`](/grid/v1/sdk-reference/react-native/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;
```
Create a proposal
##### Parameters
| Parameter | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------------------- | ----------------------- |
| `accountAddress` | `string` | Account address |
| `request` | [`CreateProposalRequest`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateProposalRequest) | Create proposal request |
##### Returns
`Promise`\<[`CreateProposalResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/VoteProposalRequest) | Vote proposal request containing signers and action |
##### Returns
`Promise`\<[`VoteProposalResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/ExecuteProposalRequest) | Execute proposal request with signer |
##### Returns
`Promise`\<[`ExecuteProposalResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/SpendingLimitRequest) | Spending limit configuration including amount, token, and period |
##### Returns
`Promise`\<[`CreateSpendingLimitResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/UpdateSpendingLimitRequest) | Update request with new spending limit parameters |
##### Returns
`Promise`\<[`SpendingLimitTransactionResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/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;
```
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/react-native/reference/latest/interfaces/UseSpendingLimitRequest) | Transaction request to authorize against the spending limit |
##### Returns
`Promise`\<[`SpendingLimitTransactionResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/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;
```
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/react-native/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;
```
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/react-native/reference/latest/interfaces/CreateStandingOrderRequest) | Standing order request with payment details and schedule |
##### Returns
`Promise`\<[`CreateStandingOrderResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/GetStandingOrdersQueryParams) | Optional query parameters for filtering and pagination |
##### Returns
`Promise`\<[`StandingOrdersResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/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;
```
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/react-native/reference/latest/interfaces/PrepareArbitraryTransactionRequest) | Transaction preparation request with the raw transaction |
| `queryParams?` | [`PrepareArbitraryTransactionQueryParams`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PrepareArbitraryTransactionQueryParams) | Optional query parameters for transaction preparation |
##### Returns
`Promise`\<[`TransactionResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/SignRequest) | Sign request containing transaction payload and session secrets |
##### Returns
`Promise`\<[`TransactionResult`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/SignAndSendRequest) | Sign and send request containing transaction payload and session secrets |
##### Returns
`Promise`\<[`TransactionSubmissionResponse`](/grid/v1/sdk-reference/react-native/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;
```
Submits a previously signed transaction to the Solana blockchain through
the Grid API.
##### Parameters
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `request` | [`SendTransactionRequest`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SendTransactionRequest) | Send request containing the signed transaction and account address |
##### Returns
`Promise`\<[`TransactionSubmissionResponse`](/grid/v1/sdk-reference/react-native/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/react-native/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;
```
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/react-native/reference/latest/interfaces/RequestVirtualAccountRequest) | Virtual account request with banking details and preferences |
##### Returns
`Promise`\<[`VirtualAccountResponse`](/grid/v1/sdk-reference/react-native/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;
```
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/react-native/reference/latest/interfaces/GetVirtualAccountsQueryParams) | Optional query parameters for filtering and pagination |
##### Returns
`Promise`\<[`VirtualAccountsResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VirtualAccountsResponse)>
Promise resolving to virtual accounts response
##### Example
```typescript theme={null}
const virtualAccounts = await gridClient.getVirtualAccounts(accountAddress);
```
# AccountBalancesResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountBalancesResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# AccountSigner
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountSigner
Signer in multi-signature account
Note: role defaults to 'primary', provider defaults to 'external'
## Example
```typescript theme={null}
const signer: AccountSigner = {
address: '5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM',
permissions: ['CAN_INITIATE', 'CAN_EXECUTE', 'CAN_VOTE']
};
const backupSigner: AccountSigner = {
address: '...',
role: 'backup',
permissions: ['CAN_VOTE'],
provider: 'turnkey'
};
```
## Properties
| Property | Type | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `address` | `string` | Public key address |
| `role?` | [`SignerRole`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/SignerRole) | Role (defaults to 'primary') |
| `permissions` | [`SignerPermission`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/SignerPermission)\[] | Permissions granted to signer |
| `provider?` | `string` | Authentication provider (defaults to 'external') |
# AddPasskeyQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AddPasskeyQueryParams
Query parameters for adding passkey
## Properties
| Property | Type | Description |
| -------------- | --------- | -------------------------------------------------- |
| `admin?` | `boolean` | Whether to add as admin signer (defaults to false) |
# AddPasskeyRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AddPasskeyRequest
Request to add passkey signer to account
## Properties
| Property | Type | Description |
| --------------------------- | -------------- | ------------------------------------------------ |
| `passkey` | `PasskeyInput` | Passkey configuration |
| `transactionSigners?` | `string`\[] | Required transaction signers (account addresses) |
# AddPasskeyResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AddPasskeyResponse
Add passkey response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ------------- | -------------------------------------------------------------------------------------------- | -------------------------------------- |
| `transaction` | `string` | - |
| `passkey` | [`PasskeyInfo`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyInfo) | - |
| `threshold` | `number` | - |
| `status` | `string` | - |
| `expiresAt` | `string` | ISO timestamp when transaction expires |
# AuthenticationRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AuthenticationRequest
Authentication request parameters for various providers.
## Properties
| Property | Type | Description |
| ------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------- |
| `email?` | `string` | User email for email-based authentication |
| `keypair?` | [`UniversalKeyPair`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/UniversalKeyPair) | Key pair for cryptographic authentication |
| `passkeyId?` | `string` | Passkey identifier for passkey authentication |
| `provider?` | `SignerProvider` | Authentication provider type |
| `expiration?` | `number` | Authentication expiration timestamp |
# BaseResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BaseResponse
Base interface for all API responses with data and metadata
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Extended by
* [`TransactionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionResponse)
* [`InitAuthResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/InitAuthResponse)
* [`CompleteAuthResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthResponse)
* [`CompleteAuthAndCreateAccountResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthAndCreateAccountResponse)
* [`GetAccountResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetAccountResponse)
* [`AccountBalancesResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountBalancesResponse)
* [`GetTransactionsResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetTransactionsResponse)
* [`TransactionSubmissionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionSubmissionResponse)
* [`TransferResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransferResponse)
* [`CreateSpendingLimitResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateSpendingLimitResponse)
* [`SpendingLimitTransactionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimitTransactionResponse)
* [`SpendingLimitResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimitResponse)
* [`SpendingLimitsResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimitsResponse)
* [`GetPasskeysResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetPasskeysResponse)
* [`AddPasskeyResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AddPasskeyResponse)
* [`RemovePasskeyResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RemovePasskeyResponse)
* [`CreatePaymentIntentResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreatePaymentIntentResponse)
* [`KycLinkResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/KycLinkResponse)
* [`KycStatusResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/KycStatusResponse)
* [`RefreshSessionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RefreshSessionResponse)
* [`CreateProposalResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateProposalResponse)
* [`VoteProposalResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VoteProposalResponse)
* [`ExecuteProposalResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/ExecuteProposalResponse)
* [`CreateTradeSmartTransactionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateTradeSmartTransactionResponse)
* [`GetTradeQuoteResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetTradeQuoteResponse)
* [`TradeSmartTransactionQuoteResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TradeSmartTransactionQuoteResponse)
* [`PrepareTradeSmartTransactionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PrepareTradeSmartTransactionResponse)
* [`GetTradeSmartTransactionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetTradeSmartTransactionResponse)
* [`VirtualAccountResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VirtualAccountResponse)
* [`VirtualAccountsResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VirtualAccountsResponse)
* [`CreateStandingOrderResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateStandingOrderResponse)
* [`StandingOrderResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/StandingOrderResponse)
* [`StandingOrdersResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/StandingOrdersResponse)
* [`AuthorizePasskeySessionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AuthorizePasskeySessionResponse)
* [`SubmitPasskeySessionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SubmitPasskeySessionResponse)
* [`FindPasskeyAccountResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/FindPasskeyAccountResponse)
* [`GetPasskeySessionResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetPasskeySessionResponse)
* [`GetPasskeyAccountResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetPasskeyAccountResponse)
* [`CreatePasskeyAccountResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreatePasskeyAccountResponse)
## Type Parameters
| Type Parameter | Default type | Description |
| -------------- | ------------ | --------------------- |
| `T` | `any` | Type of response data |
## Properties
| Property | Type | Description |
| --------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data` | `T` | Response data from API Contains the actual payload returned by the API endpoint. The type varies based on the specific response interface. |
| `lastResponse?` | [`LastResponse`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/LastResponse) | Response metadata with request ID and status code Useful for debugging and tracking requests. Contains: - requestId: Unique identifier for this request - statusCode: HTTP status code (200, 201, etc.) - headers: All response headers - idempotencyKey: Key for idempotent requests (if applicable) **See** LastResponse |
# CompleteAuthAndCreateAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthAndCreateAccountRequest
## Properties
| Property | Type |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `otpCode` | `string` |
| `otpId?` | `string` |
| `provider?` | `"privy"` \| `"turnkey"` |
| `user` | [`GridClientUserContext`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridClientUserContext) |
| `sessionSecrets` | `SessionSecrets` |
# CompleteAuthRequestWithOtp
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthRequestWithOtp
Complete authentication request with OTP verification
## Properties
| Property | Type | Description | Inherited from |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------- |
| `expiration?` | `number` | - | `CompleteAuthRequest.expiration` |
| `otpCode` | `string` | OTP code received by user | - |
| `user` | [`GridClientUserContext`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridClientUserContext) | - | - |
| `sessionSecrets` | `SessionSecrets` | Session-specific cryptographic secrets | - |
# CompleteAuthResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------ | ----------- |
| `address` | `string` | - |
| `policies` | [`AccountPolicies`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountPolicies) | - |
| `gridUserId` | `string` | - |
| `authentication` | [`AuthenticationData`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/AuthenticationData) | - |
# CreatePaymentIntentResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreatePaymentIntentResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# GetPasskeysResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetPasskeysResponse
Get passkeys response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | -------------------------------------------------------------------------------------------- | ----------- |
| `accountAddress` | `string` | - |
| `passkey` | [`PasskeyInfo`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyInfo) | - |
# GridApiConfig
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridApiConfig
Grid API client configuration
Security:
* `apiKey`: Backend only - never expose in frontend code
* `appId`: Safe for frontend - requires domain whitelist configuration
## Properties
| Property | Type | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| `apiKey?` | `string` | API key for backend authentication (never expose in frontend code) |
| `environment` | [`GridEnvironment`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/GridEnvironment) | Target environment (sandbox or production) |
| `baseUrl?` | `string` | Base URL for the Grid API |
| `appId?` | `string` | Application ID for frontend (safe to expose, whitelist domains in dashboard) |
| `timeout?` | `number` | Request timeout in milliseconds |
| `retryAttempts?` | `number` | Retry attempts for failed requests |
| `solanaRpcUrl?` | `string` | Solana RPC endpoint URL |
# GridErrorDetail
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridErrorDetail
Error detail from API validation failures
## Properties
| Property | Type | Description |
| ---------------------- | -------- | -------------------------------------- |
| `field` | `string` | Field that caused the validation error |
| `code` | `string` | Machine-readable error code |
| `message` | `string` | Human-readable error message |
| `suggestion?` | `string` | Suggestion for fixing the error |
| `documentation?` | `string` | Link to relevant documentation |
# InitAuthData
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/InitAuthData
Authentication initialization data for MPC providers (Privy, Turnkey, etc.)
## Properties
| Property | Type | Description |
| ----------------- | ---------------------------------------------------------------------- | --------------------------------- |
| `type` | `string` | - |
| `email` | `string` | - |
| `status` | `string` | - |
| `otpSent` | `boolean` | Whether OTP was sent successfully |
| `otpId?` | `string` | - |
| `provider` | `"privy"` \| `"turnkey"` \| `"passkey"` \| `"external"` \| `"dynamic"` | MPC provider type |
| `createdAt` | `string` | Creation timestamp (ISO string) |
| `expiresAt` | `string` | Expiration timestamp (ISO string) |
# InitAuthEOAData
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/InitAuthEOAData
Authentication initialization data for EOA/Solana wallets
## Properties
| Property | Type | Description |
| --------------------- | --------- | ---------------------------------- |
| `authenticated` | `boolean` | - |
| `provider` | `string` | Provider type (typically 'solana') |
| `publicKey` | `string` | Wallet public key |
# InitAuthRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/InitAuthRequest
## Properties
| Property | Type |
| ------------------- | -------- |
| `email?` | `string` |
| `expiration?` | `number` |
# InitAuthResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/InitAuthResponse
Authentication initialization response (data varies by provider type)
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# KycLinkResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/KycLinkResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# KycStatusResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/KycStatusResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# LastResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/LastResponse
API response metadata for request tracking and debugging
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
This provides metadata
about the API request for troubleshooting and support queries.
## Remarks
Use this metadata to:
* Track requests by requestId when contacting support
* Verify successful requests via statusCode
* Implement retry logic based on idempotencyKey
* Debug issues by inspecting response headers
## Example
```typescript theme={null}
const response = await gridClient.getAccount(address);
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('All headers:', response.lastResponse?.headers);
```
## Properties
| Property | Type | Description |
| ----------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `requestId` | `string` | Unique identifier from x-request-id header Use this when contacting support to help identify the specific request. |
| `statusCode` | `number` | HTTP status code (200, 201, 400, etc.) Indicates the success status of the request. |
| `idempotencyKey?` | `string` | Idempotency key from x-idempotency-key header Used to safely retry requests without duplicate effects. Only present if the request included an idempotency key. |
| `headers` | `Record`\<`string`, `string`> | All response headers as key-value pairs Contains all HTTP headers returned by the server. |
# PasskeyInfo
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyInfo
Passkey information
## Properties
| Property | Type | Description |
| ------------------- | ----------- | ------------------------------------ |
| `address` | `string` | - |
| `role` | `string` | - |
| `permissions` | `string`\[] | - |
| `provider` | `string` | - |
| `addedAt` | `string` | ISO timestamp when passkey was added |
# SendTransactionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SendTransactionRequest
Transaction submission request
## Properties
| Property | Type | Description |
| -------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------- |
| `signedTransactionPayload` | [`TransactionResult`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionResult) | Signed transaction payload |
| `address` | `string` | Target address |
# SignAndSendRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SignAndSendRequest
Request to sign and send a transaction to the blockchain.
## Properties
| Property | Type | Description |
| -------------------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `sessionSecrets` | `TaggedKeyPair`\[] \| `Keypair`\[] | Cryptographic keys for signing |
| `session?` | `any`\[] | Optional session data from authentication |
| `transactionPayload` | [`TransactionPayload`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionPayload) | Transaction data to be signed and sent |
| `address` | `string` | Target address for the transaction |
# SignRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SignRequest
Sign Request
## Properties
| Property | Type | Description |
| -------------------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `sessionSecrets` | `TaggedKeyPair`\[] \| `Keypair`\[] | Secrets generated via generateSessionSecrets() |
| `session?` | `any`\[] | Optional session data from authentication via initAuth() |
| `transactionPayload` | [`TransactionPayload`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionPayload) | Transaction data to be signed and sent |
| `provider?` | `SignerProvider` | Provider to use for signing (privy, turnkey) |
# SpendingLimitRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimitRequest
Create spending limit request
## Properties
| Property | Type | Description |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| `amount` | `string` \| `number` | Amount (min: 1) |
| `mint` | `string` | Token mint address |
| `period` | [`SpendingLimitPeriod`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/SpendingLimitPeriod) | Spending limit period |
| `transactionSigners?` | `string`\[] | Signers required to approve transaction (account addresses) |
| `spendingLimitSigners` | `string`\[] | Signers authorized to use this limit (account addresses) |
| `destinations?` | `string`\[] | Allowed destination addresses (optional) |
| `expiration?` | `number` | Unix timestamp expiration (optional) |
# StandingOrderResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/StandingOrderResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# StandingOrdersResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/StandingOrdersResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# TransactionPayload
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionPayload
Transaction payload containing the transaction data and required signatures.
## Example
```typescript theme={null}
const payload: TransactionPayload = {
transaction: 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQABBCk...',
transactionSigners: ['5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM'],
kmsPayloads: [
{
provider: 'privy',
address: '5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM',
payload: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
}
]
};
```
## Properties
| Property | Type | Description |
| -------------------------- | --------------- | ------------------------------------------- |
| `transaction` | `string` | Serialized transaction data |
| `transactionSigners` | `string`\[] | Array of signer public keys |
| `kmsPayloads` | `KmsPayload`\[] | Key management service payloads for signing |
# TransactionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# TransactionResult
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionResult
Result of a transaction signing operation.
## Properties
| Property | Type | Description |
| ------------------- | ----------------- | ------------------------------- |
| `transaction` | `string` | The signed transaction data |
| `kmsPayloads` | `KmsSignature`\[] | Array of KMS signature payloads |
# TransactionSubmissionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionSubmissionResponse
Transaction submission response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------------- | -------- | ---------------------- |
| `transactionSignature` | `string` | Transaction signature |
| `confirmedAt` | `string` | Confirmation timestamp |
# UniversalKeyPair
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/UniversalKeyPair
Key pair for cryptographic operations (publicKeyUncompressed required for Turnkey signing)
## Properties
| Property | Type |
| ------------------------------ | -------- |
| `publicKey` | `string` |
| `privateKey` | `string` |
| `publicKeyUncompressed?` | `string` |
# UpdateAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/UpdateAccountRequest
Update account configuration (all fields optional)
## Example
```typescript theme={null}
const update: UpdateAccountRequest = {
threshold: 2,
transactionSigners: ['5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM']
};
const withSigners: UpdateAccountRequest = {
signers: [{
address: 'newSignerPublicKey',
role: 'backup',
permissions: ['CAN_VOTE']
}],
threshold: 2
};
```
## Properties
| Property | Type | Description |
| --------------------------- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `signers?` | [`AccountSigner`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountSigner)\[] | Signers (replaces existing if provided) |
| `threshold?` | `number` | Approval threshold (must not exceed signers.length, range: 1-10) |
| `timeLock?` | `number` | Time lock in seconds (range: 1 to u32::MAX) |
| `adminAddress?` | `string` | Admin address (pass null to remove) |
| `transactionSigners?` | `string`\[] | Signer addresses that must approve this update |
# VirtualAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VirtualAccountResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# VirtualAccountsResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VirtualAccountsResponse
Base interface for all API responses with data and metadata
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
All successful API responses follow this wrapper pattern for consistency and debugging.
Errors throw GridError instead of returning error objects.
## Remarks
The BaseResponse wrapper provides:
* **data**: The actual response payload from the API
* **lastResponse**: Request metadata for debugging and tracking
This pattern making it easy to:
* Access response data via the `data` property
* Track requests using `lastResponse.requestId` for support queries
* Debug issues with status codes and headers
* Implement idempotency using `lastResponse.idempotencyKey`
Note: Errors are NOT returned in the response. Instead, they throw GridError with similar metadata.
## Examples
```typescript theme={null}
const response = await gridClient.getAccount(accountAddress);
console.log(response.data.address);
console.log(response.data.policies);
```
```typescript theme={null}
const response = await gridClient.createAccount({ email: 'user@example.com' });
console.log('Request ID:', response.lastResponse?.requestId);
console.log('Status:', response.lastResponse?.statusCode);
console.log('Idempotency Key:', response.lastResponse?.idempotencyKey);
```
```typescript theme={null}
try {
const response = await gridClient.getAccount(accountAddress);
console.log('Success:', response.data);
} catch (error) {
if (error instanceof GridError) {
console.error('Error:', error.message);
console.error('Request ID:', error.lastResponse?.requestId);
}
}
```
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# React Native SDK Quickstart
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/quickstart
## Installation
**Version:** 1.0.3 | [View on npm](https:/www.npmjs.com/package/@sqds/grid-react-native)
React Native SDK for Grid - authentication, smart accounts, and payments.
## Installation
```bash theme={null}
npm install @sqds/grid-react-native
```
## Required Polyfills
**IMPORTANT:** Configure polyfills at your app's entry point before importing any other code.
### 1. Install Dependencies
```bash theme={null}
npm install text-encoding react-native-get-random-values buffer @ethersproject/shims
```
### 2. Configure Polyfills
Create a file `entrypoint.js`:
```js theme={null}
import 'text-encoding';
import 'react-native-get-random-values';
import { Buffer } from 'buffer';
global.Buffer = Buffer;
import '@ethersproject/shims';
import 'expo-router/entry';
```
Set this as your entry point in `package.json`:
```json theme={null}
{
"name": "your-app-name",
"main": "entrypoint.js"
}
```
## Quick Start
```typescript theme={null}
import { GridClient } from '@sqds/grid-react-native';
const gridClient = new GridClient({
environment: 'sandbox',
apiKey: ''
});
try {
const sessionSecrets = await gridClient.generateSessionSecrets();
await gridClient.createAccount({
email: 'user@example.com'
});
const otpCode = '123456';
const response = await gridClient.completeAuthAndCreateAccount({
email: 'user@example.com',
code: otpCode,
sessionSecrets
});
console.log('Authentication successful:', response.data);
} catch (error) {
console.error('Authentication failed:', error.message);
}
```
**Note:** After calling `createAccount`, an OTP code will be sent to the user's email. The user must enter this code, which you then pass to `completeAuthAndCreateAccount` to complete the authentication flow.
## License
MIT
# Migration to v3.0.0
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/migration-to-v3
Step-by-step guide to migrate from @sqds/grid v2.x to v3.0.0
If you're currently using `@sqds/grid` v2.x, this guide will help you migrate to v3.0.0. The new version introduces improved error handling, camelCase field naming, new trading features, and better state management.
## Overview of Breaking Changes
v3.0.0 introduces several breaking changes that improve the developer experience:
* **Error handling**: Methods now throw `GridError` instead of returning `{success, error}` wrappers
* **camelCase naming**: All response/request fields now use camelCase instead of snake\_case
* **Response structure**: All responses have a `.data` object containing the payload
* **New features**: Account state management, trading smart transactions, and passkey accounts
## Migration Steps
Update your package.json and install v3.0.0:
```bash theme={null}
npm install @sqds/grid@3.0.0
```
Replace all success checks with try/catch blocks. Methods now throw `GridError` on failure.
**Before (v2.x):**
```typescript theme={null}
const response = await gridClient.createAccount({
email: "user@example.com",
});
if (response.success) {
console.log("Account created:", response.data.address);
} else {
console.error("Error:", response.error);
}
```
**After (v3.0.0):**
```typescript theme={null}
import { GridClient, GridError } from '@sqds/grid';
try {
const response = await gridClient.createAccount({
email: "user@example.com",
});
console.log("Account created:", response.data.address);
} catch (error) {
if (error instanceof GridError) {
console.error("Error:", error.message);
console.error("Code:", error.code);
console.error("Status:", error.statusCode);
console.error("Request ID:", error.lastResponse?.requestId);
}
}
```
The `GridError` class provides structured error information including `code`, `statusCode`, `details`, and `lastResponse` for debugging.
All response and request fields now use camelCase instead of snake\_case.
**Before (v2.x):**
```typescript theme={null}
const auth = await gridClient.initAuth({ email: "user@example.com" });
if (auth.success) {
console.log("OTP sent:", auth.data.otp_sent);
console.log("Created:", auth.data.created_at);
console.log("Expires:", auth.data.expires_at);
}
const account = await gridClient.getAccount(address);
if (account.success) {
console.log("User ID:", account.data.grid_user_id);
console.log("Time lock:", account.data.policies?.time_lock);
console.log("Admin:", account.data.policies?.admin_address);
}
```
**After (v3.0.0):**
```typescript theme={null}
try {
const auth = await gridClient.initAuth({ email: "user@example.com" });
console.log("OTP sent:", auth.data.otpSent);
console.log("Created:", auth.data.createdAt);
console.log("Expires:", auth.data.expiresAt);
const account = await gridClient.getAccount(address);
console.log("User ID:", account.data.gridUserId);
console.log("Time lock:", account.data.policies?.timeLock);
console.log("Admin:", account.data.policies?.adminAddress);
} catch (error) {
console.error("Failed:", error);
}
```
**Complete field name mapping:**
| Old (snake\_case) | New (camelCase) |
| ------------------------ | ---------------------- |
| `otp_sent` | `otpSent` |
| `otp_id` | `otpId` |
| `created_at` | `createdAt` |
| `expires_at` | `expiresAt` |
| `grid_user_id` | `gridUserId` |
| `time_lock` | `timeLock` |
| `admin_address` | `adminAddress` |
| `transaction_signers` | `transactionSigners` |
| `spending_limit_signers` | `spendingLimitSigners` |
| `transaction_signature` | `transactionSignature` |
| `confirmed_at` | `confirmedAt` |
**GridError field change:**
```typescript theme={null}
// Before
error.status_code
// After
error.statusCode
```
Responses now use `BaseResponse` which wraps data in a `.data` property along with request metadata in `.lastResponse`.
**Before (v2.x):**
```typescript theme={null}
const balances = await gridClient.getAccountBalances(address);
if (balances.success) {
balances.data.tokens.forEach((token) => {
console.log(`${token.symbol}: ${token.amount}`);
});
}
```
**After (v3.0.0):**
```typescript theme={null}
try {
const balances = await gridClient.getAccountBalances(address);
balances.data.tokens.forEach((token) => {
console.log(`${token.symbol}: ${token.amount}`);
});
console.log("Request ID:", balances.lastResponse?.requestId);
} catch (error) {
console.error("Failed to fetch balances:", error);
}
```
The `.data` property contains your actual response payload. The `.lastResponse` property contains request metadata (requestId, statusCode, headers) useful for debugging and support.
Update authentication data access to use camelCase.
**Before (v2.x):**
```typescript theme={null}
const spendingLimit = await gridClient.createSpendingLimit(
address,
spendingLimitPayload
);
if (spendingLimit.success) {
const signature = await gridClient.signAndSend({
sessionSecrets,
session: authResult.data.authentication,
transactionPayload: spendingLimit.data,
address,
});
}
```
**After (v3.0.0):**
```typescript theme={null}
try {
const spendingLimit = await gridClient.createSpendingLimit(
address,
spendingLimitPayload
);
const signature = await gridClient.signAndSend({
sessionSecrets,
session: authResult.data.authentication,
transactionPayload: spendingLimit.data,
address,
});
console.log("Transaction completed:", signature.data.transactionSignature);
} catch (error) {
console.error("Transaction failed:", error);
}
```
Several response types have been updated. The main change is removing the old `GridResponse` wrapper.
**Type updates:**
```typescript theme={null}
// Old types (v2.x)
GridResponse
GridResponse
GridResponse
// New types (v3.0.0) - use directly
GetAccountResponse
CreateAccountResponse
AccountBalancesResponse
```
Update your function signatures:
```typescript theme={null}
// Before
const handleAccount = async (): Promise> => {
return await gridClient.getAccount(address);
};
// After
const handleAccount = async (): Promise => {
return await gridClient.getAccount(address);
};
```
Run TypeScript compilation and your test suite:
```bash theme={null}
npm run type-check
npm test
```
Common errors to look for:
* `Property 'success' does not exist` - Update to try/catch
* `Property 'xxx_yyy' does not exist` - Update to camelCase
* `Property 'status_code' does not exist on type 'GridError'` - Use `statusCode`
## Migration Checklist
* [ ] Update package to v3.0.0
* [ ] Replace all `if (response.success)` checks with `try/catch` blocks
* [ ] Import and use `GridError` for error handling
* [ ] Update all snake\_case field accesses to camelCase (see table above)
* [ ] Update `error.status_code` to `error.statusCode`
* [ ] Update type declarations to remove `GridResponse` wrapper
* [ ] Test authentication flows (initAuth, completeAuth)
* [ ] Test transaction creation and signing
* [ ] Verify error handling catches `GridError` correctly
* [ ] Run TypeScript compilation to catch any missed changes
# AccountState
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountState
Account state for reactive UI updates
## Properties
| Property | Type | Description |
| ----------------------- | --------- | ------------------------------------ |
| `accountAddress?` | `string` | Smart account address (if connected) |
| `gridUserId?` | `string` | Grid user ID (if connected) |
| `isConnected` | `boolean` | Whether account is connected |
# AuthorizePasskeySessionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AuthorizePasskeySessionRequest
Authorize Passkey Session Request
## Properties
| Property | Type |
| ------------------- | ---------------------------------------------------------------------------------------- |
| `sessionKey?` | [`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey) |
| `metaInfo` | `MetaInfo` |
| `baseUrl?` | `string` |
# AuthorizePasskeySessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AuthorizePasskeySessionResponse
Authorize Passkey Session Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | -------- | ----------- |
| `url` | `string` | - |
# BridgeTransfer
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransfer
Bridge transfer data for fiat-to-crypto or crypto-to-fiat transfers
Represents transfers processed through Bridge's payment rails, including
ACH, SEPA, wire transfers, and other traditional banking methods.
## Properties
| Property | Type |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | `string` |
| `state` | [`TransferState`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/TransferState) |
| `onBehalfOf` | `string` |
| `sourceDepositInstructions?` | [`BridgeTransferSourceDepositInstructions`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransferSourceDepositInstructions) |
| `amount` | `string` |
| `clientReferenceId?` | `string` |
| `currency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
| `developerFee` | `string` |
| `source` | [`BridgeTransferSource`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransferSource) |
| `destination` | [`BridgeTransferDestination`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransferDestination) |
| `receipt` | [`Receipt`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/Receipt) |
| `blockchainMemo?` | `string` |
| `createdAt` | `string` |
| `updatedAt` | `string` |
# BridgeTransferSourceDepositInstructions
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransferSourceDepositInstructions
## Properties
| Property | Type |
| ------------------------------ | -------------------------------------------------------------------------------------------------- |
| `amount?` | `string` |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
| `depositMessage?` | `string` |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PaymentRail) |
| `fromAddress?` | `string` |
| `toAddress?` | `string` |
| `bankName?` | `string` |
| `bankAddress?` | `string` |
| `bankCity?` | `string` |
| `bankCountry?` | `string` |
| `bankPostalCode?` | `string` |
| `iban?` | `string` |
| `swiftBic?` | `string` |
| `beneficiaryName?` | `string` |
| `beneficiaryAddress?` | `string` |
| `beneficiaryCity?` | `string` |
| `beneficiaryCountry?` | `string` |
| `beneficiaryPostalCode?` | `string` |
| `routingNumber?` | `string` |
| `accountNumber?` | `string` |
| `accountType?` | `string` |
# CompleteAuthAndCreateAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CompleteAuthAndCreateAccountResponse
Complete auth and create account response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
| `address` | `string` | - |
| `status` | `string` | - |
| `policies` | [`AccountPolicies`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountPolicies) | - |
| `gridUserId` | `string` | - |
| `authentication` | [`AuthenticationData`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/AuthenticationData) | - |
# CreatePasskeyAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePasskeyAccountRequest
Create Passkey Account Request
Creates both the passkey account (externally signed account) and smart account in one call
## Properties
| Property | Type | Description |
| ----------------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey) | Session key for the passkey account |
| `slotNumber` | `number` | Slot number for the passkey ceremony |
| `authenticatorResponse` | `any` | WebAuthn authenticator response from passkey creation |
| `adminAddress?` | `string` | Optional admin address for settings authority |
| `memo?` | `string` | Optional memo for the account creation |
# CreatePasskeyAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreatePasskeyAccountResponse
Create Passkey Account Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------------------- | ----------- |
| `address` | `string` | - |
| `type` | `string` | - |
| `status` | `string` | - |
| `policies` | [`PasskeyAccountPolicies`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyAccountPolicies) | - |
| `authentication` | [`AuthenticationData`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/AuthenticationData) | - |
| `createdAt` | `string` | - |
| `updatedAt` | `string` | - |
# CreateStandingOrderRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateStandingOrderRequest
Create Standing Order Request
## Properties
| Property | Type |
| ------------------- | ------------------------ |
| `amount` | `string` |
| `source` | `Details` |
| `destination` | `Details` |
| `frequency` | `StandingOrderFrequency` |
| `startDate` | `string` |
| `endDate?` | `string` |
# CreateStandingOrderResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateStandingOrderResponse
Create standing order response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `id` | `string` | Standing order identifier |
| `amount` | `string` | Amount as string |
| `uiAmount` | `string` | Human-readable amount |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) | Currency type |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PaymentRail) | Payment rail used |
| `source` | `Details` | Source account details |
| `destination` | `Details` | Destination account details |
| `frequency` | `StandingOrderFrequency` | Recurrence frequency |
| `startDate` | `string` | Start date (ISO string) |
| `endDate?` | `string` | End date (ISO string, optional) |
| `status` | `StandingOrderStatus` | Current status |
| `transaction` | `string` | Serialized transaction |
| `kmsPayloads` | `KmsPayload`\[] | - |
| `transactionSigners` | `string`\[] | - |
| `validUntil` | `string` | - |
| `createdAt` | `string` | - |
| `transactionPayload` | [`TransactionPayload`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransactionPayload) | - |
# FindPasskeyAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FindPasskeyAccountRequest
Find Passkey Account Request
## Properties
| Property | Type |
| ----------------------------- | ---------------------------------------------------------------------------------------- |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey) |
| `authenticatorResponse` | `any` |
# FindPasskeyAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/FindPasskeyAccountResponse
Find Passkey Account Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------- | ----------- |
| `passkeyAccount` | `string` | - |
| `address` | `string` | - |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey) | - |
# GetPasskeyAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeyAccountResponse
Get Passkey Account Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------- | ----------- |
| `relyingPartyId` | `string` | - |
| `pubkey` | `string` | - |
| `sessionKey?` | [`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey) | - |
# GetPasskeySessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetPasskeySessionResponse
Get Passkey Session Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------- | ----- | ----------- |
| `session?` | `any` | - |
# GetStandingOrdersQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetStandingOrdersQueryParams
Get Standing Orders Query Params
## Properties
| Property | Type |
| ------------------ | --------------------- |
| `status?` | `StandingOrderStatus` |
| `currency?` | `string` |
| `startDate?` | `string` |
| `endDate?` | `string` |
| `txHash?` | `string` |
| `limit?` | `number` |
| `cursor?` | `string` |
# GetTransfersOptions
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetTransfersOptions
## Properties
| Property | Type |
| -------------------- | -------------------------------------------------------------------------------------------------- |
| `paymentRail?` | [`PaymentRail`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PaymentRail) |
| `status?` | [`TransferState`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/TransferState) |
| `currency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
| `startDate?` | `string` |
| `endDate?` | `string` |
| `txHash?` | `string` |
| `limit?` | `number` |
| `cursor?` | `string` |
# GetVirtualAccountsQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GetVirtualAccountsQueryParams
Get virtual accounts query params
## Properties
| Property | Type |
| ---------------------------- | -------------------------------------------------------------------------------------------------- |
| `sourceCurrency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
| `destinationCurrency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
# GridClientContext
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridClientContext
Grid client context
## Properties
| Property | Type |
| -------------- | -------------------------------------------------------------------------------------------------------------- |
| `client` | `ClientContext` |
| `user` | [`GridClientUserContext`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridClientUserContext) |
# GridClientSigner
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridClientSigner
## Properties
| Property | Type |
| ------------------- | ------------------------- |
| `address?` | `string` |
| `email?` | `string` |
| `sessionKey?` | `any` |
| `type` | `"primary"` \| `"backup"` |
| `provider?` | `SignerProvider` |
# GridClientUserContext
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridClientUserContext
## Properties
| Property | Type |
| ------------------- | ------------------------------------------------------------------------------------------------------- |
| `address?` | `string` |
| `gridUserId?` | `string` |
| `signers?` | [`GridClientSigner`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/GridClientSigner)\[] |
| `session?` | `Session` |
| `email?` | `string` |
| `otpId?` | `string` |
| `provider?` | `string` |
# PasskeyAccountInfo
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyAccountInfo
Passkey Account Info returned from account creation
## Properties
| Property | Type | Description |
| ---------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `passkeyAccount` | `string` | The passkey account address |
| `pubkey` | `string` | The public key in base58 format |
| `relyingPartyId` | `string` | The relying party ID (domain) |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey) | Session key associated with the passkey account |
# PasskeyAccountPolicies
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyAccountPolicies
Passkey Account Policies for newly created accounts
## Properties
| Property | Type | Description |
| --------------------- | -------- | ----------------------------------- |
| `threshold` | `number` | Signature threshold for the account |
| `adminAddress?` | `string` | Optional admin address |
# PasskeyAssertionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyAssertionResponse
Passkey Assertion Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
\| Property | Type |
|
\| `response` | \{ `signature`: `string`; `clientDataJSON`: `string`; `authenticatorData`: `string`; `publicKey?`: `string`; } |
|
\| `response.clientDataJSON` | `string` |
|
\| `response.publicKey?` | `string` |
# PasskeyCredentialData
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyCredentialData
Passkey Credential Data
## Properties
| Property | Type |
| -------------------- | ------------- |
| `id` | `ArrayBuffer` |
| `publicKey` | `string` |
| `credentialId` | `string` |
# PasskeyRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PasskeyRequest
Passkey Request
## Properties
| Property | Type |
| --------------------------- | -------- |
| `env` | `Env` |
| `appName?` | `string` |
| `userId?` | `string` |
| `redirectUrl?` | `string` |
| `challenge` | `string` |
| `slotNumber` | `string` |
| `sessionKey` | `string` |
| `expirationInSeconds` | `string` |
# PrivyRefreshSession
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/PrivyRefreshSession
Privy-specific session data for refresh operations
## Properties
| Property | Type | Description |
| -------------------------- | --------- | ----------------------------------------------------------------- |
| `user_id` | `string` | Privy user identifier |
| `session` | `Session` | Session data containing authorization keys and wallet information |
| `token` | `string` | JWT token for Privy authentication |
| `privy_access_token` | `string` | Privy platform access token |
| `refresh_token` | `string` | Refresh token for obtaining new access tokens |
# RefreshSessionKmsProvider
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionKmsProvider
KMS provider configuration for session refresh
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------ |
| `provider` | `string` | MPC provider type |
| `session` | [`ProviderSessionData`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/ProviderSessionData) | Provider-specific session data |
# RefreshSessionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionRequest
Refresh session request (supports cookie-based and body-based flows)
* Cookie-based (recommended): Omit kmsPayload, uses HTTP-only cookies
* Body-based (legacy): Include kmsPayload with tokens
## Properties
| Property | Type | Description |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `kmsPayload?` | [`RefreshSessionKmsProvider`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionKmsProvider) | KMS provider config (optional with HTTP-only cookies) |
| `encryptionPublicKey` | `string` | HPKE public key for response encryption |
# RefreshSessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionResponse
Refresh session response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ------------ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `kmsPayload` | [`RefreshSessionKmsProvider`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RefreshSessionKmsProvider) | Updated KMS provider and session data |
# RequestVirtualAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/RequestVirtualAccountRequest
Request virtual account
## Properties
| Property | Type |
| ---------------- | -------------------------------------------------------------------------------------------------- |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency) |
# SessionKey
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey
Session Key
## Properties
| Property | Type | Description |
| ------------------ | -------- | -------------- |
| `key` | `any` | The key |
| `expiration` | `number` | The expiration |
# SessionProvider
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionProvider
Session provider entry with provider name and session data
## Properties
| Property | Type | Description |
| ----------------------- | ------------------------------------------ | --------------------------------------------------- |
| `provider` | `string` | Provider name (e.g., 'privy', 'turnkey', 'Passkey') |
| `session?` | `any` | Provider-specific session data |
| `sessionKey?` | \{ `key`: `any`; `expiration`: `number`; } | Session key (Passkey provider only) |
| `sessionKey.key` | `any` | - |
| `sessionKey.expiration` | `number` | - |
| `passkeyAccount?` | `string` | Passkey account address (Passkey provider only) |
| `pubkey?` | `string` | Public key in base58 (Passkey provider only) |
| `relyingPartyId?` | `string` | Relying party ID/domain (Passkey provider only) |
| `role?` | `string` | Passkey role |
| `permissions?` | `string`\[] | Passkey permissions |
# SplTransfer
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SplTransfer
SPL token transfer data for on-chain Solana transfers (supports SPL Token and Token-2022)
## Properties
| Property | Type |
| -------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `id` | `string` |
| `gridUserId` | `string` |
| `mainAccountAddress` | `string` |
| `mint` | `string` |
| `isToken2022` | `boolean` |
| `signature` | `string` |
| `confirmationStatus` | [`ConfirmationStatus`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/ConfirmationStatus) |
| `fromAddress` | `string` |
| `toAddress` | `string` |
| `amount` | `string` |
| `uiAmount` | `string` |
| `decimals` | `number` |
| `confirmedAt?` | `string` |
| `createdAt` | `string` |
| `updatedAt` | `string` |
| `direction?` | [`TransferDirection`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/TransferDirection) |
| `environment?` | [`GridEnvironment`](/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/GridEnvironment) |
| `instructionIndex?` | `number` |
# StandingOrder
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/StandingOrder
## Properties
| Property | Type |
| -------------------------- | ------------------------ |
| `id` | `string` |
| `amount` | `string` |
| `currency` | `string` |
| `period` | `StandingOrderFrequency` |
| `destinations` | `string`\[] |
| `status` | `StandingOrderStatus` |
| `remainingAmount` | `string` |
| `lastExecutionDate?` | `string` |
| `nextExecutionDate` | `string` |
| `createdAt` | `string` |
# SubmitPasskeySessionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SubmitPasskeySessionRequest
Submit Passkey Session Request
## Properties
| Property | Type |
| ----------------------------- | ------------------- |
| `ceremonyType` | `CeremonyType` |
| `sessionKey` | `SessionKeyBackend` |
| `slotNumber` | `number` |
| `authenticatorResponse` | `any` |
# SubmitPasskeySessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SubmitPasskeySessionResponse
Submit Passkey Session Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------------- | ---------------------------------------------------------------------------------------- | ----------- |
| `passkeyAccount` | `string` | - |
| `smartAccount` | \{ `address`: `string`; } | - |
| `smartAccount.address` | `string` | - |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SessionKey) | - |
# TransferResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TransferResponse
Get transfers response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## See
* [BridgeTransfer](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/BridgeTransfer) for fiat-to-crypto transfers
* [SplTransfer](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SplTransfer) for on-chain transfers
## Properties
| Property | Type | Description |
| ------------------- | --------- | ---------------------- |
| `nextCursor?` | `string` | Next page cursor |
| `hasMore?` | `boolean` | More results available |
# TurnkeyRefreshSession
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/TurnkeyRefreshSession
Turnkey session data for refresh
Note: Turnkey refresh not yet implemented in API
## Properties
| Property | Type | Description |
| ------------------------- | -------- | --------------------------- |
| `userId` | `string` | - |
| `api_key_id` | `string` | - |
| `credential_bundle` | `string` | Encrypted credential bundle |
# VirtualAccount
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/interfaces/VirtualAccount
## Properties
| Property | Type |
| --------------------------------- | --------------------------- |
| `id` | `string` |
| `customerId` | `string` |
| `sourceDepositInstructions` | `SourceDepositInstructions` |
| `destination` | `VirtualAccountDestination` |
| `status` | `string` |
| `developerFeePercent` | `string` |
# AuthenticationData
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/AuthenticationData
```ts theme={null}
type AuthenticationData = SessionProvider[];
```
Array of session providers from authentication endpoints
# BridgeCurrency
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/BridgeCurrency
```ts theme={null}
type BridgeCurrency = "usd" | "eur";
```
# ConfirmationStatus
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/ConfirmationStatus
```ts theme={null}
type ConfirmationStatus = "pending" | "confirmed";
```
# CreateAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/CreateAccountRequest
```ts theme={null}
type CreateAccountRequest =
| EmailAccountRequest
| SignersAccountRequest
| AccountPolicies;
```
Full account creation request (discriminated union)
Note: For simple creation, use [CreateAccountInput](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/CreateAccountInput). This type is for advanced use cases with full policy control.
## See
* [EmailAccountRequest](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/EmailAccountRequest) for email accounts
* [SignersAccountRequest](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/SignersAccountRequest) for signer accounts
* [AccountPolicies](/grid/v1/sdk-reference/typescript/reference/latest/interfaces/AccountPolicies) for direct policy configuration
# CreateAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/CreateAccountResponse
```ts theme={null}
type CreateAccountResponse = EmailAccountResponse | SignersAccountResponse;
```
Account creation response (union type)
## See
* EmailAccountResponse for email accounts
* SignersAccountResponse for signer accounts
# Currency
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/Currency
```ts theme={null}
type Currency = "sol" | "usdc" | "usdt" | "pyusd" | "eurc";
```
Currency type
# GridEnvironment
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/GridEnvironment
```ts theme={null}
type GridEnvironment = "sandbox" | "production";
```
Grid API environment: `sandbox` (Devnet) or `production` (Mainnet)
# KycEndorsement
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/KycEndorsement
```ts theme={null}
type KycEndorsement = "ach" | "sepa";
```
KYC endorsement
# KycType
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/KycType
```ts theme={null}
type KycType = "individual" | "business";
```
KYC verification type
# PasskeyPermission
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PasskeyPermission
```ts theme={null}
type PasskeyPermission = string;
```
Passkey permission
# PaymentRail
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PaymentRail
```ts theme={null}
type PaymentRail =
| "ach_push"
| "ach_pull"
| "sepa"
| "faster_payments"
| "wire"
| "solana"
| "smart_account";
```
Payment rail type
# Period
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/Period
```ts theme={null}
type Period = "OneTime" | "Daily" | "Weekly" | "Monthly";
```
Period types for spending limits and policies
# PolicyPermission
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PolicyPermission
```ts theme={null}
type PolicyPermission = "CAN_INITIATE" | "CAN_VOTE" | "CAN_EXECUTE";
```
Signer permission types for policy signers
# PolicyStatus
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/PolicyStatus
```ts theme={null}
type PolicyStatus = "active" | "expired" | "cancelled";
```
Policy status enum
# ProviderSessionData
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/ProviderSessionData
```ts theme={null}
type ProviderSessionData =
| {
Privy: PrivyRefreshSession;
}
| {
Turnkey: TurnkeyRefreshSession;
};
```
Provider session data (discriminated union by provider name)
# SignerPermission
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/SignerPermission
```ts theme={null}
type SignerPermission = "CAN_INITIATE" | "CAN_EXECUTE" | "CAN_VOTE";
```
Signer permissions in multi-signature account
* CAN\_INITIATE: Initiate transactions
* CAN\_EXECUTE: Execute approved transactions
* CAN\_VOTE: Vote on pending transactions
# SignerRole
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/SignerRole
```ts theme={null}
type SignerRole = "primary" | "backup";
```
Signer role in multi-signature account
# SpendingLimitPeriod
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/SpendingLimitPeriod
```ts theme={null}
type SpendingLimitPeriod = "one_time" | "daily" | "weekly" | "monthly";
```
Spending limit period
# TransferDirection
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/TransferDirection
```ts theme={null}
type TransferDirection = "inflow" | "outflow";
```
# TransferState
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/TransferState
```ts theme={null}
type TransferState =
| "awaiting_funds"
| "in_review"
| "funds_received"
| "payment_submitted"
| "payment_processed"
| "canceled"
| "error"
| "undeliverable"
| "returned"
| "refunded";
```
# VoteAction
Source: https://developers.squads.so/grid/v1/sdk-reference/typescript/reference/latest/type-aliases/VoteAction
```ts theme={null}
type VoteAction = "approve" | "reject" | "cancel";
```
Vote action types for proposals
# Grid Grants Program
Source: https://developers.squads.so/grid/v1/grants-program
$100K funding initiative for founders building on Grid's stablecoin API platform
The **Grid Grant Program** is a \$100,000 initiative to back the next
generation of standout founders building on Grid. Selected teams will receive
up to **\$10,000 USDC**.
At Squads, we value taste, integrity, long-term thinking, and a bias for
action. We're looking for teams who share these principles, and grant
recipients will be chosen with these values in mind.
## Program overview
Up to \$10,000 USDC in funding per selected team
Promotional support from our experienced team
Get early access to new Grid features and updates
## Products we're excited about
Leverage Grid's stablecoin rails for next-gen payment solutions
Novel spend controls and innovative user experiences
Yield optimization tools designed for enterprises
High-demand money movement across specific verticals
Expense management platforms for the onchain economy
Permissionless escrows that remove traditional middlemen
Apps that simplify or supercharge decentralized finance
AI-powered financial automation and decision-making tools
## Application status
The first submission period for the Grid Grant Program ended on October 31, 2025. If you applied during this period, please look out for an email response in the coming weeks with updates on your application status.
The Grid Grant Program will run until the full \$100,000 has been awarded. New submission periods will open up shortly if the full \$100,000 hasn't been allocated yet. Stay tuned for announcements about future application windows.
Grants are awarded at our discretion, and we may choose to not select any
applicants during a given period if no teams align with our values or meet our
standards.
## Terms and conditions
### Selection criteria
We especially encourage teams who have not raised over \$1M in prior funding to
apply. While well-funded teams can still apply, they will be held to a higher
standard.
* At Squads we value taste, high integrity, long-term thinking and a bias for action. Grant recipients will be selected amongst teams who share our values.
* Decisions regarding grant selection are final and at the sole discretion of Squads Labs.
* We especially encourage teams who have not raised over \$1M in prior funding to apply to the grants. While not being a disqualification, well-funded teams will be held to a higher standard.
### Eligibility and application
* Teams [must apply here](https://squads-grid.typeform.com/to/nTYwD4YP) within the specified submission deadline for each period.
* Products submitted must use Grid to be applicable.
* Recipients cannot be existing Squads Labs team members or have received prior Grid grants.
* Recipients that fail to demonstrate progress may be ineligible for future Squads Labs programs or support.
### Grant terms and obligations
* Each selected team receives **up to \$10,000 USDC**
* Disbursement may be structured in milestones based on complexity
* Grant funds must be used exclusively for development, deployment and growth of projects built on Grid.
* Recipients agree to provide quarterly updates on project progress and fund utilization.
* The Grid Grant Program will run until the full \$100,000 has been awarded, with multiple submission periods along the way.
### Additional support
* Marketing, capital raising and other support is provided at the discretion of Squads Labs.
* Squads Labs reserves the right to showcase grant recipients and their projects in marketing materials.
### Program structure
* Multiple submission periods will be opened throughout the program duration.
* Grant disbursement is entirely at the discretion of Squads Labs and no applicants may be selected during any given submission period.
### Legal and compliance
* All projects must comply with applicable laws and regulations in their operating jurisdictions.
* Teams must have full ownership over the IP of their project to be eligible.
* Teams retain full ownership of their intellectual property developed during the program.
* This grant does not constitute an investment and Squads Labs receives no equity or tokens in return.
* Grants are non-transferable and cannot be exchanged for other forms of compensation.
# AccountBalancesData
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountBalancesData
Account balances data with SOL and token balances
## Properties
| Property | Type |
| ---------------- | ----------------- |
| `address` | `string` |
| `lamports` | `bigint` |
| `sol` | `number` |
| `tokens` | `TokenBalance`\[] |
# AccountPolicies
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountPolicies
Multi-signature account policies
Important: Signers range: 1-10, threshold must not exceed signers.length (range: 1-10)
## Properties
| Property | Type | Description |
| --------------------- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `signers` | [`AccountSigner`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountSigner)\[] | Account signers (range: 1-10) |
| `threshold` | `number` | Required signatures (must not exceed signers.length) |
| `timeLock?` | `number` | Time lock in seconds (range: 1 to u32::MAX) |
| `adminAddress?` | `string` | Admin address for administrative functions |
# AccountState
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountState
Account state for reactive UI updates
## Properties
| Property | Type | Description |
| ----------------------- | --------- | ------------------------------------ |
| `accountAddress?` | `string` | Smart account address (if connected) |
| `gridUserId?` | `string` | Grid user ID (if connected) |
| `isConnected` | `boolean` | Whether account is connected |
# AccountTransaction
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountTransaction
Transaction in account history
## Properties
| Property | Type | Description |
| -------------------- | -------- | ---------------------------- |
| `id` | `string` | - |
| `signature` | `string` | Transaction signature hash |
| `status` | `string` | - |
| `createdAt` | `string` | ISO timestamp when created |
| `confirmedAt?` | `string` | ISO timestamp when confirmed |
# AuthorizePasskeySessionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AuthorizePasskeySessionRequest
Authorize Passkey Session Request
## Properties
| Property | Type |
| ------------------- | ------------------------------------------------------------------------------------------ |
| `sessionKey?` | [`SessionKey`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey) |
| `metaInfo` | `MetaInfo` |
| `baseUrl?` | `string` |
# AuthorizePasskeySessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AuthorizePasskeySessionResponse
Authorize Passkey Session Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | -------- | ----------- |
| `url` | `string` | - |
# BridgeTransfer
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransfer
Bridge transfer data for fiat-to-crypto or crypto-to-fiat transfers
Represents transfers processed through Bridge's payment rails, including
ACH, SEPA, wire transfers, and other traditional banking methods.
## Properties
| Property | Type |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | `string` |
| `state` | [`TransferState`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/TransferState) |
| `onBehalfOf` | `string` |
| `sourceDepositInstructions?` | [`BridgeTransferSourceDepositInstructions`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransferSourceDepositInstructions) |
| `amount` | `string` |
| `clientReferenceId?` | `string` |
| `currency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
| `developerFee` | `string` |
| `source` | [`BridgeTransferSource`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransferSource) |
| `destination` | [`BridgeTransferDestination`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransferDestination) |
| `receipt` | [`Receipt`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/Receipt) |
| `blockchainMemo?` | `string` |
| `createdAt` | `string` |
| `updatedAt` | `string` |
# BridgeTransferDestination
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransferDestination
## Properties
| Property | Type |
| -------------------------- | ---------------------------------------------------------------------------------------------------- |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PaymentRail) |
| `externalAccountId?` | `string` |
| `bridgeWalletId?` | `string` |
| `fromAddress?` | `string` |
| `wireMessage?` | `string` |
| `sepaReference?` | `string` |
| `swiftReference?` | `string` |
# BridgeTransferSource
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransferSource
## Properties
| Property | Type |
| ---------------------------- | ---------------------------------------------------------------------------------------------------- |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PaymentRail) |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
| `externalAccountId?` | `string` |
| `bridgeWalletId?` | `string` |
| `fromAddress?` | `string` |
| `omad?` | `string` |
| `imad?` | `string` |
| `bankBeneficiaryName?` | `string` |
# BridgeTransferSourceDepositInstructions
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransferSourceDepositInstructions
## Properties
| Property | Type |
| ------------------------------ | ---------------------------------------------------------------------------------------------------- |
| `amount?` | `string` |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
| `depositMessage?` | `string` |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PaymentRail) |
| `fromAddress?` | `string` |
| `toAddress?` | `string` |
| `bankName?` | `string` |
| `bankAddress?` | `string` |
| `bankCity?` | `string` |
| `bankCountry?` | `string` |
| `bankPostalCode?` | `string` |
| `iban?` | `string` |
| `swiftBic?` | `string` |
| `beneficiaryName?` | `string` |
| `beneficiaryAddress?` | `string` |
| `beneficiaryCity?` | `string` |
| `beneficiaryCountry?` | `string` |
| `beneficiaryPostalCode?` | `string` |
| `routingNumber?` | `string` |
| `accountNumber?` | `string` |
| `accountType?` | `string` |
# CompleteAuthAndCreateAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CompleteAuthAndCreateAccountResponse
Complete auth and create account response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------ | ----------- |
| `address` | `string` | - |
| `status` | `string` | - |
| `policies` | [`AccountPolicies`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountPolicies) | - |
| `gridUserId` | `string` | - |
| `authentication` | [`AuthenticationData`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/AuthenticationData) | - |
# CreateAccountInput
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateAccountInput
Simplified account creation input (provide email or signer)
## Example
```typescript theme={null}
const emailAccount: CreateAccountInput = { email: 'user@example.com' };
const signerAccount: CreateAccountInput = { signer: 'publicKeyString' };
```
## Properties
| Property | Type | Description |
| --------------- | -------- | ----------------------------------- |
| `email?` | `string` | Email for email-based account |
| `signer?` | `string` | Public key for signer-based account |
# CreatePasskeyAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreatePasskeyAccountRequest
Create Passkey Account Request
Creates both the passkey account (externally signed account) and smart account in one call
## Properties
| Property | Type | Description |
| ----------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey) | Session key for the passkey account |
| `slotNumber` | `number` | Slot number for the passkey ceremony |
| `authenticatorResponse` | `any` | WebAuthn authenticator response from passkey creation |
| `adminAddress?` | `string` | Optional admin address for settings authority |
| `memo?` | `string` | Optional memo for the account creation |
# CreatePasskeyAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreatePasskeyAccountResponse
Create Passkey Account Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------------ | ----------- |
| `address` | `string` | - |
| `type` | `string` | - |
| `status` | `string` | - |
| `policies` | [`PasskeyAccountPolicies`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyAccountPolicies) | - |
| `authentication` | [`AuthenticationData`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/AuthenticationData) | - |
| `createdAt` | `string` | - |
| `updatedAt` | `string` | - |
# CreatePaymentIntentRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreatePaymentIntentRequest
Create payment intent request
## Properties
| Property | Type | Description |
| ------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `amount` | `string` | Transfer amount as a string (e.g., "100.00") |
| `source` | [`PaymentDetails`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PaymentDetails) | Source account details |
| `destination` | [`PaymentDetails`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PaymentDetails) | Destination account details |
| `feeConfig?` | [`FeeConfig`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/FeeConfig) | Fee configuration. Required for non-Enterprise customers. Enterprise customers may omit this as fees are handled by their plan. |
# CreateProposalRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateProposalRequest
Create proposal request
## Properties
| Property | Type |
| ------------------- | -------- |
| `transaction` | `string` |
| `signer` | `string` |
| `rentPayer?` | `string` |
# CreateProposalResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateProposalResponse
Create proposal response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------- | ----------- | ----------- |
| `transactions` | `string`\[] | - |
| `signer` | `string` | - |
| `rentPayer?` | `string` | - |
# CreateSpendingLimitResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateSpendingLimitResponse
Create spending limit response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------------- | --------------- | ------------------------------------ |
| `spendingLimitAddress` | `string` | On-chain spending limit address |
| `transaction` | `string` | Serialized transaction for signing |
| `kmsPayloads` | `KmsPayload`\[] | KMS payloads for multi-party signing |
| `transactionSigners` | `string`\[] | - |
# CreateStandingOrderRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateStandingOrderRequest
Create Standing Order Request
## Properties
| Property | Type |
| ------------------- | ------------------------ |
| `amount` | `string` |
| `source` | `Details` |
| `destination` | `Details` |
| `frequency` | `StandingOrderFrequency` |
| `startDate` | `string` |
| `endDate?` | `string` |
# CreateStandingOrderResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateStandingOrderResponse
Create standing order response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `id` | `string` | Standing order identifier |
| `amount` | `string` | Amount as string |
| `uiAmount` | `string` | Human-readable amount |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) | Currency type |
| `paymentRail` | [`PaymentRail`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PaymentRail) | Payment rail used |
| `source` | `Details` | Source account details |
| `destination` | `Details` | Destination account details |
| `frequency` | `StandingOrderFrequency` | Recurrence frequency |
| `startDate` | `string` | Start date (ISO string) |
| `endDate?` | `string` | End date (ISO string, optional) |
| `status` | `StandingOrderStatus` | Current status |
| `transaction` | `string` | Serialized transaction |
| `kmsPayloads` | `KmsPayload`\[] | - |
| `transactionSigners` | `string`\[] | - |
| `validUntil` | `string` | - |
| `createdAt` | `string` | - |
| `transactionPayload` | [`TransactionPayload`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransactionPayload) | - |
# EmailAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/EmailAccountRequest
Email-based account creation request
## Properties
| Property | Type |
| ------------- | --------- |
| `type` | `"email"` |
| `email` | `string` |
# ExecuteProposalRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/ExecuteProposalRequest
Execute proposal request
## Properties
| Property | Type | Description |
| -------------- | -------- | -------------------------------------------------------------------- |
| `signer` | `string` | Signer address that will execute (must have CAN\_EXECUTE permission) |
# ExecuteProposalResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/ExecuteProposalResponse
Execute proposal response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------- | ----------- | ------------------------------------ |
| `transactions` | `string`\[] | Base64-encoded unsigned transactions |
| `signer` | `string` | - |
# FeeConfig
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/FeeConfig
Fee configuration. Required for non-Enterprise customers when creating payment intents or preparing transactions.
## Properties
| Property | Type | Description |
| ------------------------ | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `currency` | [`Currency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/Currency) | Currency used to pay fees |
| `payerAddress` | `string` | Public key address of the account paying fees |
| `selfManagedFees?` | `boolean` | When true, fees are deducted from the payer account rather than being handled by Grid |
# FindPasskeyAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/FindPasskeyAccountRequest
Find Passkey Account Request
## Properties
| Property | Type |
| ----------------------------- | ------------------------------------------------------------------------------------------ |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey) |
| `authenticatorResponse` | `any` |
# FindPasskeyAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/FindPasskeyAccountResponse
Find Passkey Account Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------ | ----------- |
| `passkeyAccount` | `string` | - |
| `address` | `string` | - |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey) | - |
# GetAccountBalancesQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetAccountBalancesQueryParams
Query parameters for paginated balance requests
## Properties
| Property | Type | Description |
| -------------- | -------- | ------------------------------ |
| `limit?` | `number` | Results per page (default: 10) |
| `page?` | `number` | Page number (default: 1) |
# GetAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetAccountResponse
Get account response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ------------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------- |
| `type` | `"email"` \| `"signers"` | |
| `address` | `string` | - |
| `policies?` | [`AccountPolicies`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountPolicies) | Policies (optional for email accounts) |
| `gridUserId` | `string` | - |
| `memo?` | `string` | - |
| `createdAt?` | `string` | - |
| `status?` | `string` | Status (for email accounts) |
# GetPasskeyAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetPasskeyAccountResponse
Get Passkey Account Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | ------------------------------------------------------------------------------------------ | ----------- |
| `relyingPartyId` | `string` | - |
| `pubkey` | `string` | - |
| `sessionKey?` | [`SessionKey`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey) | - |
# GetPasskeySessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetPasskeySessionResponse
Get Passkey Session Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------- | ----- | ----------- |
| `session?` | `any` | - |
# GetStandingOrdersQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetStandingOrdersQueryParams
Get Standing Orders Query Params
## Properties
| Property | Type |
| ------------------ | --------------------- |
| `status?` | `StandingOrderStatus` |
| `currency?` | `string` |
| `startDate?` | `string` |
| `endDate?` | `string` |
| `txHash?` | `string` |
| `limit?` | `number` |
| `cursor?` | `string` |
# GetTransactionsResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetTransactionsResponse
Get transactions response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| --------------- | ------------------------------------------------------------------------------------------------------------- | ----------- |
| `transactions?` | [`AccountTransaction`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountTransaction)\[] | - |
| `error?` | `string` | - |
# GetTransfersOptions
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetTransfersOptions
## Properties
| Property | Type |
| -------------------- | ---------------------------------------------------------------------------------------------------- |
| `paymentRail?` | [`PaymentRail`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PaymentRail) |
| `status?` | [`TransferState`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/TransferState) |
| `currency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
| `startDate?` | `string` |
| `endDate?` | `string` |
| `txHash?` | `string` |
| `limit?` | `number` |
| `cursor?` | `string` |
# GetVirtualAccountsQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GetVirtualAccountsQueryParams
Get virtual accounts query params
## Properties
| Property | Type |
| ---------------------------- | ---------------------------------------------------------------------------------------------------- |
| `sourceCurrency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
| `destinationCurrency?` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
# GridClientContext
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridClientContext
Grid client context
## Properties
| Property | Type |
| -------------- | ---------------------------------------------------------------------------------------------------------------- |
| `client` | `ClientContext` |
| `user` | [`GridClientUserContext`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridClientUserContext) |
# GridClientSigner
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridClientSigner
## Properties
| Property | Type |
| ------------------- | ------------------------- |
| `address?` | `string` |
| `email?` | `string` |
| `sessionKey?` | `any` |
| `type` | `"primary"` \| `"backup"` |
| `provider?` | `SignerProvider` |
# GridClientUserContext
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridClientUserContext
## Properties
| Property | Type |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| `address?` | `string` |
| `gridUserId?` | `string` |
| `signers?` | [`GridClientSigner`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/GridClientSigner)\[] |
| `session?` | `Session` |
| `email?` | `string` |
| `otpId?` | `string` |
| `provider?` | `string` |
# KycLink
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/KycLink
KYC verification link data
## Properties
| Property | Type | Description |
| -------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------- |
| `id` | `string` | - |
| `fullName` | `string` | - |
| `email` | `string` | - |
| `type` | [`KycType`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/KycType) | - |
| `kycLink` | `string` | URL for KYC identity verification |
| `tosLink` | `string` | URL for terms of service acceptance |
| `kycStatus` | `KycStatus` | - |
| `rejectionReasons` | `string`\[] | Rejection reasons if KYC was rejected |
| `tosStatus` | `TosStatus` | - |
| `createdAt` | `string` | ISO timestamp of creation |
| `customerId` | `string` | External customer ID in KYC provider system |
| `personaInquiryType` | `string` | Persona inquiry type |
# KycStatusData
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/KycStatusData
KYC verification status data
## Properties
| Property | Type | Description |
| ---------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------- |
| `id` | `string` | - |
| `account` | `string` | - |
| `type` | [`KycType`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/KycType) | - |
| `status` | `KycStatus` | - |
| `tosStatus` | `TosStatus` | - |
| `kycContinuationLink?` | `string` | Link to continue KYC if incomplete |
| `rejectionReasons` | `RejectionReason`\[] | Rejection reasons if rejected |
| `requirementsDue` | `string`\[] | Outstanding requirements to complete verification |
| `createdAt` | `string` | ISO timestamp of creation |
| `updatedAt` | `string` | ISO timestamp of last update |
# PasskeyAccountInfo
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyAccountInfo
Passkey Account Info returned from account creation
## Properties
| Property | Type | Description |
| ---------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------- |
| `passkeyAccount` | `string` | The passkey account address |
| `pubkey` | `string` | The public key in base58 format |
| `relyingPartyId` | `string` | The relying party ID (domain) |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey) | Session key associated with the passkey account |
# PasskeyAccountPolicies
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyAccountPolicies
Passkey Account Policies for newly created accounts
## Properties
| Property | Type | Description |
| --------------------- | -------- | ----------------------------------- |
| `threshold` | `number` | Signature threshold for the account |
| `adminAddress?` | `string` | Optional admin address |
# PasskeyAssertionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyAssertionResponse
Passkey Assertion Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
\| Property | Type |
|
\| `response` | \{ `signature`: `string`; `clientDataJSON`: `string`; `authenticatorData`: `string`; `publicKey?`: `string`; } |
|
\| `response.clientDataJSON` | `string` |
|
\| `response.publicKey?` | `string` |
# PasskeyCredentialData
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyCredentialData
Passkey Credential Data
## Properties
| Property | Type |
| -------------------- | ------------- |
| `id` | `ArrayBuffer` |
| `publicKey` | `string` |
| `credentialId` | `string` |
# PasskeyRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyRequest
Passkey Request
## Properties
| Property | Type |
| --------------------------- | -------- |
| `env` | `Env` |
| `appName?` | `string` |
| `userId?` | `string` |
| `redirectUrl?` | `string` |
| `challenge` | `string` |
| `slotNumber` | `string` |
| `sessionKey` | `string` |
| `expirationInSeconds` | `string` |
# PaymentDetails
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PaymentDetails
Payment details for transfers
## Properties
| Property | Type | Description |
| -------------------------- | -------- | ------------------------------------------------------ |
| `account?` | `string` | Account (for source) |
| `address?` | `string` | Address (for crypto destination) |
| `currency` | `string` | - |
| `paymentRail?` | `string` | Payment rail (for fiat destination, e.g., "ach\_push") |
| `externalAccountId?` | `string` | External account ID (for fiat destination) |
# PolicyExpirationArgs
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PolicyExpirationArgs
Policy expiration arguments
## Properties
| Property | Type | Description |
| ------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `numPeriods` | `number` | Number of periods until expiration (e.g., 2 for "2 weeks" if period is Weekly) |
| `period` | [`Period`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/Period) | Period type for expiration calculation |
# PolicySigner
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PolicySigner
Policy signer configuration
## Properties
| Property | Type | Description |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| `address` | `string` | Public key address of the signer |
| `permissions` | [`PolicyPermission`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PolicyPermission)\[] | Permissions granted to this signer |
# PrepareArbitraryTransactionQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PrepareArbitraryTransactionQueryParams
Query parameters for preparing arbitrary transactions
## Properties
| Property | Type | Description |
| -------------- | --------- | ---------------------------------- |
| `debug?` | `boolean` | Enable debug mode (default: false) |
# PrepareArbitraryTransactionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PrepareArbitraryTransactionRequest
Prepare arbitrary transaction request
## Properties
| Property | Type | Description |
| ------------------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------- |
| `transaction` | `string` | - |
| ~~`transactionSigners?`~~ | `string`\[] | **Deprecated** Use accountSigners instead |
| `accountSigners?` | `string`\[] | - |
| ~~`payerAddress?`~~ | `string` | **Deprecated** Use feeConfig instead |
| `feeConfig?` | [`FeeConfig`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/FeeConfig) | - |
# PrivyRefreshSession
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PrivyRefreshSession
Privy-specific session data for refresh operations
## Properties
| Property | Type | Description |
| -------------------------- | --------- | ----------------------------------------------------------------- |
| `user_id` | `string` | Privy user identifier |
| `session` | `Session` | Session data containing authorization keys and wallet information |
| `token` | `string` | JWT token for Privy authentication |
| `privy_access_token` | `string` | Privy platform access token |
| `refresh_token` | `string` | Refresh token for obtaining new access tokens |
# Receipt
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/Receipt
## Properties
| Property | Type |
| ----------------- | -------- |
| `id` | `string` |
| `object` | `string` |
| `createdAt` | `string` |
# RefreshSessionKmsProvider
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RefreshSessionKmsProvider
KMS provider configuration for session refresh
## Properties
| Property | Type | Description |
| ---------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| `provider` | `string` | MPC provider type |
| `session` | [`ProviderSessionData`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/ProviderSessionData) | Provider-specific session data |
# RefreshSessionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RefreshSessionRequest
Refresh session request (supports cookie-based and body-based flows)
* Cookie-based (recommended): Omit kmsPayload, uses HTTP-only cookies
* Body-based (legacy): Include kmsPayload with tokens
## Properties
| Property | Type | Description |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
| `kmsPayload?` | [`RefreshSessionKmsProvider`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RefreshSessionKmsProvider) | KMS provider config (optional with HTTP-only cookies) |
| `encryptionPublicKey` | `string` | HPKE public key for response encryption |
# RefreshSessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RefreshSessionResponse
Refresh session response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------- |
| `kmsPayload` | [`RefreshSessionKmsProvider`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RefreshSessionKmsProvider) | Updated KMS provider and session data |
# RemovePasskeyQueryParams
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RemovePasskeyQueryParams
Remove Passkey Query Params
## Properties
| Property | Type |
| -------------- | --------- |
| `admin?` | `boolean` |
# RemovePasskeyRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RemovePasskeyRequest
Remove Passkey Request
## Properties
| Property | Type |
| --------------------------- | ----------- |
| `transactionSigners?` | `string`\[] |
# RemovePasskeyResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RemovePasskeyResponse
Remove Passkey Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------- | -------------------------------------------------------------------------------------------- | ----------- |
| `transaction` | `string` | - |
| `removedPasskey` | [`PasskeyInfo`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/PasskeyInfo) | - |
| `threshold` | `number` | - |
| `status` | `string` | - |
| `expiresAt` | `string` | - |
# RequestKycLinkRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RequestKycLinkRequest
Request KYC link
## Properties
| Property | Type |
| --------------------- | ------------------------------------------------------------------------------------------------------- |
| `type` | [`KycType`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/KycType) |
| `email` | `string` |
| `fullName` | `string` |
| `endorsements?` | [`KycEndorsement`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/KycEndorsement)\[] |
| `redirectUri?` | `string` |
# RequestVirtualAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/RequestVirtualAccountRequest
Request virtual account
## Properties
| Property | Type |
| ---------------- | ---------------------------------------------------------------------------------------------------- |
| `currency` | [`BridgeCurrency`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency) |
# SessionKey
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey
Session Key
## Properties
| Property | Type | Description |
| ------------------ | -------- | -------------- |
| `key` | `any` | The key |
| `expiration` | `number` | The expiration |
# SessionProvider
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionProvider
Session provider entry with provider name and session data
## Properties
| Property | Type | Description |
| ----------------------- | ------------------------------------------ | --------------------------------------------------- |
| `provider` | `string` | Provider name (e.g., 'privy', 'turnkey', 'Passkey') |
| `session?` | `any` | Provider-specific session data |
| `sessionKey?` | \{ `key`: `any`; `expiration`: `number`; } | Session key (Passkey provider only) |
| `sessionKey.key` | `any` | - |
| `sessionKey.expiration` | `number` | - |
| `passkeyAccount?` | `string` | Passkey account address (Passkey provider only) |
| `pubkey?` | `string` | Public key in base58 (Passkey provider only) |
| `relyingPartyId?` | `string` | Relying party ID/domain (Passkey provider only) |
| `role?` | `string` | Passkey role |
| `permissions?` | `string`\[] | Passkey permissions |
# SignersAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SignersAccountRequest
Signer-based account creation request with full policy control
## Properties
| Property | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| `type` | `"signers"` | - |
| `policies` | [`AccountPolicies`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountPolicies) | Account policies (signers, threshold, restrictions) |
| `memo?` | `string` | - |
# SpendingLimit
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimit
Spending limit data with configuration, usage, and metadata
## Properties
| Property | Type | Description |
| ----------------------------- | ----------- | ------------------------------------------------------- |
| `address` | `string` | On-chain spending limit address |
| `settingsAddress` | `string` | Settings account address |
| `mainAccountAddress` | `string` | Main smart account address |
| `environment` | `string` | Environment (sandbox or production) |
| `mint` | `string` | Token mint address |
| `amount` | `number` | Maximum amount per period |
| `period` | `number` | Period type (0=one\_time, 1=daily, 2=weekly, 3=monthly) |
| `remainingAmount` | `number` | Remaining amount in current period |
| `status` | `string` | - |
| `lastReset` | `number` | Unix timestamp of last reset |
| `signers` | `string`\[] | Authorized signer addresses |
| `destinations` | `string`\[] | Allowed destination addresses |
| `expiration` | `number` | Unix timestamp of expiration (0 for no expiration) |
| `slot` | `number` | Solana slot of last modification |
| `blockTime` | `string` | Block timestamp of last modification |
| `lastModifiedSignature` | `string` | Last modification transaction signature |
# SpendingLimitResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimitResponse
Get spending limit response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# SpendingLimitTransactionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimitTransactionResponse
Spending limit transaction response (for update/delete operations)
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------------- | --------------- | ------------------------------------ |
| `transaction` | `string` | Serialized transaction for signing |
| `transactionSigners` | `string`\[] | - |
| `kmsPayloads` | `KmsPayload`\[] | KMS payloads for multi-party signing |
# SpendingLimitsResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SpendingLimitsResponse
Get spending limits response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------- | ---- | ----------- |
# SplTransfer
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SplTransfer
SPL token transfer data for on-chain Solana transfers (supports SPL Token and Token-2022)
## Properties
| Property | Type |
| -------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `id` | `string` |
| `gridUserId` | `string` |
| `mainAccountAddress` | `string` |
| `mint` | `string` |
| `isToken2022` | `boolean` |
| `signature` | `string` |
| `confirmationStatus` | [`ConfirmationStatus`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/ConfirmationStatus) |
| `fromAddress` | `string` |
| `toAddress` | `string` |
| `amount` | `string` |
| `uiAmount` | `string` |
| `decimals` | `number` |
| `confirmedAt?` | `string` |
| `createdAt` | `string` |
| `updatedAt` | `string` |
| `direction?` | [`TransferDirection`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/TransferDirection) |
| `environment?` | [`GridEnvironment`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/GridEnvironment) |
| `instructionIndex?` | `number` |
# StandingOrder
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/StandingOrder
## Properties
| Property | Type |
| -------------------------- | ------------------------ |
| `id` | `string` |
| `amount` | `string` |
| `currency` | `string` |
| `period` | `StandingOrderFrequency` |
| `destinations` | `string`\[] |
| `status` | `StandingOrderStatus` |
| `remainingAmount` | `string` |
| `lastExecutionDate?` | `string` |
| `nextExecutionDate` | `string` |
| `createdAt` | `string` |
# SubmitPasskeySessionRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SubmitPasskeySessionRequest
Submit Passkey Session Request
## Properties
| Property | Type |
| ----------------------------- | ------------------- |
| `ceremonyType` | `CeremonyType` |
| `sessionKey` | `SessionKeyBackend` |
| `slotNumber` | `number` |
| `authenticatorResponse` | `any` |
# SubmitPasskeySessionResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SubmitPasskeySessionResponse
Submit Passkey Session Response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| ---------------------- | ------------------------------------------------------------------------------------------ | ----------- |
| `passkeyAccount` | `string` | - |
| `smartAccount` | \{ `address`: `string`; } | - |
| `smartAccount.address` | `string` | - |
| `sessionKey` | [`SessionKey`](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SessionKey) | - |
# TransferResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TransferResponse
Get transfers response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## See
* [BridgeTransfer](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/BridgeTransfer) for fiat-to-crypto transfers
* [SplTransfer](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SplTransfer) for on-chain transfers
## Properties
| Property | Type | Description |
| ------------------- | --------- | ---------------------- |
| `nextCursor?` | `string` | Next page cursor |
| `hasMore?` | `boolean` | More results available |
# TurnkeyRefreshSession
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/TurnkeyRefreshSession
Turnkey session data for refresh
Note: Turnkey refresh not yet implemented in API
## Properties
| Property | Type | Description |
| ------------------------- | -------- | --------------------------- |
| `userId` | `string` | - |
| `api_key_id` | `string` | - |
| `credential_bundle` | `string` | Encrypted credential bundle |
# UpdateSpendingLimitRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/UpdateSpendingLimitRequest
Update spending limit request
## Properties
| Property | Type | Description |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------- |
| `amount?` | `string` \| `number` | Amount (min: 1) |
| `mint?` | `string` | - |
| `period?` | [`SpendingLimitPeriod`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/SpendingLimitPeriod) | - |
| `spendingLimitSigners?` | `string`\[] | - |
| `destinations?` | `string`\[] | - |
| `expiration?` | `number` | - |
| `transactionSigners?` | `string`\[] | - |
# UseSpendingLimitRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/UseSpendingLimitRequest
Use spending limit request (consume from existing limit)
## Properties
| Property | Type | Description |
| ------------------------ | -------------------- | -------------------------------------- |
| `amount` | `string` \| `number` | Amount to use from limit (min: 1) |
| `signerAddress` | `string` | Signer address authorized to use limit |
| `recipientAddress` | `string` | Recipient address for transfer |
# VirtualAccount
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VirtualAccount
## Properties
| Property | Type |
| --------------------------------- | --------------------------- |
| `id` | `string` |
| `customerId` | `string` |
| `sourceDepositInstructions` | `SourceDepositInstructions` |
| `destination` | `VirtualAccountDestination` |
| `status` | `string` |
| `developerFeePercent` | `string` |
# VoteProposalRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VoteProposalRequest
Vote on proposal request
## Properties
| Property | Type | Description |
| --------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `signers` | `string`\[] | Array of signer addresses that will vote (must have CAN\_VOTE permission) |
| `action` | [`VoteAction`](/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/VoteAction) | Vote action to perform |
# VoteProposalResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/interfaces/VoteProposalResponse
Vote on proposal response
This response follows the standard [BaseResponse](/grid/v1/sdk-reference/typescript/reference/v2.0.0/interfaces/BaseResponse) wrapper with `data` (response payload) and `lastResponse` (request metadata).
## Properties
| Property | Type | Description |
| -------------------- | ----------- | ----------------------------------------- |
| `transaction` | `string` | Base64-encoded unsigned transaction |
| `transactionSigners` | `string`\[] | Signers that need to sign the transaction |
# AuthenticationData
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/AuthenticationData
```ts theme={null}
type AuthenticationData = SessionProvider[];
```
Array of session providers from authentication endpoints
# BridgeCurrency
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/BridgeCurrency
```ts theme={null}
type BridgeCurrency = "usd" | "eur";
```
# ConfirmationStatus
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/ConfirmationStatus
```ts theme={null}
type ConfirmationStatus = "pending" | "confirmed";
```
# CreateAccountRequest
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/CreateAccountRequest
```ts theme={null}
type CreateAccountRequest =
| EmailAccountRequest
| SignersAccountRequest
| AccountPolicies;
```
Full account creation request (discriminated union)
Note: For simple creation, use [CreateAccountInput](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/CreateAccountInput). This type is for advanced use cases with full policy control.
## See
* [EmailAccountRequest](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/EmailAccountRequest) for email accounts
* [SignersAccountRequest](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/SignersAccountRequest) for signer accounts
* [AccountPolicies](/grid/v1/sdk-reference/react-native/reference/latest/interfaces/AccountPolicies) for direct policy configuration
# CreateAccountResponse
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/CreateAccountResponse
```ts theme={null}
type CreateAccountResponse = EmailAccountResponse | SignersAccountResponse;
```
Account creation response (union type)
## See
* EmailAccountResponse for email accounts
* SignersAccountResponse for signer accounts
# Currency
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/Currency
```ts theme={null}
type Currency = "sol" | "usdc" | "usdt" | "pyusd" | "eurc";
```
Currency type
# GridEnvironment
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/GridEnvironment
```ts theme={null}
type GridEnvironment = "sandbox" | "production";
```
Grid API environment: `sandbox` (Devnet) or `production` (Mainnet)
# KycEndorsement
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/KycEndorsement
```ts theme={null}
type KycEndorsement = "ach" | "sepa";
```
KYC endorsement
# KycType
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/KycType
```ts theme={null}
type KycType = "individual" | "business";
```
KYC verification type
# PasskeyPermission
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PasskeyPermission
```ts theme={null}
type PasskeyPermission = string;
```
Passkey permission
# PaymentRail
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PaymentRail
```ts theme={null}
type PaymentRail =
| "ach_push"
| "ach_pull"
| "sepa"
| "faster_payments"
| "wire"
| "solana"
| "smart_account";
```
Payment rail type
# Period
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/Period
```ts theme={null}
type Period = "OneTime" | "Daily" | "Weekly" | "Monthly";
```
Period types for spending limits and policies
# PolicyPermission
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PolicyPermission
```ts theme={null}
type PolicyPermission = "CAN_INITIATE" | "CAN_VOTE" | "CAN_EXECUTE";
```
Signer permission types for policy signers
# PolicyStatus
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/PolicyStatus
```ts theme={null}
type PolicyStatus = "active" | "expired" | "cancelled";
```
Policy status enum
# ProviderSessionData
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/ProviderSessionData
```ts theme={null}
type ProviderSessionData =
| {
Privy: PrivyRefreshSession;
}
| {
Turnkey: TurnkeyRefreshSession;
};
```
Provider session data (discriminated union by provider name)
# SignerPermission
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/SignerPermission
```ts theme={null}
type SignerPermission = "CAN_INITIATE" | "CAN_EXECUTE" | "CAN_VOTE";
```
Signer permissions in multi-signature account
* CAN\_INITIATE: Initiate transactions
* CAN\_EXECUTE: Execute approved transactions
* CAN\_VOTE: Vote on pending transactions
# SignerRole
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/SignerRole
```ts theme={null}
type SignerRole = "primary" | "backup";
```
Signer role in multi-signature account
# SpendingLimitPeriod
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/SpendingLimitPeriod
```ts theme={null}
type SpendingLimitPeriod = "one_time" | "daily" | "weekly" | "monthly";
```
Spending limit period
# TransferDirection
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/TransferDirection
```ts theme={null}
type TransferDirection = "inflow" | "outflow";
```
# TransferState
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/TransferState
```ts theme={null}
type TransferState =
| "awaiting_funds"
| "in_review"
| "funds_received"
| "payment_submitted"
| "payment_processed"
| "canceled"
| "error"
| "undeliverable"
| "returned"
| "refunded";
```
# VoteAction
Source: https://developers.squads.so/grid/v1/sdk-reference/react-native/reference/latest/type-aliases/VoteAction
```ts theme={null}
type VoteAction = "approve" | "reject" | "cancel";
```
Vote action types for proposals