Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:
concurrency: 0
timeout: 10m
issues-exit-code: 1
tests: true
tests: false

output:
formats:
Expand Down Expand Up @@ -32,6 +32,7 @@ linters:
# You can't disable typecheck, see:
# https://github.com/golangci/golangci-lint/blob/master/docs/src/docs/welcome/faq.mdx#why-do-you-have-typecheck-errors
- unconvert
- bodyclose
settings:
errcheck:
check-type-assertions: false
Expand All @@ -46,6 +47,9 @@ linters:
goconst:
min-len: 3
min-occurrences: 2
gosec:
excludes:
- G115

formatters:
exclusions:
Expand Down
89 changes: 86 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,42 @@ go get github.com/status-im/go-wallet-sdk
- Smart fallback between different fetching methods
- Chain-agnostic design

- **`pkg/multicall`**: Efficient batching of contract calls using Multicall3
- Batch multiple contract calls into single transactions
- Support for ETH, ERC20, ERC721, and ERC1155 balance queries
- Automatic chunking and error handling
- Synchronous and asynchronous execution modes

### Ethereum Client
- **`pkg/ethclient`**: Full-featured Ethereum client with go-ethereum compatibility
- Complete RPC method coverage (eth_*, net_*, web3_*)
- Go-ethereum ethclient compatible interface for easy migration
- Chain-agnostic methods for any EVM-compatible network

### Gas Estimation
- **`pkg/gas`**: Comprehensive gas fee estimation and suggestions
- Smart fee estimation for three priority levels (low, medium, high)
- Transaction inclusion time predictions
- Multi-chain support (L1, Arbitrum, Optimism, Linea)
- Network congestion analysis for L1 chains
- Chain-specific optimizations

### Event Filtering & Parsing
- **`pkg/eventfilter`**: Efficient event filtering for ERC20, ERC721, and ERC1155 transfers
- Minimizes eth_getLogs API calls
- Direction-based filtering (send, receive, both)
- Concurrent query processing

- **`pkg/eventlog`**: Automatic event log detection and parsing
- Type-safe access to parsed event data
- Support for Transfer, Approval, and other standard events
- Works seamlessly with eventfilter

### Smart Contract Bindings
- **`pkg/contracts`**: Go bindings for smart contracts
- Multicall3 with 200+ chain deployments
- ERC20, ERC721, and ERC1155 token standards
- Automated deployment address management

### Common Utilities
- **`pkg/common`**: Shared utilities and constants used across the SDK
Expand All @@ -43,6 +75,32 @@ cd examples/ethclient-usage
go run .
```

### Gas Comparison Tool

```bash
cd examples/gas-comparison

# Test with local mock data
go run . -fake

# Test with real networks (requires Infura API key)
go run . -infura-api-key YOUR_API_KEY
```

### Multicall Usage

```bash
cd examples/multiclient3-usage
go run .
```

### Event Filter Example

```bash
cd examples/eventfilter-example
go run . -account 0xYourAddress -start 19000000 -end 19100000
```

## Testing

```bash
Expand All @@ -54,18 +112,43 @@ go test ./...
```
go-wallet-sdk/
β”œβ”€β”€ pkg/ # Core SDK packages
β”‚ β”œβ”€β”€ balance/ # Balance-related functionality
β”‚ β”œβ”€β”€ balance/ # Balance fetching functionality
β”‚ β”œβ”€β”€ multicall/ # Multicall3 batching
β”‚ β”œβ”€β”€ ethclient/ # Ethereum client with full RPC support
β”‚ β”œβ”€β”€ gas/ # Gas estimation and fee suggestions
β”‚ β”œβ”€β”€ eventfilter/ # Event filtering for transfers
β”‚ β”œβ”€β”€ eventlog/ # Event log parsing
β”‚ β”œβ”€β”€ contracts/ # Smart contract bindings
β”‚ └── common/ # Shared utilities
β”œβ”€β”€ examples/ # Usage examples
└── README.md # This file
β”‚ β”œβ”€β”€ balance-fetcher-web/ # Web interface for balance fetching
β”‚ β”œβ”€β”€ ethclient-usage/ # Ethereum client examples
β”‚ β”œβ”€β”€ gas-comparison/ # Gas fee comparison tool
β”‚ β”œβ”€β”€ multiclient3-usage/ # Multicall examples
β”‚ β”œβ”€β”€ multistandardfetcher-example/ # Multi-standard balance fetching
β”‚ └── eventfilter-example/ # Event filtering examples
└── README.md # This file
```

## Documentation

### Package Documentation
- [Balance Fetcher](pkg/balance/fetcher/README.md) - Balance fetching functionality
- [Multicall](pkg/multicall/README.md) - Efficient contract call batching
- [Ethereum Client](pkg/ethclient/README.md) - Complete Ethereum RPC client
- [Web Example](examples/balance-fetcher-web/README.md) - Complete web application
- [Gas Estimation](pkg/gas/README.md) - Gas fee estimation and suggestions
- [Event Filter](pkg/eventfilter/README.md) - Event filtering for transfers
- [Event Log Parser](pkg/eventlog/README.md) - Event log parsing

### Example Documentation
- [Web Balance Fetcher](examples/balance-fetcher-web/README.md) - Web interface for balance fetching
- [Ethereum Client Usage](examples/ethclient-usage/README.md) - Ethereum client examples
- [Gas Comparison](examples/gas-comparison/README.md) - Gas fee comparison tool
- [Multicall Usage](examples/multiclient3-usage/README.md) - Multicall examples
- [Event Filter Example](examples/eventfilter-example/README.md) - Event filtering examples

### Specifications
- [Technical Specifications](docs/specs.md) - Complete SDK specifications and architecture

## Contributing

Expand Down
Loading
Loading