From 6a9222ad5a172312fa06fccd4924951d15c0c695 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 16:42:37 +0000 Subject: [PATCH 1/5] feat(api): update via SDK Studio (#1) --- .github/workflows/publish-npm.yml | 32 +++++++++ .github/workflows/release-doctor.yml | 19 ++++++ .release-please-manifest.json | 3 + CONTRIBUTING.md | 10 +-- README.md | 25 +++---- bin/check-release-environment | 32 +++++++++ jest.config.ts | 6 +- package.json | 8 +-- release-please-config.json | 67 +++++++++++++++++++ scripts/build | 6 +- scripts/utils/postprocess-files.cjs | 4 +- src/_shims/README.md | 32 ++++----- src/_shims/index-deno.ts | 2 +- src/_shims/index.d.ts | 2 +- src/_shims/index.js | 2 +- src/_shims/index.mjs | 2 +- src/_shims/manual-types.d.ts | 4 +- src/_shims/registry.ts | 4 +- src/_shims/web-runtime.ts | 8 +-- src/client.ts | 2 +- src/core.ts | 12 ++-- src/resources/evm/evm.ts | 14 ++-- src/resources/evm/json-rpc.ts | 8 +-- src/resources/evm/transaction-bulk.ts | 8 +-- src/resources/evm/transaction-raw.ts | 8 +-- src/resources/evm/transaction.ts | 8 +-- src/resources/evm/user-operation.ts | 2 +- src/resources/site.ts | 6 +- src/version.ts | 2 +- tests/api-resources/evm/json-rpc.test.ts | 2 +- .../evm/transaction-bulk.test.ts | 2 +- .../api-resources/evm/transaction-raw.test.ts | 2 +- tests/api-resources/evm/transaction.test.ts | 2 +- tests/api-resources/site.test.ts | 2 +- tests/form.test.ts | 6 +- tests/index.test.ts | 6 +- tests/responses.test.ts | 4 +- tests/stringifyQuery.test.ts | 2 +- tests/uploads.test.ts | 4 +- tsconfig.build.json | 4 +- tsconfig.deno.json | 6 +- tsconfig.json | 6 +- 42 files changed, 268 insertions(+), 118 deletions(-) create mode 100644 .github/workflows/publish-npm.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment create mode 100644 release-please-config.json diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..bf5425b --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,32 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to NPM in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/blockaid-official/blockaid-client-node/actions/workflows/publish-npm.yml +name: Publish NPM +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: | + yarn install + + - name: Publish to NPM + run: | + bash ./bin/publish-npm + env: + NPM_TOKEN: ${{ secrets.BLOCKAID_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..475c511 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,19 @@ +name: Release Doctor +on: + pull_request: + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'blockaid-official/blockaid-client-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + NPM_TOKEN: ${{ secrets.BLOCKAID_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..67dcd73 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d49f32..689a1d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```bash -npm install git+ssh://git@github.com:stainless-sdks/new/blockaid-node.git +npm install git+ssh://git@github.com:blockaid-official/blockaid-client-node.git ``` Alternatively, to link a local copy of the repo: ```bash # Clone -git clone https://www.github.com/stainless-sdks/new/blockaid-node +git clone https://www.github.com/blockaid-official/blockaid-client-node cd blockaid-client-node # With yarn yarn link cd ../my-package -yarn link blockaid +yarn link @blockaid/client # With pnpm pnpm link --global cd ../my-package -pnpm link -—global blockaid +pnpm link -—global @blockaid/client ``` ## Running tests @@ -99,7 +99,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/stainless-sdks/new/blockaid-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/blockaid-official/blockaid-client-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index a5d90ae..4495660 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Blockaid Node API Library -[![NPM version](https://img.shields.io/npm/v/blockaid.svg)](https://npmjs.org/package/blockaid) +[![NPM version](https://img.shields.io/npm/v/@blockaid/client.svg)](https://npmjs.org/package/@blockaid/client) This library provides convenient access to the Blockaid REST API from server-side TypeScript or JavaScript. @@ -11,19 +11,16 @@ It is generated with [Stainless](https://www.stainlessapi.com/). ## Installation ```sh -npm install git+ssh://git@github.com:stainless-sdks/new/blockaid-node.git +npm install @blockaid/client ``` -> [!NOTE] -> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install blockaid` - ## Usage The full API of this library can be found in [api.md](api.md). ```js -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; const blockaid = new Blockaid({ apiKey: process.env['BLOCKAID_CLIENT_API_KEY'], // This is the default and can be omitted @@ -54,7 +51,7 @@ This library includes TypeScript definitions for all request params and response ```ts -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; const blockaid = new Blockaid({ apiKey: process.env['BLOCKAID_CLIENT_API_KEY'], // This is the default and can be omitted @@ -270,12 +267,12 @@ add the following import before your first import `from "Blockaid"`: ```ts // Tell TypeScript and the package to use the global web fetch instead of node-fetch. // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed. -import 'blockaid/shims/web'; -import Blockaid from 'blockaid'; +import '@blockaid/client/shims/web'; +import Blockaid from '@blockaid/client'; ``` -To do the inverse, add `import "blockaid/shims/node"` (which does import polyfills). -This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/stainless-sdks/blockaid-client-node/tree/main/src/_shims#readme)). +To do the inverse, add `import "@blockaid/client/shims/node"` (which does import polyfills). +This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/blockaid-official/blockaid-client-node/tree/main/src/_shims#readme)). ### Logging and middleware @@ -284,7 +281,7 @@ which can be used to inspect or alter the `Request` or `Response` before/after e ```ts import { fetch } from 'undici'; // as one example -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; const client = new Blockaid({ fetch: async (url: RequestInfo, init?: RequestInit): Promise => { @@ -344,7 +341,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/new/blockaid-node/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/blockaid-official/blockaid-client-node/issues) with questions, bugs, or suggestions. ## Requirements @@ -353,7 +350,7 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import Blockaid from "npm:blockaid"`. +- Deno v1.28.0 or higher, using `import Blockaid from "npm:@blockaid/client"`. - Bun 1.0 or later. - Cloudflare Workers. - Vercel Edge Runtime. diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..daeaa90 --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +warnings=() +errors=() + +if [ -z "${NPM_TOKEN}" ]; then + warnings+=("The BLOCKAID_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenWarnings=${#warnings[@]} + +if [[ lenWarnings -gt 0 ]]; then + echo -e "Found the following warnings in the release environment:\n" + + for warning in "${warnings[@]}"; do + echo -e "- $warning\n" + done +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/jest.config.ts b/jest.config.ts index 1450822..5bbaf85 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -7,9 +7,9 @@ const config: JestConfigWithTsJest = { '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], }, moduleNameMapper: { - '^blockaid$': '/src/index.ts', - '^blockaid/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', - '^blockaid/(.*)$': '/src/$1', + '^@blockaid/client$': '/src/index.ts', + '^@blockaid/client/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', + '^@blockaid/client/(.*)$': '/src/$1', }, modulePathIgnorePatterns: [ '/ecosystem-tests/', diff --git a/package.json b/package.json index 5adef51..5bb68b2 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "blockaid", + "name": "@blockaid/client", "version": "0.0.1-alpha.0", "description": "The official TypeScript library for the Blockaid API", "author": "Blockaid ", "types": "dist/index.d.ts", "main": "dist/index.js", "type": "commonjs", - "repository": "github:stainless-sdks/blockaid-client-node", + "repository": "github:blockaid-official/blockaid-client-node", "license": "Apache-2.0", "packageManager": "yarn@1.22.22", "files": [ @@ -61,8 +61,8 @@ "./shims/web.mjs" ], "imports": { - "blockaid": ".", - "blockaid/*": "./src/*" + "@blockaid/client": ".", + "@blockaid/client/*": "./src/*" }, "exports": { "./_shims/auto/*": { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..624ed99 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,67 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "node", + "extra-files": [ + "src/version.ts", + "README.md" + ] +} diff --git a/scripts/build b/scripts/build index c777135..44e3c05 100755 --- a/scripts/build +++ b/scripts/build @@ -8,7 +8,7 @@ node scripts/utils/check-version.cjs # Build into dist and will publish the package from there, # so that src/resources/foo.ts becomes /resources/foo.js -# This way importing from `"blockaid/resources/foo"` works +# This way importing from `"@blockaid/client/resources/foo"` works # even with `"moduleResolution": "node"` rm -rf dist; mkdir dist @@ -47,8 +47,8 @@ node scripts/utils/postprocess-files.cjs # make sure that nothing crashes when we require the output CJS or # import the output ESM -(cd dist && node -e 'require("blockaid")') -(cd dist && node -e 'import("blockaid")' --input-type=module) +(cd dist && node -e 'require("@blockaid/client")') +(cd dist && node -e 'import("@blockaid/client")' --input-type=module) if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] then diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index 9546add..81e66cd 100644 --- a/scripts/utils/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const { parse } = require('@typescript-eslint/parser'); -const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'blockaid/'; +const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? '@blockaid/client/'; const distDir = process.env['DIST_PATH'] ? @@ -142,7 +142,7 @@ async function postprocess() { if (file.endsWith('.d.ts')) { // work around bad tsc behavior - // if we have `import { type Readable } from 'blockaid/_shims/index'`, + // if we have `import { type Readable } from '@blockaid/client/_shims/index'`, // tsc sometimes replaces `Readable` with `import("stream").Readable` inline // in the output .d.ts transformed = transformed.replace(/import\("stream"\).Readable/g, 'Readable'); diff --git a/src/_shims/README.md b/src/_shims/README.md index f7039eb..17df835 100644 --- a/src/_shims/README.md +++ b/src/_shims/README.md @@ -1,9 +1,9 @@ # 👋 Wondering what everything in here does? -`blockaid` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various +`@blockaid/client` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM). -To do this, `blockaid` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node. +To do this, `@blockaid/client` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node. It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to automatically select the correct shims for each environment. However, conditional exports are a fairly new @@ -15,32 +15,32 @@ getting the wrong raw `Response` type from `.asResponse()`, for example. The user can work around these issues by manually importing one of: -- `import 'blockaid/shims/node'` -- `import 'blockaid/shims/web'` +- `import '@blockaid/client/shims/node'` +- `import '@blockaid/client/shims/web'` All of the code here in `_shims` handles selecting the automatic default shims or manual overrides. ### How it works - Runtime -Runtime shims get installed by calling `setShims` exported by `blockaid/_shims/registry`. +Runtime shims get installed by calling `setShims` exported by `@blockaid/client/_shims/registry`. -Manually importing `blockaid/shims/node` or `blockaid/shims/web`, calls `setShims` with the respective runtime shims. +Manually importing `@blockaid/client/shims/node` or `@blockaid/client/shims/web`, calls `setShims` with the respective runtime shims. -All client code imports shims from `blockaid/_shims/index`, which: +All client code imports shims from `@blockaid/client/_shims/index`, which: - checks if shims have been set manually -- if not, calls `setShims` with the shims from `blockaid/_shims/auto/runtime` -- re-exports the installed shims from `blockaid/_shims/registry`. +- if not, calls `setShims` with the shims from `@blockaid/client/_shims/auto/runtime` +- re-exports the installed shims from `@blockaid/client/_shims/registry`. -`blockaid/_shims/auto/runtime` exports web runtime shims. -If the `node` export condition is set, the export map replaces it with `blockaid/_shims/auto/runtime-node`. +`@blockaid/client/_shims/auto/runtime` exports web runtime shims. +If the `node` export condition is set, the export map replaces it with `@blockaid/client/_shims/auto/runtime-node`. ### How it works - Type time -All client code imports shim types from `blockaid/_shims/index`, which selects the manual types from `blockaid/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `blockaid/_shims/auto/types`. +All client code imports shim types from `@blockaid/client/_shims/index`, which selects the manual types from `@blockaid/client/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@blockaid/client/_shims/auto/types`. -`blockaid/_shims/manual-types` exports an empty namespace. -Manually importing `blockaid/shims/node` or `blockaid/shims/web` merges declarations into this empty namespace, so they get picked up by `blockaid/_shims/index`. +`@blockaid/client/_shims/manual-types` exports an empty namespace. +Manually importing `@blockaid/client/shims/node` or `@blockaid/client/shims/web` merges declarations into this empty namespace, so they get picked up by `@blockaid/client/_shims/index`. -`blockaid/_shims/auto/types` exports web type definitions. -If the `node` export condition is set, the export map replaces it with `blockaid/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`. +`@blockaid/client/_shims/auto/types` exports web type definitions. +If the `node` export condition is set, the export map replaces it with `@blockaid/client/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`. diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index 2704089..6bd1602 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -79,7 +79,7 @@ export function getDefaultAgent(url: string) { } export function fileFromPath() { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/stainless-sdks/new/blockaid-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/blockaid-official/blockaid-client-node#file-uploads', ); } diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index 19f2113..5a5a783 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -2,7 +2,7 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ import { manual } from './manual-types'; -import * as auto from 'blockaid/_shims/auto/types'; +import * as auto from '@blockaid/client/_shims/auto/types'; import { type RequestOptions } from '../core'; type SelectType = unknown extends Manual ? Auto : Manual; diff --git a/src/_shims/index.js b/src/_shims/index.js index 5d78320..f4c6017 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -2,7 +2,7 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ const shims = require('./registry'); -const auto = require('blockaid/_shims/auto/runtime'); +const auto = require('@blockaid/client/_shims/auto/runtime'); if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index d942d96..37a588d 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -2,6 +2,6 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ import * as shims from './registry.mjs'; -import * as auto from 'blockaid/_shims/auto/runtime'; +import * as auto from '@blockaid/client/_shims/auto/runtime'; if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); export * from './registry.mjs'; diff --git a/src/_shims/manual-types.d.ts b/src/_shims/manual-types.d.ts index 8d8e0fa..f9cda97 100644 --- a/src/_shims/manual-types.d.ts +++ b/src/_shims/manual-types.d.ts @@ -4,8 +4,8 @@ /** * Types will get added to this namespace when you import one of the following: * - * import 'blockaid/shims/node' - * import 'blockaid/shims/web' + * import '@blockaid/client/shims/node' + * import '@blockaid/client/shims/web' * * Importing more than one will cause type and runtime errors. */ diff --git a/src/_shims/registry.ts b/src/_shims/registry.ts index 68ebadf..11298ec 100644 --- a/src/_shims/registry.ts +++ b/src/_shims/registry.ts @@ -42,12 +42,12 @@ export let isFsReadStream: Shims['isFsReadStream'] | undefined = undefined; export function setShims(shims: Shims, options: { auto: boolean } = { auto: false }) { if (auto) { throw new Error( - `you must \`import 'blockaid/shims/${shims.kind}'\` before importing anything else from blockaid`, + `you must \`import '@blockaid/client/shims/${shims.kind}'\` before importing anything else from @blockaid/client`, ); } if (kind) { throw new Error( - `can't \`import 'blockaid/shims/${shims.kind}'\` after \`import 'blockaid/shims/${kind}'\``, + `can't \`import '@blockaid/client/shims/${shims.kind}'\` after \`import '@blockaid/client/shims/${kind}'\``, ); } auto = options.auto; diff --git a/src/_shims/web-runtime.ts b/src/_shims/web-runtime.ts index 7258a20..14b7a3f 100644 --- a/src/_shims/web-runtime.ts +++ b/src/_shims/web-runtime.ts @@ -9,9 +9,9 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } const recommendation = manuallyImported ? `You may need to use polyfills` - : `Add one of these imports before your first \`import … from 'blockaid'\`: -- \`import 'blockaid/shims/node'\` (if you're running on Node) -- \`import 'blockaid/shims/web'\` (otherwise) + : `Add one of these imports before your first \`import … from '@blockaid/client'\`: +- \`import '@blockaid/client/shims/node'\` (if you're running on Node) +- \`import '@blockaid/client/shims/web'\` (otherwise) `; let _fetch, _Request, _Response, _Headers; @@ -95,7 +95,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } getDefaultAgent: (url: string) => undefined, fileFromPath: () => { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/stainless-sdks/new/blockaid-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/blockaid-official/blockaid-client-node#file-uploads', ); }, isFsReadStream: (value: any) => false, diff --git a/src/client.ts b/src/client.ts index 6283cd6..689d44d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -4,7 +4,7 @@ import * as Core from './core'; import * as Errors from './error'; import { type Agent } from './_shims/index'; import * as Uploads from './uploads'; -import * as API from 'blockaid/resources/index'; +import * as API from '@blockaid/client/resources/index'; export interface ClientOptions { /** diff --git a/src/core.ts b/src/core.ts index 79ef653..8ebd51c 100644 --- a/src/core.ts +++ b/src/core.ts @@ -97,9 +97,9 @@ export class APIPromise extends Promise { * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'blockaid'`: - * - `import 'blockaid/shims/node'` (if you're running on Node) - * - `import 'blockaid/shims/web'` (otherwise) + * or add one of these imports before your first `import … from '@blockaid/client'`: + * - `import '@blockaid/client/shims/node'` (if you're running on Node) + * - `import '@blockaid/client/shims/web'` (otherwise) */ asResponse(): Promise { return this.responsePromise.then((p) => p.response); @@ -113,9 +113,9 @@ export class APIPromise extends Promise { * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'blockaid'`: - * - `import 'blockaid/shims/node'` (if you're running on Node) - * - `import 'blockaid/shims/web'` (otherwise) + * or add one of these imports before your first `import … from '@blockaid/client'`: + * - `import '@blockaid/client/shims/node'` (if you're running on Node) + * - `import '@blockaid/client/shims/web'` (otherwise) */ async withResponse(): Promise<{ data: T; response: Response }> { const [data, response] = await Promise.all([this.parse(), this.asResponse()]); diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index bae1aee..fec3fc6 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'blockaid/resource'; -import * as EvmAPI from 'blockaid/resources/evm/evm'; -import * as JsonRpcAPI from 'blockaid/resources/evm/json-rpc'; -import * as TransactionAPI from 'blockaid/resources/evm/transaction'; -import * as TransactionBulkAPI from 'blockaid/resources/evm/transaction-bulk'; -import * as TransactionRawAPI from 'blockaid/resources/evm/transaction-raw'; -import * as UserOperationAPI from 'blockaid/resources/evm/user-operation'; +import { APIResource } from '@blockaid/client/resource'; +import * as EvmAPI from '@blockaid/client/resources/evm/evm'; +import * as JsonRpcAPI from '@blockaid/client/resources/evm/json-rpc'; +import * as TransactionAPI from '@blockaid/client/resources/evm/transaction'; +import * as TransactionBulkAPI from '@blockaid/client/resources/evm/transaction-bulk'; +import * as TransactionRawAPI from '@blockaid/client/resources/evm/transaction-raw'; +import * as UserOperationAPI from '@blockaid/client/resources/evm/user-operation'; export class Evm extends APIResource { jsonRpc: JsonRpcAPI.JsonRpc = new JsonRpcAPI.JsonRpc(this._client); diff --git a/src/resources/evm/json-rpc.ts b/src/resources/evm/json-rpc.ts index a64b79d..a0389b7 100644 --- a/src/resources/evm/json-rpc.ts +++ b/src/resources/evm/json-rpc.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'blockaid/core'; -import { APIResource } from 'blockaid/resource'; -import * as JsonRpcAPI from 'blockaid/resources/evm/json-rpc'; -import * as EvmAPI from 'blockaid/resources/evm/evm'; +import * as Core from '@blockaid/client/core'; +import { APIResource } from '@blockaid/client/resource'; +import * as JsonRpcAPI from '@blockaid/client/resources/evm/json-rpc'; +import * as EvmAPI from '@blockaid/client/resources/evm/evm'; export class JsonRpc extends APIResource { /** diff --git a/src/resources/evm/transaction-bulk.ts b/src/resources/evm/transaction-bulk.ts index b73d633..5a2c3ae 100644 --- a/src/resources/evm/transaction-bulk.ts +++ b/src/resources/evm/transaction-bulk.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'blockaid/core'; -import { APIResource } from 'blockaid/resource'; -import * as TransactionBulkAPI from 'blockaid/resources/evm/transaction-bulk'; -import * as EvmAPI from 'blockaid/resources/evm/evm'; +import * as Core from '@blockaid/client/core'; +import { APIResource } from '@blockaid/client/resource'; +import * as TransactionBulkAPI from '@blockaid/client/resources/evm/transaction-bulk'; +import * as EvmAPI from '@blockaid/client/resources/evm/evm'; export class TransactionBulk extends APIResource { /** diff --git a/src/resources/evm/transaction-raw.ts b/src/resources/evm/transaction-raw.ts index a74fb1d..a458c73 100644 --- a/src/resources/evm/transaction-raw.ts +++ b/src/resources/evm/transaction-raw.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'blockaid/core'; -import { APIResource } from 'blockaid/resource'; -import * as TransactionRawAPI from 'blockaid/resources/evm/transaction-raw'; -import * as EvmAPI from 'blockaid/resources/evm/evm'; +import * as Core from '@blockaid/client/core'; +import { APIResource } from '@blockaid/client/resource'; +import * as TransactionRawAPI from '@blockaid/client/resources/evm/transaction-raw'; +import * as EvmAPI from '@blockaid/client/resources/evm/evm'; export class TransactionRaw extends APIResource { /** diff --git a/src/resources/evm/transaction.ts b/src/resources/evm/transaction.ts index 5f17fbb..0cedfa3 100644 --- a/src/resources/evm/transaction.ts +++ b/src/resources/evm/transaction.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'blockaid/core'; -import { APIResource } from 'blockaid/resource'; -import * as TransactionAPI from 'blockaid/resources/evm/transaction'; -import * as EvmAPI from 'blockaid/resources/evm/evm'; +import * as Core from '@blockaid/client/core'; +import { APIResource } from '@blockaid/client/resource'; +import * as TransactionAPI from '@blockaid/client/resources/evm/transaction'; +import * as EvmAPI from '@blockaid/client/resources/evm/evm'; export class Transaction extends APIResource { /** diff --git a/src/resources/evm/user-operation.ts b/src/resources/evm/user-operation.ts index 9e6de97..d54735f 100644 --- a/src/resources/evm/user-operation.ts +++ b/src/resources/evm/user-operation.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'blockaid/resource'; +import { APIResource } from '@blockaid/client/resource'; export class UserOperation extends APIResource {} diff --git a/src/resources/site.ts b/src/resources/site.ts index 55e3b83..15a9f15 100644 --- a/src/resources/site.ts +++ b/src/resources/site.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'blockaid/core'; -import { APIResource } from 'blockaid/resource'; -import * as SiteAPI from 'blockaid/resources/site'; +import * as Core from '@blockaid/client/core'; +import { APIResource } from '@blockaid/client/resource'; +import * as SiteAPI from '@blockaid/client/resources/site'; export class Site extends APIResource { /** diff --git a/src/version.ts b/src/version.ts index 55a1a52..db692bc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.1-alpha.0'; +export const VERSION = '0.0.1-alpha.0'; // x-release-please-version diff --git a/tests/api-resources/evm/json-rpc.test.ts b/tests/api-resources/evm/json-rpc.test.ts index 022a143..7f177f5 100644 --- a/tests/api-resources/evm/json-rpc.test.ts +++ b/tests/api-resources/evm/json-rpc.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; import { Response } from 'node-fetch'; const blockaid = new Blockaid({ diff --git a/tests/api-resources/evm/transaction-bulk.test.ts b/tests/api-resources/evm/transaction-bulk.test.ts index 6412f98..3378cfa 100644 --- a/tests/api-resources/evm/transaction-bulk.test.ts +++ b/tests/api-resources/evm/transaction-bulk.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; import { Response } from 'node-fetch'; const blockaid = new Blockaid({ diff --git a/tests/api-resources/evm/transaction-raw.test.ts b/tests/api-resources/evm/transaction-raw.test.ts index a70d31f..7bee50e 100644 --- a/tests/api-resources/evm/transaction-raw.test.ts +++ b/tests/api-resources/evm/transaction-raw.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; import { Response } from 'node-fetch'; const blockaid = new Blockaid({ diff --git a/tests/api-resources/evm/transaction.test.ts b/tests/api-resources/evm/transaction.test.ts index 2ea8261..5a20f6b 100644 --- a/tests/api-resources/evm/transaction.test.ts +++ b/tests/api-resources/evm/transaction.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; import { Response } from 'node-fetch'; const blockaid = new Blockaid({ diff --git a/tests/api-resources/site.test.ts b/tests/api-resources/site.test.ts index 245d7b2..2d58742 100644 --- a/tests/api-resources/site.test.ts +++ b/tests/api-resources/site.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Blockaid from 'blockaid'; +import Blockaid from '@blockaid/client'; import { Response } from 'node-fetch'; const blockaid = new Blockaid({ diff --git a/tests/form.test.ts b/tests/form.test.ts index 3980c82..aa18886 100644 --- a/tests/form.test.ts +++ b/tests/form.test.ts @@ -1,6 +1,6 @@ -import { multipartFormRequestOptions, createForm } from 'blockaid/core'; -import { Blob } from 'blockaid/_shims/index'; -import { toFile } from 'blockaid'; +import { multipartFormRequestOptions, createForm } from '@blockaid/client/core'; +import { Blob } from '@blockaid/client/_shims/index'; +import { toFile } from '@blockaid/client'; describe('form data validation', () => { test('valid values do not error', async () => { diff --git a/tests/index.test.ts b/tests/index.test.ts index df2b242..4ed8580 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Blockaid from 'blockaid'; -import { APIUserAbortError } from 'blockaid'; -import { Headers } from 'blockaid/core'; +import Blockaid from '@blockaid/client'; +import { APIUserAbortError } from '@blockaid/client'; +import { Headers } from '@blockaid/client/core'; import defaultFetch, { Response, type RequestInit, type RequestInfo } from 'node-fetch'; describe('instantiate client', () => { diff --git a/tests/responses.test.ts b/tests/responses.test.ts index 1a0d0bb..2d4c582 100644 --- a/tests/responses.test.ts +++ b/tests/responses.test.ts @@ -1,5 +1,5 @@ -import { createResponseHeaders } from 'blockaid/core'; -import { Headers } from 'blockaid/_shims/index'; +import { createResponseHeaders } from '@blockaid/client/core'; +import { Headers } from '@blockaid/client/_shims/index'; describe('response parsing', () => { // TODO: test unicode characters diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index e924b18..d8eba72 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,4 +1,4 @@ -import { APIClient } from 'blockaid/core'; +import { APIClient } from '@blockaid/client/core'; const { stringifyQuery } = APIClient.prototype as any; diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 3204501..96a5928 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,6 +1,6 @@ import fs from 'fs'; -import { toFile, type ResponseLike } from 'blockaid/uploads'; -import { File } from 'blockaid/_shims/index'; +import { toFile, type ResponseLike } from '@blockaid/client/uploads'; +import { File } from '@blockaid/client/_shims/index'; class MyClass { name: string = 'foo'; diff --git a/tsconfig.build.json b/tsconfig.build.json index e86eef7..fe754d1 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "blockaid/*": ["dist/src/*"], - "blockaid": ["dist/src/index.ts"], + "@blockaid/client/*": ["dist/src/*"], + "@blockaid/client": ["dist/src/index.ts"], }, "noEmit": false, "declaration": true, diff --git a/tsconfig.deno.json b/tsconfig.deno.json index a65d943..6a5302c 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -6,9 +6,9 @@ "rootDir": "./deno", "lib": ["es2020", "DOM"], "paths": { - "blockaid/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "blockaid/*": ["deno/*"], - "blockaid": ["deno/index.ts"], + "@blockaid/client/_shims/auto/*": ["deno/_shims/auto/*-deno"], + "@blockaid/client/*": ["deno/*"], + "@blockaid/client": ["deno/index.ts"], }, "noEmit": true, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index dc73ec4..6737b3b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,9 +9,9 @@ "esModuleInterop": true, "baseUrl": "./", "paths": { - "blockaid/_shims/auto/*": ["src/_shims/auto/*-node"], - "blockaid/*": ["src/*"], - "blockaid": ["src/index.ts"], + "@blockaid/client/_shims/auto/*": ["src/_shims/auto/*-node"], + "@blockaid/client/*": ["src/*"], + "@blockaid/client": ["src/index.ts"], }, "noEmit": true, From 6ddd9b182c924f0a200224aa131dfe22b4d44874 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 16:52:08 +0000 Subject: [PATCH 2/5] feat(api): update via SDK Studio (#3) --- .stats.yml | 4 +- README.md | 10 +- api.md | 4 + src/resources/evm/evm.ts | 9 ++ src/resources/evm/index.ts | 2 +- src/resources/evm/json-rpc.ts | 23 ++- src/resources/evm/transaction-bulk.ts | 23 ++- src/resources/evm/transaction-raw.ts | 23 ++- src/resources/evm/transaction.ts | 23 ++- src/resources/evm/user-operation.ts | 142 +++++++++++++++++- tests/api-resources/evm/json-rpc.test.ts | 3 +- .../evm/transaction-bulk.test.ts | 3 +- .../api-resources/evm/transaction-raw.test.ts | 3 +- tests/api-resources/evm/transaction.test.ts | 3 +- .../api-resources/evm/user-operation.test.ts | 52 +++++++ tests/api-resources/site.test.ts | 7 +- 16 files changed, 292 insertions(+), 42 deletions(-) create mode 100644 tests/api-resources/evm/user-operation.test.ts diff --git a/.stats.yml b/.stats.yml index 685b628..02faa3d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 5 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-f7745627dabd1a61b80339c0138885efa0a20694b62a79891fff2f57d7ed4d65.yml +configured_endpoints: 6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-ed9637d21344fad29a9d65a1498c236e96b3492cfcdfac262a69ff99bd5b2bcd.yml diff --git a/README.md b/README.md index 4495660..75f8d01 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ const blockaid = new Blockaid({ async function main() { const transactionScanResponse = await blockaid.evm.jsonRpc.scan({ - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -59,7 +58,6 @@ const blockaid = new Blockaid({ async function main() { const params: Blockaid.Evm.JsonRpcScanParams = { - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -88,7 +86,6 @@ a subclass of `APIError` will be thrown: async function main() { const transactionScanResponse = await blockaid.evm.jsonRpc .scan({ - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -141,7 +138,7 @@ const blockaid = new Blockaid({ }); // Or, configure per-request: -await blockaid.evm.jsonRpc.scan({ chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { +await blockaid.evm.jsonRpc.scan({ data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { maxRetries: 5, }); ``` @@ -158,7 +155,7 @@ const blockaid = new Blockaid({ }); // Override per-request: -await blockaid.evm.jsonRpc.scan({ chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { +await blockaid.evm.jsonRpc.scan({ data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { timeout: 5 * 1000, }); ``` @@ -181,7 +178,6 @@ const blockaid = new Blockaid(); const response = await blockaid.evm.jsonRpc .scan({ - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -197,7 +193,6 @@ console.log(response.statusText); // access the underlying Response object const { data: transactionScanResponse, response: raw } = await blockaid.evm.jsonRpc .scan({ - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -315,7 +310,6 @@ const blockaid = new Blockaid({ // Override per-request: await blockaid.evm.jsonRpc.scan( { - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ diff --git a/api.md b/api.md index a9a69b3..6a2d2a7 100644 --- a/api.md +++ b/api.md @@ -53,6 +53,10 @@ Methods: ## UserOperation +Methods: + +- client.evm.userOperation.scan({ ...params }) -> TransactionScanResponse + # Site Types: diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index fec3fc6..9f0d3ef 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -342,6 +342,10 @@ export interface NonercTokenDetails { } export interface TransactionBulkResponse { + block?: string; + + chain?: string; + events?: Array; gas_estimation?: @@ -456,6 +460,10 @@ export interface TransactionScanFeature { } export interface TransactionScanResponse { + block?: string; + + chain?: string; + simulation?: TransactionSimulation | TransactionScanResponse.TransactionSimulationError; validation?: TransactionValidation | TransactionScanResponse.TransactrionValidationError; @@ -655,4 +663,5 @@ export namespace Evm { export import TransactionRaw = TransactionRawAPI.TransactionRaw; export import TransactionRawScanParams = TransactionRawAPI.TransactionRawScanParams; export import UserOperation = UserOperationAPI.UserOperation; + export import UserOperationScanParams = UserOperationAPI.UserOperationScanParams; } diff --git a/src/resources/evm/index.ts b/src/resources/evm/index.ts index bd1fc98..680817b 100644 --- a/src/resources/evm/index.ts +++ b/src/resources/evm/index.ts @@ -27,4 +27,4 @@ export { JsonRpcScanParams, JsonRpc } from './json-rpc'; export { TransactionBulkScanResponse, TransactionBulkScanParams, TransactionBulk } from './transaction-bulk'; export { TransactionRawScanParams, TransactionRaw } from './transaction-raw'; export { TransactionScanParams, Transaction } from './transaction'; -export { UserOperation } from './user-operation'; +export { UserOperationScanParams, UserOperation } from './user-operation'; diff --git a/src/resources/evm/json-rpc.ts b/src/resources/evm/json-rpc.ts index a0389b7..867d3c7 100644 --- a/src/resources/evm/json-rpc.ts +++ b/src/resources/evm/json-rpc.ts @@ -20,11 +20,6 @@ export class JsonRpc extends APIResource { } export interface JsonRpcScanParams { - /** - * The chain name - */ - chain: string; - /** * JSON-RPC request that was received by the wallet. */ @@ -40,6 +35,24 @@ export interface JsonRpcScanParams { */ account_address?: string; + /** + * An enumeration. + */ + chain?: + | 'arbitrum' + | 'avalanche' + | 'base' + | 'base-sepolia' + | 'bsc' + | 'ethereum' + | 'optimism' + | 'polygon' + | 'zksync' + | 'zora' + | 'linea' + | 'blast' + | 'unknown'; + /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/transaction-bulk.ts b/src/resources/evm/transaction-bulk.ts index 5a2c3ae..50721de 100644 --- a/src/resources/evm/transaction-bulk.ts +++ b/src/resources/evm/transaction-bulk.ts @@ -23,11 +23,6 @@ export class TransactionBulk extends APIResource { export type TransactionBulkScanResponse = Array; export interface TransactionBulkScanParams { - /** - * The chain name - */ - chain: string; - /** * Transaction bulk parameters */ @@ -38,6 +33,24 @@ export interface TransactionBulkScanParams { */ metadata: EvmAPI.Metadata; + /** + * An enumeration. + */ + chain?: + | 'arbitrum' + | 'avalanche' + | 'base' + | 'base-sepolia' + | 'bsc' + | 'ethereum' + | 'optimism' + | 'polygon' + | 'zksync' + | 'zora' + | 'linea' + | 'blast' + | 'unknown'; + /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/transaction-raw.ts b/src/resources/evm/transaction-raw.ts index a458c73..ce068fe 100644 --- a/src/resources/evm/transaction-raw.ts +++ b/src/resources/evm/transaction-raw.ts @@ -26,11 +26,6 @@ export interface TransactionRawScanParams { */ account_address: string; - /** - * The chain name - */ - chain: string; - /** * Hex string of the raw transaction data */ @@ -41,6 +36,24 @@ export interface TransactionRawScanParams { */ metadata: EvmAPI.Metadata; + /** + * An enumeration. + */ + chain?: + | 'arbitrum' + | 'avalanche' + | 'base' + | 'base-sepolia' + | 'bsc' + | 'ethereum' + | 'optimism' + | 'polygon' + | 'zksync' + | 'zora' + | 'linea' + | 'blast' + | 'unknown'; + /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/transaction.ts b/src/resources/evm/transaction.ts index 0cedfa3..1babc6e 100644 --- a/src/resources/evm/transaction.ts +++ b/src/resources/evm/transaction.ts @@ -26,11 +26,6 @@ export interface TransactionScanParams { */ account_address: string; - /** - * The chain name - */ - chain: string; - /** * Transaction parameters */ @@ -41,6 +36,24 @@ export interface TransactionScanParams { */ metadata: EvmAPI.Metadata; + /** + * An enumeration. + */ + chain?: + | 'arbitrum' + | 'avalanche' + | 'base' + | 'base-sepolia' + | 'bsc' + | 'ethereum' + | 'optimism' + | 'polygon' + | 'zksync' + | 'zora' + | 'linea' + | 'blast' + | 'unknown'; + /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/user-operation.ts b/src/resources/evm/user-operation.ts index d54735f..56ddc1c 100644 --- a/src/resources/evm/user-operation.ts +++ b/src/resources/evm/user-operation.ts @@ -1,5 +1,145 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import * as Core from '@blockaid/client/core'; import { APIResource } from '@blockaid/client/resource'; +import * as UserOperationAPI from '@blockaid/client/resources/evm/user-operation'; +import * as EvmAPI from '@blockaid/client/resources/evm/evm'; -export class UserOperation extends APIResource {} +export class UserOperation extends APIResource { + /** + * Gets a user operation request and returns a full simulation indicating what will + * happen in the transaction together with a recommended action and some textual + * reasons of why the transaction was flagged that way. + */ + scan( + body: UserOperationScanParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + return this._client.post('/evm/user-operation/scan', { body, ...options }); + } +} + +export interface UserOperationScanParams { + /** + * The user operation request that was received by the wallet + */ + data: UserOperationScanParams.Data; + + /** + * Object of additional information to validate against. + */ + metadata: EvmAPI.Metadata; + + /** + * The address of the account (wallet) sending the request in hex string format + */ + account_address?: string; + + /** + * An enumeration. + */ + chain?: + | 'arbitrum' + | 'avalanche' + | 'base' + | 'base-sepolia' + | 'bsc' + | 'ethereum' + | 'optimism' + | 'polygon' + | 'zksync' + | 'zora' + | 'linea' + | 'blast' + | 'unknown'; + + /** + * List of one or both of options for the desired output. "simulation" - include + * simulation output in your response. "validation" - include security validation + * of the transaction in your response. Default is ["validation"] + */ + options?: Array<'validation' | 'simulation'>; +} + +export namespace UserOperationScanParams { + /** + * The user operation request that was received by the wallet + */ + export interface Data { + /** + * The operation parameters of the user operation request + */ + operation: Data.Operation; + + /** + * The address of the entrypoint receiving the request in hex string format + */ + entrypoint?: string; + } + + export namespace Data { + /** + * The operation parameters of the user operation request + */ + export interface Operation { + /** + * The call data value in hex string format. + */ + call_data?: string; + + /** + * The call gas limit value in hex string format. + */ + call_gas_limit?: string; + + /** + * The init code value in hex string format. + */ + init_code?: string; + + /** + * The max fee per gas value in hex string format. + */ + max_fee_per_gas?: string; + + /** + * The max priority fee per gas value in hex string format. + */ + max_priority_fee_per_gas?: string; + + /** + * The nonce value in hex string format. + */ + nonce?: string; + + /** + * The paymaster and data value in hex string format. + */ + paymaster_and_data?: string; + + /** + * The pre verification gas value in hex string format. + */ + pre_verification_gas?: string; + + /** + * The sender address of the operation in hex string format + */ + sender?: string; + + /** + * The signature value in hex string format. + */ + signature?: string; + + /** + * The verification gas limit value in hex string format. + */ + verification_gas_limit?: string; + } + } +} + +export namespace UserOperation { + export import UserOperationScanParams = UserOperationAPI.UserOperationScanParams; +} diff --git a/tests/api-resources/evm/json-rpc.test.ts b/tests/api-resources/evm/json-rpc.test.ts index 7f177f5..0f5835c 100644 --- a/tests/api-resources/evm/json-rpc.test.ts +++ b/tests/api-resources/evm/json-rpc.test.ts @@ -11,7 +11,6 @@ const blockaid = new Blockaid({ describe('resource jsonRpc', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.jsonRpc.scan({ - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -32,7 +31,6 @@ describe('resource jsonRpc', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.jsonRpc.scan({ - chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -42,6 +40,7 @@ describe('resource jsonRpc', () => { }, metadata: { domain: 'https://boredapeyartclub.com' }, account_address: '0x49c73c9d361c04769a452E85D343b41aC38e0EE4', + chain: 'ethereum', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/transaction-bulk.test.ts b/tests/api-resources/evm/transaction-bulk.test.ts index 3378cfa..0914eab 100644 --- a/tests/api-resources/evm/transaction-bulk.test.ts +++ b/tests/api-resources/evm/transaction-bulk.test.ts @@ -11,7 +11,6 @@ const blockaid = new Blockaid({ describe('resource transactionBulk', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.transactionBulk.scan({ - chain: 'ethereum', data: [ { from: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' }, { from: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' }, @@ -29,7 +28,6 @@ describe('resource transactionBulk', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.transactionBulk.scan({ - chain: 'ethereum', data: [ { from: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', @@ -49,6 +47,7 @@ describe('resource transactionBulk', () => { }, ], metadata: { domain: 'https://example.com' }, + chain: 'ethereum', options: ['validation'], }); }); diff --git a/tests/api-resources/evm/transaction-raw.test.ts b/tests/api-resources/evm/transaction-raw.test.ts index 7bee50e..3467623 100644 --- a/tests/api-resources/evm/transaction-raw.test.ts +++ b/tests/api-resources/evm/transaction-raw.test.ts @@ -12,7 +12,6 @@ describe('resource transactionRaw', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.transactionRaw.scan({ account_address: '0x362320f3a3eeeb4c4699b1b9062a84B2612bcdba', - chain: 'ethereum', data: '0x02f903f8018208488405f5e100850a9a03feb38302fa6a941111111254eeb25477b68fb85ed929f73a96058280b9038862e238bb00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab3e25398a24d6af080000000000000000000000000000000000000000000000000000000070db68f000000000000000000000000000000000000000000000000000000c0c2f020e4000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000006e2a43be0b1d33b726f0ca3b8de60b3482b8b050000000000000000000000000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000773594000000000000000000000000000000000000000000000000b4b34aede8e617e060000000a4000000a4000000a4000000a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000a4bf15fcd8000000000000000000000000303389f541ff2d620e42832f180a08e767b28e10000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000242cc2878d0064b6509600000000060000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a946fd8d5b9e873563a1411cbdf290b8310d8cdddc94da3aebf95b16a6dc0bf56d736ece63e3906527b7dcf08aa845d6a5cd4e0d99c9994f617b6faa378317f71c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e26b9977c001a0386a78e05b5ab3b4badbae843aaa6ed379b2f4353aa730c8f360141e72cba692a036ed37a00c6364685e58bc0cd9cdd1c140d6690c3c0d216c1b67e3d262e2f0f9', metadata: { domain: 'https://app.1inch.io' }, }); @@ -28,9 +27,9 @@ describe('resource transactionRaw', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.transactionRaw.scan({ account_address: '0x362320f3a3eeeb4c4699b1b9062a84B2612bcdba', - chain: 'ethereum', data: '0x02f903f8018208488405f5e100850a9a03feb38302fa6a941111111254eeb25477b68fb85ed929f73a96058280b9038862e238bb00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab3e25398a24d6af080000000000000000000000000000000000000000000000000000000070db68f000000000000000000000000000000000000000000000000000000c0c2f020e4000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000006e2a43be0b1d33b726f0ca3b8de60b3482b8b050000000000000000000000000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000773594000000000000000000000000000000000000000000000000b4b34aede8e617e060000000a4000000a4000000a4000000a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000a4bf15fcd8000000000000000000000000303389f541ff2d620e42832f180a08e767b28e10000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000242cc2878d0064b6509600000000060000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a946fd8d5b9e873563a1411cbdf290b8310d8cdddc94da3aebf95b16a6dc0bf56d736ece63e3906527b7dcf08aa845d6a5cd4e0d99c9994f617b6faa378317f71c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e26b9977c001a0386a78e05b5ab3b4badbae843aaa6ed379b2f4353aa730c8f360141e72cba692a036ed37a00c6364685e58bc0cd9cdd1c140d6690c3c0d216c1b67e3d262e2f0f9', metadata: { domain: 'https://app.1inch.io' }, + chain: 'ethereum', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/transaction.test.ts b/tests/api-resources/evm/transaction.test.ts index 5a20f6b..6f8fb08 100644 --- a/tests/api-resources/evm/transaction.test.ts +++ b/tests/api-resources/evm/transaction.test.ts @@ -12,7 +12,6 @@ describe('resource transaction', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.transaction.scan({ account_address: 'string', - chain: 'ethereum', data: { from: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb' }, metadata: { domain: 'https://boredapeyartclub.com' }, }); @@ -28,7 +27,6 @@ describe('resource transaction', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.transaction.scan({ account_address: 'string', - chain: 'ethereum', data: { from: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb', to: '0x0d524a5b52737c0a02880d5e84f7d20b8d66bfba', @@ -38,6 +36,7 @@ describe('resource transaction', () => { gas_price: 'string', }, metadata: { domain: 'https://boredapeyartclub.com' }, + chain: 'ethereum', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/user-operation.test.ts b/tests/api-resources/evm/user-operation.test.ts new file mode 100644 index 0000000..b896364 --- /dev/null +++ b/tests/api-resources/evm/user-operation.test.ts @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Blockaid from '@blockaid/client'; +import { Response } from 'node-fetch'; + +const blockaid = new Blockaid({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource userOperation', () => { + test('scan: only required params', async () => { + const responsePromise = blockaid.evm.userOperation.scan({ + data: { operation: {} }, + metadata: { domain: 'example.com' }, + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('scan: required and optional params', async () => { + const response = await blockaid.evm.userOperation.scan({ + data: { + operation: { + sender: '0x77bA5AC3ca4864be26CA3112baDf07286CcC3324', + nonce: '0x22', + init_code: '0x', + call_data: + '0x51945447000000000000000000000000aeed57a826a998f9388ce2fd6cdb0b6aa75e3d190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b300000000000000000000000050a9266605ba303b659ff105919205570f2af971000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000', + call_gas_limit: '0x3c38', + verification_gas_limit: '0x1659f', + pre_verification_gas: '0x2496ebc', + max_fee_per_gas: '0x218fe7', + max_priority_fee_per_gas: '0xf4240', + paymaster_and_data: + '0x9d6ac51b972544251fcc0f2902e633e3f9bd3f290000000000000000000000000000000000000000000000000000000065cc4c990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001eb8343d03ec9fc28a877c2fcad21d9923c56e6ad156ea6647282a35ce215c931f9fbdf3bec37168f9c9b49e33a0818731c5892ff626852f9465e619538540221c', + signature: '0x', + }, + entrypoint: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789', + }, + metadata: { domain: 'example.com' }, + account_address: '0x77bA5AC3ca4864be26CA3112baDf07286CcC3324', + chain: 'base-sepolia', + options: ['simulation', 'validation'], + }); + }); +}); diff --git a/tests/api-resources/site.test.ts b/tests/api-resources/site.test.ts index 2d58742..0b56b57 100644 --- a/tests/api-resources/site.test.ts +++ b/tests/api-resources/site.test.ts @@ -10,7 +10,7 @@ const blockaid = new Blockaid({ describe('resource site', () => { test('scan: only required params', async () => { - const responsePromise = blockaid.site.scan({ url: 'string' }); + const responsePromise = blockaid.site.scan({ url: 'https://app.uniswap.org' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,6 +21,9 @@ describe('resource site', () => { }); test('scan: required and optional params', async () => { - const response = await blockaid.site.scan({ url: 'string', metadata: { type: 'catalog' } }); + const response = await blockaid.site.scan({ + url: 'https://app.uniswap.org', + metadata: { type: 'catalog' }, + }); }); }); From b222e241d44f9af46fba19eaf9ddd6358cd668e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 16:52:58 +0000 Subject: [PATCH 3/5] feat(api): update via SDK Studio (#4) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 02faa3d..f8660e9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 6 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-ed9637d21344fad29a9d65a1498c236e96b3492cfcdfac262a69ff99bd5b2bcd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-c20de49d6ab2434c700b46407b69809d206e1788a691ac4e90c0c1c5e03ec1a1.yml From 94cf774dc471aae9e7e3f2227fc82ddc154c92e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 17:26:36 +0000 Subject: [PATCH 4/5] feat(api): update via SDK Studio (#5) --- .stats.yml | 2 +- README.md | 10 ++++++-- src/resources/evm/json-rpc.ts | 23 ++++--------------- src/resources/evm/transaction-bulk.ts | 23 ++++--------------- src/resources/evm/transaction-raw.ts | 23 ++++--------------- src/resources/evm/transaction.ts | 23 ++++--------------- src/resources/evm/user-operation.ts | 23 ++++--------------- tests/api-resources/evm/json-rpc.test.ts | 3 ++- .../evm/transaction-bulk.test.ts | 3 ++- .../api-resources/evm/transaction-raw.test.ts | 3 ++- tests/api-resources/evm/transaction.test.ts | 3 ++- .../api-resources/evm/user-operation.test.ts | 3 ++- 12 files changed, 44 insertions(+), 98 deletions(-) diff --git a/.stats.yml b/.stats.yml index f8660e9..ce24876 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 6 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-c20de49d6ab2434c700b46407b69809d206e1788a691ac4e90c0c1c5e03ec1a1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-35e92c2ca8e7a8cd7c2f58d0fe2f217585365bd24e68c6ee61b9f11a1cbf68a7.yml diff --git a/README.md b/README.md index 75f8d01..4495660 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ const blockaid = new Blockaid({ async function main() { const transactionScanResponse = await blockaid.evm.jsonRpc.scan({ + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -58,6 +59,7 @@ const blockaid = new Blockaid({ async function main() { const params: Blockaid.Evm.JsonRpcScanParams = { + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -86,6 +88,7 @@ a subclass of `APIError` will be thrown: async function main() { const transactionScanResponse = await blockaid.evm.jsonRpc .scan({ + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -138,7 +141,7 @@ const blockaid = new Blockaid({ }); // Or, configure per-request: -await blockaid.evm.jsonRpc.scan({ data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { +await blockaid.evm.jsonRpc.scan({ chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { maxRetries: 5, }); ``` @@ -155,7 +158,7 @@ const blockaid = new Blockaid({ }); // Override per-request: -await blockaid.evm.jsonRpc.scan({ data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { +await blockaid.evm.jsonRpc.scan({ chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: ['0x49c73c9d361c04769a452E85D343b41aC38e0EE4', '{"domain":{"chainId":1,"name":"Aave interest bearing WETH","version":"1","verifyingContract":"0x030ba81f1c18d280636f32af80b9aad02cf0854e"},"message":{"owner":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4","spender":"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd","value":"115792089237316195423570985008687907853269984665640564039457584007913129639935","nonce":"0","deadline":"1988064000","holder":"0x49c73c9d361c04769a452E85D343b41aC38e0EE4"},"primaryType":"Permit","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Permit":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"},{"name":"nonce","type":"uint256"},{"name":"deadline","type":"uint256"}]}}'] }, metadata: { domain: 'https://boredapeyartclub.com' } }, { timeout: 5 * 1000, }); ``` @@ -178,6 +181,7 @@ const blockaid = new Blockaid(); const response = await blockaid.evm.jsonRpc .scan({ + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -193,6 +197,7 @@ console.log(response.statusText); // access the underlying Response object const { data: transactionScanResponse, response: raw } = await blockaid.evm.jsonRpc .scan({ + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -310,6 +315,7 @@ const blockaid = new Blockaid({ // Override per-request: await blockaid.evm.jsonRpc.scan( { + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ diff --git a/src/resources/evm/json-rpc.ts b/src/resources/evm/json-rpc.ts index 867d3c7..a0389b7 100644 --- a/src/resources/evm/json-rpc.ts +++ b/src/resources/evm/json-rpc.ts @@ -20,6 +20,11 @@ export class JsonRpc extends APIResource { } export interface JsonRpcScanParams { + /** + * The chain name + */ + chain: string; + /** * JSON-RPC request that was received by the wallet. */ @@ -35,24 +40,6 @@ export interface JsonRpcScanParams { */ account_address?: string; - /** - * An enumeration. - */ - chain?: - | 'arbitrum' - | 'avalanche' - | 'base' - | 'base-sepolia' - | 'bsc' - | 'ethereum' - | 'optimism' - | 'polygon' - | 'zksync' - | 'zora' - | 'linea' - | 'blast' - | 'unknown'; - /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/transaction-bulk.ts b/src/resources/evm/transaction-bulk.ts index 50721de..5a2c3ae 100644 --- a/src/resources/evm/transaction-bulk.ts +++ b/src/resources/evm/transaction-bulk.ts @@ -23,6 +23,11 @@ export class TransactionBulk extends APIResource { export type TransactionBulkScanResponse = Array; export interface TransactionBulkScanParams { + /** + * The chain name + */ + chain: string; + /** * Transaction bulk parameters */ @@ -33,24 +38,6 @@ export interface TransactionBulkScanParams { */ metadata: EvmAPI.Metadata; - /** - * An enumeration. - */ - chain?: - | 'arbitrum' - | 'avalanche' - | 'base' - | 'base-sepolia' - | 'bsc' - | 'ethereum' - | 'optimism' - | 'polygon' - | 'zksync' - | 'zora' - | 'linea' - | 'blast' - | 'unknown'; - /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/transaction-raw.ts b/src/resources/evm/transaction-raw.ts index ce068fe..a458c73 100644 --- a/src/resources/evm/transaction-raw.ts +++ b/src/resources/evm/transaction-raw.ts @@ -26,6 +26,11 @@ export interface TransactionRawScanParams { */ account_address: string; + /** + * The chain name + */ + chain: string; + /** * Hex string of the raw transaction data */ @@ -36,24 +41,6 @@ export interface TransactionRawScanParams { */ metadata: EvmAPI.Metadata; - /** - * An enumeration. - */ - chain?: - | 'arbitrum' - | 'avalanche' - | 'base' - | 'base-sepolia' - | 'bsc' - | 'ethereum' - | 'optimism' - | 'polygon' - | 'zksync' - | 'zora' - | 'linea' - | 'blast' - | 'unknown'; - /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/transaction.ts b/src/resources/evm/transaction.ts index 1babc6e..0cedfa3 100644 --- a/src/resources/evm/transaction.ts +++ b/src/resources/evm/transaction.ts @@ -26,6 +26,11 @@ export interface TransactionScanParams { */ account_address: string; + /** + * The chain name + */ + chain: string; + /** * Transaction parameters */ @@ -36,24 +41,6 @@ export interface TransactionScanParams { */ metadata: EvmAPI.Metadata; - /** - * An enumeration. - */ - chain?: - | 'arbitrum' - | 'avalanche' - | 'base' - | 'base-sepolia' - | 'bsc' - | 'ethereum' - | 'optimism' - | 'polygon' - | 'zksync' - | 'zora' - | 'linea' - | 'blast' - | 'unknown'; - /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/src/resources/evm/user-operation.ts b/src/resources/evm/user-operation.ts index 56ddc1c..7f7ac01 100644 --- a/src/resources/evm/user-operation.ts +++ b/src/resources/evm/user-operation.ts @@ -20,6 +20,11 @@ export class UserOperation extends APIResource { } export interface UserOperationScanParams { + /** + * The chain name + */ + chain: string; + /** * The user operation request that was received by the wallet */ @@ -35,24 +40,6 @@ export interface UserOperationScanParams { */ account_address?: string; - /** - * An enumeration. - */ - chain?: - | 'arbitrum' - | 'avalanche' - | 'base' - | 'base-sepolia' - | 'bsc' - | 'ethereum' - | 'optimism' - | 'polygon' - | 'zksync' - | 'zora' - | 'linea' - | 'blast' - | 'unknown'; - /** * List of one or both of options for the desired output. "simulation" - include * simulation output in your response. "validation" - include security validation diff --git a/tests/api-resources/evm/json-rpc.test.ts b/tests/api-resources/evm/json-rpc.test.ts index 0f5835c..7f177f5 100644 --- a/tests/api-resources/evm/json-rpc.test.ts +++ b/tests/api-resources/evm/json-rpc.test.ts @@ -11,6 +11,7 @@ const blockaid = new Blockaid({ describe('resource jsonRpc', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.jsonRpc.scan({ + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -31,6 +32,7 @@ describe('resource jsonRpc', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.jsonRpc.scan({ + chain: 'ethereum', data: { method: 'eth_signTypedData_v4', params: [ @@ -40,7 +42,6 @@ describe('resource jsonRpc', () => { }, metadata: { domain: 'https://boredapeyartclub.com' }, account_address: '0x49c73c9d361c04769a452E85D343b41aC38e0EE4', - chain: 'ethereum', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/transaction-bulk.test.ts b/tests/api-resources/evm/transaction-bulk.test.ts index 0914eab..3378cfa 100644 --- a/tests/api-resources/evm/transaction-bulk.test.ts +++ b/tests/api-resources/evm/transaction-bulk.test.ts @@ -11,6 +11,7 @@ const blockaid = new Blockaid({ describe('resource transactionBulk', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.transactionBulk.scan({ + chain: 'ethereum', data: [ { from: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' }, { from: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' }, @@ -28,6 +29,7 @@ describe('resource transactionBulk', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.transactionBulk.scan({ + chain: 'ethereum', data: [ { from: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', @@ -47,7 +49,6 @@ describe('resource transactionBulk', () => { }, ], metadata: { domain: 'https://example.com' }, - chain: 'ethereum', options: ['validation'], }); }); diff --git a/tests/api-resources/evm/transaction-raw.test.ts b/tests/api-resources/evm/transaction-raw.test.ts index 3467623..7bee50e 100644 --- a/tests/api-resources/evm/transaction-raw.test.ts +++ b/tests/api-resources/evm/transaction-raw.test.ts @@ -12,6 +12,7 @@ describe('resource transactionRaw', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.transactionRaw.scan({ account_address: '0x362320f3a3eeeb4c4699b1b9062a84B2612bcdba', + chain: 'ethereum', data: '0x02f903f8018208488405f5e100850a9a03feb38302fa6a941111111254eeb25477b68fb85ed929f73a96058280b9038862e238bb00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab3e25398a24d6af080000000000000000000000000000000000000000000000000000000070db68f000000000000000000000000000000000000000000000000000000c0c2f020e4000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000006e2a43be0b1d33b726f0ca3b8de60b3482b8b050000000000000000000000000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000773594000000000000000000000000000000000000000000000000b4b34aede8e617e060000000a4000000a4000000a4000000a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000a4bf15fcd8000000000000000000000000303389f541ff2d620e42832f180a08e767b28e10000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000242cc2878d0064b6509600000000060000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a946fd8d5b9e873563a1411cbdf290b8310d8cdddc94da3aebf95b16a6dc0bf56d736ece63e3906527b7dcf08aa845d6a5cd4e0d99c9994f617b6faa378317f71c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e26b9977c001a0386a78e05b5ab3b4badbae843aaa6ed379b2f4353aa730c8f360141e72cba692a036ed37a00c6364685e58bc0cd9cdd1c140d6690c3c0d216c1b67e3d262e2f0f9', metadata: { domain: 'https://app.1inch.io' }, }); @@ -27,9 +28,9 @@ describe('resource transactionRaw', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.transactionRaw.scan({ account_address: '0x362320f3a3eeeb4c4699b1b9062a84B2612bcdba', + chain: 'ethereum', data: '0x02f903f8018208488405f5e100850a9a03feb38302fa6a941111111254eeb25477b68fb85ed929f73a96058280b9038862e238bb00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab3e25398a24d6af080000000000000000000000000000000000000000000000000000000070db68f000000000000000000000000000000000000000000000000000000c0c2f020e4000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000006e2a43be0b1d33b726f0ca3b8de60b3482b8b050000000000000000000000000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000773594000000000000000000000000000000000000000000000000b4b34aede8e617e060000000a4000000a4000000a4000000a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000a4bf15fcd8000000000000000000000000303389f541ff2d620e42832f180a08e767b28e10000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000242cc2878d0064b6509600000000060000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a946fd8d5b9e873563a1411cbdf290b8310d8cdddc94da3aebf95b16a6dc0bf56d736ece63e3906527b7dcf08aa845d6a5cd4e0d99c9994f617b6faa378317f71c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e26b9977c001a0386a78e05b5ab3b4badbae843aaa6ed379b2f4353aa730c8f360141e72cba692a036ed37a00c6364685e58bc0cd9cdd1c140d6690c3c0d216c1b67e3d262e2f0f9', metadata: { domain: 'https://app.1inch.io' }, - chain: 'ethereum', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/transaction.test.ts b/tests/api-resources/evm/transaction.test.ts index 6f8fb08..5a20f6b 100644 --- a/tests/api-resources/evm/transaction.test.ts +++ b/tests/api-resources/evm/transaction.test.ts @@ -12,6 +12,7 @@ describe('resource transaction', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.transaction.scan({ account_address: 'string', + chain: 'ethereum', data: { from: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb' }, metadata: { domain: 'https://boredapeyartclub.com' }, }); @@ -27,6 +28,7 @@ describe('resource transaction', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.transaction.scan({ account_address: 'string', + chain: 'ethereum', data: { from: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb', to: '0x0d524a5b52737c0a02880d5e84f7d20b8d66bfba', @@ -36,7 +38,6 @@ describe('resource transaction', () => { gas_price: 'string', }, metadata: { domain: 'https://boredapeyartclub.com' }, - chain: 'ethereum', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/user-operation.test.ts b/tests/api-resources/evm/user-operation.test.ts index b896364..68d187a 100644 --- a/tests/api-resources/evm/user-operation.test.ts +++ b/tests/api-resources/evm/user-operation.test.ts @@ -11,6 +11,7 @@ const blockaid = new Blockaid({ describe('resource userOperation', () => { test('scan: only required params', async () => { const responsePromise = blockaid.evm.userOperation.scan({ + chain: 'base-sepolia', data: { operation: {} }, metadata: { domain: 'example.com' }, }); @@ -25,6 +26,7 @@ describe('resource userOperation', () => { test('scan: required and optional params', async () => { const response = await blockaid.evm.userOperation.scan({ + chain: 'base-sepolia', data: { operation: { sender: '0x77bA5AC3ca4864be26CA3112baDf07286CcC3324', @@ -45,7 +47,6 @@ describe('resource userOperation', () => { }, metadata: { domain: 'example.com' }, account_address: '0x77bA5AC3ca4864be26CA3112baDf07286CcC3324', - chain: 'base-sepolia', options: ['simulation', 'validation'], }); }); From 67c8d1a40d5f2cbcb9be41838b0d50f6a8283de8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 17:26:45 +0000 Subject: [PATCH 5/5] release: 0.7.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 67dcd73..e7ca613 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1-alpha.0" + ".": "0.7.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..77bf745 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# Changelog + +## 0.7.0 (2024-05-02) + +Full Changelog: [v0.0.1-alpha.0...v0.7.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.0.1-alpha.0...v0.7.0) + +### Features + +* **api:** update via SDK Studio ([c72a5c8](https://github.com/blockaid-official/blockaid-client-node/commit/c72a5c8092b257a61e539c3066f9f56af1b2fb2a)) +* **api:** update via SDK Studio ([#1](https://github.com/blockaid-official/blockaid-client-node/issues/1)) ([6a9222a](https://github.com/blockaid-official/blockaid-client-node/commit/6a9222ad5a172312fa06fccd4924951d15c0c695)) +* **api:** update via SDK Studio ([#3](https://github.com/blockaid-official/blockaid-client-node/issues/3)) ([6ddd9b1](https://github.com/blockaid-official/blockaid-client-node/commit/6ddd9b182c924f0a200224aa131dfe22b4d44874)) +* **api:** update via SDK Studio ([#4](https://github.com/blockaid-official/blockaid-client-node/issues/4)) ([b222e24](https://github.com/blockaid-official/blockaid-client-node/commit/b222e241d44f9af46fba19eaf9ddd6358cd668e9)) +* **api:** update via SDK Studio ([#5](https://github.com/blockaid-official/blockaid-client-node/issues/5)) ([94cf774](https://github.com/blockaid-official/blockaid-client-node/commit/94cf774dc471aae9e7e3f2227fc82ddc154c92e3)) + + +### Chores + +* update SDK settings ([73bafea](https://github.com/blockaid-official/blockaid-client-node/commit/73bafea0cedaccb5d1c8beeada3a6ffb16a112a1)) diff --git a/package.json b/package.json index 5bb68b2..41b14b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blockaid/client", - "version": "0.0.1-alpha.0", + "version": "0.7.0", "description": "The official TypeScript library for the Blockaid API", "author": "Blockaid ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index db692bc..d9da9f7 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.1-alpha.0'; // x-release-please-version +export const VERSION = '0.7.0'; // x-release-please-version