From e582ab7a30310b39c35746d1ce1f94ed06230a2d Mon Sep 17 00:00:00 2001 From: Lior Agnin Date: Sun, 3 Mar 2024 21:06:22 +0200 Subject: [PATCH 1/4] Remove all broken links --- .../Voltage-Finance-bridge-FuseBNB-Chain.mdx | 7 +++--- docs/basics/intro-to-fuse/fuse-consensus.mdx | 2 +- .../README.mdx | 4 ++-- docs/developers/Quick-Start.mdx | 22 +++++-------------- docusaurus.config.js | 4 ++-- 5 files changed, 14 insertions(+), 25 deletions(-) diff --git a/docs/basics/Voltage-Finance-bridge-FuseBNB-Chain.mdx b/docs/basics/Voltage-Finance-bridge-FuseBNB-Chain.mdx index e0af73ee..44e2b094 100644 --- a/docs/basics/Voltage-Finance-bridge-FuseBNB-Chain.mdx +++ b/docs/basics/Voltage-Finance-bridge-FuseBNB-Chain.mdx @@ -8,11 +8,10 @@ This is a step-by-step guide explaining how to move BEP20-supported tokens betwe In this step-by-step bridging tutorial, we will use a [MetaMask wallet](https://metamask.io/download/) to bridge FUSE tokens from **Fuse** to the \*\*BSC network \*\*via the native [app.voltage.finance](https://app.voltage.finance/#/bridge) bridge. - +:::note Make sure you are connected to the Fuse Network RPC. To learn how to add the - Fuse Network RPC you can follow the tutorial - [here](https://docs.fuse.io/docs/tutorials/network-tutorials/tutorialsOverview) - + Fuse Network RPC you can follow the [tutorial](../basics/guides/tutorialsOverview) +::: **Step 1:** Navigate to[ ](https://fuseswap.com/)[app.voltage.finance/#/bridge](https://app.voltage.finance/#/bridge): diff --git a/docs/basics/intro-to-fuse/fuse-consensus.mdx b/docs/basics/intro-to-fuse/fuse-consensus.mdx index 681b12d1..13bc1a85 100644 --- a/docs/basics/intro-to-fuse/fuse-consensus.mdx +++ b/docs/basics/intro-to-fuse/fuse-consensus.mdx @@ -39,7 +39,7 @@ The need to stake Fuse ensures that an entity cannot create multiple seemingly d The validator who publishes a block agreed upon during a consensus round is rewarded by the network protocol in newly minted FUSE tokens. They also receive the fees users pay for the transactions included in the block. -Over time, validators can expect to publish a share of blocks equal to their overall stake. Since FUSE uses dPoS, a validator can increase their share by attracting FUSE tokens from delegators. The mechanics of delegation on FUSE are discussed in more detail on the [following page](https://docs.fuse.io/aboutFuse/about-fuse/fuse-network-blockchain/validators-and-delegation). +Over time, validators can expect to publish a share of blocks equal to their overall stake. Since FUSE uses dPoS, a validator can increase their share by attracting FUSE tokens from delegators. ## Misbehaving and malfunctioning diff --git a/docs/basics/intro-to-fuse/fuse-governance-and-development/README.mdx b/docs/basics/intro-to-fuse/fuse-governance-and-development/README.mdx index 9630dfdf..3fb441c9 100644 --- a/docs/basics/intro-to-fuse/fuse-governance-and-development/README.mdx +++ b/docs/basics/intro-to-fuse/fuse-governance-and-development/README.mdx @@ -11,7 +11,7 @@ Governance is currently split among the following actors: **1) Network Validators.** Fuse Network validators are entrusted with deciding whether to adopt [Fuse improvement proposals](./fips.mdx) (FIPs). Regardless of their share of the overall network stake, every validator has one vote, but this will likely change soon. -**2) Fuse Foundation and the project team.** Like most public blockchain projects at the initial stage of development, the development of the core network protocol and the Fuse treasury that primarily consists of the undistributed genesis FUSE supply (see the subsection "[FUSE Supply and Current Distribution](https://docs.fuse.io/general/fuse-token/fuse-supply-and-current-distribution)") are currently managed mainly by a foundation. +**2) Fuse Foundation and the project team.** Like most public blockchain projects at the initial stage of development, the development of the core network protocol and the Fuse treasury that primarily consists of the undistributed genesis FUSE supply are currently managed mainly by a foundation. For Fuse, this role is played by Gibraltar-incorporated company Fuse Network Limited. Fuse Foundation employs the Fuse project team, whose members' profiles can be found [here](https://fuse.io/about). @@ -21,4 +21,4 @@ It also boosts the network's adoption by improving the Fuse tech stack, securing Since Fuse is a decentralized public blockchain platform, no permission from the project team is required for anyone who wishes to integrate with or develop on top of Fuse, including the network and node software development. -3\) Fuse Assembly. See the Assembly [page](https://docs.fuse.io/general/fuse-governance/fuse-assembly) for more details. +3\) Fuse Assembly. See the [Assembly page](../fuse-governance-and-development/fuse-assembly) for more details. diff --git a/docs/developers/Quick-Start.mdx b/docs/developers/Quick-Start.mdx index 787507ef..f5bd83bf 100644 --- a/docs/developers/Quick-Start.mdx +++ b/docs/developers/Quick-Start.mdx @@ -36,10 +36,6 @@ Welcome to the Fuse Blockchain Developer Quick Start Guide! This guide is design ## Building on Fuse -### Creating a Fuse Wallet - -To interact with the Fuse Blockchain, you'll need a wallet. Follow the [Fuse Metamask guide](https://docs.fuse.io/fuse-wallet/create-fuse-wallet) to set up your wallet. - ### Choosing a Development Option Fuse is EVM compatible and uses Solidity programming languages for smart contract development. @@ -48,11 +44,7 @@ Fuse provides a set of APIs for building on the Fuse blockchain, and also a Web ### Writing and Deploying Smart Contracts -Follow the [smart contract development guide](https://docs.fuse.io/fuse-studio/smart-contracts) for step-by-step instructions on writing and deploying smart contracts on Fuse. - -You can use Remix IDE, Hardhat, and/or ThirdWeb to deploy and test your smart contracts. Refer to the [smart contract deployment guide](https://docs.fuse.io/fuse-studio/smart-contracts) for step-by-step instructions. - -Get familiar with Fuse smart contract concepts, including token creation, staking, and governance. Refer to the [smart contract guide](https://docs.fuse.io/fuse-studio/smart-contracts) for in-depth information. +You can use [Remix IDE](../developers/deploying-smart-contracts/using-remix-and-metamask), [Hardhat](../developers/deploying-smart-contracts/using-hardhat), and/or [ThirdWeb](../developers/deploying-smart-contracts/using-thirdweb) to deploy and test your smart contracts. Learn how to interact with smart contracts using web3 libraries. Fuse supports Ethereum-compatible libraries like Web3.js and ethers.js. @@ -60,17 +52,15 @@ Learn how to interact with smart contracts using web3 libraries. Fuse supports E ## Fuse Developer Tools -### Fuse API Documentation - -Refer to the [Fuse API documentation](https://docs.fuse.io/api) for comprehensive information on Fuse APIs, endpoints, and integration guides. - ### FuseBox -Visit the [Fuse developer portal](https://developer.fuse.io/) for additional resources, tutorials, and community support. +[Create your project](https://console.fuse.io/build) to access FuseBox APIs. + +### SDK (Both TS & Dart) -### Flutter SDK +Fuse provides a variety of tools and SDKs to enhance your development experience. -Fuse provides a variety of tools and SDKs to enhance your development experience. Explore the [Fuse GitHub repository](https://github.com/fuseio) for the latest tools and libraries. +[Fuse API documentation](../fuse-box/fuse-apis/api-introduction) for comprehensive information on FuseBox APIs, endpoints, and tutorials.

 

diff --git a/docusaurus.config.js b/docusaurus.config.js index d44cb85d..1a82d069 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -173,8 +173,8 @@ const config = { to: "https://explorer.fuse.io/", }, { - label: "Documentation", - to: "https://docs.fuse.io/", + label: "Bridge", + to: "https://console.fuse.io/bridge", }, { label: "Staking", From 44c02beeec1203edb625cbb073869feff7d64aac Mon Sep 17 00:00:00 2001 From: emmaodia Date: Mon, 4 Mar 2024 05:25:31 +0100 Subject: [PATCH 2/4] update: Fuse Wallet Mobile Transfers Guide. --- .../tutorials/mobile-guide-transfers.mdx | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 docs/fuse-box/tutorials/mobile-guide-transfers.mdx diff --git a/docs/fuse-box/tutorials/mobile-guide-transfers.mdx b/docs/fuse-box/tutorials/mobile-guide-transfers.mdx new file mode 100644 index 00000000..4ec7a832 --- /dev/null +++ b/docs/fuse-box/tutorials/mobile-guide-transfers.mdx @@ -0,0 +1,201 @@ +--- +title: Handling Transfers Using the Fuse Wallet SDK in a Flutter App +sidebar_position: 9 +--- + +## Pre-requites: +- Basic knowledge of Dart/Flutter +- An API Key from [Console](https://console.fuse.io/build) +- PrivateKEY from an Externally Owned Account (EOA) + +## Step 1: Set Up Your Flutter Project +Create a new Flutter project using the following command: + +```bash +flutter create fuse_wallet_app +cd fuse_wallet_app +``` + +Open the project in your favorite code editor, such as VSCode and run it using: + +```bash +flutter run +``` +You will find the default app running. + +## Step 2: Add Dependencies +In your pubspec.yaml file, add the required dependencies: + +```yaml +dependencies: + fuse_wallet_sdk: ^0.3.1 + flutter_hooks: ^0.23.0 +``` + +Run flutter pub get to install the dependencies. + +## Step 3: Implement the Wallet Creation Screen + +Open your Flutter project and open the default Dart file in the `lib` dir of your app, `main.dart`. Update it with the following code: + + + +```dart +import 'package:flutter/material.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:fuse_wallet_sdk/fuse_wallet_sdk.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Smart Contract Wallet', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: WalletCreationScreen(), + ); + } +} + + +class WalletCreationScreen extends HookWidget { + @override + Widget build(BuildContext context) { + final createWallet = useState(null); + + Future _createSmartContractWallet() async { + const apiKey = 'pk_KEY'; + final privateKey = EthPrivateKey.fromHex('0xEOA_PRIVATE_KEY'); + + try { + final fuseSDK = await FuseSDK.init(apiKey, privateKey); + String address = fuseSDK.wallet.getSender(); + + createWallet.value = address; +print('Smart contract wallet address: ${createWallet.value}'); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => TransferScreen(fuseSDK: fuseSDK, walletAddress: address), + ), + ); + } catch (e) { + // Handle initialization error + print('Error during wallet creation: $e'); + } + } + + return Scaffold( + appBar: AppBar( + title: Text('FuseBox Mobile App'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + onPressed: () { + _createSmartContractWallet(); + }, + child: Text('Create Smart Contract Wallet'), + ), + SizedBox(height: 20), + if (createWallet.value != null) + Text('Wallet Address: ${createWallet.value}'), + + ], + ), + ), + ); + } +} +``` +In the Screen above, we implemented a Basic Screen when you can click a Button, and create a Smart Contract Wallet. The screen navigates to a Transfer Screen where the created Smart Contract Wallet is displayed. + +## Step 4: Implement the Transfer +Create a new file named transfer_screen.dart and implement the Transfer Screen. + +```dart +class TransferScreen extends HookWidget { + final FuseSDK fuseSDK; + final String walletAddress; + + + TransferScreen({required this.fuseSDK, required this.walletAddress}); + + Future _transferFunds() async { + try { + final res = await fuseSDK.transferToken( + EthereumAddress.fromHex('0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'), // Replace with your token address + EthereumAddress.fromHex('0xd8da6bf26964af9d7eed9e03e53415d37aa96045'), // for 'vitalik.eth'. Replace with recipient's address. + BigInt.parse('1000000000000000000'), // Replace with the amount in Wei + ); + + print('UserOpHash: ${res.userOpHash}'); + print('Waiting for transaction...'); + + final ev = await res.wait(); + print('Transaction successful... Hash ${ev}'); + // Handle success, you can show a success message or navigate to another screen + } catch (e) { + // Handle the error, you can show an error message or log it + print('Error during transfer: $e'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Transfer Screen'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + + children: [ + Text('Wallet Address: ${walletAddress}'), + Text('Transfer funds here'), + ElevatedButton( + onPressed: () { + _transferFunds(); + }, + child: Text('Transfer Funds'), + ), + ], + ), + ), + ); + } +} +``` + +Run your app using: +```bash +flutter run +``` + +You should now have a basic Flutter app that allows users to create a Smart Contract Wallet and perform token transfers using the Fuse Wallet SDK. Please replace the placeholder values with your actual API key, private key, token address, recipient address, and transfer amount. + +## Conclusion +In this tutorial, we've created a simple Flutter app that leverages the Fuse Wallet SDK to demonstrate the process of creating a Smart Contract Wallet and initiating a token transfer on the Fuse Blockchain. While this example serves as a basic introduction to integrating blockchain functionality into a mobile app, developers can expand upon this foundation to build more robust and feature-rich applications. + +### Use Cases for Expansion +- User Authentication and Security: Enhance the app by implementing authentication mechanisms to secure user accounts and wallet access. Integrate biometrics or PIN-based authentication for an added layer of security. + +- Token Balance and Transaction History: Extend the app to display the user's token balance and transaction history. Utilize the Fuse Wallet SDK's functionalities to retrieve and present this information in a user-friendly manner. + +- Advanced Token Transfer Features: Explore advanced token transfer features such as handling different token types, adding transfer notes, or implementing recurring transfers. This can enhance the app's versatility for various use cases. + +- Integration with External APIs: Integrate the app with external APIs or services to retrieve real-time market data, token prices, or additional information relevant to the user's financial activities. + +- Smart Contract Interactions: Explore smart contract interactions beyond simple transfers. Implement features like voting, decentralized finance (DeFi) integrations, or participation in decentralized applications (DApps). + +Remember, this example is a starting point, and developers can tailor the app to meet specific use cases and business requirements. Fuse Wallet SDK provides a powerful toolkit to explore various blockchain-related functionalities, and integrating these features can result in a versatile and powerful mobile app for users interested in decentralized finance and blockchain technology. + + From e096534696fb29118cd4ec1ded92063062d0648e Mon Sep 17 00:00:00 2001 From: emmaodia Date: Mon, 4 Mar 2024 05:42:45 +0100 Subject: [PATCH 3/4] fix: Semrush Discovered Broken Links. --- docs/developers/Quick-Start.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developers/Quick-Start.mdx b/docs/developers/Quick-Start.mdx index 787507ef..02dee7e0 100644 --- a/docs/developers/Quick-Start.mdx +++ b/docs/developers/Quick-Start.mdx @@ -38,7 +38,7 @@ Welcome to the Fuse Blockchain Developer Quick Start Guide! This guide is design ### Creating a Fuse Wallet -To interact with the Fuse Blockchain, you'll need a wallet. Follow the [Fuse Metamask guide](https://docs.fuse.io/fuse-wallet/create-fuse-wallet) to set up your wallet. +To interact with the Fuse Blockchain, you'll need a wallet. Follow the [Fuse Metamask guide](../basics/guides/tutorialsOverview) to set up your wallet. ### Choosing a Development Option @@ -48,7 +48,7 @@ Fuse provides a set of APIs for building on the Fuse blockchain, and also a Web ### Writing and Deploying Smart Contracts -Follow the [smart contract development guide](https://docs.fuse.io/fuse-studio/smart-contracts) for step-by-step instructions on writing and deploying smart contracts on Fuse. +Follow the [smart contract development guide](../developers/deploying-smart-contracts/) for step-by-step instructions on writing and deploying smart contracts on Fuse. You can use Remix IDE, Hardhat, and/or ThirdWeb to deploy and test your smart contracts. Refer to the [smart contract deployment guide](https://docs.fuse.io/fuse-studio/smart-contracts) for step-by-step instructions. @@ -62,7 +62,7 @@ Learn how to interact with smart contracts using web3 libraries. Fuse supports E ### Fuse API Documentation -Refer to the [Fuse API documentation](https://docs.fuse.io/api) for comprehensive information on Fuse APIs, endpoints, and integration guides. +Refer to the [Fuse API documentation](../category/api-reference) for comprehensive information on Fuse APIs, endpoints, and integration guides. ### FuseBox From c68834afc811c081bc1be265cb04680f52d2f9f4 Mon Sep 17 00:00:00 2001 From: Lior Ageniho Date: Mon, 4 Mar 2024 10:44:52 +0200 Subject: [PATCH 4/4] Update Quick-Start.mdx --- docs/developers/Quick-Start.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/developers/Quick-Start.mdx b/docs/developers/Quick-Start.mdx index 2c36b754..4e2912e1 100644 --- a/docs/developers/Quick-Start.mdx +++ b/docs/developers/Quick-Start.mdx @@ -57,10 +57,6 @@ Learn how to interact with smart contracts using web3 libraries. Fuse supports E ## Fuse Developer Tools -### Fuse API Documentation - -Refer to the [Fuse API documentation](../category/api-reference) for comprehensive information on Fuse APIs, endpoints, and integration guides. - ### FuseBox [Create your project](https://console.fuse.io/build) to access FuseBox APIs.