Skip to content

Commit

Permalink
Generalized 4626 vault integration (#161)
Browse files Browse the repository at this point in the history
* Update widgets.yaml

* feat: deposit vault widget

* Update widgets.yaml

* Update widgets.yaml

* Update display_widgets.py

* Update display_widgets.py

* Update display_widgets.py

* fix: move to end

* fix: use items

* chore: widget index bump

---------

Co-authored-by: marcomariscal <[email protected]>
  • Loading branch information
iamsahu and marcomariscal authored Sep 21, 2023
1 parent 2c34b57 commit af0bc08
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
12 changes: 12 additions & 0 deletions chat/display_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ def _widgetize_inner(command: str, params: str, depth: int = 0) -> str:
elif command == "withdraw-eth-reth":
items = params.split(",")
lines.append(f"withdraw eth from reth action for amount: {items[0]}.")
elif command == 'savings-dai-deposit':
items = params.split(",")
lines.append(f"DAI deposit action for amount: {items[0]}.")
elif command == 'savings-dai-withdraw':
items = params.split(",")
lines.append(f"DAI withdraw action for amount: {items[0]}.")
elif command == 'deposit-vault':
items = params.split(",")
lines.append(f"Deposit vault action for token: {items[0]}, amount: {items[1]}.")
elif command == 'withdraw-vault':
items = params.split(",")
lines.append(f"Withdraw vault action for token: {items[0]}, amount: {items[1]}.")
else:
# assert 0, f'unrecognized command: {command}({params})'
lines.append(f"An unrecognized command: {command}({params})")
Expand Down
60 changes: 60 additions & 0 deletions knowledge_base/widgets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,64 @@
required:
- amount
type: object
return_value_description: ''
- _name_: display_savings_dai_deposit
description: Used to deposit DAI into the DAI savings account.
parameters:
properties:
amount:
description: Amount of DAI to deposit.
type: string
required:
- amount
type: object
return_value_description: ''
- _name_: display_savings_dai_withdraw
description: Used to withdraw DAI from the DAI savings account.
parameters:
properties:
amount:
description: Amount of DAI to withdraw.
type: string
required:
- amount
type: object
return_value_description: ''
- _name_: display_deposit_vault
description: Used to deposit a token into a vault
parameters:
properties:
depositToken:
description: Token to deposit into the vault.
type: string
amount:
description: Amount of token to deposit.
type: string
vault:
description: Vault to deposit the token in.
type: string
required:
- depositToken
- amount
- vault
type: object
return_value_description: ''
- _name_: display_withdraw_vault
description: Used to withdraw a token from a vault
parameters:
properties:
withdrawToken:
description: Token to withdraw from the vault.
type: string
amount:
description: Amount of token to withdraw.
type: string
vault:
description: Vault to withdraw the token in.
type: string
required:
- withdrawToken
- amount
- vault
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 = "WidgetV23"
WIDGET_INDEX_NAME = "WidgetV24"

def get_widget_index_name():
if env.is_local():
Expand Down

0 comments on commit af0bc08

Please sign in to comment.