Skip to content

Commit 8b18782

Browse files
committed
added execute command and removed from tsconfig
1 parent 84e4ce3 commit 8b18782

File tree

2 files changed

+61
-21
lines changed

2 files changed

+61
-21
lines changed

apps/portal/src/app/nebula/api-reference/page.mdx

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -407,40 +407,87 @@ const result = await handleNebulaResponse(data);
407407

408408
#### Execute Command
409409

410+
411+
410412
```bash
411413
POST /execute
412414
```
413-
414-
Execute specific blockchain commands or actions.
415+
Execute specific blockchain commands or actions. This endpoint is designed for direct command execution without the conversational context of the chat endpoint.
415416

416417
**Request Body:**
417418
```bash
418419
{
419-
"message": "Deploy a new ERC20 contract",
420-
"session_id": "sess_01HKW2ZH45JNQRTM0YPKJ6QXXX", // Optional
421-
"config": {
422-
"chain": "ethereum",
423-
"contract_name": "MyToken",
424-
"symbol": "MTK"
420+
"message": "send 0.0001 ETH on sepolia to vitalik.eth",
421+
"user_id": "default-user",
422+
"stream": false,
423+
"execute_config": {
424+
"mode": "client",
425+
"signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE"
425426
}
426427
}
427428
```
428429

430+
**Request Parameters:**
431+
- `message` (required): The command to execute
432+
- `user_id` (optional): Identifier for the user making the request
433+
- `stream` (optional): Whether to stream the response
434+
- `execute_config` (optional): Configuration for transaction execution
435+
- `mode`: Execution mode (currently only "client" is supported)
436+
- `signer_wallet_address`: Address that will sign the transaction
437+
438+
**Example Response:**
439+
```json
440+
{
441+
"message": "The transaction is to transfer 0.0001 ETH to the address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045. The transaction simulation indicates that it will most likely succeed. \n\nPlease go ahead and sign and confirm the transaction.",
442+
"actions": [
443+
{
444+
"session_id": "d8ca7326-fea4-4bcc-9bb7-9c84dd138379",
445+
"request_id": "40404a54-be4a-4540-8c97-d74f8c454d0e",
446+
"type": "sign_transaction",
447+
"source": "executor",
448+
"data": "{\"maxPriorityFeePerGas\": \"0x6a392bd\", \"maxFeePerGas\": \"0x546126ce9\", \"chainId\": 11155111, \"from\": \"0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE\", \"to\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\", \"data\": \"0x\", \"value\": \"0x5af3107a4000\", \"gas\": \"0x5208\"}"
449+
}
450+
],
451+
"session_id": "d8ca7326-fea4-4bcc-9bb7-9c84dd138379",
452+
"request_id": "40404a54-be4a-4540-8c97-d74f8c454d0e"
453+
}
454+
```
455+
429456
**Example curl:**
430457
```bash
431458
curl -X POST https://nebula-api.thirdweb.com/execute \
432459
-H "Content-Type: application/json" \
433460
-H "x-secret-key: YOUR_THIRDWEB_SECRET_KEY" \
434461
-d '{
435-
"message": "Deploy a new ERC20 contract",
436-
"config": {
437-
"chain": "ethereum",
438-
"contract_name": "MyToken",
439-
"symbol": "MTK"
462+
"message": "send 0.0001 ETH on sepolia to vitalik.eth",
463+
"user_id": "default-user",
464+
"stream": false,
465+
"execute_config": {
466+
"mode": "client",
467+
"signer_wallet_address": "0xc3F2b2a12Eba0f5989cD75B2964E31D56603a2cE"
440468
}
441469
}'
442470
```
443471

472+
**Response Properties:**
473+
- `message`: A human-readable description of the action to be taken
474+
- `actions`: Array of actions to be executed
475+
- `session_id`: Unique identifier for the session
476+
- `request_id`: Unique identifier for this request
477+
- `type`: The type of action (e.g., "sign_transaction")
478+
- `source`: Origin of the action
479+
- `data`: Transaction data in hexadecimal format including:
480+
- `maxPriorityFeePerGas`: Maximum priority fee per gas in hex
481+
- `maxFeePerGas`: Maximum fee per gas in hex
482+
- `chainId`: Network identifier
483+
- `from`: Sender's address
484+
- `to`: Recipient's address
485+
- `data`: Transaction data
486+
- `value`: Amount to send in hex
487+
- `gas`: Gas limit in hex
488+
- `session_id`: Session identifier for this execution
489+
- `request_id`: Unique identifier for this request
490+
444491
### Sessions
445492

446493
#### List Sessions

apps/portal/tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@
2828
},
2929
"forceConsistentCasingInFileNames": true
3030
},
31-
"include": [
32-
"next-env.d.ts",
33-
"**/*.ts",
34-
"**/*.tsx",
35-
".next/types/**/*.ts",
36-
"src/app/react/v5/components/onchain/page.mdx",
37-
"src/app/nebula/page.mdx"
38-
],
31+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
3932
"exclude": ["node_modules"],
4033
"ts-node": {
4134
"compilerOptions": {

0 commit comments

Comments
 (0)