Skip to main content
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

1

Update Package Version

Update your package.json and install v3.0.0:
2

Update Error Handling Pattern

Replace all success checks with try/catch blocks. Methods now throw GridError on failure.Before (v2.x):
After (v3.0.0):
The GridError class provides structured error information including code, statusCode, details, and lastResponse for debugging.
3

Update Field Names to camelCase

All response and request fields now use camelCase instead of snake_case.Before (v2.x):
After (v3.0.0):
Complete field name mapping:GridError field change:
4

Update Response Access Pattern

Responses now use BaseResponse<T> which wraps data in a .data property along with request metadata in .lastResponse.Before (v2.x):
After (v3.0.0):
The .data property contains your actual response payload. The .lastResponse property contains request metadata (requestId, statusCode, headers) useful for debugging and support.
5

Update Transaction Signing Flow

Update authentication data access to use camelCase.Before (v2.x):
After (v3.0.0):
6

Update Type References

Several response types have been updated. The main change is removing the old GridResponse<T> wrapper.Type updates:
Update your function signatures:
7

Verify All Changes

Run TypeScript compilation and your test suite:
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<T> 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