Router
The single entry point for users to interact with. The Router forwards the data to an Agent when executing a transaction.
Last updated
The single entry point for users to interact with. The Router forwards the data to an Agent when executing a transaction.
Last updated
The Router provides a single entry point for users to operate protocols in an intuitive and concise manner. Within the Router, users can execute operations by calling the execute()
function.
The function serves as the core interface for users to execute transactions. It requires three parameters:
permit2Datas
: The Permit2 data for pulling tokens from the user address.
logics
: The operations for Protocolink to interact with other protocols.
tokensReturn
: The specified tokens should be sent back to the user address at the end of the transaction.
Though Protocolink provides the Execute Transactions for users to operate protocols in a single transaction, it would take users a bunch of time to build the parameters. To solve this issue, Protocolink provides the executeWithSignerFee()
function.
permit2Datas
: The Permit2 data for pulling tokens from the user address.
logicBatch
: The operations for Protocolink to interact with other protocols.
signer
: The address that signed the logicBatch
.
signature
: The hash value of the signed logicBatch
.
tokensReturn
: The specified tokens should be sent back to the user address at the end of the transaction.
Users (aka. delegators) can delegate their Agent to other users (aka. delegatee). When an Agent is delegated, the delegatee is allowed to send transactions on the delegator's behalf by calling the executeFor()
function.
user
: The delegator address.
permit2Datas
: The Permit2 data for pulling tokens from the user address.
logics
: The operations for Protocolink to interact with other protocols.
tokensReturn
: The specified tokens should be sent back to the user address at the end of the transaction.
Same as Execute Transactions with API Data, delegatees can call the Router contract with API data by using the executeForWithSignerFee()
function.
user
: The delegator address.
permit2Datas
: The Permit2 data for pulling tokens from the user address.
logicBatch
: The operations for Protocolink to interact with other protocols.
signer
: The address that signed the logicBatch
.
signature
: The hash value of the signed logicBatch
.
tokensReturn
: The specified tokens should be sent back to the user address at the end of the transaction.
If users do not require a standalone delegatee, they can share their signature instead. A signature is signed by a delegator and it represents the hash value of the details
. The details
includes a nonce
value to ensure it can only be used once before the deadline
. Now, anyone with a signature can call the executeBySig()
function to send a transaction on behalf of the delegator.
details
: The operations for Protocolink to interact with other protocols.
user
: The delegator address.
signature
: The hash value of the signed logicBatch
.
Same as Execute Transactions with API Data, anyone can call the Router contract with a signature and API data by using the executeBySigWithSignerFee()
function.
details
: The operations for Protocolink to interact with other protocols.
user
: The delegator address.
userSignature
: The hash value of the signed details
.
signer
: The address that signed the logicBatch
from the details
.
signerSignature
: The hash value of the signed logicBatch
.
The function serves as the core interface for users to execute transactions with Protocolink API data. It requires five parameters:
The also includes other information like fees. Check more details of the Fees.
The function serves as the core interface for delegatees to execute transactions. It requires four parameters:
To delegate their Agent, delegators need to the delegatee with an expiry value. The expiry value ensures that the Agent is delegated within a period.
If users want to revoke the delegation from a delegatee before the expiry, users need to provide the delegatee address to the function.
The function serves as the core interface for delegatees to execute transactions with API data. It requires six parameters:
The also includes other information like fees
. Check more details of the Fees.
The function serves as the core interface for anyone to execute transactions with signatures. It requires three parameters:
The also includes other information like permit2Datas
.
The function serves as the core interface for anyone to execute a transaction with the signatures and API data. It requires five parameters:
The also includes other information like permit2Datas
.