Skip to main content

What is FuseBox

FuseBox is an Open Source Wallet-As-A-Service platform based on Account Abstraction. It is ERC-4337 complaint and provides Developers the ability to use a Bundler for collacting UserOperations, and also a Paymaster to sponsor Gas payments for their users to provide a Gasless experience. FuseBox is required for building applications on the Fuse Network. It provides a set of methods that are available to Developers via a REST API, a Flutter SDK and a TypeScript SDK. Thus making is easier for Developers to interact with the Fuse Blockchain without the need to make direct RPC calls, and eliminating the need to use a node service provider.

FuseBox Backend is developed with the NestJS framework. It relies on ERC-4337 Smart Contracts, Paymaster, Bundler, and additional API endpoints written in NodeJS.

 

REST API

The Fuse API is a REST API that Developers can use to access particular features on a need basis if they prefer this method as against cloning the GitHub repository into their projects. The Smart Wallet API is powered by Account Abstraction and as a result the Smart Wallet creates Smart Contract Accounts. The API is available at the Base Endpoint: https://api.fuse.io/. The Fuse REST API is divided into:

  • Smart Wallet API v2: This API enables the creation and administration of smart wallet accounts supporting the ERC-4337 standard.

  • Notification API: Subscribing to the Notification API allows you to receive updates on wallet events and activities pertaining to your customers.

  • Trade API: This API facilitates trading activities and provides access to trading-related data.

  • Smart Wallet API v2: The Smart Wallet API v2 (previously referenced as Smart Wallets, now deprecated) enables Developers to Authenticate and access a jwt string which they can then parse to enable sessions for users. This enables users who Authenticate in the DApp provided by the Developer and are recognised upon sign out and sign in without the need to re-authenticate. The endpoints available are:

    • Auth
    • Create Wallet
    • Get Wallet
    • Get Historical Transaction

Below is an example using curl to create a Smart Contract Account using the endpoint

curl -L -X POST 'https://api.fuse.io/api/v1/smart-wallets/create' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{}'

Bearer is the jwt TOKEN returned from Auth endpoint.

  • Notification API: Fuse Notification API enables developers to send relevant, timely notifications on the most essential Web3 events such as External Transfers, Internal Transfers and Token Transfers. Fuse Notifications works by using webhooks, the Base url is https://api.fuse.io/api/v0/notifications/webhook. Learn more

  • Trade API: With the Trade API, users can buy and sell popular cryptocurrencies like Bitcoin and Ethereum, stablecoins, or custom tokens dedicated to their application domain. Behind the scenes, it uses voltage.finance decentralized exchange. The endpoints available are:

    • Price
    • Price Change
    • Stats
    • Swap
    • Tokens

Below is an example using curl to call the Price endpoint for a particular token:

curl -L -X GET 'https://api.fuse.io/api/v0/trade/price/:tokenAddress' \
-H 'Accept: application/json'

Learn more

 

FuseBox Flutter SDK

The FuseBox Flutter SDK is available as a Flutter package for Mobile applications development. The Package contains all the endpoints available in the REST API.

  • Create and Get Address
  • Send transactions
  • Approve Token Transactions
  • Retry mechanism
  • Send Batch Transactions

It is easy for developers to start building with the Flutter SDK. Below is an example to instantiate an app and create a Smart Contract Account:

import 'package:fuse_wallet_sdk/fuse_wallet_sdk.dart';
final apiKey = 'YOUR_PUBLIC_API_KEY';
final privateKey = EthPrivateKey.fromHex('YOUR_PRIVATE_KEY');
final fuseSDK = await FuseSDK.init(apiKey, privateKey);

 

FuseBox Web SDK

FuseBox Web SDK is a powerful toolkit designed to streamline the integration of your applications with the Fuse Blockchain. Leveraging this SDK empowers developers to effortlessly create Smart Contract Wallets, initiate User Operations, and tap into the Fuse Notification and Trade APIs which are COMING to the SDK in the next release. With a comprehensive set of methods, FuseBox Web SDK simplifies the development process, facilitating efficient integration with the Fuse Network.

The FuseBox Web SDK all-in-one solution streamlines development, ensuring efficient integration with the Fuse Network.

Smart Contract Wallet Initialization

The SDK simplifies the initializing of Smart Contract Wallets from an Externally Owned Account (EOA). Developers can easily manage wallet credentials and initiate Smart Contract Wallet creation. It is as seamless as running the code below:

Wallet Action History Retrieval

Developers can retrieve the complete history of User Operations carried out by a Smart Contract Wallet. This feature enables seamless auditing and tracking of wallet activities.

User Operation Transfers

The SDK facilitates sending User Operations, whether with or without a Paymaster. This flexibility allows developers to implement customizable transaction functionalities within their applications.

Batch Transfers

Effortlessly batch multiple User Operations, such as swaps, using the callContract or executeBatch method. This feature simplifies complex transactions, enhancing the overall user experience.

 

GitHub Repo

FuseBox Backend is the only Open Source project that enables developers have access to the Fuse Blockchain RPC methods without the need for a node service provider. The default open source library is free for use by developers can be accessed on GitHub.

 

Account Abstraction using FuseBox

The introduction of ERC-4337 as a standard in the Ethereum Ecosystem is a welcome development that ensures the ability to onboard the next billion users to Web3. This standard has also been extended into Fuse blockchain.

The difference is that the Fuse ecosystem provides a higher Transactions Output Per Second (TPS) and thus a faster Block Time for validating transactions. With the introduction of Account Abstraction into Fuse, DApp developers can now build without having to worry about onboarding traditional web2 users, who might have to come to use their applications and find a steep learning curve as is commonly associated with onboarding using wallets that are non-custodial and require users to recall their private keys and/or mnemonic seed phrases, given whichever scenario. So, to make it easier for developers to onboard users, Fuse has built the Fuse Connect Wallet.

 

In the following sections, we will cover how to start with the FuseBox, an overview of its Architecture, and the various Tools. If you have any questions or feedback, please get in touch with our support team at support@fuse.io.

Was this page helpful?

Happy React is loading...