diff --git a/docs/tools/suave-std/Suapp.mdx b/docs/tools/suave-std/Suapp.mdx index 18f69fe5..9ae7e1d5 100755 --- a/docs/tools/suave-std/Suapp.mdx +++ b/docs/tools/suave-std/Suapp.mdx @@ -4,6 +4,6 @@ Suapp is a contract with general utilities for a Suapp. ## Functions -### [emitOffchainLogs](https://github.com/flashbots/suave-std/tree/main/src/Suapp.sol#L9) +### [emitOffchainLogs](https://github.com/flashbots/suave-std/tree/main/src/Suapp.sol#L10) Modifier to emit the offchain logs. diff --git a/docs/tools/suave-std/protocols/Bundle.mdx b/docs/tools/suave-std/protocols/Bundle.mdx index bd491b90..0d747d62 100755 --- a/docs/tools/suave-std/protocols/Bundle.mdx +++ b/docs/tools/suave-std/protocols/Bundle.mdx @@ -18,7 +18,31 @@ Output: - `response` (`bytes`): Raw bytes response from the Flashbots relay. -### [decodeBundle](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L82) +### [encodeBundleParams](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L39) + +Encode a bundle in json format. + +Input: + +- `args` ([BundleObj](#bundleobj)): The bundle to encode. + +Output: + +- `params` (`bytes`): JSON-encoded bytes: `{blockNumber, txs, minTimestamp, maxTimestamp}`. + +### [encodeBundle](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L61) + +Encode a call to `eth_sendBundle` as an HttpRequest. + +Input: + +- `args` ([BundleObj](#bundleobj)): The bundle to encode. + +Output: + +- `request` ([HttpRequest](../suavelib/Suave.sol#httprequest)): The HttpRequest to send the bundle. + +### [decodeBundle](https://github.com/flashbots/suave-std/tree/main/src/protocols/Bundle.sol#L90) Decode a bundle from a JSON string. diff --git a/docs/tools/suave-std/suavelib/Suave.mdx b/docs/tools/suave-std/suavelib/Suave.mdx index fa1283d0..6180b767 100755 --- a/docs/tools/suave-std/suavelib/Suave.mdx +++ b/docs/tools/suave-std/suavelib/Suave.mdx @@ -4,7 +4,7 @@ Library to interact with the Suave MEVM precompiles. ## Functions -### [isConfidential](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L153) +### [isConfidential](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L155) Returns whether execution is off- or on-chain. @@ -12,7 +12,7 @@ Output: - `b` (`bool`): Whether execution is off- or on-chain. -### [buildEthBlock](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L172) +### [buildEthBlock](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L174) Constructs an Ethereum block based on the provided data records. No blobs are returned. @@ -30,7 +30,7 @@ Output: - `executionPayload` (`bytes`): Execution payload encoded in JSON. -### [buildEthBlockTo](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L191) +### [buildEthBlockTo](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L193) Constructs an Ethereum block based on the provided data records. No blobs are returned. @@ -50,7 +50,7 @@ Output: - `executionPayload` (`bytes`): Execution payload encoded in JSON. -### [confidentialInputs](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L208) +### [confidentialInputs](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L210) Provides the confidential inputs associated with a confidential computation request. Outputs are in bytes format. @@ -58,7 +58,7 @@ Output: - `confindentialData` (`bytes`): Confidential inputs. -### [confidentialRetrieve](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L221) +### [confidentialRetrieve](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L223) Retrieves data from the confidential store. Also mandates the caller's presence in the `AllowedPeekers` list. @@ -72,7 +72,7 @@ Output: - `value` (`bytes`): Value of the data. -### [confidentialStore](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L234) +### [confidentialStore](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L236) Stores data in the confidential store. Requires the caller to be part of the `AllowedPeekers` for the associated data record. @@ -84,7 +84,7 @@ Input: - `value` (`bytes`): Value of the data to store. -### [contextGet](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L244) +### [contextGet](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L246) Retrieves a value from the context. @@ -96,7 +96,7 @@ Output: - `value` (`bytes`): Value of the key. -### [doHTTPRequest](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L256) +### [doHTTPRequest](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L258) Performs an HTTP request and returns the response. `request` is the request to perform. @@ -108,7 +108,7 @@ Output: - `httpResponse` (`bytes`): Body of the response. -### [ethcall](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L269) +### [ethcall](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L271) Uses the `eth_call` JSON RPC method to let you simulate a function call and return the response. @@ -122,7 +122,7 @@ Output: - `callOutput` (`bytes`): Output of the contract call. -### [extractHint](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L281) +### [extractHint](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L283) Interprets the bundle data and extracts hints, such as the `To` address and calldata. @@ -134,7 +134,7 @@ Output: - `hints` (`bytes`): List of hints encoded in JSON. -### [fetchDataRecords](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L295) +### [fetchDataRecords](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L297) Retrieves all data records correlating with a specified decryption condition and namespace. @@ -148,7 +148,7 @@ Output: - `dataRecords` (``): List of data records that match the filter. -### [fillMevShareBundle](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L307) +### [fillMevShareBundle](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L309) Joins the user's transaction and with the backrun, and returns encoded mev-share bundle. The bundle is ready to be sent via `SubmitBundleJsonRPC`. @@ -160,7 +160,7 @@ Output: - `encodedBundle` (`bytes`): Mev-Share bundle encoded in JSON. -### [newBuilder](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L319) +### [newBuilder](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L321) Initializes a new remote builder session. @@ -168,7 +168,7 @@ Output: - `sessionid` (`string`): ID of the remote builder session. -### [newDataRecord](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L334) +### [newDataRecord](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L336) Initializes data records within the ConfidentialStore. Prior to storing data, all data records should undergo initialization via this precompile. @@ -186,7 +186,7 @@ Output: - `dataRecord` ([DataRecord](#datarecord)): Data record that was created. -### [privateKeyGen](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L352) +### [privateKeyGen](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L354) Generates a private key in ECDA secp256k1 format. @@ -198,7 +198,7 @@ Output: - `privateKey` (`string`): Hex encoded string of the ECDSA private key. Exactly as a signMessage precompile wants. -### [randomBytes](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L364) +### [randomBytes](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L366) Generates a number of random bytes, given by the argument numBytes. @@ -210,7 +210,7 @@ Output: - `value` (`bytes`): Randomly-generated bytes. -### [signEthTransaction](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L378) +### [signEthTransaction](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L380) Signs an Ethereum Transaction, 1559 or Legacy, and returns raw signed transaction bytes. `txn` is binary encoding of the transaction. @@ -226,7 +226,7 @@ Output: - `signedTxn` (`bytes`): Signed transaction encoded in RLP. -### [signMessage](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L395) +### [signMessage](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L397) Signs a message and returns the signature. @@ -242,7 +242,7 @@ Output: - `signature` (`bytes`): Signature of the message with the private key. -### [simulateBundle](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L411) +### [simulateBundle](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L413) Performs a simulation of the bundle by building a block that includes it. @@ -254,7 +254,7 @@ Output: - `effectiveGasPrice` (`uint64`): Effective Gas Price of the resultant block. -### [simulateTransaction](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L424) +### [simulateTransaction](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L426) Simulates a transaction on a remote builder session. @@ -268,7 +268,7 @@ Output: - `simulationResult` ([SimulateTransactionResult](#simulatetransactionresult)): Result of the simulation. -### [submitBundleJsonRPC](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L441) +### [submitBundleJsonRPC](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L443) Submits bytes as JSONRPC message to the specified URL with the specified method. As this call is intended for bundles, it also signs the params and adds `X-Flashbots-Signature` header, as usual with bundles. Regular eth bundles don't need any processing to be sent. @@ -284,7 +284,7 @@ Output: - `errorMessage` (`bytes`): Error message if any. -### [submitEthBlockToRelay](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L458) +### [submitEthBlockToRelay](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L460) Submits a given builderBid to a mev-boost relay. @@ -327,7 +327,7 @@ A record of data stored in the ConfidentialStore. - `allowedStores` (``): Addresses can set data. - `version` (`string`): Namespace of the data record. -### [HttpRequest](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L63) +### [HttpRequest](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L64) Description of an HTTP request. @@ -336,8 +336,9 @@ Description of an HTTP request. - `headers` (``): HTTP Headers. - `body` (`bytes`): Body of the request (if Post or Put). - `withFlashbotsSignature` (`bool`): Whether to include the Flashbots signature. +- `timeout` (`uint64`): Timeout of the request in milliseconds. -### [SimulateTransactionResult](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L76) +### [SimulateTransactionResult](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L78) Result of a simulated transaction. @@ -346,7 +347,7 @@ Result of a simulated transaction. - `success` (`bool`): Whether the transaction was successful or not. - `error` (`string`): Error message if any. -### [SimulatedLog](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L87) +### [SimulatedLog](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L89) A log emitted during the simulation of a transaction. @@ -354,7 +355,7 @@ A log emitted during the simulation of a transaction. - `addr` (`address`): Address of the contract that emitted the log. - `topics` (``): Topics of the log. -### [Withdrawal](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L98) +### [Withdrawal](https://github.com/flashbots/suave-std/tree/main/src/suavelib/Suave.sol#L100) A withdrawal from the beacon chain.