Expand description

example to use

#[derive(Eq, PartialEq, Debug, Ex3Payload)]
struct PriceVolumePair {
    #[index(0)]
    price: BigUint,
    #[index(1)]
    volume: BigUint,
}

#[serde(transparent)]
#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
struct MyStructId(String);

#[derive(Eq, PartialEq, Debug, Copy, Clone, Ex3PayloadEnum)]
enum OrderCategory {
    SpotLimit = 0,
    SpotMarket = 1,
    SpotSwap = 2,
}

#[derive(Eq, PartialEq, Debug, Ex3Payload)]
struct ComplexObject {
    #[index(0)]
    orders: Vec<PriceVolumePair>,
    #[index(1)]
    null_orders: Option<Vec<PriceVolumePair>>,
    #[index(2)]
    one_order: PriceVolumePair,
    #[index(3)]
    null_one_order: Option<PriceVolumePair>,
    #[index(4)]
    order_category: OrderCategory,
    #[index(5)]
    string_value: String,
    #[index(6)]
    null_string: Option<String>,
    #[index(7)]
    empty_string: String,
    #[index(8)]
    my_struct_id: MyStructId,
}

Derive Macros