Skip to content

Commit

Permalink
feat(api): manual updates (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 11, 2024
1 parent 6b34d68 commit c10997e
Show file tree
Hide file tree
Showing 17 changed files with 1,325 additions and 1,359 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: 19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-45800f1aa42276b5d55d613d6b586c35fdc605496753c575443096a26655a4cd.yml
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-87ee3fdeb9a606656f22829350b26c4844d0071379d4718d0dc1495381eae9ba.yml
10 changes: 8 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,27 +138,31 @@ Types:

- <code><a href="./src/resources/stellar/stellar.ts">StellarAssetContractDetailsSchema</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarAssetTransferDetailsSchema</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarTransactionScanResponse</a></code>

## Transaction

Types:

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

Methods:

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

# Bitcoin

## Transaction

Types:

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

Methods:

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

# Starknet
Expand All @@ -173,10 +177,12 @@ Types:

Types:

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

Methods:

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

# Site
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ import {
Stellar,
StellarAssetContractDetailsSchema,
StellarAssetTransferDetailsSchema,
StellarTransactionScanResponse,
} from './resources/stellar/stellar';

const environments = {
Expand Down Expand Up @@ -417,6 +418,7 @@ export declare namespace Blockaid {
Stellar as Stellar,
type StellarAssetContractDetailsSchema as StellarAssetContractDetailsSchema,
type StellarAssetTransferDetailsSchema as StellarAssetTransferDetailsSchema,
type StellarTransactionScanResponse as StellarTransactionScanResponse,
};

export { Bitcoin as Bitcoin };
Expand Down
10 changes: 9 additions & 1 deletion src/resources/bitcoin/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

import { APIResource } from '../../resource';
import * as TransactionAPI from './transaction';
import { Transaction, TransactionScanParams, TransactionScanResponse } from './transaction';
import {
Transaction,
TransactionReportParams,
TransactionReportResponse,
TransactionScanParams,
TransactionScanResponse,
} from './transaction';

export class Bitcoin extends APIResource {
transaction: TransactionAPI.Transaction = new TransactionAPI.Transaction(this._client);
Expand All @@ -13,7 +19,9 @@ Bitcoin.Transaction = Transaction;
export declare namespace Bitcoin {
export {
Transaction as Transaction,
type TransactionReportResponse as TransactionReportResponse,
type TransactionScanResponse as TransactionScanResponse,
type TransactionReportParams as TransactionReportParams,
type TransactionScanParams as TransactionScanParams,
};
}
8 changes: 7 additions & 1 deletion src/resources/bitcoin/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Bitcoin } from './bitcoin';
export { Transaction, type TransactionScanResponse, type TransactionScanParams } from './transaction';
export {
Transaction,
type TransactionReportResponse,
type TransactionScanResponse,
type TransactionReportParams,
type TransactionScanParams,
} from './transaction';
85 changes: 85 additions & 0 deletions src/resources/bitcoin/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ import { APIResource } from '../../resource';
import * as Core from '../../core';

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

/**
* Scan Transaction
*/
Expand All @@ -12,6 +22,8 @@ export class Transaction extends APIResource {
}
}

export type TransactionReportResponse = number;

export interface TransactionScanResponse {
/**
* Simulation result; Only present if simulation option is included in the request
Expand Down Expand Up @@ -444,6 +456,77 @@ export namespace TransactionScanResponse {
}
}

export interface TransactionReportParams {
details: string;

event: 'should_be_malicious' | 'should_be_benign';

report:
| TransactionReportParams.BitcoinAppealRequestID
| TransactionReportParams.BitcoinAppealTransactionDataReportRequestSchemaTypeChainSchemaAnnotatedStrSkipValidationPlainSerializerGetPydanticSchemaAnnotatedStrSkipValidationPlainSerializerGetPydanticSchemaAnnotatedSetOptionsFieldInfoAnnotationNoneTypeRequiredFalseValidationSimulationTitleOptionsSimulationMetadataMinLenMinLength1;
}

export namespace TransactionReportParams {
export interface BitcoinAppealRequestID {
id: string;

type?: 'request_id';
}

export interface BitcoinAppealTransactionDataReportRequestSchemaTypeChainSchemaAnnotatedStrSkipValidationPlainSerializerGetPydanticSchemaAnnotatedStrSkipValidationPlainSerializerGetPydanticSchemaAnnotatedSetOptionsFieldInfoAnnotationNoneTypeRequiredFalseValidationSimulationTitleOptionsSimulationMetadataMinLenMinLength1 {
params: BitcoinAppealTransactionDataReportRequestSchemaTypeChainSchemaAnnotatedStrSkipValidationPlainSerializerGetPydanticSchemaAnnotatedStrSkipValidationPlainSerializerGetPydanticSchemaAnnotatedSetOptionsFieldInfoAnnotationNoneTypeRequiredFalseValidationSimulationTitleOptionsSimulationMetadataMinLenMinLength1.Params;

type?: 'params';
}

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

chain: 'bitcoin';

/**
* Metadata
*/
metadata:
| Params.BitcoinblockaidApplicationRunnerAppSchemasTransactionScanningAPIWalletRequestMetadata
| Params.BitcoinblockaidApplicationRunnerAppSchemasTransactionScanningAPIInAppRequestMetadata;

transaction: string;

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

export namespace Params {
export interface BitcoinblockaidApplicationRunnerAppSchemasTransactionScanningAPIWalletRequestMetadata {
/**
* Metadata for wallet requests
*/
type: 'wallet';

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

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

export interface TransactionScanParams {
account_address: string;

Expand Down Expand Up @@ -491,7 +574,9 @@ export namespace TransactionScanParams {

export declare namespace Transaction {
export {
type TransactionReportResponse as TransactionReportResponse,
type TransactionScanResponse as TransactionScanResponse,
type TransactionReportParams as TransactionReportParams,
type TransactionScanParams as TransactionScanParams,
};
}
Loading

0 comments on commit c10997e

Please sign in to comment.