Skip to content

Commit

Permalink
Update Suave-std api reference (#119)
Browse files Browse the repository at this point in the history
Co-authored-by: metachris <[email protected]>
  • Loading branch information
github-actions[bot] and metachris authored Jun 6, 2024
1 parent 8f6558c commit 0583482
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 40 deletions.
28 changes: 14 additions & 14 deletions docs/tools/suave-std/Transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Transactions is a library with utilities to encode, decode and sign Ethereum tra

## Functions

### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L109)
### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L110)

Encode a EIP-155 transaction in RLP.

Expand All @@ -16,7 +16,7 @@ Output:

- `output` (`bytes`): The encoded RLP bytes.

### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L133)
### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L134)

Encode a EIP-1559 request transaction in RLP.

Expand All @@ -28,7 +28,7 @@ Output:

- `output` (`bytes`): The encoded RLP bytes.

### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L157)
### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L158)

Encode a EIP-1559 transaction in RLP.

Expand All @@ -40,7 +40,7 @@ Output:

- `output` (`bytes`): The encoded RLP bytes.

### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L200)
### [encodeRLP](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L201)

Encode a EIP-1559 request transaction in RLP.

Expand All @@ -52,7 +52,7 @@ Output:

- `output` (`bytes`): The encoded RLP bytes.

### [decodeRLP_EIP155](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L239)
### [decodeRLP_EIP155](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L240)

Decode a EIP-155 transaction from RLP.

Expand All @@ -64,7 +64,7 @@ Output:

- `txStruct` ([EIP155](#eip155)): The transaction structure.

### [decodeRLP_EIP155Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L267)
### [decodeRLP_EIP155Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L268)

Decode a EIP-155 request transaction from RLP.

Expand All @@ -76,7 +76,7 @@ Output:

- `txStruct` ([EIP155Request](#eip155request)): The transaction structure.

### [decodeRLP_EIP1559](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L293)
### [decodeRLP_EIP1559](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L294)

Decode a EIP-1559 transaction from RLP.

Expand All @@ -88,7 +88,7 @@ Output:

- `txStruct` ([EIP1559](#eip1559)): The transaction structure.

### [decodeRLP_EIP1559Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L330)
### [decodeRLP_EIP1559Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L331)

Decode a EIP-1559 request transaction from RLP.

Expand All @@ -100,7 +100,7 @@ Output:

- `txStruct` ([EIP1559Request](#eip1559request)): The transaction structure.

### [signTxn](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L371)
### [signTxn](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L372)

Sign a EIP-155 transaction request.

Expand All @@ -114,7 +114,7 @@ Output:

- `response` ([EIP1559](#eip1559)): The signed transaction.

### [signTxn](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L400)
### [signTxn](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L401)

Sign a EIP-155 transaction request.

Expand All @@ -130,7 +130,7 @@ Output:

## Structs

### [EIP155](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L25)
### [EIP155](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L26)

EIP-155 transaction structure.

Expand All @@ -145,7 +145,7 @@ EIP-155 transaction structure.
- `s` (`bytes32`): Is the 's' signature value.
- `v` (`uint256`): Is the 'v' signature value.

### [EIP155Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L46)
### [EIP155Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L47)

EIP-155 transaction request structure.

Expand All @@ -157,7 +157,7 @@ EIP-155 transaction request structure.
- `data` (`bytes`): Is the transaction data.
- `chainId` (`uint256`): Is the id of the chain where the transaction will be executed.

### [EIP1559](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L69)
### [EIP1559](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L70)

EIP-1559 transaction structure.

Expand All @@ -174,7 +174,7 @@ EIP-1559 transaction structure.
- `s` (`bytes32`): Is the 's' signature value.
- `v` (`uint256`): Is the 'v' signature value.

### [EIP1559Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L94)
### [EIP1559Request](https://github.com/flashbots/suave-std/tree/main/src/Transactions.sol#L95)

EIP-1559 transaction request structure.

Expand Down
18 changes: 17 additions & 1 deletion docs/tools/suave-std/protocols/ChatGPT.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,23 @@ Input:

- `_apiKey` (`string`): The API key to interact with the OpenAI ChatGPT.

### [complete](https://github.com/flashbots/suave-std/tree/main/src/protocols/ChatGPT.sol#L32)
### [complete](https://github.com/flashbots/suave-std/tree/main/src/protocols/ChatGPT.sol#L34)

Complete a chat with the OpenAI ChatGPT.

Input:

- `messages` (``): The messages to complete the chat.

- `model` (`string`): The model of ChatGPT.

- `temperature` (`string`): The temperature of this request.

Output:

- `message` (`string`): The response from the OpenAI ChatGPT.

### [complete](https://github.com/flashbots/suave-std/tree/main/src/protocols/ChatGPT.sol#L61)

Complete a chat with the OpenAI ChatGPT.

Expand Down
32 changes: 30 additions & 2 deletions docs/tools/suave-std/protocols/EthJsonRPC.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EthJsonRPC is a library with utilities to interact with an Ethereum JSON-RPC end

## Functions

### [nonce](https://github.com/flashbots/suave-std/tree/main/src/protocols/EthJsonRPC.sol#L23)
### [nonce](https://github.com/flashbots/suave-std/tree/main/src/protocols/EthJsonRPC.sol#L28)

Get the nonce of an address.

Expand All @@ -16,7 +16,19 @@ Output:

- `val` (`uint256`): The nonce of the address.

### [call](https://github.com/flashbots/suave-std/tree/main/src/protocols/EthJsonRPC.sol#L39)
### [balance](https://github.com/flashbots/suave-std/tree/main/src/protocols/EthJsonRPC.sol#L43)

Get the balance of an address.

Input:

- `addr` (`address`): The address to get the balance.

Output:

- `val` (`uint256`): The balance of the address.

### [call](https://github.com/flashbots/suave-std/tree/main/src/protocols/EthJsonRPC.sol#L59)

Call a contract function.

Expand All @@ -29,3 +41,19 @@ Input:
Output:

- `the` (`bytes`): Result of the function call.

### [call](https://github.com/flashbots/suave-std/tree/main/src/protocols/EthJsonRPC.sol#L78)

Call a contract function with a state override.

Input:

- `to` (`address`): The address of the contract.

- `data` (`bytes`): The data of the function.

- `accountOverride` (``): The state override.

Output:

- `the` (`bytes`): Result of the function call.
Loading

0 comments on commit 0583482

Please sign in to comment.