Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #80

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-9c9c35c33cadaa4b82c201adcd48e547fdd0030dd826162baeb3faa0a74ebcec.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-c167b75ce21316a9631403b4ad32a13d372eb4e994c4d4278a1811de06d75e42.yml
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as Core from './core';
import * as Errors from './error';
import { type Agent } from './_shims/index';
import * as Uploads from './uploads';
import { type Agent } from './_shims/index';
import * as Core from '@blockaid/client/core';
import * as API from '@blockaid/client/resources/index';

export interface ClientOptions {
Expand Down Expand Up @@ -69,7 +69,9 @@ export interface ClientOptions {
defaultQuery?: Core.DefaultQuery;
}

/** API Client for interfacing with the Blockaid API. */
/**
* API Client for interfacing with the Blockaid API.
*/
export class Blockaid extends Core.APIClient {
apiKey: string;

Expand Down Expand Up @@ -111,6 +113,7 @@ export class Blockaid extends Core.APIClient {
maxRetries: options.maxRetries,
fetch: options.fetch,
});

this._options = options;

this.apiKey = apiKey;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/evm/json-rpc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as JsonRpcAPI from '@blockaid/client/resources/evm/json-rpc';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/evm/post-transaction-bulk.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as PostTransactionBulkAPI from '@blockaid/client/resources/evm/post-transaction-bulk';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/evm/post-transaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as PostTransactionAPI from '@blockaid/client/resources/evm/post-transaction';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/evm/transaction-bulk.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as TransactionBulkAPI from '@blockaid/client/resources/evm/transaction-bulk';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/evm/transaction-raw.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as TransactionRawAPI from '@blockaid/client/resources/evm/transaction-raw';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/evm/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as TransactionAPI from '@blockaid/client/resources/evm/transaction';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/evm/user-operation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as UserOperationAPI from '@blockaid/client/resources/evm/user-operation';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
2 changes: 1 addition & 1 deletion src/resources/site.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as SiteAPI from '@blockaid/client/resources/site';

export class Site extends APIResource {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/token.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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 Core from '@blockaid/client/core';
import * as TokenAPI from '@blockaid/client/resources/token';
import * as EvmAPI from '@blockaid/client/resources/evm/evm';

Expand Down
9 changes: 6 additions & 3 deletions tests/stringifyQuery.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { APIClient } from '@blockaid/client/core';
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

const { stringifyQuery } = APIClient.prototype as any;
import { Blockaid } from '@blockaid/client';

describe('APIClient.stringifyQuery', () => {
const { stringifyQuery } = Blockaid.prototype as any;

describe(stringifyQuery, () => {
for (const [input, expected] of [
[{ a: '1', b: 2, c: true }, 'a=1&b=2&c=true'],
[{ a: null, b: false, c: undefined }, 'a=&b=false'],
Expand All @@ -18,6 +20,7 @@ describe('APIClient.stringifyQuery', () => {
expect(stringifyQuery(input)).toEqual(expected);
});
}

for (const value of [[], {}, new Date()]) {
it(`${JSON.stringify(value)} -> <error>`, () => {
expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`);
Expand Down