Skip to content

feat(account-abstraction): implement AccountContract SDK package#36

Merged
wheval merged 2 commits intoancore-org:mainfrom
Agbasimere:main
Feb 26, 2026
Merged

feat(account-abstraction): implement AccountContract SDK package#36
wheval merged 2 commits intoancore-org:mainfrom
Agbasimere:main

Conversation

@Agbasimere
Copy link
Contributor

Summary

Implements the @ancore/account-abstraction SDK package with an AccountContract class that wraps Soroban contract invocations for the Ancore account contract (contracts/account).

Changes

  • AccountContract (src/account-contract.ts): TypeScript API for contract methods
    • initialize(owner) — invoke contract initialize
    • execute(to, function, args) — invoke contract execute
    • addSessionKey(publicKey, permissions, expiresAt) — invoke add_session_key
    • revokeSessionKey(publicKey) — invoke revoke_session_key
    • getSessionKey(publicKey) / getSessionKeyInvocation(publicKey) — get_session_key
    • getOwner() / getOwnerInvocation() — get_owner
    • getNonce() / getNonceInvocation() — get_nonce
    • call(method, ...args) and buildInvokeOperation(invocation) for building Stellar operations
  • XDR helpers (src/xdr-utils.ts): Encode/decode for addresses, BytesN<32>, u64, permissions, symbols, and SessionKey structs
  • Errors (src/errors.ts): Typed errors (AlreadyInitializedError, NotInitializedError, UnauthorizedError, etc.) and mapContractError() for contract/host errors
  • Unit tests (src/__tests__/account-contract.test.ts): 24 tests with mocked server for AccountContract, XDR helpers, and error mapping
  • Build/config: tsconfig.json for account-abstraction; tsconfig.json + build script update for @ancore/types (DTS resolution); jest.config.cjs and test deps; root package.json esbuild override; ui-kit vitest run so pre-push hook completes

Dependencies

  • @stellar/stellar-sdk, @ancore/types, @ancore/stellar, @ancore/crypto

Testing

  • pnpm test in packages/account-abstraction — all 24 tests pass
  • Build: pnpm run build --filter=@ancore/types --filter=@ancore/account-abstraction

Closes #31 (if your issue number is different, replace it).

@Agbasimere
Copy link
Contributor Author

@wheval pls merge.

@wheval wheval merged commit e1a5f21 into ancore-org:main Feb 26, 2026
1 of 4 checks passed
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.

[FEATURE]: Implement Account Abstraction SDK Package

2 participants