Skip to content

Latest commit

 

History

History
189 lines (121 loc) · 4.29 KB

File metadata and controls

189 lines (121 loc) · 4.29 KB

🧰 Functions

⚙️ calc_taking_amount

Calculates taker amount by linear proportion.

Function Type
calc_taking_amount (swap_maker_amount: int, order_maker_amount: int, order_taker_amount: int) -> int

⚙️ calc_making_amount

Calculates maker amount by linear proportion.

Function Type
calc_making_amount (swap_taker_amount: int, order_maker_amount: int, order_taker_amount: int) -> int

🏭 Extension

Methods

⚙️ decode

Decodes the extension from bytes.

Method Type
decode (bytes: str) -> Extension

⚙️ default

Returns a default instance of the Extension.

Method Type
default () -> Extension

⚙️ keccak256

Computes a keccak256 hash of the extension data.

Method Type
keccak256 () -> int

⚙️ is_empty

Checks if the extension is empty.

Method Type
is_empty () -> bool

⚙️ encode

Encodes the extension into a hex string.

Method Type
encode () -> str

🏭 Interaction

Methods

⚙️ encode

Encodes the interaction into a hex string.

Method Type
encode () -> str

🏭 ExtensionBuilder

Methods

⚙️ with_maker_asset_suffix

Sets a suffix for the maker asset.

Method Type
with_maker_asset_suffix (suffix: str) -> ExtensionBuilder

⚙️ with_taker_asset_suffix

Sets a suffix for the taker asset.

Method Type
with_taker_asset_suffix (suffix: str) -> ExtensionBuilder

⚙️ with_making_amount_data

Specifies the address and data to calculate making amount.

Method Type
with_making_amount_data (address: Address, data: str) -> ExtensionBuilder

Parameters:

  • address: Address of the contract to be called.
  • data: Data to be passed for calculation.

⚙️ with_taking_amount_data

Specifies the address and data to calculate taking amount.

Method Type
with_taking_amount_data (address: Address, data: str) -> ExtensionBuilder

Parameters:

  • address: Address of the contract to be called.
  • data: Data to be passed for calculation.

⚙️ with_predicate

Sets a predicate for the extension.

Method Type
with_predicate (predicate: str) -> ExtensionBuilder

⚙️ with_maker_permit

Allows specifying a permit for the maker asset.

Method Type
with_maker_permit (token_from: Address, permit_data: str) -> ExtensionBuilder

⚙️ with_pre_interaction

Sets a pre-interaction for the extension.

Method Type
with_pre_interaction (interaction: Interaction) -> ExtensionBuilder

⚙️ with_post_interaction

Sets a post-interaction for the extension.

Method Type
with_post_interaction (interaction: Interaction) -> ExtensionBuilder

⚙️ with_custom_data

Sets custom data for the extension.

Method Type
with_custom_data (data: str) -> ExtensionBuilder

⚙️ build

Builds and returns the extension.

Method Type
build () -> Extension