@inco/js 0.1.21 → 0.1.23

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.mjs CHANGED
@@ -48,7 +48,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
48
48
  throw Error('Dynamic require of "' + x + '" is not supported');
49
49
  });
50
50
 
51
- // node_modules/viem/_esm/utils/data/isHex.js
51
+ // ../node_modules/viem/_esm/utils/data/isHex.js
52
52
  function isHex(value6, { strict: strict2 = true } = {}) {
53
53
  if (!value6)
54
54
  return false;
@@ -57,19 +57,18 @@ function isHex(value6, { strict: strict2 = true } = {}) {
57
57
  return strict2 ? /^0x[0-9a-fA-F]*$/.test(value6) : value6.startsWith("0x");
58
58
  }
59
59
 
60
- // node_modules/viem/_esm/utils/data/size.js
60
+ // ../node_modules/viem/_esm/utils/data/size.js
61
61
  function size21(value6) {
62
62
  if (isHex(value6, { strict: false }))
63
63
  return Math.ceil((value6.length - 2) / 2);
64
64
  return value6.length;
65
65
  }
66
- var init_size = () => {
67
- };
66
+ var init_size = () => {};
68
67
 
69
- // node_modules/viem/_esm/errors/version.js
70
- var version = "2.22.23";
68
+ // ../node_modules/viem/_esm/errors/version.js
69
+ var version = "2.24.3";
71
70
 
72
- // node_modules/viem/_esm/errors/base.js
71
+ // ../node_modules/viem/_esm/errors/base.js
73
72
  function walk(err, fn) {
74
73
  if (fn?.(err))
75
74
  return err;
@@ -157,7 +156,7 @@ var init_base = __esm(() => {
157
156
  };
158
157
  });
159
158
 
160
- // node_modules/viem/_esm/errors/abi.js
159
+ // ../node_modules/viem/_esm/errors/abi.js
161
160
  var AbiEncodingLengthMismatchError, BytesSizeMismatchError, UnsupportedPackedAbiType;
162
161
  var init_abi = __esm(() => {
163
162
  init_base();
@@ -187,7 +186,7 @@ var init_abi = __esm(() => {
187
186
  };
188
187
  });
189
188
 
190
- // node_modules/viem/_esm/errors/data.js
189
+ // ../node_modules/viem/_esm/errors/data.js
191
190
  var SizeExceedsPaddingSizeError;
192
191
  var init_data = __esm(() => {
193
192
  init_base();
@@ -198,7 +197,7 @@ var init_data = __esm(() => {
198
197
  };
199
198
  });
200
199
 
201
- // node_modules/viem/_esm/utils/data/pad.js
200
+ // ../node_modules/viem/_esm/utils/data/pad.js
202
201
  function pad(hexOrBytes, { dir: dir2, size: size22 = 32 } = {}) {
203
202
  if (typeof hexOrBytes === "string")
204
203
  return padHex(hexOrBytes, { dir: dir2, size: size22 });
@@ -236,7 +235,7 @@ var init_pad = __esm(() => {
236
235
  init_data();
237
236
  });
238
237
 
239
- // node_modules/viem/_esm/errors/encoding.js
238
+ // ../node_modules/viem/_esm/errors/encoding.js
240
239
  var IntegerOutOfRangeError, SizeOverflowError;
241
240
  var init_encoding = __esm(() => {
242
241
  init_base();
@@ -252,7 +251,7 @@ var init_encoding = __esm(() => {
252
251
  };
253
252
  });
254
253
 
255
- // node_modules/viem/_esm/utils/encoding/fromHex.js
254
+ // ../node_modules/viem/_esm/utils/encoding/fromHex.js
256
255
  function assertSize(hexOrBytes, { size: size22 }) {
257
256
  if (size21(hexOrBytes) > size22)
258
257
  throw new SizeOverflowError({
@@ -265,7 +264,7 @@ var init_fromHex = __esm(() => {
265
264
  init_size();
266
265
  });
267
266
 
268
- // node_modules/viem/_esm/utils/encoding/toHex.js
267
+ // ../node_modules/viem/_esm/utils/encoding/toHex.js
269
268
  function toHex(value6, opts = {}) {
270
269
  if (typeof value6 === "number" || typeof value6 === "bigint")
271
270
  return numberToHex(value6, opts);
@@ -337,7 +336,7 @@ var init_toHex = __esm(() => {
337
336
  encoder2 = /* @__PURE__ */ new TextEncoder;
338
337
  });
339
338
 
340
- // node_modules/viem/_esm/utils/encoding/toBytes.js
339
+ // ../node_modules/viem/_esm/utils/encoding/toBytes.js
341
340
  function toBytes(value6, opts = {}) {
342
341
  if (typeof value6 === "number" || typeof value6 === "bigint")
343
342
  return numberToBytes(value6, opts);
@@ -442,8 +441,7 @@ function aoutput(out, instance) {
442
441
  throw new Error("digestInto() expects output buffer of length at least " + min4);
443
442
  }
444
443
  }
445
- var init__assert = () => {
446
- };
444
+ var init__assert = () => {};
447
445
 
448
446
  // ../node_modules/@noble/hashes/esm/_u64.js
449
447
  function fromBig(n, le = false) {
@@ -705,7 +703,7 @@ var init_sha3 = __esm(() => {
705
703
  shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
706
704
  });
707
705
 
708
- // node_modules/viem/_esm/utils/hash/keccak256.js
706
+ // ../node_modules/viem/_esm/utils/hash/keccak256.js
709
707
  function keccak256(value6, to_) {
710
708
  const to = to_ || "hex";
711
709
  const bytes = keccak_256(isHex(value6, { strict: false }) ? toBytes(value6) : value6);
@@ -719,7 +717,7 @@ var init_keccak256 = __esm(() => {
719
717
  init_toHex();
720
718
  });
721
719
 
722
- // node_modules/viem/_esm/errors/address.js
720
+ // ../node_modules/viem/_esm/errors/address.js
723
721
  var InvalidAddressError;
724
722
  var init_address = __esm(() => {
725
723
  init_base();
@@ -736,7 +734,7 @@ var init_address = __esm(() => {
736
734
  };
737
735
  });
738
736
 
739
- // node_modules/viem/_esm/utils/lru.js
737
+ // ../node_modules/viem/_esm/utils/lru.js
740
738
  var LruMap;
741
739
  var init_lru = __esm(() => {
742
740
  LruMap = class LruMap extends Map {
@@ -770,7 +768,7 @@ var init_lru = __esm(() => {
770
768
  };
771
769
  });
772
770
 
773
- // node_modules/viem/_esm/utils/address/getAddress.js
771
+ // ../node_modules/viem/_esm/utils/address/getAddress.js
774
772
  function checksumAddress(address_, chainId) {
775
773
  if (checksumAddressCache.has(`${address_}.${chainId}`))
776
774
  return checksumAddressCache.get(`${address_}.${chainId}`);
@@ -797,7 +795,7 @@ var init_getAddress = __esm(() => {
797
795
  checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
798
796
  });
799
797
 
800
- // node_modules/viem/_esm/utils/address/isAddress.js
798
+ // ../node_modules/viem/_esm/utils/address/isAddress.js
801
799
  function isAddress(address, options) {
802
800
  const { strict: strict2 = true } = options ?? {};
803
801
  const cacheKey = `${address}.${strict2}`;
@@ -823,12 +821,12 @@ var init_isAddress = __esm(() => {
823
821
  isAddressCache = /* @__PURE__ */ new LruMap(8192);
824
822
  });
825
823
 
826
- // node_modules/viem/_esm/utils/data/concat.js
824
+ // ../node_modules/viem/_esm/utils/data/concat.js
827
825
  function concatHex(values7) {
828
826
  return `0x${values7.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
829
827
  }
830
828
 
831
- // node_modules/viem/_esm/utils/regex.js
829
+ // ../node_modules/viem/_esm/utils/regex.js
832
830
  var arrayRegex, bytesRegex, integerRegex;
833
831
  var init_regex = __esm(() => {
834
832
  arrayRegex = /^(.*)\[([0-9]*)\]$/;
@@ -2565,8 +2563,7 @@ var tracingFunction = (name) => {
2565
2563
  };
2566
2564
  };
2567
2565
  var internalCall = /* @__PURE__ */ tracingFunction("effect_internal_function");
2568
- var genConstructor = function* () {
2569
- }.constructor;
2566
+ var genConstructor = function* () {}.constructor;
2570
2567
 
2571
2568
  // ../node_modules/effect/dist/esm/Hash.js
2572
2569
  var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => new WeakMap);
@@ -2913,8 +2910,7 @@ var StructuralCommitPrototype = {
2913
2910
  ...StructuralPrototype
2914
2911
  };
2915
2912
  var Base = /* @__PURE__ */ function() {
2916
- function Base2() {
2917
- }
2913
+ function Base2() {}
2918
2914
  Base2.prototype = CommitPrototype;
2919
2915
  return Base2;
2920
2916
  }();
@@ -6417,8 +6413,7 @@ var Reference = () => (id, options) => {
6417
6413
  Error.stackTraceLimit = 2;
6418
6414
  const creationError = new Error;
6419
6415
  Error.stackTraceLimit = limit;
6420
- function ReferenceClass() {
6421
- }
6416
+ function ReferenceClass() {}
6422
6417
  Object.setPrototypeOf(ReferenceClass, ReferenceProto);
6423
6418
  ReferenceClass.key = id;
6424
6419
  ReferenceClass.defaultValue = options.defaultValue;
@@ -9358,8 +9353,7 @@ var prettyErrorMessage = (u) => {
9358
9353
  if (hasProperty(u, "toString") && isFunction2(u["toString"]) && u["toString"] !== Object.prototype.toString && u["toString"] !== globalThis.Array.prototype.toString) {
9359
9354
  return u["toString"]();
9360
9355
  }
9361
- } catch {
9362
- }
9356
+ } catch {}
9363
9357
  return stringifyCircular(u);
9364
9358
  };
9365
9359
  var locationRegex = /\((.*)\)/g;
@@ -9933,8 +9927,7 @@ var zip2 = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, (a) => map9(th
9933
9927
  var zipLeft = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, (a) => as(that, a)));
9934
9928
  var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, () => that));
9935
9929
  var never = /* @__PURE__ */ asyncInterrupt(() => {
9936
- const interval = setInterval(() => {
9937
- }, 2 ** 31 - 1);
9930
+ const interval = setInterval(() => {}, 2 ** 31 - 1);
9938
9931
  return sync(() => clearInterval(interval));
9939
9932
  });
9940
9933
  var interruptFiber = (self) => flatMap6(fiberId, (fiberId2) => pipe(self, interruptAsFiber(fiberId2)));
@@ -13754,16 +13747,11 @@ class Const {
13754
13747
  get value() {
13755
13748
  return this.effect;
13756
13749
  }
13757
- onStart(_context, _effect, _parent, _fiber) {
13758
- }
13759
- onEnd(_value, _fiber) {
13760
- }
13761
- onEffect(_fiber, _effect) {
13762
- }
13763
- onSuspend(_fiber) {
13764
- }
13765
- onResume(_fiber) {
13766
- }
13750
+ onStart(_context, _effect, _parent, _fiber) {}
13751
+ onEnd(_value, _fiber) {}
13752
+ onEffect(_fiber, _effect) {}
13753
+ onSuspend(_fiber) {}
13754
+ onResume(_fiber) {}
13767
13755
  map(f) {
13768
13756
  return new ProxySupervisor(this, pipe(this.value, map9(f)));
13769
13757
  }
@@ -14237,8 +14225,7 @@ class FiberRuntime extends Class {
14237
14225
  return whileLoop({
14238
14226
  while: () => !isDone3,
14239
14227
  body,
14240
- step: () => {
14241
- }
14228
+ step: () => {}
14242
14229
  });
14243
14230
  }
14244
14231
  return null;
@@ -23768,7 +23755,7 @@ class TrieIterator {
23768
23755
  }
23769
23756
  }
23770
23757
  var isTrie = (u) => hasProperty(u, TrieTypeId);
23771
- // node_modules/viem/_esm/utils/abi/encodePacked.js
23758
+ // ../node_modules/viem/_esm/utils/abi/encodePacked.js
23772
23759
  init_abi();
23773
23760
  init_address();
23774
23761
  init_isAddress();
@@ -23837,7 +23824,7 @@ function encode6(type2, value6, isArray2 = false) {
23837
23824
  throw new UnsupportedPackedAbiType(type2);
23838
23825
  }
23839
23826
 
23840
- // node_modules/viem/_esm/index.js
23827
+ // ../node_modules/viem/_esm/index.js
23841
23828
  init_toBytes();
23842
23829
  init_toHex();
23843
23830
  // src/schema.ts
@@ -23899,6 +23886,10 @@ var Bytes32 = BytesToHex.pipe(exports_Schema.filter((x) => x.length === 66 || `E
23899
23886
  function asBytes32(x) {
23900
23887
  return parse3(Bytes32, x);
23901
23888
  }
23889
+ var Address = HexString.pipe(exports_Schema.filter((s) => s.length === 42 || `Address must be a 20-byte '0x'-prefixed hex string, but got: ${s}`), exports_Schema.brand("Address"));
23890
+ function parseAddress(address) {
23891
+ return parse3(Address, address);
23892
+ }
23902
23893
  // src/chain.ts
23903
23894
  var supportedChains = {
23904
23895
  baseSepolia: 84532,
@@ -23993,6 +23984,7 @@ function assertUint8(value6) {
23993
23984
  export {
23994
23985
  supportedChains,
23995
23986
  parseJson2 as parseJson,
23987
+ parseAddress,
23996
23988
  parse3 as parse,
23997
23989
  padLeft,
23998
23990
  normaliseToHex,
@@ -24015,5 +24007,6 @@ export {
24015
24007
  HexString,
24016
24008
  HandleTypeName,
24017
24009
  HANDLE_VERSION,
24018
- Bytes32
24010
+ Bytes32,
24011
+ Address
24019
24012
  };
@@ -7,7 +7,7 @@ export interface Secp256k1Keypair extends PubKeyEncodable {
7
7
  }
8
8
  export type Secp256k1PubKey = curve.base.BasePoint;
9
9
  export declare function toSecp256k1Keypair(kp: ec.KeyPair): Secp256k1Keypair;
10
- export declare function generateSecp256k1Keypair(): Promise<Secp256k1Keypair>;
10
+ export declare function generateSecp256k1Keypair(): Secp256k1Keypair;
11
11
  export declare function encodeSecp256k1PublicKey(pub: Secp256k1PubKey): Uint8Array;
12
12
  export declare function decodeSecp256k1PublicKey(pubKeyCompressed: Uint8Array): Secp256k1PubKey;
13
13
  export declare function decodeSecp256k1PrivateKey(privKey: Uint8Array): Secp256k1Keypair;