Skip to content

Commit

Permalink
feat(api): manual updates (#314)
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 1a19626 commit 319bc69
Show file tree
Hide file tree
Showing 16 changed files with 1,321 additions and 210 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
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-9074805d4822d26da6e3f769edeb3bb4294de7586358fa0a4901990a405ab1e9.yml
17 changes: 6 additions & 11 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,16 @@ Methods:

# Stellar

Types:

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

## Transaction

Types:

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

Methods:

- <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 }) -> TransactionScanResponse</code>

# Bitcoin
Expand All @@ -155,28 +152,26 @@ Methods:

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

Types:

- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc1155Diff</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc20Diff</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc721Diff</a></code>

## Transaction

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
26 changes: 4 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,8 @@ import {
TxScanRequestSchema,
ValidationFeature,
} from './resources/solana/solana';
import {
Starknet,
StarknetErc1155Diff,
StarknetErc20Diff,
StarknetErc721Diff,
} from './resources/starknet/starknet';
import {
Stellar,
StellarAssetContractDetailsSchema,
StellarAssetTransferDetailsSchema,
} from './resources/stellar/stellar';
import { Starknet } from './resources/starknet/starknet';
import { Stellar } from './resources/stellar/stellar';

const environments = {
production: 'https://api.blockaid.io',
Expand Down Expand Up @@ -392,20 +383,11 @@ export declare namespace Blockaid {
type ValidationFeature as ValidationFeature,
};

export {
Stellar as Stellar,
type StellarAssetContractDetailsSchema as StellarAssetContractDetailsSchema,
type StellarAssetTransferDetailsSchema as StellarAssetTransferDetailsSchema,
};
export { Stellar as Stellar };

export { Bitcoin as Bitcoin };

export {
Starknet as Starknet,
type StarknetErc1155Diff as StarknetErc1155Diff,
type StarknetErc20Diff as StarknetErc20Diff,
type StarknetErc721Diff as StarknetErc721Diff,
};
export { Starknet as Starknet };

export {
Site as Site,
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';
83 changes: 83 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 @@ -441,6 +453,75 @@ export namespace TransactionScanResponse {
}
}

export interface TransactionReportParams {
details: string;

event: 'should_be_malicious' | 'should_be_benign';

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

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

type?: 'request_id';
}

export interface BitcoinAppealTransactionDataReport {
params: BitcoinAppealTransactionDataReport.Params;

type?: 'params';
}

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

chain: 'bitcoin';

/**
* Metadata
*/
metadata: Params.BitcoinWalletRequestMetadata | Params.BitcoinInAppRequestMetadata;

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 BitcoinWalletRequestMetadata {
/**
* Metadata for wallet requests
*/
type: 'wallet';

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

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

export interface TransactionScanParams {
account_address: string;

Expand Down Expand Up @@ -488,7 +569,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,
};
}
13 changes: 2 additions & 11 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,8 @@ export {
type TxScanRequestSchema,
type ValidationFeature,
} from './solana/solana';
export {
Starknet,
type StarknetErc1155Diff,
type StarknetErc20Diff,
type StarknetErc721Diff,
} from './starknet/starknet';
export {
Stellar,
type StellarAssetContractDetailsSchema,
type StellarAssetTransferDetailsSchema,
} from './stellar/stellar';
export { Starknet } from './starknet/starknet';
export { Stellar } from './stellar/stellar';
export {
Token,
type TokenReportResponse,
Expand Down
13 changes: 7 additions & 6 deletions src/resources/starknet/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Starknet } from './starknet';
export {
Starknet,
type StarknetErc1155Diff,
type StarknetErc20Diff,
type StarknetErc721Diff,
} from './starknet';
export { Transaction, type TransactionScanResponse, type TransactionScanParams } from './transaction';
Transaction,
type TransactionReportResponse,
type TransactionScanResponse,
type TransactionReportParams,
type TransactionScanParams,
} from './transaction';
77 changes: 9 additions & 68 deletions src/resources/starknet/starknet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,85 +2,26 @@

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 Starknet extends APIResource {
transaction: TransactionAPI.Transaction = new TransactionAPI.Transaction(this._client);
}

export interface StarknetErc1155Diff {
/**
* Token ID of the transfer
*/
token_id: string;

/**
* USD price of the asset
*/
usd_price: string;

/**
* Value of the transfer
*/
value: number;

/**
* Summarized description of the transfer
*/
summary?: string | null;
}

export interface StarknetErc20Diff {
/**
* Raw value of the transfer
*/
raw_value: number;

/**
* USD price of the asset
*/
usd_price: string;

/**
* Value of the transfer
*/
value: string;

/**
* Summarized description of the transfer
*/
summary?: string | null;
}

export interface StarknetErc721Diff {
/**
* Token ID of the transfer
*/
token_id: string;

/**
* USD price of the asset
*/
usd_price: string;

/**
* Summarized description of the transfer
*/
summary?: string | null;
}

Starknet.Transaction = Transaction;

export declare namespace Starknet {
export {
type StarknetErc1155Diff as StarknetErc1155Diff,
type StarknetErc20Diff as StarknetErc20Diff,
type StarknetErc721Diff as StarknetErc721Diff,
};

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

0 comments on commit 319bc69

Please sign in to comment.