NibiruChain / py-sdk

Python-based client for interacting with the Nibiru blockchain
MIT License
19 stars 8 forks source link

refactor(msg)!: Unifies the PythonMsg functions under the nibiru.Msg object for improved UX. #191

Closed Unique-Divine closed 1 year ago

Unique-Divine commented 1 year ago

Description

Follows the pattern of accessing messages through the Msg object.

Instead of assuming knowledge on the user to access each method and importing each class individually from nibiru/msg/__init__.py:

import nibiru.msg

msgs = [
  nibiru.msg.MsgOpenPosition(),
  nibiru.msg.MsgAddMargin(),
  nibiru.msg.MsgSend(),
]

We can instead access messages in a module-wise pattern similar to how they are on-chain:

from nibiru import Msg

msgs = [
  Msg.perp.open_position(),
  Msg.perp.add_margin(),
  Msg.bank.send(),
]

Other changes