@xyo-network/xl1-rpc 1.24.30 → 1.24.32

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.
@@ -1493,7 +1493,11 @@ import { creatableProvider } from "@xyo-network/xl1-protocol-sdk";
1493
1493
  import { AccountBalanceViewerMoniker } from "@xyo-network/xl1-protocol";
1494
1494
 
1495
1495
  // src/provider/viewer/JsonRpcViewer.ts
1496
- import { AbstractCreatableProvider, HttpRpcRemoteConfigZod } from "@xyo-network/xl1-protocol-sdk";
1496
+ import {
1497
+ AbstractCreatableProvider,
1498
+ HttpRpcRemoteConfigZod,
1499
+ PostMessageRpcRemoteConfigZod
1500
+ } from "@xyo-network/xl1-protocol-sdk";
1497
1501
 
1498
1502
  // src/transport/HttpRpcTransport.ts
1499
1503
  import {
@@ -1746,11 +1750,16 @@ var AbstractJsonRpcViewer = class extends AbstractCreatableProvider {
1746
1750
  await super.createHandler();
1747
1751
  }
1748
1752
  createTransport() {
1749
- const httpRemoteConfig = HttpRpcRemoteConfigZod.safeParse(this.config.remote);
1753
+ const httpRemoteConfig = HttpRpcRemoteConfigZod.safeParse(this.config.remote.rpc);
1750
1754
  if (httpRemoteConfig.success) {
1751
- const { url } = httpRemoteConfig.data.rpc;
1755
+ const { url } = httpRemoteConfig.data;
1752
1756
  return new HttpRpcTransport(url, this.schemas());
1753
1757
  }
1758
+ const postMessageRemoteConfig = PostMessageRpcRemoteConfigZod.safeParse(this.config.remote.rpc);
1759
+ if (postMessageRemoteConfig.success) {
1760
+ const { networkId, sessionId } = postMessageRemoteConfig.data;
1761
+ return new PostMessageRpcTransport(networkId, this.schemas(), sessionId, this.logger);
1762
+ }
1754
1763
  throw new Error("Unable to create transport");
1755
1764
  }
1756
1765
  };
@@ -2555,7 +2564,11 @@ import { creatableProvider as creatableProvider13 } from "@xyo-network/xl1-proto
2555
2564
  import { MempoolRunnerMoniker } from "@xyo-network/xl1-protocol";
2556
2565
 
2557
2566
  // src/provider/runner/JsonRpcRunner.ts
2558
- import { AbstractCreatableProvider as AbstractCreatableProvider2, HttpRpcRemoteConfigZod as HttpRpcRemoteConfigZod2 } from "@xyo-network/xl1-protocol-sdk";
2567
+ import {
2568
+ AbstractCreatableProvider as AbstractCreatableProvider2,
2569
+ HttpRpcRemoteConfigZod as HttpRpcRemoteConfigZod2,
2570
+ PostMessageRpcRemoteConfigZod as PostMessageRpcRemoteConfigZod2
2571
+ } from "@xyo-network/xl1-protocol-sdk";
2559
2572
  var AbstractJsonRpcRunner = class extends AbstractCreatableProvider2 {
2560
2573
  get transport() {
2561
2574
  return this.params.transport;
@@ -2565,11 +2578,16 @@ var AbstractJsonRpcRunner = class extends AbstractCreatableProvider2 {
2565
2578
  await super.createHandler();
2566
2579
  }
2567
2580
  createTransport() {
2568
- const httpRemoteConfig = HttpRpcRemoteConfigZod2.safeParse(this.config.remote);
2581
+ const httpRemoteConfig = HttpRpcRemoteConfigZod2.safeParse(this.config.remote.rpc);
2569
2582
  if (httpRemoteConfig.success) {
2570
- const { url } = httpRemoteConfig.data.rpc;
2583
+ const { url } = httpRemoteConfig.data;
2571
2584
  return new HttpRpcTransport(url, this.schemas());
2572
2585
  }
2586
+ const postMessageRemoteConfig = PostMessageRpcRemoteConfigZod2.safeParse(this.config.remote.rpc);
2587
+ if (postMessageRemoteConfig.success) {
2588
+ const { networkId, sessionId } = postMessageRemoteConfig.data;
2589
+ return new PostMessageRpcTransport(networkId, this.schemas(), sessionId, this.logger);
2590
+ }
2573
2591
  throw new Error("Unable to create transport");
2574
2592
  }
2575
2593
  };