Skip to content

feat: Support v5 SDK format for signatureGenerate endpoints #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 26, 2024

Conversation

arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Jun 26, 2024

Adds an experimental x-thirdweb-sdk-version flag to the signatureGenerate endpoints. This enables Engine to generate signature payloads compatible with thirdweb v5 SDK.

Tested these variations of generating a signature w/ Engine and signature minting with the thirdweb SDK:

  • erc20, v4
  • erc721, v4
  • erc1155, v4
  • erc20, v5
  • erc721, v5
  • erc1155, v5

v4 input:

{
  "to": "0xa5B8492D8223D255dB279C7c3ebdA34Be5eC9D85",
  "quantity": "1",
  "primarySaleRecipient": "0x0000000000000000000000000000000000000000",
  "currencyAddress": "0x0000000000000000000000000000000000000000",
  "mintStartTime": "1719367192000"
}

v4 output:

{
  "result": {
    "payload": {
      "to": "0xa5B8492D8223D255dB279C7c3ebdA34Be5eC9D85",
      "quantity": "1",
      "primarySaleRecipient": "0x0000000000000000000000000000000000000000",
      "uid": "0x3539323164373132376638623465383538663566303630363732613430356664",
      "currencyAddress": "0x0000000000000000000000000000000000000000",
      "price": "0",
      "mintStartTime": 1719367192,
      "mintEndTime": 2034727806
    },
    "signature": "0xea0372db75bd673bed3dfa23db34c5f8a15bb96ac8ce3e0b7093f642629b395c278a7f246f967ee2633279f77d17b5eaf747c7e4be3e89e9527dce500e7813561b"
  }
}

v5 input:

{
    "to": "0xa5B8492D8223D255dB279C7c3ebdA34Be5eC9D85",
    "validityStartTimestamp": "1719367192",
    "quantity": "2"
}

v5 output:

{
  "result": {
    "payload": {
      "to": "0xa5B8492D8223D255dB279C7c3ebdA34Be5eC9D85",
      "primarySaleRecipient": "0x4Ff9aa707AE1eAeb40E581DF2cf4e14AffcC553d",
      "quantity": "2000000000000000000",
      "price": "0",
      "currency": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
      "validityStartTimestamp": 1719367192,
      "validityEndTimestamp": 2034727648,
      "uid": "0x2036295f2d551adb572ad5aa721ea541b822baa487a50049354827d31c4cbd4d"
    },
    "signature": "0xcf299de9448d38d8ca8d98b163892611173be664f559bc6f6da60f663ba60c9b4286cc01a3b0f56cca8cc502956c018af37d3a8ac8ed8d54aa7724d837c5376e1c"
  }
}

PR-Codex overview

This PR updates schemas and adds support for v5 SDK in ERC20 contract signature generation.

Detailed summary

  • Added thirdwebSdkVersionSchema for v5 SDK compatibility
  • Updated schemas for ERC20 contract signature generation
  • Implemented v5 SDK support in erc20SignatureGenerate handler

The following files were skipped due to too many changes: src/server/routes/contract/extensions/erc20/read/signatureGenerate.ts, src/server/routes/contract/extensions/erc721/read/signatureGenerate.ts, src/server/routes/contract/extensions/erc1155/read/signatureGenerate.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@arcoraven arcoraven merged commit 1dc5d59 into main Jun 26, 2024
4 checks passed
@arcoraven arcoraven deleted the ph/v5endpoints branch June 26, 2024 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants