Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass more ui options to TonConnect #214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/ui/src/models/ton-connect-ui-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ export interface TonConnectUiOptions {
*/
walletsListConfiguration?: WalletsListConfiguration;

/**
* Url to the wallets list JSON file.
*/
walletsListSource?: string;

/**
* Wallets list cache time to live.
*/
walletsListCacheTTLMs?: number;

/**
* Configuration for action-period (e.g. sendTransaction) UI elements: modals and notifications and wallet behaviour (return strategy).
*/
Expand Down
6 changes: 5 additions & 1 deletion packages/ui/src/ton-connect-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ export class TonConnectUI {
} else if (options && 'manifestUrl' in options && options.manifestUrl) {
this.connector = new TonConnect({
manifestUrl: options.manifestUrl,
eventDispatcher: options?.eventDispatcher
eventDispatcher: options?.eventDispatcher,
...(options.walletsListSource &&
{ walletsListSource: options.walletsListSource }),
...(options.walletsListCacheTTLMs && options.walletsListCacheTTLMs > 0 &&
{walletsListCacheTTLMs: options.walletsListCacheTTLMs}),
});
} else {
throw new TonConnectUIError(
Expand Down