diff --git a/docs/build/dapp/01-introduction.md b/docs/build/dapp/01-introduction.md new file mode 100644 index 000000000..72aead515 --- /dev/null +++ b/docs/build/dapp/01-introduction.md @@ -0,0 +1,53 @@ +--- +id: introduction +title: Howto create a DApp +sidebar_label: Introduction +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + +This documentation aims to guide beginner and intermediate developers in integrating with **Archethic Wallet** (**aeWallet**). It explains various communication methods and includes code snippets in **Dart (Flutter)** and **TypeScript**. + + +## Introduction + +Archethic wallets enable **DApps (Decentralized Applications)** to interact with the Archethic blockchain. This interaction is essential for: + +- Signing transactions. +- Managing accounts. + +While keeping your secrets protected in **aeWallet**. + + +## Communication Channels + +Below are the supported communication methods with Archethic wallets: + +| **DApp platform** | **aeWallet platform** | **Channel** | **Typescript Lib** | **Flutter Lib** | +|---------------------------|---------------------------|-------------------------------|-----------------------|-----------------------| +| Web (Desktop browser) | Desktop | WebSocket | ✅ | ✅ | +| Web (aeWallet browser) | Mobile | Web Message Channel | ⛔️ Not implemented yet| ⛔️ Not implemented yet | +| Web (Desktop browser) | Chrome Extension | Web Message Channel | ✅ | ✅ | +| Desktop | Desktop | WebSocket | ✅ | ✅ | +| Mobile | Mobile | DeepLink | ⛔️ | ✅ | + + +:::info +Currently, the primary use case is **web desktop DApps** running in browsers like Chrome. In the future, a mobile wallet will support DApps through an embedded browser. +::: + + + +## Tools and Libraries + +- **Flutter/Dart:** [archethic_lib_dart](https://pub.dev/packages/archethic_lib_dart) +- **TypeScript:** [@archethicjs/sdk](https://www.npmjs.com/package/@archethicjs/sdk) + + +## Additional Resources + +- [archethic_wallet_client on pub.dev](https://pub.dev/packages/archethic_wallet_client) +- [archethic_lib_dart on pub.dev](https://pub.dev/packages/archethic_lib_dart) +- [@archethicjs/sdk on npm](https://www.npmjs.com/package/@archethicjs/sdk) + diff --git a/docs/build/dapp/02-getting-started.md b/docs/build/dapp/02-getting-started.md new file mode 100644 index 000000000..1fdac5ee1 --- /dev/null +++ b/docs/build/dapp/02-getting-started.md @@ -0,0 +1,37 @@ +--- +id: getting-started +title: Installation/Connection +sidebar_label: Getting started +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +## Installing library + + + + +```shell +npm install @archethicjs/sdk +``` + + + + +```shell +flutter pub add archethic_wallet_client +``` + + + + +## Setup Deeplink channel + +:::note +For a **mobile DApp** to communicate with **aeWallet mobile**, the only communication channel is the deeplink. +::: + +:::tip +This is required only if your **DApp** is an Android or iOS application. +::: + diff --git a/docs/build/dapp/03-connecting.md b/docs/build/dapp/03-connecting.md new file mode 100644 index 000000000..2562f05f5 --- /dev/null +++ b/docs/build/dapp/03-connecting.md @@ -0,0 +1,120 @@ +--- +id: connecting +title: Connecting aeWallet +sidebar_label: Connecting aeWallet +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + +This example attempts to connect to **aeWallet** and writes a log when connection status is updated. + +:::tip +Ensure that the **aeWallet** application is **running and unlocked** before attempting connection. +::: + + + + +```html title="index.html" + + +