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

[core] AptosConnect Telegram support #434

Merged
merged 2 commits into from
Oct 8, 2024
Merged
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
5 changes: 5 additions & 0 deletions .changeset/hot-boats-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aptos-labs/wallet-adapter-core": minor
---

Bumped `@aptos-connect/wallet-adapter-plugin` to 2.1.0 to enable Telegram support
1 change: 1 addition & 0 deletions apps/nextjs-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-toast": "^1.1.5",
"@telegram-apps/sdk": "^2.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the same underlying package (although I'm using v2 here)

'react-sdk' builds on top of 'sdk'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

didn't need full react support

"@trustwallet/aptos-wallet-adapter": "^0.1.6",
"antd": "^5.1.2",
"class-variance-authority": "^0.7.0",
Expand Down
8 changes: 7 additions & 1 deletion apps/nextjs-example/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
isAptosNetwork,
useWallet,
} from "@aptos-labs/wallet-adapter-react";
import { init as initTelegram } from "@telegram-apps/sdk";
import { AlertCircle } from "lucide-react";
import Image from "next/image";

Expand All @@ -40,13 +41,18 @@ import { registerWallet } from "@aptos-labs/wallet-standard";

// Example of how to register a browser extension wallet plugin.
// Browser extension wallets should call registerWallet once on page load.
// When you click "Connect Wallet", you should see "Example Wallet"
// When you click "Connect Wallet", you should see "Example Wallet"
(function () {
if (typeof window === "undefined") return;
const myWallet = new MyWallet();
registerWallet(myWallet);
})();

const isTelegramMiniApp = typeof window !== 'undefined' && (window as any).TelegramWebviewProxy !== undefined;
if (isTelegramMiniApp) {
initTelegram();
}

export default function Home() {
const { account, connected, network, wallet, changeNetwork } = useWallet();

Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-adapter-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"typescript": "^4.5.3"
},
"dependencies": {
"@aptos-connect/wallet-adapter-plugin": "^2.0.2",
"@aptos-connect/wallet-adapter-plugin": "^2.1.1",
"@aptos-labs/wallet-standard": "^0.2.0",
"@atomrigslab/aptos-wallet-adapter": "^0.1.20",
"@mizuwallet-sdk/aptos-wallet-adapter": "^0.2.5",
Expand Down
102 changes: 78 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading