@toon-protocol/core 3.1.4 → 3.2.1
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 +4 -4
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -462,7 +462,7 @@ interface IlpPeerInfo {
|
|
|
462
462
|
assetCode: string;
|
|
463
463
|
/** Asset scale - number of decimal places (e.g., 9 for XRP, 6 for USD cents) */
|
|
464
464
|
assetScale: number;
|
|
465
|
-
/** Supported settlement chain identifiers
|
|
465
|
+
/** Supported settlement chain identifiers (e.g., ["evm:8453", "solana:devnet", "xrp:mainnet"]). EVM uses the BARE `evm:<numeric chainId>` form — negotiation is a set intersection, so an extra family segment (`evm:base:8453`) matches nothing. See toon#165. */
|
|
466
466
|
supportedChains?: string[];
|
|
467
467
|
/** Maps chain identifier to the peer's settlement address on that chain */
|
|
468
468
|
settlementAddresses?: Record<string, string>;
|
|
@@ -521,7 +521,7 @@ interface Subscription {
|
|
|
521
521
|
interface OpenChannelParams {
|
|
522
522
|
/** Connector peer identifier */
|
|
523
523
|
peerId: string;
|
|
524
|
-
/** Settlement chain identifier (e.g., "evm:
|
|
524
|
+
/** Settlement chain identifier (e.g., "evm:8453") */
|
|
525
525
|
chain: string;
|
|
526
526
|
/** Token contract address on the chain */
|
|
527
527
|
token?: string;
|
|
@@ -3956,7 +3956,7 @@ declare function resolveNetworkProfile(network: NetworkMode, opts?: {
|
|
|
3956
3956
|
*
|
|
3957
3957
|
* Where {@link NetworkProfile} targets the apex connector + node containers
|
|
3958
3958
|
* (env overlay + `chainProviders`), this targets the @toon-protocol/client
|
|
3959
|
-
* `ToonClientConfig` shape: identifier-keyed maps (`evm:<
|
|
3959
|
+
* `ToonClientConfig` shape: identifier-keyed maps (`evm:<chainId>`,
|
|
3960
3960
|
* `solana:<cluster>`, `mina:<network>`) plus the Solana/Mina channel params.
|
|
3961
3961
|
* It draws from the SAME presets (`CHAIN_PRESETS`, `SOLANA_TIER`, `MINA_TIER`),
|
|
3962
3962
|
* so node and client default to the identical live contracts — no duplicated
|
|
@@ -3966,7 +3966,7 @@ declare function resolveNetworkProfile(network: NetworkMode, opts?: {
|
|
|
3966
3966
|
* client's fully-manual path and is intentionally not handled.
|
|
3967
3967
|
*/
|
|
3968
3968
|
interface ClientNetworkPresets {
|
|
3969
|
-
/** Chain identifiers (`evm:
|
|
3969
|
+
/** Chain identifiers (`evm:84532`, `solana:devnet`, `mina:devnet`). */
|
|
3970
3970
|
supportedChains: string[];
|
|
3971
3971
|
/** identifier → JSON-RPC / GraphQL URL. */
|
|
3972
3972
|
chainRpcUrls: Record<string, string>;
|
package/dist/index.js
CHANGED
|
@@ -2236,10 +2236,10 @@ var NostrPeerDiscovery = class {
|
|
|
2236
2236
|
// src/discovery/genesis-peers.json
|
|
2237
2237
|
var genesis_peers_default = [
|
|
2238
2238
|
{
|
|
2239
|
-
pubkey: "
|
|
2239
|
+
pubkey: "30fdd01d55c3efeb4c19c2cbeda8247cbc40ae9b15c026e9a301a263001fa7a9",
|
|
2240
2240
|
relayUrl: "wss://relay-ws.devnet.toonprotocol.dev",
|
|
2241
|
-
ilpAddress: "g.
|
|
2242
|
-
btpEndpoint: "wss://proxy.devnet.toonprotocol.dev
|
|
2241
|
+
ilpAddress: "g.toon",
|
|
2242
|
+
btpEndpoint: "wss://proxy.devnet.toonprotocol.dev/ilp/btp"
|
|
2243
2243
|
}
|
|
2244
2244
|
];
|
|
2245
2245
|
|
|
@@ -3351,6 +3351,14 @@ var BootstrapService = class {
|
|
|
3351
3351
|
});
|
|
3352
3352
|
}
|
|
3353
3353
|
}
|
|
3354
|
+
} else {
|
|
3355
|
+
const reason = `No shared settlement chain with ${registeredPeerId}: we support [${this.settlementInfo.supportedChains.join(", ")}], peer supports [${peerInfo.supportedChains.join(", ")}]`;
|
|
3356
|
+
console.warn(`[Bootstrap] ${reason}`);
|
|
3357
|
+
this.emit({
|
|
3358
|
+
type: "bootstrap:settlement-failed",
|
|
3359
|
+
peerId: registeredPeerId,
|
|
3360
|
+
reason
|
|
3361
|
+
});
|
|
3354
3362
|
}
|
|
3355
3363
|
} catch (error) {
|
|
3356
3364
|
const reason = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -3893,6 +3901,14 @@ function createDiscoveryTracker(config) {
|
|
|
3893
3901
|
peerId
|
|
3894
3902
|
);
|
|
3895
3903
|
}
|
|
3904
|
+
} else {
|
|
3905
|
+
const reason = `No shared settlement chain with ${peerId}: we support [${config.settlementInfo.supportedChains.join(", ")}], peer supports [${peerInfo.supportedChains.join(", ")}]`;
|
|
3906
|
+
console.warn("[DiscoveryTracker] %s", reason);
|
|
3907
|
+
emit({
|
|
3908
|
+
type: "bootstrap:settlement-failed",
|
|
3909
|
+
peerId,
|
|
3910
|
+
reason
|
|
3911
|
+
});
|
|
3896
3912
|
}
|
|
3897
3913
|
} catch (error) {
|
|
3898
3914
|
const reason = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -4839,8 +4855,7 @@ function resolveNetworkProfile(network, opts = {}) {
|
|
|
4839
4855
|
return { network, chainProviders, nodeEnv, status };
|
|
4840
4856
|
}
|
|
4841
4857
|
function evmClientId(preset) {
|
|
4842
|
-
|
|
4843
|
-
return `evm:${family}:${preset.chainId}`;
|
|
4858
|
+
return `evm:${preset.chainId}`;
|
|
4844
4859
|
}
|
|
4845
4860
|
function resolveClientNetwork(network) {
|
|
4846
4861
|
const supportedChains = [];
|