Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/getting-started/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALCHEMY_RPC_URL= # e.g. https://eth-sepolia.g.alchemy.com/v2/XXXXX
BUNDLER_RPC_URL= # optional if repo provides a bundler URL
PRIVATE_KEY= # ONLY for local testing (use a throwaway key)
20 changes: 20 additions & 0 deletions examples/getting-started/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "aa-sdk-getting-started",
"private": true,
"type": "module",
"scripts": {
"build": "tsc -p tsconfig.json",
"start": "node dist/index.js",
"dev": "ts-node src/index.ts"
},
"dependencies": {
"@alchemy/aa-core": "workspace:*",
"@alchemy/aa-ethers": "workspace:*",
"ethers": "^6.10.0",
"dotenv": "^16.4.0"
},
"devDependencies": {
"ts-node": "^10.9.2",
"typescript": "^5.4.0"
}
}
11 changes: 11 additions & 0 deletions examples/getting-started/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'dotenv/config';
import { version as ethersVersion } from 'ethers';
import pkgCore from '@alchemy/aa-core/package.json' assert { type: 'json' };

console.log('Ethers version:', ethersVersion);
console.log('@alchemy/aa-core version:', pkgCore.version);

// TODO: Expand this example in a follow-up PR to show a minimal userOp:
// 1) Create client
// 2) Fund / sponsor gas (if required)
// 3) Send a user operation and log hash
12 changes: 12 additions & 0 deletions examples/getting-started/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "Bundler",
"esModuleInterop": true,
"strict": true,
"outDir": "dist",
"skipLibCheck": true
},
"include": ["src"]
}