From c83fcf2b1e90e75d09700a4c452f4a85225af11f Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Tue, 7 Jul 2026 13:43:51 -0400 Subject: [PATCH] feat(admin): add account_info endpoint (DX-6093) Adds `account_info` to the admin client, wrapping `GET /v0/account/info`. Returns the account id, name, creation timestamp, billing version, and current subscription (plan name, status, interval). Exposed across all four language layers following the existing `list_chains` no-param GET pattern: - Core: new `account.rs` with `AccountInfo`, `AccountSubscription`, `AccountInfoResponse` types plus wiremock happy-path and API-error tests. - Python (`account_info`), Node (`accountInfo`), Ruby (`account_info`) bindings, surface files, RBS signature, and per-language READMEs. - Example usage added to all four admin examples. --- crates/core/README.md | 16 +++ crates/core/examples/admin.rs | 17 +++ crates/core/src/admin/account.rs | 51 +++++++ crates/core/src/admin/mod.rs | 76 +++++++++++ crates/node/src/lib.rs | 7 + crates/python/src/lib.rs | 15 ++ crates/ruby/src/lib.rs | 9 ++ npm/README.md | 16 +++ npm/examples/admin.ts | 7 + npm/index.d.ts | 37 +++++ npm/sdk.d.ts | 4 + python/README.md | 16 +++ python/examples/admin.py | 6 + python/quicknode_sdk/__init__.py | 6 + python/quicknode_sdk/__init__.pyi | 6 + python/quicknode_sdk/_core/__init__.pyi | 128 +++++++++++++++++- python/quicknode_sdk/init_manual_override.pyi | 6 + ruby/README.md | 16 +++ ruby/examples/admin.rb | 7 + ruby/sig/quicknode_sdk.rbs | 1 + 20 files changed, 446 insertions(+), 1 deletion(-) create mode 100644 crates/core/src/admin/account.rs diff --git a/crates/core/README.md b/crates/core/README.md index 761fd28..21b0d96 100644 --- a/crates/core/README.md +++ b/crates/core/README.md @@ -34,6 +34,7 @@ This is one of four language bindings published from the same Rust core. See the - [Endpoint URLs](#endpoint-urls) - [Metrics](#metrics) - [Chains](#chains) + - [Account](#account) - [Billing](#billing) - [Bulk Operations](#bulk-operations) - [Account Tags](#account-tags) @@ -971,6 +972,21 @@ Lists the blockchains supported by Quicknode along with their networks. let resp = qn.admin.list_chains().await?; ``` +#### Account + +##### `account_info` / `accountInfo` + +Returns details about the account, including its id, name, creation timestamp, billing version, and current subscription. + +**Parameters**: none. + +**Returns**: `AccountInfoResponse` with `data: AccountInfo` (including a nested `subscription: AccountSubscription`). + +```rust +// Rust +let resp = qn.admin.account_info().await?; +``` + #### Billing ##### `list_invoices` / `listInvoices` diff --git a/crates/core/examples/admin.rs b/crates/core/examples/admin.rs index b1d9d4d..f0e504f 100644 --- a/crates/core/examples/admin.rs +++ b/crates/core/examples/admin.rs @@ -6,6 +6,23 @@ async fn main() { let config = SdkFullConfig::from_env().expect("Config from env failed"); let qn = QuicknodeSdk::new(&config).expect("sdk failed to initialize"); + match qn.admin.account_info().await { + Ok(resp) => { + if let Some(a) = &resp.data { + let plan = a + .subscription + .as_ref() + .and_then(|s| s.plan_name.clone()) + .unwrap_or_else(|| "".to_string()); + println!( + "account {} | {} | billing={:?} | plan={}", + a.id, a.name, a.billing_version, plan + ); + } + } + Err(e) => eprintln!("account_info error: {e}"), + } + let params = GetEndpointsRequest::builder() .limit(20) .sort_by("created_at".to_string()) diff --git a/crates/core/src/admin/account.rs b/crates/core/src/admin/account.rs new file mode 100644 index 0000000..d43a6ea --- /dev/null +++ b/crates/core/src/admin/account.rs @@ -0,0 +1,51 @@ +#[cfg(feature = "node")] +use napi_derive::napi; +#[cfg(feature = "python")] +use pyo3::pyclass; +#[cfg(feature = "python")] +use pyo3_stub_gen::derive::gen_stub_pyclass; +use serde::{Deserialize, Serialize}; + +/// The account's current subscription. +#[cfg_attr(feature = "python", gen_stub_pyclass)] +#[cfg_attr(feature = "python", pyclass(get_all, set_all))] +#[cfg_attr(feature = "node", napi(object))] +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AccountSubscription { + /// Plan name (e.g. `Accelerate`). + pub plan_name: Option, + /// Subscription status (e.g. `active`). + pub status: Option, + /// Billing interval (e.g. `monthly`). + pub interval: Option, +} + +/// Details about a Quicknode account. +#[cfg_attr(feature = "python", gen_stub_pyclass)] +#[cfg_attr(feature = "python", pyclass(get_all, set_all))] +#[cfg_attr(feature = "node", napi(object))] +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AccountInfo { + /// Numeric account id. + pub id: i64, + /// Account name. + pub name: String, + /// ISO 8601 timestamp of when the account was created. + pub created_at: String, + /// Billing version (e.g. `v6`). + pub billing_version: Option, + /// The account's current subscription, when present. + pub subscription: Option, +} + +/// Response from `account_info`. +#[cfg_attr(feature = "python", gen_stub_pyclass)] +#[cfg_attr(feature = "python", pyclass(get_all, set_all))] +#[cfg_attr(feature = "node", napi(object))] +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AccountInfoResponse { + /// Account details, when the request succeeded. + pub data: Option, + /// Error message when the request did not succeed. + pub error: Option, +} diff --git a/crates/core/src/admin/mod.rs b/crates/core/src/admin/mod.rs index e69754f..2071fb0 100644 --- a/crates/core/src/admin/mod.rs +++ b/crates/core/src/admin/mod.rs @@ -1,3 +1,4 @@ +pub mod account; pub mod billing; pub mod bulk; pub mod chains; @@ -11,6 +12,7 @@ pub mod tags; pub mod teams; pub mod usage; +pub use account::{AccountInfo, AccountInfoResponse, AccountSubscription}; pub use billing::{ Invoice, InvoiceLine, ListInvoicesData, ListInvoicesResponse, ListPaymentsData, ListPaymentsResponse, Payment, @@ -1561,6 +1563,27 @@ impl AdminApiClient { serde_json::from_str(&body).map_err(|source| SdkError::Decode { source, body }) } + /// Returns details about the account, including its id, name, creation + /// timestamp, billing version, and current subscription. + pub async fn account_info(&self) -> Result { + let url = self.config.admin().base_url.join("account/info")?; + let resp = self + .config + .http_client() + .get(url) + .send() + .await + .map_err(SdkError::Http)?; + + let status = resp.status(); + let body = resp.text().await.map_err(SdkError::Http)?; + + if !status.is_success() { + return Err(SdkError::Api { status, body }); + } + serde_json::from_str(&body).map_err(|source| SdkError::Decode { source, body }) + } + /// Returns the account's invoices, including id, status, billing reason, /// amounts due and paid, line items with descriptions and billing periods, /// and creation timestamps. @@ -2984,6 +3007,59 @@ mod tests { assert_eq!(resp.data[0].networks[0].chain_id, Some(1)); } + #[tokio::test] + async fn account_info_success() { + let server = MockServer::start().await; + + Mock::given(method("GET")) + .and(path("/account/info")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "data": { + "id": 794770, + "name": "MCP Test Account", + "created_at": "2026-03-27T20:22:32.536Z", + "billing_version": "v6", + "subscription": { + "plan_name": "Accelerate", + "status": "active", + "interval": "monthly" + } + }, + "error": null + }))) + .mount(&server) + .await; + + let sdk = make_sdk(format!("{}/", server.uri())); + let resp = sdk.admin.account_info().await.unwrap(); + let data = resp.data.expect("expected account data"); + assert_eq!(data.id, 794770); + assert_eq!(data.name, "MCP Test Account"); + assert_eq!(data.billing_version.as_deref(), Some("v6")); + let subscription = data.subscription.expect("expected subscription"); + assert_eq!(subscription.plan_name.as_deref(), Some("Accelerate")); + assert_eq!(subscription.status.as_deref(), Some("active")); + assert_eq!(subscription.interval.as_deref(), Some("monthly")); + } + + #[tokio::test] + async fn account_info_api_error() { + let server = MockServer::start().await; + + Mock::given(method("GET")) + .and(path("/account/info")) + .respond_with(ResponseTemplate::new(401).set_body_string("Unauthorized")) + .mount(&server) + .await; + + let sdk = make_sdk(format!("{}/", server.uri())); + let err = sdk.admin.account_info().await.unwrap_err(); + let SdkError::Api { status, .. } = err else { + unreachable!("expected SdkError::Api, got {err:?}"); + }; + assert_eq!(status.as_u16(), 401); + } + #[tokio::test] async fn list_invoices_success() { let server = MockServer::start().await; diff --git a/crates/node/src/lib.rs b/crates/node/src/lib.rs index 302c063..e03cfcd 100644 --- a/crates/node/src/lib.rs +++ b/crates/node/src/lib.rs @@ -715,6 +715,13 @@ impl AdminApiClient { self.inner.list_chains().await.map_err(errors::map_sdk_err) } + /// Returns details about the account, including its id, name, creation + /// timestamp, billing version, and current subscription. + #[napi] + pub async fn account_info(&self) -> Result { + self.inner.account_info().await.map_err(errors::map_sdk_err) + } + /// Returns the account's invoices, including id, status, billing reason, /// amounts due and paid, line items with descriptions and billing periods, /// and creation timestamps. diff --git a/crates/python/src/lib.rs b/crates/python/src/lib.rs index 850ebb3..74c6de6 100644 --- a/crates/python/src/lib.rs +++ b/crates/python/src/lib.rs @@ -1074,6 +1074,18 @@ impl AdminApiClient { }) } + /// Returns details about the account, including its id, name, creation + /// timestamp, billing version, and current subscription. + #[gen_stub(override_return_type( + type_repr = "typing.Coroutine[typing.Any, typing.Any, AccountInfoResponse]" + ))] + fn account_info<'py>(&self, py: Python<'py>) -> PyResult> { + let client = self.inner.clone(); + pyo3_async_runtimes::tokio::future_into_py(py, async move { + client.account_info().await.map_err(errors::map_sdk_err) + }) + } + /// Returns the account's invoices, including id, status, billing reason, /// amounts due and paid, line items with descriptions and billing periods, /// and creation timestamps. @@ -2501,6 +2513,9 @@ fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; + m.add_class::()?; + m.add_class::()?; + m.add_class::()?; m.add_class::()?; m.add_class::()?; m.add_class::()?; diff --git a/crates/ruby/src/lib.rs b/crates/ruby/src/lib.rs index 81ca483..132b8c8 100644 --- a/crates/ruby/src/lib.rs +++ b/crates/ruby/src/lib.rs @@ -910,6 +910,14 @@ impl AdminApiClient { .and_then(to_ruby) } + fn account_info(&self) -> Result { + let client = self.inner.clone(); + runtime() + .block_on(client.account_info()) + .map_err(map_err) + .and_then(to_ruby) + } + fn list_invoices(&self) -> Result { let client = self.inner.clone(); runtime() @@ -1987,6 +1995,7 @@ fn init(ruby: &Ruby) -> Result<(), Error> { method!(AdminApiClient::get_account_metrics, 1), )?; admin.define_method("list_chains", method!(AdminApiClient::list_chains, 0))?; + admin.define_method("account_info", method!(AdminApiClient::account_info, 0))?; admin.define_method("list_invoices", method!(AdminApiClient::list_invoices, 0))?; admin.define_method("list_payments", method!(AdminApiClient::list_payments, 0))?; admin.define_method("list_teams", method!(AdminApiClient::list_teams, 0))?; diff --git a/npm/README.md b/npm/README.md index e7463e8..99c9391 100644 --- a/npm/README.md +++ b/npm/README.md @@ -34,6 +34,7 @@ This is one of four language bindings published from the same Rust core. See the - [Endpoint URLs](#endpoint-urls) - [Metrics](#metrics) - [Chains](#chains) + - [Account](#account) - [Billing](#billing) - [Bulk Operations](#bulk-operations) - [Account Tags](#account-tags) @@ -932,6 +933,21 @@ Lists the blockchains supported by Quicknode along with their networks. const resp = await qn.admin.listChains(); ``` +#### Account + +##### `account_info` / `accountInfo` + +Returns details about the account, including its id, name, creation timestamp, billing version, and current subscription. + +**Parameters**: none. + +**Returns**: `AccountInfoResponse` with `data: AccountInfo` (including a nested `subscription: AccountSubscription`). + +```typescript +// Node.js +const resp = await qn.admin.accountInfo(); +``` + #### Billing ##### `list_invoices` / `listInvoices` diff --git a/npm/examples/admin.ts b/npm/examples/admin.ts index ed40e7e..e49838f 100644 --- a/npm/examples/admin.ts +++ b/npm/examples/admin.ts @@ -8,6 +8,13 @@ import { async function main() { const qn = QuicknodeSdk.fromEnv(); + const account = await qn.admin.accountInfo(); + if (account.data) { + const a = account.data; + const plan = a.subscription?.planName ?? ""; + console.log(`account ${a.id} | ${a.name} | billing=${a.billingVersion} | plan=${plan}`); + } + const response = await qn.admin.getEndpoints({ limit: 20, sortBy: "created_at", diff --git a/npm/index.d.ts b/npm/index.d.ts index 8e0c342..5de3b16 100644 --- a/npm/index.d.ts +++ b/npm/index.d.ts @@ -1,5 +1,37 @@ /* auto-generated by NAPI-RS */ /* eslint-disable */ +/** Details about a Quicknode account. */ +export interface AccountInfo { + /** Numeric account id. */ + id: number + /** Account name. */ + name: string + /** ISO 8601 timestamp of when the account was created. */ + createdAt: string + /** Billing version (e.g. `v6`). */ + billingVersion?: string + /** The account's current subscription, when present. */ + subscription?: AccountSubscription +} + +/** Response from `account_info`. */ +export interface AccountInfoResponse { + /** Account details, when the request succeeded. */ + data?: AccountInfo + /** Error message when the request did not succeed. */ + error?: string +} + +/** The account's current subscription. */ +export interface AccountSubscription { + /** Plan name (e.g. `Accelerate`). */ + planName?: string + /** Subscription status (e.g. `active`). */ + status?: string + /** Billing interval (e.g. `monthly`). */ + interval?: string +} + /** An account-level tag, shared across endpoints. */ export interface AccountTag { /** Tag identifier. */ @@ -2202,6 +2234,11 @@ export declare class AdminApiClient { * Each entry includes the chain slug and its network slugs and names. */ listChains(): Promise + /** + * Returns details about the account, including its id, name, creation + * timestamp, billing version, and current subscription. + */ + accountInfo(): Promise /** * Returns the account's invoices, including id, status, billing reason, * amounts due and paid, line items with descriptions and billing periods, diff --git a/npm/sdk.d.ts b/npm/sdk.d.ts index 4729e82..10a5097 100644 --- a/npm/sdk.d.ts +++ b/npm/sdk.d.ts @@ -134,6 +134,10 @@ export type { ChainNetwork, Chain, ListChainsResponse, + // account + AccountSubscription, + AccountInfo, + AccountInfoResponse, // metrics GetEndpointMetricsRequest, GetAccountMetricsRequest, diff --git a/python/README.md b/python/README.md index 6dc00cf..14da731 100644 --- a/python/README.md +++ b/python/README.md @@ -34,6 +34,7 @@ This is one of four language bindings published from the same Rust core. See the - [Endpoint URLs](#endpoint-urls) - [Metrics](#metrics) - [Chains](#chains) + - [Account](#account) - [Billing](#billing) - [Bulk Operations](#bulk-operations) - [Account Tags](#account-tags) @@ -933,6 +934,21 @@ Lists the blockchains supported by Quicknode along with their networks. resp = await qn.admin.list_chains() ``` +#### Account + +##### `account_info` / `accountInfo` + +Returns details about the account, including its id, name, creation timestamp, billing version, and current subscription. + +**Parameters**: none. + +**Returns**: `AccountInfoResponse` with `data: AccountInfo` (including a nested `subscription: AccountSubscription`). + +```python +# Python +resp = await qn.admin.account_info() +``` + #### Billing ##### `list_invoices` / `listInvoices` diff --git a/python/examples/admin.py b/python/examples/admin.py index 904c279..062defe 100644 --- a/python/examples/admin.py +++ b/python/examples/admin.py @@ -14,6 +14,12 @@ async def main(): qn = QuicknodeSdk.from_env() + account = await qn.admin.account_info() + if account.data is not None: + a = account.data + plan = a.subscription.plan_name if a.subscription is not None else "" + print(f"account {a.id} | {a.name} | billing={a.billing_version} | plan={plan}") + response = await qn.admin.get_endpoints( limit=20, sort_by="created_at", diff --git a/python/quicknode_sdk/__init__.py b/python/quicknode_sdk/__init__.py index 7c2fdd9..d7eb5f3 100644 --- a/python/quicknode_sdk/__init__.py +++ b/python/quicknode_sdk/__init__.py @@ -88,6 +88,9 @@ ChainNetwork, Chain, ListChainsResponse, + AccountSubscription, + AccountInfo, + AccountInfoResponse, InvoiceLine, Invoice, ListInvoicesData, @@ -295,6 +298,9 @@ "ChainNetwork", "Chain", "ListChainsResponse", + "AccountSubscription", + "AccountInfo", + "AccountInfoResponse", "InvoiceLine", "Invoice", "ListInvoicesData", diff --git a/python/quicknode_sdk/__init__.pyi b/python/quicknode_sdk/__init__.pyi index 95768c8..eec813d 100644 --- a/python/quicknode_sdk/__init__.pyi +++ b/python/quicknode_sdk/__init__.pyi @@ -90,6 +90,9 @@ from quicknode_sdk._core import ( ChainNetwork, Chain, ListChainsResponse, + AccountSubscription, + AccountInfo, + AccountInfoResponse, InvoiceLine, Invoice, ListInvoicesData, @@ -313,6 +316,9 @@ __all__ = [ "ChainNetwork", "Chain", "ListChainsResponse", + "AccountSubscription", + "AccountInfo", + "AccountInfoResponse", "InvoiceLine", "Invoice", "ListInvoicesData", diff --git a/python/quicknode_sdk/_core/__init__.pyi b/python/quicknode_sdk/_core/__init__.pyi index 0c7825f..a977268 100644 --- a/python/quicknode_sdk/_core/__init__.pyi +++ b/python/quicknode_sdk/_core/__init__.pyi @@ -4,6 +4,9 @@ import builtins import typing __all__ = [ + "AccountInfo", + "AccountInfoResponse", + "AccountSubscription", "AccountTag", "AddressBookConfig", "AdminApiClient", @@ -218,6 +221,124 @@ __all__ = [ "XrplWalletFilterTemplate", ] +@typing.final +class AccountInfo: + r""" + Details about a Quicknode account. + """ + @property + def id(self) -> builtins.int: + r""" + Numeric account id. + """ + @id.setter + def id(self, value: builtins.int) -> None: + r""" + Numeric account id. + """ + @property + def name(self) -> builtins.str: + r""" + Account name. + """ + @name.setter + def name(self, value: builtins.str) -> None: + r""" + Account name. + """ + @property + def created_at(self) -> builtins.str: + r""" + ISO 8601 timestamp of when the account was created. + """ + @created_at.setter + def created_at(self, value: builtins.str) -> None: + r""" + ISO 8601 timestamp of when the account was created. + """ + @property + def billing_version(self) -> typing.Optional[builtins.str]: + r""" + Billing version (e.g. `v6`). + """ + @billing_version.setter + def billing_version(self, value: typing.Optional[builtins.str]) -> None: + r""" + Billing version (e.g. `v6`). + """ + @property + def subscription(self) -> typing.Optional[AccountSubscription]: + r""" + The account's current subscription, when present. + """ + @subscription.setter + def subscription(self, value: typing.Optional[AccountSubscription]) -> None: + r""" + The account's current subscription, when present. + """ + +@typing.final +class AccountInfoResponse: + r""" + Response from `account_info`. + """ + @property + def data(self) -> typing.Optional[AccountInfo]: + r""" + Account details, when the request succeeded. + """ + @data.setter + def data(self, value: typing.Optional[AccountInfo]) -> None: + r""" + Account details, when the request succeeded. + """ + @property + def error(self) -> typing.Optional[builtins.str]: + r""" + Error message when the request did not succeed. + """ + @error.setter + def error(self, value: typing.Optional[builtins.str]) -> None: + r""" + Error message when the request did not succeed. + """ + +@typing.final +class AccountSubscription: + r""" + The account's current subscription. + """ + @property + def plan_name(self) -> typing.Optional[builtins.str]: + r""" + Plan name (e.g. `Accelerate`). + """ + @plan_name.setter + def plan_name(self, value: typing.Optional[builtins.str]) -> None: + r""" + Plan name (e.g. `Accelerate`). + """ + @property + def status(self) -> typing.Optional[builtins.str]: + r""" + Subscription status (e.g. `active`). + """ + @status.setter + def status(self, value: typing.Optional[builtins.str]) -> None: + r""" + Subscription status (e.g. `active`). + """ + @property + def interval(self) -> typing.Optional[builtins.str]: + r""" + Billing interval (e.g. `monthly`). + """ + @interval.setter + def interval(self, value: typing.Optional[builtins.str]) -> None: + r""" + Billing interval (e.g. `monthly`). + """ + @typing.final class AccountTag: r""" @@ -529,6 +650,11 @@ class AdminApiClient: Returns all chains supported by Quicknode along with their networks. Each entry includes the chain slug and its network slugs and names. """ + def account_info(self) -> typing.Coroutine[typing.Any, typing.Any, AccountInfoResponse]: + r""" + Returns details about the account, including its id, name, creation + timestamp, billing version, and current subscription. + """ def list_invoices(self) -> typing.Coroutine[typing.Any, typing.Any, ListInvoicesResponse]: r""" Returns the account's invoices, including id, status, billing reason, @@ -5639,7 +5765,7 @@ class SqlApiClient: def query(self, query: builtins.str, cluster_id: builtins.str) -> typing.Coroutine[typing.Any, typing.Any, QueryResponse]: r""" Executes a SQL query against the given cluster and returns the result - set. Only `SELECT` queries are permitted (enforced server-side). + set. """ def get_schema(self, cluster_id: builtins.str) -> typing.Coroutine[typing.Any, typing.Any, ChainSchema]: r""" diff --git a/python/quicknode_sdk/init_manual_override.pyi b/python/quicknode_sdk/init_manual_override.pyi index 95768c8..eec813d 100644 --- a/python/quicknode_sdk/init_manual_override.pyi +++ b/python/quicknode_sdk/init_manual_override.pyi @@ -90,6 +90,9 @@ from quicknode_sdk._core import ( ChainNetwork, Chain, ListChainsResponse, + AccountSubscription, + AccountInfo, + AccountInfoResponse, InvoiceLine, Invoice, ListInvoicesData, @@ -313,6 +316,9 @@ __all__ = [ "ChainNetwork", "Chain", "ListChainsResponse", + "AccountSubscription", + "AccountInfo", + "AccountInfoResponse", "InvoiceLine", "Invoice", "ListInvoicesData", diff --git a/ruby/README.md b/ruby/README.md index e5aec15..aced643 100644 --- a/ruby/README.md +++ b/ruby/README.md @@ -34,6 +34,7 @@ This is one of four language bindings published from the same Rust core. See the - [Endpoint URLs](#endpoint-urls) - [Metrics](#metrics) - [Chains](#chains) + - [Account](#account) - [Billing](#billing) - [Bulk Operations](#bulk-operations) - [Account Tags](#account-tags) @@ -928,6 +929,21 @@ Lists the blockchains supported by Quicknode along with their networks. resp = qn.admin.list_chains ``` +#### Account + +##### `account_info` / `accountInfo` + +Returns details about the account, including its id, name, creation timestamp, billing version, and current subscription. + +**Parameters**: none. + +**Returns**: `AccountInfoResponse` with `data: AccountInfo` (including a nested `subscription: AccountSubscription`). + +```ruby +# Ruby +resp = qn.admin.account_info +``` + #### Billing ##### `list_invoices` / `listInvoices` diff --git a/ruby/examples/admin.rb b/ruby/examples/admin.rb index deb807b..445d12d 100644 --- a/ruby/examples/admin.rb +++ b/ruby/examples/admin.rb @@ -2,6 +2,13 @@ qn = QuicknodeSdk::SDK.from_env +account = qn.admin.account_info +if account[:data] + a = account[:data] + plan = a.dig(:subscription, :plan_name) || "" + puts "account #{a[:id]} | #{a[:name]} | billing=#{a[:billing_version]} | plan=#{plan}" +end + response = qn.admin.get_endpoints( limit: 20, sort_by: "created_at", diff --git a/ruby/sig/quicknode_sdk.rbs b/ruby/sig/quicknode_sdk.rbs index f245cb1..747bac8 100644 --- a/ruby/sig/quicknode_sdk.rbs +++ b/ruby/sig/quicknode_sdk.rbs @@ -91,6 +91,7 @@ module QuicknodeSdk def get_endpoint_metrics: (id: String, period: String, metric: String) -> untyped def get_account_metrics: (period: String, metric: String, ?percentile: String) -> untyped def list_chains: () -> untyped + def account_info: () -> untyped def list_invoices: () -> untyped def list_payments: () -> untyped def list_teams: () -> untyped