Replies: 4 comments 2 replies
-
Does Because I am able to login. Also refer to https://docs.biconomy.io/sdk/biconomy-sdk-mexa to use biconomy |
Beta Was this translation helpful? Give feedback.
-
Looking at the SDK, Biconomy constructor takes import {Biconomy} from '@biconomy/mexa' // version ^3.0.3
const biconomy = new Biconomy(provider: ExternalProvider, options: OptionsType) (alias) type ExternalProvider = {
isMetaMask?: boolean | undefined;
isStatus?: boolean | undefined;
host?: string | undefined;
path?: string | undefined;
sendAsync?: ((request: {
method: string;
params?: Array<any>;
}, callback: (error: any, response: any) => void) => void) | undefined;
send?: ((request: {
method: string;
params?: Array<any>;
}, callback: (error: any, response: any) => void) => void) | undefined;
request?: ((request: {
method: string;
params?: Array<any>;
}) => Promise<any>) | undefined;
}
import ExternalProvider
export type OptionsType = {
apiKey: string,
debug?: boolean,
strictMode?: boolean,
jsonRpcUrl?: string,
contractAddresses: string[],
}; |
Beta Was this translation helpful? Give feedback.
-
@shahbaz17 was this resolved? |
Beta Was this translation helpful? Give feedback.
-
Looking at the code here, you'll have to use an additional const biconomy = new Biconomy(web3auth.provider, {
apiKey: 'NuSSxYDAx.3de630c2-75c8-4d87-a684-8a66bd1b7117',
debug: true,
contractAddresses: ['0x3888b4606f9f12ee2e92f04bb0398172bb91765d'], // smart contract address
})
window.web3biconomy = new Web3(biconomy) And while making a write operation (involving fee), use this const writeContract = async () => {
if (!provider) {
uiConsole('provider not initialized yet')
return
}
const web3 = window.web3biconomy // <-- See this line.
const fromAddress = (await web3.eth.getAccounts())[0]
const contractABI =
'[ { "inputs": [ { "internalType": "string", "name": "initMessage", "type": "string" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ { "internalType": "string", "name": "newMessage", "type": "string" } ], "name": "update", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "message", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" } ]'
const contractAddress = '0x3888B4606F9f12eE2e92f04Bb0398172BB91765d'
const contract = new web3.eth.Contract(
JSON.parse(contractABI),
contractAddress,
)
// Send the transaction to the smart contract to update the message and wait to finish
const receipt = await contract.methods
.update('Journey to Web3Auth begins.')
.send({
from: fromAddress,
})
return receipt
} |
Beta Was this translation helpful? Give feedback.
-
When integrating web3auth with Biconomy (Gasless meta-transactions), we are experiencing errors ( most probably due to proxy[provider] of web3auth), while when we are using metamask or any other wallet like coinbase we do not face any error. here is a sample for explaining above issue. [two method showing error in sample must be work to enable meta-transactions] https://anand-nftically.github.io/gasless-web3auth
Asked by
Anand Bhatnagar
on telegram.Source code: https://github.com/anand-nftically/gasless-web3auth
Beta Was this translation helpful? Give feedback.
All reactions