Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Chore: Block iframes, update Engine docs on overloaded methods #344

Merged
merged 4 commits into from
Apr 17, 2024
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
18 changes: 18 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ const withMDX = createMDX({
const nextConfig = {
pageExtensions: ["mdx", "tsx", "ts"],
redirects,
headers: async () => {
return [
// Disallow all pages from being embedded in an iframe.
{
source: "/:path*",
headers: [
{
key: "Content-Security-Policy",
value: `frame-ancestors 'none';`,
},
{
key: "X-Frame-Options",
value: "DENY",
},
],
},
];
},
};

export default withMDX(nextConfig);
31 changes: 29 additions & 2 deletions src/app/engine/features/contracts/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMetadata } from "@doc";
import { Details, createMetadata } from "@doc";

export const metadata = createMetadata({
title: "Contracts | thirdweb Engine",
Expand Down Expand Up @@ -40,7 +40,34 @@ const { result } = await resp.json();
console.log("Queue ID:", result.queueId);
```

[See API reference.](https://redocly.github.io/redoc/?url=https://demo.web3api.thirdweb.com/json#tag/Contract/operation/write)
<Details id="handling-overloaded-functions" summary="Handling overloaded functions">

If there are multiple signatures for `functionName` on the contract, provide the full signature with args.

**Example**

Your contract has two functions named `mintTo`:

```solidity
function mintTo(address to) public
```

```solidity
function mintTo(address to, uint256 quantity) public
```

This is the request body to call the second function:

```json
{
"functionName": "mintTo(address, uint256)",
"args": ["0x4Ff9aa707AE1eAeb40E581DF2cf4e14AffcC553d", "3"]
}
```

</Details>

[See API reference](https://redocly.github.io/redoc/?url=https://demo.web3api.thirdweb.com/json#tag/Contract/operation/write)

### Call a payable method

Expand Down
Loading