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

Type error: SorobanContextType incompatible type. #21

Open
MattPoblete opened this issue Jul 29, 2024 · 3 comments
Open

Type error: SorobanContextType incompatible type. #21

MattPoblete opened this issue Jul 29, 2024 · 3 comments

Comments

@MattPoblete
Copy link
Contributor

The props:

  connectors: Connector[]
  setActiveConnectorAndConnect?: (connector: Connector) => void
  server?: SorobanRpc.Server
  serverHorizon?: StellarSdk.Horizon.Server

of SorobanContextType in utils/contractInvoke/types.ts:60 are incompatibles with the SorobanContextType provided by @soroban-react/core

@chopan123
Copy link
Collaborator

@abstract829

@abstract829
Copy link
Contributor

Should change in the connect type

export type Connector = {
    id: string
    name: string
    shortName?: string
    iconUrl: string | (() => Promise<string>)
    iconBackground: string
    installed?: boolean
    downloadUrls?: {
      android?: string
      ios?: string
      browserExtension?: string
      qrCode?: string
    }
    isConnected: () => boolean // should return Promise<boolean>
    getNetworkDetails: () => Promise<NetworkDetails>
    getPublicKey: () => Promise<string>
    signTransaction: (
      xdr: string,
      opts?: {
        network?: string
        networkPassphrase?: string
        accountToSign?: string
      }
    ) => Promise<string>
}

but the correct way to avoid this type errors happen again in the future should be to move the SorobanContextType from @soroban-react/contracts to @soroban-react/types so we could use the package here instead of clone the types

@PedroCo3lho
Copy link

This issue is open for contribution? I can submit a pr today exporting types directly from @soroban-react/types for better consistence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

4 participants