Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 28, 2024
1 parent 34397a3 commit 8c247f2
Show file tree
Hide file tree
Showing 14 changed files with 329 additions and 6 deletions.
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-22465fdf72becb3729b413aee10ef25b577513fe0571db3d35c2e14eb73f0423.yml
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-0731fc5fc7e6e7a78263605acda9f388f0f09c8b47de5b83af88323c330ea38d.yml
14 changes: 14 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ Methods:

## Transaction

Types:

- <code><a href="./src/resources/evm/transaction.ts">TransactionReportResponse</a></code>

Methods:

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

## TransactionBulk
Expand All @@ -63,8 +68,13 @@ Methods:

## PostTransaction

Types:

- <code><a href="./src/resources/evm/post-transaction.ts">PostTransactionReportResponse</a></code>

Methods:

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

## PostTransactionBulk
Expand Down Expand Up @@ -144,18 +154,22 @@ Types:

- <code><a href="./src/resources/site.ts">SiteScanHitResponse</a></code>
- <code><a href="./src/resources/site.ts">SiteScanMissResponse</a></code>
- <code><a href="./src/resources/site.ts">SiteReportResponse</a></code>
- <code><a href="./src/resources/site.ts">SiteScanResponse</a></code>

Methods:

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

# Token

Types:

- <code><a href="./src/resources/token.ts">TokenReportResponse</a></code>
- <code><a href="./src/resources/token.ts">TokenScanResponse</a></code>

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>
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,15 @@ export namespace Blockaid {
export import Site = API.Site;
export import SiteScanHitResponse = API.SiteScanHitResponse;
export import SiteScanMissResponse = API.SiteScanMissResponse;
export import SiteReportResponse = API.SiteReportResponse;
export import SiteScanResponse = API.SiteScanResponse;
export import SiteReportParams = API.SiteReportParams;
export import SiteScanParams = API.SiteScanParams;

export import Token = API.Token;
export import TokenReportResponse = API.TokenReportResponse;
export import TokenScanResponse = API.TokenScanResponse;
export import TokenReportParams = API.TokenReportParams;
export import TokenScanParams = API.TokenScanParams;
}

Expand Down
4 changes: 4 additions & 0 deletions src/resources/evm/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,8 @@ export namespace Evm {
export import JsonRpc = JsonRpcAPI.JsonRpc;
export import JsonRpcScanParams = JsonRpcAPI.JsonRpcScanParams;
export import Transaction = TransactionAPI.Transaction;
export import TransactionReportResponse = TransactionAPI.TransactionReportResponse;
export import TransactionReportParams = TransactionAPI.TransactionReportParams;
export import TransactionScanParams = TransactionAPI.TransactionScanParams;
export import TransactionBulk = TransactionBulkAPI.TransactionBulk;
export import TransactionBulkScanResponse = TransactionBulkAPI.TransactionBulkScanResponse;
Expand All @@ -785,6 +787,8 @@ export namespace Evm {
export import UserOperation = UserOperationAPI.UserOperation;
export import UserOperationScanParams = UserOperationAPI.UserOperationScanParams;
export import PostTransaction = PostTransactionAPI.PostTransaction;
export import PostTransactionReportResponse = PostTransactionAPI.PostTransactionReportResponse;
export import PostTransactionReportParams = PostTransactionAPI.PostTransactionReportParams;
export import PostTransactionScanParams = PostTransactionAPI.PostTransactionScanParams;
export import PostTransactionBulk = PostTransactionBulkAPI.PostTransactionBulk;
export import PostTransactionBulkScanResponse = PostTransactionBulkAPI.PostTransactionBulkScanResponse;
Expand Down
14 changes: 12 additions & 2 deletions src/resources/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,18 @@ export {
PostTransactionBulkScanParams,
PostTransactionBulk,
} from './post-transaction-bulk';
export { PostTransactionScanParams, PostTransaction } from './post-transaction';
export {
PostTransactionReportResponse,
PostTransactionReportParams,
PostTransactionScanParams,
PostTransaction,
} from './post-transaction';
export { TransactionBulkScanResponse, TransactionBulkScanParams, TransactionBulk } from './transaction-bulk';
export { TransactionRawScanParams, TransactionRaw } from './transaction-raw';
export { TransactionScanParams, Transaction } from './transaction';
export {
TransactionReportResponse,
TransactionReportParams,
TransactionScanParams,
Transaction,
} from './transaction';
export { UserOperationScanParams, UserOperation } from './user-operation';
49 changes: 49 additions & 0 deletions src/resources/evm/post-transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import * as PostTransactionAPI from './post-transaction';
import * as EvmAPI from './evm';

export class PostTransaction extends APIResource {
/**
* Report for misclassification of an EVM post transaction.
*/
report(body: PostTransactionReportParams, options?: Core.RequestOptions): Core.APIPromise<unknown> {
return this._client.post('/v0/evm/post-transaction/report', { body, ...options });
}

/**
* Scan a transaction that was already executed on chain, returns validation with
* features indicating address poisoning entites and malicious operators.
Expand All @@ -18,6 +25,46 @@ export class PostTransaction extends APIResource {
}
}

export type PostTransactionReportResponse = unknown;

export interface PostTransactionReportParams {
details: string;

/**
* An enumeration.
*/
event: 'FALSE_POSITIVE' | 'FALSE_NEGATIVE';

report:
| PostTransactionReportParams.ParamReportChainTransactionHashParams
| PostTransactionReportParams.RequestIDReport;
}

export namespace PostTransactionReportParams {
export interface ParamReportChainTransactionHashParams {
params: ParamReportChainTransactionHashParams.Params;

type: 'params';
}

export namespace ParamReportChainTransactionHashParams {
export interface Params {
/**
* The chain name
*/
chain: EvmAPI.TransactionScanSupportedChain;

tx_hash: string;
}
}

export interface RequestIDReport {
request_id: string;

type: 'request_id';
}
}

export interface PostTransactionScanParams {
/**
* The chain name or chain ID
Expand Down Expand Up @@ -54,5 +101,7 @@ export namespace PostTransactionScanParams {
}

export namespace PostTransaction {
export import PostTransactionReportResponse = PostTransactionAPI.PostTransactionReportResponse;
export import PostTransactionReportParams = PostTransactionAPI.PostTransactionReportParams;
export import PostTransactionScanParams = PostTransactionAPI.PostTransactionScanParams;
}
53 changes: 53 additions & 0 deletions src/resources/evm/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import * as TransactionAPI from './transaction';
import * as EvmAPI from './evm';

export class Transaction extends APIResource {
/**
* Report for misclassification of a transaction.
*/
report(body: TransactionReportParams, options?: Core.RequestOptions): Core.APIPromise<unknown> {
return this._client.post('/v0/evm/transaction/report', { body, ...options });
}

/**
* Gets a transaction and returns a full simulation indicating what will happen in
* the transaction together with a recommended action and some textual reasons of
Expand All @@ -19,6 +26,50 @@ export class Transaction extends APIResource {
}
}

export type TransactionReportResponse = unknown;

export interface TransactionReportParams {
details: string;

/**
* An enumeration.
*/
event: 'FALSE_POSITIVE' | 'FALSE_NEGATIVE';

report:
| TransactionReportParams.ParamReportTransactionReportParams
| TransactionReportParams.RequestIDReport;
}

export namespace TransactionReportParams {
export interface ParamReportTransactionReportParams {
params: ParamReportTransactionReportParams.Params;

type: 'params';
}

export namespace ParamReportTransactionReportParams {
export interface Params {
account_address: string;

/**
* The chain name
*/
chain: EvmAPI.TransactionScanSupportedChain;

data: unknown;

metadata: unknown;
}
}

export interface RequestIDReport {
request_id: string;

type: 'request_id';
}
}

export interface TransactionScanParams {
/**
* The address to relate the transaction to. Account address determines in which
Expand Down Expand Up @@ -92,5 +143,7 @@ export namespace TransactionScanParams {
}

export namespace Transaction {
export import TransactionReportResponse = TransactionAPI.TransactionReportResponse;
export import TransactionReportParams = TransactionAPI.TransactionReportParams;
export import TransactionScanParams = TransactionAPI.TransactionScanParams;
}
12 changes: 10 additions & 2 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,20 @@ export {
UsdDiff,
Evm,
} from './evm/evm';
export { SiteScanHitResponse, SiteScanMissResponse, SiteScanResponse, SiteScanParams, Site } from './site';
export {
SiteScanHitResponse,
SiteScanMissResponse,
SiteReportResponse,
SiteScanResponse,
SiteReportParams,
SiteScanParams,
Site,
} from './site';
export {
StellarAssetContractDetailsSchema,
StellarAssetTransferDetailsSchema,
StellarTransactionScanRequest,
StellarTransactionScanResponse,
Stellar,
} from './stellar/stellar';
export { TokenScanResponse, TokenScanParams, Token } from './token';
export { TokenReportResponse, TokenScanResponse, TokenReportParams, TokenScanParams, Token } from './token';
42 changes: 42 additions & 0 deletions src/resources/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import * as Core from '../core';
import * as SiteAPI from './site';

export class Site extends APIResource {
/**
* Report for misclassification of a site.
*/
report(body: SiteReportParams, options?: Core.RequestOptions): Core.APIPromise<unknown> {
return this._client.post('/v0/site/report', { body, ...options });
}

/**
* Scan Site
*/
Expand Down Expand Up @@ -65,8 +72,41 @@ export interface SiteScanMissResponse {
status: 'miss';
}

export type SiteReportResponse = unknown;

export type SiteScanResponse = SiteScanHitResponse | SiteScanMissResponse;

export interface SiteReportParams {
details: string;

/**
* An enumeration.
*/
event: 'FALSE_POSITIVE' | 'FALSE_NEGATIVE';

report: SiteReportParams.ParamReportSiteReportParams | SiteReportParams.RequestIDReport;
}

export namespace SiteReportParams {
export interface ParamReportSiteReportParams {
params: ParamReportSiteReportParams.Params;

type: 'params';
}

export namespace ParamReportSiteReportParams {
export interface Params {
url: string;
}
}

export interface RequestIDReport {
request_id: string;

type: 'request_id';
}
}

export interface SiteScanParams {
url: string;

Expand All @@ -88,6 +128,8 @@ export namespace SiteScanParams {
export namespace Site {
export import SiteScanHitResponse = SiteAPI.SiteScanHitResponse;
export import SiteScanMissResponse = SiteAPI.SiteScanMissResponse;
export import SiteReportResponse = SiteAPI.SiteReportResponse;
export import SiteScanResponse = SiteAPI.SiteScanResponse;
export import SiteReportParams = SiteAPI.SiteReportParams;
export import SiteScanParams = SiteAPI.SiteScanParams;
}
Loading

0 comments on commit 8c247f2

Please sign in to comment.