Skip to content

Commit

Permalink
Update more
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranbt committed Mar 13, 2024
1 parent 25e1328 commit 35a0559
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 212 deletions.
8 changes: 4 additions & 4 deletions docs/concepts/suave-std/Context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ Context is a library with functions to retrieve the context of the MEVM executio

### [confidentialInputs](https://github.com/flashbots/suave-std/tree/main/src/Context.sol#L10)

returns the confidential inputs of the confidential compute request.
Returns the confidential inputs of the confidential compute request.

Output:

- "output": bytes of the confidential inputs.
- `output` (`bytes`): Bytes of the confidential inputs.

### [kettleAddress](https://github.com/flashbots/suave-std/tree/main/src/Context.sol#L16)

returns the address of the Kettle that executes the confidential compute request.
Returns the address of the Kettle that executes the confidential compute request.

Output:

- "kettleAddress": address of the kettle.
- `kettleAddress` (`address`): Address of the kettle.
24 changes: 12 additions & 12 deletions docs/concepts/suave-std/Random.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,48 @@ Random is a library with utilities to generate random data.

### [randomUint8](https://github.com/flashbots/suave-std/tree/main/src/Random.sol#L10)

generate a random uint8 number.
Generate a random uint8 number.

Output:

- "value": is the random number
- `value` (`uint8`): Is the random number.

### [randomUint16](https://github.com/flashbots/suave-std/tree/main/src/Random.sol#L19)

generate a random uint16 number.
Generate a random uint16 number.

Output:

- "value": is the random number
- `value` (`uint16`): Is the random number.

### [randomUint32](https://github.com/flashbots/suave-std/tree/main/src/Random.sol#L28)

generate a random uint32 number.
Generate a random uint32 number.

Output:

- "value": is the random number
- `value` (`uint32`): Is the random number.

### [randomUint64](https://github.com/flashbots/suave-std/tree/main/src/Random.sol#L37)

generate a random uint64 number.
Generate a random uint64 number.

Output:

- "value": is the random number
- `value` (`uint64`): Is the random number.

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

generate a random uint128 number.
Generate a random uint128 number.

Output:

- "value": is the random number
- `value` (`uint128`): Is the random number.

### [randomUint256](https://github.com/flashbots/suave-std/tree/main/src/Random.sol#L55)

generate a random uint256 number.
Generate a random uint256 number.

Output:

- "value": is the random number
- `value` (`uint256`): Is the random number.
2 changes: 1 addition & 1 deletion docs/concepts/suave-std/Suapp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Suapp is a contract with general utilities for a Suapp.

### [emitOffchainLogs](https://github.com/flashbots/suave-std/tree/main/src/Suapp.sol#L9)

modifier to emit the offchain logs.
Modifier to emit the offchain logs.
140 changes: 70 additions & 70 deletions docs/concepts/suave-std/Transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,184 +6,184 @@ Transactions is a library with utilities to encode, decode and sign Ethereum tra

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

encode a EIP-155 transaction in RLP.
Encode a EIP-155 transaction in RLP.

Input:

- "txStruct": is the transaction structure.
- `txStruct` ([EIP155](#eip155)): Is the transaction structure.

Output:

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

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

encode a EIP-1559 request transaction in RLP.
Encode a EIP-1559 request transaction in RLP.

Input:

- "txStruct": is the transaction structure.
- `txStruct` ([EIP155Request](#eip155request)): Is the transaction structure.

Output:

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

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

encode a EIP-1559 transaction in RLP.
Encode a EIP-1559 transaction in RLP.

Input:

- "txStruct": is the transaction structure.
- `txStruct` ([EIP1559](#eip1559)): Is the transaction structure.

Output:

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

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

encode a EIP-1559 request transaction in RLP.
Encode a EIP-1559 request transaction in RLP.

Input:

- "txStruct": is the transaction structure.
- `txStruct` ([EIP1559Request](#eip1559request)): Is the transaction structure.

Output:

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

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

decode a EIP-155 transaction from RLP.
Decode a EIP-155 transaction from RLP.

Input:

- "rlp": is the encoded RLP bytes.
- `rlp` (`bytes`): Is the encoded RLP bytes.

Output:

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

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

decode a EIP-155 request transaction from RLP.
Decode a EIP-155 request transaction from RLP.

Input:

- "rlp": is the encoded RLP bytes.
- `rlp` (`bytes`): Is the encoded RLP bytes.

Output:

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

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

decode a EIP-1559 transaction from RLP.
Decode a EIP-1559 transaction from RLP.

Input:

- "rlp": is the encoded RLP bytes.
- `rlp` (`bytes`): Is the encoded RLP bytes.

Output:

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

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

decode a EIP-1559 request transaction from RLP.
Decode a EIP-1559 request transaction from RLP.

Input:

- "rlp": is the encoded RLP bytes.
- `rlp` (`bytes`): Is the encoded RLP bytes.

Output:

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

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

sign a EIP-155 transaction request.
Sign a EIP-155 transaction request.

Input:

- "request": is the transaction request.
- `request` ([EIP1559Request](#eip1559request)): Is the transaction request.

- "signingKey": is the private key to sign the transaction.
- `signingKey` (`string`): Is the private key to sign the transaction.

Output:

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

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

sign a EIP-155 transaction request.
Sign a EIP-155 transaction request.

Input:

- "request": is the transaction request.
- `request` ([EIP155Request](#eip155request)): Is the transaction request.

- "signingKey": is the private key to sign the transaction.
- `signingKey` (`string`): Is the private key to sign the transaction.

Output:

- "response": the signed transaction.
- `response` ([EIP155](#eip155)): The signed transaction.

## Structs

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

EIP-155 transaction structure.

- "to": is the target address.
- "gas": is the gas limit.
- "gasPrice": is the gas price.
- "value": is the transfer value in gwei.
- "nonce": is the latest nonce of the sender.
- "data": is the transaction data.
- "chainId": is the id of the chain where the transaction will be executed.
- "r": is the 'r' signature value.
- "s": is the 's' signature value.
- "v": is the 'v' signature value.
- `to` (`address`): Is the target address.
- `gas` (`uint256`): Is the gas limit.
- `gasPrice` (`uint256`): Is the gas price.
- `value` (`uint256`): Is the transfer value in gwei.
- `nonce` (`uint256`): Is the latest nonce of the sender.
- `data` (`bytes`): Is the transaction data.
- `chainId` (`uint256`): Is the id of the chain where the transaction will be executed.
- `r` (`bytes32`): Is the 'r' signature value.
- `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)

EIP-155 transaction request structure.

- "to": is the target address.
- "gas": is the gas limit.
- "gasPrice": is the gas price.
- "value": is the transfer value in gwei.
- "nonce": is the latest nonce of the sender.
- "data": is the transaction data.
- "chainId": is the id of the chain where the transaction will be executed.
- `to` (`address`): Is the target address.
- `gas` (`uint256`): Is the gas limit.
- `gasPrice` (`uint256`): Is the gas price.
- `value` (`uint256`): Is the transfer value in gwei.
- `nonce` (`uint256`): Is the latest nonce of the sender.
- `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)

EIP-1559 transaction structure.

- "to": is the target address.
- "gas": is the gas limit.
- "maxFeePerGas": is the maximum fee per gas.
- "maxPriorityFeePerGas": is the maximum priority fee per gas.
- "value": is the transfer value in gwei.
- "nonce": is the latest nonce of the sender.
- "data": is the transaction data.
- "chainId": is the id of the chain where the transaction will be executed.
- "accessList": is the access list.
- "r": is the 'r' signature value.
- "s": is the 's' signature value.
- "v": is the 'v' signature value.
- `to` (`address`): Is the target address.
- `gas` (`uint256`): Is the gas limit.
- `maxFeePerGas` (`uint256`): Is the maximum fee per gas.
- `maxPriorityFeePerGas` (`uint256`): Is the maximum priority fee per gas.
- `value` (`uint256`): Is the transfer value in gwei.
- `nonce` (`uint256`): Is the latest nonce of the sender.
- `data` (`bytes`): Is the transaction data.
- `chainId` (`uint256`): Is the id of the chain where the transaction will be executed.
- `accessList` (`bytes`): Is the access list.
- `r` (`bytes32`): Is the 'r' signature value.
- `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)

EIP-1559 transaction request structure.

- "to": is the target address.
- "gas": is the gas limit.
- "maxFeePerGas": is the maximum fee per gas.
- "maxPriorityFeePerGas": is the maximum priority fee per gas.
- "value": is the transfer value in gwei.
- "nonce": is the latest nonce of the sender.
- "data": is the transaction data.
- "chainId": is the id of the chain where the transaction will be executed.
- "accessList": is the access list.
- `to` (`address`): Is the target address.
- `gas` (`uint256`): Is the gas limit.
- `maxFeePerGas` (`uint256`): Is the maximum fee per gas.
- `maxPriorityFeePerGas` (`uint256`): Is the maximum priority fee per gas.
- `value` (`uint256`): Is the transfer value in gwei.
- `nonce` (`uint256`): Is the latest nonce of the sender.
- `data` (`bytes`): Is the transaction data.
- `chainId` (`uint256`): Is the id of the chain where the transaction will be executed.
- `accessList` (`bytes`): Is the access list.
31 changes: 21 additions & 10 deletions docs/concepts/suave-std/protocols/Bundle.mdx
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
# Bundle

Bundle is a library with utilities to interact with the Flashbots bundle API described in https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#eth_sendbundle
Bundle is a library with utilities to interact with the Flashbots bundle API described in https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#eth_sendbundle.

## Functions

### [sendBundle](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L25)
### [sendBundle](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L30)

send a bundle to the Flashbots relay.
Send a bundle to the Flashbots relay.

Input:

- "url": the URL of the Flashbots relay.
- `url` (`string`): The URL of the Flashbots relay.

- "bundle": the bundle to send.
- `bundle` ([BundleObj](#bundleobj)): The bundle to send.

Output:

- "response": raw bytes response from the Flashbots relay.
- `response` (`bytes`): Raw bytes response from the Flashbots relay.

### [decodeBundle](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L77)
### [decodeBundle](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L82)

decode a bundle from a JSON string.
Decode a bundle from a JSON string.

Input:

- "bundleJson": the JSON string of the bundle.
- `bundleJson` (`string`): The JSON string of the bundle.

Output:

- "bundle": the decoded bundle.
- `bundle` ([BundleObj](#bundleobj)): The decoded bundle.

## Structs

### [BundleObj](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L16)

BundleObj is a struct that represents a bundle to be sent to the Flashbots relay.

- `blockNumber` (`uint64`): The block number at which the bundle should be executed.
- `minTimestamp` (`uint64`): The minimum timestamp at which the bundle should be executed.
- `maxTimestamp` (`uint64`): The maximum timestamp at which the bundle should be executed.
- `txns` (``): The transactions to be included in the bundle.
Loading

0 comments on commit 35a0559

Please sign in to comment.