viem 0.0.1-alpha.11 → 0.0.1-alpha.13

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.
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk35OJIFIWjs = require('./chunk-35OJIFIW.js');
6
+ var _chunkAGF7GU6Gjs = require('./chunk-AGF7GU6G.js');
7
7
 
8
8
  // src/clients/transports/createTransport.ts
9
9
  function createTransport(config, value) {
@@ -60,13 +60,13 @@ function http(url, { key = "http", name = "HTTP JSON-RPC" } = {}) {
60
60
  return ({ chain }) => {
61
61
  const url_ = url || _optionalChain([chain, 'optionalAccess', _ => _.rpcUrls, 'access', _2 => _2.default, 'access', _3 => _3.http, 'access', _4 => _4[0]]);
62
62
  if (!url_)
63
- throw new (0, _chunk35OJIFIWjs.UrlRequiredError)();
63
+ throw new (0, _chunkAGF7GU6Gjs.UrlRequiredError)();
64
64
  return createTransport(
65
65
  {
66
66
  key,
67
67
  name,
68
68
  async request({ method, params }) {
69
- const { result } = await _chunk35OJIFIWjs.rpc.http(url_, {
69
+ const { result } = await _chunkAGF7GU6Gjs.rpc.http(url_, {
70
70
  body: {
71
71
  method,
72
72
  params
@@ -91,14 +91,14 @@ function webSocket(url, {
91
91
  return ({ chain }) => {
92
92
  const url_ = url || _optionalChain([chain, 'optionalAccess', _5 => _5.rpcUrls, 'access', _6 => _6.default, 'access', _7 => _7.webSocket, 'optionalAccess', _8 => _8[0]]);
93
93
  if (!url_)
94
- throw new (0, _chunk35OJIFIWjs.UrlRequiredError)();
94
+ throw new (0, _chunkAGF7GU6Gjs.UrlRequiredError)();
95
95
  return createTransport(
96
96
  {
97
97
  key,
98
98
  name,
99
99
  async request({ method, params }) {
100
- const socket = await _chunk35OJIFIWjs.getSocket.call(void 0, url_);
101
- const { result } = await _chunk35OJIFIWjs.rpc.webSocketAsync(socket, {
100
+ const socket = await _chunkAGF7GU6Gjs.getSocket.call(void 0, url_);
101
+ const { result } = await _chunkAGF7GU6Gjs.rpc.webSocketAsync(socket, {
102
102
  body: { method, params }
103
103
  });
104
104
  return result;
@@ -107,12 +107,12 @@ function webSocket(url, {
107
107
  },
108
108
  {
109
109
  getSocket() {
110
- return _chunk35OJIFIWjs.getSocket.call(void 0, url_);
110
+ return _chunkAGF7GU6Gjs.getSocket.call(void 0, url_);
111
111
  },
112
112
  async subscribe({ params, onData, onError }) {
113
- const socket = await _chunk35OJIFIWjs.getSocket.call(void 0, url_);
113
+ const socket = await _chunkAGF7GU6Gjs.getSocket.call(void 0, url_);
114
114
  const { result: subscriptionId } = await new Promise(
115
- (resolve, reject) => _chunk35OJIFIWjs.rpc.webSocket(socket, {
115
+ (resolve, reject) => _chunkAGF7GU6Gjs.rpc.webSocket(socket, {
116
116
  body: {
117
117
  method: "eth_subscribe",
118
118
  params
@@ -134,7 +134,7 @@ function webSocket(url, {
134
134
  subscriptionId,
135
135
  async unsubscribe() {
136
136
  return new Promise(
137
- (resolve, reject) => _chunk35OJIFIWjs.rpc.webSocket(socket, {
137
+ (resolve, reject) => _chunkAGF7GU6Gjs.rpc.webSocket(socket, {
138
138
  body: {
139
139
  method: "eth_unsubscribe",
140
140
  params: [subscriptionId]
@@ -181,7 +181,7 @@ function createClient({
181
181
  key,
182
182
  name,
183
183
  pollingInterval,
184
- request: _chunk35OJIFIWjs.buildRequest.call(void 0, config.request),
184
+ request: _chunkAGF7GU6Gjs.buildRequest.call(void 0, config.request),
185
185
  transport: { ...config, ...value },
186
186
  type,
187
187
  uid: uid()