Demo wallet, deployed
Demo wallet, GitHub
Initialization
The basic kit initialization consists of creating a corresponding object by passing it a minimal set of necessary arguments: TON networks to operate on. Yet, it is often useful to configure optional parameters right away — the following example also specifies core wallet information, TON Connect manifest, and bridge settings.Configuration parameters
Required
Record<CHAIN, NetworkConfig>
required
For one or more TON networks, configure their respective API or RPC providers to interact with.It is also possible to provide an entirely custom provider with its own
ApiClient interface implementation.Optional
DeviceInfo
Core information and constraints of the given wallet. If not provided, defaults will be used.There, The
Feature type is defined as:maxMessages number depends on the TON wallet used, because every wallet has its own limit on the volume of messages.For example,- Ledger wallet would only handle 1 message per transaction
- Wallet
v4r2handles up to 4 messages - Wallet
v5r1handles up to 255 messages
WalletInfo
How your wallet interacts with the TON Connect. If not provided, defaults will be used. This field is closely related to the corresponding JSON manifest file.
BridgeConfig
Connectivity options: either an HTTP or JavaScript bridge setup. The former’s
bridgeUrl points to the publicly exposed bridge URL, while the latter’s jsBridgeKey points to the property name within the window object on the same web page.Bridges are used for dApp communication — if the dApp exists in the same web environment as the wallet, then the JavaScript bridge is enough. Otherwise, use an HTTP bridge setup.StorageConfig | StorageAdapter
How to store intermediate events.
EventProcessorConfig
How TON Connect events are processed. This is useful for background scripts in browser extensions that process incoming events and log them, but do so outside a queue.
AnalyticsConfig
Collect and gather analytical data.
object
Extra configuration used when developing WalletKit itself. Irrelevant in other cases.