Git Product home page Git Product logo

Comments (6)

KedziaPawel avatar KedziaPawel commented on August 20, 2024 1

shouldn't this issue be linked inside viem repo, as it was originally? The bug seems to be related to viem/actions which are part of viem repo. In the getClient.test-d.ts I need to write code like below to recreate the issue

import { chain, config } from '@wagmi/test'
import { expectTypeOf, test } from 'vitest'

import { http } from 'viem'
import { waitForTransactionReceipt } from 'viem/actions'
import { createConfig } from '../createConfig.js'
import { arbitrumNova, optimism } from '../exports/chains.js'
import { getClient } from './getClient.js'

test('behavior: viem actions', () => {
  const config = createConfig({
    chains: [arbitrumNova, optimism],
    transports: {
      [arbitrumNova.id]: http(),
      [optimism.id]: http(),
    },
  })
  const client = getClient(config)
  waitForTransactionReceipt(client, { hash: '0x…' })
})

from wagmi.

LufyCZ avatar LufyCZ commented on August 20, 2024

using client.waitForTransactionReceipt works fine (might be the intended usage?)

from wagmi.

tmm avatar tmm commented on August 20, 2024

If anyone wants to look into this, this is the test that you need to pass:

getClient.test-d.ts

test('behavior: viem actions', () => {
  const config = createConfig({
    chains: [arbitrumNova, optimism],
    transports: {
      [arbitrumNova.id]: http(),
      [optimism.id]: http(),
    },
  })
  const client = getClient(config)
  waitForTransactionReceipt(client, { hash: '0x…' })
})

from wagmi.

tmm avatar tmm commented on August 20, 2024

shouldn't this issue be linked inside viem repo, as it was originally?

It could, but it's less likely that Viem will have a client with a chain union for client.chain. In this case, getClient returns a client with client.chain: typeof arbitrumNova | typeof optimism. Seems like the move is to solve this downstream of Viem in getClient.test-d.ts first (since Wagmi should have type coverage for this scenario), then update Viem if necessary.

from wagmi.

ibrosen avatar ibrosen commented on August 20, 2024

@tmm it looks like in #3929 you're gonna take this on as part of a larger refactor

is there a rough timeline on when it might land? we need to bump wagmi to pull in a coinbase wallet fix on Zora, if there's a rough timeline it'll help me decide whether to wait or to refactor some @wagmi/core usage in favour of consuming the actions from a client instead

from wagmi.

ibrosen avatar ibrosen commented on August 20, 2024

@tmm it looks like in #3929 you're gonna take this on as part of a larger refactor

is there a rough timeline on when it might land? we need to bump wagmi to pull in a coinbase wallet fix on Zora, if there's a rough timeline it'll help me decide whether to wait or to refactor some @wagmi/core usage in favour of consuming the actions from a client instead

refactored out our @wagmi/core usage in favour of consuming actions via public/wallet clients instead, i'd been meaning to do that anyways

from wagmi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.