{"id":43171883,"url":"https://github.com/fuseio/fusebox-web-sdk","last_synced_at":"2026-02-01T02:35:32.788Z","repository":{"id":205968791,"uuid":"709816812","full_name":"fuseio/fusebox-web-sdk","owner":"fuseio","description":"JS implementation of Fusebox SDK","archived":false,"fork":false,"pushed_at":"2025-03-27T08:52:16.000Z","size":510,"stargazers_count":3,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-12T16:16:43.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fuseio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-25T13:07:33.000Z","updated_at":"2025-03-27T08:52:21.000Z","dependencies_parsed_at":"2024-01-26T14:45:50.863Z","dependency_job_id":"0b161ebe-a921-470f-b7a0-481c9c0d31c3","html_url":"https://github.com/fuseio/fusebox-web-sdk","commit_stats":null,"previous_names":["fuseio/fuse_wallet_web_sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fuseio/fusebox-web-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuseio%2Ffusebox-web-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuseio%2Ffusebox-web-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuseio%2Ffusebox-web-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuseio%2Ffusebox-web-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuseio","download_url":"https://codeload.github.com/fuseio/fusebox-web-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuseio%2Ffusebox-web-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28965430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-01T02:35:32.039Z","updated_at":"2026-02-01T02:35:32.780Z","avatar_url":"https://github.com/fuseio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e                    \n\u003cimg  src=\"https://raw.githubusercontent.com/fuseio/fusebox-web-sdk/master/art/sdk_logo.svg\" height=\"170\"\u003e                    \n\u003c/p\u003e                    \n\n\u003cp align=\"center\"\u003e                    \n\u003ca href=\"https://img.shields.io/badge/License-MIT-green\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-green\" alt=\"MIT License\"\u003e\u003c/a\u003e                  \n\u003c/p\u003e\n\n- [Introduction](#introduction)\n  - [Benefits of using FuseBox TS SDK](#benefits-of-using-fusebox-ts-sdk)\n  - [Purpose of the SDK](#purpose-of-the-sdk)\n- [Instantiation](#instantiation)\n  - [Examples](#examples)\n    - [Get Address](#get-address)\n    - [Send transactions](#send-transactions)\n    - [Send batch transactions](#send-batch-transactions)\n    - [Staking](#staking)\n    - [Unstake](#unstake)\n    - [Trading](#trading)\n- [Features](#features)\n    - [Get Address](#get-address-1)\n    - [Send transactions](#send-transactions-1)\n    - [Send batch transactions](#send-batch-transactions-1)\n    - [Sponsored Transactions](#sponsored-transactions)\n    - [Staking](#staking-1)\n    - [Trading](#trading-1)\n- [Troubleshooting](#troubleshooting)\n- [Limitations](#limitations)\n\n## Introduction\n\nThe FuseBox TS SDK is a set of tools for creating, managing, and engaging with FuseBox TS SDK in client applications. FuseBox TS SDK lets users create smart contract wallets([Based on ERC-4337](https://eips.ethereum.org/EIPS/eip-4337)) associated with each user's Externally Owned Account (EOA) that provide added security compared to traditional EOAs with a single private key. With FuseBox TS SDK, users can deposit funds that no one else can control and withdraw at any time.\n\n### Benefits of using FuseBox TS SDK\nUsing FuseBox TS SDK provides several benefits, including:\n\n- **Enhanced security**: FuseBox TS SDK are non-custodial accounts that allow users to deposit funds that no one else can control and withdraw at any time. Each Fuse Smart Wallet is a smart contract associated with the user's EOA and can only be controlled by that user.\n- **Enhanced UX**: FuseBox TS SDK support gasless transactions, improving the user experience and making it more seamless to interact with the blockchain.\n- **Better developer experience**: The FuseBox TS SDK abstracts away the complexities of web3 development, such as cryptography, wallet management, and smart contract interactions, making it easier for developers to build blockchain-based applications\n\n### Purpose of the SDK\n\nThe SDK is designed to make it easy for developers to create, manage, and engage with FuseBox TS SDK in their applications. The SDK provides pre-built functions and utilities, allowing developers to interact with FuseBox TS SDK securely and efficiently.\n\n\n## Instantiation\n\n```typescript\nimport { FuseSDK } from \"@fuseio/fusebox-web-sdk\";\nimport { ethers } from 'ethers';\n\n// Create a project: https://console.fuse.io/build\nconst apiKey = 'YOUR_PUBLIC_API_KEY';\nconst credentials = new ethers.Wallet(\"PRIVATE_KEY\");\nconst fuseSDK = await FuseSDK.init(apiKey, credentials);\n```\n\n### Examples\n\n#### [Get Address](./example/address.ts)\n\n#### [Send transactions](./example/transfer.ts)\n\n#### [Send batch transactions](./example/batch.ts)\n\n#### [Staking](./example/stake_tokens.ts)\n\n#### [Unstake](./example/unstake_tokens.ts)\n\n#### [Trading](./example/swap_tokens.ts)\n\n\n## Features\n\nThe FuseBox TS SDK provides several features that allow developers to create, manage, and engage with FuseBox TS SDK in their applications. Some of the key features include:\n\n#### Get Address\n\nGets the address of the wallet created.\n\n```typescript\nconsole.log(`Smart contract wallet address: ${fuseSDK.wallet.getSender()}`);\n```\n\n#### Send transactions\n\nSend transactions, including ERC20 and NFT transfers and interaction with arbitrary smart contracts.\n\n```typescript\nconst tokenAddress = \"YOUR_TOKEN\";\nconst to = \"RECEIVER_ADDRESS\";\nconst amount = parseUnits('10000', DECIMAL); //Amount should be set in WEI. `DECIMAL` should be a numeric value\nconst data = Uint8Array.from([]);\nconst res = await fuseSDK.transferToken(\n  tokenAddress,\n  to,\n  amount,\n  data\n);\nconsole.log(`UserOpHash: ${res.userOpHash}`);\nconsole.log(`Waiting for transaction...`);\nconst ev = await res.wait();\nconsole.log(`Transaction hash: https://explorer.fuse.io/tx/${ev?.transactionHash}`);\n```\n\n#### Send batch transactions\n\nThe process of grouping multiple transactions into a single batch to be processed together. This is often done to optimize processing time and reduce transaction fees.\n\n```typescript\n// Approve and transfer in a single batch\nconst approveCallData = ContractUtils.encodeERC20ApproveCall(\n  spender,\n  amount\n) as unknown as Uint8Array;\n\nconst calls = [\n  {\n    to: tokenAddress,\n    value: BigInt(0),\n    data: approveCallData,\n  },\n  {\n    to: spender,\n    value: BigInt(0),\n    data: callData,\n  },\n];\n\nconst res = await fuseSDK.executeBatch(calls, txOptions);\n\nconsole.log(`UserOpHash: ${res.userOpHash}`);\n\nconsole.log(`Waiting for transaction...`);\nconst ev = await res.wait();\nconsole.log(`Transaction hash: https://explorer.fuse.io/tx/${ev?.transactionHash}`);\n```\n\n#### Sponsored Transactions\n\nSponsored transactions are the ability to pay for another user’s transaction fees. To do this, the Fuse operator must enable the sponsored feature in his project and deposit some funds into the paymaster contract. The SDK provides a middleware to check if the project is sponsored and the amount of funds available for sponsoring.\n\nTo use this feature, you must first initialize the SDK with the `withPaymaster` parameter set to `true`.\n\n```typescript\nimport { FuseSDK } from \"@fuseio/fusebox-web-sdk\";\nimport { ethers } from 'ethers';\n\nconst apiKey = 'YOUR_PUBLIC_API_KEY';\nconst credentials = new ethers.Wallet(\"PRIVATE_KEY\");\nconst fuseSDK = await FuseSDK.init(apiKey, credentials, { withPaymaster: true });\n```\n\n#### Staking\n\nThe SDK provides a module for staking. This module allows users to stake their tokens and earn rewards.\n\nCurrently, the SDK supports staking for the following tokens: Native Fuse \u0026 VoltToken\n\n```typescript\n\nconst stakingOptions = await fuseSDK.stakingModule.getStakingOptions(); // Get staking options\n\nconst nativeTokenAddress = Variables.NATIVE_TOKEN_ADDRESS;\nconst res = await fuseSDK.stakeToken(\n  new StakeRequestBody({\n    accountAddress: fuseSDK.wallet.getSender(),\n    tokenAmount: '0.01',\n    tokenAddress: nativeTokenAddress,\n  })\n);\n\nconsole.log(`UserOpHash: ${res?.userOpHash}`);\nconsole.log('Waiting for transaction...');\nconst ev = await res?.wait();\nconsole.log(`Transaction hash: https://explorer.fuse.io/tx/${ev?.transactionHash}`);\n```\n\n#### Trading\n\nSmart Wallet can buy and sell popular cryptocurrencies like Bitcoin and Ethereum, Stable-coins. Behind the scenes, it uses [voltage.finance](https://voltage.finance/) decentralized exchange.\n\n```typescript\nconst nativeTokenAddress = Variables.NATIVE_TOKEN_ADDRESS;\nconst usdcTokenAddress = '0x28C3d1cD466Ba22f6cae51b1a4692a831696391A';\nconst res = await fuseSDK.swapTokens(\n  new TradeRequest(\n    nativeTokenAddress,\n    usdcTokenAddress,\n    parseUnits('1', 18),\n    true,\n  ),\n);\n\nconsole.log(`UserOpHash: ${res?.userOpHash}`);\nconsole.log('Waiting for transaction...');\nconst ev = await res?.wait();\nconsole.log(`Transaction hash: https://explorer.fuse.io/tx/${ev?.transactionHash}`);\n```\n\n## Troubleshooting\n\n1. **User op cannot be replaced: fee too low.**\n\n   If you're getting the `User op cannot be replaced: fee too low` error, it means that the gas price you set is too low. You can increase the gas price by setting the `TxOptions` parameter when sending a transaction. To replace an user operation, a new user operation must have at least 10% higher `maxPriorityFeePerGas` and 10% higher `maxPriorityFeePerGas` than the one in the user operation mempool.\n\nTo replace the user operation, the new gas price must be at least 10% higher.\n\n```typescript\nconst tokenAddress = \"YOUR_TOKEN\";\nconst to = \"RECEIVER_ADDRESS\";\nconst amount = parseUnits('10000', DECIMAL); //Amount should be set in WEI. `DECIMAL` should be a numeric value\nconst data = Uint8Array.from([]);\n\nconst res = await fuseSDK.transferToken(\n  tokenAddress,\n  to,\n  amount,\n  data,\n  {\n    withRetry: true,\n    feeIncrementPercentage: 11,\n  }\n);\nconsole.log(`UserOpHash: ${res.userOpHash}`);\nconsole.log(`Waiting for transaction...`);\nconst ev = await res.wait();\nconsole.log(`Transaction hash: https://explorer.fuse.io/tx/${ev?.transactionHash}`);\n```\n\n## Limitations\n\nThe FuseBox TS SDK works only on the Fuse \u0026 Fuse Sparknet networks, an EVM based chain L1 blockchain. Support for other blockchains is planned for the future.\n\nIf you have any questions or feedback, please get in touch with our support team at support@fuse.io.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuseio%2Ffusebox-web-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuseio%2Ffusebox-web-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuseio%2Ffusebox-web-sdk/lists"}