Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1018 Bytes

File metadata and controls

42 lines (34 loc) · 1018 Bytes

thirdweb API OpenAPI TypeScript wrapper

This package is a thin OpenAPI wrapper for the thirdweb API

Configuration

import { configure } from "@thirdweb-dev/api";

// call this once at the startup of your application
configure({
  secretKey: "<PROJECT_SECRET_KEY>",
});

Example Usage

import { writeContract } from "@thirdweb-dev/api";

const result = await writeContract({
  headers: {
    "x-secret-key": "<PROJECT-SECRET-KEY>",
  },
  body: {
    from: "0x1234567891234567891234567891234567891234",
    chainId: "1",
    calls: [
      {
        contractAddress: "0x1234567890123456789012345678901234567890",
        method: "function transfer(address to, uint256 amount)",
        params: [
          "0x1234567890123456789012345678901234567890",
          "1000000000000000000",
        ],
      },
    ],
  },
});

This package was autogenerated from the thirdweb openAPI spec using @hey-api/openapi-ts