Payments
Handles the encoding of calldata for payment operations.
GitHub File: payments.ts
Properties
Public
Property | Type | Modifier | Description |
---|---|---|---|
INTERFACE | static | The Application Binary Interface for the related Elastic contracts. |
Constructor
Private constructor that cannot be constructed.
Methods
encodeFeeBips() - private
static
private
static
Encodes the fees and returns the fee value as a hexed string.
Parameters
Params | Type | Description |
---|---|---|
fee | The fees charged for the payment |
Returns
Type | Description |
---|---|
string | An encoded string that represents the hex value of the fee. |
encodeUnwrapETH() - public
static
public
static
Handles the encoding of unwrapping WETH with the option to charge fees for the unwrapping operation.
Parameters
Params | Type | Description |
---|---|---|
amountMinimum | The minimum balance of the contract from which WETH is being unwrapped. Prevents malicious contracts from stealing WETH9 from users. | |
recipient | string | The recipient of the unwrapped ETH. |
feeOptions | An object that contains fee data for the unwrap transaction:
|
Returns
Type | Description |
---|---|
string | The hex encoded calldata to perform the WETH unwrapping. |
encodeSweepToken() - public
static
public
static
Handles the encoding of transferring all of a contract's token
balance with an optional fee.
Parameters
Params | Type | Description |
---|---|---|
token | The token to be transferred/swept. | |
amountMinimum | The minimum balance of the contract. Prevents malicious contracts from stealing WETH9 from users. | |
recipient | string | The recipient of the unwrapped ETH. |
feeOptions | An object that contains fee data for the unwrap transaction:
|
Returns
Type | Description |
---|---|
string | The hex encoded calldata to perform the token sweep operation. |
encodeRefundETH() - public
static
public
static
Handles the encoding of transferring all of a contract's ETH balance to the message sender.
Returns
Type | Description |
---|---|
string | The hex encoded calldata to perform the ETH refund operation. |
Last updated