@chainrails/react 0.1.5 → 0.1.6

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.
@@ -50,7 +50,7 @@ const be = (() => {
50
50
  throw r;
51
51
  }
52
52
  return e && !t;
53
- })(), Ut = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", xt = typeof globalThis.FormData == "function", _e = ["get", "post", "put", "patch", "head", "delete"], kt = {
53
+ })(), Ut = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", kt = typeof globalThis.FormData == "function", $e = ["get", "post", "put", "patch", "head", "delete"], xt = {
54
54
  json: "application/json",
55
55
  text: "text/*",
56
56
  formData: "multipart/form-data",
@@ -59,7 +59,7 @@ const be = (() => {
59
59
  // Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).
60
60
  // We still feature-check at runtime before exposing the shortcut.
61
61
  bytes: "*/*"
62
- }, H = 2147483647, Dt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, $e = Symbol("stop");
62
+ }, H = 2147483647, Dt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, _e = Symbol("stop");
63
63
  class Le {
64
64
  options;
65
65
  constructor(t) {
@@ -98,7 +98,7 @@ const Ot = (e) => new Le(e), Nt = {
98
98
  signal: !0,
99
99
  window: !0,
100
100
  duplex: !0
101
- }, _t = (e) => {
101
+ }, $t = (e) => {
102
102
  if (!e)
103
103
  return 0;
104
104
  if (e instanceof FormData) {
@@ -140,7 +140,7 @@ const Ot = (e) => new Le(e), Nt = {
140
140
  n && (r += n.byteLength, s?.({ percent: 1, totalBytes: Math.max(t, r), transferredBytes: r }, n));
141
141
  }
142
142
  }));
143
- }, $t = (e, t) => {
143
+ }, _t = (e, t) => {
144
144
  if (!e.body)
145
145
  return e;
146
146
  if (e.status === 204)
@@ -158,7 +158,7 @@ const Ot = (e) => new Le(e), Nt = {
158
158
  }, Lt = (e, t, s) => {
159
159
  if (!e.body)
160
160
  return e;
161
- const n = _t(s ?? e.body);
161
+ const n = $t(s ?? e.body);
162
162
  return new Request(e, {
163
163
  // @ts-expect-error - Types are outdated.
164
164
  duplex: "half",
@@ -235,7 +235,7 @@ const qe = (e = {}, t = {}) => ({
235
235
  I(o.hooks) && (n = qe(n, o.hooks), t.hooks = n), I(o.headers) && (s = je(s, o.headers), t.headers = s);
236
236
  }
237
237
  return r !== void 0 && (t.searchParams = r), i.length > 0 && (i.length === 1 ? t.signal = i[0] : Be ? t.signal = AbortSignal.any(i) : t.signal = i.at(-1)), t.context === void 0 && (t.context = {}), t;
238
- }, jt = (e) => _e.includes(e) ? e.toUpperCase() : e, qt = ["get", "put", "head", "delete", "options", "trace"], Ft = [408, 413, 429, 500, 502, 503, 504], Ht = [413, 429, 503], Ee = {
238
+ }, jt = (e) => $e.includes(e) ? e.toUpperCase() : e, qt = ["get", "put", "head", "delete", "options", "trace"], Ft = [408, 413, 429, 500, 502, 503, 504], Ht = [413, 429, 503], Ee = {
239
239
  limit: 2,
240
240
  methods: qt,
241
241
  statusCodes: Ft,
@@ -325,14 +325,14 @@ class O {
325
325
  throw new TypeError("The `onDownloadProgress` option must be a function");
326
326
  if (!Ct)
327
327
  throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
328
- return $t(o.clone(), n.#e.onDownloadProgress);
328
+ return _t(o.clone(), n.#e.onDownloadProgress);
329
329
  }
330
330
  return o;
331
331
  }, i = n.#f(r).finally(async () => {
332
332
  const o = n.#o, a = [];
333
333
  o && !o.bodyUsed && a.push(o.body?.cancel()), n.request.bodyUsed || a.push(n.request.body?.cancel()), await Promise.all(a);
334
334
  });
335
- for (const [o, a] of Object.entries(kt))
335
+ for (const [o, a] of Object.entries(xt))
336
336
  o === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[o] = async () => {
337
337
  n.request.headers.set("accept", n.request.headers.get("accept") || a);
338
338
  const c = await i;
@@ -387,7 +387,7 @@ class O {
387
387
  }
388
388
  Ut && Be && (this.#r = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal), be && (this.#e.duplex = "half"), this.#e.json !== void 0 && (this.#e.body = this.#e.stringifyJson?.(this.#e.json) ?? JSON.stringify(this.#e.json), this.#e.headers.set("content-type", this.#e.headers.get("content-type") ?? "application/json"));
389
389
  const n = s.headers && new globalThis.Headers(s.headers).has("content-type");
390
- if (this.#t instanceof globalThis.Request && (xt && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Xt(this.#e.searchParams)) {
390
+ if (this.#t instanceof globalThis.Request && (kt && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Xt(this.#e.searchParams)) {
391
391
  const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(O.#d(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
392
392
  this.request = new globalThis.Request(o, this.#e);
393
393
  }
@@ -463,7 +463,7 @@ class O {
463
463
  }
464
464
  if (i instanceof globalThis.Response)
465
465
  return i;
466
- if (i === $e)
466
+ if (i === _e)
467
467
  return;
468
468
  }
469
469
  return this.#f(t);
@@ -500,9 +500,9 @@ class O {
500
500
  /*! MIT License © Sindre Sorhus */
501
501
  const Z = (e) => {
502
502
  const t = (s, n) => O.create(s, M(e, n));
503
- for (const s of _e)
503
+ for (const s of $e)
504
504
  t[s] = (n, r) => O.create(n, M(e, r, { method: s }));
505
- return t.create = (s) => Z(M(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Z(M(e, s))), t.stop = $e, t.retry = Ot, t;
505
+ return t.create = (s) => Z(M(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Z(M(e, s))), t.stop = _e, t.retry = Ot, t;
506
506
  }, Zt = Z();
507
507
  var S = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(S || {});
508
508
  const Fe = {
@@ -745,9 +745,9 @@ function nt(e, t = {}) {
745
745
  const s = rs.encode(e);
746
746
  return typeof t.size == "number" ? (ae(s, { size: t.size }), q(s, { dir: "right", size: t.size })) : s;
747
747
  }
748
- const _ = /* @__PURE__ */ BigInt(2 ** 32 - 1), Te = /* @__PURE__ */ BigInt(32);
748
+ const $ = /* @__PURE__ */ BigInt(2 ** 32 - 1), Te = /* @__PURE__ */ BigInt(32);
749
749
  function cs(e, t = !1) {
750
- return t ? { h: Number(e & _), l: Number(e >> Te & _) } : { h: Number(e >> Te & _) | 0, l: Number(e & _) | 0 };
750
+ return t ? { h: Number(e & $), l: Number(e >> Te & $) } : { h: Number(e >> Te & $) | 0, l: Number(e & $) | 0 };
751
751
  }
752
752
  function us(e, t = !1) {
753
753
  const s = e.length;
@@ -767,7 +767,7 @@ function Ae(e) {
767
767
  if (!Number.isSafeInteger(e) || e < 0)
768
768
  throw new Error("positive integer expected, got " + e);
769
769
  }
770
- function $(e, ...t) {
770
+ function _(e, ...t) {
771
771
  if (!ps(e))
772
772
  throw new Error("Uint8Array expected");
773
773
  if (t.length > 0 && !t.includes(e.length))
@@ -780,7 +780,7 @@ function ve(e, t = !0) {
780
780
  throw new Error("Hash#digest() has already been called");
781
781
  }
782
782
  function gs(e, t) {
783
- $(e);
783
+ _(e);
784
784
  const s = t.outputLen;
785
785
  if (e.length < s)
786
786
  throw new Error("digestInto() expects output buffer of length at least " + s);
@@ -808,7 +808,7 @@ function Es(e) {
808
808
  return new Uint8Array(new TextEncoder().encode(e));
809
809
  }
810
810
  function ot(e) {
811
- return typeof e == "string" && (e = Es(e)), $(e), e;
811
+ return typeof e == "string" && (e = Es(e)), _(e), e;
812
812
  }
813
813
  class Ss {
814
814
  }
@@ -816,16 +816,16 @@ function Rs(e) {
816
816
  const t = (n) => e().update(ot(n)).digest(), s = e();
817
817
  return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
818
818
  }
819
- const Ts = BigInt(0), x = BigInt(1), As = BigInt(2), vs = BigInt(7), Ps = BigInt(256), Is = BigInt(113), it = [], at = [], ct = [];
820
- for (let e = 0, t = x, s = 1, n = 0; e < 24; e++) {
819
+ const Ts = BigInt(0), k = BigInt(1), As = BigInt(2), vs = BigInt(7), Ps = BigInt(256), Is = BigInt(113), it = [], at = [], ct = [];
820
+ for (let e = 0, t = k, s = 1, n = 0; e < 24; e++) {
821
821
  [s, n] = [n, (2 * s + 3 * n) % 5], it.push(2 * (5 * n + s)), at.push((e + 1) * (e + 2) / 2 % 64);
822
822
  let r = Ts;
823
823
  for (let i = 0; i < 7; i++)
824
- t = (t << x ^ (t >> vs) * Is) % Ps, t & As && (r ^= x << (x << /* @__PURE__ */ BigInt(i)) - x);
824
+ t = (t << k ^ (t >> vs) * Is) % Ps, t & As && (r ^= k << (k << /* @__PURE__ */ BigInt(i)) - k);
825
825
  ct.push(r);
826
826
  }
827
827
  const ut = us(ct, !0), Us = ut[0], Cs = ut[1], Ie = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s), Ue = (e, t, s) => s > 32 ? ds(e, t, s) : fs(e, t, s);
828
- function xs(e, t = 24) {
828
+ function ks(e, t = 24) {
829
829
  const s = new Uint32Array(10);
830
830
  for (let n = 24 - t; n < 24; n++) {
831
831
  for (let o = 0; o < 10; o++)
@@ -861,10 +861,10 @@ class ce extends Ss {
861
861
  return this._cloneInto();
862
862
  }
863
863
  keccak() {
864
- Pe(this.state32), xs(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
864
+ Pe(this.state32), ks(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
865
865
  }
866
866
  update(t) {
867
- ve(this), t = ot(t), $(t);
867
+ ve(this), t = ot(t), _(t);
868
868
  const { blockLen: s, state: n } = this, r = t.length;
869
869
  for (let i = 0; i < r; ) {
870
870
  const o = Math.min(s - this.pos, r - i);
@@ -882,7 +882,7 @@ class ce extends Ss {
882
882
  t[n] ^= s, (s & 128) !== 0 && n === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
883
883
  }
884
884
  writeInto(t) {
885
- ve(this, !1), $(t), this.finish();
885
+ ve(this, !1), _(t), this.finish();
886
886
  const s = this.state, { blockLen: n } = this;
887
887
  for (let r = 0, i = t.length; r < i; ) {
888
888
  this.posOut >= n && this.keccak();
@@ -915,7 +915,7 @@ class ce extends Ss {
915
915
  return t || (t = new ce(s, n, r, o, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = n, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
916
916
  }
917
917
  }
918
- const ks = (e, t, s) => Rs(() => new ce(t, e, s)), Ds = ks(1, 136, 256 / 8);
918
+ const xs = (e, t, s) => Rs(() => new ce(t, e, s)), Ds = xs(1, 136, 256 / 8);
919
919
  function Os(e, t) {
920
920
  return Ds(ie(e, { strict: !1 }) ? os(e) : e);
921
921
  }
@@ -974,7 +974,7 @@ function Bs(e, t) {
974
974
  const r = Ms.test(e) ? e.toLowerCase() === e ? !0 : s ? ft(e) === e : !0 : !1;
975
975
  return V.set(n, r), r;
976
976
  }
977
- const _s = {
977
+ const $s = {
978
978
  chainId: He.chainId,
979
979
  address: T("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
980
980
  symbol: "USDC",
@@ -982,7 +982,7 @@ const _s = {
982
982
  decimals: 6,
983
983
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
984
984
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
985
- }, $s = {
985
+ }, _s = {
986
986
  chainId: Fe.chainId,
987
987
  address: T("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
988
988
  symbol: "USDC",
@@ -1054,7 +1054,7 @@ const _s = {
1054
1054
  ARBITRUM_MAINNET: {
1055
1055
  ...Fe,
1056
1056
  tokens: {
1057
- [S.USDC]: $s
1057
+ [S.USDC]: _s
1058
1058
  },
1059
1059
  explorer: "https://arbiscan.io"
1060
1060
  },
@@ -1062,7 +1062,7 @@ const _s = {
1062
1062
  ...He,
1063
1063
  explorer: "https://sepolia.arbiscan.io",
1064
1064
  tokens: {
1065
- [S.USDC]: _s
1065
+ [S.USDC]: $s
1066
1066
  }
1067
1067
  },
1068
1068
  AVALANCHE_MAINNET: {
@@ -1381,7 +1381,7 @@ function Un(e) {
1381
1381
  function nn(e) {
1382
1382
  return BigInt(e).toString();
1383
1383
  }
1384
- const rn = Symbol(), le = Symbol(), k = "a", pt = "f", xe = "p", gt = "c", mt = "t", fe = "h", D = "w", he = "o", de = "k";
1384
+ const rn = Symbol(), le = Symbol(), x = "a", pt = "f", ke = "p", gt = "c", mt = "t", fe = "h", D = "w", he = "o", de = "k";
1385
1385
  let on = (e, t) => new Proxy(e, t);
1386
1386
  const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (se.has(e) ? se.get(e) : te(e) === Object.prototype || te(e) === Array.prototype), L = (e) => typeof e == "object" && e !== null, an = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), cn = (e) => {
1387
1387
  if (Array.isArray(e))
@@ -1397,8 +1397,8 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1397
1397
  let n = !1;
1398
1398
  const r = (a, c) => {
1399
1399
  if (!n) {
1400
- let u = s[k].get(e);
1401
- if (u || (u = {}, s[k].set(e, u)), a === D)
1400
+ let u = s[x].get(e);
1401
+ if (u || (u = {}, s[x].set(e, u)), a === D)
1402
1402
  u[D] = !0;
1403
1403
  else {
1404
1404
  let f = u[a];
@@ -1406,10 +1406,10 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1406
1406
  }
1407
1407
  }
1408
1408
  }, i = () => {
1409
- n = !0, s[k].delete(e);
1409
+ n = !0, s[x].delete(e);
1410
1410
  }, o = {
1411
1411
  get(a, c) {
1412
- return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[k], s[gt], s[mt]));
1412
+ return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[x], s[gt], s[mt]));
1413
1413
  },
1414
1414
  has(a, c) {
1415
1415
  return c === rn ? (i(), !0) : (r(fe, c), Reflect.has(a, c));
@@ -1436,7 +1436,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1436
1436
  }
1437
1437
  const [i, o] = r;
1438
1438
  let a = s && s.get(i);
1439
- return (!a || a[1][pt] !== !!o) && (a = un(i, !!o), a[1][xe] = on(o || i, a[0]), s && s.set(i, a)), a[1][k] = t, a[1][gt] = s, a[1][mt] = n, a[1][xe];
1439
+ return (!a || a[1][pt] !== !!o) && (a = un(i, !!o), a[1][ke] = on(o || i, a[0]), s && s.set(i, a)), a[1][x] = t, a[1][gt] = s, a[1][mt] = n, a[1][ke];
1440
1440
  }, ln = (e, t) => {
1441
1441
  const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
1442
1442
  return s.length !== n.length || s.some((r, i) => r !== n[i]);
@@ -1472,7 +1472,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1472
1472
  if (o === null)
1473
1473
  throw new Error("invalid used");
1474
1474
  return o;
1475
- }, fn = (e) => yt(e) && e[le] || null, ke = (e, t = !0) => {
1475
+ }, fn = (e) => yt(e) && e[le] || null, xe = (e, t = !0) => {
1476
1476
  se.set(e, t);
1477
1477
  }, hn = (e, t, s) => {
1478
1478
  const n = [], r = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
@@ -1504,7 +1504,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1504
1504
  if (s?.[0] === t)
1505
1505
  return s[1];
1506
1506
  const n = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
1507
- return ke(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
1507
+ return xe(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
1508
1508
  if (Object.getOwnPropertyDescriptor(n, r))
1509
1509
  return;
1510
1510
  const i = Reflect.get(e, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
@@ -1518,7 +1518,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1518
1518
  configurable: !0
1519
1519
  };
1520
1520
  if (me.has(i))
1521
- ke(i, !1);
1521
+ xe(i, !1);
1522
1522
  else if (U.has(i)) {
1523
1523
  const [c, u] = U.get(
1524
1524
  i
@@ -1702,7 +1702,8 @@ function Cn({
1702
1702
  })
1703
1703
  }).then((l) => l.json()).then((l) => {
1704
1704
  A < f || (P.data = l, h.config({
1705
- api_key: l.sessionToken
1705
+ api_key: l.sessionToken,
1706
+ env: e === "https://chainrails-sdk-server.vercel.app/test/create-session" ? "internal" : "production"
1706
1707
  }), P.isPending = !1, y(A));
1707
1708
  }).catch((l) => {
1708
1709
  A < f || (P.error = l?.toString(), P.isPending = !1, y(A));
@@ -50,7 +50,7 @@ const be = (() => {
50
50
  throw r;
51
51
  }
52
52
  return e && !t;
53
- })(), Ut = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", xt = typeof globalThis.FormData == "function", _e = ["get", "post", "put", "patch", "head", "delete"], kt = {
53
+ })(), Ut = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", kt = typeof globalThis.FormData == "function", $e = ["get", "post", "put", "patch", "head", "delete"], xt = {
54
54
  json: "application/json",
55
55
  text: "text/*",
56
56
  formData: "multipart/form-data",
@@ -59,7 +59,7 @@ const be = (() => {
59
59
  // Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).
60
60
  // We still feature-check at runtime before exposing the shortcut.
61
61
  bytes: "*/*"
62
- }, H = 2147483647, Dt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, $e = Symbol("stop");
62
+ }, H = 2147483647, Dt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, _e = Symbol("stop");
63
63
  class Le {
64
64
  options;
65
65
  constructor(t) {
@@ -98,7 +98,7 @@ const Ot = (e) => new Le(e), Nt = {
98
98
  signal: !0,
99
99
  window: !0,
100
100
  duplex: !0
101
- }, _t = (e) => {
101
+ }, $t = (e) => {
102
102
  if (!e)
103
103
  return 0;
104
104
  if (e instanceof FormData) {
@@ -140,7 +140,7 @@ const Ot = (e) => new Le(e), Nt = {
140
140
  n && (r += n.byteLength, s?.({ percent: 1, totalBytes: Math.max(t, r), transferredBytes: r }, n));
141
141
  }
142
142
  }));
143
- }, $t = (e, t) => {
143
+ }, _t = (e, t) => {
144
144
  if (!e.body)
145
145
  return e;
146
146
  if (e.status === 204)
@@ -158,7 +158,7 @@ const Ot = (e) => new Le(e), Nt = {
158
158
  }, Lt = (e, t, s) => {
159
159
  if (!e.body)
160
160
  return e;
161
- const n = _t(s ?? e.body);
161
+ const n = $t(s ?? e.body);
162
162
  return new Request(e, {
163
163
  // @ts-expect-error - Types are outdated.
164
164
  duplex: "half",
@@ -235,7 +235,7 @@ const qe = (e = {}, t = {}) => ({
235
235
  I(o.hooks) && (n = qe(n, o.hooks), t.hooks = n), I(o.headers) && (s = je(s, o.headers), t.headers = s);
236
236
  }
237
237
  return r !== void 0 && (t.searchParams = r), i.length > 0 && (i.length === 1 ? t.signal = i[0] : Be ? t.signal = AbortSignal.any(i) : t.signal = i.at(-1)), t.context === void 0 && (t.context = {}), t;
238
- }, jt = (e) => _e.includes(e) ? e.toUpperCase() : e, qt = ["get", "put", "head", "delete", "options", "trace"], Ft = [408, 413, 429, 500, 502, 503, 504], Ht = [413, 429, 503], Ee = {
238
+ }, jt = (e) => $e.includes(e) ? e.toUpperCase() : e, qt = ["get", "put", "head", "delete", "options", "trace"], Ft = [408, 413, 429, 500, 502, 503, 504], Ht = [413, 429, 503], Ee = {
239
239
  limit: 2,
240
240
  methods: qt,
241
241
  statusCodes: Ft,
@@ -325,14 +325,14 @@ class O {
325
325
  throw new TypeError("The `onDownloadProgress` option must be a function");
326
326
  if (!Ct)
327
327
  throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
328
- return $t(o.clone(), n.#e.onDownloadProgress);
328
+ return _t(o.clone(), n.#e.onDownloadProgress);
329
329
  }
330
330
  return o;
331
331
  }, i = n.#f(r).finally(async () => {
332
332
  const o = n.#o, a = [];
333
333
  o && !o.bodyUsed && a.push(o.body?.cancel()), n.request.bodyUsed || a.push(n.request.body?.cancel()), await Promise.all(a);
334
334
  });
335
- for (const [o, a] of Object.entries(kt))
335
+ for (const [o, a] of Object.entries(xt))
336
336
  o === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[o] = async () => {
337
337
  n.request.headers.set("accept", n.request.headers.get("accept") || a);
338
338
  const c = await i;
@@ -387,7 +387,7 @@ class O {
387
387
  }
388
388
  Ut && Be && (this.#r = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal), be && (this.#e.duplex = "half"), this.#e.json !== void 0 && (this.#e.body = this.#e.stringifyJson?.(this.#e.json) ?? JSON.stringify(this.#e.json), this.#e.headers.set("content-type", this.#e.headers.get("content-type") ?? "application/json"));
389
389
  const n = s.headers && new globalThis.Headers(s.headers).has("content-type");
390
- if (this.#t instanceof globalThis.Request && (xt && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Xt(this.#e.searchParams)) {
390
+ if (this.#t instanceof globalThis.Request && (kt && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Xt(this.#e.searchParams)) {
391
391
  const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(O.#d(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
392
392
  this.request = new globalThis.Request(o, this.#e);
393
393
  }
@@ -463,7 +463,7 @@ class O {
463
463
  }
464
464
  if (i instanceof globalThis.Response)
465
465
  return i;
466
- if (i === $e)
466
+ if (i === _e)
467
467
  return;
468
468
  }
469
469
  return this.#f(t);
@@ -500,9 +500,9 @@ class O {
500
500
  /*! MIT License © Sindre Sorhus */
501
501
  const Z = (e) => {
502
502
  const t = (s, n) => O.create(s, M(e, n));
503
- for (const s of _e)
503
+ for (const s of $e)
504
504
  t[s] = (n, r) => O.create(n, M(e, r, { method: s }));
505
- return t.create = (s) => Z(M(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Z(M(e, s))), t.stop = $e, t.retry = Ot, t;
505
+ return t.create = (s) => Z(M(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Z(M(e, s))), t.stop = _e, t.retry = Ot, t;
506
506
  }, Zt = Z();
507
507
  var S = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(S || {});
508
508
  const Fe = {
@@ -745,9 +745,9 @@ function nt(e, t = {}) {
745
745
  const s = rs.encode(e);
746
746
  return typeof t.size == "number" ? (ae(s, { size: t.size }), q(s, { dir: "right", size: t.size })) : s;
747
747
  }
748
- const _ = /* @__PURE__ */ BigInt(2 ** 32 - 1), Te = /* @__PURE__ */ BigInt(32);
748
+ const $ = /* @__PURE__ */ BigInt(2 ** 32 - 1), Te = /* @__PURE__ */ BigInt(32);
749
749
  function cs(e, t = !1) {
750
- return t ? { h: Number(e & _), l: Number(e >> Te & _) } : { h: Number(e >> Te & _) | 0, l: Number(e & _) | 0 };
750
+ return t ? { h: Number(e & $), l: Number(e >> Te & $) } : { h: Number(e >> Te & $) | 0, l: Number(e & $) | 0 };
751
751
  }
752
752
  function us(e, t = !1) {
753
753
  const s = e.length;
@@ -767,7 +767,7 @@ function Ae(e) {
767
767
  if (!Number.isSafeInteger(e) || e < 0)
768
768
  throw new Error("positive integer expected, got " + e);
769
769
  }
770
- function $(e, ...t) {
770
+ function _(e, ...t) {
771
771
  if (!ps(e))
772
772
  throw new Error("Uint8Array expected");
773
773
  if (t.length > 0 && !t.includes(e.length))
@@ -780,7 +780,7 @@ function ve(e, t = !0) {
780
780
  throw new Error("Hash#digest() has already been called");
781
781
  }
782
782
  function gs(e, t) {
783
- $(e);
783
+ _(e);
784
784
  const s = t.outputLen;
785
785
  if (e.length < s)
786
786
  throw new Error("digestInto() expects output buffer of length at least " + s);
@@ -808,7 +808,7 @@ function Es(e) {
808
808
  return new Uint8Array(new TextEncoder().encode(e));
809
809
  }
810
810
  function ot(e) {
811
- return typeof e == "string" && (e = Es(e)), $(e), e;
811
+ return typeof e == "string" && (e = Es(e)), _(e), e;
812
812
  }
813
813
  class Ss {
814
814
  }
@@ -816,16 +816,16 @@ function Rs(e) {
816
816
  const t = (n) => e().update(ot(n)).digest(), s = e();
817
817
  return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
818
818
  }
819
- const Ts = BigInt(0), x = BigInt(1), As = BigInt(2), vs = BigInt(7), Ps = BigInt(256), Is = BigInt(113), it = [], at = [], ct = [];
820
- for (let e = 0, t = x, s = 1, n = 0; e < 24; e++) {
819
+ const Ts = BigInt(0), k = BigInt(1), As = BigInt(2), vs = BigInt(7), Ps = BigInt(256), Is = BigInt(113), it = [], at = [], ct = [];
820
+ for (let e = 0, t = k, s = 1, n = 0; e < 24; e++) {
821
821
  [s, n] = [n, (2 * s + 3 * n) % 5], it.push(2 * (5 * n + s)), at.push((e + 1) * (e + 2) / 2 % 64);
822
822
  let r = Ts;
823
823
  for (let i = 0; i < 7; i++)
824
- t = (t << x ^ (t >> vs) * Is) % Ps, t & As && (r ^= x << (x << /* @__PURE__ */ BigInt(i)) - x);
824
+ t = (t << k ^ (t >> vs) * Is) % Ps, t & As && (r ^= k << (k << /* @__PURE__ */ BigInt(i)) - k);
825
825
  ct.push(r);
826
826
  }
827
827
  const ut = us(ct, !0), Us = ut[0], Cs = ut[1], Ie = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s), Ue = (e, t, s) => s > 32 ? ds(e, t, s) : fs(e, t, s);
828
- function xs(e, t = 24) {
828
+ function ks(e, t = 24) {
829
829
  const s = new Uint32Array(10);
830
830
  for (let n = 24 - t; n < 24; n++) {
831
831
  for (let o = 0; o < 10; o++)
@@ -861,10 +861,10 @@ class ce extends Ss {
861
861
  return this._cloneInto();
862
862
  }
863
863
  keccak() {
864
- Pe(this.state32), xs(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
864
+ Pe(this.state32), ks(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
865
865
  }
866
866
  update(t) {
867
- ve(this), t = ot(t), $(t);
867
+ ve(this), t = ot(t), _(t);
868
868
  const { blockLen: s, state: n } = this, r = t.length;
869
869
  for (let i = 0; i < r; ) {
870
870
  const o = Math.min(s - this.pos, r - i);
@@ -882,7 +882,7 @@ class ce extends Ss {
882
882
  t[n] ^= s, (s & 128) !== 0 && n === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
883
883
  }
884
884
  writeInto(t) {
885
- ve(this, !1), $(t), this.finish();
885
+ ve(this, !1), _(t), this.finish();
886
886
  const s = this.state, { blockLen: n } = this;
887
887
  for (let r = 0, i = t.length; r < i; ) {
888
888
  this.posOut >= n && this.keccak();
@@ -915,7 +915,7 @@ class ce extends Ss {
915
915
  return t || (t = new ce(s, n, r, o, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = n, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
916
916
  }
917
917
  }
918
- const ks = (e, t, s) => Rs(() => new ce(t, e, s)), Ds = ks(1, 136, 256 / 8);
918
+ const xs = (e, t, s) => Rs(() => new ce(t, e, s)), Ds = xs(1, 136, 256 / 8);
919
919
  function Os(e, t) {
920
920
  return Ds(ie(e, { strict: !1 }) ? os(e) : e);
921
921
  }
@@ -974,7 +974,7 @@ function Bs(e, t) {
974
974
  const r = Ms.test(e) ? e.toLowerCase() === e ? !0 : s ? ft(e) === e : !0 : !1;
975
975
  return V.set(n, r), r;
976
976
  }
977
- const _s = {
977
+ const $s = {
978
978
  chainId: He.chainId,
979
979
  address: T("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
980
980
  symbol: "USDC",
@@ -982,7 +982,7 @@ const _s = {
982
982
  decimals: 6,
983
983
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
984
984
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
985
- }, $s = {
985
+ }, _s = {
986
986
  chainId: Fe.chainId,
987
987
  address: T("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
988
988
  symbol: "USDC",
@@ -1054,7 +1054,7 @@ const _s = {
1054
1054
  ARBITRUM_MAINNET: {
1055
1055
  ...Fe,
1056
1056
  tokens: {
1057
- [S.USDC]: $s
1057
+ [S.USDC]: _s
1058
1058
  },
1059
1059
  explorer: "https://arbiscan.io"
1060
1060
  },
@@ -1062,7 +1062,7 @@ const _s = {
1062
1062
  ...He,
1063
1063
  explorer: "https://sepolia.arbiscan.io",
1064
1064
  tokens: {
1065
- [S.USDC]: _s
1065
+ [S.USDC]: $s
1066
1066
  }
1067
1067
  },
1068
1068
  AVALANCHE_MAINNET: {
@@ -1381,7 +1381,7 @@ function Un(e) {
1381
1381
  function nn(e) {
1382
1382
  return BigInt(e).toString();
1383
1383
  }
1384
- const rn = Symbol(), le = Symbol(), k = "a", pt = "f", xe = "p", gt = "c", mt = "t", fe = "h", D = "w", he = "o", de = "k";
1384
+ const rn = Symbol(), le = Symbol(), x = "a", pt = "f", ke = "p", gt = "c", mt = "t", fe = "h", D = "w", he = "o", de = "k";
1385
1385
  let on = (e, t) => new Proxy(e, t);
1386
1386
  const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (se.has(e) ? se.get(e) : te(e) === Object.prototype || te(e) === Array.prototype), L = (e) => typeof e == "object" && e !== null, an = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), cn = (e) => {
1387
1387
  if (Array.isArray(e))
@@ -1397,8 +1397,8 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1397
1397
  let n = !1;
1398
1398
  const r = (a, c) => {
1399
1399
  if (!n) {
1400
- let u = s[k].get(e);
1401
- if (u || (u = {}, s[k].set(e, u)), a === D)
1400
+ let u = s[x].get(e);
1401
+ if (u || (u = {}, s[x].set(e, u)), a === D)
1402
1402
  u[D] = !0;
1403
1403
  else {
1404
1404
  let f = u[a];
@@ -1406,10 +1406,10 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1406
1406
  }
1407
1407
  }
1408
1408
  }, i = () => {
1409
- n = !0, s[k].delete(e);
1409
+ n = !0, s[x].delete(e);
1410
1410
  }, o = {
1411
1411
  get(a, c) {
1412
- return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[k], s[gt], s[mt]));
1412
+ return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[x], s[gt], s[mt]));
1413
1413
  },
1414
1414
  has(a, c) {
1415
1415
  return c === rn ? (i(), !0) : (r(fe, c), Reflect.has(a, c));
@@ -1436,7 +1436,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1436
1436
  }
1437
1437
  const [i, o] = r;
1438
1438
  let a = s && s.get(i);
1439
- return (!a || a[1][pt] !== !!o) && (a = un(i, !!o), a[1][xe] = on(o || i, a[0]), s && s.set(i, a)), a[1][k] = t, a[1][gt] = s, a[1][mt] = n, a[1][xe];
1439
+ return (!a || a[1][pt] !== !!o) && (a = un(i, !!o), a[1][ke] = on(o || i, a[0]), s && s.set(i, a)), a[1][x] = t, a[1][gt] = s, a[1][mt] = n, a[1][ke];
1440
1440
  }, ln = (e, t) => {
1441
1441
  const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
1442
1442
  return s.length !== n.length || s.some((r, i) => r !== n[i]);
@@ -1472,7 +1472,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1472
1472
  if (o === null)
1473
1473
  throw new Error("invalid used");
1474
1474
  return o;
1475
- }, fn = (e) => yt(e) && e[le] || null, ke = (e, t = !0) => {
1475
+ }, fn = (e) => yt(e) && e[le] || null, xe = (e, t = !0) => {
1476
1476
  se.set(e, t);
1477
1477
  }, hn = (e, t, s) => {
1478
1478
  const n = [], r = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
@@ -1504,7 +1504,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1504
1504
  if (s?.[0] === t)
1505
1505
  return s[1];
1506
1506
  const n = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
1507
- return ke(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
1507
+ return xe(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
1508
1508
  if (Object.getOwnPropertyDescriptor(n, r))
1509
1509
  return;
1510
1510
  const i = Reflect.get(e, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
@@ -1518,7 +1518,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
1518
1518
  configurable: !0
1519
1519
  };
1520
1520
  if (me.has(i))
1521
- ke(i, !1);
1521
+ xe(i, !1);
1522
1522
  else if (U.has(i)) {
1523
1523
  const [c, u] = U.get(
1524
1524
  i
@@ -1702,7 +1702,8 @@ function Cn({
1702
1702
  })
1703
1703
  }).then((l) => l.json()).then((l) => {
1704
1704
  A < f || (P.data = l, h.config({
1705
- api_key: l.sessionToken
1705
+ api_key: l.sessionToken,
1706
+ env: e === "https://chainrails-sdk-server.vercel.app/test/create-session" ? "internal" : "production"
1706
1707
  }), P.isPending = !1, y(A));
1707
1708
  }).catch((l) => {
1708
1709
  A < f || (P.error = l?.toString(), P.isPending = !1, y(A));