Calculates taker amount by linear proportion.
Function | Type |
---|---|
calc_taking_amount |
(swap_maker_amount: int, order_maker_amount: int, order_taker_amount: int) -> int |
Calculates maker amount by linear proportion.
Function | Type |
---|---|
calc_making_amount |
(swap_taker_amount: int, order_maker_amount: int, order_taker_amount: int) -> int |
Decodes the extension from bytes.
Method | Type |
---|---|
decode |
(bytes: str) -> Extension |
Returns a default instance of the Extension.
Method | Type |
---|---|
default |
() -> Extension |
Computes a keccak256 hash of the extension data.
Method | Type |
---|---|
keccak256 |
() -> int |
Checks if the extension is empty.
Method | Type |
---|---|
is_empty |
() -> bool |
Encodes the extension into a hex string.
Method | Type |
---|---|
encode |
() -> str |
Encodes the interaction into a hex string.
Method | Type |
---|---|
encode |
() -> str |
- with_maker_asset_suffix
- with_taker_asset_suffix
- with_making_amount_data
- with_taking_amount_data
- with_predicate
- with_maker_permit
- with_pre_interaction
- with_post_interaction
- with_custom_data
- build
Sets a suffix for the maker asset.
Method | Type |
---|---|
with_maker_asset_suffix |
(suffix: str) -> ExtensionBuilder |
Sets a suffix for the taker asset.
Method | Type |
---|---|
with_taker_asset_suffix |
(suffix: str) -> ExtensionBuilder |
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.
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.
Sets a predicate for the extension.
Method | Type |
---|---|
with_predicate |
(predicate: str) -> ExtensionBuilder |
Allows specifying a permit for the maker asset.
Method | Type |
---|---|
with_maker_permit |
(token_from: Address, permit_data: str) -> ExtensionBuilder |
Sets a pre-interaction for the extension.
Method | Type |
---|---|
with_pre_interaction |
(interaction: Interaction) -> ExtensionBuilder |
Sets a post-interaction for the extension.
Method | Type |
---|---|
with_post_interaction |
(interaction: Interaction) -> ExtensionBuilder |
Sets custom data for the extension.
Method | Type |
---|---|
with_custom_data |
(data: str) -> ExtensionBuilder |
Builds and returns the extension.
Method | Type |
---|---|
build |
() -> Extension |