|
1 | 1 |
|
| 2 | + |
2 | 3 | # Custom Alerts for Wallet Activities |
3 | 4 |
|
4 | 5 |
|
@@ -62,6 +63,45 @@ Create a `config.yaml` file in the root directory with the following content: |
62 | 63 |
|
63 | 64 | ```sh |
64 | 65 | client, err := ethclient.Dial("wss://mainnet.infura.io/ws/v3/YOUR_INFURA_PROJECT_ID") |
65 | | -2. **Run the application**: |
| 66 | +2. **Configure user preferences** |
| 67 | +
|
| 68 | + userPreference := &models.UserPreference{ |
| 69 | + UserID: "user@example.com", |
| 70 | + WalletAddress: "0x...", |
| 71 | + MinEtherValue: "1000000000000000000", // 1 ETH |
| 72 | + TrackNFTs: true, |
| 73 | + EmailNotification: true |
| 74 | + }) |
| 75 | + |
| 76 | +3. **Run the application**: |
| 77 | + ```sh |
| 78 | + go run main.go |
| 79 | +## Testing |
| 80 | + |
| 81 | +1. **Run all tests**: |
| 82 | + |
| 83 | + ```sh |
| 84 | + go test ./... -v |
| 85 | +2. **Run specific tests**: |
| 86 | +
|
66 | 87 | ```sh |
67 | | - go run main.go |
| 88 | + go test -v ./services/... // Test notification services |
| 89 | + go test -v ./repository/... // Test repositories |
| 90 | +## Key Components |
| 91 | + |
| 92 | +**NFT Detection**: |
| 93 | + |
| 94 | + Pre-configured list of popular NFT contract addresses |
| 95 | + Extensible for adding new collections |
| 96 | + Transaction Processing: |
| 97 | + |
| 98 | +**Real-time block monitoring**: |
| 99 | + |
| 100 | + Transaction filtering and categorization |
| 101 | + Event creation and storage |
| 102 | + |
| 103 | +**Notification System**: |
| 104 | + |
| 105 | + Email notifications via SendGrid |
| 106 | + User preference-based filtering |
| 107 | + Customizable notification templates |
0 commit comments