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

Network Settings - Soroban RPC URL #953

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

aristidesstaffieri
Copy link
Contributor

@aristidesstaffieri aristidesstaffieri commented Sep 6, 2023

Ticket: https://stellarorg.atlassian.net/jira/software/c/projects/WAL/boards/61?modal=detail&selectedIssue=WAL-1077&assignee=63bc81730a1b5442166a2f79
Also fixes: https://stellarorg.atlassian.net/browse/WAL-1083

Renames URL field in network settings to Horizon RPC URL
Adds Soroban RPC URL field to network settings
Updates network settings in storage to support optional sorobanRpcUrl
Uses new sorobanRpcUrl field to replace hardcoded soroban rpc url throughout
Migrates Network details to add sorobanRpcUrl
Adds handling for optional sorobanRpcUrl

@aristidesstaffieri aristidesstaffieri self-assigned this Sep 6, 2023
@aristidesstaffieri aristidesstaffieri changed the title [WIP] renames url field in network settings, adds soroban rpc url field Network Settings - Soroban RPC URL Sep 7, 2023
@aristidesstaffieri aristidesstaffieri marked this pull request as ready for review September 7, 2023 16:20
@@ -105,3 +106,23 @@ export const migrateFriendBotUrlNetworkDetails = async () => {

await localStore.setItem(NETWORKS_LIST_ID, migratedNetworkList);
};

export const migrateSorobanRpcUrlNetworkDetails = async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll have to do this again once we support Soroban in testnet/pubnet

@aristidesstaffieri aristidesstaffieri changed the base branch from master to release/5.6.0 September 7, 2023 17:52
return true
}
return false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

very NIT: but this would be a little tidier as const supportsSorobanRpc = (network: string) => network === NETWORK_NAMES.FUTURENET

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 for sure 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in 704bac5


if (!sorobanClient.server || !sorobanClient.newTxBuilder) {
throw new Error("soroban rpc not supported")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is it better to throw this error in SorobanContext so we don't have to do this check every time we try to use sorobanClient?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well we can't throw it there because there is no way to instantiate a SorobanClient on pubnet/testnet yet so we had to move to an optional server/tx builder in order to allow custom ones as well as support some default networks but not all of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was sort of overlooked before because we incorrectly passed in a horizon instance when we were on pubnet/testnet.

@aristidesstaffieri aristidesstaffieri merged commit b950978 into release/5.6.0 Sep 13, 2023
2 checks passed
@aristidesstaffieri aristidesstaffieri deleted the feature/custom-network-sorobanrpc branch September 13, 2023 19:04
piyalbasu added a commit that referenced this pull request Sep 13, 2023
* Updated onboarding last steps (#955)

* Functional, needs styling

* Use proper apostrophe

* Network Settings - Soroban RPC URL (#953)

* renames url field in network settings, adds soroban rpc url field

* adds handling for optional soroban rpc support

* also config custom soroban rpcs

* refactor helper to be more concise

* Added translations

---------

Co-authored-by: Iveta <[email protected]>
Co-authored-by: aristides <[email protected]>
aristidesstaffieri added a commit that referenced this pull request Sep 14, 2023
* renames url field in network settings, adds soroban rpc url field

* adds handling for optional soroban rpc support

* also config custom soroban rpcs

* Updated onboarding last steps (#955)

* Functional, needs styling

* Use proper apostrophe

* refactor helper to be more concise

* refactors storage getter/setter to account for networks for token id lists

* Network Settings - Soroban RPC URL (#953)

* renames url field in network settings, adds soroban rpc url field

* adds handling for optional soroban rpc support

* also config custom soroban rpcs

* refactor helper to be more concise

* adds migration to network keyed toke id list

* Bump versions to 5.4.0 (#960)

* docs(): bumping release to 5.4.0

* Empty-Commit

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Piyal Basu <[email protected]>

* refactors to a network keyed object of token IDs for token id list

* fixes migration to be backwards compatible

* adds storage version and uses storage version in token id list migration

* fix typo in storage key

* hardcode storage schema version, decouple from package version

* updates comment for version migration

---------

Co-authored-by: Iveta <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Piyal Basu <[email protected]>
piyalbasu added a commit that referenced this pull request Sep 16, 2023
* adds the bump footprint expiration op type to tx history

* WIP, refactors history item to build async rows

* clean up and organize soroban related helpers

* Added translations

* remove unwanted files from translations commit

* removes helper shim and fixes import pattern

* use sdk base fee, add restore footprint header title, use more direct i128 helper

* fixes soroban tx submission error handling, bumps soroban-client

* fix use of source account in SorobanContext newTxBuilder

* split transfer and mint history items

* Added translations

* WIP, adds base states for testing soroban token payment

* adds mock soroban context, tests token payment flow

* adds tests for soroban helpers

* adds token amount dom test

* adds new path for signing auth entries, adds SignAuthEntry component and related API hooks

* Adds basic signing component for auth entry sign flow

* Adds new external api signAuthEntry, adds docs, adds sign auth entry component

* Added translations

* adds buildInvocationTree to render formatted json for invocations and sub invocations

* use correct key in responseQueue handler for signAuthEntry, clean up AuthEntry

* splits SignTx and SignBlob, makes new route for sign-blob

* use buildInvocationTree in transaction render for signTx

* Added translations

* Added translations

* remove accidental tarball commit

* adds missing loading states, fixes missing error handling in message handler

* remove extra line

* refactors signing flows to use a common helper hook

* dont allow HW signing on sign blob or sign auth entry, not currently supported in ledger API

* Added translations

* Added translations

* updates HW wallet not supported text

* Added translations

* refactors SorobanContext to accoutn for missing rpc urls

* moves dispatch to be in shared signing hook

* add translations

* Release/5.6.0 (#954)

* Updated onboarding last steps (#955)

* Functional, needs styling

* Use proper apostrophe

* Network Settings - Soroban RPC URL (#953)

* renames url field in network settings, adds soroban rpc url field

* adds handling for optional soroban rpc support

* also config custom soroban rpcs

* refactor helper to be more concise

* Added translations

---------

Co-authored-by: Iveta <[email protected]>
Co-authored-by: aristides <[email protected]>

* Refactor/multi network custom token (#958)

* renames url field in network settings, adds soroban rpc url field

* adds handling for optional soroban rpc support

* also config custom soroban rpcs

* Updated onboarding last steps (#955)

* Functional, needs styling

* Use proper apostrophe

* refactor helper to be more concise

* refactors storage getter/setter to account for networks for token id lists

* Network Settings - Soroban RPC URL (#953)

* renames url field in network settings, adds soroban rpc url field

* adds handling for optional soroban rpc support

* also config custom soroban rpcs

* refactor helper to be more concise

* adds migration to network keyed toke id list

* Bump versions to 5.4.0 (#960)

* docs(): bumping release to 5.4.0

* Empty-Commit

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Piyal Basu <[email protected]>

* refactors to a network keyed object of token IDs for token id list

* fixes migration to be backwards compatible

* adds storage version and uses storage version in token id list migration

* fix typo in storage key

* hardcode storage schema version, decouple from package version

* updates comment for version migration

---------

Co-authored-by: Iveta <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Piyal Basu <[email protected]>

* add prettier changes

* Added translations

* WIP: upgrade soroban-client (#961)

* upgrade soroban-client

* updates to new simulation response (#962)

* updates to new simulation response

* formatting tweaks

* fix broken tests

---------

Co-authored-by: Piyal Basu <[email protected]>

---------

Co-authored-by: aristides <[email protected]>

* move schema update

* fix migration key

* rm log

* fix account history

---------

Co-authored-by: Aristides Staffieri <[email protected]>
Co-authored-by: Iveta <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
@esteblock
Copy link

Hello. What is the difference between normal horizon and this soroban rpc? ( I don't have access to those links)
Also, I think that the freighter-api should be upgraded to get the new sorobanRpc
@joaquinsoza

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