@bloque/sdk-accounts 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,32 @@
1
1
  import { BaseClient } from '@bloque/sdk-core';
2
- import type { CreateVirtualAccountParams, UpdateVirtualMetadataParams, VirtualAccount } from './types';
2
+ import type { CreateAccountOptions } from '../types';
3
+ import type { CreateVirtualAccountParams, ListVirtualAccountsParams, ListVirtualAccountsResult, UpdateVirtualMetadataParams, VirtualAccount } from './types';
3
4
  export declare class VirtualClient extends BaseClient {
5
+ /**
6
+ * List virtual accounts
7
+ *
8
+ * Retrieves a list of virtual accounts, optionally filtered by holder URN or specific account URN.
9
+ *
10
+ * @param params - List parameters (optional)
11
+ * @returns Promise resolving to list of virtual accounts
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // List all virtual accounts for the authenticated holder
16
+ * const result = await bloque.accounts.virtual.list();
17
+ *
18
+ * // List virtual accounts for a specific holder
19
+ * const result = await bloque.accounts.virtual.list({
20
+ * holderUrn: 'did:bloque:bloque-root:nestor'
21
+ * });
22
+ *
23
+ * // Get a specific virtual account
24
+ * const result = await bloque.accounts.virtual.list({
25
+ * urn: 'did:bloque:account:virtual:275d10a2-0854-4081-9d61-ea506e917335'
26
+ * });
27
+ * ```
28
+ */
29
+ list(params?: ListVirtualAccountsParams): Promise<ListVirtualAccountsResult>;
4
30
  /**
5
31
  * Create a new virtual account
6
32
  *
@@ -8,17 +34,29 @@ export declare class VirtualClient extends BaseClient {
8
34
  * They're useful for development and testing purposes.
9
35
  *
10
36
  * @param params - Virtual account creation parameters
37
+ * @param options - Creation options (optional)
11
38
  * @returns Promise resolving to the created virtual account
12
39
  *
13
40
  * @example
14
41
  * ```typescript
42
+ * // Create without waiting
15
43
  * const account = await bloque.accounts.virtual.create({
16
44
  * firstName: 'John',
17
45
  * lastName: 'Doe'
18
46
  * });
47
+ *
48
+ * // Create and wait for active status
49
+ * const account = await bloque.accounts.virtual.create({
50
+ * firstName: 'John',
51
+ * lastName: 'Doe'
52
+ * }, { waitLedger: true });
19
53
  * ```
20
54
  */
21
- create(params: CreateVirtualAccountParams): Promise<VirtualAccount>;
55
+ create(params: CreateVirtualAccountParams, options?: CreateAccountOptions): Promise<VirtualAccount>;
56
+ /**
57
+ * Private method to poll account status until it becomes active
58
+ */
59
+ private _waitForActiveStatus;
22
60
  /**
23
61
  * Update virtual account metadata
24
62
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloque/sdk-accounts",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "bloque",
@@ -36,6 +36,6 @@
36
36
  "node": ">=22"
37
37
  },
38
38
  "dependencies": {
39
- "@bloque/sdk-core": "0.0.24"
39
+ "@bloque/sdk-core": "0.0.26"
40
40
  }
41
41
  }