Skip to content

Commit

Permalink
feat(api): api update (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 12, 2024
1 parent e63fddd commit 85b6f49
Show file tree
Hide file tree
Showing 18 changed files with 1,205 additions and 1,222 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-f41ac491b9d7fa4596ebc394c2f2b22c93ad45da2dd3de08574022091afed10e.yml
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-a8d116e345ec36054b1a8cc6fa98564ede39989a9b9ce1383f9e37738dcf33ff.yml
24 changes: 20 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ Types:
- <code><a href="./src/resources/solana/solana.ts">DelegatedAssetDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">FungibleMintAccountDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">InstructionErrorDetails</a></code>
- <code><a href="./src/resources/solana/solana.ts">NativeDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">NativeDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">NativeSolOwnershipDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">NonFungibleMintAccountDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">PdaAccountSchema</a></code>
Expand All @@ -111,6 +113,7 @@ Types:
- <code><a href="./src/resources/solana/solana.ts">SplNonFungibleTokenDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplNonFungibleTokenDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplTokenOwnershipDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">StakedAssetDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">StakedSolWithdrawAuthorityDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SuccessfulSimulationResultSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SystemAccountDetailsSchema</a></code>
Expand All @@ -136,47 +139,60 @@ Methods:

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">StellarAssetContractDetails</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarAssetTransferDetails</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarLegacyAssetDetails</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarNativeAssetDetails</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarSingleAssetExposure</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarTransactionScanRequest</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

Types:

- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc1155Details</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc1155Diff</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc20Details</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc20Diff</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc721Details</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
30 changes: 26 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ import {
DelegatedAssetDetailsSchema,
FungibleMintAccountDetailsSchema,
InstructionErrorDetails,
NativeDetailsSchema,
NativeDiffSchema,
NativeSolOwnershipDiffSchema,
NonFungibleMintAccountDetailsSchema,
PdaAccountSchema,
Expand All @@ -72,6 +74,7 @@ import {
SplNonFungibleTokenDetailsSchema,
SplNonFungibleTokenDiffSchema,
SplTokenOwnershipDiffSchema,
StakedAssetDetailsSchema,
StakedSolWithdrawAuthorityDiffSchema,
SuccessfulSimulationResultSchema,
SystemAccountDetailsSchema,
Expand All @@ -83,14 +86,22 @@ import {
} from './resources/solana/solana';
import {
Starknet,
StarknetErc1155Details,
StarknetErc1155Diff,
StarknetErc20Details,
StarknetErc20Diff,
StarknetErc721Details,
StarknetErc721Diff,
} from './resources/starknet/starknet';
import {
Stellar,
StellarAssetContractDetailsSchema,
StellarAssetTransferDetailsSchema,
StellarAssetContractDetails,
StellarAssetTransferDetails,
StellarLegacyAssetDetails,
StellarNativeAssetDetails,
StellarSingleAssetExposure,
StellarTransactionScanRequest,
StellarTransactionScanResponse,
} from './resources/stellar/stellar';

const environments = {
Expand Down Expand Up @@ -372,6 +383,8 @@ export declare namespace Blockaid {
type DelegatedAssetDetailsSchema as DelegatedAssetDetailsSchema,
type FungibleMintAccountDetailsSchema as FungibleMintAccountDetailsSchema,
type InstructionErrorDetails as InstructionErrorDetails,
type NativeDetailsSchema as NativeDetailsSchema,
type NativeDiffSchema as NativeDiffSchema,
type NativeSolOwnershipDiffSchema as NativeSolOwnershipDiffSchema,
type NonFungibleMintAccountDetailsSchema as NonFungibleMintAccountDetailsSchema,
type PdaAccountSchema as PdaAccountSchema,
Expand All @@ -382,6 +395,7 @@ export declare namespace Blockaid {
type SplNonFungibleTokenDetailsSchema as SplNonFungibleTokenDetailsSchema,
type SplNonFungibleTokenDiffSchema as SplNonFungibleTokenDiffSchema,
type SplTokenOwnershipDiffSchema as SplTokenOwnershipDiffSchema,
type StakedAssetDetailsSchema as StakedAssetDetailsSchema,
type StakedSolWithdrawAuthorityDiffSchema as StakedSolWithdrawAuthorityDiffSchema,
type SuccessfulSimulationResultSchema as SuccessfulSimulationResultSchema,
type SystemAccountDetailsSchema as SystemAccountDetailsSchema,
Expand All @@ -394,16 +408,24 @@ export declare namespace Blockaid {

export {
Stellar as Stellar,
type StellarAssetContractDetailsSchema as StellarAssetContractDetailsSchema,
type StellarAssetTransferDetailsSchema as StellarAssetTransferDetailsSchema,
type StellarAssetContractDetails as StellarAssetContractDetails,
type StellarAssetTransferDetails as StellarAssetTransferDetails,
type StellarLegacyAssetDetails as StellarLegacyAssetDetails,
type StellarNativeAssetDetails as StellarNativeAssetDetails,
type StellarSingleAssetExposure as StellarSingleAssetExposure,
type StellarTransactionScanRequest as StellarTransactionScanRequest,
type StellarTransactionScanResponse as StellarTransactionScanResponse,
};

export { Bitcoin as Bitcoin };

export {
Starknet as Starknet,
type StarknetErc1155Details as StarknetErc1155Details,
type StarknetErc1155Diff as StarknetErc1155Diff,
type StarknetErc20Details as StarknetErc20Details,
type StarknetErc20Diff as StarknetErc20Diff,
type StarknetErc721Details as StarknetErc721Details,
type StarknetErc721Diff as StarknetErc721Diff,
};

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,
};
}
15 changes: 13 additions & 2 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export {
type DelegatedAssetDetailsSchema,
type FungibleMintAccountDetailsSchema,
type InstructionErrorDetails,
type NativeDetailsSchema,
type NativeDiffSchema,
type NativeSolOwnershipDiffSchema,
type NonFungibleMintAccountDetailsSchema,
type PdaAccountSchema,
Expand All @@ -59,6 +61,7 @@ export {
type SplNonFungibleTokenDetailsSchema,
type SplNonFungibleTokenDiffSchema,
type SplTokenOwnershipDiffSchema,
type StakedAssetDetailsSchema,
type StakedSolWithdrawAuthorityDiffSchema,
type SuccessfulSimulationResultSchema,
type SystemAccountDetailsSchema,
Expand All @@ -70,14 +73,22 @@ export {
} from './solana/solana';
export {
Starknet,
type StarknetErc1155Details,
type StarknetErc1155Diff,
type StarknetErc20Details,
type StarknetErc20Diff,
type StarknetErc721Details,
type StarknetErc721Diff,
} from './starknet/starknet';
export {
Stellar,
type StellarAssetContractDetailsSchema,
type StellarAssetTransferDetailsSchema,
type StellarAssetContractDetails,
type StellarAssetTransferDetails,
type StellarLegacyAssetDetails,
type StellarNativeAssetDetails,
type StellarSingleAssetExposure,
type StellarTransactionScanRequest,
type StellarTransactionScanResponse,
} from './stellar/stellar';
export {
Token,
Expand Down
3 changes: 3 additions & 0 deletions src/resources/solana/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export {
type DelegatedAssetDetailsSchema,
type FungibleMintAccountDetailsSchema,
type InstructionErrorDetails,
type NativeDetailsSchema,
type NativeDiffSchema,
type NativeSolOwnershipDiffSchema,
type NonFungibleMintAccountDetailsSchema,
type PdaAccountSchema,
Expand All @@ -26,6 +28,7 @@ export {
type SplNonFungibleTokenDetailsSchema,
type SplNonFungibleTokenDiffSchema,
type SplTokenOwnershipDiffSchema,
type StakedAssetDetailsSchema,
type StakedSolWithdrawAuthorityDiffSchema,
type SuccessfulSimulationResultSchema,
type SystemAccountDetailsSchema,
Expand Down
Loading

0 comments on commit 85b6f49

Please sign in to comment.