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

adds route and helper to submit transaction to the horizon rpc #13

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

aristidesstaffieri
Copy link
Contributor

The platform team would like Freighter to start moving towards a world where it doesn't use the RPCs directly in an effort to move away from promoting the SDF hosted RPCs and to encourage community involvement.

This adds a way to submit transactions to the RPC through a route, submitting transactions to the Horizon RPC should work for Soroban(invoke host fn) ops as well.

@aristidesstaffieri aristidesstaffieri self-assigned this Dec 14, 2023
data,
error: null,
};
} catch (e: any) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you're just picking up this code from the Freighter codebase, but maybe we can type this error now. I think it should be BadResponseError from stellar-sdk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah so I actually tried this but it turns out in TS, you can only annotate the error from the catch block as an any or unknown. https://byby.dev/ts-try-catch-error-type#:~:text=The%20only%20type%20annotations%20that,on%20it%20without%20type%20checking.

So I did annotate it in the response shape from this function but not sure if I can actually annotate the error as it come in from the catch block.

@aristidesstaffieri aristidesstaffieri merged commit a880c3e into main Dec 18, 2023
3 checks passed
@aristidesstaffieri aristidesstaffieri deleted the feat/ledger-writes branch December 18, 2023 22:18
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.

2 participants