generated from nathanwoodburn/python-webserver-template
fix: Add tx signature verification
All checks were successful
Build Docker / BuildImage (push) Successful in 32s
All checks were successful
Build Docker / BuildImage (push) Successful in 32s
This commit is contained in:
parent
87b7b1ba20
commit
606d31ba17
2
cache/1981e30de11cf0845e8b5affb4dc75e0.json
vendored
2
cache/1981e30de11cf0845e8b5affb4dc75e0.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733719019.8687048, "result": 3917.66}
|
||||
{"timestamp": 1733789918.4846652, "result": 3712.77}
|
2
cache/1ccff5c6f117409fea0c861aa44b8e62.json
vendored
2
cache/1ccff5c6f117409fea0c861aa44b8e62.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733718944.0457852, "result": 1.16}
|
||||
{"timestamp": 1733789921.2481468, "result": 0.98991}
|
2
cache/29409a8a40dd2d547a7a44b8f6758f54.json
vendored
2
cache/29409a8a40dd2d547a7a44b8f6758f54.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733719021.134048, "result": 4.19}
|
||||
{"timestamp": 1733789854.0988004, "result": 4.19}
|
2
cache/4104ed0427efe63d4ca0dead970a4391.json
vendored
2
cache/4104ed0427efe63d4ca0dead970a4391.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733719018.4388325, "result": 245.52}
|
||||
{"timestamp": 1733789856.5556242, "result": 227.89}
|
2
cache/46c1ec7f5edb30c070003dc54e072f41.json
vendored
2
cache/46c1ec7f5edb30c070003dc54e072f41.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733719082.3050148, "result": 4.18}
|
||||
{"timestamp": 1733789919.6086097, "result": 3.77}
|
2
cache/598f5dbf97fb0d45cbc6e1a5b0a3b575.json
vendored
2
cache/598f5dbf97fb0d45cbc6e1a5b0a3b575.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733718865.254725, "result": 231.94}
|
||||
{"timestamp": 1733789851.6413863, "result": 215.13}
|
2
cache/6cc6c6a0b2d0654f551d33209c1fd824.json
vendored
2
cache/6cc6c6a0b2d0654f551d33209c1fd824.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733719142.596215, "result": 4.32}
|
||||
{"timestamp": 1733789920.0200877, "result": 3.9}
|
2
cache/6eec370e2713cfc84c84e1080b8a191a.json
vendored
2
cache/6eec370e2713cfc84c84e1080b8a191a.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733720614.112476, "result": 326.899783283}
|
||||
{"timestamp": 1733790003.498964, "result": 388.922873018}
|
2
cache/790b28a9a21cf694ad9577ef1072ac9e.json
vendored
2
cache/790b28a9a21cf694ad9577ef1072ac9e.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733718864.8976314, "result": 0.038218578}
|
||||
{"timestamp": 1733789851.2324705, "result": 0.034115021}
|
2
cache/a071d7bdda25c22e42ad7840f17c4b0e.json
vendored
2
cache/a071d7bdda25c22e42ad7840f17c4b0e.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733719021.178202, "result": 1.0}
|
||||
{"timestamp": 1733789854.9180405, "result": 1.0}
|
2
cache/a099e7e540e16a185b0279b9494e5099.json
vendored
2
cache/a099e7e540e16a185b0279b9494e5099.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733719020.2031393, "result": 98929}
|
||||
{"timestamp": 1733789857.3777826, "result": 97129}
|
2
cache/a0ee60913ba556f39d128e7d7249e788.json
vendored
2
cache/a0ee60913ba556f39d128e7d7249e788.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733720524.535053, "result": [{"mint": "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4", "balance": 19.88979, "price": 4.19, "value": 83.33822010000002, "name": "Jupiter Perpetuals Liquidity Provider Token", "symbol": "jlp"}, {"mint": "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", "balance": 0.00035766, "price": 98929, "value": 35.38294614, "name": "Wrapped BTC (Wormhole)", "symbol": "wbtc"}, {"mint": "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v", "balance": 0.039815492, "price": 245.52, "value": 9.775499595840001, "name": "Jupiter Staked SOL", "symbol": "jupsol"}, {"mint": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", "balance": 0.00255735, "price": 3917.66, "value": 10.018827800999999, "name": "Ethereum (Wormhole)", "symbol": "eth"}, {"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.18, "value": 3.77391344726, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.32, "value": 41.72633568864, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
||||
{"timestamp": 1733789920.0303614, "result": [{"mint": "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4", "balance": 19.88979, "price": 4.19, "value": 83.33822010000002, "name": "Jupiter Perpetuals Liquidity Provider Token", "symbol": "jlp"}, {"mint": "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v", "balance": 0.039815492, "price": 227.89, "value": 9.07355247188, "name": "Jupiter Staked SOL", "symbol": "jupsol"}, {"mint": "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", "balance": 0.00056828, "price": 97129, "value": 55.19646812, "name": "Wrapped BTC (Wormhole)", "symbol": "wbtc"}, {"mint": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", "balance": 0.00255735, "price": 3712.77, "value": 9.4948523595, "name": "Ethereum (Wormhole)", "symbol": "eth"}, {"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 3.77, "value": 3.4037449033900002, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 3.9, "value": 37.669608607799994, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
2
cache/c652e896f57f598d23e3dbebdb815ef6.json
vendored
2
cache/c652e896f57f598d23e3dbebdb815ef6.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733720524.479128, "result": [{"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.18, "value": 3.77391344726, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.32, "value": 41.72633568864, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
||||
{"timestamp": 1733789920.0300026, "result": [{"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 3.77, "value": 3.4037449033900002, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 3.9, "value": 37.669608607799994, "name": "Volo Staked SUI", "symbol": "vsui"}]}
|
2
cache/ccf2a009e56f1b05d471a55d9c9ea8ea.json
vendored
2
cache/ccf2a009e56f1b05d471a55d9c9ea8ea.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733720521.0848057, "result": 82.815227}
|
||||
{"timestamp": 1733789920.8670247, "result": 82.815227}
|
2
cache/d4e81748ee91683b2c48adaa5cf95187.json
vendored
2
cache/d4e81748ee91683b2c48adaa5cf95187.json
vendored
@ -1 +1 @@
|
||||
{"timestamp": 1733720598.8847191, "result": [{"name": "Kamino USDC Lending", "description": "Kamino USDC Lending", "apy": 26.85, "url": "https://app.kamino.finance/lending/reserve/DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek/Ga4rZytCpq1unD4DbEJ5bkHeUz9g3oh9AAFEi6vSauXp", "value": 20, "updated": "1733719659", "initial": 20, "bought": "1733717057", "type": "Lending"}, {"name": "dYdX MegaVault", "description": "dYdX MegaVault", "apy": 46, "url": "https://dydx.trade/vault", "value": 23.25, "updated": "1733719659", "initial": 23, "bought": "1733300000", "type": "Lending"}]}
|
||||
{"timestamp": 1733789922.7835755, "result": [{"name": "Kamino USDC Lending", "description": "Kamino USDC Lending", "apy": 26.85, "url": "https://app.kamino.finance/lending/reserve/DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek/Ga4rZytCpq1unD4DbEJ5bkHeUz9g3oh9AAFEi6vSauXp", "value": 20, "updated": "1733729835", "initial": 20, "bought": "1733717057", "type": "Lending"}, {"name": "dYdX MegaVault", "description": "dYdX MegaVault", "apy": 46, "url": "https://dydx.trade/vault", "value": 23.29, "updated": "1733729835", "initial": 23, "bought": "1733300000", "type": "Lending"}]}
|
18
server.py
18
server.py
@ -573,11 +573,27 @@ def parseDeposit(data):
|
||||
continue
|
||||
if 'tokenTransfers' not in tx:
|
||||
continue
|
||||
|
||||
|
||||
# Skip memo txs
|
||||
if 'Memo' in json.dumps(tx):
|
||||
print(f"Skipping deposit as it contains memo: {tx['description']}")
|
||||
continue
|
||||
|
||||
signature = tx['signature']
|
||||
if not os.path.exists(f"cache/txs.json"):
|
||||
with open(f"cache/txs.json", "w") as f:
|
||||
json.dump([], f)
|
||||
|
||||
with open(f"cache/txs.json") as f:
|
||||
txs = json.load(f)
|
||||
|
||||
if signature in txs:
|
||||
print(f"Skipping duplicate tx: {signature}")
|
||||
continue
|
||||
|
||||
txs.append(signature)
|
||||
with open(f"cache/txs.json", "w") as f:
|
||||
json.dump(txs, f)
|
||||
|
||||
for transfer in tx['nativeTransfers']:
|
||||
if transfer['toUserAccount'] != str(vault_sol_address):
|
||||
|
Loading…
Reference in New Issue
Block a user