Skip to content

Commit

Permalink
feat: various codegen changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Stainless Bot committed Aug 14, 2024
1 parent 98f8c14 commit 3141309
Show file tree
Hide file tree
Showing 32 changed files with 501 additions and 95 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.BLOCKAID_NPM_TOKEN || secrets.NPM_TOKEN }}

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.15.0"
".": "0.18.1"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-0731fc5fc7e6e7a78263605acda9f388f0f09c8b47de5b83af88323c330ea38d.yml
configured_endpoints: 17
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-8dd8c884279595b8b11d09ec701e71405a3042fd1107ec837467bdc137ecf255.yml
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
# Changelog

## 0.18.1 (2024-08-14)

Full Changelog: [v0.18.0...v0.18.1](https://github.com/blockaid-official/blockaid-client-node/compare/v0.18.0...v0.18.1)

### Features

* **api:** OpenAPI spec update via Stainless API ([#140](https://github.com/blockaid-official/blockaid-client-node/issues/140)) ([03bdc79](https://github.com/blockaid-official/blockaid-client-node/commit/03bdc79ef1dfffced49eac95981f880ed8692c64))
* **api:** OpenAPI spec update via Stainless API ([#142](https://github.com/blockaid-official/blockaid-client-node/issues/142)) ([ccf5309](https://github.com/blockaid-official/blockaid-client-node/commit/ccf5309b8f694b351a6a96f1a9938e43748fd867))
* **api:** OpenAPI spec update via Stainless API ([#143](https://github.com/blockaid-official/blockaid-client-node/issues/143)) ([359f73e](https://github.com/blockaid-official/blockaid-client-node/commit/359f73efc266f3089febbe9e3ab960a68a3e95db))
* **api:** OpenAPI spec update via Stainless API ([#144](https://github.com/blockaid-official/blockaid-client-node/issues/144)) ([5b26f64](https://github.com/blockaid-official/blockaid-client-node/commit/5b26f644551fafc647413740ce4eac707dab456d))
* **api:** OpenAPI spec update via Stainless API ([#145](https://github.com/blockaid-official/blockaid-client-node/issues/145)) ([b813822](https://github.com/blockaid-official/blockaid-client-node/commit/b81382246cb7d41c16b16ecfd055ae4bf0242d04))
* **api:** OpenAPI spec update via Stainless API ([#150](https://github.com/blockaid-official/blockaid-client-node/issues/150)) ([48dc177](https://github.com/blockaid-official/blockaid-client-node/commit/48dc177aa0f7d2e72177fe6f819953ca934e1438))
* **api:** OpenAPI spec update via Stainless API ([#151](https://github.com/blockaid-official/blockaid-client-node/issues/151)) ([d6cd57b](https://github.com/blockaid-official/blockaid-client-node/commit/d6cd57b433f2cb82ad79d120339abba0b92035ff))
* **api:** OpenAPI spec update via Stainless API ([#152](https://github.com/blockaid-official/blockaid-client-node/issues/152)) ([ccea2e3](https://github.com/blockaid-official/blockaid-client-node/commit/ccea2e3735639eb2986d0362f1fc782946cf1ba5))
* **api:** OpenAPI spec update via Stainless API ([#153](https://github.com/blockaid-official/blockaid-client-node/issues/153)) ([c90f50e](https://github.com/blockaid-official/blockaid-client-node/commit/c90f50ee993de1c90b51beeea08e5fa20af981a1))
* **api:** OpenAPI spec update via Stainless API ([#155](https://github.com/blockaid-official/blockaid-client-node/issues/155)) ([ed27d06](https://github.com/blockaid-official/blockaid-client-node/commit/ed27d0641e375a7bceed05d3d53e1766a9e5b4b4))
* **api:** OpenAPI spec update via Stainless API ([#156](https://github.com/blockaid-official/blockaid-client-node/issues/156)) ([0662706](https://github.com/blockaid-official/blockaid-client-node/commit/0662706f507b49b73d7d9e12f063e96b7dd88639))


### Chores

* **ci:** bump prism mock server version ([#149](https://github.com/blockaid-official/blockaid-client-node/issues/149)) ([af6d913](https://github.com/blockaid-official/blockaid-client-node/commit/af6d913734a5d5f50419bbb7f9056242c1a1b108))
* **ci:** minor changes ([#148](https://github.com/blockaid-official/blockaid-client-node/issues/148)) ([a6563e0](https://github.com/blockaid-official/blockaid-client-node/commit/a6563e0e07a1db8a9a799eb8327fef02bdebbcb1))
* **examples:** minor formatting changes ([#154](https://github.com/blockaid-official/blockaid-client-node/issues/154)) ([9f6500a](https://github.com/blockaid-official/blockaid-client-node/commit/9f6500a052e1dff1e4b60f1a830be6c69c1b826f))
* force eslint to use non flat config ([#146](https://github.com/blockaid-official/blockaid-client-node/issues/146)) ([57ad1a7](https://github.com/blockaid-official/blockaid-client-node/commit/57ad1a76ac01f9fcbbbab9a67df5d055b0b5635f))
* **internal:** codegen related update ([#147](https://github.com/blockaid-official/blockaid-client-node/issues/147)) ([b8b0b38](https://github.com/blockaid-official/blockaid-client-node/commit/b8b0b38f57c643ddc7d0149eeae9c8f93d45153d))

## 0.18.0 (2024-08-04)

Full Changelog: [v0.17.0...v0.18.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.17.0...v0.18.0)

### Features

* **api:** OpenAPI spec update via Stainless API ([#138](https://github.com/blockaid-official/blockaid-client-node/issues/138)) ([c9f8651](https://github.com/blockaid-official/blockaid-client-node/commit/c9f8651d72b23bcde31807734bd2535ba6a656fb))
* **api:** update via SDK Studio ([#135](https://github.com/blockaid-official/blockaid-client-node/issues/135)) ([6eaea52](https://github.com/blockaid-official/blockaid-client-node/commit/6eaea52da33581ed606e2ab5b691e08a02a9fe7e))
* **api:** update via SDK Studio ([#137](https://github.com/blockaid-official/blockaid-client-node/issues/137)) ([70e9f91](https://github.com/blockaid-official/blockaid-client-node/commit/70e9f913170fc8a6a3ff6ca9e911c051ce94f425))

## 0.17.0 (2024-08-04)

Full Changelog: [v0.16.0...v0.17.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.16.0...v0.17.0)

### Features

* **api:** OpenAPI spec update via Stainless API ([#130](https://github.com/blockaid-official/blockaid-client-node/issues/130)) ([d0963c6](https://github.com/blockaid-official/blockaid-client-node/commit/d0963c61d5cfcce446b9bc6420ff28e6d2d2842a))
* **api:** OpenAPI spec update via Stainless API ([#133](https://github.com/blockaid-official/blockaid-client-node/issues/133)) ([4ae7ac7](https://github.com/blockaid-official/blockaid-client-node/commit/4ae7ac74f361584b8ea36874ea560824ce7e368c))


### Chores

* **ci:** correctly tag pre-release npm packages ([#132](https://github.com/blockaid-official/blockaid-client-node/issues/132)) ([d810e7f](https://github.com/blockaid-official/blockaid-client-node/commit/d810e7f05d30196077ce92faf4a55e906590b1a4))

## 0.16.0 (2024-07-30)

Full Changelog: [v0.15.0...v0.16.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.15.0...v0.16.0)

### Features

* **api:** OpenAPI spec update via Stainless API ([#125](https://github.com/blockaid-official/blockaid-client-node/issues/125)) ([57c1bf0](https://github.com/blockaid-official/blockaid-client-node/commit/57c1bf02596ebdf58a32e79602b6c029bf001836))
* **api:** OpenAPI spec update via Stainless API ([#127](https://github.com/blockaid-official/blockaid-client-node/issues/127)) ([74e90fe](https://github.com/blockaid-official/blockaid-client-node/commit/74e90fee05679a8a2f79a88203b7e75a02a114e6))


### Chores

* **internal:** add constant for default timeout ([#128](https://github.com/blockaid-official/blockaid-client-node/issues/128)) ([75872ae](https://github.com/blockaid-official/blockaid-client-node/commit/75872aeb5ed1a48ba1be26de4555d52b701f71a2))

## 0.15.0 (2024-07-28)

Full Changelog: [v0.14.0...v0.15.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.14.0...v0.15.0)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const client = new Blockaid({

async function main() {
const transactionScanResponse = await client.evm.jsonRpc.scan({
chain: 'ethereum',
chain: 'arbitrum',
data: {
method: 'eth_signTypedData_v4',
params: [
Expand Down Expand Up @@ -59,7 +59,7 @@ const client = new Blockaid({

async function main() {
const params: Blockaid.Evm.JsonRpcScanParams = {
chain: 'ethereum',
chain: 'arbitrum',
data: {
method: 'eth_signTypedData_v4',
params: [
Expand Down Expand Up @@ -88,7 +88,7 @@ a subclass of `APIError` will be thrown:
async function main() {
const transactionScanResponse = await client.evm.jsonRpc
.scan({
chain: 'ethereum',
chain: 'arbitrum',
data: {
method: 'eth_signTypedData_v4',
params: [
Expand Down Expand Up @@ -141,7 +141,7 @@ const client = new Blockaid({
});

// Or, configure per-request:
await client.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 client.evm.jsonRpc.scan({ chain: 'arbitrum', 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,
});
```
Expand All @@ -158,7 +158,7 @@ const client = new Blockaid({
});

// Override per-request:
await client.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 client.evm.jsonRpc.scan({ chain: 'arbitrum', 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,
});
```
Expand All @@ -181,7 +181,7 @@ const client = new Blockaid();

const response = await client.evm.jsonRpc
.scan({
chain: 'ethereum',
chain: 'arbitrum',
data: {
method: 'eth_signTypedData_v4',
params: [
Expand All @@ -197,7 +197,7 @@ console.log(response.statusText); // access the underlying Response object

const { data: transactionScanResponse, response: raw } = await client.evm.jsonRpc
.scan({
chain: 'ethereum',
chain: 'arbitrum',
data: {
method: 'eth_signTypedData_v4',
params: [
Expand Down Expand Up @@ -315,7 +315,7 @@ const client = new Blockaid({
// Override per-request:
await client.evm.jsonRpc.scan(
{
chain: 'ethereum',
chain: 'arbitrum',
data: {
method: 'eth_signTypedData_v4',
params: [
Expand Down
10 changes: 10 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,13 @@ Methods:

- <code title="post /v0/token/report">client.token.<a href="./src/resources/token.ts">report</a>({ ...params }) -> unknown</code>
- <code title="post /v0/token/scan">client.token.<a href="./src/resources/token.ts">scan</a>({ ...params }) -> TokenScanResponse</code>

# TokenBulk

Types:

- <code><a href="./src/resources/token-bulk.ts">TokenBulkScanResponse</a></code>

Methods:

- <code title="post /v0/token-bulk/scan">client.tokenBulk.<a href="./src/resources/token-bulk.ts">scan</a>({ ...params }) -> TokenBulkScanResponse</code>
1 change: 1 addition & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ if [[ lenErrors -gt 0 ]]; then
fi

echo "The environment is ready to push releases!"

20 changes: 18 additions & 2 deletions bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@

set -eux

npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"

# Build the project
yarn build

# Navigate to the dist directory
cd dist
yarn publish --access public

# Get the version from package.json
VERSION="$(node -p "require('./package.json').version")"

# Extract the pre-release tag if it exists
if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
# Extract the part before any dot in the pre-release identifier
TAG="${BASH_REMATCH[1]}"
else
TAG="latest"
fi

# Publish with the appropriate tag
yarn publish --access public --tag "$TAG"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockaid/client",
"version": "0.15.0",
"version": "0.18.1",
"description": "The official TypeScript library for the Blockaid API",
"author": "Blockaid <[email protected]>",
"types": "dist/index.d.ts",
Expand All @@ -21,7 +21,7 @@
"prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi",
"tsn": "ts-node -r tsconfig-paths/register",
"lint": "./scripts/lint",
"fix": "eslint --fix --ext ts,js ."
"fix": "./scripts/format"
},
"dependencies": {
"@types/node": "^18.11.18",
Expand Down
2 changes: 1 addition & 1 deletion scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
cd "$(dirname "$0")/.."

echo "==> Running eslint --fix"
./node_modules/.bin/eslint --fix --ext ts,js .
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --fix --ext ts,js .
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
cd "$(dirname "$0")/.."

echo "==> Running eslint"
./node_modules/.bin/eslint --ext ts,js .
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js .
4 changes: 2 additions & 2 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stainless-api/[email protected].5 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
echo -n "Waiting for server"
Expand All @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL"
npm exec --package=@stainless-api/[email protected].5 -- prism mock "$URL"
fi
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class Blockaid extends Core.APIClient {
stellar: API.Stellar = new API.Stellar(this);
site: API.Site = new API.Site(this);
token: API.Token = new API.Token(this);
tokenBulk: API.TokenBulk = new API.TokenBulk(this);

protected override defaultQuery(): Core.DefaultQuery | undefined {
return this._options.defaultQuery;
Expand All @@ -141,6 +142,7 @@ export class Blockaid extends Core.APIClient {
}

static Blockaid = this;
static DEFAULT_TIMEOUT = 60000; // 1 minute

static BlockaidError = Errors.BlockaidError;
static APIError = Errors.APIError;
Expand Down Expand Up @@ -189,7 +191,7 @@ export namespace Blockaid {
export import Erc1155Diff = API.Erc1155Diff;
export import Erc1155Exposure = API.Erc1155Exposure;
export import Erc1155TokenDetails = API.Erc1155TokenDetails;
export import Erc20AddressAssetExposure = API.Erc20AddressAssetExposure
export import Erc20AddressAssetExposure = API.Erc20AddressAssetExposure;
export import Erc20Diff = API.Erc20Diff;
export import Erc20Exposure = API.Erc20Exposure;
export import Erc20TokenDetails = API.Erc20TokenDetails;
Expand Down Expand Up @@ -266,6 +268,10 @@ export namespace Blockaid {
export import TokenScanResponse = API.TokenScanResponse;
export import TokenReportParams = API.TokenReportParams;
export import TokenScanParams = API.TokenScanParams;

export import TokenBulk = API.TokenBulk;
export import TokenBulkScanResponse = API.TokenBulkScanResponse;
export import TokenBulkScanParams = API.TokenBulkScanParams;
}

export default Blockaid;
Loading

0 comments on commit 3141309

Please sign in to comment.