Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 10, 2024
1 parent 0b65cf9 commit 1ad5f36
Show file tree
Hide file tree
Showing 10 changed files with 1,043 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 10
configured_endpoints: 12
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-f88dc435e11134e1b575820cd27672e8e6c42b53abef807cb8d0d4851a64c86b.yml
30 changes: 30 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,36 @@ Methods:

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

# Solana

Types:

- <code><a href="./src/resources/solana/solana.ts">AssetTransferDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">CnftDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">NativeSolDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplFungibleTokenDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplNonFungibleTokenDetailsSchema</a></code>

## Message

Types:

- <code><a href="./src/resources/solana/message.ts">MessageScanResponse</a></code>

Methods:

- <code title="post /v0/solana/message/scan">client.solana.message.<a href="./src/resources/solana/message.ts">scan</a>({ ...params }) -> MessageScanResponse</code>

## Address

Types:

- <code><a href="./src/resources/solana/address.ts">AddressScanResponse</a></code>

Methods:

- <code title="post /v0/solana/address/scan">client.solana.address.<a href="./src/resources/solana/address.ts">scan</a>({ ...params }) -> AddressScanResponse</code>

# Stellar

Types:
Expand Down
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class Blockaid extends Core.APIClient {
}

evm: API.Evm = new API.Evm(this);
solana: API.Solana = new API.Solana(this);
stellar: API.Stellar = new API.Stellar(this);
site: API.Site = new API.Site(this);
token: API.Token = new API.Token(this);
Expand Down Expand Up @@ -210,6 +211,13 @@ export namespace Blockaid {
export import TransactionValidationError = API.TransactionValidationError;
export import UsdDiff = API.UsdDiff;

export import Solana = API.Solana;
export import AssetTransferDetailsSchema = API.AssetTransferDetailsSchema;
export import CnftDetailsSchema = API.CnftDetailsSchema;
export import NativeSolDetailsSchema = API.NativeSolDetailsSchema;
export import SplFungibleTokenDetailsSchema = API.SplFungibleTokenDetailsSchema;
export import SplNonFungibleTokenDetailsSchema = API.SplNonFungibleTokenDetailsSchema;

export import Stellar = API.Stellar;
export import StellarAssetContractDetailsSchema = API.StellarAssetContractDetailsSchema;
export import StellarAssetTransferDetailsSchema = API.StellarAssetTransferDetailsSchema;
Expand Down
8 changes: 8 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ export {
UsdDiff,
Evm,
} from './evm/evm';
export {
AssetTransferDetailsSchema,
CnftDetailsSchema,
NativeSolDetailsSchema,
SplFungibleTokenDetailsSchema,
SplNonFungibleTokenDetailsSchema,
Solana,
} from './solana/solana';
export { SiteScanHitResponse, SiteScanMissResponse, SiteScanResponse, SiteScanParams, Site } from './site';
export {
StellarAssetContractDetailsSchema,
Expand Down
75 changes: 75 additions & 0 deletions src/resources/solana/address.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// 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 AddressAPI from '@blockaid/client/resources/solana/address';

export class Address extends APIResource {
/**
* Gets an address and returns a full security assessment indicating weather or not
* this address is malicious as well as textual reasons of why the address was
* flagged that way.
*/
scan(body: AddressScanParams, options?: Core.RequestOptions): Core.APIPromise<AddressScanResponse> {
return this._client.post('/v0/solana/address/scan', { body, ...options });
}
}

export interface AddressScanResponse {
/**
* Features about the result
*/
features: Array<AddressScanResponse.Feature>;

/**
* An enumeration.
*/
result_type: 'Malicious' | 'Warning' | 'Benign';
}

export namespace AddressScanResponse {
export interface Feature {
/**
* Description of the feature
*/
description: string;

/**
* ID of the feature
*/
feature_id: string;

/**
* An enumeration.
*/
type: 'Malicious' | 'Warning' | 'Benign' | 'Info';
}
}

export interface AddressScanParams {
/**
* Encoded public key
*/
address: string;

metadata: AddressScanParams.Metadata;

/**
* Chain to scan the transaction on
*/
chain?: string;
}

export namespace AddressScanParams {
export interface Metadata {
/**
* URL of the dApp related to the address
*/
url: string;
}
}

export namespace Address {
export import AddressScanResponse = AddressAPI.AddressScanResponse;
export import AddressScanParams = AddressAPI.AddressScanParams;
}
12 changes: 12 additions & 0 deletions src/resources/solana/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { AddressScanResponse, AddressScanParams, Address } from './address';
export {
AssetTransferDetailsSchema,
CnftDetailsSchema,
NativeSolDetailsSchema,
SplFungibleTokenDetailsSchema,
SplNonFungibleTokenDetailsSchema,
Solana,
} from './solana';
export { MessageScanResponse, MessageScanParams, Message } from './message';
Loading

0 comments on commit 1ad5f36

Please sign in to comment.