From aa02f259942b64b732ce425049d888c8049f3475 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 02:50:35 +0000 Subject: [PATCH 1/4] chore: rebuild project due to codegen change (#330) --- package.json | 1 - src/index.ts | 4 ++-- yarn.lock | 40 ---------------------------------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 638d9bf8..e73023a0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", - "ts-morph": "^19.0.0", "ts-node": "^10.5.0", "tsc-multi": "^1.1.0", "tsconfig-paths": "^4.0.0", diff --git a/src/index.ts b/src/index.ts index 6da72cc5..7ac61bdc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -475,7 +475,7 @@ export declare namespace Blockaid { }; } -export { toFile, fileFromPath } from '@blockaid/client/uploads'; +export { toFile, fileFromPath } from './uploads'; export { BlockaidError, APIError, @@ -490,6 +490,6 @@ export { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} from '@blockaid/client/error'; +} from './error'; export default Blockaid; diff --git a/yarn.lock b/yarn.lock index 14e8a752..bfd47d8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -759,16 +759,6 @@ dependencies: "@swc/counter" "^0.1.3" -"@ts-morph/common@~0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" - integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== - dependencies: - fast-glob "^3.2.12" - minimatch "^7.4.3" - mkdirp "^2.1.6" - path-browserify "^1.0.1" - "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" @@ -1315,11 +1305,6 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -code-block-writer@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" - integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== - collect-v8-coverage@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" @@ -2680,23 +2665,11 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^7.4.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -mkdirp@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2860,11 +2833,6 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -3283,14 +3251,6 @@ ts-jest@^29.1.0: semver "^7.5.3" yargs-parser "^21.0.1" -ts-morph@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" - integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== - dependencies: - "@ts-morph/common" "~0.20.0" - code-block-writer "^12.0.0" - ts-node@^10.5.0: version "10.7.0" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" From 77a1c4e9384d5d05a6b4efde8db7123b8ed405cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 20:09:13 +0000 Subject: [PATCH 2/4] chore: rebuild project due to codegen change (#332) --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index cc907fd1..e870a658 100644 --- a/README.md +++ b/README.md @@ -351,6 +351,15 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: +- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) +- 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/client"`. +- Bun 1.0 or later. +- Cloudflare Workers. +- Vercel Edge Runtime. +- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). +- Nitro v2.6 or greater. + Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. From d165a1aeca9ac7044f804199c0ac6ca11565f0eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 16:45:48 +0000 Subject: [PATCH 3/4] feat(api): api update (#333) --- .stats.yml | 2 +- src/resources/evm/evm.ts | 107 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1ec52b9d..77044dfa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-63c446028fc6e2ac5a16a0517c126a07fa4e97a5ab23853fb88750ccebaa991f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-87dcafa1eeddf38e2c6f697c167dfd2388926b2b8d2fb792ed11af8ca515f131.yml diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index 818029b4..14218069 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -1401,6 +1401,113 @@ export interface TransactionSimulationError { * A string indicating if the simulation was successful or not. */ status: 'Error'; + + /** + * Error details if the simulation failed. + */ + error_details?: + | TransactionSimulationError.GeneralInsufficientFundsErrorDetails + | TransactionSimulationError.GenericErrorDetails; +} + +export namespace TransactionSimulationError { + export interface GeneralInsufficientFundsErrorDetails { + /** + * The address of the account + */ + account_address: string; + + /** + * The asset that the account does not have enough balance for + */ + asset: + | GeneralInsufficientFundsErrorDetails.NativeAsset + | GeneralInsufficientFundsErrorDetails.Erc20Asset + | GeneralInsufficientFundsErrorDetails.Erc721Asset + | GeneralInsufficientFundsErrorDetails.Erc1155Asset; + + /** + * The type of the model + */ + code: 'GENERAL_INSUFFICIENT_FUNDS'; + + /** + * The current balance of the account + */ + current_balance?: number; + + /** + * The required balance of the account + */ + required_balance?: number; + } + + export namespace GeneralInsufficientFundsErrorDetails { + export interface NativeAsset { + /** + * Details + */ + details: EvmAPI.NativeAssetDetails; + + /** + * The type of the model + */ + type: 'NATIVE'; + } + + export interface Erc20Asset { + /** + * Details + */ + details: EvmAPI.Erc20TokenDetails; + + /** + * The type of the model + */ + type: 'ERC20'; + } + + export interface Erc721Asset { + /** + * Details + */ + details: EvmAPI.Erc1155TokenDetails; + + /** + * Token Id + */ + token_id: number; + + /** + * The type of the model + */ + type: 'ERC721'; + } + + export interface Erc1155Asset { + /** + * Details + */ + details: EvmAPI.Erc1155TokenDetails; + + /** + * Token Id + */ + token_id: number; + + /** + * The type of the model + */ + type: 'ERC1155'; + } + } + + export interface GenericErrorDetails { + /** + * The error code + */ + code: string; + } } export interface TransactionValidation { From 7c4ed9ad9521a87e461088d6682a7a17c6a0ae95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 16:46:23 +0000 Subject: [PATCH 4/4] release: 0.30.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 712789e1..716d0046 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.29.1" + ".": "0.30.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b1925e1..5228f68a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.30.0 (2024-11-17) + +Full Changelog: [v0.29.1...v0.30.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.29.1...v0.30.0) + +### Features + +* **api:** api update ([#333](https://github.com/blockaid-official/blockaid-client-node/issues/333)) ([d165a1a](https://github.com/blockaid-official/blockaid-client-node/commit/d165a1aeca9ac7044f804199c0ac6ca11565f0eb)) + + +### Chores + +* rebuild project due to codegen change ([#330](https://github.com/blockaid-official/blockaid-client-node/issues/330)) ([aa02f25](https://github.com/blockaid-official/blockaid-client-node/commit/aa02f259942b64b732ce425049d888c8049f3475)) +* rebuild project due to codegen change ([#332](https://github.com/blockaid-official/blockaid-client-node/issues/332)) ([77a1c4e](https://github.com/blockaid-official/blockaid-client-node/commit/77a1c4e9384d5d05a6b4efde8db7123b8ed405cf)) + ## 0.29.1 (2024-11-13) Full Changelog: [v0.29.0...v0.29.1](https://github.com/blockaid-official/blockaid-client-node/compare/v0.29.0...v0.29.1) diff --git a/package.json b/package.json index e73023a0..88a57700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blockaid/client", - "version": "0.29.1", + "version": "0.30.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 b8b7a277..91a9bb6d 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.29.1'; // x-release-please-version +export const VERSION = '0.30.0'; // x-release-please-version