@agentlayer.tech/wallet 0.1.66 → 0.1.68
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.
- package/.openclaw/extensions/agent-wallet/index.ts +82 -0
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +7 -1
- package/.openclaw/extensions/agent-wallet/package.json +1 -1
- package/VERSION +1 -1
- package/agent-wallet/README.md +6 -0
- package/agent-wallet/agent_wallet/__init__.py +1 -1
- package/agent-wallet/agent_wallet/openclaw_adapter.py +481 -4
- package/agent-wallet/agent_wallet/providers/kamino.py +169 -3
- package/agent-wallet/agent_wallet/providers/x402.py +145 -19
- package/agent-wallet/agent_wallet/transaction_policy.py +60 -0
- package/agent-wallet/agent_wallet/wallet_layer/base.py +124 -0
- package/agent-wallet/agent_wallet/wallet_layer/solana.py +563 -0
- package/agent-wallet/agent_wallet/wallet_layer/wdk_evm.py +34 -0
- package/agent-wallet/openclaw.plugin.json +2 -2
- package/agent-wallet/pyproject.toml +2 -2
- package/agent-wallet/scripts/install_openclaw_local_config.py +6 -0
- package/agent-wallet/skills/wallet-operator/SKILL.md +5 -3
- package/claude-code/plugins/agent-wallet/.claude-plugin/plugin.json +1 -1
- package/codex/plugins/agent-wallet/.codex-plugin/plugin.json +1 -1
- package/hermes/plugins/agent_wallet/plugin.yaml +1 -1
- package/package.json +1 -1
- package/wdk-btc-wallet/package.json +1 -1
- package/wdk-evm-wallet/package.json +1 -1
- package/wdk-evm-wallet/src/server.js +6 -0
- package/wdk-evm-wallet/src/wdk_evm_wallet.js +149 -19
|
@@ -549,6 +549,24 @@ class AgentWalletBackend(ABC):
|
|
|
549
549
|
async def get_kamino_lend_markets(self) -> dict[str, Any]:
|
|
550
550
|
raise WalletBackendError(f"{self.name} does not support Kamino market lookup.")
|
|
551
551
|
|
|
552
|
+
async def get_kamino_portfolio(self, user: str | None = None) -> dict[str, Any]:
|
|
553
|
+
raise WalletBackendError(f"{self.name} does not support Kamino portfolio lookup.")
|
|
554
|
+
|
|
555
|
+
async def get_kamino_vaults(
|
|
556
|
+
self,
|
|
557
|
+
vault_address: str | None = None,
|
|
558
|
+
token_mint: str | None = None,
|
|
559
|
+
include_metrics: bool = False,
|
|
560
|
+
limit: int | None = None,
|
|
561
|
+
) -> dict[str, Any]:
|
|
562
|
+
raise WalletBackendError(f"{self.name} does not support Kamino vault lookup.")
|
|
563
|
+
|
|
564
|
+
async def get_kamino_earn_positions(self, user: str | None = None) -> dict[str, Any]:
|
|
565
|
+
raise WalletBackendError(f"{self.name} does not support Kamino Earn position lookup.")
|
|
566
|
+
|
|
567
|
+
async def get_kamino_liquidity_positions(self, user: str | None = None) -> dict[str, Any]:
|
|
568
|
+
raise WalletBackendError(f"{self.name} does not support Kamino liquidity position lookup.")
|
|
569
|
+
|
|
552
570
|
async def get_kamino_lend_market_reserves(self, market: str) -> dict[str, Any]:
|
|
553
571
|
raise WalletBackendError(f"{self.name} does not support Kamino reserve lookup.")
|
|
554
572
|
|
|
@@ -791,6 +809,112 @@ class AgentWalletBackend(ABC):
|
|
|
791
809
|
) -> dict[str, Any]:
|
|
792
810
|
raise WalletBackendError(f"{self.name} does not support Kamino repays.")
|
|
793
811
|
|
|
812
|
+
async def preview_kamino_earn_deposit(
|
|
813
|
+
self,
|
|
814
|
+
kvault: str,
|
|
815
|
+
amount_ui: str,
|
|
816
|
+
) -> dict[str, Any]:
|
|
817
|
+
raise WalletBackendError(f"{self.name} does not support Kamino Earn deposit previews.")
|
|
818
|
+
|
|
819
|
+
def _build_kamino_earn_intent_preview(
|
|
820
|
+
self,
|
|
821
|
+
base_preview: dict[str, Any],
|
|
822
|
+
*,
|
|
823
|
+
valid_for_seconds: int,
|
|
824
|
+
) -> dict[str, Any]:
|
|
825
|
+
if valid_for_seconds <= 0 or valid_for_seconds > 300:
|
|
826
|
+
raise WalletBackendError("valid_for_seconds must be between 1 and 300.")
|
|
827
|
+
try:
|
|
828
|
+
can_send = bool(self.get_capabilities().can_send_transaction)
|
|
829
|
+
except Exception:
|
|
830
|
+
can_send = bool(base_preview.get("can_send"))
|
|
831
|
+
return {
|
|
832
|
+
"chain": "solana",
|
|
833
|
+
"network": getattr(self, "network", "mainnet"),
|
|
834
|
+
"mode": "intent_preview",
|
|
835
|
+
"asset_type": "kamino-earn-intent",
|
|
836
|
+
"kamino_operation": base_preview["asset_type"],
|
|
837
|
+
"owner": base_preview["owner"],
|
|
838
|
+
"kvault": base_preview["kvault"],
|
|
839
|
+
"amount_ui": base_preview["amount_ui"],
|
|
840
|
+
"vault_info": base_preview.get("vault_info"),
|
|
841
|
+
"position_info": base_preview.get("position_info"),
|
|
842
|
+
"recipient_policy": "owner-only",
|
|
843
|
+
"spend_policy": "exact-amount",
|
|
844
|
+
"valid_for_seconds": valid_for_seconds,
|
|
845
|
+
"valid_until_epoch_seconds": int(time.time()) + valid_for_seconds,
|
|
846
|
+
"intent_note": (
|
|
847
|
+
"This is an intent approval preview. Execute re-derives the Kamino "
|
|
848
|
+
"Earn transaction and only signs/sends if it remains within these approved parameters."
|
|
849
|
+
),
|
|
850
|
+
"can_send": can_send,
|
|
851
|
+
"sign_only": bool(getattr(self, "sign_only", False)),
|
|
852
|
+
"source": "kamino-intent",
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
async def preview_kamino_earn_deposit_intent(
|
|
856
|
+
self,
|
|
857
|
+
kvault: str,
|
|
858
|
+
amount_ui: str,
|
|
859
|
+
valid_for_seconds: int = 120,
|
|
860
|
+
) -> dict[str, Any]:
|
|
861
|
+
base = await self.preview_kamino_earn_deposit(
|
|
862
|
+
kvault=kvault,
|
|
863
|
+
amount_ui=amount_ui,
|
|
864
|
+
)
|
|
865
|
+
return self._build_kamino_earn_intent_preview(base, valid_for_seconds=valid_for_seconds)
|
|
866
|
+
|
|
867
|
+
async def prepare_kamino_earn_deposit(
|
|
868
|
+
self,
|
|
869
|
+
kvault: str,
|
|
870
|
+
amount_ui: str,
|
|
871
|
+
approved_preview: dict[str, Any] | None = None,
|
|
872
|
+
) -> dict[str, Any]:
|
|
873
|
+
raise WalletBackendError(f"{self.name} does not support Kamino Earn deposit preparation.")
|
|
874
|
+
|
|
875
|
+
async def execute_kamino_earn_deposit(
|
|
876
|
+
self,
|
|
877
|
+
kvault: str,
|
|
878
|
+
amount_ui: str,
|
|
879
|
+
approved_preview: dict[str, Any] | None = None,
|
|
880
|
+
) -> dict[str, Any]:
|
|
881
|
+
raise WalletBackendError(f"{self.name} does not support Kamino Earn deposits.")
|
|
882
|
+
|
|
883
|
+
async def preview_kamino_earn_withdraw(
|
|
884
|
+
self,
|
|
885
|
+
kvault: str,
|
|
886
|
+
amount_ui: str,
|
|
887
|
+
) -> dict[str, Any]:
|
|
888
|
+
raise WalletBackendError(f"{self.name} does not support Kamino Earn withdraw previews.")
|
|
889
|
+
|
|
890
|
+
async def preview_kamino_earn_withdraw_intent(
|
|
891
|
+
self,
|
|
892
|
+
kvault: str,
|
|
893
|
+
amount_ui: str,
|
|
894
|
+
valid_for_seconds: int = 120,
|
|
895
|
+
) -> dict[str, Any]:
|
|
896
|
+
base = await self.preview_kamino_earn_withdraw(
|
|
897
|
+
kvault=kvault,
|
|
898
|
+
amount_ui=amount_ui,
|
|
899
|
+
)
|
|
900
|
+
return self._build_kamino_earn_intent_preview(base, valid_for_seconds=valid_for_seconds)
|
|
901
|
+
|
|
902
|
+
async def prepare_kamino_earn_withdraw(
|
|
903
|
+
self,
|
|
904
|
+
kvault: str,
|
|
905
|
+
amount_ui: str,
|
|
906
|
+
approved_preview: dict[str, Any] | None = None,
|
|
907
|
+
) -> dict[str, Any]:
|
|
908
|
+
raise WalletBackendError(f"{self.name} does not support Kamino Earn withdraw preparation.")
|
|
909
|
+
|
|
910
|
+
async def execute_kamino_earn_withdraw(
|
|
911
|
+
self,
|
|
912
|
+
kvault: str,
|
|
913
|
+
amount_ui: str,
|
|
914
|
+
approved_preview: dict[str, Any] | None = None,
|
|
915
|
+
) -> dict[str, Any]:
|
|
916
|
+
raise WalletBackendError(f"{self.name} does not support Kamino Earn withdraws.")
|
|
917
|
+
|
|
794
918
|
async def preview_close_empty_token_accounts(
|
|
795
919
|
self,
|
|
796
920
|
limit: int = 8,
|