generateTonConnectProof
Generates a TonConnect proof for authentication with backend services. This creates a cryptographic proof that the user owns the wallet.Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
payload | string | The proof payload, typically a nonce or challenge from your backend |
walletAccount | TonWalletAccount | The wallet account to generate the proof for |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
Promise<TonConnectProof> - A promise that resolves to the proof object:
| Field | Type | Description |
|---|---|---|
address | string | Wallet address |
domain | TonConnectDomain | Domain information (see below) |
payload | string | The payload string that was signed |
signature | string | Signature as a base64 string |
timestamp | number | Unix timestamp in seconds |
TonConnectDomain
| Field | Type | Description |
|---|---|---|
lengthBytes | number | Length of domain value in bytes |
value | string | Domain value (e.g., “example.com”) |
Errors
| Error | Description |
|---|---|
NotTonProviderError | Thrown if the wallet account’s provider is not a TON provider |
MethodNotImplementedError | Thrown if the wallet provider does not support proof generation |
Related functions
- isTonWalletAccount - Check if a wallet account is a TON account
- sendTon - Send native TON