LibTransaction
The LibTransaction
library provides functions for encoding and decoding a Transaction
struct into a byte array.
Field | Type | Description |
---|---|---|
Each named value is assigned an implicit integer value, starting at 0 for the first value and incrementing by 1 for each subsequent value. In this case, | ||
Each named value is assigned an implicit integer value, starting at 0 for the first value and incrementing by 1 for each subsequent value. In this case, | ||
the network id of the recipient chain. | ||
the address of the source asset address that will get swapped. Example: | ||
the address of the destination asset address that will be received after swapping.
Example:
| ||
the address of the recipient.
Example: | ||
the address of the aggregator at the destionation address. | ||
the minimum swapped amount that is acceptable by the user. Example: | ||
the gas fee that the user can pay for the swapping.
Example: | ||
the sequence we receive while transferring the tokens over the bridge. |
Field | Type | Description |
---|---|---|
This field is of type | ||
This field is of type | ||
This field is of type | ||
This field is of type | ||
This field is of type |
encode()
The encode
function takes a Transaction
struct and converts it into a byte array.
Input
Field | Type | Description |
---|---|---|
the transaction struct to perform the encoding. |
Output
Field | Type | Description |
---|---|---|
returns the encoded data in the form of bytes. |
decode()
The decode
function takes a byte array and converts it back into a Transaction
struct.
Input
Field | Type | Description |
---|---|---|
the payload in bytes that needs to be decoded |
Output
Field | Type | Description |
---|---|---|
returns the Transaction struct after the decoding is completed. |
Last updated