Skip to content

Commit

Permalink
Update mint-collectibles-serverless.mdx (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnybones1 authored Nov 4, 2024
1 parent 0a01539 commit e334820
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions docs/pages/guides/mint-collectibles-serverless.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,11 @@ import { ethers } from "ethers";

// Or, use an existing EOA private key
const privateKey = "";
const provider = new ethers.providers.JsonRpcProvider(
"https://nodes.sequence.app/mainnet"
);

// Create your server EOA
const walletEOA = new ethers.Wallet(privateKey, provider);

// Open a Sequence session, this will find or create
// a Sequence wallet controlled by your server EOA
const session = await Session.singleSigner({
signer: walletEOA,
signer: privateKey,
projectAccessKey: "access_key",
});

Expand Down Expand Up @@ -407,18 +401,14 @@ const callContract = async (request: Request, env: Env, address: string, tokenId

const nodeUrl = `https://nodes.sequence.app/${env.CHAIN_HANDLE}`
const relayerUrl = `https://${env.CHAIN_HANDLE}-relayer.sequence.app`
const provider = new ethers.providers.JsonRpcProvider({ url: nodeUrl, skipFetchSetup: true })
const contractAddress = env.CONTRACT_ADDRESS
const contractAddress = env.CONTRACT_ADDRESS

// create EOA from private key
const walletEOA = new ethers.Wallet(env.PKEY, provider);

// instantiate settings
const settings: Partial<SessionSettings> = {
networks: [{
...networks[findSupportedNetwork(env.CHAIN_HANDLE)!.chainId],
rpcUrl: findSupportedNetwork(env.CHAIN_HANDLE)!.rpcUrl,
provider: provider,
relayer: {
url: relayerUrl,
provider: {
Expand All @@ -431,7 +421,7 @@ const callContract = async (request: Request, env: Env, address: string, tokenId
// create a single signer sequence wallet session
const session = await Session.singleSigner({
settings: settings,
signer: walletEOA,
signer: env.PKEY,
projectAccessKey: env.PROJECT_ACCESS_KEY
})

Expand Down

0 comments on commit e334820

Please sign in to comment.