huginn_callisto_network_agent 0.1.96 → 0.1.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fca06dc2c9d268982c5a11a127ba738c4ce11b0c33b0e846eecea9b8a20cb611
4
- data.tar.gz: d7fd923d8f55246c727c04ae06e480e51daab7d7b833d3f0ac088342fbdac50d
3
+ metadata.gz: 9dfee72a9b9f4ded9d0f1ad5d9f597d9b1f280fda9f5ddbbf600f141a2a956c9
4
+ data.tar.gz: 5934a8338dddfe927b2b95df824e660b342e568a9495687c4a10d358a29dac01
5
5
  SHA512:
6
- metadata.gz: 9d47b9e97c488cfb844998004e41f5794406da25b35171c8b356c534ba1776a87f5e49035b76f61eccafa9de7e4b05b61e5a96f2d1784093664cd1c5bfb22703
7
- data.tar.gz: 625983589ef344fcf8a39f65443b356804ece0a60228e545198054764265cb1ca3d8f7553a08b0df747001a78c889d67b6bf30057132760bd01a63ced031ecbc
6
+ metadata.gz: 777f0ed7260037bd8f4f6bf9f2ad2f28da9669b0c4c2be094f4d5f1535fe2c58ca957b6002f0ba1dae04aecc6f76a89c02af8e22a6249dff5c21ba21010eef0f
7
+ data.tar.gz: cb0e22e0d45c88089176b9f877a9e5875b828cab19feda2f53fd628ab8e00b3ba2a5ceb38d724d9c88171aff8be980e205fd21d6fc2926edb1044fb6691e135b
@@ -268,7 +268,7 @@ module Agents
268
268
  end
269
269
  end
270
270
 
271
- def dao_vote_id(id,internal=false)
271
+ def dao_vote_id(id,internal=true)
272
272
 
273
273
  if interpolated['debug'] == 'true'
274
274
  log "unlocking the wallet"
@@ -289,7 +289,9 @@ module Agents
289
289
  {
290
290
  "from" => "#{interpolated['wallet']}",
291
291
  "data" => "0xc9d27afe#{to_hex(id.to_i)}#{to_hex(bool_to_int(interpolated['vote']))}",
292
- "to" => "0x810059e1406dedafd1bdca4e0137cba306c0ce36"
292
+ "to" => "0x810059e1406dedafd1bdca4e0137cba306c0ce36",
293
+ "gas" => "0x30d40",
294
+ "gasPrice" => "#{eth_gasPrice(internal)}"
293
295
  }
294
296
  ]
295
297
  })
@@ -304,12 +306,9 @@ module Agents
304
306
 
305
307
  payload = JSON.parse(response.body)
306
308
 
307
- if internal == false
309
+ if interpolated['emit_events'] == 'true'
308
310
  create_event payload: payload
309
- else
310
- return payload['result']
311
311
  end
312
- else
313
312
  end
314
313
 
315
314
  end
@@ -366,15 +365,10 @@ module Agents
366
365
  end
367
366
 
368
367
  def dao_claim(id)
369
- # function_id = '0x379607f5'
370
- # formatted_value = id.to_s(16).rjust(64, '0')
371
- # data = "#{function_id}#{formatted_value}"
372
368
  if interpolated['debug'] == 'true'
373
369
  log "unlocking the wallet"
374
370
  end
375
371
  response = JSON.parse(unlock_wallet())
376
- # log "response -> #{response}"
377
- # log "response result -> #{response['result']}"
378
372
  if response['result'] == true
379
373
  if interpolated['debug'] == 'true'
380
374
  log "the wallet is unlocked"
@@ -390,7 +384,9 @@ module Agents
390
384
  {
391
385
  "from" => "#{interpolated['wallet']}",
392
386
  "data" => "0x379607f5#{to_hex(id)}",
393
- "to" => "0x810059e1406dedafd1bdca4e0137cba306c0ce36"
387
+ "to" => "0x810059e1406dedafd1bdca4e0137cba306c0ce36",
388
+ "gas" => "0x30d40",
389
+ "gasPrice" => "#{eth_gasPrice(internal)}"
394
390
  }
395
391
  ]
396
392
  })
@@ -567,8 +563,6 @@ module Agents
567
563
  contract = "0x7777265DC7FD2a15A7f2E8d8Ad87b3DAec677777"
568
564
  power_of_10 = 18
569
565
  final_value = interpolated['value'].to_i * 10**power_of_10
570
- # log "0x83f818b4000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000001"
571
- # log "0x83f818b4#{to_hex(max_gain(contract).to_i)}#{to_hex(interpolated['round'].to_i)}"
572
566
  if interpolated['debug'] == 'true'
573
567
  log "unlocking the wallet"
574
568
  end
@@ -591,10 +585,10 @@ module Agents
591
585
  "from" => "#{interpolated['wallet']}",
592
586
  "value" => "0x#{final_value.to_s(16)}",
593
587
  "data" => "0x83f818b4#{to_hex(max_gain(contract).to_i)}#{to_hex(interpolated['round'].to_i)}",
588
+ "gas" => "0x30d40",
594
589
  "gasPrice" => "#{eth_gasPrice(internal)}"
595
590
  }
596
591
  ],
597
- # "gas" => "0x186a0",
598
592
  "id" => 1
599
593
  })
600
594
 
@@ -917,6 +911,7 @@ module Agents
917
911
  "from" => "#{interpolated['wallet']}",
918
912
  "to" => "#{interpolated['wallet_dest']}",
919
913
  "value" => "0x#{final_value.to_s(16)}",
914
+ "gas" => "0x30d40",
920
915
  "gasPrice" => "#{eth_gasPrice(internal)}"
921
916
  }
922
917
  ],
@@ -965,6 +960,7 @@ module Agents
965
960
  "to" => "0x08A7c8be47773546DC5E173d67B0c38AfFfa4b84",
966
961
  "data" => "0x5d8c85ef#{to_hex(interpolated['round'].to_i)}",
967
962
  "value" => "0x#{final_value.to_s(16)}",
963
+ "gas" => "0x30d40",
968
964
  "gasPrice" => "#{eth_gasPrice(internal)}"
969
965
  }
970
966
  ],
@@ -1012,6 +1008,7 @@ module Agents
1012
1008
  "from" => "#{interpolated['wallet']}",
1013
1009
  "to" => "0x08A7c8be47773546DC5E173d67B0c38AfFfa4b84",
1014
1010
  "data" => "0xcd948855",
1011
+ "gas" => "0x30d40",
1015
1012
  "gasPrice" => "#{eth_gasPrice(internal)}"
1016
1013
  }
1017
1014
  ],
@@ -1681,7 +1678,7 @@ module Agents
1681
1678
  end
1682
1679
  end
1683
1680
 
1684
- def eth_gasPrice(internal=false)
1681
+ def eth_gasPrice(internal="false")
1685
1682
 
1686
1683
  uri = URI.parse("#{interpolated['rpc_server']}")
1687
1684
  request = Net::HTTP::Post.new(uri)
@@ -1705,16 +1702,18 @@ module Agents
1705
1702
 
1706
1703
  payload = JSON.parse(response.body)
1707
1704
 
1708
- if internal == false
1705
+ if internal == "false"
1709
1706
  if interpolated['changes_only'] == 'true'
1710
- if payload.to_s != memory['eth_gasPrice']
1711
- memory['eth_gasPrice'] = payload.to_s
1707
+ if payload != memory['eth_gasPrice']
1708
+ memory['eth_gasPrice'] = payload
1712
1709
  payload['result'] = payload['result'].to_i(16)
1713
1710
  create_event payload: payload
1711
+ else
1712
+ log "no diff"
1714
1713
  end
1715
1714
  else
1716
- if payload.to_s != memory['eth_gasPrice']
1717
- memory['eth_gasPrice'] = payload.to_s
1715
+ if payload != memory['eth_gasPrice']
1716
+ memory['eth_gasPrice'] = payload
1718
1717
  end
1719
1718
  payload['result'] = payload['result'].to_i(16)
1720
1719
  create_event payload: payload
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: huginn_callisto_network_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.96
4
+ version: 0.1.98
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Germain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-04 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler