Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 11, 2024
1 parent 4ba45cd commit 6f20d3b
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 18 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: 12
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-735896cbc9b757f96ce708fb436c436e6015eb69c5bfa90ced16416ff850105a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-d7ff355d85b64141baca85cb8d2e6bcad9b17dc21dd4d0c41d2e95d3757feb56.yml
6 changes: 6 additions & 0 deletions src/resources/evm/json-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export interface JsonRpcScanParams {
*/
account_address?: string;

/**
* The relative block for the block validation. Can be "latest", "earliest",
* "pending" or a block number.
*/
block?: number | string;

/**
* list of one or both of options for the desired output. "simulation" - include
* simulation output in your response. "validation" - include security validation
Expand Down
6 changes: 6 additions & 0 deletions src/resources/evm/post-transaction-bulk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export interface PostTransactionBulkScanParams {
*/
metadata: EvmAPI.Metadata;

/**
* The relative block for the block validation. Can be "latest", "earliest",
* "pending" or a block number.
*/
block?: number | string;

/**
* List of one or both of options for the desired output. "simulation" - include
* simulation output in your response. "validation" - include security validation
Expand Down
6 changes: 6 additions & 0 deletions src/resources/evm/post-transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export interface PostTransactionScanParams {
*/
metadata: EvmAPI.Metadata;

/**
* The relative block for the block validation. Can be "latest", "earliest",
* "pending" or a block number.
*/
block?: number | string;

/**
* list of one or both of options for the desired output. "simulation" - include
* simulation output in your response. "validation" - include security validation
Expand Down
6 changes: 6 additions & 0 deletions src/resources/evm/transaction-bulk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export interface TransactionBulkScanParams {
*/
metadata: EvmAPI.Metadata;

/**
* The relative block for the block validation. Can be "latest", "earliest",
* "pending" or a block number.
*/
block?: number | string;

/**
* List of one or both of options for the desired output. "simulation" - include
* simulation output in your response. "validation" - include security validation
Expand Down
6 changes: 6 additions & 0 deletions src/resources/evm/transaction-raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export interface TransactionRawScanParams {
*/
metadata: EvmAPI.Metadata;

/**
* The relative block for the block validation. Can be "latest", "earliest",
* "pending" or a block number.
*/
block?: number | string;

/**
* list of one or both of options for the desired output. "simulation" - include
* simulation output in your response. "validation" - include security validation
Expand Down
6 changes: 6 additions & 0 deletions src/resources/evm/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export interface TransactionScanParams {
*/
metadata: EvmAPI.Metadata;

/**
* The relative block for the block validation. Can be "latest", "earliest",
* "pending" or a block number.
*/
block?: number | string;

/**
* list of one or both of options for the desired output. "simulation" - include
* simulation output in your response. "validation" - include security validation
Expand Down
6 changes: 6 additions & 0 deletions src/resources/evm/user-operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export interface UserOperationScanParams {
*/
account_address?: string;

/**
* The relative block for the block validation. Can be "latest", "earliest",
* "pending" or a block number.
*/
block?: number | string;

/**
* list of one or both of options for the desired output. "simulation" - include
* simulation output in your response. "validation" - include security validation
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/evm/json-rpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('resource jsonRpc', () => {
},
metadata: { domain: 'https://boredapeyartclub.com' },
account_address: '0x49c73c9d361c04769a452E85D343b41aC38e0EE4',
block: '18370320',
options: ['simulation', 'validation'],
});
});
Expand Down
5 changes: 3 additions & 2 deletions tests/api-resources/evm/post-transaction-bulk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('resource postTransactionBulk', () => {
'0x11c865addc39f1e1c4f0f6c9a84533c501e3705a6397988af942b2103d5e87a2',
'0x50a109a2c2dd396e49710613dcf652728656055d90f80094f10c3ddd05150d2e',
],
metadata: { domain: 'string' },
metadata: { domain: 'domain' },
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -34,7 +34,8 @@ describe('resource postTransactionBulk', () => {
'0x11c865addc39f1e1c4f0f6c9a84533c501e3705a6397988af942b2103d5e87a2',
'0x50a109a2c2dd396e49710613dcf652728656055d90f80094f10c3ddd05150d2e',
],
metadata: { domain: 'string' },
metadata: { domain: 'domain' },
block: 0,
options: ['validation', 'simulation'],
});
});
Expand Down
5 changes: 3 additions & 2 deletions tests/api-resources/evm/post-transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('resource postTransaction', () => {
const responsePromise = blockaid.evm.postTransaction.scan({
chain: 'ethereum',
data: { tx_hash: '0xc01780dadc107754b331250b4797606949cb3d0087facc0a737122d5e973c83c' },
metadata: { domain: 'string' },
metadata: { domain: 'domain' },
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -28,7 +28,8 @@ describe('resource postTransaction', () => {
const response = await blockaid.evm.postTransaction.scan({
chain: 'ethereum',
data: { tx_hash: '0xc01780dadc107754b331250b4797606949cb3d0087facc0a737122d5e973c83c' },
metadata: { domain: 'string' },
metadata: { domain: 'domain' },
block: 0,
options: ['validation', 'simulation'],
});
});
Expand Down
9 changes: 5 additions & 4 deletions tests/api-resources/evm/transaction-bulk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@ describe('resource transactionBulk', () => {
to: '0xA4e5961B58DBE487639929643dCB1Dc3848dAF5E',
data: '0x',
value: '0x100000000000',
gas: 'string',
gas_price: 'string',
gas: 'gas',
gas_price: 'gas_price',
},
{
from: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
to: '0x0D524a5B52737C0a02880d5E84F7D20b8d66bfba',
data: '0x',
value: '0xdeadbeef',
gas: 'string',
gas_price: 'string',
gas: 'gas',
gas_price: 'gas_price',
},
],
metadata: { domain: 'https://example.com' },
block: '20224477',
options: ['validation'],
});
});
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/evm/transaction-raw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('resource transactionRaw', () => {
chain: 'ethereum',
data: '0x02f903f8018208488405f5e100850a9a03feb38302fa6a941111111254eeb25477b68fb85ed929f73a96058280b9038862e238bb00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab3e25398a24d6af080000000000000000000000000000000000000000000000000000000070db68f000000000000000000000000000000000000000000000000000000c0c2f020e4000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000006e2a43be0b1d33b726f0ca3b8de60b3482b8b050000000000000000000000000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000773594000000000000000000000000000000000000000000000000b4b34aede8e617e060000000a4000000a4000000a4000000a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000a4bf15fcd8000000000000000000000000303389f541ff2d620e42832f180a08e767b28e10000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000242cc2878d0064b6509600000000060000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a946fd8d5b9e873563a1411cbdf290b8310d8cdddc94da3aebf95b16a6dc0bf56d736ece63e3906527b7dcf08aa845d6a5cd4e0d99c9994f617b6faa378317f71c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e26b9977c001a0386a78e05b5ab3b4badbae843aaa6ed379b2f4353aa730c8f360141e72cba692a036ed37a00c6364685e58bc0cd9cdd1c140d6690c3c0d216c1b67e3d262e2f0f9',
metadata: { domain: 'https://app.1inch.io' },
block: '17718858',
options: ['simulation', 'validation'],
});
});
Expand Down
9 changes: 5 additions & 4 deletions tests/api-resources/evm/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const blockaid = new Blockaid({
describe('resource transaction', () => {
test('scan: only required params', async () => {
const responsePromise = blockaid.evm.transaction.scan({
account_address: 'string',
account_address: 'account_address',
chain: 'ethereum',
data: { from: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb' },
metadata: { domain: 'https://boredapeyartclub.com' },
Expand All @@ -27,17 +27,18 @@ describe('resource transaction', () => {

test('scan: required and optional params', async () => {
const response = await blockaid.evm.transaction.scan({
account_address: 'string',
account_address: 'account_address',
chain: 'ethereum',
data: {
from: '0x5e1a0d484c5f0de722e82f9dca3a9d5a421d47cb',
to: '0x0d524a5b52737c0a02880d5e84f7d20b8d66bfba',
data: '0x',
value: '0x1000000000000000',
gas: 'string',
gas_price: 'string',
gas: 'gas',
gas_price: 'gas_price',
},
metadata: { domain: 'https://boredapeyartclub.com' },
block: 0,
options: ['simulation', 'validation'],
});
});
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/evm/user-operation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe('resource userOperation', () => {
},
metadata: { domain: 'example.com' },
account_address: '0x77bA5AC3ca4864be26CA3112baDf07286CcC3324',
block: '0x5c6fd5',
options: ['simulation', 'validation'],
});
});
Expand Down
8 changes: 4 additions & 4 deletions tests/api-resources/stellar/transaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const blockaid = new Blockaid({
describe('resource transaction', () => {
test('scan: only required params', async () => {
const responsePromise = blockaid.stellar.transaction.scan({
account_address: 'string',
account_address: 'account_address',
chain: 'pubnet',
metadata: { url: 'string' },
metadata: { url: 'url' },
transactions: ['string', 'string', 'string'],
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -27,9 +27,9 @@ describe('resource transaction', () => {

test('scan: required and optional params', async () => {
const response = await blockaid.stellar.transaction.scan({
account_address: 'string',
account_address: 'account_address',
chain: 'pubnet',
metadata: { type: 'wallet', url: 'string' },
metadata: { type: 'wallet', url: 'url' },
transactions: ['string', 'string', 'string'],
options: ['validation'],
});
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('resource token', () => {
const response = await blockaid.token.scan({
address: '0x66587563e933bbf3974b89156b47bb82b921eb35',
chain: 'ethereum',
metadata: { domain: 'string' },
metadata: { domain: 'domain' },
});
});
});

0 comments on commit 6f20d3b

Please sign in to comment.