But in the window object, in starknet_argentX or in starknet-braavos, provider are not the same and are not with ProviderInterface type.
In starknet_braavos, the provider is a SequencerProvider (imported from starknet.js).
In starknet_argentX, the provider is a specific l type.
On user side, if you use this command : const starknet = await connect({ modalMode: "alwaysAsk", modalTheme: "dark" }); , starknet.provider is not a ProviderInterface, it's the type of the window.starknet_* object :
Fortunately, starknet.js succeeds to process such data, using the Provider class (including a private provider:SequencerProvider).
But you have access only to the methods of a Provider class. You have not access to specific methods of SequencerProvider and RpcProvider classes of starknet.js (like getClassAt, estimateMessageFee or getEvents). And the only data available for the user to try to create a new SequencerProvider or RpcProvider is starknet.sequencer.chainId. If your wallet is connected to starknet-devnet, the chainId is not sufficient to create correctly the new provider.
I think that get-starknet should :
return a provider conform to the ProviderInterface type.
return also in a different object the following data (to allow the user to create an other provider including the methods he needs) :
Hello, I found a problem about provider. User is expecting a provider of type ProviderInterface (imported from starknet.js) :
StarknetWindowObject.ts :
But in the window object, in
starknet_argentX
or instarknet-braavos
, provider are not the same and are not withProviderInterface
type. Instarknet_braavos
, the provider is aSequencerProvider
(imported from starknet.js). Instarknet_argentX
, the provider is a specificl
type.On user side, if you use this command :
const starknet = await connect({ modalMode: "alwaysAsk", modalTheme: "dark" });
, starknet.provider is not aProviderInterface
, it's the type of thewindow.starknet_*
object : Fortunately, starknet.js succeeds to process such data, using the Provider class (including a private provider:SequencerProvider). But you have access only to the methods of a Provider class. You have not access to specific methods ofSequencerProvider
andRpcProvider
classes of starknet.js (like getClassAt, estimateMessageFee or getEvents). And the only data available for the user to try to create a new SequencerProvider or RpcProvider is starknet.sequencer.chainId. If your wallet is connected to starknet-devnet, the chainId is not sufficient to create correctly the new provider.I think that get-starknet should :