useDApp icon indicating copy to clipboard operation
useDApp copied to clipboard

Ability to request a signer for a useCall function

Open soya-miruku opened this issue 3 years ago • 4 comments

I know this may sound a bit weird, but given we can't specify the signer when initializing a new contract as a param to the useCall func (unless i am miss understanding something), having an optional param would be useful for my use case whereby the signer is required

const result = useCall({
  contract,
  method: 'getUserInfo',
  args: [user]
}, {refresh: 'everyBlock', useSigner: true})

soya-miruku avatar Jul 24 '22 12:07 soya-miruku

@VinHylme Why do you need it? Do you use msg.sender in your view functions?

rzadp avatar Jul 25 '22 07:07 rzadp

@rzadp working with a company and that's what the solidity dev did and as a result im having to find ways to get around it :/

soya-miruku avatar Jul 25 '22 10:07 soya-miruku

@VinHylme Sure, just wanted to clarify the use case.

I'm afraid that might not be possible, because all our calls go through a Multicall contract - so effectively the Multicall contract address is the sender. But we will brainstorm if it's possible to work around this and make your use case possible.

rzadp avatar Jul 25 '22 10:07 rzadp

@rzadp thank you sir

soya-miruku avatar Jul 25 '22 16:07 soya-miruku