Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and Stainless Bot committed Aug 21, 2024
1 parent 70c3b0f commit d4d22be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-27b198f27c560514e57792ad3c3e31b30a636e86ff4cd0fca52e477beb3943ea.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-5e4d0576b2d38134571cb327258a600c25f8caa892fe15739b0c6dd6f0af182c.yml
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ The full API of this library can be found in [api.md](api.md).
```js
import Blockaid from '@blockaid/client';

const client = new Blockaid({
apiKey: process.env['BLOCKAID_CLIENT_API_KEY'], // This is the default and can be omitted
});
const client = new Blockaid();

async function main() {
const transactionScanResponse = await client.evm.jsonRpc.scan({
Expand Down Expand Up @@ -53,9 +51,7 @@ This library includes TypeScript definitions for all request params and response
```ts
import Blockaid from '@blockaid/client';

const client = new Blockaid({
apiKey: process.env['BLOCKAID_CLIENT_API_KEY'], // This is the default and can be omitted
});
const client = new Blockaid();

async function main() {
const params: Blockaid.Evm.JsonRpcScanParams = {
Expand Down Expand Up @@ -138,6 +134,7 @@ You can use the `maxRetries` option to configure or disable this:
// Configure the default for all requests:
const client = new Blockaid({
maxRetries: 0, // default is 2
apiKey: 'My API Key',
});

// Or, configure per-request:
Expand All @@ -155,6 +152,7 @@ Requests time out after 1 minute by default. You can configure this with a `time
// Configure the default for all requests:
const client = new Blockaid({
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
apiKey: 'My API Key',
});

// Override per-request:
Expand Down Expand Up @@ -310,6 +308,7 @@ import { HttpsProxyAgent } from 'https-proxy-agent';
// Configure the default for all requests:
const client = new Blockaid({
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
apiKey: 'My API Key',
});

// Override per-request:
Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ export class Blockaid extends Core.APIClient {
};
}

protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
return { 'X-API-Key': this.apiKey };
}

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

Expand Down

0 comments on commit d4d22be

Please sign in to comment.