3.0.6 • Published 1 year ago

@biconomy/mexa v3.0.6

Weekly downloads
567
License
MIT
Repository
github
Last release
1 year ago

Enable meta transactions or gasless transactions in your DApp by integrating

Mexa SDK in your DApp

Biconomy SDK (Mexa)

Introduction

Biconomy SDK (Mexa), 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 mexa.

By using Mexa, 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 Mexa Dashboard to register your DApp and methods on which to enable meta transactions and copy your DApp ID and API Key.
  2. Install Biconomy SDK (Mexa)
npm install @biconomy/mexa

Import and initialize mexa and web3

import { Biconomy } from "@biconomy/mexa";
const biconomy = new Biconomy(<web3 provider>,{apiKey: <API Key>});
web3 = new Web3(biconomy);

Note: <web3 provider> could be window.ethereum for Metamask or portis.provider for Portis and so on.

Initialize your dapp after mexa initialization

biconomy.onEvent(biconomy.READY, () => {
 // Initialize your dapp here
}).onEvent(biconomy.ERROR, (error, message) => {
 // Handle error while initializing mexa
});

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 mexa dashboard also), mexa will ask for user’s signature and handle the transaction rather than sending signed transaction directly to blockchain from user’s wallet.

Configuration

Biconomy constructor takes 2 parameters

const biconomy = new Biconomy(<existing web3 provider>, options);

<existing web3 provider>

object required

Any web3 provider that supports personal_sign, eth_accounts, eth_sendTransaction, eth_call RPC methods and web3 subscriptions.

For example, it can be window.ethereum for Metamask or portis.provider for Portis and so on.

options

object required

A json object having configuration values for initializing mexa sdk.

For metamask biconomy initialization code would look like:

let options = {
 apiKey: <API KEY>,
 strictMode: true
};
const biconomy = new Biconomy(window.ethereum, options);

3.0.6

1 year ago

2.0.39-beta.1

1 year ago

3.0.5

1 year ago

2.0.37

2 years ago

2.0.38

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

2.0.35

2 years ago

2.0.36

2 years ago

2.0.33

2 years ago

2.0.34

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.29

2 years ago

2.0.31

2 years ago

2.0.32

2 years ago

2.0.30

2 years ago

2.0.28

2 years ago

2.0.26

2 years ago

2.0.27

2 years ago

2.0.25

2 years ago

2.0.24

2 years ago

2.0.22

2 years ago

2.0.23

2 years ago

2.0.21

3 years ago

2.0.20

3 years ago

2.0.19

3 years ago

2.0.18

3 years ago

2.0.16

3 years ago

2.0.17

3 years ago

2.0.15

3 years ago

2.0.14

3 years ago

2.0.13

3 years ago

2.0.11

3 years ago

2.0.12

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.5

3 years ago

2.0.6

3 years ago

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.5.15

3 years ago

1.5.14

3 years ago

1.5.13

4 years ago

1.5.12

4 years ago

1.5.11

4 years ago

1.5.10

4 years ago

1.5.9

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.10

4 years ago

1.3.11

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago