@sherwoodagent/cli 0.80.0 → 0.82.0

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.
Files changed (68) hide show
  1. package/dist/{abis-OLIDCWDS.js → abis-ZQ6I3S6L.js} +2 -4
  2. package/dist/{addresses-EF5OQSKV.js → addresses-FGJ4I4IG.js} +3 -3
  3. package/dist/{agent-VLYILEUP.js → agent-QUINV725.js} +7 -7
  4. package/dist/{chat-56DDAGA2.js → chat-5TUHBSIA.js} +9 -9
  5. package/dist/{chunk-QK3FUTVI.js → chunk-27XY2HXV.js} +5 -5
  6. package/dist/{chunk-VJKZDHH3.js → chunk-3TLKNRZV.js} +10 -9
  7. package/dist/chunk-3TLKNRZV.js.map +1 -0
  8. package/dist/{chunk-RFJSV3EZ.js → chunk-4KJUX5SS.js} +5 -5
  9. package/dist/{chunk-K2NEFUEP.js → chunk-54CLRBPB.js} +5 -5
  10. package/dist/{chunk-QSYLZA4Z.js → chunk-6BVA4RIH.js} +2 -2
  11. package/dist/{chunk-MAG63U53.js → chunk-76DLC7CM.js} +4 -4
  12. package/dist/{chunk-BJ4G3TPP.js → chunk-EPQR6PJ4.js} +2 -2
  13. package/dist/{chunk-54WMDJTL.js → chunk-LZEV772I.js} +386 -5
  14. package/dist/chunk-LZEV772I.js.map +1 -0
  15. package/dist/{chunk-2LUTKS24.js → chunk-MC5QEPW3.js} +6 -6
  16. package/dist/{chunk-XW6NDXBA.js → chunk-PMRYC6SF.js} +12 -12
  17. package/dist/{chunk-XW6NDXBA.js.map → chunk-PMRYC6SF.js.map} +1 -1
  18. package/dist/{chunk-XDWYX5ZM.js → chunk-UHGWEJ24.js} +2 -2
  19. package/dist/{chunk-XDGCHURW.js → chunk-VR4VHX4D.js} +3 -3
  20. package/dist/chunk-VR4VHX4D.js.map +1 -0
  21. package/dist/{chunk-TU655ZTV.js → chunk-XSP64L7L.js} +1102 -480
  22. package/dist/chunk-XSP64L7L.js.map +1 -0
  23. package/dist/{chunk-UO4UITOY.js → chunk-Y6XOH23Y.js} +28 -7
  24. package/dist/chunk-Y6XOH23Y.js.map +1 -0
  25. package/dist/{client-25LF2O4P.js → client-VNSFNDF4.js} +3 -3
  26. package/dist/{eas-HHMRO37P.js → eas-PJ3Y4NDB.js} +6 -6
  27. package/dist/{governor-AL2XUGBE.js → governor-4ASVLOCI.js} +6 -6
  28. package/dist/index.js +4857 -4569
  29. package/dist/index.js.map +1 -1
  30. package/dist/{ipfs-RWSTXTZM.js → ipfs-EJ7IHXCU.js} +2 -2
  31. package/dist/{network-R45QDUYO.js → network-RI54LT2Y.js} +2 -2
  32. package/dist/{price-QO22NF5Q.js → price-JX2LFKFW.js} +6 -6
  33. package/dist/{providers-ALMXBRNW.js → providers-F6MNPMR4.js} +4 -4
  34. package/dist/{research-ICDDAAGV.js → research-5ZJTRILJ.js} +8 -8
  35. package/dist/{session-RSWSCMM5.js → session-AXLPYJHX.js} +11 -11
  36. package/dist/{trade-YNQVWUYZ.js → trade-BZM7K2F4.js} +15 -15
  37. package/dist/{vault-QKURBBSL.js → vault-AWQBFD4C.js} +9 -9
  38. package/dist/{xmtp-M2OBCCNR.js → xmtp-M74BRF3G.js} +6 -6
  39. package/package.json +1 -1
  40. package/dist/chunk-54WMDJTL.js.map +0 -1
  41. package/dist/chunk-TU655ZTV.js.map +0 -1
  42. package/dist/chunk-UO4UITOY.js.map +0 -1
  43. package/dist/chunk-VJKZDHH3.js.map +0 -1
  44. package/dist/chunk-XDGCHURW.js.map +0 -1
  45. /package/dist/{abis-OLIDCWDS.js.map → abis-ZQ6I3S6L.js.map} +0 -0
  46. /package/dist/{addresses-EF5OQSKV.js.map → addresses-FGJ4I4IG.js.map} +0 -0
  47. /package/dist/{agent-VLYILEUP.js.map → agent-QUINV725.js.map} +0 -0
  48. /package/dist/{chat-56DDAGA2.js.map → chat-5TUHBSIA.js.map} +0 -0
  49. /package/dist/{chunk-QK3FUTVI.js.map → chunk-27XY2HXV.js.map} +0 -0
  50. /package/dist/{chunk-RFJSV3EZ.js.map → chunk-4KJUX5SS.js.map} +0 -0
  51. /package/dist/{chunk-K2NEFUEP.js.map → chunk-54CLRBPB.js.map} +0 -0
  52. /package/dist/{chunk-QSYLZA4Z.js.map → chunk-6BVA4RIH.js.map} +0 -0
  53. /package/dist/{chunk-MAG63U53.js.map → chunk-76DLC7CM.js.map} +0 -0
  54. /package/dist/{chunk-BJ4G3TPP.js.map → chunk-EPQR6PJ4.js.map} +0 -0
  55. /package/dist/{chunk-2LUTKS24.js.map → chunk-MC5QEPW3.js.map} +0 -0
  56. /package/dist/{chunk-XDWYX5ZM.js.map → chunk-UHGWEJ24.js.map} +0 -0
  57. /package/dist/{client-25LF2O4P.js.map → client-VNSFNDF4.js.map} +0 -0
  58. /package/dist/{eas-HHMRO37P.js.map → eas-PJ3Y4NDB.js.map} +0 -0
  59. /package/dist/{governor-AL2XUGBE.js.map → governor-4ASVLOCI.js.map} +0 -0
  60. /package/dist/{ipfs-RWSTXTZM.js.map → ipfs-EJ7IHXCU.js.map} +0 -0
  61. /package/dist/{network-R45QDUYO.js.map → network-RI54LT2Y.js.map} +0 -0
  62. /package/dist/{price-QO22NF5Q.js.map → price-JX2LFKFW.js.map} +0 -0
  63. /package/dist/{providers-ALMXBRNW.js.map → providers-F6MNPMR4.js.map} +0 -0
  64. /package/dist/{research-ICDDAAGV.js.map → research-5ZJTRILJ.js.map} +0 -0
  65. /package/dist/{session-RSWSCMM5.js.map → session-AXLPYJHX.js.map} +0 -0
  66. /package/dist/{trade-YNQVWUYZ.js.map → trade-BZM7K2F4.js.map} +0 -0
  67. /package/dist/{vault-QKURBBSL.js.map → vault-AWQBFD4C.js.map} +0 -0
  68. /package/dist/{xmtp-M2OBCCNR.js.map → xmtp-M74BRF3G.js.map} +0 -0
@@ -8,18 +8,18 @@ import {
8
8
  UNISWAP,
9
9
  VENICE,
10
10
  robinhoodEquityMaxAge
11
- } from "./chunk-XW6NDXBA.js";
11
+ } from "./chunk-PMRYC6SF.js";
12
12
  import {
13
13
  getPublicClient
14
- } from "./chunk-BJ4G3TPP.js";
14
+ } from "./chunk-EPQR6PJ4.js";
15
15
  import {
16
16
  getNetwork
17
- } from "./chunk-VJKZDHH3.js";
17
+ } from "./chunk-3TLKNRZV.js";
18
18
  import {
19
19
  BASE_STRATEGY_ABI,
20
20
  ERC20_ABI,
21
21
  UNISWAP_QUOTER_V2_ABI
22
- } from "./chunk-TU655ZTV.js";
22
+ } from "./chunk-XSP64L7L.js";
23
23
 
24
24
  // src/lib/swap-router.ts
25
25
  import { encodeFunctionData as encodeFunctionData9, decodeFunctionResult } from "viem";
@@ -440,6 +440,385 @@ function buildSettleCalls6(clone) {
440
440
 
441
441
  // src/strategies/hyperliquid-perp-template.ts
442
442
  import { encodeAbiParameters as encodeAbiParameters7, encodeFunctionData as encodeFunctionData7, maxUint256 as maxUint2562 } from "viem";
443
+
444
+ // src/lib/abis-legacy.ts
445
+ var HYPERLIQUID_PERP_STRATEGY_ABI = [
446
+ {
447
+ name: "asset",
448
+ type: "function",
449
+ stateMutability: "view",
450
+ inputs: [],
451
+ outputs: [{ name: "", type: "address" }]
452
+ },
453
+ {
454
+ name: "assetTraded",
455
+ type: "function",
456
+ stateMutability: "view",
457
+ inputs: [{ name: "", type: "uint32" }],
458
+ outputs: [{ name: "", type: "bool" }]
459
+ },
460
+ {
461
+ name: "cumulativeSwept",
462
+ type: "function",
463
+ stateMutability: "view",
464
+ inputs: [],
465
+ outputs: [{ name: "", type: "uint256" }]
466
+ },
467
+ {
468
+ name: "depositAmount",
469
+ type: "function",
470
+ stateMutability: "view",
471
+ inputs: [],
472
+ outputs: [{ name: "", type: "uint256" }]
473
+ },
474
+ { name: "execute", type: "function", stateMutability: "nonpayable", inputs: [], outputs: [] },
475
+ {
476
+ name: "executed",
477
+ type: "function",
478
+ stateMutability: "view",
479
+ inputs: [],
480
+ outputs: [{ name: "", type: "bool" }]
481
+ },
482
+ {
483
+ name: "finalizeForHyperCore",
484
+ type: "function",
485
+ stateMutability: "nonpayable",
486
+ inputs: [
487
+ { name: "token", type: "uint64" },
488
+ { name: "variant", type: "uint8" },
489
+ { name: "createNonce", type: "uint64" }
490
+ ],
491
+ outputs: []
492
+ },
493
+ {
494
+ name: "getMarginSummary",
495
+ type: "function",
496
+ stateMutability: "view",
497
+ inputs: [],
498
+ outputs: [
499
+ {
500
+ name: "summary",
501
+ type: "tuple",
502
+ components: [
503
+ { name: "accountValue", type: "int64" },
504
+ { name: "marginUsed", type: "uint64" },
505
+ { name: "ntlPos", type: "uint64" },
506
+ { name: "rawUsd", type: "int64" }
507
+ ]
508
+ }
509
+ ]
510
+ },
511
+ {
512
+ name: "getPosition",
513
+ type: "function",
514
+ stateMutability: "view",
515
+ inputs: [],
516
+ outputs: [
517
+ {
518
+ name: "pos",
519
+ type: "tuple",
520
+ components: [
521
+ { name: "szi", type: "int64" },
522
+ { name: "entryNtl", type: "uint64" },
523
+ { name: "isolatedRawUsd", type: "int64" },
524
+ { name: "leverage", type: "uint32" },
525
+ { name: "isIsolated", type: "bool" }
526
+ ]
527
+ }
528
+ ]
529
+ },
530
+ {
531
+ name: "getSpotBalance",
532
+ type: "function",
533
+ stateMutability: "view",
534
+ inputs: [],
535
+ outputs: [
536
+ {
537
+ name: "balance",
538
+ type: "tuple",
539
+ components: [
540
+ { name: "total", type: "uint64" },
541
+ { name: "hold", type: "uint64" },
542
+ { name: "entryNtl", type: "uint64" }
543
+ ]
544
+ }
545
+ ]
546
+ },
547
+ {
548
+ name: "hasActiveStopLoss",
549
+ type: "function",
550
+ stateMutability: "view",
551
+ inputs: [],
552
+ outputs: [{ name: "", type: "bool" }]
553
+ },
554
+ {
555
+ name: "hyperCoreFinalized",
556
+ type: "function",
557
+ stateMutability: "view",
558
+ inputs: [],
559
+ outputs: [{ name: "", type: "bool" }]
560
+ },
561
+ {
562
+ name: "inFlightToHc",
563
+ type: "function",
564
+ stateMutability: "view",
565
+ inputs: [],
566
+ outputs: [{ name: "", type: "uint256" }]
567
+ },
568
+ {
569
+ name: "initialize",
570
+ type: "function",
571
+ stateMutability: "nonpayable",
572
+ inputs: [
573
+ { name: "vault_", type: "address" },
574
+ { name: "proposer_", type: "address" },
575
+ { name: "data", type: "bytes" }
576
+ ],
577
+ outputs: []
578
+ },
579
+ {
580
+ name: "initiateReturn",
581
+ type: "function",
582
+ stateMutability: "nonpayable",
583
+ inputs: [],
584
+ outputs: []
585
+ },
586
+ {
587
+ name: "lastRecoverBlock",
588
+ type: "function",
589
+ stateMutability: "view",
590
+ inputs: [],
591
+ outputs: [{ name: "", type: "uint256" }]
592
+ },
593
+ {
594
+ name: "lastTradeReset",
595
+ type: "function",
596
+ stateMutability: "view",
597
+ inputs: [],
598
+ outputs: [{ name: "", type: "uint256" }]
599
+ },
600
+ {
601
+ name: "leverage",
602
+ type: "function",
603
+ stateMutability: "view",
604
+ inputs: [],
605
+ outputs: [{ name: "", type: "uint32" }]
606
+ },
607
+ {
608
+ name: "maxPositionSize",
609
+ type: "function",
610
+ stateMutability: "view",
611
+ inputs: [],
612
+ outputs: [{ name: "", type: "uint256" }]
613
+ },
614
+ {
615
+ name: "maxTradesPerDay",
616
+ type: "function",
617
+ stateMutability: "view",
618
+ inputs: [],
619
+ outputs: [{ name: "", type: "uint32" }]
620
+ },
621
+ {
622
+ name: "moveSpotToPerp",
623
+ type: "function",
624
+ stateMutability: "nonpayable",
625
+ inputs: [],
626
+ outputs: []
627
+ },
628
+ {
629
+ name: "name",
630
+ type: "function",
631
+ stateMutability: "pure",
632
+ inputs: [],
633
+ outputs: [{ name: "", type: "string" }]
634
+ },
635
+ {
636
+ name: "perpAssetIndex",
637
+ type: "function",
638
+ stateMutability: "view",
639
+ inputs: [],
640
+ outputs: [{ name: "", type: "uint32" }]
641
+ },
642
+ {
643
+ name: "positions",
644
+ type: "function",
645
+ stateMutability: "view",
646
+ inputs: [],
647
+ outputs: [
648
+ {
649
+ name: "ps",
650
+ type: "tuple[]",
651
+ components: [
652
+ { name: "venue", type: "address" },
653
+ { name: "kind", type: "bytes32" },
654
+ { name: "ref", type: "bytes" }
655
+ ]
656
+ }
657
+ ]
658
+ },
659
+ {
660
+ name: "proposer",
661
+ type: "function",
662
+ stateMutability: "view",
663
+ inputs: [],
664
+ outputs: [{ name: "", type: "address" }]
665
+ },
666
+ {
667
+ name: "recoverHcResiduals",
668
+ type: "function",
669
+ stateMutability: "nonpayable",
670
+ inputs: [],
671
+ outputs: []
672
+ },
673
+ {
674
+ name: "returnsInitiated",
675
+ type: "function",
676
+ stateMutability: "view",
677
+ inputs: [],
678
+ outputs: [{ name: "", type: "bool" }]
679
+ },
680
+ {
681
+ name: "returnsInitiatedBlock",
682
+ type: "function",
683
+ stateMutability: "view",
684
+ inputs: [],
685
+ outputs: [{ name: "", type: "uint256" }]
686
+ },
687
+ {
688
+ name: "selfManagesFees",
689
+ type: "function",
690
+ stateMutability: "view",
691
+ inputs: [],
692
+ outputs: [{ name: "", type: "bool" }]
693
+ },
694
+ { name: "settle", type: "function", stateMutability: "nonpayable", inputs: [], outputs: [] },
695
+ {
696
+ name: "settled",
697
+ type: "function",
698
+ stateMutability: "view",
699
+ inputs: [],
700
+ outputs: [{ name: "", type: "bool" }]
701
+ },
702
+ {
703
+ name: "state",
704
+ type: "function",
705
+ stateMutability: "view",
706
+ inputs: [],
707
+ outputs: [{ name: "", type: "uint8" }]
708
+ },
709
+ {
710
+ name: "sweepToVault",
711
+ type: "function",
712
+ stateMutability: "nonpayable",
713
+ inputs: [],
714
+ outputs: []
715
+ },
716
+ {
717
+ name: "tradedAssets",
718
+ type: "function",
719
+ stateMutability: "view",
720
+ inputs: [{ name: "", type: "uint256" }],
721
+ outputs: [{ name: "", type: "uint32" }]
722
+ },
723
+ {
724
+ name: "tradesToday",
725
+ type: "function",
726
+ stateMutability: "view",
727
+ inputs: [],
728
+ outputs: [{ name: "", type: "uint32" }]
729
+ },
730
+ {
731
+ name: "updateParams",
732
+ type: "function",
733
+ stateMutability: "nonpayable",
734
+ inputs: [{ name: "data", type: "bytes" }],
735
+ outputs: []
736
+ },
737
+ {
738
+ name: "vault",
739
+ type: "function",
740
+ stateMutability: "view",
741
+ inputs: [],
742
+ outputs: [{ name: "", type: "address" }]
743
+ },
744
+ {
745
+ name: "FundsParked",
746
+ type: "event",
747
+ inputs: [{ name: "amount", type: "uint256", indexed: false }]
748
+ },
749
+ {
750
+ name: "FundsSwept",
751
+ type: "event",
752
+ inputs: [{ name: "amount", type: "uint256", indexed: false }]
753
+ },
754
+ {
755
+ name: "HyperCoreFinalized",
756
+ type: "event",
757
+ inputs: [
758
+ { name: "token", type: "uint64", indexed: false },
759
+ { name: "variant", type: "uint8", indexed: false },
760
+ { name: "createNonce", type: "uint64", indexed: false }
761
+ ]
762
+ },
763
+ {
764
+ name: "PositionClosed",
765
+ type: "event",
766
+ inputs: [
767
+ { name: "asset", type: "uint32", indexed: false },
768
+ { name: "limitPx", type: "uint64", indexed: false },
769
+ { name: "sz", type: "uint64", indexed: false }
770
+ ]
771
+ },
772
+ {
773
+ name: "PositionOpened",
774
+ type: "event",
775
+ inputs: [
776
+ { name: "asset", type: "uint32", indexed: false },
777
+ { name: "isBuy", type: "bool", indexed: false },
778
+ { name: "limitPx", type: "uint64", indexed: false },
779
+ { name: "sz", type: "uint64", indexed: false },
780
+ { name: "leverage", type: "uint32", indexed: false }
781
+ ]
782
+ },
783
+ { name: "ReturnsInitiated", type: "event", inputs: [] },
784
+ { name: "Settled", type: "event", inputs: [] },
785
+ {
786
+ name: "StopLossUpdated",
787
+ type: "event",
788
+ inputs: [{ name: "triggerPx", type: "uint64", indexed: false }]
789
+ },
790
+ { name: "AccountMarginSummaryPrecompileCallFailed", type: "error", inputs: [] },
791
+ { name: "AlreadyExecuted", type: "error", inputs: [] },
792
+ { name: "AlreadyFinalized", type: "error", inputs: [] },
793
+ { name: "AlreadyInitialized", type: "error", inputs: [] },
794
+ { name: "AlreadySettled", type: "error", inputs: [] },
795
+ { name: "DepositAmountTooLarge", type: "error", inputs: [] },
796
+ { name: "InvalidAction", type: "error", inputs: [] },
797
+ { name: "InvalidAmount", type: "error", inputs: [] },
798
+ { name: "MaxTradesExceeded", type: "error", inputs: [] },
799
+ { name: "NotAuthorized", type: "error", inputs: [] },
800
+ { name: "NotExecuted", type: "error", inputs: [] },
801
+ { name: "NotProposer", type: "error", inputs: [] },
802
+ { name: "NotSweepable", type: "error", inputs: [] },
803
+ { name: "NotVault", type: "error", inputs: [] },
804
+ { name: "Position2PrecompileCallFailed", type: "error", inputs: [] },
805
+ {
806
+ name: "PositionTooLarge",
807
+ type: "error",
808
+ inputs: [{ name: "actual", type: "uint256" }, { name: "max", type: "uint256" }]
809
+ },
810
+ { name: "ReturnsNotInitiated", type: "error", inputs: [] },
811
+ {
812
+ name: "SafeERC20FailedOperation",
813
+ type: "error",
814
+ inputs: [{ name: "token", type: "address" }]
815
+ },
816
+ { name: "SettleTooSoon", type: "error", inputs: [] },
817
+ { name: "SpotBalancePrecompileCallFailed", type: "error", inputs: [] },
818
+ { name: "ZeroAddress", type: "error", inputs: [] }
819
+ ];
820
+
821
+ // src/strategies/hyperliquid-perp-template.ts
443
822
  function buildInitData7(asset, depositAmount, perpAssetIndex, leverage, maxPositionSize, maxTradesPerDay) {
444
823
  return encodeAbiParameters7(
445
824
  [
@@ -1119,6 +1498,7 @@ function resolveToken(symbolOrAddress) {
1119
1498
  function defaultPortfolioAsset() {
1120
1499
  const network = getNetwork();
1121
1500
  if (network === "robinhood-testnet") return "WETH";
1501
+ if (network === "robinhood-fork") return "USDG";
1122
1502
  return "USDC";
1123
1503
  }
1124
1504
  function assetDecimalsForSymbol(symbol) {
@@ -1239,6 +1619,7 @@ function encodeSwapPath(tokens, fees) {
1239
1619
  }
1240
1620
 
1241
1621
  export {
1622
+ HYPERLIQUID_PERP_STRATEGY_ABI,
1242
1623
  computeProposalAssetChecks,
1243
1624
  buildInitDataForTemplate,
1244
1625
  buildCallsForTemplate,
@@ -1250,4 +1631,4 @@ export {
1250
1631
  applySlippage,
1251
1632
  encodeSwapPath
1252
1633
  };
1253
- //# sourceMappingURL=chunk-54WMDJTL.js.map
1634
+ //# sourceMappingURL=chunk-LZEV772I.js.map