Open hardyjosh opened 3 weeks ago
for order operations we also need to add a function for fetching token info
we need a way to flag tokens as swappable, so rather than defining the tokens up front, i can change their address as a first step
We can mark which tokens in the tokens map can be changed:
''' gui: select-tokens:
tokens: token1: address: 0x00 (placeholder) token2: address: 0x00 '''
token1 and token2 would be used in the order, and as a first step of the gui you can change their address
this structure means we can map one choice to both an input and output, e.g.
''' my-order: inputs:
this must be done as a first step before anything else. we'll be adding token replacement for token symbols into field descriptions, which means we need to know the token symbols up front.
We also need the ability to optionally set a vault id that will be used for all inputs and outputs in the order.
This could be done at any stage by updating the OrderIO for the relevant order
https://github.com/rainlanguage/rain.orderbook/blob/main/crates/settings/src/order.rs#L32
Interface Definition for DotrainOrderGui
TODO:
Core Interfaces
DotrainOrder
Deposit
Preset
FieldDefinition
Deployment
GUI
Constructor
Field Operations
Deposit Operations
State Management
Order Operations
Core Types
FieldValue
Error Types
ValidationError
GuiError
SerializeError
// Error serializing state
DeserializeError
// Error deserializing state