Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions nexus-sdk/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ Owned OwnerCap object must be passed to this command for authorization.
This command requires that a wallet is connected to the CLI...
{% endhint %}

---

**`nexus tool set-invocation-cost --tool-fqn <fqn> --owner-cap <object_id> --invocation-cost <mist>`**

Tool owners can change the invocation cost of their Tools specified by the FQN. This operation requires that the `OwnerCap<OverGas>` object is passed to the command and owned by the transaction sender.

<!-- TODO: <https://github.com/Talus-Network/nexus-next/issues/283> -->

{% hint style="info" %}
This command requires that a wallet is connected to the CLI...
{% endhint %}

---

**`nexus tool list`**

List all Nexus Tools available in the Tool Registry. This reads the dynamic object directly from Sui.
Expand Down Expand Up @@ -178,6 +192,40 @@ This command requires that a wallet is connected to the CLI...

---

**`nexus gas expiry enable --tool-fqn <fqn> --owner-cap <object_id> --cost-per-minute <mist>`**

The tool owners can enable the expiry gas extension for their tools specified by the FQN. This operation requires that the `OwnerCap<OverGas>` object is passed to the command and owned by the transaction sender. This allows users to buy expiry gas tickets that can be used to pay for the tool usage for a limited amount of time.

Calling this command again with a different `cost-per-minute` value will update the cost of the tickets.

{% hint style="info" %}
This command requires that a wallet is connected to the CLI...
{% endhint %}

---

**`nexus gas expiry disable --tool-fqn <fqn> --owner-cap <object_id>`**

Disables the expiry gas extension for the tool specified by the FQN. This operation requires that the `OwnerCap<OverGas>` object is passed to the command and owned by the transaction sender.

{% hint style="info" %}
This command requires that a wallet is connected to the CLI...
{% endhint %}

---

**`nexus gas expiry buy-ticket --tool-fqn <fqn> --minutes <minutes> --coin <object_id>`**

Buy an expiry gas ticket for the tool specified by the FQN. This ticket can then be used to pay for the tool usage for the specified amount of `minutes` if a DAG is executed from the same address that was used to buy this ticket. The ticket is paid for with the provided `coin` object.

This transaction fails if the tool does not have the expiry gas extension enabled.

{% hint style="info" %}
This command requires that a wallet is connected to the CLI...
{% endhint %}

---

### `nexus network`

Set of commands for managing Nexus networks.
Expand Down
2 changes: 1 addition & 1 deletion nexus-sdk/guides/math-branching-with-chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,5 +621,5 @@ This extended DAG demonstrates how to combine mathematical computation with natu

<!-- List of references -->

[math-branching-entry-guide]: ./math-branching-dag-entry.md
[math-branching-entry-guide]: ./math_branching-dag-entry.md
[llm-openai-chat-prep-tool]: ./llm-openai-chat-prep-tool.md
86 changes: 86 additions & 0 deletions tools/social-twitter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,91 @@ The tweet mentions retrieval failed.

---

# `xyz.taluslabs.social.twitter.get-tweets@1`

Standard Nexus Tool that retrieves multiple tweets by their IDs from the Twitter API. Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets)

## Input

**`bearer_token`: [`String`]**

The bearer token for the user's Twitter account.

**`ids`: [`Vec<String>`]**

A list of Tweet IDs to retrieve. Up to 100 are allowed in a single request.

_opt_ **`tweet_fields`: [`Option<Vec<String>>`]** _default_: [`None`]

A list of Tweet fields to display.

_opt_ **`expansions`: [`Option<Vec<String>>`]** _default_: [`None`]

A list of fields to expand.

_opt_ **`media_fields`: [`Option<Vec<String>>`]** _default_: [`None`]

A list of Media fields to display.

_opt_ **`poll_fields`: [`Option<Vec<String>>`]** _default_: [`None`]

A list of Poll fields to display.

_opt_ **`user_fields`: [`Option<Vec<String>>`]** _default_: [`None`]

A list of User fields to display.

_opt_ **`place_fields`: [`Option<Vec<String>>`]** _default_: [`None`]

A list of Place fields to display.

## Output Variants & Ports

**`ok`**

The tweets were retrieved successfully.

- **`ok.data`: [`Vec<Tweet>`]** - The collection of retrieved tweets.
- **`ok.includes`: [`Option<Includes>`]** - Additional data included in the response (users, media, polls, etc.)
- **`ok.meta`: [`Option<Meta>`]** - Metadata about the response.

**`err`**

The tweets could not be retrieved due to an error.

- **`err.kind`: [`TwitterErrorKind`]** - The type of error that occurred. Possible values:

- `network` - A network-related error occurred when connecting to Twitter
- `connection` - Could not establish a connection to Twitter
- `timeout` - The request to Twitter timed out
- `parse` - Failed to parse Twitter's response
- `auth` - Authentication or authorization error
- `not_found` - The requested tweet or resource was not found
- `rate_limit` - Twitter's rate limit was exceeded
- `server` - An error occurred on Twitter's servers
- `forbidden` - The request was forbidden
- `api` - An API-specific error occurred
- `unknown` - An unexpected error occurred

- **`err.reason`: [`String`]** - The reason for the error. This could be:

- Twitter API error (e.g., "Twitter API returned errors: Not Found Error: Could not find tweet with id: [1346889436626259969].")
- Network error (e.g., "Network error: network error: Connection refused")
- Response parsing error (e.g., "Response parsing error: expected value at line 1 column 1")
- Status code error (e.g., "Twitter API status error: 429 Too Many Requests")
- "No tweet data or errors found in the response" when the API response is empty
- Unauthorized error (e.g., "Unauthorized")
- Other error types handled by the centralized error handling mechanism

- **`err.status_code`: [`Option<u16>`]** - The HTTP status code returned by Twitter, if available. Common codes include:
- `401` - Unauthorized (authentication error)
- `403` - Forbidden
- `404` - Not Found
- `429` - Too Many Requests (rate limit exceeded)
- `5xx` - Server errors

---

# `xyz.taluslabs.social.twitter.get-user-by-id@1`

Standard Nexus Tool that retrieves a user from the Twitter API by their ID. Twitter api [reference](https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id)
Expand Down Expand Up @@ -981,6 +1066,7 @@ The ID of the user to add to the list.

The user was successfully added to the list.

- \*\*`ok.is_member`
- **`ok.is_member`** - Confirmation that the user is a member of the list (true).

**`err`**
Expand Down