1Shot icon

1Shot

Interact with the blockchain and web3 via 1Shot API

Actions5

Overview

The node integrates with the 1Shot API to interact with blockchain and web3 functionalities. Specifically, for the "1Shot Prompt" resource with the "Search Prompts" operation, it allows users to search for available prompts (tools or contract descriptions) that can be used dynamically in workflows based on a query string and a specified blockchain network (chain). This is useful for developers or automation engineers who want to discover smart contract interaction templates or tools relevant to their use case without manually browsing external resources.

Practical example:
A user wants to find predefined prompts related to token transfers on the Ethereum mainnet. They provide a search query like "token transfer" and select the Ethereum chain. The node returns matching prompts that can then be used to automate interactions with those contracts.

Properties

Name Meaning
Query A text string to search 1Shot Prompts for relevant tools or contract descriptions matching this query.
Chain Name or ID Select the blockchain network by name or specify its Chain ID. Options include Ethereum, Sepolia, Base, Avalanche, etc.

Output

The output is a JSON array containing the search results from the 1Shot API. Each item represents a prompt or contract description matching the query on the specified blockchain network. The exact structure depends on the API response but typically includes details such as prompt identifiers, descriptions, and metadata needed to use these prompts in further workflow steps.

No binary data output is produced by this operation.

Dependencies

  • Requires an OAuth2 API credential configured in n8n to authenticate requests to the 1Shot API.
  • The node makes HTTP POST requests to https://api.1shotapi.com/v0/contracts/descriptions/search.
  • The user must have valid access tokens for the 1Shot API.

Troubleshooting

  • Common issues:

    • Invalid or expired OAuth2 credentials will cause authentication failures.
    • Providing an empty or invalid query string may result in no results or errors.
    • Selecting an unsupported chain ID or name could lead to unexpected responses or empty results.
  • Error messages:

    • "Unsupported resource" or "Unsupported operation" errors indicate misconfiguration of the resource or operation parameters.
    • HTTP 403 errors usually mean the OAuth2 token is invalid or expired; refreshing credentials or re-authenticating resolves this.
    • Network or API errors should be checked by verifying internet connectivity and API service status.

Links and References

Discussion