Skip to content

Commit

Permalink
integration: hop protocol (#252)
Browse files Browse the repository at this point in the history
* feat: hop protocol

* fix: formatting

* fix: try again

* feat: update widget index num
  • Loading branch information
marcomariscal authored Sep 14, 2023
1 parent 4edb0ee commit 61b02b1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions chat/display_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})")
Expand Down
23 changes: 23 additions & 0 deletions knowledge_base/widgets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
2 changes: 1 addition & 1 deletion utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 61b02b1

Please sign in to comment.