Giter Site home page Giter Site logo

sdk-examples's Introduction

SDK by Example

This repository contains a set of examples that demonstrate how to use the Biconomy SDk smart-account to build decentralised applications. The SmartAccount package generates a smart wallet contract for each user EOA. It takes a provider, provider can be anything, here we have different examples of providers.

Important Links

Examples

Project Library Provider
backend-node-cli Node.js smart-account
react-biconomy-web3Auth React.js biconomy-web3Auth
react-vite-social-login React.js + vite.js biconomy-web3Auth
nextjs-biconomy-web3Auth Next.js biconomy-web3Auth
react-vite-particle-auth React.js + vite.js biconomy-particleAuth
react-native-web3Auth React Native biconomy-web3Auth-native
react-native-smartAccount React Native ethers (private key)
nextjs-rainbow Next.js rainbow wallet
nextjs-web3modal Next.js web3Modal
vuejs-biconomy-web3auth Vue.js + vite.js biconomy-web3Auth
nextjs-biconomy-web3Auth-nextAuth-siwe Next.js + NextAuth.js biconomy-web3Auth + siwe

sdk-examples's People

Contributors

amanraj1608 avatar arcticfloyd1984 avatar livingrockrises avatar sebpalluel avatar talhamalik883 avatar tomarsachin2271 avatar vanshika-srivastava avatar

Stargazers

 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

sdk-examples's Issues

react_native_smartAccount doesn't works for Android

Hi, I tried using this example to set up react-native Smart Accounts . I think Biconomy SDK can't be used in React Native for Android due to Gradle depriciation issues. is there any walkthrough for this ?

I would like to change the uxMode from "popup" to "redirect"

Hi, I would like to change the uxMode of web3 auth from "popup" to "redirect", as the popup may blocked by some of the web browser's settings. But, I found in the lib code that the uxMode is hardcoded as popup. Is there any ways to change the logintype from popup to redirect.

LIB: "@biconomy/web3-auth"

poup

Thanks in advance,
Sivasankar

Getting error while running yarn run smartAccount address

While setting this repo i run into below error while running the command yarn run smartAccount address

$ ts-node scripts/index.ts address
/Users/sachintomar/github/sdk-examples/backend-node/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
scripts/gasless/parallelUserOpsMintNFT.ts:18:37 - error TS2339: Property 'numOfParallelUserOps' does not exist on type '{ privateKey: string; accountIndex: number; chainId: number; rpcUrl: string; bundlerUrl: string; biconomyPaymasterUrl: string; preferredToken: string; tokenList: never[]; }'.

18 const numOfParallelUserOps = config.numOfParallelUserOps;
                                       ~~~~~~~~~~~~~~~~~~~~

    at createTSError (/Users/sachintomar/github/sdk-examples/backend-node/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/Users/sachintomar/github/sdk-examples/backend-node/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/Users/sachintomar/github/sdk-examples/backend-node/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/Users/sachintomar/github/sdk-examples/backend-node/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/Users/sachintomar/github/sdk-examples/backend-node/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/sachintomar/github/sdk-examples/backend-node/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1115:32)
    at Function.Module._load (node:internal/modules/cjs/loader:962:12)
    at Module.require (node:internal/modules/cjs/loader:1139:19) {
  diagnosticCodes: [ 2339 ]
}
error Command failed with exit code 1.

Reproduction steps

  1. Git clone repository
  2. Go to backend-node folder
  3. Run yarn
  4. Run yarn run smartAccount init --network=arbitrum-one-mainnet
  5. Run yarn run smartAccount address

Social Login Sdk Provider is Null

I tried my own and also used : nextjs-biconomy-web3Auth/components/scw.tsx code

but when:

 const sdk = new SocialLogin();
 await sdk.init();
 setSocialLoginSDK(sdk);

sdk instance was created but in the response of the sdk instance provider is getting null, even after called await sdk.init(); also getting provider as null.

I can't able to call the Google Login , Facebook login and Continuew with email options
when I trigger any of these options, getting error as:

WalletLoginError: Failed to connect with walletWallet adapter is not ready yet, Please wait for init function to resolve before calling connect/connectTo function
    at Function.fromCode (base.esm.js:375:1)
    at Function.connectionError (base.esm.js:381:1)
    at OpenloginAdapter.checkConnectionRequirements (base.esm.js:497:1)
    at OpenloginAdapter._callee2$ (openloginAdapter.esm.js:163:37)
    at tryCatch (regeneratorRuntime.js:44:1)
    at Generator.eval (regeneratorRuntime.js:125:1)
    at Generator.eval [as next] (regeneratorRuntime.js:69:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:22:1)
    at eval (asyncToGenerator.js:27:1)
    at new Promise (<anonymous>)
    at OpenloginAdapter.eval (asyncToGenerator.js:19:1)
    at OpenloginAdapter.connect (openloginAdapter.esm.js:195:1)
    at Web3AuthCore._callee2$ (core.esm.js:145:1)
    at tryCatch (regeneratorRuntime.js:44:1)
    at Generator.eval (regeneratorRuntime.js:125:1)
    at Generator.eval [as next] (regeneratorRuntime.js:69:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:22:1)
    at eval (asyncToGenerator.js:27:1)
    at new Promise (<anonymous>)
    at Web3AuthCore.eval (asyncToGenerator.js:19:1)
    at Web3AuthCore.connectTo (core.esm.js:157:1)
    at SocialLogin.socialLogin (SocialLogin.js:185:1)
    at onClick (UI.js:65:67)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
    at invokeGuardedCallback (react-dom.development.js:4277:1)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
    at executeDispatch (react-dom.development.js:9041:1)
    at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1)
    at processDispatchQueue (react-dom.development.js:9086:1)
    at dispatchEventsForPlugins (react-dom.development.js:9097:1)
    at eval (react-dom.development.js:9288:1)
    at batchedUpdates$1 (react-dom.development.js:26140:1)
    at batchedUpdates (react-dom.development.js:3991:1)
    at dispatchEventForPluginEventSystem (react-dom.development.js:9287:1)
    at dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay (react-dom.development.js:6465:1)
    at dispatchEvent (react-dom.development.js:6457:1)
    at dispatchDiscreteEvent (react-dom.development.js:6430:1)
console.error @ client.js:1
window.console.error @ next-dev.js:27
overrideMethod @ react_devtools_backend_compact.js:2367
socialLogin @ SocialLogin.js:201
await in socialLogin (async)
onClick @ UI.js:65
callCallback @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
eval @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26140
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430

but when I trigger Continue using metamask, again connectWeb3() method is called now I am getting provider in sdk instance, So I can able to logged in and its Smart account also created.

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.