|
| 1 | +package main |
| 2 | + |
| 3 | +import ( |
| 4 | + "flag" |
| 5 | + "fmt" |
| 6 | + "math/rand" |
| 7 | + "time" |
| 8 | +) |
| 9 | + |
| 10 | +const ( |
| 11 | + buyOperation = "BUY" |
| 12 | + sellOperation = "SELL" |
| 13 | + convertOperation = "CONVERT" |
| 14 | + withdrawOperation = "WITHDRAW" |
| 15 | + dateFormat = "01/02/2006 15:04:05 -0700" |
| 16 | +) |
| 17 | + |
| 18 | +func main() { |
| 19 | + transactionIntervalFlag := flag.Duration("transaction-interval", time.Minute, "interval between each transaction") |
| 20 | + rotationIntervalFlag := flag.Duration("rotation-interval", time.Hour, "interval between each transaction file") |
| 21 | + |
| 22 | + flag.Parse() |
| 23 | + |
| 24 | + addresses := []string{ |
| 25 | + "0xa42c9E5B5d936309D6B4Ca323B0dD5739643D2Dd", |
| 26 | + "0x7F1C681EF8aD3E695b8dd18C9aD99Ad3A1469CEb", |
| 27 | + "0xD534d113C3CdDFB34bC9D78d85caE4433E6B6326", |
| 28 | + "0x3ddda9438c70f06ce31Bb364788b47EF113e06F9", |
| 29 | + "0x1312395388f9f8F0AF11bfc50Bae8284962732b1", |
| 30 | + "0x980Bc04e435C5E948B1f70a69cD377783500757b", |
| 31 | + "0x120aE479935B4dB6e8bAea92Ac82Efed60165777", |
| 32 | + "0xFfEC835E4fEF2038F8CBC1170fD5d3bf3122bCd5", |
| 33 | + "0x72C3996FC71f485D95C705aE8A167380e4a891af", |
| 34 | + "0x2e23acC09912b6327766179E5F861679D50b5a9b", |
| 35 | + "0x07bb6FBE0e76492FeA01f740D01Ec796e5468968", |
| 36 | + "0x1C28aA9E5Bd21c62153Dae1AD19F6cc9305C15c1", |
| 37 | + "0xf56167Fa1CD74FD6d761E015758a3CE6BE4466F5", |
| 38 | + "0xd1ABA973674601DD10FEF7Abb239E4e975E26a44", |
| 39 | + "0x4bA6b63527B81B82d6b5eDf75E960e071FA21937", |
| 40 | + "0xc68c701B5904fB27Ec72Cc8ff062530a0ffd2015", |
| 41 | + "0xeeaFf5e4B8B488303A9F1db36edbB9d73b38dFcf", |
| 42 | + "0x3a623858c4e9E8649D9Fbb01e7aE3248d12D2b3E", |
| 43 | + "0x00B2cf90D4aDD5023A0e2CF29516fE72E3A02e2c", |
| 44 | + "0xf9Fb58eB4871590764987ac1b1244b3AE4135626", |
| 45 | + } |
| 46 | + cryptoCoins := []string{"BTC", "ETH", "USDT", "BUSD", "SOL", "DOT", "LUNA"} |
| 47 | + fiatCoins := []string{"USD", "EUR", "MDL"} |
| 48 | + operations := []string{buyOperation, sellOperation, convertOperation, withdrawOperation} |
| 49 | + //maxAmounts := map[string]float64{ |
| 50 | + //} |
| 51 | + buyFee := 2.0 |
| 52 | + withdrawFee := 15 |
| 53 | + |
| 54 | + now, then := time.Now().UTC(), time.Now().UTC() |
| 55 | + for { |
| 56 | + if now.Sub(then) > *rotationIntervalFlag { |
| 57 | + return |
| 58 | + } |
| 59 | + rand.Seed(time.Now().UnixNano()) |
| 60 | + addressIndex := rand.Intn(len(addresses)) |
| 61 | + address := addresses[addressIndex] |
| 62 | + cryptoCoinIndex := rand.Intn(len(cryptoCoins)) |
| 63 | + cryptoCoin := cryptoCoins[cryptoCoinIndex] |
| 64 | + fiatCoinIndex := rand.Intn(len(fiatCoins)) |
| 65 | + fiatCoin := fiatCoins[fiatCoinIndex] |
| 66 | + operationIndex := rand.Intn(len(operations)) |
| 67 | + operation := operations[operationIndex] |
| 68 | + date := now.Format(dateFormat) |
| 69 | + |
| 70 | + // make sure in and out coins are different otherwise skip iteration |
| 71 | + |
| 72 | + line := "" |
| 73 | + switch operation { |
| 74 | + case buyOperation: |
| 75 | + line = fmt.Sprintf("%s %s %s:%v %s:%v %v%% %s", address, operation, cryptoCoin, 1, fiatCoin, 123, buyFee, date) |
| 76 | + case sellOperation: |
| 77 | + line = fmt.Sprintf("%s %s %s:%v %s:%v %v%% %s", address, operation, cryptoCoin, 1, fiatCoin, 123, 0, date) |
| 78 | + case convertOperation: |
| 79 | + line = fmt.Sprintf("%s %s %s:%v %s:%v %v%% %s", address, operation, cryptoCoin, 1, cryptoCoin, 123, 0, date) |
| 80 | + case withdrawOperation: |
| 81 | + line = fmt.Sprintf("%s %s %s:%v %s:%v %v%s %s", address, operation, cryptoCoin, 1, cryptoCoin, 123, withdrawFee, fiatCoin, date) |
| 82 | + } |
| 83 | + |
| 84 | + fmt.Println(line) |
| 85 | + now = now.Add(*transactionIntervalFlag) |
| 86 | + } |
| 87 | +} |
0 commit comments