TypinkProvider
TypinkProvider
is the global provider for Typink DApps, it managed shared state internally so hooks and child components can access (accounts, signer, wallet connection, Dedot clients, contract deployments ...)
First thing to do is to wrap your application component with TypinkProvider
.
If you're using an external wallet connector like SubConnect or Talisman Connect, you will need to pass into the TypinkProvider
2 more props: connectedAccount
(InjectedAccouunt) & signer
(Signer) so Typink knows which account & signer to interact with the ink! contracts.
Props
deployments
ContractDeployment[]
An array of contract deployments
defaultCaller
string
The default Substrate address used as the default caller for making queries when no wallet is connected.
defaultNetworkId
string
The default network to be used. Choose from supported networks, such as popTestnet
, astar
, etc.
cacheMetadata
boolean
Toggle whether or not to cache network metadata.
supportedNetworks
NetworkInfo[]
signer
Signer
The signer for handling transactions. If using an external wallet connector (e.g., SubConnect, Talisman Connect), pass your signer here.
connectedAccount
InjectedAccount
The currently connected account. If using an external wallet connector, pass the active account here.
wallets
Wallet [ ]
Provided supported wallets
appName
string
The name of your dApp, used to identify your dApp when connecting to wallets
Last updated
Was this helpful?