GithubHelp home page GithubHelp logo

bcnmy / mexa-sdk Goto Github PK

View Code? Open in Web Editor NEW
105.0 20.0 42.0 76.46 MB

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

License: MIT License

TypeScript 100.00%

mexa-sdk's Introduction


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.

mexa-sdk's People

Contributors

arcticfloyd1984 avatar artsparkai avatar ayushgupta0610 avatar biconomy avatar chrislahaye avatar divyan73 avatar its-me-ilia avatar kunal047 avatar livingrock7 avatar livingrockrises avatar realkinando avatar rplusq avatar sanchaymittal avatar tarun1475 avatar tomarsachin2271 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mexa-sdk's Issues

Problem with SDK in backend

Describe the bug
Hello, i followed the tutorial for the integration in the backend link, but when I call the method getForwardRequestAndMessageToSign it returns this error:
No API found on dashboard for called method setQuote

I add the method in the dashboard,used this data link

I am using the contract that is in the example of gasless link

To Reproduce
Create a typescript node project

Mexa SDK version (please complete the following information):
2.0.35

`

public static async testBiconomy() {

const walletFromPrivateKey = new ethers.Wallet(pk)

// The address as a Promise per the Signer API
const addressFrom = await walletFromPrivateKey.getAddress()
console.log("🚀 ~ file: Wallet.service.ts:627 ~ WalletService ~ testBiconomy ~ addressFrom", addressFrom)

const to =  testBiconomyAddress
console.log("🚀 ~ file: Wallet.service.ts:630 ~ WalletService ~ testBiconomy ~ to", to)


    const provider = new ethers.providers.JsonRpcProvider(
      nodoBlockchain?.value as string
    )
    const biconomy = new Biconomy(provider,{apiKey: apiKeyBiconomy, debug:true});

      const iface = new ethers.utils.Interface(testBiconomyAbi)

     const functionSignature  = iface.encodeFunctionData('setQuote', ["PruebaQuote"])
    
    let providerBiconomy = biconomy.getEthersProvider();
   
    let rawTx = {
      to: to,
      data: functionSignature,
      from: addressFrom
    };

    let signedTx = await walletFromPrivateKey.signTransaction(rawTx);
    console.log("🚀 ~ file: Wallet.service.ts:581 ~ WalletService ~ testBiconomy ~ signedTx", signedTx)

    // should get user message to sign for EIP712 or personal signature types
    const forwardData = await biconomy.getForwardRequestAndMessageToSign(signedTx);
    console.log("🚀 ~ file: Wallet.service.ts:585 ~ WalletService ~ testBiconomy ~ forwardData", forwardData.request)

    // optionally one can sign using sigUtil
    const signature = signTypedData({ privateKey: Buffer.from(pk, 'hex'), data: forwardData.eip712Format, version: 
   SignTypedDataVersion.V3});                                                                    
    console.log("🚀 ~ file: Wallet.service.ts:589 ~ WalletService ~ testBiconomy ~ signature", signature)
    
    let dataTransaction = {
        signature: signature,
        forwardRequest: forwardData.request,
        rawTransaction: signedTx,
        signatureType: biconomy.EIP712_SIGN
    };

    try{

      const result=await providerBiconomy.send("eth_sendRawTransaction", [dataTransaction])

      return result

    }catch(error){
      console.log("🚀 ~ file: Wallet.service.ts:537 ~ WalletService ~ testBiconomy ~ error", error)
      
     throw new Error(ErrorConstants.TRANSACTION_ERROR);

    }

}
`

I appreciate any help

Gasless Bundled Transactions

Prize Bounty

$1500

Challenge Description

Bundling Transactions could help in reducing network congestion and save gas fees for the users, but more importantly, it could drastically improve the UX of the DApps as well.

Build a Smart Contract Layer to bundle multiple transactions on-chain into a single transaction to save gas fees and integrate biconomy to provide gasless transactions for the users. The contract layer must be generic and must be able to support transactions from different arenas( DeFi, Gaming, etc.)
Transaction ordering should be preserved and proper error handling should be considered.

E.g Create a smart contract wallet and call functions on contract wallet in one Bundled Transaction on-chain

Submission Requirements

  • Submissions must be open source
  • Biconomy must be integrated in the application to reflect better UX
  • The app should offer solution to an existing problem or add value to the users
  • The project must have a working demo to be considered a complete submission recommended to submit the submission as a PR in the https://github.com/bcnmy/mexa-sdk/gitcoin/your_project_folder repository for quick and easy assessment

Submission Deadline

May 27, 2020

Judging Criteria

We are looking for projects to extract complexities and build an easy to use smart contract layer off-chain and on-chain.Composability must be considered.

Keeping transaction ordering and how to handle the case if one or more transactions from the bundled transaction fail, will be major factors while evaluating the solution.

Winner Announcement Date

June 2, 2020

can't run react app after install @biconomy/mexa

Describe the bug
after installing @biconomy/mexa sdk i couldn't run react app anymore it's throw that error on the console
Class extends value undefined is not a constructor or null at node_modules/@biconomy/gasless-messaging-sdk/node_modules/ws/lib/receiver.js

Screenshots
Screen Shot 2022-10-31 at 6 00 40 PM

**Mexa SDK version

  • Version: 3.0.4

Additional context
i'm using react v 18.2.0 and vite 3.1.7

Only contractName is used to find out api information

SDK finds out the api information using only the methodName being executed. This is a blockcer for dapps which have multiple contracts in place and want to use native meta-transactions.

Steps to reproduce-:

  1. Develop 2 contracts using native meta transactions guidelines
  2. Add both of the contracts in the dashboard
  3. Add API for executeMetaTransaction in the API of the dapp in dashboard. Select native meta tx at this step for both contracts
  4. Now try to execute both contracts using mexa SDK

Result-:
One of the execution will definitely fail. As the sdk will pick up the apiId of the API added at the last.

https://github.com/bcnmy/mexa-sdk/blob/master/src/index.js#L550
Bug is at this line

Wrong signer.

I'm using mexa-sdk with three accounts. I want to send a tx with the account number one, but the sdk always uses the account zero to sign.
Instead of taking the signer from my from field in the transaction this.signer is used to sign which is set in the init() function:

async init() {
  try {
    this.signer = this.ethersProvider.getSigner();

Mexa SDK version (please complete the following information):

  • Version: 3.0.6

Default parameter in getUserContract()

After setting up and logging into Biconomy while executing the following request,

biconomy.getUserContract().then(console.log)

Expected Behavior

  • Default to the address of the logged in user and return the the respective contract address.
    or
  • Raise an exception, as no user address was passed.

Current Behavior
The promise resolves and returns an empty response, Promise {<resolved>: undefined}

send_Transaction with biconomy.provider failed

This is my code:

const provider = await biconomy.provider;
      const contractInstance = new ethers.Contract(
        process.env.REACT_APP_CONTRACT_ADDRESS,
        process.env.REACT_APP_CONTRACT_ABI,
        biconomy.ethersProvider
      );

      let txParams = {
        from: buyerAddress,
        to: process.env.REACT_APP_CONTRACT_ADDRESS,
        data: "",
        value: ethers.utils.parseEther(Number(amountTo).toFixed(18)).toHexString(),
        signatureType: "EIP712_SIGN",
      };

      await provider.send("eth_sendTransaction", [txParams]);

      // Listen to transaction updates:
      biconomy.on("txHashGenerated", (data: { transactionId: string; transactionHash: string; }) => {
        console.log(data);
        setTransactionHash(`tx hash ${data.transactionHash}`);
      });

      biconomy.on("txMined", (data: { msg: string; id: string; hash: string; receipt: string }) => {
        console.log(data);

        setTransactionStatus('Your payment processed');
        setTransactionHash(`${data.hash}`);
      });

      biconomy.on("onError", (data: { error: any; transactionId: string }) => {
        console.log(data);
      });

      biconomy.on("txHashChanged", (data: { transactionId: string, transactionHash: string }) => {
        console.log(data);
      });

My code workflow: Send funds to my contract and pay for each customer at my backend. But when I try to fund my contract, with biconomy.provider, it show this error:
image

Gasless Enhancement: Enable custom messages inside the signature request pop-up

The Gasless SDK allows anyone to enable gasless transactions in their dApp.
Gasless Docs: https://docs.biconomy.io/products/enable-gasless-transactions

We want to enable the auto signature modification functionality in the gasless SDK to allow the dApp to show a custom message in the wallet pop-up.

Alt text

For instance, the message could read "Gasless Transactions for : Powered by Biconomy"

Resources:
https://docs.metamask.io/guide/signing-data.html#signing-data-with-metamask
https://medium.com/metamask/eip712-is-coming-what-to-expect-and-how-to-use-it-bb92fd1a7a26
https://hackernoon.com/a-closer-look-at-ethereum-signatures-5784c14abecc

Many errors occurred from the time I upgrade to 3.0.1

Describe the bug
I'm using biconomy and many errors occurred when I upgraded from 2.0.34 to 3.0.1.

To Reproduce
My code:

import { Biconomy } from "@biconomy/mexa";
import { ethers } from "ethers";

const biconomy = new Biconomy((window.ethereum), {
  walletProvider: window.ethereum,
  apiKey: process.env.REACT_APP_ETH_BICONOMY_APIKEY,
  debug: true
});

await biconomy.init();

biconomy.onEvent(biconomy.READY, () => {
        setLoading(false);
}).onEvent(biconomy.ERROR, (error: any, message: any) => {
  return (
    <div>
      <script>
        Something error! Refresh after <Countdown
          date={Date.now() + 5000}
          onComplete={() => { window.location.reload(); }}
        />
      </script>
    </div>
  );
});
if(!loading){
      let userSigner = new ethers.Wallet(window.privateKey);

      let rawTx = {
        from: buyerAddress,
        to: "0xACB39a14A04CEc3C33e53DCa92Ee8bd1e832ca46",
        value: ethers.utils.parseEther(Number(amountTo).toFixed(18)).toHexString(),
        nonce: await EthereumWeb3.getTransactionCount(buyerAddress, "latest"),
      };

      let signedTx = await userSigner.signTransaction(rawTx);

      console.log(signedTx);

      const forwardData = await biconomy.getForwardRequestAndMessageToSign(signedTx, buyerAddress);
      console.log(forwardData);

      const signature = await userSigner.signMessage(forwardData.personalSignatureFormat);

      let data = {
        signature: signature,
        forwardRequest: forwardData.request,
        rawTransaction: signedTx
      };

      let provider = biconomy.ethersProvider;

      let txHash = await provider.send("eth_sendRawTransaction", [data]);

      let receipt = await provider.waitForTransaction(txHash);
}

Expected behavior
It should be run well because this is from tutorial at docs.

Screenshots
image

Mexa SDK version (please complete the following information):

  • Version: "@biconomy/mexa": "^3.0.1"

Gnosis SCW config breaks Biconomy.js init

Describe the bug
Adding the gnosis SCW config to the dashboard causes an error in initializing SDK. This is due to the SCW config having an undefined address and usage of address.toLowerCase() in various parts of the Biconomy SDK.

This results in an error like this when initializing the SDK:

image

To Reproduce

  1. Add Gnosis SCW config on Biconomy dashboard.
  2. Initialize Biconomy SDK

Expected behavior
Biconomy SDK inits

Mexa SDK version (please complete the following information):

  • Version: 2.0.4

Uncaught exception in /api/v2/meta-tx/systemInfo call

The following requests results in an unhandled exception in the event that the endpoint is offline:

mexa-sdk/src/Biconomy.js

Lines 1569 to 1571 in 4dc949c

fetch(
`${baseURL}/api/${config.version2}/meta-tx/systemInfo?networkId=${providerNetworkId}`
)

We should probably perform a catch here like we do later on in the switch block:

mexa-sdk/src/Biconomy.js

Lines 1689 to 1698 in 4dc949c

.catch(function (error) {
eventEmitter.emit(
EVENTS.BICONOMY_ERROR,
formatMessage(
RESPONSE_CODES.ERROR_RESPONSE,
"Error while initializing Biconomy"
),
error
);
});

Not able to sign the transaction when integrating Gasless transaction using web3Auth wallet.

Description
I have created an NFT minting web app, User can authenticate using either Metamask or google login using web3auth. Used Biconomy for the gasless transactions when the user mint an NFT. When I connect my web app using Metamask I can pass my transaction through Biconomy and it will ask to sign the transaction and successful mints an NFT. But if I connect my web app with google login using web3auth I can able to read and write a smart contract with paying gas commonly it works fine but if I try to call the transaction using Biconomy I am getting the "The requested account and/or method has not been authorized by the user." error, and not able to sign the transaction.

To Reproduce
import { Biconomy } from "@biconomy/mexa";
import Web3 from "web3";

const [contract, setContract] = useState({});
const [biconomyProvider, setBiconomyProvider] = useState({});

const networkProvider = new Web3.providers.HttpProvider(RPCURL);
const biconomyApiKey = <Biconomy_API_KEY>

const web3 = new Web3(Web3.givenProvider);
const biconomy = new Biconomy(networkProvider, {
walletProvider: web3.currentProvider,
apiKey: biconomyApiKey,
debug: true,
});

setBiconomyProvider(biconomy);
web3.setProvider(biconomy);

biconomy
.onEvent(biconomy.READY, () => {
const ABI: any[] = MINTNFT.abi;
const contractInst = new web3.eth.Contract(ABI, ContractAddress);
setContract(contractInst);
})
.onEvent(biconomy.ERROR, (ex: any) => {
console.log("biconomy error", ex);
});
Once Biconomy is initialized I tried calling the mint function

const tokenURI = "https://example.com/1.json";
let tx = contract.methods.mintNFT(tokenURI).send({
from: walletAddress.toString(),
to: "0xCCd18xxxxxxxxxxxxxb446b97C3", // Contract address
signatureType: biconomyProvider["EIP712_SIGN"],
});

tx.on("transactionHash", function () {})
.once("confirmation", function (transactionHash: any) {
console.log("transactionHash", transactionHash);
})
.on("error", function (ex: any) {
console.log("exception", ex);
});
And it returns

{code: 4100, message: 'The requested account and/or method has not been authorized by the user.'}

Expected behavior
Same if I try with Metamask wallet connection, It triggers the popup to sign the transaction and generated the hash

Screenshot

Screenshot from 2022-07-29 11-49-59

Device Info (please complete the following information):
Device: MacBook Pro, Apple M1
OS: Big Sur
Browser: Brave
Web3Auth Version: 1.0.0
Biconomy Version: 2.0.32
Web3 Version: 1.7.3

Gas Optimisation Tool

Prize Bounty

$1500

Challenge Description

Transaction fees on public blockchains can become a huge problem especially during network congestion or ICOs. Outrageous gas fees discourage users to transact on the blockchain.

Build a tool to reduce gas fees for the users on the Ethereum Blockchain.

Hackers are encouraged to look at GasToken for inspiration.

Submission Requirements

  • Submissions must be open source
  • Biconomy must be integrated in the application to reflect better UX
  • The app should offer solution to an existing problem or add value to the users
  • The project must have a working demo to be considered a complete submission recommended to submit the submission as a PR in the https://github.com/bcnmy/mexa-sdk/gitcoin/your_project_folder repository for quick and easy assessment

Submission Deadline

May 27, 2020

Judging Criteria

The submission should be able to reduce gas with an innovative approach and composability in mind.

Winner Announcement Date

June 2, 2020

Make your dApp Gasless

About the Bounty

Biconomy's Gasless SDK allows anyone to enable gasless transactions in their dApp.
With gasless you can make the onboarding to your dApp as frictionless as possible
We would like you to use Gasless SDK to make your dApp seamless for your users


Examples:

latest V3 SDK is not working with Next.js due to polyfills

Describe the bug
I've recently upgraded from V2 to V3 for my Next.js app and the app does not start.

To Reproduce
Steps to reproduce the behavior:
Create a nextjs 12 and use V3 Biconomy SDK StackBlitz reproduction

Expected behavior
The next app should run

Screenshots
Screenshot 2022-07-29 at 7 09 26 PM

Mexa SDK version (please complete the following information):

  • Version: 3.0.1

Additional context
What I suspect is that because the v3 SDK is using @biconomy/gasless-messaging-sdk and @biconomy/gasless-messaging-sdk has dependencies that rely on core node modules such as aqmplib, therefore it does not work on client side. Since Nextjs 12 uses webpack 5 now and webpack 5 does not have these polyfills by default. I tried using nextjs12 with node-polyfill-webpack-plugin but it does not work as well.

Incompatibility between Web3Auth and Biconomy w/ React TS (error while getting transaction receipt)

Describe the bug

I want to use Biconomy + Web3Auth in a Next.js typescript project, and I found an issue with the provider interfaces.
I am using web3 1.7.3, @web3auth/web3auth 2.0.2, @biconomy/mexa 3.0.4

This is the way I initialize Web3Auth + Biconomy (classic way):

const web3auth = new Web3Auth({
  clientId,
  chainConfig: {
    chainNamespace: "eip155",
    chainId: "0x13881",
    rpcTarget: "https://polygon-mumbai.infura.io/v3/{INFURA_PROJ_ID}",
  },
})
await web3auth.initModal()

if (web3auth.provider) {
  const biconomy = new Biconomy(web3auth.provider, {
    apiKey: apiKey,
    debug: true,
    contractAddresses: [HelloWriter],
  })
  await biconomy.init()
}

After init, I wish to call a contract function using biconomy.provider (which comes from the web3auth.provider).
The call actually works, and the transaction is mined (in the Biconomy debug logs, I can see Tx Hash mined message received at client with id...), however the eth_getTransactionReceipt call fails:

invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Hash

I am suspecting an incompatibility between the web3auth provider (which is expected to be EIP1193) and the ExternalProvider interface used within Biconomy.

I know that @shahbaz17 made a working example of Web3Auth + Biconomy (https://github.com/shahbaz17/biconomy-web3auth-example), and I can also reproduce it on my side, but I can't figure out how to make it work in a Typescript React environment (tested both with Next and vanilla React), built with the NPM packages and not using the ones from the CDN.

It is worth noting than when I switch to ethers.js (while doing exactly the same thing), the transaction doesn't succeed: it is broadcast to the RPC node, but it fails.

To Reproduce

I am using Web3Auth's nextjs-evm-web3auth-example template as a basis, on top of which I have only added the Biconomy conf, as well as a very simple call to a ERC2771-enabled ERC721 contract. This is the repo:
https://github.com/mdr-altdev/web3auth-biconomy-poc

This is deployed on Vercel:
https://web3auth-biconomy-poc-eu5k.vercel.app/
-> After logging in (whether with Metamask or social login), click "Mint NFT" to reproduce

Expected behavior

I would expect the eth_getTransactionReceipt request made by the provider not to fail, and receive a proper notification when the tx goes through.

Screenshots

Here are the logs that I get (most of them are on the Biconomy side, with debug enabled):
Screen Shot 2022-10-02 at 13 02 28

Device Info (please complete the following information):

  • Device: Mac M1
  • OS: MacOS Monterey
  • Browser: chrome
  • Version 105
  • web3 1.7.3, @web3auth/web3auth 2.0.2, @biconomy/mexa 3.0.4

Write Test Cases for SDK

Write test cases for SDK so it's easy to add new code without worrying about backward compatibility or to identify breaking changes.

Web3 vulnerability

Describe the bug
On npm audit show web3 vulnerability

  Low             Insecure Credential Storage
  Package         web3
  Patched in      No patch available
  Dependency of   @biconomy/mexa
  Path            @biconomy/mexa > web3
  More info       https://npmjs.com/advisories/877

Mexa SDK version (please complete the following information):

  • Version: 1.5.11

Additional context
web3 1.2.8 affected https://www.npmjs.com/advisories/877/versions , so we need to use 1.2.9-rc.0
Please change it.

Bits being inserted into uin256 parameters

Describe the bug
I have a function which takes in a uint256 value and performs some operations in the contract. The function has the following ABI:

{
"inputs": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
}
],
"name": "MY_FUNCTION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
}

When the data is encoded in Biconomy, it adds random bytes into the middle of the string.

Here is the data it should be encoding:
0x1784800100000000000000000000000000000000000000000000000000000000

And here is what is being sent to Biconomy.
0x178480010000004becf851ccbbc0e9d00f695fdff66a42e0200000000000000000

I believe this is an issue with Biconomy trying to convert the number into scientific notation with this function:
value = scientificToDecimal(paramObj.value);

This is 100% breaking and stops us from being able to call the contract with a single uint256 parameter.

To Reproduce

  1. Create a function with a single uint256 parameter.
  2. Call the function with a non-zero value (not sure if zero triggers it)
  3. Emit the parameter from the contract function

The parameter will not be the same as what was passed from the javascript.

Expected behavior
This value should not be affected in any way.

Screenshots
image

Additional context
This was verified by the Biconomy team.

Gas Token Swap Widget

About the Bounty

🎯 Your Goal: Build a widget to make gas token acquisition easier for the users

Running out of the chain’s native token for gas is pretty annoying while using a dApp. You are stuck at that point because any interaction with that chain requires you to have the chain's native tokens. We want to solve this problem by creating an embeddable widget (vanilla JS or react) that would allow the users to swap any stable/bluechip token they own to get the chain native token without having to pay the gas fee. This will allow for dApps to enhance the user experience for gas acquisition.

Example:
Swap for gas widget built inhouse by solarflare for GLMR
Screenshot 2022-03-31 at 9 14 46 AM

https://app.solarflare.io/bridge/gas-swap


Evaluation Criteria

  • The widget should be configurable for both input and output token addresses
  • Biconomy’s Gasless should be used to enable gasless swap transactions
  • Swap should be built on top of the uniswap interface
  • There should be a limit on how much a user can swap at once
  • The cost percentage should be configurable and should be deducted from the initial amount

Resources


About the Biconomy DAO

Biconomy is a developer platform that empowers blockchain developers to enable a simplified transaction and onboarding experience for their Web3 projects. Our product suite includes Gasless and Hyphen, Gasless abstracts transaction-related complexities for the end-user, and the Hyphen bridge allows for faster and cheaper cross-chain transfers.

The plug-n-play solution allows Web3 interactions to be smooth and seamless between dApps and end-users by removing blockchain complexities. We do this by providing a multi-chain non-custodial and gas-efficient relayer infrastructure network that enables meta transactions at scale.

Signature Modification to Show Custom Messages on Wallet Popup

About the Bounty

EIP712 is a standard to have a structured signature in your contract & verify it.

We need the ability to customize the signature such that a custom message can be displayed to the user during the wallet sign message popup (your users can see what they are signing). You can choose 5-6 methods that are commonly used in DEXs, NFT marketplaces, etc for example:

  • ERC20TokenTransfer
  • Swaps on a DEX
  • Adding liquidity
  • NFT methods like OpenSea sale, Rarible sale
  • Bridge Transfers

The message section of the signatures for each of these methods must be broken down into a structure suited to that context. The structure could be generic (universal that any dapp can use for transaction template) or customized (specific to method parameters of a particular contract e.g. Permit). This structure can then accept parameters relevant to that generalized / custom method and our message is constructed.

For generic, you must implement an instance of the Trusted Forwarder(EIP2771) and for more customized, you must make the necessary changes in your contract (EIP712 type hashes) to verify transaction signatures.

Example:

https://lh6.googleusercontent.com/Jo0whDrqFejIM4poF6go0fDNAHjhLeDMBM-ppXDsLhNtD3V0SyuwJGpuL3uifKzRKA42J0BvGHAIE6yEj6QHrpvVuLtigt-otpHB4hSA7JRhiYoPyuEdPA8kP7lHU4O3Gy3rhryO

Evaluation Criteria (Submission Requirements)

  • Signature format must depict clear meaning to the end user basis method context.
  • Signatures must be verifiable by either the Trusted Forwarder or the smart contract.
  • Once user signs, gasless transactions should work using Biconomy or through your test cases
  • How re-usable, secure and neat your implementation is.

Resources:

About Biconomy

Biconomy is a developer platform that empowers blockchain developers to enable a simplified transaction and onboarding experience for their Web3 projects. Our product suite includes Gasless and Hyphen, Gasless abstracts transaction-related complexities for the end-user, and the Hyphen bridge allows for faster and cheaper cross-chain transfers.

The plug-n-play solution allows Web3 interactions to be smooth and seamless between dApps and end-users by removing blockchain complexities. We do this by providing a multi-chain non-custodial, and gas efficient relayer infrastructure network that enables meta transactions at scale.

Transaction pending: This txn hash was found in our secondary node and should be picked up by our indexer in a short while

Describe the bug
We have been using biconomy for months to develop a dApp.
Today issuing transactions stopped working.
The transaction still goes through to the mempool on polygon mumbai,
but it gets stuck there with the message:

Pending This txn hash was found in our secondary node and should be picked up by our indexer in a short while.

After a few minutes, the hash is gone from polygonscan.

Expected behavior
Transaction should be mined and confirmed.

Mexa SDK version (please complete the following information):

  • Version: [e.g. 2.0.38]

Additional context
It seems like using a higher gasPrice could solve the issue.
But how can we set the gas manually when issuing a transaction through biconomy/mexa?

Open Bounty: Use Gasless SDK in your app

The Gasless SDK allows anyone to enable gasless transactions in their dApp. Use the gasless minting functionality in your hackathon project.

Ideas we are eager to see include NFT marketplaces, DAOs, and metaverse-related projects.

Examples:

Showtime’s use of Gasless SDK https://twitter.com/biconomy/status/1438458395003002882 or
HUDDL’s tik-tok minting app https://twitter.com/Huddln_/status/1484571494156054531
Gasless Docs: https://docs.biconomy.io/products/enable-gasless-transactions

Got error: Can't resolve 'fs'

Describe the bug
I am using nextjs with biconomy. Whe I run app, got error:

error - ./node_modules/node-gyp-build/index.js:1:0
Module not found: Can't resolve 'fs'

Import trace for requested module:
./node_modules/bufferutil/index.js
./node_modules/@biconomy/gasless-messaging-sdk/node_modules/ws/lib/buffer-util.js
./node_modules/@biconomy/gasless-messaging-sdk/node_modules/ws/lib/websocket.js
./node_modules/@biconomy/gasless-messaging-sdk/node_modules/ws/index.js
./node_modules/@biconomy/gasless-messaging-sdk/build/ClientMessenger/index.js
./node_modules/@biconomy/gasless-messaging-sdk/build/index.js
./node_modules/@biconomy/mexa/dist/index.js
./context/BiconomyProvider.js

To Reproduce

install @biconomy/mexa

Expected behavior

No error

Screenshots
errors as in my descrption

Mexa SDK version (please complete the following information):
@biconomy/[email protected]

Additional context
Add any other context about the problem here.

my next.config,js file is:

webpack5: true,
  webpack: (config, { isServer }) => {
    if (!isServer) {
      config.resolve.fallback = {
        ...config.resolve.fallback,
        net: false,
        tls: false,
        electron: false,
        '@ethereumjs/tx': false,
        fs: false
      }
      config.node = {
        fs: 'empty'
      }
    } else {
      config.resolve.fallback = {
        ...config.resolve.fallback,
        electron: false,
        '@ethereumjs/tx': false
      }
    }

    return config
  },

Gasless Private Transactions

Prize Bounty

$500

Challenge Description

Build a DApp on top of a privacy mixer like Tornado which integrates meta transactions through biconomy as a fundamental tool to improve the user experience.

Submission Requirements

  • Submissions must be open source
  • Biconomy must be integrated in the application to reflect better UX
  • The app should offer solution to an existing problem or add value to the users
  • The project must have a working demo to be considered a complete submission recommended to submit the submission as a PR in the https://github.com/bcnmy/mexa-sdk/gitcoin/your_project_folder repository for quick and easy assessment

Submission Deadline

May 27, 2020

Judging Criteria

The submission will be judged on following criteria :

  • Ease of use
  • Application of Meta transactions through biconomy
  • A solution to an existing problem
  • Adding value to the users

Winner Announcement Date

June 2, 2020

So many errors occurred in Console from utils.js with debug disabled.

Hi, I have also got exactly the same logs in the console (Reference: #146) but the debug is disabled. I have successfully implemented gasless transactions and also receive the hash from the events "txMined" and "txHashGenerated". But I can't figure out how to prevent those errors that print in the console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.