• Stars
    star
    105
  • Rank 326,106 (Top 7 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Repository contains mexa sdk code that can be plugged into your dapp and can leverage meta transaction feature.

Enable meta transactions or gasless transactions in your DApp by integrating Biconomy Gasless SDK in your DApp

Biconomy Gasless SDK

Introduction

Biconomy Gasless SDK, enables meta transactions or gasless transactions in your DApp (Decentralized Application) out of the box without any change in your smart contracts and just a few lines of code in your DApp to integrate gasless sdk.

By using Gasless SDK, dapp users are able to use the dapp and send transactions free of cost while developer pays the gas fee on their behalf as a part of user acquisition cost.

Letโ€™s Get Started

  1. Go to Biconomy Gasless Dashboard to register your DApp and methods on which to enable meta transactions and copy your DApp ID and API Key.
  2. Install Biconomy Gasless SDK
npm install @biconomy/mexa

Import and initialize gasless sdk and web3

import { Biconomy } from "@biconomy/mexa";
const biconomy = new Biconomy(window.ethereum, {
        apiKey: apiKey,
        contractAddresses: [<Your contract address>],
});      
await biconomy.init();

Initialize your dapp after gasless SDK initialization

biconomy.on("txMined", (data: any) => {
    // Event emitter to monitor when a transaction is mined
    console.log("transaction data", data);
});
biconomy.on("txHashGenerated", (data: any) => {
    // Event emitter to monitor when a transaction hash is generated
    console.log("transaction data", data);
});
biconomy.on("txHashChanged", (data: any) => {
    // Event emitter to monitor when a transaction hash is changed in case of gas price bump
    console.log("transaction data", data);
});
biconomy.on("error", (data: any) => {
    // Event emitter to monitor when an error occurs
    console.log("transaction data", data);
});

Congratulations!! You have now enabled meta transactions in your DApp. Interact with web3 the way you have been doing it.

Now whenever there is a write transaction action initiated from user (registered in biconomy gasless dashboard also), gasless SDK will ask for userโ€™s signature and handle the transaction rather than sending signed transaction directly to blockchain from userโ€™s wallet.

Key Name Value Required? Description
apiKey

type: string

API Key can be found on Biconomy gasless dashboard.

true Unique id assigned to each DApp that used to authenticate requests coming from Biconomy gasless sdk.
strictMode

type: boolean

default value: false

Value could be true or false.

false

If strict mode is on, and method/api called by user is not registered on Biconomy gasless dashboard then no transaction will be initiated.

If strict mode is off, and method called by user is not registered on Biconomy gasless dashbord dashboard then existing provider will be used to send user transaction but in this case, the user will have to pay the transaction fee.

More Repositories

1

metatx-standard

Repository contains generalized meta transaction standard that can be added to any smart contract to allow Meta Transactions from any externally-owned (key-based) account.
JavaScript
141
star
2

scw-contracts

SCW contracts for Biconomy Smart Account
TypeScript
111
star
3

mexa

Repository contains smart contracts for biconomy's Mexa platform to implement meta transactions and allow dapp users to perform blockchain operations without holding any ether or other crypto currency.
JavaScript
94
star
4

biconomy-client-sdk

Biconomy SDK is a plug & play toolkit for dApps to build transaction legos that enable a highly customised one-click experience for their users
TypeScript
72
star
5

biconomy-paymasters

Paymasters development project
TypeScript
29
star
6

dapp-demo

JavaScript
25
star
7

sdk-examples

TypeScript
24
star
8

docs

Biconomy official documentation
MDX
15
star
9

relayer-node

A Multichain Relayer Node
TypeScript
14
star
10

nexus

Nexus by Biconomy: ERC-7579 Modular Smart Account for Enhanced Account Abstraction
Solidity
12
star
11

hyphen-contract

all contracts related to hyphen
Solidity
11
star
12

biconomy-contracts

Smart contracts of Biconomy's multi-chain relayer protocol
Solidity
10
star
13

wallet-integrations

This Repository consist of various integration with Biconomy.
JavaScript
8
star
14

hyphen-ui

TypeScript
6
star
15

useAA

react hook library
TypeScript
6
star
16

gasless-playground

TypeScript
6
star
17

userop-debugger-backend

TypeScript
6
star
18

bundler

4337 Typescript Bundler
TypeScript
6
star
19

sdk-demo

A playground to test some use cases of the SDK.
TypeScript
5
star
20

moonShot

Gamified version of option trading on blockchain. Where user place a bet on a coin's price and bet if the price will go up or down, if after certain duration his prediction comes true he wins some tokens.
JavaScript
5
star
21

hyphen-sdk

Repository containing Hyphen SDK code that helps you integrate Hyphen cross-chain asset transfer protocol in your Dapp. Hyphen SDK provides you simple to use methods that connects directly with Hyphen liquidity pools on supported chains and hyphen nodes to fetch information related to cross chain transfer transactions.
TypeScript
5
star
22

quickstart

TypeScript
4
star
23

ccmp-contracts

Cross Chain Messaging Protocol Aggregator
TypeScript
4
star
24

awesome-biconomy

Compilation of compelling project ideas and useful resources for utilizing Biconomy
4
star
25

InstaExitDemo

Demo showcasing instaExit where you can transfer funds instantly across different chains.
JavaScript
3
star
26

hyphen-data

JavaScript
3
star
27

hyphen-arbitrage-bot

Python bot which delivers Arbitrage Opportunities via Twitter account @ArbitRajaBot for all tokens across all chains.
Python
3
star
28

biconomy-sdk-starter-kit

TypeScript
2
star
29

gasless-minting-demo

JavaScript
2
star
30

3074-Experiments

Solidity
2
star
31

biconomy-careers

TypeScript
1
star
32

.github

1
star
33

hyphen-widget

A Widget for Hyphen
TypeScript
1
star
34

safety-module

UI for Biconomy Safety Module
JavaScript
1
star
35

mexa-sdk-react-native-example

Java
1
star
36

brn-contracts

Smart Contracts for the Decentralised Relayer Network
Solidity
1
star
37

frames

TypeScript
1
star
38

compound-demo

JavaScript
1
star
39

biconomy_viem_example

TypeScript
1
star
40

frame-smart-account-template

create smart account template
TypeScript
1
star
41

mexa-examples

Project containing different example codes showing how mexa can be used in different ways to enable gas less transactions in your project.
JavaScript
1
star
42

insta-exit-sdk

SDK to interact with Biconomy instaExit backend. It will provide a seamless process to integrate Insta-exit in any dapp or project
TypeScript
1
star
43

entry-point-gas-estimations

4337 Gas Estimations SDK
TypeScript
1
star
44

fallback-gastank

Solidity
1
star