paltalabs / soroban-react

@soroban-react is a simple, powerful framework for building modern Soroban dApps using React.
https://soroban-react.paltalabs.io/
Apache License 2.0
26 stars 13 forks source link

use User RPC and default RPC #92

Closed abstract829 closed 2 months ago

abstract829 commented 2 months ago

this pr fixes #88 and #90

now the app uses the rpc from the wallet and not the hardcoded one

example with two testnets rpc:

https://streamable.com/kokart

and now you can set the default rpc with:

  <SorobanReactProvider
    chains={chains}
    appName={'Soroswap'}
    connectors={connectors}
    activeChain={{
      ...activeChain,
      sorobanRpcUrl:
        'https://testnet.stellar.validationcloud.io/v1/Mewk7YPYiUy3wAlDNlQsIhwxbdumICRYrz2tXS2vOck',
    }}
  >
    {children}
  </SorobanReactProvider>

or if you are not sending an default activeChain:

   <SorobanReactProvider
      chains={chains}
      appName={'Soroswap'}
      connectors={connectors}
      server={fromURLToServer('https://testnet.stellar.validationcloud.io/v1/Mewk7YPYiUy3wAlDNlQsIhwxbdumICRYrz2tXS2vOck')}
    >
      {children}
    </SorobanReactProvider>
vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
soroban-react ❌ Failed (Inspect) May 7, 2024 1:10pm