Skip to content

Conversation

@btspoony
Copy link
Contributor

No description provided.

- Introduced the @burnt-labs/abstraxion-backend package, including essential files such as package.json, tsconfig.json, and ESLint configuration.
- Set up Jest for testing with a basic configuration.
- Updated pnpm-lock.yaml to reflect new dependencies and versions.
- Added README and CHANGELOG for documentation and version tracking.
… and encryption

- Implemented core functionality for session key management, including storing, retrieving, and revoking session keys.
- Added encryption services using AES-256-GCM for secure session key storage.
- Created a modular architecture with database adapter interfaces for extensibility.
- Introduced comprehensive test coverage for encryption and session key management functionalities.
- Updated README and documentation to reflect new features and usage examples.
- Added validation for configuration parameters in the AbstraxionBackend constructor to ensure required fields are provided.
- Implemented input validation for userId and other parameters in various methods to improve error handling.
- Introduced new error types: UserIdRequiredError and UnknownError for better clarity in error reporting.
- Updated error handling to throw specific errors instead of generic ones, enhancing debugging and user feedback.
- Removed the encryptionService property and its instantiation from the AbstraxionBackend class as it is no longer needed.
- This change simplifies the class structure and improves maintainability.
- Changed Jest test environment from jsdom to node for better compatibility with backend testing.
- Simplified session key generation by directly creating a wallet with a default HD path, removing the previous mnemonic generation method and related code.
- Updated the session key object to reference the wallet's mnemonic directly.
- Reformatted code across multiple files for consistent style, including spacing and line breaks.
- Updated comments to enhance clarity and maintainability.
- Ensured consistent use of double quotes for strings throughout the codebase.
- Improved the structure of import statements for better organization.
- Enhanced readability of function parameters and object properties by aligning them properly.
@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2025

🦋 Changeset detected

Latest commit: 76d4181

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@burnt-labs/abstraxion-core Minor
@burnt-labs/tailwind-config Patch
backend-session Patch
demo-app Patch
@burnt-labs/abstraxion-react-native Patch
@burnt-labs/abstraxion Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

… handling improvements

- Integrated node-cache for improved state management with automatic cleanup.
- Added comprehensive error handling with custom error classes for better clarity in error reporting.
- Updated session key management to utilize the new error handling structure.
- Enhanced configuration validation to ensure required fields are provided.
- Introduced new error types for session key operations to improve debugging and user feedback.
- Introduced EncryptionService for AES-256-GCM encryption and decryption of session keys.
- Added SessionKeyManager to manage session key lifecycle, including storage, retrieval, and revocation.
- Updated AbstraxionBackend to utilize the new SessionKeyManager and adjusted import paths accordingly.
- Enhanced test coverage for EncryptionService and SessionKeyManager functionalities.
- Changed import statements for crypto and util modules to use the node: prefix for better clarity and consistency across the codebase.
- Added patch version for @burnt-labs/tailwind-config.
- Updated main and types fields in tailwind-config package.json to point to tailwind.config.ts.
- Removed obsolete .env.example file from abstraxion-backend package.
- Added indexes for username and email in User model for improved query performance.
- Changed sessionKeyExpiry type from Int to DateTime in SessionKey model for better date handling.
- Updated AuditLog model to use DateTime for timestamp and added index for userId and timestamp.
- Modified seed script to use Date objects for timestamps and added sessionKeyAddress in upsert conditions.
- Introduced new methods in database adapter for revoking session keys and managing session key states.
- Enhanced SessionKeyManager to handle session key creation, updates, and revocations more effectively.
- Added comprehensive tests for wallet API and session key management functionalities.
- Introduced new methods for retrieving the last session key and active session keys in the database adapter.
- Updated the session key management logic to utilize the new retrieval methods.
- Refactored session key update and revocation methods to improve clarity and maintainability.
- Adjusted session key info structure to allow optional createdAt and updatedAt fields.
- Improved validation logic for session key info to reflect the updated structure.
- Introduced a comprehensive API middleware system for consistent error handling, rate limiting, and request validation across all API routes.
- Added utility functions for standardized API responses, including success and error formats.
- Created specific wrappers for health check and wallet operations to streamline API handler creation.
- Enhanced type safety and maintainability with TypeScript support and structured context management.
- Updated existing API routes to utilize the new middleware and wrapper functions for improved clarity and functionality.
…thods

- Changed time handling in tests to use Date objects for better clarity and consistency.
- Updated session key revocation method to accept session key address as a parameter.
- Enhanced TestDatabaseAdapter with new methods for retrieving last and active session keys.
- Refactored session key storage and update methods to support multiple session keys per user.
- Improved audit log retrieval to handle Date objects correctly.
- Modified the test description to clarify that it initiates wallet connection for an existing user.
- Added user creation step within the test to ensure the user exists before testing the wallet connection.
- Removed the verification step for user creation as it is now handled within the test setup.
- Updated wallet test to utilize the public sessionKeyManager for better access and clarity.
- Refactored session key management logic to streamline the retrieval of the sessionKeyManager instance.
- Enhanced code readability by removing unnecessary import statements and simplifying the test setup.
- Changed sessionPermissions from an array to an object in multiple test cases for consistency and accuracy in session key management.
- Removed unnecessary imports from SessionKeyManager tests for improved clarity.
- Changed sessionPermissions from an array to an object in TestDatabaseAdapter for consistency in session key management.
- Modified callbackSchema to include 'granted' and 'granter' fields for improved authorization handling.
- Updated AbstraxionBackend to enforce required redirectUrl and treasury parameters.
- Enhanced session key management by storing permissions and granter address during callback processing.
- Refactored error handling to include new errors for missing redirectUrl and granter address.
- Adjusted README to reflect changes in functionality and integration with frontend SDK.
- Added XION_REDIRECT_URL and XION_TREASURY to env.example for improved configuration.
- Updated callbackSchema to include 'state' for better validation.
- Enhanced AbstraxionBackend to validate presence of redirectUrl and treasury during initialization.
- Refactored error handling to utilize centralized error types for consistency.
- Improved session key management by incorporating new parameters in callback processing.
@btspoony btspoony marked this pull request as ready for review September 29, 2025 14:10
… authentication flow

- Introduced InMemoryDummyRedirectStrategy for handling redirects in the absence of a request.
- Updated AbstraxionBackend to utilize InMemoryDummyRedirectStrategy when no request is provided.
- Enhanced authentication flow with additional checks for keypair and grants.
- Added comprehensive tests for AbstraxionBackend to ensure proper functionality and error handling.
- Removed the dashboardUrl configuration from AbstraxionBackend implementation and related tests.
- Updated tests to reflect the new dashboardUrl value for consistency with the latest configuration.
@btspoony btspoony changed the title New library for backend adaption Demo of backend adaption Oct 14, 2025
@btspoony
Copy link
Contributor Author

@justinbarry the backend library has been moved to the demo code

@justinbarry
Copy link
Contributor

@codex

@chatgpt-codex-connector
Copy link

Summary

Testing

  • ⚠️ pnpm --filter backend-session test -- --runTestsByPath src/__tests__/lib/abstraxion-backend/EncryptionService.test.ts (fails: jest binary not available in environment)

View task →

@justinbarry
Copy link
Contributor

image

Can we make this more in line other Xion applications?

user.id,
context.request as any,
);
const signer = await abstraxionAuth.getSigner(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the Cosmwasm client here. Hopefully simpler for you.

const client = await abstraxionAuth.getCosmWasmClient()
client.sendTokens(....)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emmm,
image
ESLint failed, looks like no this method

// Convert amount to micro units
const amountNum = parseFloat(amount);
const microAmount = Math.floor(amountNum * 1_000_000).toString();
const denomMicro = denom === "XION" ? "uxion" : "uusdc";
Copy link
Contributor

@justinbarry justinbarry Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really make the usdc IBC denoms a constant someplace.

@btspoony
Copy link
Contributor Author

image Can we make this more in line other Xion applications?

Okay

…Default method to directly return the gas price from xionGasValues
- Changed background colors to black and adjusted text colors to white across various components including HomePage, SignInPage, SignUpPage, ProfilePage, TransferComponent, and WalletComponent.
- Updated loading indicators and error messages to match the new color scheme.
- Enhanced button styles for better visibility and interaction feedback.
@btspoony btspoony requested a review from justinbarry October 28, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants