From 61b02b19afb474a59ff5fff304d3ab046447bf7c Mon Sep 17 00:00:00 2001 From: marcomariscal <42938673+marcomariscal@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:32:47 -0700 Subject: [PATCH] integration: hop protocol (#252) * feat: hop protocol * fix: formatting * fix: try again * feat: update widget index num --- chat/display_widgets.py | 3 +++ knowledge_base/widgets.yaml | 23 +++++++++++++++++++++++ utils/constants.py | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/chat/display_widgets.py b/chat/display_widgets.py index 06fa7dd..977ceae 100644 --- a/chat/display_widgets.py +++ b/chat/display_widgets.py @@ -171,6 +171,9 @@ def _widgetize_inner(command: str, params: str, depth: int = 0) -> str: elif command == 'yield-protocol-borrow-close': items = params.split(",") lines.append(f"yield protocol borrow close action: {items[0]}") + elif command == 'hop-protocol-bridge': + items = params.split(",") + lines.append(f"hop protocol bridge action for amount: {items[0]}, token symbol: {items[1]}, from chain: {items[2]}, to chain: {items[3]}.") else: # assert 0, f'unrecognized command: {command}({params})' lines.append(f"An unrecognized command: {command}({params})") diff --git a/knowledge_base/widgets.yaml b/knowledge_base/widgets.yaml index 5bf628f..53b2773 100644 --- a/knowledge_base/widgets.yaml +++ b/knowledge_base/widgets.yaml @@ -698,3 +698,26 @@ - borrowToken type: object return_value_description: "" +- _name_: display_hop_protocol_bridge + description: use the hop protocol to bridge/deposit tokens from a supported chain to a different supported chain + parameters: + properties: + amount: + description: token amount + type: string + tokenSymbol: + description: token symbol + type: string + fromChain: + description: chain to bridge from + type: string + toChain: + description: chain to bridge to + type: string + required: + - amount + - tokenSymbol + - fromChain + - toChain + type: object + return_value_description: "" \ No newline at end of file diff --git a/utils/constants.py b/utils/constants.py index cd74a88..6156677 100644 --- a/utils/constants.py +++ b/utils/constants.py @@ -53,7 +53,7 @@ WIDGET_INFO_TOKEN_LIMIT = 4000 # Widget Index -WIDGET_INDEX_NAME = "WidgetV20" +WIDGET_INDEX_NAME = "WidgetV21" def get_widget_index_name(): if env.is_local():