-
Notifications
You must be signed in to change notification settings - Fork 844
Add Stellar support #711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marcelosalloum
wants to merge
14
commits into
coinbase:main
Choose a base branch
from
marcelosalloum:stellar-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Stellar support #711
Conversation
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
🟡 Heimdall Review Status
|
|
@marcelosalloum is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
5a9a588 to
2afc1ca
Compare
…or rpc construction, as well as its unit tests
REASON: the Stellar SDK seems to contain code that is incompatible with the Edge Runtime, likely due to specific imports or usage of `eval`/`new Function` in its dependencies.
…ellar tokenCatalog
[WIP] Add Stellar support to x402-express, x402-hono, and x402-next
2afc1ca to
ddc1969
Compare
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.
Description
Note
This PR partially addresses the issue #633
Added basic Stellar blockchain support to the x402 exact scheme, specifically to the typescript packages, enabling users to make payments using Stellar network alongside existing EVM and SVM chains.
The implementation leverages Stellar's SEP-41 token standard for transfers via
invokeHostFunctionoperations (not classic Stellar payment operations), where the client signs the auth entry for the transaction, and the facilitator rebuilds the transaction with their account as source, signs, and submits.Payment Requirements Format
For Stellar exact scheme payments, the PaymentRequirements format is:
Note: The
extra.maxLedgerfield is required for Stellar (unlike EVM/Solana whereextrais optional). This specifies the maximum ledger number by which the transaction must be included on-chain.📦 Modified typescript packages
x402-axiosx402-fetchx402-expressx402-honox402-nextExamples Updated
The following TypeScript examples now support Stellar:
examples/typescript/facilitatorexamples/typescript/servers/expressexamples/typescript/clients/axiosexamples/typescript/clients/fetchTests
Unit tests
Added comprehensive unit test coverage for the included Stellar components, as well as the modified pieces of code. Run
pnpm testfrom the/typescriptdirectoryManual tests
Following the running example from README.md, I've executed e2e manual tests to ensure the
facilitator,serversandclientsare working as expected.Checklist
Known Limitations & Future Work
The following enhancements are planned for future PRs:
FeeBumpTransactionfor higher throughput and more reliable settlemente2efolderDesign Changes
Asset Configuration Refactoring
Introduced a new method
getUsdcConfigForNetwork(network: Network)to retrieve USDC configuration for any supported network. This diverges from the previous EVM-centric approach that relied onchainIdfor asset lookup.Rationale: Stellar (like Solana) is not an EVM chain and does not have a
chainId. The new network-based approach provides a unified interface across all blockchain types (EVM, Solana, and Stellar), simplifying multi-chain asset configuration.Benefits: