pub struct TxInfoJson;Expand description
JSON renderer for the L2 tx_info wire payload.
Field order and base64-encoded Sig match the upstream Go marshalling so
the resulting string is byte-equivalent (modulo the random Sig) to what
the closed signer emits, and is what the sequencer expects on sendTx.
Implementations§
Source§impl TxInfoJson
impl TxInfoJson
Sourcepub fn update_leverage(tx: &UpdateLeverageTxInfo, signed: &SignedTx) -> String
pub fn update_leverage(tx: &UpdateLeverageTxInfo, signed: &SignedTx) -> String
Render a signed UpdateLeverage to its JSON payload.
Wire field names mirror the upstream txtypes.L2UpdateLeverageTxInfo
Go struct. The FFI wrapper for this kind passes only SkipNonce, so
L2TxAttributes is null or a single {"4":1} entry.
Sourcepub fn create_order(tx: &CreateOrderTxInfo, signed: &SignedTx) -> String
pub fn create_order(tx: &CreateOrderTxInfo, signed: &SignedTx) -> String
Render a signed CreateOrder to its JSON payload.
Sourcepub fn modify_order(tx: &ModifyOrderTxInfo, signed: &SignedTx) -> String
pub fn modify_order(tx: &ModifyOrderTxInfo, signed: &SignedTx) -> String
Render a signed ModifyOrder to its JSON payload.
Sourcepub fn cancel_order(tx: &CancelOrderTxInfo, signed: &SignedTx) -> String
pub fn cancel_order(tx: &CancelOrderTxInfo, signed: &SignedTx) -> String
Render a signed CancelOrder to its JSON payload.
CancelOrder only accepts the skip_nonce L2 attribute.
Sourcepub fn cancel_all_orders(
tx: &CancelAllOrdersTxInfo,
signed: &SignedTx,
) -> String
pub fn cancel_all_orders( tx: &CancelAllOrdersTxInfo, signed: &SignedTx, ) -> String
Render a signed CancelAllOrders to its JSON payload.
Wire field names mirror the upstream txtypes.L2CancelAllOrdersTxInfo
Go struct. The FFI wrapper for this kind passes only SkipNonce, so
L2TxAttributes is null or a single {"4":1} entry.
Sourcepub fn approve_integrator(
tx: &ApproveIntegratorTxInfo,
signed: &SignedTx,
l1_sig: &str,
) -> String
pub fn approve_integrator( tx: &ApproveIntegratorTxInfo, signed: &SignedTx, l1_sig: &str, ) -> String
Render a signed ApproveIntegrator to its JSON payload.
Pass an empty l1_sig when no L1 signature is present.
L2TxAttributes uses the same null-or-skip_nonce shape as CancelOrder.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TxInfoJson
impl RefUnwindSafe for TxInfoJson
impl Send for TxInfoJson
impl Sync for TxInfoJson
impl Unpin for TxInfoJson
impl UnsafeUnpin for TxInfoJson
impl UnwindSafe for TxInfoJson
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more