From 6f20d3bbcbafda3fa86b926e4f09af28e4f4d8bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:36:11 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#102) --- .stats.yml | 2 +- src/resources/evm/json-rpc.ts | 6 ++++++ src/resources/evm/post-transaction-bulk.ts | 6 ++++++ src/resources/evm/post-transaction.ts | 6 ++++++ src/resources/evm/transaction-bulk.ts | 6 ++++++ src/resources/evm/transaction-raw.ts | 6 ++++++ src/resources/evm/transaction.ts | 6 ++++++ src/resources/evm/user-operation.ts | 6 ++++++ tests/api-resources/evm/json-rpc.test.ts | 1 + tests/api-resources/evm/post-transaction-bulk.test.ts | 5 +++-- tests/api-resources/evm/post-transaction.test.ts | 5 +++-- tests/api-resources/evm/transaction-bulk.test.ts | 9 +++++---- tests/api-resources/evm/transaction-raw.test.ts | 1 + tests/api-resources/evm/transaction.test.ts | 9 +++++---- tests/api-resources/evm/user-operation.test.ts | 1 + tests/api-resources/stellar/transaction.test.ts | 8 ++++---- tests/api-resources/token.test.ts | 2 +- 17 files changed, 67 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index d84bffa..f5624ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/src/resources/evm/json-rpc.ts b/src/resources/evm/json-rpc.ts index e9509c8..0a76e2f 100644 --- a/src/resources/evm/json-rpc.ts +++ b/src/resources/evm/json-rpc.ts @@ -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 diff --git a/src/resources/evm/post-transaction-bulk.ts b/src/resources/evm/post-transaction-bulk.ts index 81e7ba7..f37b09a 100644 --- a/src/resources/evm/post-transaction-bulk.ts +++ b/src/resources/evm/post-transaction-bulk.ts @@ -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 diff --git a/src/resources/evm/post-transaction.ts b/src/resources/evm/post-transaction.ts index 4acf74c..f16fda2 100644 --- a/src/resources/evm/post-transaction.ts +++ b/src/resources/evm/post-transaction.ts @@ -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 diff --git a/src/resources/evm/transaction-bulk.ts b/src/resources/evm/transaction-bulk.ts index 2a1b50e..7e17bee 100644 --- a/src/resources/evm/transaction-bulk.ts +++ b/src/resources/evm/transaction-bulk.ts @@ -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 diff --git a/src/resources/evm/transaction-raw.ts b/src/resources/evm/transaction-raw.ts index 7b4461f..ef1beaa 100644 --- a/src/resources/evm/transaction-raw.ts +++ b/src/resources/evm/transaction-raw.ts @@ -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 diff --git a/src/resources/evm/transaction.ts b/src/resources/evm/transaction.ts index 2eda0ab..28fd281 100644 --- a/src/resources/evm/transaction.ts +++ b/src/resources/evm/transaction.ts @@ -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 diff --git a/src/resources/evm/user-operation.ts b/src/resources/evm/user-operation.ts index fa722d2..1ac79d4 100644 --- a/src/resources/evm/user-operation.ts +++ b/src/resources/evm/user-operation.ts @@ -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 diff --git a/tests/api-resources/evm/json-rpc.test.ts b/tests/api-resources/evm/json-rpc.test.ts index 7f177f5..b1fbdb8 100644 --- a/tests/api-resources/evm/json-rpc.test.ts +++ b/tests/api-resources/evm/json-rpc.test.ts @@ -42,6 +42,7 @@ describe('resource jsonRpc', () => { }, metadata: { domain: 'https://boredapeyartclub.com' }, account_address: '0x49c73c9d361c04769a452E85D343b41aC38e0EE4', + block: '18370320', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/post-transaction-bulk.test.ts b/tests/api-resources/evm/post-transaction-bulk.test.ts index 36449d8..d361299 100644 --- a/tests/api-resources/evm/post-transaction-bulk.test.ts +++ b/tests/api-resources/evm/post-transaction-bulk.test.ts @@ -16,7 +16,7 @@ describe('resource postTransactionBulk', () => { '0x11c865addc39f1e1c4f0f6c9a84533c501e3705a6397988af942b2103d5e87a2', '0x50a109a2c2dd396e49710613dcf652728656055d90f80094f10c3ddd05150d2e', ], - metadata: { domain: 'string' }, + metadata: { domain: 'domain' }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -34,7 +34,8 @@ describe('resource postTransactionBulk', () => { '0x11c865addc39f1e1c4f0f6c9a84533c501e3705a6397988af942b2103d5e87a2', '0x50a109a2c2dd396e49710613dcf652728656055d90f80094f10c3ddd05150d2e', ], - metadata: { domain: 'string' }, + metadata: { domain: 'domain' }, + block: 0, options: ['validation', 'simulation'], }); }); diff --git a/tests/api-resources/evm/post-transaction.test.ts b/tests/api-resources/evm/post-transaction.test.ts index 285114b..a2a630e 100644 --- a/tests/api-resources/evm/post-transaction.test.ts +++ b/tests/api-resources/evm/post-transaction.test.ts @@ -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); @@ -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'], }); }); diff --git a/tests/api-resources/evm/transaction-bulk.test.ts b/tests/api-resources/evm/transaction-bulk.test.ts index 3378cfa..99894a5 100644 --- a/tests/api-resources/evm/transaction-bulk.test.ts +++ b/tests/api-resources/evm/transaction-bulk.test.ts @@ -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'], }); }); diff --git a/tests/api-resources/evm/transaction-raw.test.ts b/tests/api-resources/evm/transaction-raw.test.ts index 7bee50e..8157669 100644 --- a/tests/api-resources/evm/transaction-raw.test.ts +++ b/tests/api-resources/evm/transaction-raw.test.ts @@ -31,6 +31,7 @@ describe('resource transactionRaw', () => { chain: 'ethereum', data: '0x02f903f8018208488405f5e100850a9a03feb38302fa6a941111111254eeb25477b68fb85ed929f73a96058280b9038862e238bb00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab3e25398a24d6af080000000000000000000000000000000000000000000000000000000070db68f000000000000000000000000000000000000000000000000000000c0c2f020e4000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000006e2a43be0b1d33b726f0ca3b8de60b3482b8b050000000000000000000000000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000773594000000000000000000000000000000000000000000000000b4b34aede8e617e060000000a4000000a4000000a4000000a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000a4bf15fcd8000000000000000000000000303389f541ff2d620e42832f180a08e767b28e10000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000242cc2878d0064b6509600000000060000b78ed0dd769e3fbd8e2b526f6f75dcccc7e2af4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041a946fd8d5b9e873563a1411cbdf290b8310d8cdddc94da3aebf95b16a6dc0bf56d736ece63e3906527b7dcf08aa845d6a5cd4e0d99c9994f617b6faa378317f71c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e26b9977c001a0386a78e05b5ab3b4badbae843aaa6ed379b2f4353aa730c8f360141e72cba692a036ed37a00c6364685e58bc0cd9cdd1c140d6690c3c0d216c1b67e3d262e2f0f9', metadata: { domain: 'https://app.1inch.io' }, + block: '17718858', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/evm/transaction.test.ts b/tests/api-resources/evm/transaction.test.ts index 5a20f6b..328d8be 100644 --- a/tests/api-resources/evm/transaction.test.ts +++ b/tests/api-resources/evm/transaction.test.ts @@ -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' }, @@ -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'], }); }); diff --git a/tests/api-resources/evm/user-operation.test.ts b/tests/api-resources/evm/user-operation.test.ts index 68d187a..f4b72f2 100644 --- a/tests/api-resources/evm/user-operation.test.ts +++ b/tests/api-resources/evm/user-operation.test.ts @@ -47,6 +47,7 @@ describe('resource userOperation', () => { }, metadata: { domain: 'example.com' }, account_address: '0x77bA5AC3ca4864be26CA3112baDf07286CcC3324', + block: '0x5c6fd5', options: ['simulation', 'validation'], }); }); diff --git a/tests/api-resources/stellar/transaction.test.ts b/tests/api-resources/stellar/transaction.test.ts index 3ab943a..dc5575e 100644 --- a/tests/api-resources/stellar/transaction.test.ts +++ b/tests/api-resources/stellar/transaction.test.ts @@ -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(); @@ -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'], }); diff --git a/tests/api-resources/token.test.ts b/tests/api-resources/token.test.ts index 4616f8e..dae26ef 100644 --- a/tests/api-resources/token.test.ts +++ b/tests/api-resources/token.test.ts @@ -27,7 +27,7 @@ describe('resource token', () => { const response = await blockaid.token.scan({ address: '0x66587563e933bbf3974b89156b47bb82b921eb35', chain: 'ethereum', - metadata: { domain: 'string' }, + metadata: { domain: 'domain' }, }); }); });