Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stainless Bot committed Aug 21, 2024
1 parent 2f0040b commit bf193aa
Show file tree
Hide file tree
Showing 27 changed files with 1,018 additions and 1,241 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
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-6526422e6cb64e9f67a884a01aacf5e4740b835d31160e850a3ecc748c0d6919.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-342e3c84eca99d7cf6f1adb17507ed19727f0f7e992d099dfd90d0ea4cd573ba.yml
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const client = new Blockaid({
});

async function main() {
const evmTransactionScanResponse = await client.evm.jsonRpc.scan({
const transactionScanResponse = await client.evm.jsonRpc.scan({
chain: 'arbitrum',
data: {
method: 'eth_signTypedData_v4',
Expand All @@ -39,7 +39,7 @@ async function main() {
metadata: { domain: 'https://boredapeyartclub.com' },
});

console.log(evmTransactionScanResponse.validation);
console.log(transactionScanResponse.validation);
}

main();
Expand Down Expand Up @@ -69,9 +69,7 @@ async function main() {
},
metadata: { domain: 'https://boredapeyartclub.com' },
};
const evmTransactionScanResponse: Blockaid.EvmTransactionScanResponse = await client.evm.jsonRpc.scan(
params,
);
const transactionScanResponse: Blockaid.TransactionScanResponse = await client.evm.jsonRpc.scan(params);
}

main();
Expand All @@ -88,7 +86,7 @@ a subclass of `APIError` will be thrown:
<!-- prettier-ignore -->
```ts
async function main() {
const evmTransactionScanResponse = await client.evm.jsonRpc
const transactionScanResponse = await client.evm.jsonRpc
.scan({
chain: 'arbitrum',
data: {
Expand Down Expand Up @@ -197,7 +195,7 @@ const response = await client.evm.jsonRpc
console.log(response.headers.get('X-My-Header'));
console.log(response.statusText); // access the underlying Response object

const { data: evmTransactionScanResponse, response: raw } = await client.evm.jsonRpc
const { data: transactionScanResponse, response: raw } = await client.evm.jsonRpc
.scan({
chain: 'arbitrum',
data: {
Expand All @@ -211,7 +209,7 @@ const { data: evmTransactionScanResponse, response: raw } = await client.evm.jso
})
.withResponse();
console.log(raw.headers.get('X-My-Header'));
console.log(evmTransactionScanResponse.validation);
console.log(transactionScanResponse.validation);
```

### Making custom/undocumented requests
Expand Down
44 changes: 22 additions & 22 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Types:

Methods:

- <code title="post /v0/evm/json-rpc/scan">client.evm.jsonRpc.<a href="./src/resources/evm/json-rpc.ts">scan</a>({ ...params }) -> EvmTransactionScanResponse</code>
- <code title="post /v0/evm/json-rpc/scan">client.evm.jsonRpc.<a href="./src/resources/evm/json-rpc.ts">scan</a>({ ...params }) -> TransactionScanResponse</code>

## Transaction

Expand All @@ -48,7 +48,7 @@ Types:
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 }) -> EvmTransactionScanResponse</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 @@ -64,13 +64,13 @@ Methods:

Methods:

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

## UserOperation

Methods:

- <code title="post /v0/evm/user-operation/scan">client.evm.userOperation.<a href="./src/resources/evm/user-operation.ts">scan</a>({ ...params }) -> EvmTransactionScanResponse</code>
- <code title="post /v0/evm/user-operation/scan">client.evm.userOperation.<a href="./src/resources/evm/user-operation.ts">scan</a>({ ...params }) -> TransactionScanResponse</code>

## PostTransaction

Expand All @@ -81,7 +81,7 @@ Types:
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 }) -> EvmTransactionScanResponse</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 All @@ -98,6 +98,8 @@ Methods:
Types:

- <code><a href="./src/resources/solana/solana.ts">AccountSummarySchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">AddressScanRequestSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">AddressScanResponseSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">APIErrorDetails</a></code>
- <code><a href="./src/resources/solana/solana.ts">AssetTransferDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">CnftDetailsSchema</a></code>
Expand All @@ -113,10 +115,7 @@ Types:
- <code><a href="./src/resources/solana/solana.ts">NonFungibleMintAccountDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">PdaAccountSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">ProgramAccountDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SolanaAddressScanRequest</a></code>
- <code><a href="./src/resources/solana/solana.ts">SolanaAddressScanResponse</a></code>
- <code><a href="./src/resources/solana/solana.ts">SolanaMessageScanRequest</a></code>
- <code><a href="./src/resources/solana/solana.ts">SolanaMessageScanResponse</a></code>
- <code><a href="./src/resources/solana/solana.ts">ResponseSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplFungibleTokenDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplFungibleTokenDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">SplNonFungibleTokenDetailsSchema</a></code>
Expand All @@ -129,25 +128,26 @@ Types:
- <code><a href="./src/resources/solana/solana.ts">TokenAccountDetailsSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">TotalUsdDiffSchema</a></code>
- <code><a href="./src/resources/solana/solana.ts">TransactionErrorDetails</a></code>
- <code><a href="./src/resources/solana/solana.ts">TxScanRequestSchema</a></code>

## Message

Methods:

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

## Address

Methods:

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

# Stellar

Types:

- <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">StellarAssetContractDetailsSchema</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarAssetTransferDetailsSchema</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarTransactionScanRequest</a></code>
- <code><a href="./src/resources/stellar/stellar.ts">StellarTransactionScanResponse</a></code>

Expand All @@ -159,16 +159,15 @@ Methods:

# Bitcoin

Types:
## Transaction

- <code><a href="./src/resources/bitcoin/bitcoin.ts">BitcoinTransactionScanRequest</a></code>
- <code><a href="./src/resources/bitcoin/bitcoin.ts">BitcoinTransactionScanResponse</a></code>
Types:

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

Methods:

- <code title="post /v0/bitcoin/transaction/scan">client.bitcoin.transaction.<a href="./src/resources/bitcoin/transaction.ts">scan</a>({ ...params }) -> BitcoinTransactionScanResponse</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 @@ -181,14 +180,16 @@ Types:
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc721Details</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetErc721Diff</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetNativeDiff</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetTransactionScanRequest</a></code>
- <code><a href="./src/resources/starknet/starknet.ts">StarknetTransactionScanResponse</a></code>

## Transaction

Types:

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

Methods:

- <code title="post /v0/starknet/transaction/scan">client.starknet.transaction.<a href="./src/resources/starknet/transaction.ts">scan</a>({ ...params }) -> StarknetTransactionScanResponse</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 All @@ -208,7 +209,6 @@ Methods:

Types:

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

Expand Down
17 changes: 6 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ export namespace Blockaid {

export import Solana = API.Solana;
export import AccountSummarySchema = API.AccountSummarySchema;
export import AddressScanRequestSchema = API.AddressScanRequestSchema;
export import AddressScanResponseSchema = API.AddressScanResponseSchema;
export import APIErrorDetails = API.APIErrorDetails;
export import AssetTransferDetailsSchema = API.AssetTransferDetailsSchema;
export import CnftDetailsSchema = API.CnftDetailsSchema;
Expand All @@ -237,10 +239,7 @@ export namespace Blockaid {
export import NonFungibleMintAccountDetailsSchema = API.NonFungibleMintAccountDetailsSchema;
export import PdaAccountSchema = API.PdaAccountSchema;
export import ProgramAccountDetailsSchema = API.ProgramAccountDetailsSchema;
export import SolanaAddressScanRequest = API.SolanaAddressScanRequest;
export import SolanaAddressScanResponse = API.SolanaAddressScanResponse;
export import SolanaMessageScanRequest = API.SolanaMessageScanRequest;
export import SolanaMessageScanResponse = API.SolanaMessageScanResponse;
export import ResponseSchema = API.ResponseSchema;
export import SplFungibleTokenDetailsSchema = API.SplFungibleTokenDetailsSchema;
export import SplFungibleTokenDiffSchema = API.SplFungibleTokenDiffSchema;
export import SplNonFungibleTokenDetailsSchema = API.SplNonFungibleTokenDetailsSchema;
Expand All @@ -253,16 +252,15 @@ export namespace Blockaid {
export import TokenAccountDetailsSchema = API.TokenAccountDetailsSchema;
export import TotalUsdDiffSchema = API.TotalUsdDiffSchema;
export import TransactionErrorDetails = API.TransactionErrorDetails;
export import TxScanRequestSchema = API.TxScanRequestSchema;

export import Stellar = API.Stellar;
export import StellarAssetContractDetails = API.StellarAssetContractDetails;
export import StellarAssetTransferDetails = API.StellarAssetTransferDetails;
export import StellarAssetContractDetailsSchema = API.StellarAssetContractDetailsSchema;
export import StellarAssetTransferDetailsSchema = API.StellarAssetTransferDetailsSchema;
export import StellarTransactionScanRequest = API.StellarTransactionScanRequest;
export import StellarTransactionScanResponse = API.StellarTransactionScanResponse;

export import Bitcoin = API.Bitcoin;
export import BitcoinTransactionScanRequest = API.BitcoinTransactionScanRequest;
export import BitcoinTransactionScanResponse = API.BitcoinTransactionScanResponse;

export import Starknet = API.Starknet;
export import StarknetErc1155Details = API.StarknetErc1155Details;
Expand All @@ -272,8 +270,6 @@ export namespace Blockaid {
export import StarknetErc721Details = API.StarknetErc721Details;
export import StarknetErc721Diff = API.StarknetErc721Diff;
export import StarknetNativeDiff = API.StarknetNativeDiff;
export import StarknetTransactionScanRequest = API.StarknetTransactionScanRequest;
export import StarknetTransactionScanResponse = API.StarknetTransactionScanResponse;

export import Site = API.Site;
export import SiteScanHitResponse = API.SiteScanHitResponse;
Expand All @@ -284,7 +280,6 @@ export namespace Blockaid {
export import SiteScanParams = API.SiteScanParams;

export import Token = API.Token;
export import TokenScanSupportedChain = API.TokenScanSupportedChain;
export import TokenReportResponse = API.TokenReportResponse;
export import TokenScanResponse = API.TokenScanResponse;
export import TokenReportParams = API.TokenReportParams;
Expand Down
Loading

0 comments on commit bf193aa

Please sign in to comment.