Skip to content

Instantly share code, notes, and snippets.

View himanshugarg06's full-sized avatar
🎯
Focusing

Himanshu garg himanshugarg06

🎯
Focusing
View GitHub Profile
@himanshugarg06
himanshugarg06 / bicoturnkey.ts
Created November 14, 2024 06:26
Biconomy turnkey integration documentation
import { http } from "viem";
import { baseSepolia } from "viem/chains";
import { ApiKeyStamper, DEFAULT_ETHEREUM_ACCOUNTS, Turnkey } from "@turnkey/sdk-server";
import { TurnkeyClient } from "@turnkey/http";
import { createNexusClient } from "@biconomy/sdk";
import { NexusClient } from "@biconomy/sdk";
import { createAccount } from "@turnkey/viem";
import { TurnkeySigner } from "@turnkey/ethers";
@himanshugarg06
himanshugarg06 / passkeyModule.ts
Created October 9, 2024 05:07
Passkey module for biconomy smart account v2
'use client';
import {
BaseValidationModule,
BaseValidationModuleConfig,
convertSigner,
ModuleVersion,
SmartAccountSigner,
SupportedSigner
} from '@biconomy/account';
@himanshugarg06
himanshugarg06 / sei.ts
Created October 7, 2024 09:50
Biconomy Smart accounts on sei network
import {
Hex,
createWalletClient,
encodeFunctionData,
http,
parseAbi,
} from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { sei } from "viem/chains";
@himanshugarg06
himanshugarg06 / kakarot.ts
Created September 25, 2024 17:46
kakarot sponsored transaction example
import { Hex, createWalletClient, encodeFunctionData, http, parseAbi, parseEther } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { kakarotSepolia } from "viem/chains";
import { createSmartAccountClient, DEFAULT_ECDSA_OWNERSHIP_MODULE, ECDSA_OWNERSHIP_MODULE_ADDRESSES_BY_VERSION, PaymasterMode } from "@biconomy/account";
const createAccountAndMintNft = async () => {
const config = {
privateKey: "",
biconomyPaymasterApiKey: "8U2pVvfD7.534f005f-8b18-4904-a643-d69f4935f2a4",
@himanshugarg06
himanshugarg06 / privyBiconomy.ts
Created September 19, 2024 14:02
Privy embedded smart account wallets
import React, { useState, useEffect } from "react";
import { ConnectedWallet, usePrivy, useWallets } from "@privy-io/react-auth";
import "react-toastify/dist/ReactToastify.css";
import { polygon } from "viem/chains";
import { useSmartWallets } from "@privy-io/react-auth/smart-wallets";
import { parseEther } from "viem";
export default function Home() {
const [chainSelected, setChainSelected] = useState(0);
const [smartWallet, setSmartWallet] = useState<ConnectedWallet | null>(null);

We’re excited to support your migration to Biconomy! This guide will walk you through the steps and any necessary adjustments for your setup, while highlighting the benefits of our stack.

Built on top of ERC 4337, we offer a full-stack solution for tapping into the power of our Smart Accounts Platform, Paymasters, and Bundlers. Checkout the list of supported networks for our Bundlers and Paymasters.

Migration Steps:

  1. Create biconomy bundler client: With Biconomy, you can utilize our Bundler infrastructure through either the SDK or API requests. Follow the official guide to set up the bundler client. You can find the Biconomy Bundler URL here.

  2. Setup paymaster: Biconomy's paymaster service enables Dapps to sponsor transactions and, also allows users to use ERC-20 tokens as payment for gas. Log in to the Biconomy dashboard to get the paymaster URL

@himanshugarg06
himanshugarg06 / safeSA-Bicobundler-ERC20paymaster.ts
Created August 22, 2024 06:47
Mint transaction using Safe smart account, biconomy bundler and ERC20 paymaster
// Safe smart accounts with Biconomy Bundler and Paymaster SDK
import { ENTRYPOINT_ADDRESS_V06, UserOperation } from "permissionless";
import {
SafeSmartAccount,
signerToSafeSmartAccount,
} from "permissionless/accounts";
import {
Chain,
createClient,
@himanshugarg06
himanshugarg06 / viem-bico-intergation.ts
Created August 13, 2024 06:46
An example of ERC 4337 transaction using viem SDK and Biconomy bundler and paymaster
import { createPublicClient, http, parseEther } from 'viem';
import { createBundlerClient, toCoinbaseSmartAccount, createPaymasterClient, toSoladySmartAccount } from 'viem/account-abstraction';
import { sepolia } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';
const main = async () => {
const client = createPublicClient({
chain: sepolia,
transport: http(),
})
const { smartAccountAddress } = useSmartAccount();
const {
mutate,
data: userOpResponse,
error,
isPending,
} = useSendGasTokenTransaction();
const {
@himanshugarg06
himanshugarg06 / safeAccountBicoInfra.ts
Last active July 2, 2024 10:42
Safe smart account integration with Biconomy Bundler and paymaster SDK
import { ENTRYPOINT_ADDRESS_V06, UserOperation } from "permissionless";
import {
SafeSmartAccount,
signerToSafeSmartAccount,
} from "permissionless/accounts";
import {
Chain,
createClient,
createPublicClient,
encodeFunctionData,