@inversealtruism/csd-client 0.1.11 → 0.1.12

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.
package/dist/index.cjs CHANGED
@@ -133,8 +133,11 @@ var CsdClient = class {
133
133
  tx(id) {
134
134
  return this.get(`/tx/${id}`);
135
135
  }
136
- utxos(addr) {
137
- return this.get(`/utxos/${addr}`);
136
+ // Default available=true: excludes immature/locked coinbase UTXOs so callers don't build txs spending
137
+ // un-spendable outputs (the node would silently reject them) — audit TXB-1-SDK. Pass {available:false}
138
+ // for the full set (e.g. balance display that wants to show locked coinbases).
139
+ utxos(addr, opts = {}) {
140
+ return this.get(`/utxos/${addr}${opts.available === false ? "" : "?available=true"}`);
138
141
  }
139
142
  proposal(id) {
140
143
  return this.get(`/proposal/${id}`);
package/dist/index.d.cts CHANGED
@@ -143,7 +143,9 @@ declare class CsdClient {
143
143
  blockByHeight(h: number): Promise<RpcBlock>;
144
144
  blockByHash(hash: string): Promise<RpcBlock>;
145
145
  tx(id: string): Promise<RpcTxInfo>;
146
- utxos(addr: string): Promise<RpcUtxos>;
146
+ utxos(addr: string, opts?: {
147
+ available?: boolean;
148
+ }): Promise<RpcUtxos>;
147
149
  proposal(id: string): Promise<RpcProposal>;
148
150
  proposals(domain: string, limit?: number): Promise<RpcProposal[]>;
149
151
  topDomain(domain: string, epoch?: number): Promise<unknown>;
package/dist/index.d.ts CHANGED
@@ -143,7 +143,9 @@ declare class CsdClient {
143
143
  blockByHeight(h: number): Promise<RpcBlock>;
144
144
  blockByHash(hash: string): Promise<RpcBlock>;
145
145
  tx(id: string): Promise<RpcTxInfo>;
146
- utxos(addr: string): Promise<RpcUtxos>;
146
+ utxos(addr: string, opts?: {
147
+ available?: boolean;
148
+ }): Promise<RpcUtxos>;
147
149
  proposal(id: string): Promise<RpcProposal>;
148
150
  proposals(domain: string, limit?: number): Promise<RpcProposal[]>;
149
151
  topDomain(domain: string, epoch?: number): Promise<unknown>;
package/dist/index.js CHANGED
@@ -106,8 +106,11 @@ var CsdClient = class {
106
106
  tx(id) {
107
107
  return this.get(`/tx/${id}`);
108
108
  }
109
- utxos(addr) {
110
- return this.get(`/utxos/${addr}`);
109
+ // Default available=true: excludes immature/locked coinbase UTXOs so callers don't build txs spending
110
+ // un-spendable outputs (the node would silently reject them) — audit TXB-1-SDK. Pass {available:false}
111
+ // for the full set (e.g. balance display that wants to show locked coinbases).
112
+ utxos(addr, opts = {}) {
113
+ return this.get(`/utxos/${addr}${opts.available === false ? "" : "?available=true"}`);
111
114
  }
112
115
  proposal(id) {
113
116
  return this.get(`/proposal/${id}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inversealtruism/csd-client",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Typed HTTP RPC client for a Compute Substrate node (or the Cairn proxy / a discovered gateway) — tip/block/tx/utxos/proposals/top/domains/mempool/submit/templates.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -19,12 +19,12 @@
19
19
  "README.md"
20
20
  ],
21
21
  "dependencies": {
22
- "@inversealtruism/csd-codec": "0.1.11"
22
+ "@inversealtruism/csd-codec": "0.1.12"
23
23
  },
24
24
  "license": "MIT",
25
25
  "sideEffects": false,
26
26
  "devDependencies": {
27
- "@inversealtruism/csd-vectors": "0.1.11"
27
+ "@inversealtruism/csd-vectors": "0.1.12"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"