stellar / soroban-example-dapp

End-to-End Example Soroban Dapp
Apache License 2.0
1.03k stars 835 forks source link

use @soroban-react@v4.0.0 #96

Closed esteblock closed 1 year ago

esteblock commented 1 year ago

The new version of the library allow to have multi-chain dapps (some contracts in standalone, and some contracts in futurenet) It can also allow more than one connector.

Now ProviderExample.tsk is just

import React from 'react'
import {SorobanReactProvider} from '@soroban-react/core';
import {futurenet, sandbox, standalone} from '@soroban-react/chains';
import {freighter} from '@soroban-react/freighter';
import {ChainMetadata, Connector} from "@soroban-react/types";

const chains: ChainMetadata[] = [sandbox, standalone, futurenet];
const connectors: Connector[] = [freighter()]

  export default function ProviderExample({children}:{children: React.ReactNode}) {
    return (
      <SorobanReactProvider
        chains={chains}
        appName={"Example Stellar App"}
        connectors={connectors}>
          {children}
      </SorobanReactProvider>
    )
  }
esteblock commented 1 year ago

@soroban-react v4.0.0 is before the recent PR https://github.com/esteblock/soroban-react/pull/22 that uses soroban-client 0.5.0 that PR lead to versions 4.1.0

In order to use soroban-client 0.5.0, please upgrade @soroban-react to v4.1.0.

I prefer to first merge this and then work on