feat(account-abstraction): implement AccountContract SDK package#36
Merged
wheval merged 2 commits intoancore-org:mainfrom Feb 26, 2026
Merged
feat(account-abstraction): implement AccountContract SDK package#36wheval merged 2 commits intoancore-org:mainfrom
wheval merged 2 commits intoancore-org:mainfrom
Conversation
Contributor
Author
|
@wheval pls merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
@ancore/account-abstractionSDK package with anAccountContractclass that wraps Soroban contract invocations for the Ancore account contract (contracts/account).Changes
src/account-contract.ts): TypeScript API for contract methodsinitialize(owner)— invoke contract initializeexecute(to, function, args)— invoke contract executeaddSessionKey(publicKey, permissions, expiresAt)— invoke add_session_keyrevokeSessionKey(publicKey)— invoke revoke_session_keygetSessionKey(publicKey)/getSessionKeyInvocation(publicKey)— get_session_keygetOwner()/getOwnerInvocation()— get_ownergetNonce()/getNonceInvocation()— get_noncecall(method, ...args)andbuildInvokeOperation(invocation)for building Stellar operationssrc/xdr-utils.ts): Encode/decode for addresses, BytesN<32>, u64, permissions, symbols, and SessionKey structssrc/errors.ts): Typed errors (AlreadyInitializedError,NotInitializedError,UnauthorizedError, etc.) andmapContractError()for contract/host errorssrc/__tests__/account-contract.test.ts): 24 tests with mocked server for AccountContract, XDR helpers, and error mappingtsconfig.jsonfor account-abstraction;tsconfig.json+ build script update for@ancore/types(DTS resolution);jest.config.cjsand test deps; rootpackage.jsonesbuild override; ui-kitvitest runso pre-push hook completesDependencies
@stellar/stellar-sdk,@ancore/types,@ancore/stellar,@ancore/cryptoTesting
pnpm testinpackages/account-abstraction— all 24 tests passpnpm run build --filter=@ancore/types --filter=@ancore/account-abstractionCloses #31 (if your issue number is different, replace it).