Skip to content
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"ecosystem/appkit/init",
"ecosystem/appkit/toncoin",
"ecosystem/appkit/jettons",
"ecosystem/appkit/nfts"
"ecosystem/appkit/nfts",
"ecosystem/appkit/staking"
]
},
{
Expand Down
34 changes: 19 additions & 15 deletions ecosystem/appkit/init.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ For local development and testing, use the [manifest file from this demo dApp](h
AppKit,
AppKitProvider,
// Enables TON wallet connections
TonConnectConnector,
createTonConnectConnector,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example switches from TonConnectConnector to createTonConnectConnector, but the current published AppKit types still export TonConnectConnector and do not mention a createTonConnectConnector helper. If the matching AppKit release is not already published, these snippets will become non-runnable for readers using the latest npm package. Please gate this on the release or keep the docs on the currently shipped API surface.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} from '@ton/appkit-react';
import '@ton/appkit-react/styles.css';

const kit = new AppKit({
connectors: [
new TonConnectConnector({
createTonConnectConnector({
tonConnectOptions: {
// Public link to the application manifest JSON file.
// For local development and testing, use the one from a demo dApp:
Expand All @@ -159,12 +159,12 @@ For local development and testing, use the [manifest file from this demo dApp](h
import {
AppKit,
// Enables TON wallet connections
TonConnectConnector,
createTonConnectConnector,
} from '@ton/appkit';

const kit = new AppKit({
connectors: [
new TonConnectConnector({
createTonConnectConnector({
tonConnectOptions: {
// Public link to the application manifest JSON file.
// For local development and testing, use the one from a demo dApp:
Expand Down Expand Up @@ -257,14 +257,15 @@ The following initialization example sets up everything at once:
AppKitProvider,
Network,
// Wallet connector
TonConnectConnector,
createTonConnectConnector,
} from '@ton/appkit-react';

// Styles
import '@ton/appkit-react/styles.css';

// DeFi provider
// DeFi providers
import { OmnistonSwapProvider } from '@ston-fi/omniston-sdk';
import { createTonstakersProvider } from '@ton/appkit/staking/tonstakers';

// TanStack Query
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
Expand Down Expand Up @@ -298,7 +299,7 @@ The following initialization example sets up everything at once:
// 2. Configure connectors.
connectors: [
// Enables connections with TON wallet services, such as Tonkeeper or MyTonWallet.
new TonConnectConnector({
createTonConnectConnector({
tonConnectOptions: {
// Public link to the application manifest JSON file.
// For local development and testing, use the one from a demo dApp:
Expand All @@ -307,7 +308,10 @@ The following initialization example sets up everything at once:
}),
],
// 3. Configure DeFi providers.
providers: [new OmnistonSwapProvider()],
providers: [
new OmnistonSwapProvider(),
createTonstakersProvider(),
],
});

// 4. Wrap the rest of the app in a QueryClientProvider and an AppKitProvider.
Expand All @@ -328,7 +332,7 @@ The following initialization example sets up everything at once:
AppKit,
Network,
// Wallet connector
TonConnectConnector,
createTonConnectConnector,
} from '@ton/appkit';

// DeFi provider
Expand All @@ -353,7 +357,7 @@ The following initialization example sets up everything at once:
// 2. Configure connectors.
connectors: [
// Enables connections with TON wallet services, such as Tonkeeper or MyTonWallet.
new TonConnectConnector({
createTonConnectConnector({
tonConnectOptions: {
// Public link to the application manifest JSON file.
// For local development and testing, use the one from a demo dApp:
Expand Down Expand Up @@ -522,13 +526,13 @@ Before migrating, [install AppKit and peer packages](#installation) and add nece
// Replaces <TonConnectUIProvider>
AppKitProvider,
// Wallet connector
TonConnectConnector,
createTonConnectConnector,
} from '@ton/appkit-react';
import '@ton/appkit-react/styles.css';

const kit = new AppKit({
connectors: [
new TonConnectConnector({
createTonConnectConnector({
// In place of props on the TonConnectUIProvider
tonConnectOptions: {
// Public link to the application manifest JSON file.
Expand Down Expand Up @@ -580,12 +584,12 @@ Before migrating, [install AppKit and peer packages](#installation) and add nece
```ts
import {
AppKit,
TonConnectConnector,
createTonConnectConnector,
} from '@ton/appkit';

const kit = new AppKit({
connectors: [
new TonConnectConnector({
createTonConnectConnector({
// Pass the existing TonConnectUI instance object
tonConnectUI
}),
Expand All @@ -597,7 +601,7 @@ Before migrating, [install AppKit and peer packages](#installation) and add nece

```ts
// Passing the existing TonConnectUI instance object
kit.addConnector(new TonConnectConnector({ tonConnectUI }));
kit.addConnector(createTonConnectConnector({ tonConnectUI }));
```

Refer to the [complete initialization setup](#complete-setup) for all the possible AppKit configuration options.
Expand Down
7 changes: 7 additions & 0 deletions ecosystem/appkit/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ TON Connect's **AppKit** is an open-source SDK that integrates web2 and web3 app
horizontal="true"
href="/ecosystem/appkit/nfts"
/>

<Card
title="Stake tokens"
icon="chart-line"
horizontal="true"
href="/ecosystem/appkit/staking"
/>
</Columns>

## See also
Expand Down
Loading
Loading