@toon-protocol/core 3.2.0 → 3.3.0
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 +28 -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
|
@@ -436,7 +436,9 @@ function parseIlpPeerInfo(event) {
|
|
|
436
436
|
throw new InvalidEventError("Invalid field: httpEndpoint must be a string");
|
|
437
437
|
}
|
|
438
438
|
if (supportsUpgrade !== void 0 && typeof supportsUpgrade !== "boolean") {
|
|
439
|
-
throw new InvalidEventError(
|
|
439
|
+
throw new InvalidEventError(
|
|
440
|
+
"Invalid field: supportsUpgrade must be a boolean"
|
|
441
|
+
);
|
|
440
442
|
}
|
|
441
443
|
if (typeof assetCode !== "string" || assetCode.length === 0) {
|
|
442
444
|
throw new InvalidEventError("Missing or invalid required field: assetCode");
|
|
@@ -2238,8 +2240,14 @@ var genesis_peers_default = [
|
|
|
2238
2240
|
{
|
|
2239
2241
|
pubkey: "30fdd01d55c3efeb4c19c2cbeda8247cbc40ae9b15c026e9a301a263001fa7a9",
|
|
2240
2242
|
relayUrl: "wss://relay-ws.devnet.toonprotocol.dev",
|
|
2241
|
-
ilpAddress: "g.toon",
|
|
2242
|
-
btpEndpoint: "wss://proxy.devnet.toonprotocol.dev/ilp/btp"
|
|
2243
|
+
ilpAddress: "g.toon.relay",
|
|
2244
|
+
btpEndpoint: "wss://proxy.relay.devnet.toonprotocol.dev/ilp/btp"
|
|
2245
|
+
},
|
|
2246
|
+
{
|
|
2247
|
+
pubkey: "499cdd71c7c3eab8d9b35f88ec9cde29018461e4bef86389004abcd7cfa1108a",
|
|
2248
|
+
relayUrl: "wss://relay-ws.devnet.toonprotocol.dev",
|
|
2249
|
+
ilpAddress: "g.toon.ario",
|
|
2250
|
+
btpEndpoint: "wss://proxy.ario.devnet.toonprotocol.dev/ilp/btp"
|
|
2243
2251
|
}
|
|
2244
2252
|
];
|
|
2245
2253
|
|
|
@@ -3351,6 +3359,14 @@ var BootstrapService = class {
|
|
|
3351
3359
|
});
|
|
3352
3360
|
}
|
|
3353
3361
|
}
|
|
3362
|
+
} else {
|
|
3363
|
+
const reason = `No shared settlement chain with ${registeredPeerId}: we support [${this.settlementInfo.supportedChains.join(", ")}], peer supports [${peerInfo.supportedChains.join(", ")}]`;
|
|
3364
|
+
console.warn(`[Bootstrap] ${reason}`);
|
|
3365
|
+
this.emit({
|
|
3366
|
+
type: "bootstrap:settlement-failed",
|
|
3367
|
+
peerId: registeredPeerId,
|
|
3368
|
+
reason
|
|
3369
|
+
});
|
|
3354
3370
|
}
|
|
3355
3371
|
} catch (error) {
|
|
3356
3372
|
const reason = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -3893,6 +3909,14 @@ function createDiscoveryTracker(config) {
|
|
|
3893
3909
|
peerId
|
|
3894
3910
|
);
|
|
3895
3911
|
}
|
|
3912
|
+
} else {
|
|
3913
|
+
const reason = `No shared settlement chain with ${peerId}: we support [${config.settlementInfo.supportedChains.join(", ")}], peer supports [${peerInfo.supportedChains.join(", ")}]`;
|
|
3914
|
+
console.warn("[DiscoveryTracker] %s", reason);
|
|
3915
|
+
emit({
|
|
3916
|
+
type: "bootstrap:settlement-failed",
|
|
3917
|
+
peerId,
|
|
3918
|
+
reason
|
|
3919
|
+
});
|
|
3896
3920
|
}
|
|
3897
3921
|
} catch (error) {
|
|
3898
3922
|
const reason = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -4839,8 +4863,7 @@ function resolveNetworkProfile(network, opts = {}) {
|
|
|
4839
4863
|
return { network, chainProviders, nodeEnv, status };
|
|
4840
4864
|
}
|
|
4841
4865
|
function evmClientId(preset) {
|
|
4842
|
-
|
|
4843
|
-
return `evm:${family}:${preset.chainId}`;
|
|
4866
|
+
return `evm:${preset.chainId}`;
|
|
4844
4867
|
}
|
|
4845
4868
|
function resolveClientNetwork(network) {
|
|
4846
4869
|
const supportedChains = [];
|