1Shot API icon

1Shot API

Interact with EVM blockchains via 1Shot API

Contract Method → Execute as Delegator

AI-generated

Overview

This node operation allows executing a contract method on an EVM blockchain as a delegator using the 1Shot API. It is useful when you want to perform contract method calls on behalf of another wallet (delegator) by specifying delegation details such as delegator wallet address, delegation ID, or delegation data. This operation supports passing parameters to the contract method and additional optional fields like wallet ID, memo, contract address override, value, authorization list, and gas limit.

Use Case Examples

  1. Executing a contract method to transfer tokens on behalf of a delegator wallet by specifying the delegator's wallet address and method parameters.
  2. Using a delegation ID to ensure the correct delegation is used for executing a contract method that interacts with a smart contract.
  3. Passing delegation data as a JSON object to perform a one-time delegated contract method execution without storing the delegation in the API.

Properties

Name Meaning
Contract Method Name or ID The identifier or name of the contract method to execute as a delegator. This is required to specify which contract method to call.
Parameters JSON object containing the parameters to pass to the contract method. This allows specifying method arguments in JSON format.
Delegator Wallet Address The address of the delegator wallet to use for the contract method execution. Only one of delegatorAddress, delegationId, or delegationData can be used.
Delegation ID The ID of a specific delegation to use for the transaction. This ensures the correct delegation is used. Only one of delegatorAddress, delegationId, or delegationData can be used.
Delegation Data A JSON object representing a delegation to use for the transaction. Treated as a one-time use delegation and not stored for reuse. Only one of delegatorAddress, delegationId, or delegationData can be used.
Additional Fields Optional additional fields to customize the contract method execution, including wallet ID, memo, contract address override, value to send, authorization list, and gas limit.

Output

JSON

  • json - The JSON response from executing the contract method as a delegator, containing transaction details or execution result.

Dependencies

  • 1Shot API OAuth2 credentials

Troubleshooting

  • Ensure only one of delegatorWalletAddress, delegationId, or delegationData is provided to avoid conflicts.
  • Verify that the contract method ID or name is valid and exists in the 1Shot API.
  • Check that the parameters JSON is correctly formatted and matches the contract method's expected inputs.
  • If the transaction fails, review the gas limit and value fields to ensure they are sufficient and correctly specified.
  • Authentication errors may occur if the OAuth2 credentials are invalid or expired; re-authenticate if needed.

Discussion