@1sat/wallet-toolbox 0.0.72 → 0.0.74

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.
@@ -36,15 +36,5 @@ export type GetExchangeRateInput = Record<string, never>;
36
36
  * Get current BSV/USD exchange rate.
37
37
  */
38
38
  export declare const getExchangeRate: Skill<GetExchangeRateInput, number>;
39
- /** Input for getChainInfo skill (no required params) */
40
- export type GetChainInfoInput = Record<string, never>;
41
- /** Output for getChainInfo skill */
42
- export interface ChainInfo {
43
- blocks: number;
44
- }
45
- /**
46
- * Get chain info from WhatsOnChain.
47
- */
48
- export declare const getChainInfo: Skill<GetChainInfoInput, ChainInfo | null>;
49
39
  /** All balance skills for registry */
50
- export declare const balanceSkills: (Skill<GetBalanceInput, Balance> | Skill<GetPaymentUtxosInput, PaymentUtxo[]> | Skill<GetExchangeRateInput, number> | Skill<GetChainInfoInput, ChainInfo | null>)[];
40
+ export declare const balanceSkills: (Skill<GetBalanceInput, Balance> | Skill<GetPaymentUtxosInput, PaymentUtxo[]> | Skill<GetExchangeRateInput, number>)[];
@@ -103,35 +103,6 @@ export const getExchangeRate = {
103
103
  return fetchExchangeRate(ctx.chain, ctx.wocApiKey);
104
104
  },
105
105
  };
106
- /**
107
- * Get chain info from WhatsOnChain.
108
- */
109
- export const getChainInfo = {
110
- meta: {
111
- name: "getChainInfo",
112
- description: "Get current chain info (block height) from WhatsOnChain",
113
- category: "balance",
114
- inputSchema: {
115
- type: "object",
116
- properties: {},
117
- },
118
- },
119
- async execute(ctx) {
120
- const baseUrl = ctx.chain === "main" ? WOC_MAINNET_URL : WOC_TESTNET_URL;
121
- const headers = {};
122
- if (ctx.wocApiKey)
123
- headers["woc-api-key"] = ctx.wocApiKey;
124
- try {
125
- const response = await fetch(`${baseUrl}/chain/info`, { headers });
126
- if (!response.ok)
127
- return null;
128
- return await response.json();
129
- }
130
- catch {
131
- return null;
132
- }
133
- },
134
- };
135
106
  // ============================================================================
136
107
  // Module exports
137
108
  // ============================================================================
@@ -140,5 +111,4 @@ export const balanceSkills = [
140
111
  getBalance,
141
112
  getPaymentUtxos,
142
113
  getExchangeRate,
143
- getChainInfo,
144
114
  ];
@@ -4,7 +4,7 @@
4
4
  * Skills for time-locking BSV.
5
5
  */
6
6
  import { Hash, PublicKey, Script, Transaction, TransactionSignature, Utils, } from "@bsv/sdk";
7
- import { LOCK_BASKET, LOCK_PREFIX, LOCK_SUFFIX, MIN_UNLOCK_SATS, WOC_MAINNET_URL, WOC_TESTNET_URL, } from "../constants";
7
+ import { LOCK_BASKET, LOCK_PREFIX, LOCK_SUFFIX, MIN_UNLOCK_SATS, } from "../constants";
8
8
  // ============================================================================
9
9
  // Constants
10
10
  // ============================================================================
@@ -21,21 +21,6 @@ function buildLockScript(address, until) {
21
21
  .writeNumber(until)
22
22
  .writeScript(Script.fromHex(LOCK_SUFFIX));
23
23
  }
24
- async function getChainInfoInternal(chain, wocApiKey) {
25
- const baseUrl = chain === "main" ? WOC_MAINNET_URL : WOC_TESTNET_URL;
26
- const headers = {};
27
- if (wocApiKey)
28
- headers["woc-api-key"] = wocApiKey;
29
- try {
30
- const response = await fetch(`${baseUrl}/chain/info`, { headers });
31
- if (!response.ok)
32
- return null;
33
- return await response.json();
34
- }
35
- catch {
36
- return null;
37
- }
38
- }
39
24
  /**
40
25
  * Get lock data summary.
41
26
  */
@@ -51,8 +36,9 @@ export const getLockData = {
51
36
  },
52
37
  async execute(ctx) {
53
38
  const lockData = { totalLocked: 0, unlockable: 0, nextUnlock: 0 };
54
- const chainInfo = await getChainInfoInternal(ctx.chain, ctx.wocApiKey);
55
- const currentHeight = chainInfo?.blocks || 0;
39
+ if (!ctx.services)
40
+ return lockData;
41
+ const currentHeight = await ctx.services.chaintracks.currentHeight();
56
42
  const result = await ctx.wallet.listOutputs({
57
43
  basket: LOCK_BASKET,
58
44
  includeTags: true,
@@ -178,11 +164,9 @@ export const unlockBsv = {
178
164
  },
179
165
  async execute(ctx) {
180
166
  try {
181
- const chainInfo = await getChainInfoInternal(ctx.chain, ctx.wocApiKey);
182
- const currentHeight = chainInfo?.blocks || 0;
183
- if (currentHeight === 0) {
184
- return { error: "could-not-get-block-height" };
185
- }
167
+ if (!ctx.services)
168
+ return { error: "services-required" };
169
+ const currentHeight = await ctx.services.chaintracks.currentHeight();
186
170
  const result = await ctx.wallet.listOutputs({
187
171
  basket: LOCK_BASKET,
188
172
  includeTags: true,
@@ -1,7 +1,7 @@
1
- import type { sdk } from "@bopen-io/wallet-toolbox-mobile/out/src/index.client.js";
2
- import type { TableSettings } from "@bopen-io/wallet-toolbox-mobile/out/src/storage/schema/tables/TableSettings.js";
3
- import type { TableSyncState } from "@bopen-io/wallet-toolbox-mobile/out/src/storage/schema/tables/TableSyncState.js";
4
- import type { TableUser } from "@bopen-io/wallet-toolbox-mobile/out/src/storage/schema/tables/TableUser.js";
1
+ import type { sdk } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js";
2
+ import type { TableSettings } from "@bsv/wallet-toolbox-mobile/out/src/storage/schema/tables/TableSettings.js";
3
+ import type { TableSyncState } from "@bsv/wallet-toolbox-mobile/out/src/storage/schema/tables/TableSyncState.js";
4
+ import type { TableUser } from "@bsv/wallet-toolbox-mobile/out/src/storage/schema/tables/TableUser.js";
5
5
  import { Zip, ZipDeflate } from "fflate";
6
6
  type AuthId = sdk.AuthId;
7
7
  type ProcessSyncChunkResult = sdk.ProcessSyncChunkResult;
@@ -1,5 +1,5 @@
1
- import type { sdk } from "@bopen-io/wallet-toolbox-mobile/out/src/index.client.js";
2
- import type { TableSettings } from "@bopen-io/wallet-toolbox-mobile/out/src/storage/schema/tables/TableSettings.js";
1
+ import type { sdk } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js";
2
+ import type { TableSettings } from "@bsv/wallet-toolbox-mobile/out/src/storage/schema/tables/TableSettings.js";
3
3
  import type { Unzipped } from "fflate";
4
4
  import type { BackupManifest } from "./types";
5
5
  type RequestSyncChunkArgs = sdk.RequestSyncChunkArgs;
@@ -1,4 +1,4 @@
1
- import type { sdk } from "@bopen-io/wallet-toolbox-mobile/out/src/index.client.js";
1
+ import type { sdk } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js";
2
2
  type Chain = sdk.Chain;
3
3
  /**
4
4
  * Manifest stored in the backup ZIP file describing the backup contents.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "./api";
2
2
  export { OneSatServices, type SyncOutput } from "./services/OneSatServices";
3
- export type { IndexedOutput, OrdfsMetadata, OrdfsContentOptions, OrdfsContentResponse, OrdfsResponseHeaders, Capability, } from "./services/types";
3
+ export type { IndexedOutput, OrdfsMetadata, OrdfsContentOptions, OrdfsContentResponse, OrdfsResponseHeaders, Capability, TokenDetailResponse, TokenStatus, Bsv21TokenData, Bsv21OutputData, Bsv21TransactionData, } from "./services/types";
4
4
  export * from "./services/client";
5
5
  export { ReadOnlySigner } from "./signers/ReadOnlySigner";
6
6
  export * from "./indexers";
@@ -56,9 +56,9 @@ export class Bsv21Indexer extends Indexer {
56
56
  if (!isDeploy) {
57
57
  try {
58
58
  const details = await this.services.bsv21.getTokenDetails(tokenId);
59
- bsv21.sym = details.sym;
60
- bsv21.icon = resolveIcon(details.icon, tokenId);
61
- bsv21.dec = details.dec;
59
+ bsv21.sym = details.token.sym;
60
+ bsv21.icon = resolveIcon(details.token.icon, tokenId);
61
+ bsv21.dec = Number(details.token.dec) || 0;
62
62
  }
63
63
  catch (e) {
64
64
  // Token not found on server - could be unconfirmed or invalid
@@ -8,7 +8,7 @@ export interface Bsv21TokenData {
8
8
  op: string;
9
9
  amt: string;
10
10
  sym?: string;
11
- dec?: number;
11
+ dec?: string;
12
12
  icon?: string;
13
13
  address?: string;
14
14
  }
@@ -16,15 +16,13 @@ export interface Bsv21TokenData {
16
16
  * BSV21 output data from overlay API
17
17
  */
18
18
  export interface Bsv21OutputData {
19
- txid: string;
19
+ txid?: string;
20
20
  vout: number;
21
21
  data: {
22
22
  bsv21: Bsv21TokenData;
23
23
  };
24
- script: string;
25
- satoshis: number;
26
- spend: string | null;
27
- score: number;
24
+ spend?: string | null;
25
+ score?: number;
28
26
  }
29
27
  /**
30
28
  * BSV21 transaction data from overlay API
@@ -34,6 +32,7 @@ export interface Bsv21TransactionData {
34
32
  inputs: Bsv21OutputData[];
35
33
  outputs: Bsv21OutputData[];
36
34
  beef?: string;
35
+ block_height?: number;
37
36
  }
38
37
  /**
39
38
  * IndexData contains the parsed data and tags from an indexer
@@ -1,5 +1,5 @@
1
1
  import { Beef, Transaction } from "@bsv/sdk";
2
- import type { TableOutput, sdk as toolboxSdk } from "@bopen-io/wallet-toolbox";
2
+ import type { TableOutput, sdk as toolboxSdk } from "@bsv/wallet-toolbox";
3
3
  type Chain = toolboxSdk.Chain;
4
4
  type BlockHeader = toolboxSdk.BlockHeader;
5
5
  type GetMerklePathResult = toolboxSdk.GetMerklePathResult;
@@ -1,36 +1,45 @@
1
- import type { Bsv21TokenDetails, Bsv21TransactionData, ClientOptions, IndexedOutput } from "../types";
1
+ import type { Bsv21TransactionData, ClientOptions, IndexedOutput, TokenDetailResponse } from "../types";
2
2
  import { BaseClient } from "./BaseClient";
3
3
  /**
4
4
  * Client for /1sat/bsv21/* routes.
5
5
  * Provides BSV21 token queries.
6
6
  *
7
7
  * Routes:
8
- * - GET /:tokenId - Get token details
9
- * - GET /:tokenId/blk/:height - Get token data at block height
10
- * - GET /:tokenId/tx/:txid - Get token data for transaction
8
+ * - POST /lookup - Bulk lookup token details with funding status
9
+ * - GET /:tokenId - Get token details with funding status
10
+ * - GET /:tokenId/tx/:txid - Get token transaction data
11
11
  * - GET /:tokenId/:lockType/:address/balance - Get token balance
12
12
  * - GET /:tokenId/:lockType/:address/unspent - Get unspent token UTXOs
13
13
  * - GET /:tokenId/:lockType/:address/history - Get token transaction history
14
+ * - POST /:tokenId/:lockType/balance - Multi-address token balance
15
+ * - POST /:tokenId/:lockType/unspent - Multi-address unspent token UTXOs
16
+ * - POST /:tokenId/:lockType/history - Multi-address token transaction history
14
17
  */
15
18
  export declare class Bsv21Client extends BaseClient {
16
19
  private cache;
17
20
  constructor(baseUrl: string, options?: ClientOptions);
18
21
  /**
19
- * Get token details (deploy data).
20
- * Results are cached since token details are immutable.
22
+ * Bulk lookup token details with funding status.
23
+ * Returns details and active status for multiple tokens in one request.
24
+ * @param tokenIds - Array of token IDs (max 100)
21
25
  */
22
- getTokenDetails(tokenId: string): Promise<Bsv21TokenDetails>;
26
+ lookupTokens(tokenIds: string[]): Promise<TokenDetailResponse[]>;
27
+ /**
28
+ * Get token details with funding status.
29
+ * Results are cached since token deploy data is immutable.
30
+ */
31
+ getTokenDetails(tokenId: string): Promise<TokenDetailResponse>;
23
32
  /**
24
33
  * Get token transaction data for a specific txid
25
34
  */
26
35
  getTokenByTxid(tokenId: string, txid: string): Promise<Bsv21TransactionData>;
27
36
  /**
28
37
  * Get token balance for an address
29
- * @param tokenId - Token ID (outpoint of deploy tx)
30
- * @param lockType - Lock type (e.g., 'p2pkh', 'ordlock')
31
- * @param address - Address to check
32
38
  */
33
- getBalance(tokenId: string, lockType: string, address: string): Promise<bigint>;
39
+ getBalance(tokenId: string, lockType: string, address: string): Promise<{
40
+ balance: number;
41
+ utxoCount: number;
42
+ }>;
34
43
  /**
35
44
  * Get unspent token UTXOs for an address
36
45
  */
@@ -39,6 +48,24 @@ export declare class Bsv21Client extends BaseClient {
39
48
  * Get token transaction history for an address
40
49
  */
41
50
  getHistory(tokenId: string, lockType: string, address: string): Promise<IndexedOutput[]>;
51
+ /**
52
+ * Get token balance for multiple addresses
53
+ * @param addresses - Array of addresses (max 100)
54
+ */
55
+ getBalanceMulti(tokenId: string, lockType: string, addresses: string[]): Promise<{
56
+ balance: number;
57
+ utxoCount: number;
58
+ }>;
59
+ /**
60
+ * Get unspent token UTXOs for multiple addresses
61
+ * @param addresses - Array of addresses (max 100)
62
+ */
63
+ getUnspentMulti(tokenId: string, lockType: string, addresses: string[]): Promise<IndexedOutput[]>;
64
+ /**
65
+ * Get token transaction history for multiple addresses
66
+ * @param addresses - Array of addresses (max 100)
67
+ */
68
+ getHistoryMulti(tokenId: string, lockType: string, addresses: string[]): Promise<IndexedOutput[]>;
42
69
  /**
43
70
  * Clear the token details cache
44
71
  */
@@ -4,12 +4,15 @@ import { BaseClient } from "./BaseClient";
4
4
  * Provides BSV21 token queries.
5
5
  *
6
6
  * Routes:
7
- * - GET /:tokenId - Get token details
8
- * - GET /:tokenId/blk/:height - Get token data at block height
9
- * - GET /:tokenId/tx/:txid - Get token data for transaction
7
+ * - POST /lookup - Bulk lookup token details with funding status
8
+ * - GET /:tokenId - Get token details with funding status
9
+ * - GET /:tokenId/tx/:txid - Get token transaction data
10
10
  * - GET /:tokenId/:lockType/:address/balance - Get token balance
11
11
  * - GET /:tokenId/:lockType/:address/unspent - Get unspent token UTXOs
12
12
  * - GET /:tokenId/:lockType/:address/history - Get token transaction history
13
+ * - POST /:tokenId/:lockType/balance - Multi-address token balance
14
+ * - POST /:tokenId/:lockType/unspent - Multi-address unspent token UTXOs
15
+ * - POST /:tokenId/:lockType/history - Multi-address token transaction history
13
16
  */
14
17
  export class Bsv21Client extends BaseClient {
15
18
  cache = new Map();
@@ -17,8 +20,20 @@ export class Bsv21Client extends BaseClient {
17
20
  super(`${baseUrl}/1sat/bsv21`, options);
18
21
  }
19
22
  /**
20
- * Get token details (deploy data).
21
- * Results are cached since token details are immutable.
23
+ * Bulk lookup token details with funding status.
24
+ * Returns details and active status for multiple tokens in one request.
25
+ * @param tokenIds - Array of token IDs (max 100)
26
+ */
27
+ async lookupTokens(tokenIds) {
28
+ return this.request("/lookup", {
29
+ method: "POST",
30
+ headers: { "Content-Type": "application/json" },
31
+ body: JSON.stringify(tokenIds),
32
+ });
33
+ }
34
+ /**
35
+ * Get token details with funding status.
36
+ * Results are cached since token deploy data is immutable.
22
37
  */
23
38
  async getTokenDetails(tokenId) {
24
39
  const cached = this.cache.get(tokenId);
@@ -36,13 +51,9 @@ export class Bsv21Client extends BaseClient {
36
51
  }
37
52
  /**
38
53
  * Get token balance for an address
39
- * @param tokenId - Token ID (outpoint of deploy tx)
40
- * @param lockType - Lock type (e.g., 'p2pkh', 'ordlock')
41
- * @param address - Address to check
42
54
  */
43
55
  async getBalance(tokenId, lockType, address) {
44
- const data = await this.request(`/${tokenId}/${lockType}/${address}/balance`);
45
- return BigInt(data.balance);
56
+ return this.request(`/${tokenId}/${lockType}/${address}/balance`);
46
57
  }
47
58
  /**
48
59
  * Get unspent token UTXOs for an address
@@ -56,6 +67,39 @@ export class Bsv21Client extends BaseClient {
56
67
  async getHistory(tokenId, lockType, address) {
57
68
  return this.request(`/${tokenId}/${lockType}/${address}/history`);
58
69
  }
70
+ /**
71
+ * Get token balance for multiple addresses
72
+ * @param addresses - Array of addresses (max 100)
73
+ */
74
+ async getBalanceMulti(tokenId, lockType, addresses) {
75
+ return this.request(`/${tokenId}/${lockType}/balance`, {
76
+ method: "POST",
77
+ headers: { "Content-Type": "application/json" },
78
+ body: JSON.stringify(addresses),
79
+ });
80
+ }
81
+ /**
82
+ * Get unspent token UTXOs for multiple addresses
83
+ * @param addresses - Array of addresses (max 100)
84
+ */
85
+ async getUnspentMulti(tokenId, lockType, addresses) {
86
+ return this.request(`/${tokenId}/${lockType}/unspent`, {
87
+ method: "POST",
88
+ headers: { "Content-Type": "application/json" },
89
+ body: JSON.stringify(addresses),
90
+ });
91
+ }
92
+ /**
93
+ * Get token transaction history for multiple addresses
94
+ * @param addresses - Array of addresses (max 100)
95
+ */
96
+ async getHistoryMulti(tokenId, lockType, addresses) {
97
+ return this.request(`/${tokenId}/${lockType}/history`, {
98
+ method: "POST",
99
+ headers: { "Content-Type": "application/json" },
100
+ body: JSON.stringify(addresses),
101
+ });
102
+ }
59
103
  /**
60
104
  * Clear the token details cache
61
105
  */
@@ -1,10 +1,10 @@
1
1
  import type { ChainTracker } from "@bsv/sdk";
2
- import type { BaseBlockHeader, BlockHeader, Chain } from "@bopen-io/wallet-toolbox";
2
+ import type { BaseBlockHeader, BlockHeader, Chain } from "@bsv/wallet-toolbox";
3
3
  import type { ClientOptions } from "../types";
4
4
  import { BaseClient } from "./BaseClient";
5
5
  /**
6
6
  * Client for /1sat/chaintracks/* routes.
7
- * Implements ChaintracksClientApi interface from @bopen-io/wallet-toolbox.
7
+ * Implements ChaintracksClientApi interface from @bsv/wallet-toolbox.
8
8
  *
9
9
  * Routes:
10
10
  * - GET /tip - Get chain tip
@@ -54,7 +54,7 @@ function toHex(data) {
54
54
  }
55
55
  /**
56
56
  * Client for /1sat/chaintracks/* routes.
57
- * Implements ChaintracksClientApi interface from @bopen-io/wallet-toolbox.
57
+ * Implements ChaintracksClientApi interface from @bsv/wallet-toolbox.
58
58
  *
59
59
  * Routes:
60
60
  * - GET /tip - Get chain tip
@@ -11,12 +11,6 @@ export interface TopicManagerInfo {
11
11
  export interface LookupServiceInfo {
12
12
  [key: string]: unknown;
13
13
  }
14
- /** BSV-21 token info extracted from topic managers */
15
- export interface Bsv21TokenInfo {
16
- tokenId: string;
17
- symbol?: string;
18
- icon?: string;
19
- }
20
14
  /**
21
15
  * Client for overlay service routes.
22
16
  * Handles topic manager queries and overlay lookups.
@@ -25,23 +19,12 @@ export declare class OverlayClient extends BaseClient {
25
19
  constructor(baseUrl: string, options?: ClientOptions);
26
20
  /**
27
21
  * List all registered topic managers.
28
- * BSV-21 tokens have topic managers named `tm_{tokenId}`.
29
22
  */
30
23
  listTopicManagers(): Promise<Record<string, TopicManagerInfo>>;
31
24
  /**
32
25
  * List all registered lookup service providers.
33
26
  */
34
27
  listLookupServiceProviders(): Promise<Record<string, LookupServiceInfo>>;
35
- /**
36
- * Get list of active BSV-21 token IDs from topic managers.
37
- * Extracts tokenIds from topics matching the `tm_{tokenId}` pattern.
38
- */
39
- getActiveBsv21TokenIds(): Promise<string[]>;
40
- /**
41
- * Get active BSV-21 tokens with metadata from topic managers.
42
- * Returns tokenId, symbol (from name), and icon for each active token.
43
- */
44
- getActiveBsv21Tokens(): Promise<Bsv21TokenInfo[]>;
45
28
  /**
46
29
  * Submit a transaction to the overlay service for indexing.
47
30
  * @param beef - BEEF data as Uint8Array or number[]
@@ -9,7 +9,6 @@ export class OverlayClient extends BaseClient {
9
9
  }
10
10
  /**
11
11
  * List all registered topic managers.
12
- * BSV-21 tokens have topic managers named `tm_{tokenId}`.
13
12
  */
14
13
  async listTopicManagers() {
15
14
  return this.request("/1sat/overlay/listTopicManagers");
@@ -20,38 +19,6 @@ export class OverlayClient extends BaseClient {
20
19
  async listLookupServiceProviders() {
21
20
  return this.request("/1sat/overlay/listLookupServiceProviders");
22
21
  }
23
- /**
24
- * Get list of active BSV-21 token IDs from topic managers.
25
- * Extracts tokenIds from topics matching the `tm_{tokenId}` pattern.
26
- */
27
- async getActiveBsv21TokenIds() {
28
- const topicManagers = await this.listTopicManagers();
29
- const tokenIds = [];
30
- for (const topic of Object.keys(topicManagers)) {
31
- if (topic.startsWith("tm_")) {
32
- tokenIds.push(topic.slice(3));
33
- }
34
- }
35
- return tokenIds;
36
- }
37
- /**
38
- * Get active BSV-21 tokens with metadata from topic managers.
39
- * Returns tokenId, symbol (from name), and icon for each active token.
40
- */
41
- async getActiveBsv21Tokens() {
42
- const topicManagers = await this.listTopicManagers();
43
- const tokens = [];
44
- for (const [topic, info] of Object.entries(topicManagers)) {
45
- if (topic.startsWith("tm_")) {
46
- tokens.push({
47
- tokenId: topic.slice(3),
48
- symbol: info.name,
49
- icon: info.icon,
50
- });
51
- }
52
- }
53
- return tokens;
54
- }
55
22
  /**
56
23
  * Submit a transaction to the overlay service for indexing.
57
24
  * @param beef - BEEF data as Uint8Array or number[]
@@ -195,19 +195,6 @@ export interface OrdfsContentResponse {
195
195
  data: Uint8Array;
196
196
  headers: OrdfsResponseHeaders;
197
197
  }
198
- /**
199
- * BSV21 token details (deploy data)
200
- */
201
- export interface Bsv21TokenDetails {
202
- id: string;
203
- txid: string;
204
- vout: number;
205
- op: string;
206
- amt: string;
207
- sym?: string;
208
- dec: number;
209
- icon?: string;
210
- }
211
198
  /**
212
199
  * BSV21 token data structure from overlay API
213
200
  */
@@ -216,23 +203,44 @@ export interface Bsv21TokenData {
216
203
  op: string;
217
204
  amt: string;
218
205
  sym?: string;
219
- dec?: number;
206
+ dec?: string;
220
207
  icon?: string;
221
208
  address?: string;
222
209
  }
210
+ /**
211
+ * BSV21 token detail response from GET /bsv21/:tokenId and POST /bsv21/lookup
212
+ */
213
+ export interface TokenDetailResponse {
214
+ tokenId: string;
215
+ token: Bsv21TokenData;
216
+ status: TokenStatus;
217
+ }
218
+ /**
219
+ * BSV21 token funding/activity status
220
+ */
221
+ export interface TokenStatus {
222
+ token_id: string;
223
+ is_active: boolean;
224
+ balance: number;
225
+ credits: number;
226
+ debits: number;
227
+ output_count: number;
228
+ fee_per_output: number;
229
+ fee_address: string;
230
+ is_whitelisted: boolean;
231
+ is_blacklisted: boolean;
232
+ }
223
233
  /**
224
234
  * BSV21 output data from overlay API
225
235
  */
226
236
  export interface Bsv21OutputData {
227
- txid: string;
237
+ txid?: string;
228
238
  vout: number;
229
239
  data: {
230
240
  bsv21: Bsv21TokenData;
231
241
  };
232
- script: string;
233
- satoshis: number;
234
- spend: string | null;
235
- score: number;
242
+ spend?: string | null;
243
+ score?: number;
236
244
  }
237
245
  /**
238
246
  * BSV21 transaction data from overlay API
@@ -242,6 +250,7 @@ export interface Bsv21TransactionData {
242
250
  inputs: Bsv21OutputData[];
243
251
  outputs: Bsv21OutputData[];
244
252
  beef?: string;
253
+ block_height?: number;
245
254
  }
246
255
  /**
247
256
  * Event from SSE subscription
@@ -5,7 +5,7 @@
5
5
  * (browser extension) and 1sat-website (React app).
6
6
  */
7
7
  import { PrivateKey } from "@bsv/sdk";
8
- import { Monitor, type PermissionsManagerConfig, StorageClient, Wallet, WalletPermissionsManager, WalletStorageManager } from "@bopen-io/wallet-toolbox-mobile/out/src/index.client.js";
8
+ import { Monitor, type PermissionsManagerConfig, StorageClient, Wallet, WalletPermissionsManager, WalletStorageManager } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js";
9
9
  import { OneSatServices } from "../services/OneSatServices";
10
10
  import { type FullSyncResult, type FullSyncStage } from "./fullSync";
11
11
  type Chain = "main" | "test";
@@ -5,7 +5,7 @@
5
5
  * (browser extension) and 1sat-website (React app).
6
6
  */
7
7
  import { KeyDeriver, PrivateKey } from "@bsv/sdk";
8
- import { Monitor, Services, StorageClient, StorageIdb, StorageProvider, Wallet, WalletPermissionsManager, WalletStorageManager, } from "@bopen-io/wallet-toolbox-mobile/out/src/index.client.js";
8
+ import { Monitor, Services, StorageClient, StorageIdb, StorageProvider, Wallet, WalletPermissionsManager, WalletStorageManager, } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js";
9
9
  import { OneSatServices } from "../services/OneSatServices";
10
10
  import { fullSync } from "./fullSync";
11
11
  // Default database name for IndexedDB storage
@@ -4,8 +4,8 @@
4
4
  * Performs a complete resync: push local → reset sync state → full pull from server.
5
5
  * This is a deliberate user action (not automatic) for recovering from sync issues.
6
6
  */
7
- import type { WalletStorageManager } from "@bopen-io/wallet-toolbox-mobile/out/src/index.client.js";
8
- import type { sdk as mobileToolboxSdk } from "@bopen-io/wallet-toolbox-mobile/out/src/index.client.js";
7
+ import type { WalletStorageManager } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js";
8
+ import type { sdk as mobileToolboxSdk } from "@bsv/wallet-toolbox-mobile/out/src/index.client.js";
9
9
  type WalletStorageProvider = mobileToolboxSdk.WalletStorageProvider;
10
10
  export type FullSyncStage = "pushing" | "resetting" | "pulling" | "complete";
11
11
  export interface FullSyncOptions {
@@ -4,8 +4,8 @@
4
4
  * Performs a complete resync: push local → reset sync state → full pull from server.
5
5
  * This is a deliberate user action (not automatic) for recovering from sync issues.
6
6
  */
7
- import { createSyncMap } from "@bopen-io/wallet-toolbox-mobile/out/src/storage/schema/entities/EntityBase.js";
8
- import { EntitySyncState } from "@bopen-io/wallet-toolbox-mobile/out/src/storage/schema/entities/EntitySyncState.js";
7
+ import { createSyncMap } from "@bsv/wallet-toolbox-mobile/out/src/storage/schema/entities/EntityBase.js";
8
+ import { EntitySyncState } from "@bsv/wallet-toolbox-mobile/out/src/storage/schema/entities/EntitySyncState.js";
9
9
  /**
10
10
  * Perform a full sync with the remote backup server.
11
11
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1sat/wallet-toolbox",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "description": "BSV wallet library extending @bsv/wallet-toolbox with 1Sat Ordinals protocol support",
5
5
  "author": "1Sat Team",
6
6
  "license": "MIT",
@@ -45,17 +45,17 @@
45
45
  "fflate": "^0.8.2"
46
46
  },
47
47
  "peerDependencies": {
48
- "@bopen-io/wallet-toolbox-mobile": "1.7.24-idb-fix.1"
48
+ "@bsv/wallet-toolbox-mobile": "npm:@bopen-io/wallet-toolbox-mobile@1.7.24-idb-fix.1"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
- "@bopen-io/wallet-toolbox-mobile": {
51
+ "@bsv/wallet-toolbox-mobile": {
52
52
  "optional": true
53
53
  }
54
54
  },
55
55
  "devDependencies": {
56
56
  "@biomejs/biome": "^1.9.4",
57
- "@bopen-io/wallet-toolbox": "1.7.24-idb-fix.1",
58
- "@bopen-io/wallet-toolbox-mobile": "1.7.24-idb-fix.1",
57
+ "@bsv/wallet-toolbox": "npm:@bopen-io/wallet-toolbox@1.7.24-idb-fix.1",
58
+ "@bsv/wallet-toolbox-mobile": "npm:@bopen-io/wallet-toolbox-mobile@1.7.24-idb-fix.1",
59
59
  "@types/bun": "^1.3.4",
60
60
  "@types/chrome": "^0.1.32",
61
61
  "typescript": "^5.9.3"