@toon-protocol/client 0.21.1 → 0.21.2
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.d.ts +12 -2
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1769,8 +1769,18 @@ declare class ToonClient {
|
|
|
1769
1769
|
* `start()` would register and that `rig fund` prints — so all configured
|
|
1770
1770
|
* chains appear even before a start. Best-effort per chain: an unreachable
|
|
1771
1771
|
* RPC yields `{ unreadable: true }` for that chain, never failing the others.
|
|
1772
|
-
|
|
1773
|
-
|
|
1772
|
+
*
|
|
1773
|
+
* `fallback` supplies Solana/Mina channel params (RPC/GraphQL + token) to use
|
|
1774
|
+
* ONLY when `config.solanaChannel`/`config.minaChannel` are unset — a
|
|
1775
|
+
* wallet-view-only default (e.g. the network preset's public RPC) that lets a
|
|
1776
|
+
* caller show all three chains, reading 0 for a not-yet-on-chain account,
|
|
1777
|
+
* WITHOUT injecting those channels into the client's settlement config (which
|
|
1778
|
+
* would change chain negotiation). Explicit config wins.
|
|
1779
|
+
*/
|
|
1780
|
+
getWalletBalances(fallback?: {
|
|
1781
|
+
solanaChannel?: ToonClientConfig['solanaChannel'];
|
|
1782
|
+
minaChannel?: ToonClientConfig['minaChannel'];
|
|
1783
|
+
}): Promise<WalletChainBalances[]>;
|
|
1774
1784
|
/**
|
|
1775
1785
|
* Resolves an ILP destination address to a peer ID.
|
|
1776
1786
|
* Convention: destination "g.toon.peer1" → peerId "peer1" (last segment).
|
package/dist/index.js
CHANGED
|
@@ -5820,8 +5820,15 @@ var ToonClient = class {
|
|
|
5820
5820
|
* `start()` would register and that `rig fund` prints — so all configured
|
|
5821
5821
|
* chains appear even before a start. Best-effort per chain: an unreachable
|
|
5822
5822
|
* RPC yields `{ unreadable: true }` for that chain, never failing the others.
|
|
5823
|
+
*
|
|
5824
|
+
* `fallback` supplies Solana/Mina channel params (RPC/GraphQL + token) to use
|
|
5825
|
+
* ONLY when `config.solanaChannel`/`config.minaChannel` are unset — a
|
|
5826
|
+
* wallet-view-only default (e.g. the network preset's public RPC) that lets a
|
|
5827
|
+
* caller show all three chains, reading 0 for a not-yet-on-chain account,
|
|
5828
|
+
* WITHOUT injecting those channels into the client's settlement config (which
|
|
5829
|
+
* would change chain negotiation). Explicit config wins.
|
|
5823
5830
|
*/
|
|
5824
|
-
async getWalletBalances() {
|
|
5831
|
+
async getWalletBalances(fallback) {
|
|
5825
5832
|
const sources = {};
|
|
5826
5833
|
let derived;
|
|
5827
5834
|
let derivedTried = false;
|
|
@@ -5853,7 +5860,7 @@ var ToonClient = class {
|
|
|
5853
5860
|
};
|
|
5854
5861
|
}
|
|
5855
5862
|
}
|
|
5856
|
-
const sol = this.config.solanaChannel;
|
|
5863
|
+
const sol = this.config.solanaChannel ?? fallback?.solanaChannel;
|
|
5857
5864
|
if (sol?.rpcUrl) {
|
|
5858
5865
|
const solAddress = this.getSolanaAddress() ?? (await ensureDerived())?.solana.publicKey;
|
|
5859
5866
|
if (solAddress) {
|
|
@@ -5865,7 +5872,7 @@ var ToonClient = class {
|
|
|
5865
5872
|
};
|
|
5866
5873
|
}
|
|
5867
5874
|
}
|
|
5868
|
-
const mina = this.config.minaChannel;
|
|
5875
|
+
const mina = this.config.minaChannel ?? fallback?.minaChannel;
|
|
5869
5876
|
if (mina?.graphqlUrl) {
|
|
5870
5877
|
const minaAddress = this.getMinaAddress() ?? (await ensureDerived())?.mina.publicKey;
|
|
5871
5878
|
if (minaAddress) {
|