Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 21, 2024
1 parent 8f0aa10 commit 4cacf4c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 127 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 12
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-84bcb7b94ca6b21e8d486402a12eb18576497eff38b7cd846e509c49c58e8b2e.yml
configured_endpoints: 11
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-e201805908610f3980464949d264407cb96388191245bb8544bd03999e67f017.yml
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The full API of this library can be found in [api.md](api.md).
```js
import Blockaid from '@blockaid/client';

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

Expand Down Expand Up @@ -53,7 +53,7 @@ This library includes TypeScript definitions for all request params and response
```ts
import Blockaid from '@blockaid/client';

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

Expand Down Expand Up @@ -136,7 +136,7 @@ You can use the `maxRetries` option to configure or disable this:
<!-- prettier-ignore -->
```js
// Configure the default for all requests:
const blockaid = new Blockaid({
const client = new Blockaid({
maxRetries: 0, // default is 2
});

Expand All @@ -153,7 +153,7 @@ Requests time out after 1 minute by default. You can configure this with a `time
<!-- prettier-ignore -->
```ts
// Configure the default for all requests:
const blockaid = new Blockaid({
const client = new Blockaid({
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
});

Expand All @@ -177,7 +177,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi

<!-- prettier-ignore -->
```ts
const blockaid = new Blockaid();
const client = new Blockaid();

const response = await blockaid.evm.jsonRpc
.scan({
Expand Down Expand Up @@ -308,7 +308,7 @@ import http from 'http';
import { HttpsProxyAgent } from 'https-proxy-agent';

// Configure the default for all requests:
const blockaid = new Blockaid({
const client = new Blockaid({
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
});

Expand Down Expand Up @@ -349,14 +349,6 @@ 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/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.
4 changes: 0 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ Types:

## Transaction

Methods:

- <code title="post /v0/stellar/scan/transaction">client.stellar.transaction.<a href="./src/resources/stellar/transaction.ts">scan</a>({ ...params }) -> StellarTransactionScanResponse</code>

# Site

Types:
Expand Down
2 changes: 1 addition & 1 deletion src/resources/stellar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export {
StellarTransactionScanResponse,
Stellar,
} from './stellar';
export { TransactionScanParams, Transaction } from './transaction';
export { Transaction } from './transaction';
1 change: 0 additions & 1 deletion src/resources/stellar/stellar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,5 +524,4 @@ export namespace Stellar {
export import StellarTransactionScanRequest = StellarAPI.StellarTransactionScanRequest;
export import StellarTransactionScanResponse = StellarAPI.StellarTransactionScanResponse;
export import Transaction = TransactionAPI.Transaction;
export import TransactionScanParams = TransactionAPI.TransactionScanParams;
}
69 changes: 1 addition & 68 deletions src/resources/stellar/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,72 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '@blockaid/client/resource';
import * as Core from '@blockaid/client/core';
import * as TransactionAPI from '@blockaid/client/resources/stellar/transaction';
import * as StellarAPI from '@blockaid/client/resources/stellar/stellar';

export class Transaction extends APIResource {
/**
* Scan Transactions
*/
scan(
body: TransactionScanParams,
options?: Core.RequestOptions,
): Core.APIPromise<StellarAPI.StellarTransactionScanResponse> {
return this._client.post('/v0/stellar/scan/transaction', { body, ...options });
}
}

export interface TransactionScanParams {
account_address: string;

/**
* A CAIP-2 chain ID or a Stellar network name
*/
chain: 'pubnet' | 'futurenet' | 'testnet';

/**
* Metadata
*/
metadata:
| TransactionScanParams.StellarWalletRequestMetadata
| TransactionScanParams.StellarInAppRequestMetadata;

/**
* List of XDR-encoded transactions to be scanned
*/
transactions: Array<string>;

/**
* List of options to include in the response
*
* - `simulation`: Include simulation output in the response
* - `validation`: Include security validation of the transaction in the response
*/
options?: Array<'validation' | 'simulation'>;
}

export namespace TransactionScanParams {
export interface StellarWalletRequestMetadata {
/**
* Metadata for wallet requests
*/
type: 'wallet';

/**
* URL of the dApp originating the transaction
*/
url: string;
}

export interface StellarInAppRequestMetadata {
/**
* Metadata for in-app requests
*/
type: 'in_app';
}
}

export namespace Transaction {
export import TransactionScanParams = TransactionAPI.TransactionScanParams;
}
export class Transaction extends APIResource {}
37 changes: 0 additions & 37 deletions tests/api-resources/stellar/transaction.test.ts

This file was deleted.

0 comments on commit 4cacf4c

Please sign in to comment.