Skip to main content

FormatParams

Struct FormatParams 

Source
pub struct FormatParams {
Show 28 fields pub token_path: Option<String>, pub token: Option<String>, pub native_currency_address: Option<NativeCurrencyAddress>, pub chain_id: Option<u64>, pub chain_id_path: Option<String>, pub enum_path: Option<String>, pub ref_path: Option<String>, pub map_reference: Option<String>, pub threshold: Option<String>, pub message: Option<String>, pub base: Option<String>, pub decimals: Option<u8>, pub prefix: Option<bool>, pub encryption: Option<EncryptionParams>, pub encoding: Option<String>, pub selector_path: Option<String>, pub selector: Option<String>, pub callee_path: Option<String>, pub callee: Option<String>, pub amount_path: Option<String>, pub amount: Option<UintLiteral>, pub spender_path: Option<String>, pub spender: Option<String>, pub types: Option<Vec<String>>, pub sources: Option<Vec<String>>, pub sender_address: Option<SenderAddress>, pub collection_path: Option<String>, pub collection: Option<String>,
}
Expand description

Format parameters — varies by format type.

Fields§

§token_path: Option<String>

Token address path for tokenAmount/tokenTicker (resolved from calldata).

§token: Option<String>

Static token address or $.metadata.constants.* ref for tokenAmount/tokenTicker.

§native_currency_address: Option<NativeCurrencyAddress>

Native currency address — single address or array of addresses/constant refs. Per spec: “Either a string or an array of strings.”

§chain_id: Option<u64>

Static chain ID for cross-chain token resolution.

§chain_id_path: Option<String>

Dynamic chain ID path from calldata.

§enum_path: Option<String>

Enum lookup key in metadata.enums.

§ref_path: Option<String>

$ref enum reference path (v2): e.g., "$.metadata.enums.interestRateMode".

§map_reference: Option<String>

Map reference key in metadata.maps.

§threshold: Option<String>

Threshold for max-amount display (v2). Value or "$.metadata.constants.max" reference.

§message: Option<String>

Message to display when amount >= threshold (e.g., “All”, “Max”).

§base: Option<String>

Unit base symbol (e.g., “%”, “bps”, “h”) for the unit format.

§decimals: Option<u8>

Decimal places for the unit format (default 0).

§prefix: Option<bool>

Whether to use SI prefix notation for the unit format.

§encryption: Option<EncryptionParams>

Encryption parameters.

§encoding: Option<String>

Date encoding: "timestamp" (default) or "blockheight".

§selector_path: Option<String>

Path to resolve which selector to use for nested calldata decoding.

§selector: Option<String>

Constant selector override for nested calldata decoding.

§callee_path: Option<String>

Path to the callee address for nested calldata (e.g., “to”).

§callee: Option<String>

Constant callee address for nested calldata.

§amount_path: Option<String>

Path to the value amount for nested calldata (injected as @.value in inner context).

§amount: Option<UintLiteral>

Constant native amount for nested calldata.

§spender_path: Option<String>

Path to the spender/from address for nested calldata (injected as @.from in inner context).

§spender: Option<String>

Constant spender/from address for nested calldata.

§types: Option<Vec<String>>

Address types for addressName format (spec: “eoa”, “contract”, etc.).

§sources: Option<Vec<String>>

Trusted name sources for addressName format (spec: “ens”, “local”).

§sender_address: Option<SenderAddress>

Sender address check for addressName format.

§collection_path: Option<String>

Path to the collection address for nftName format.

§collection: Option<String>

Constant collection address for nftName format.

Trait Implementations§

Source§

impl Clone for FormatParams

Source§

fn clone(&self) -> FormatParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FormatParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FormatParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FormatParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompatExt for T

Source§

fn compat(self) -> Compat<T>

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,