ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
326 stars 92 forks source link

[UI]: Add storage managment #241

Open w1tsky opened 3 months ago

w1tsky commented 3 months ago

Is your feature request related to a problem?

Currently, there is no consistent way to save sessions other than using local storage, which cannot be easily managed. The IStorage interface is only available when using the SDK, not the UI package.

Describe the solution you'd like

Ideally, there should be an IStorage interface implemented in the @tonconnect/ui package, providing an alternative way to save sessions, rather than relying solely on browser local storage.

Describe alternatives you've considered

As an alternative, it's possible to manually read and save these local storage keys on the backend when the wallet is connected:

ton-connect-storage_bridge-connection
ton-connect-ui_last-selected-wallet-info
ton-connect-storage_http-bridge-gateway::https://bridge.ton.space/bridge
ton-connect-ui_wallet-info
ton-connect-ui_preferred-wallet

Afterward, we can manually set these keys with the values retrieved from the backend, overriding the values set by the UI package, which is not reliable.

Additional context

No response

Samotaa commented 3 months ago

it would be nice

slavnycoder commented 1 day ago

Yes, it is needed.