From 7590291669d3720d69c42382c34e0b8dd6a0988c Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 28 Nov 2024 13:27:09 +0000 Subject: [PATCH 1/9] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7b9bd29c..0e686f17 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-fa5b82ce6b474291bffc46c40e81830c60e1f60d9ee8403f97d433050829d1e9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-33b6c76f7c2451dc6be7b198131a58579caaebdca32ddfa29cec960adc9cfd98.yml From a2c39b935e8a857213e410fcb386985f4aa14b64 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 07:00:53 +0000 Subject: [PATCH 2/9] feat(internal): make git install file structure match npm (#340) --- package.json | 2 +- scripts/utils/check-is-in-git-install.sh | 2 +- scripts/utils/git-swap.sh | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 scripts/utils/git-swap.sh diff --git a/package.json b/package.json index dccfa35b..2e570621 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "./scripts/build", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi", + "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi", "tsn": "ts-node -r tsconfig-paths/register", "lint": "./scripts/lint", "fix": "./scripts/format" diff --git a/scripts/utils/check-is-in-git-install.sh b/scripts/utils/check-is-in-git-install.sh index 36bcedc2..1354eb43 100755 --- a/scripts/utils/check-is-in-git-install.sh +++ b/scripts/utils/check-is-in-git-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check if you happen to call prepare for a repository that's already in node_modules. [ "$(basename "$(dirname "$PWD")")" = 'node_modules' ] || # The name of the containing directory that 'npm` uses, which looks like diff --git a/scripts/utils/git-swap.sh b/scripts/utils/git-swap.sh new file mode 100755 index 00000000..79d1888e --- /dev/null +++ b/scripts/utils/git-swap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -exuo pipefail +# the package is published to NPM from ./dist +# we want the final file structure for git installs to match the npm installs, so we + +# delete everything except ./dist and ./node_modules +find . -maxdepth 1 -mindepth 1 ! -name 'dist' ! -name 'node_modules' -exec rm -rf '{}' + + +# move everything from ./dist to . +mv dist/* . + +# delete the now-empty ./dist +rmdir dist From a75f1d135ab529c385eb46447ad0e26120936bc7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:12:31 +0000 Subject: [PATCH 3/9] feat(api): api update (#342) --- .stats.yml | 2 +- src/resources/evm/evm.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0e686f17..28fdfffc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-33b6c76f7c2451dc6be7b198131a58579caaebdca32ddfa29cec960adc9cfd98.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-5944633c44715ad59d5b7028d42b81a54ed92d2a1f8e9ebfa8a422816aebe312.yml diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index c9dcdcbd..c290271d 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -476,7 +476,8 @@ export type TransactionScanSupportedChain = | 'soneium-minato' | 'ronin' | 'apechain' - | 'zero-network'; + | 'zero-network' + | 'berachain'; export interface TransactionSimulation { /** From 1dd571a2098dbb63d0c571bb245e18c50c7735f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:45:50 +0000 Subject: [PATCH 4/9] feat(api): api update (#343) --- .stats.yml | 2 +- src/resources/evm/evm.ts | 3 +-- src/resources/token-bulk.ts | 8 +++++++- src/resources/token.ts | 8 +++++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 28fdfffc..2d920f85 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-5944633c44715ad59d5b7028d42b81a54ed92d2a1f8e9ebfa8a422816aebe312.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-b303750a215f2f05f585a13f15d46ec2e005865fa4a84f726b7c3f8072473547.yml diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index c290271d..12ff6aa0 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -361,8 +361,7 @@ export type TokenScanSupportedChain = | 'blast' | 'zksync' | 'scroll' - | 'degen' - | 'bitcoin'; + | 'degen'; export interface TransactionScanFeature { /** diff --git a/src/resources/token-bulk.ts b/src/resources/token-bulk.ts index 0b33b1ac..6e4e582d 100644 --- a/src/resources/token-bulk.ts +++ b/src/resources/token-bulk.ts @@ -432,7 +432,13 @@ export namespace TokenBulkScanResponse { | 'HIDDEN_OWNER' | 'TRANSFER_PAUSEABLE' | 'OWNERSHIP_RENOUNCED' - | 'PROXY_CONTRACT'; + | 'PROXY_CONTRACT' + | 'LIQUID_STAKE' + | 'REBASE_TOKEN' + | 'UNSELLABLE_TOKEN' + | 'CONCENTRATED_SUPPLY_DISTRIBUTION' + | 'INSUFFICIENT_LOCKED_LIQUIDITY' + | 'HONEYPOT'; /** * An enumeration. diff --git a/src/resources/token.ts b/src/resources/token.ts index f3de04c8..f700be92 100644 --- a/src/resources/token.ts +++ b/src/resources/token.ts @@ -439,7 +439,13 @@ export namespace TokenScanResponse { | 'HIDDEN_OWNER' | 'TRANSFER_PAUSEABLE' | 'OWNERSHIP_RENOUNCED' - | 'PROXY_CONTRACT'; + | 'PROXY_CONTRACT' + | 'LIQUID_STAKE' + | 'REBASE_TOKEN' + | 'UNSELLABLE_TOKEN' + | 'CONCENTRATED_SUPPLY_DISTRIBUTION' + | 'INSUFFICIENT_LOCKED_LIQUIDITY' + | 'HONEYPOT'; /** * An enumeration. From 59f00691aeb50b76f9f270222d365cda6b43bb10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:09:45 +0000 Subject: [PATCH 5/9] feat(api): api update (#344) --- .stats.yml | 2 +- src/resources/evm/evm.ts | 3 ++- src/resources/token-bulk.ts | 8 +------- src/resources/token.ts | 8 +------- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2d920f85..d1ec3bda 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-b303750a215f2f05f585a13f15d46ec2e005865fa4a84f726b7c3f8072473547.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-75f569a5b007228fce0d69bd657c86e205777a4b26c604c4b645c245869e76af.yml diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index 12ff6aa0..c290271d 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -361,7 +361,8 @@ export type TokenScanSupportedChain = | 'blast' | 'zksync' | 'scroll' - | 'degen'; + | 'degen' + | 'bitcoin'; export interface TransactionScanFeature { /** diff --git a/src/resources/token-bulk.ts b/src/resources/token-bulk.ts index 6e4e582d..0b33b1ac 100644 --- a/src/resources/token-bulk.ts +++ b/src/resources/token-bulk.ts @@ -432,13 +432,7 @@ export namespace TokenBulkScanResponse { | 'HIDDEN_OWNER' | 'TRANSFER_PAUSEABLE' | 'OWNERSHIP_RENOUNCED' - | 'PROXY_CONTRACT' - | 'LIQUID_STAKE' - | 'REBASE_TOKEN' - | 'UNSELLABLE_TOKEN' - | 'CONCENTRATED_SUPPLY_DISTRIBUTION' - | 'INSUFFICIENT_LOCKED_LIQUIDITY' - | 'HONEYPOT'; + | 'PROXY_CONTRACT'; /** * An enumeration. diff --git a/src/resources/token.ts b/src/resources/token.ts index f700be92..f3de04c8 100644 --- a/src/resources/token.ts +++ b/src/resources/token.ts @@ -439,13 +439,7 @@ export namespace TokenScanResponse { | 'HIDDEN_OWNER' | 'TRANSFER_PAUSEABLE' | 'OWNERSHIP_RENOUNCED' - | 'PROXY_CONTRACT' - | 'LIQUID_STAKE' - | 'REBASE_TOKEN' - | 'UNSELLABLE_TOKEN' - | 'CONCENTRATED_SUPPLY_DISTRIBUTION' - | 'INSUFFICIENT_LOCKED_LIQUIDITY' - | 'HONEYPOT'; + | 'PROXY_CONTRACT'; /** * An enumeration. From fd4108f11d02980fb1803c495c1d42f1e23e02c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:55:07 +0000 Subject: [PATCH 6/9] feat(api): api update (#345) --- .stats.yml | 2 +- src/resources/evm/evm.ts | 3 +-- src/resources/token-bulk.ts | 8 +++++++- src/resources/token.ts | 8 +++++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index d1ec3bda..9b3e3717 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-75f569a5b007228fce0d69bd657c86e205777a4b26c604c4b645c245869e76af.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-521a396e60660ae282d00a61d3f2a71a8e852f2bb95aa97a415139c0dfc74d14.yml diff --git a/src/resources/evm/evm.ts b/src/resources/evm/evm.ts index c290271d..12ff6aa0 100644 --- a/src/resources/evm/evm.ts +++ b/src/resources/evm/evm.ts @@ -361,8 +361,7 @@ export type TokenScanSupportedChain = | 'blast' | 'zksync' | 'scroll' - | 'degen' - | 'bitcoin'; + | 'degen'; export interface TransactionScanFeature { /** diff --git a/src/resources/token-bulk.ts b/src/resources/token-bulk.ts index 0b33b1ac..6e4e582d 100644 --- a/src/resources/token-bulk.ts +++ b/src/resources/token-bulk.ts @@ -432,7 +432,13 @@ export namespace TokenBulkScanResponse { | 'HIDDEN_OWNER' | 'TRANSFER_PAUSEABLE' | 'OWNERSHIP_RENOUNCED' - | 'PROXY_CONTRACT'; + | 'PROXY_CONTRACT' + | 'LIQUID_STAKE' + | 'REBASE_TOKEN' + | 'UNSELLABLE_TOKEN' + | 'CONCENTRATED_SUPPLY_DISTRIBUTION' + | 'INSUFFICIENT_LOCKED_LIQUIDITY' + | 'HONEYPOT'; /** * An enumeration. diff --git a/src/resources/token.ts b/src/resources/token.ts index f3de04c8..f700be92 100644 --- a/src/resources/token.ts +++ b/src/resources/token.ts @@ -439,7 +439,13 @@ export namespace TokenScanResponse { | 'HIDDEN_OWNER' | 'TRANSFER_PAUSEABLE' | 'OWNERSHIP_RENOUNCED' - | 'PROXY_CONTRACT'; + | 'PROXY_CONTRACT' + | 'LIQUID_STAKE' + | 'REBASE_TOKEN' + | 'UNSELLABLE_TOKEN' + | 'CONCENTRATED_SUPPLY_DISTRIBUTION' + | 'INSUFFICIENT_LOCKED_LIQUIDITY' + | 'HONEYPOT'; /** * An enumeration. From b6846a47a794c3947a8bdbc4d8e8af7375085639 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:02:13 +0000 Subject: [PATCH 7/9] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9b3e3717..057bcb15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-521a396e60660ae282d00a61d3f2a71a8e852f2bb95aa97a415139c0dfc74d14.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-c50e79bc49d14456290a8db01cefddcd8c5f0f8bc17ae19163784c1e23929708.yml From 390817cc297dbc1555aeae431182dc4dc8fbb3b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:02:55 +0000 Subject: [PATCH 8/9] feat(api): api update (#346) --- .stats.yml | 4 +- api.md | 4 - src/resources/bitcoin/bitcoin.ts | 416 ++++++++++++++++-- src/resources/bitcoin/index.ts | 2 +- src/resources/bitcoin/transaction.ts | 63 +-- .../api-resources/bitcoin/transaction.test.ts | 37 -- 6 files changed, 377 insertions(+), 149 deletions(-) delete mode 100644 tests/api-resources/bitcoin/transaction.test.ts diff --git a/.stats.yml b/.stats.yml index 057bcb15..42a04e63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-c50e79bc49d14456290a8db01cefddcd8c5f0f8bc17ae19163784c1e23929708.yml +configured_endpoints: 19 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/new%2Fblockaid-57ba1e6bf68e557293babd701bbf3d1b558909f3ad8f0766c3485498e3ab4a2e.yml diff --git a/api.md b/api.md index 79620554..ec33988b 100644 --- a/api.md +++ b/api.md @@ -162,10 +162,6 @@ Types: ## Transaction -Methods: - -- client.bitcoin.transaction.scan({ ...params }) -> BitcoinTransactionScanResponse - # Starknet Types: diff --git a/src/resources/bitcoin/bitcoin.ts b/src/resources/bitcoin/bitcoin.ts index ae9da466..7fc9dc4a 100644 --- a/src/resources/bitcoin/bitcoin.ts +++ b/src/resources/bitcoin/bitcoin.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../resource'; import * as TransactionAPI from './transaction'; -import { Transaction, TransactionScanParams } from './transaction'; +import { Transaction } from './transaction'; export class Bitcoin extends APIResource { transaction: TransactionAPI.Transaction = new TransactionAPI.Transaction(this._client); @@ -73,9 +73,13 @@ export interface BitcoinTransactionScanResponse { export namespace BitcoinTransactionScanResponse { export interface BitcoinSimulationResult { - status: 'Success'; + /** + * Summary of the actions and asset transfers that were made by the requested + * account address + */ + account_summary: BitcoinSimulationResult.AccountSummary; - account_summary?: null; + status: 'Success'; /** * Details of addresses involved in the transaction @@ -90,18 +94,354 @@ export namespace BitcoinTransactionScanResponse { string, Array< | BitcoinSimulationResult.BitcoinNativeAssetDiff - | BitcoinSimulationResult.BitcoinOrdinalAssetDiff + | BitcoinSimulationResult.BitcoinInscriptionAssetDiff | BitcoinSimulationResult.BitcoinRunesAssetDiff > >; } export namespace BitcoinSimulationResult { + /** + * Summary of the actions and asset transfers that were made by the requested + * account address + */ + export interface AccountSummary { + /** + * Total USD diff for the requested account address + */ + total_usd_diff: AccountSummary.TotalUsdDiff; + + /** + * Assets diffs of the requested account address + */ + account_assets_diffs?: Array< + | AccountSummary.BitcoinNativeAssetDiff + | AccountSummary.BitcoinInscriptionAssetDiff + | AccountSummary.BitcoinRunesAssetDiff + >; + } + + export namespace AccountSummary { + /** + * Total USD diff for the requested account address + */ + export interface TotalUsdDiff { + /** + * Total incoming USD transfers + */ + in: number; + + /** + * Total outgoing USD transfers + */ + out: number; + + /** + * Total USD transfers + */ + total?: number; + } + + export interface BitcoinNativeAssetDiff { + asset: BitcoinNativeAssetDiff.Asset; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: BitcoinNativeAssetDiff.In | null; + + /** + * Details of the outgoing transfer + */ + out?: BitcoinNativeAssetDiff.Out | null; + } + + export namespace BitcoinNativeAssetDiff { + export interface Asset { + /** + * URL of the asset's logo + */ + logo_url: string | null; + + /** + * Decimals of the asset + */ + decimals?: 8; + + /** + * Name of the asset + */ + name?: 'Bitcoin'; + + /** + * Symbol of the asset + */ + symbol?: 'BTC'; + + /** + * Type of the asset (`NATIVE`) + */ + type?: 'NATIVE'; + } + + /** + * Details of the incoming transfer + */ + export interface In { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + + /** + * Details of the outgoing transfer + */ + export interface Out { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + } + + export interface BitcoinInscriptionAssetDiff { + asset: BitcoinInscriptionAssetDiff.Asset; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: BitcoinInscriptionAssetDiff.In | null; + + /** + * Details of the outgoing transfer + */ + out?: BitcoinInscriptionAssetDiff.Out | null; + } + + export namespace BitcoinInscriptionAssetDiff { + export interface Asset { + /** + * The Inscription ID + */ + id: string; + + /** + * Inscription's display name + */ + name: string; + + /** + * The Inscription sat + */ + sat: number; + + /** + * URL of the asset's logo + */ + logo_url?: string | null; + + /** + * Type of the asset (`INSCRIPTION`) + */ + type?: 'INSCRIPTION'; + } + + /** + * Details of the incoming transfer + */ + export interface In { + /** + * Inscription ID of the transfer + */ + inscription_id: string; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + + /** + * Details of the outgoing transfer + */ + export interface Out { + /** + * Inscription ID of the transfer + */ + inscription_id: string; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + } + + export interface BitcoinRunesAssetDiff { + asset: BitcoinRunesAssetDiff.Asset; + + /** + * The type of the assets in this diff + */ + asset_type: string; + + /** + * Details of the incoming transfer + */ + in?: BitcoinRunesAssetDiff.In | null; + + /** + * Details of the outgoing transfer + */ + out?: BitcoinRunesAssetDiff.Out | null; + } + + export namespace BitcoinRunesAssetDiff { + export interface Asset { + /** + * The Rune ID + */ + id: string; + + /** + * Decimals of the asset + */ + decimals: number; + + /** + * The Rune name + */ + name: string; + + /** + * The Rune spaced name + */ + spaced_name: string; + + /** + * The Rune's symbol + */ + symbol: string; + + /** + * URL of the asset's logo + */ + logo_url?: string | null; + + /** + * Type of the asset (`RUNE`) + */ + type?: 'RUNE'; + } + + /** + * Details of the incoming transfer + */ + export interface In { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + + /** + * Details of the outgoing transfer + */ + export interface Out { + /** + * Raw value of the transfer + */ + raw_value: number; + + /** + * USD price of the asset + */ + usd_price: string; + + /** + * Value of the transfer + */ + value: string; + + /** + * Summarized description of the transfer + */ + summary?: string | null; + } + } + } + export interface AddressDetail { /** * Encoded public key of the account */ - account_address: unknown; + account_address: string; /** * Description of the account @@ -163,7 +503,7 @@ export namespace BitcoinTransactionScanResponse { /** * Raw value of the transfer */ - raw_value: string; + raw_value: number; /** * USD price of the asset @@ -188,7 +528,7 @@ export namespace BitcoinTransactionScanResponse { /** * Raw value of the transfer */ - raw_value: string; + raw_value: number; /** * USD price of the asset @@ -207,8 +547,8 @@ export namespace BitcoinTransactionScanResponse { } } - export interface BitcoinOrdinalAssetDiff { - asset: BitcoinOrdinalAssetDiff.Asset; + export interface BitcoinInscriptionAssetDiff { + asset: BitcoinInscriptionAssetDiff.Asset; /** * The type of the assets in this diff @@ -218,30 +558,40 @@ export namespace BitcoinTransactionScanResponse { /** * Details of the incoming transfer */ - in?: BitcoinOrdinalAssetDiff.In | null; + in?: BitcoinInscriptionAssetDiff.In | null; /** * Details of the outgoing transfer */ - out?: BitcoinOrdinalAssetDiff.Out | null; + out?: BitcoinInscriptionAssetDiff.Out | null; } - export namespace BitcoinOrdinalAssetDiff { + export namespace BitcoinInscriptionAssetDiff { export interface Asset { /** - * token's name + * The Inscription ID + */ + id: string; + + /** + * Inscription's display name */ name: string; + /** + * The Inscription sat + */ + sat: number; + /** * URL of the asset's logo */ logo_url?: string | null; /** - * Type of the asset (`ORDINAL`) + * Type of the asset (`INSCRIPTION`) */ - type?: 'ORDINAL'; + type?: 'INSCRIPTION'; } /** @@ -249,25 +599,15 @@ export namespace BitcoinTransactionScanResponse { */ export interface In { /** - * Id of the ordinal - */ - id: string; - - /** - * Raw value of the transfer + * Inscription ID of the transfer */ - raw_value: string; + inscription_id: string; /** * USD price of the asset */ usd_price: string; - /** - * Value of the transfer - */ - value: string; - /** * Summarized description of the transfer */ @@ -279,25 +619,15 @@ export namespace BitcoinTransactionScanResponse { */ export interface Out { /** - * Id of the ordinal - */ - id: string; - - /** - * Raw value of the transfer + * Inscription ID of the transfer */ - raw_value: string; + inscription_id: string; /** * USD price of the asset */ usd_price: string; - /** - * Value of the transfer - */ - value: string; - /** * Summarized description of the transfer */ @@ -347,7 +677,7 @@ export namespace BitcoinTransactionScanResponse { spaced_name: string; /** - * token's symbol + * The Rune's symbol */ symbol: string; @@ -369,7 +699,7 @@ export namespace BitcoinTransactionScanResponse { /** * Raw value of the transfer */ - raw_value: string; + raw_value: number; /** * USD price of the asset @@ -394,7 +724,7 @@ export namespace BitcoinTransactionScanResponse { /** * Raw value of the transfer */ - raw_value: string; + raw_value: number; /** * USD price of the asset @@ -490,5 +820,5 @@ export declare namespace Bitcoin { type BitcoinTransactionScanResponse as BitcoinTransactionScanResponse, }; - export { Transaction as Transaction, type TransactionScanParams as TransactionScanParams }; + export { Transaction as Transaction }; } diff --git a/src/resources/bitcoin/index.ts b/src/resources/bitcoin/index.ts index e7c7a49b..d7d1abb6 100644 --- a/src/resources/bitcoin/index.ts +++ b/src/resources/bitcoin/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bitcoin, type BitcoinTransactionScanRequest, type BitcoinTransactionScanResponse } from './bitcoin'; -export { Transaction, type TransactionScanParams } from './transaction'; +export { Transaction } from './transaction'; diff --git a/src/resources/bitcoin/transaction.ts b/src/resources/bitcoin/transaction.ts index 970a0096..e26967e8 100644 --- a/src/resources/bitcoin/transaction.ts +++ b/src/resources/bitcoin/transaction.ts @@ -1,66 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as Core from '../../core'; -import * as BitcoinAPI from './bitcoin'; -export class Transaction extends APIResource { - /** - * Scan Transaction - */ - scan( - body: TransactionScanParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - return this._client.post('/v0/bitcoin/transaction/scan', { body, ...options }); - } -} - -export interface TransactionScanParams { - account_address: string; - - chain: 'bitcoin'; - - /** - * Metadata - */ - metadata: - | TransactionScanParams.BitcoinWalletRequestMetadata - | TransactionScanParams.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 TransactionScanParams { - 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 declare namespace Transaction { - export { type TransactionScanParams as TransactionScanParams }; -} +export class Transaction extends APIResource {} diff --git a/tests/api-resources/bitcoin/transaction.test.ts b/tests/api-resources/bitcoin/transaction.test.ts deleted file mode 100644 index 16e50953..00000000 --- a/tests/api-resources/bitcoin/transaction.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Blockaid from '@blockaid/client'; -import { Response } from 'node-fetch'; - -const client = new Blockaid({ - apiKey: 'My API Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource transaction', () => { - test('scan: only required params', async () => { - const responsePromise = client.bitcoin.transaction.scan({ - account_address: 'account_address', - chain: 'bitcoin', - metadata: { type: 'wallet', url: 'url' }, - transaction: 'transaction', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('scan: required and optional params', async () => { - const response = await client.bitcoin.transaction.scan({ - account_address: 'account_address', - chain: 'bitcoin', - metadata: { type: 'wallet', url: 'url' }, - transaction: 'transaction', - options: ['validation'], - }); - }); -}); From 5e5295edfe87f129fd537456e79e5673be6a5921 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:03:14 +0000 Subject: [PATCH 9/9] release: 0.32.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8e3d9554..47582228 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.31.0" + ".": "0.32.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bdeda89..91b3b516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.32.0 (2024-12-10) + +Full Changelog: [v0.31.0...v0.32.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.31.0...v0.32.0) + +### Features + +* **api:** api update ([#342](https://github.com/blockaid-official/blockaid-client-node/issues/342)) ([a75f1d1](https://github.com/blockaid-official/blockaid-client-node/commit/a75f1d135ab529c385eb46447ad0e26120936bc7)) +* **api:** api update ([#343](https://github.com/blockaid-official/blockaid-client-node/issues/343)) ([1dd571a](https://github.com/blockaid-official/blockaid-client-node/commit/1dd571a2098dbb63d0c571bb245e18c50c7735f0)) +* **api:** api update ([#344](https://github.com/blockaid-official/blockaid-client-node/issues/344)) ([59f0069](https://github.com/blockaid-official/blockaid-client-node/commit/59f00691aeb50b76f9f270222d365cda6b43bb10)) +* **api:** api update ([#345](https://github.com/blockaid-official/blockaid-client-node/issues/345)) ([fd4108f](https://github.com/blockaid-official/blockaid-client-node/commit/fd4108f11d02980fb1803c495c1d42f1e23e02c1)) +* **api:** api update ([#346](https://github.com/blockaid-official/blockaid-client-node/issues/346)) ([390817c](https://github.com/blockaid-official/blockaid-client-node/commit/390817cc297dbc1555aeae431182dc4dc8fbb3b7)) +* **internal:** make git install file structure match npm ([#340](https://github.com/blockaid-official/blockaid-client-node/issues/340)) ([a2c39b9](https://github.com/blockaid-official/blockaid-client-node/commit/a2c39b935e8a857213e410fcb386985f4aa14b64)) + ## 0.31.0 (2024-11-24) Full Changelog: [v0.30.0...v0.31.0](https://github.com/blockaid-official/blockaid-client-node/compare/v0.30.0...v0.31.0) diff --git a/package.json b/package.json index 2e570621..b9969e54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blockaid/client", - "version": "0.31.0", + "version": "0.32.0", "description": "The official TypeScript library for the Blockaid API", "author": "Blockaid ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index b6314c28..b413d151 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.31.0'; // x-release-please-version +export const VERSION = '0.32.0'; // x-release-please-version