telegram-webapp-sdk 0.1.1

Telegram WebApp SDK for Rust
Documentation
# Telegram WebApp API Coverage

This checklist tracks support for the [Telegram Web Apps JavaScript API](https://core.telegram.org/bots/webapps). Mark items as they are implemented.

## Methods

- [x] ready ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] expand ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] close ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] sendData ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] openLink ([840ace1]https://github.com/RAprogramm/telegram-webapp-sdk/commit/840ace1)
- [x] openTelegramLink ([840ace1]https://github.com/RAprogramm/telegram-webapp-sdk/commit/840ace1)
- [x] openInvoice ([840ace1]https://github.com/RAprogramm/telegram-webapp-sdk/commit/840ace1)
- [x] switchInlineQuery ([a098e00]https://github.com/RAprogramm/telegram-webapp-sdk/commit/a098e00)
- [x] showAlert ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] showConfirm ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] showPopup ([840ace1]https://github.com/RAprogramm/telegram-webapp-sdk/commit/840ace1)
- [x] showScanQrPopup ([840ace1]https://github.com/RAprogramm/telegram-webapp-sdk/commit/840ace1)
- [x] closeScanQrPopup ([840ace1]https://github.com/RAprogramm/telegram-webapp-sdk/commit/840ace1)
- [x] shareURL ([a098e00]https://github.com/RAprogramm/telegram-webapp-sdk/commit/a098e00)
- [x] shareMessage ([4b10c98]https://github.com/RAprogramm/telegram-webapp-sdk/commit/4b10c98)
- [x] shareToStory ([4b10c98]https://github.com/RAprogramm/telegram-webapp-sdk/commit/4b10c98)
- [x] joinVoiceChat ([a098e00]https://github.com/RAprogramm/telegram-webapp-sdk/commit/a098e00)
- [x] requestWriteAccess ([a098e00]https://github.com/RAprogramm/telegram-webapp-sdk/commit/a098e00)
- [x] requestContact ([d595540]https://github.com/RAprogramm/telegram-webapp-sdk/commit/d595540)
- [x] requestPhoneNumber ([d595540]https://github.com/RAprogramm/telegram-webapp-sdk/commit/d595540)
- [x] openContact ([d595540]https://github.com/RAprogramm/telegram-webapp-sdk/commit/d595540)
- [x] enableVerticalSwipes ([8e60df3]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8e60df3)
- [x] disableVerticalSwipes ([8e60df3]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8e60df3)
- [x] hideKeyboard ([94ff585]https://github.com/RAprogramm/telegram-webapp-sdk/commit/94ff585)
- [x] downloadFile ([3092094]https://github.com/RAprogramm/telegram-webapp-sdk/commit/3092094)
- [x] readTextFromClipboard ([fd1c84e]https://github.com/RAprogramm/telegram-webapp-sdk/commit/fd1c84e)
- [x] setEmojiStatus ([12cfbd0]https://github.com/RAprogramm/telegram-webapp-sdk/commit/12cfbd0)
- [x] requestEmojiStatusAccess ([12cfbd0]https://github.com/RAprogramm/telegram-webapp-sdk/commit/12cfbd0)
- [x] setHeaderColor ([58a73cb]https://github.com/RAprogramm/telegram-webapp-sdk/commit/58a73cb)
- [x] setBackgroundColor ([58a73cb]https://github.com/RAprogramm/telegram-webapp-sdk/commit/58a73cb)
- [x] setBottomBarColor ([58a73cb]https://github.com/RAprogramm/telegram-webapp-sdk/commit/58a73cb)
- [x] addToHomeScreen ([e709edb]https://github.com/RAprogramm/telegram-webapp-sdk/commit/e709edb)
- [x] checkHomeScreenStatus ([e709edb]https://github.com/RAprogramm/telegram-webapp-sdk/commit/e709edb)
- [x] enableClosingConfirmation ([8fe4dec]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8fe4dec)
- [x] disableClosingConfirmation ([8fe4dec]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8fe4dec)
- [x] isClosingConfirmationEnabled (unreleased)
- [x] requestFullscreen ([4364008]https://github.com/RAprogramm/telegram-webapp-sdk/commit/4364008)
- [x] exitFullscreen ([4364008]https://github.com/RAprogramm/telegram-webapp-sdk/commit/4364008)
- [x] lockOrientation ([4364008]https://github.com/RAprogramm/telegram-webapp-sdk/commit/4364008)
- [x] unlockOrientation ([4364008]https://github.com/RAprogramm/telegram-webapp-sdk/commit/4364008)

## Objects

### BottomButton (Main & Secondary)
- [x] show ([7d524fd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7d524fd)
- [x] hide ([7d524fd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7d524fd)
- [x] setText ([7d524fd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7d524fd)
- [x] setColor ([7d524fd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7d524fd)
- [x] setTextColor ([7d524fd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7d524fd)
- [x] onClick ([7d524fd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7d524fd)
- [x] offClick ([7d524fd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7d524fd)

### MainButton
- [x] show ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] hide ([f0a108d]https://github.com/RAprogramm/telegram-webapp-sdk/commit/f0a108d)
- [x] setText ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] onClick ([0a42d7b]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0a42d7b)
- [x] offClick ([0a42d7b]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0a42d7b)

### BackButton
- [x] show ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] hide ([bcce132]https://github.com/RAprogramm/telegram-webapp-sdk/commit/bcce132)
- [x] onClick ([0a42d7b]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0a42d7b)
- [x] offClick ([0a42d7b]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0a42d7b)

### SettingsButton
- [x] show ([885be03]https://github.com/RAprogramm/telegram-webapp-sdk/commit/885be03)
- [x] hide ([885be03]https://github.com/RAprogramm/telegram-webapp-sdk/commit/885be03)
- [x] onClick ([885be03]https://github.com/RAprogramm/telegram-webapp-sdk/commit/885be03)
- [x] offClick ([885be03]https://github.com/RAprogramm/telegram-webapp-sdk/commit/885be03)

### HapticFeedback
- [x] impactOccurred ([9896d92]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9896d92)
- [x] notificationOccurred ([9896d92]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9896d92)
- [x] selectionChanged ([9896d92]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9896d92)

## Sensors

### Accelerometer
- [x] start ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)
- [x] stop ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)
- [x] getAcceleration ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)

### Gyroscope
- [x] start ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)
- [x] stop ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)
- [x] getAngularVelocity ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)

### DeviceOrientation
- [x] start ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)
- [x] stop ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)
- [x] getOrientation ([9428d51]https://github.com/RAprogramm/telegram-webapp-sdk/commit/9428d51)

### LocationManager
- [x] init ([10ca55c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/10ca55c)
- [x] getLocation ([10ca55c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/10ca55c)
- [x] openSettings ([10ca55c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/10ca55c)
- [x] onLocationManagerUpdated ([10ca55c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/10ca55c)
- [x] onLocationRequested ([10ca55c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/10ca55c)

### BiometricManager
- [x] init ([8c34fbd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8c34fbd)
- [x] requestAccess ([8c34fbd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8c34fbd)
- [x] authenticate ([8c34fbd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8c34fbd)
- [x] updateBiometricToken ([8c34fbd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8c34fbd)
- [x] openSettings ([8c34fbd]https://github.com/RAprogramm/telegram-webapp-sdk/commit/8c34fbd)
- [x] isInited ([7a2555c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7a2555c)
- [x] isBiometricAvailable ([7a2555c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7a2555c)
- [x] isAccessRequested ([7a2555c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7a2555c)
- [x] isAccessGranted ([7a2555c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7a2555c)
- [x] isBiometricTokenSaved ([7a2555c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7a2555c)
- [x] deviceId ([7a2555c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/7a2555c)

## Storages

### CloudStorage
- [x] getItem ([ae2a302]https://github.com/RAprogramm/telegram-webapp-sdk/commit/ae2a302)
- [x] setItem ([ae2a302]https://github.com/RAprogramm/telegram-webapp-sdk/commit/ae2a302)
- [x] removeItem ([ae2a302]https://github.com/RAprogramm/telegram-webapp-sdk/commit/ae2a302)
- [x] getItems ([ae2a302]https://github.com/RAprogramm/telegram-webapp-sdk/commit/ae2a302)
- [x] setItems
- [x] removeItems ([ae2a302]https://github.com/RAprogramm/telegram-webapp-sdk/commit/ae2a302)
- [x] getKeys ([ae2a302]https://github.com/RAprogramm/telegram-webapp-sdk/commit/ae2a302)
- [x] clear ([ae2a302]https://github.com/RAprogramm/telegram-webapp-sdk/commit/ae2a302)

### DeviceStorage
- [x] set ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)
- [x] get ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)
- [x] remove ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)
- [x] clear ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)

### SecureStorage
- [x] set ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)
- [x] get ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)
- [x] restore ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)
- [x] remove ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)
- [x] clear ([0905616]https://github.com/RAprogramm/telegram-webapp-sdk/commit/0905616)

## Background events

| Event | Payload |
|-------|---------|
| `mainButtonClicked` | none |
| `backButtonClicked` | none |
| `settingsButtonClicked` | none |
| `writeAccessRequested` | `bool` granted flag |
| `contactRequested` | `bool` shared flag |
| `phoneRequested` | `bool` shared flag |
| `invoiceClosed` | status `String` |
| `popupClosed` | object `{ button_id: Option<String> }` |
| `qrTextReceived` | scanned text `String` |
| `clipboardTextReceived` | clipboard text `String` |

## Remaining WebApp Features

The following features are not yet covered by the SDK:

- [x] Init data validation (unreleased)
- [x] Theme and safe area change events ([58a73cb]https://github.com/RAprogramm/telegram-webapp-sdk/commit/58a73cb)
- [x] Viewport management
- [x] Clipboard access ([fd1c84e]https://github.com/RAprogramm/telegram-webapp-sdk/commit/fd1c84e)
- [x] Location access ([10ca55c]https://github.com/RAprogramm/telegram-webapp-sdk/commit/10ca55c)
- [x] Invoice payments (unreleased)
- [x] Background events (unreleased)