@chainrails/sdk 0.2.5 → 0.2.7

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.
@@ -202,7 +202,7 @@ function De(t, e = {}) {
202
202
  const s = new Uint8Array(1);
203
203
  return s[0] = Number(t), typeof e.size == "number" ? (O(s, { size: e.size }), E(s, { size: e.size })) : s;
204
204
  }
205
- const d = {
205
+ const p = {
206
206
  zero: 48,
207
207
  nine: 57,
208
208
  A: 65,
@@ -211,12 +211,12 @@ const d = {
211
211
  f: 102
212
212
  };
213
213
  function L(t) {
214
- if (t >= d.zero && t <= d.nine)
215
- return t - d.zero;
216
- if (t >= d.A && t <= d.F)
217
- return t - (d.A - 10);
218
- if (t >= d.a && t <= d.f)
219
- return t - (d.a - 10);
214
+ if (t >= p.zero && t <= p.nine)
215
+ return t - p.zero;
216
+ if (t >= p.A && t <= p.F)
217
+ return t - (p.A - 10);
218
+ if (t >= p.a && t <= p.f)
219
+ return t - (p.a - 10);
220
220
  }
221
221
  function ae(t, e = {}) {
222
222
  let s = t;
@@ -268,7 +268,7 @@ function w(t, ...e) {
268
268
  if (e.length > 0 && !e.includes(t.length))
269
269
  throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
270
270
  }
271
- function q(t, e = !0) {
271
+ function K(t, e = !0) {
272
272
  if (t.destroyed)
273
273
  throw new Error("Hash instance has been destroyed");
274
274
  if (e && t.finished)
@@ -296,7 +296,7 @@ function _e(t) {
296
296
  t[e] = Le(t[e]);
297
297
  return t;
298
298
  }
299
- const K = Fe ? (t) => t : _e;
299
+ const q = Fe ? (t) => t : _e;
300
300
  function He(t) {
301
301
  if (typeof t != "string")
302
302
  throw new Error("string expected");
@@ -305,21 +305,21 @@ function He(t) {
305
305
  function le(t) {
306
306
  return typeof t == "string" && (t = He(t)), w(t), t;
307
307
  }
308
- class qe {
308
+ class Ke {
309
309
  }
310
- function Ke(t) {
310
+ function qe(t) {
311
311
  const e = (n) => t().update(le(n)).digest(), s = t();
312
312
  return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
313
313
  }
314
- const Ve = BigInt(0), y = BigInt(1), Xe = BigInt(2), Ge = BigInt(7), Qe = BigInt(256), We = BigInt(113), he = [], de = [], pe = [];
314
+ const Ve = BigInt(0), y = BigInt(1), Xe = BigInt(2), Ge = BigInt(7), Qe = BigInt(256), We = BigInt(113), he = [], pe = [], de = [];
315
315
  for (let t = 0, e = y, s = 1, n = 0; t < 24; t++) {
316
- [s, n] = [n, (2 * s + 3 * n) % 5], he.push(2 * (5 * n + s)), de.push((t + 1) * (t + 2) / 2 % 64);
316
+ [s, n] = [n, (2 * s + 3 * n) % 5], he.push(2 * (5 * n + s)), pe.push((t + 1) * (t + 2) / 2 % 64);
317
317
  let i = Ve;
318
318
  for (let r = 0; r < 7; r++)
319
319
  e = (e << y ^ (e >> Ge) * We) % Qe, e & Xe && (i ^= y << (y << /* @__PURE__ */ BigInt(r)) - y);
320
- pe.push(i);
320
+ de.push(i);
321
321
  }
322
- const ge = ke(pe, !0), Je = ge[0], Ye = ge[1], V = (t, e, s) => s > 32 ? $e(t, e, s) : Be(t, e, s), X = (t, e, s) => s > 32 ? Me(t, e, s) : ze(t, e, s);
322
+ const ge = ke(de, !0), Je = ge[0], Ye = ge[1], V = (t, e, s) => s > 32 ? $e(t, e, s) : Be(t, e, s), X = (t, e, s) => s > 32 ? Me(t, e, s) : ze(t, e, s);
323
323
  function Ze(t, e = 24) {
324
324
  const s = new Uint32Array(10);
325
325
  for (let n = 24 - e; n < 24; n++) {
@@ -332,7 +332,7 @@ function Ze(t, e = 24) {
332
332
  }
333
333
  let i = t[2], r = t[3];
334
334
  for (let o = 0; o < 24; o++) {
335
- const a = de[o], l = V(i, r, a), f = X(i, r, a), m = he[o];
335
+ const a = pe[o], l = V(i, r, a), f = X(i, r, a), m = he[o];
336
336
  i = t[m], r = t[m + 1], t[m] = l, t[m + 1] = f;
337
337
  }
338
338
  for (let o = 0; o < 50; o += 10) {
@@ -345,7 +345,7 @@ function Ze(t, e = 24) {
345
345
  }
346
346
  ue(s);
347
347
  }
348
- class P extends qe {
348
+ class P extends Ke {
349
349
  // NOTE: we accept arguments in bytes instead of bits here.
350
350
  constructor(e, s, n, i = !1, r = 24) {
351
351
  if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = s, this.outputLen = n, this.enableXOF = i, this.rounds = r, H(n), !(0 < e && e < 200))
@@ -356,10 +356,10 @@ class P extends qe {
356
356
  return this._cloneInto();
357
357
  }
358
358
  keccak() {
359
- K(this.state32), Ze(this.state32, this.rounds), K(this.state32), this.posOut = 0, this.pos = 0;
359
+ q(this.state32), Ze(this.state32, this.rounds), q(this.state32), this.posOut = 0, this.pos = 0;
360
360
  }
361
361
  update(e) {
362
- q(this), e = le(e), w(e);
362
+ K(this), e = le(e), w(e);
363
363
  const { blockLen: s, state: n } = this, i = e.length;
364
364
  for (let r = 0; r < i; ) {
365
365
  const o = Math.min(s - this.pos, i - r);
@@ -377,7 +377,7 @@ class P extends qe {
377
377
  e[n] ^= s, (s & 128) !== 0 && n === i - 1 && this.keccak(), e[i - 1] ^= 128, this.keccak();
378
378
  }
379
379
  writeInto(e) {
380
- q(this, !1), w(e), this.finish();
380
+ K(this, !1), w(e), this.finish();
381
381
  const s = this.state, { blockLen: n } = this;
382
382
  for (let i = 0, r = e.length; i < r; ) {
383
383
  this.posOut >= n && this.keccak();
@@ -410,7 +410,7 @@ class P extends qe {
410
410
  return e || (e = new P(s, n, i, o, r)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = n, e.outputLen = i, e.enableXOF = o, e.destroyed = this.destroyed, e;
411
411
  }
412
412
  }
413
- const et = (t, e, s) => Ke(() => new P(e, t, s)), tt = et(1, 136, 256 / 8);
413
+ const et = (t, e, s) => qe(() => new P(e, t, s)), tt = et(1, 136, 256 / 8);
414
414
  function st(t, e) {
415
415
  return tt(j(t, { strict: !1 }) ? Ne(t) : t);
416
416
  }
@@ -456,7 +456,7 @@ function me(t, e) {
456
456
  const r = `0x${i.join("")}`;
457
457
  return A.set(`${t}.${e}`, r), r;
458
458
  }
459
- function p(t, e) {
459
+ function d(t, e) {
460
460
  if (!ot(t, { strict: !1 }))
461
461
  throw new nt({ address: t });
462
462
  return me(t, e);
@@ -471,7 +471,7 @@ function ot(t, e) {
471
471
  }
472
472
  const v = {
473
473
  chainId: Q.chainId,
474
- address: p("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
474
+ address: d("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
475
475
  symbol: "USDC",
476
476
  fiatISO: "USD",
477
477
  decimals: 6,
@@ -479,7 +479,7 @@ const v = {
479
479
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
480
480
  }, C = {
481
481
  chainId: G.chainId,
482
- address: p("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
482
+ address: d("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
483
483
  symbol: "USDC",
484
484
  name: "USD Coin",
485
485
  decimals: 6,
@@ -487,7 +487,7 @@ const v = {
487
487
  /* USDC */
488
488
  }, T = {
489
489
  chainId: se.chainId,
490
- address: p("0x5425890298aed601595a70ab815c96711a31bc65"),
490
+ address: d("0x5425890298aed601595a70ab815c96711a31bc65"),
491
491
  symbol: "USDC",
492
492
  fiatISO: "USD",
493
493
  decimals: 6,
@@ -495,7 +495,7 @@ const v = {
495
495
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
496
496
  }, N = {
497
497
  chainId: te.chainId,
498
- address: p("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
498
+ address: d("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
499
499
  symbol: "USDC",
500
500
  fiatISO: "USD",
501
501
  decimals: 6,
@@ -503,7 +503,7 @@ const v = {
503
503
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
504
504
  }, D = {
505
505
  chainId: J.chainId,
506
- address: p("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
506
+ address: d("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
507
507
  symbol: "USDC",
508
508
  fiatISO: "USD",
509
509
  decimals: 6,
@@ -511,7 +511,7 @@ const v = {
511
511
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
512
512
  }, x = {
513
513
  chainId: W.chainId,
514
- address: p("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
514
+ address: d("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
515
515
  symbol: "USDC",
516
516
  fiatISO: "USD",
517
517
  decimals: 6,
@@ -519,21 +519,21 @@ const v = {
519
519
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
520
520
  }, R = {
521
521
  chainId: Y.chainId,
522
- address: p("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
522
+ address: d("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
523
523
  symbol: "USDC",
524
524
  decimals: 18,
525
525
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
526
526
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
527
527
  }, k = {
528
528
  chainId: ee.chainId,
529
- address: p("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
529
+ address: d("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
530
530
  symbol: "USDC",
531
531
  decimals: 6,
532
532
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
533
533
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
534
534
  }, B = {
535
535
  chainId: Z.chainId,
536
- address: p("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
536
+ address: d("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
537
537
  symbol: "USDC",
538
538
  decimals: 6,
539
539
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
@@ -640,37 +640,42 @@ function ut(t, e) {
640
640
  return ct(t)?.tokens[e]?.address;
641
641
  }
642
642
  var Ie = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(Ie || {});
643
- class u {
644
- constructor({ api_key: e, env: s, seesion_token: n }) {
645
- this.api_key = e || "", this.sessionToken = n || "", this.env = s ?? Ie.PRODUCTION;
643
+ class c {
644
+ constructor({ api_key: e, env: s, seesion_token: n, props: i }) {
645
+ this.api_key = e || "", this.sessionToken = n || "", this.env = s ?? Ie.PRODUCTION, this.props = i;
646
646
  }
647
647
  static async config(e) {
648
- if (!u.app) {
648
+ if (!c.app) {
649
649
  if (!e)
650
650
  throw new Error("Please provide an api_key");
651
- u.app = new u(e);
651
+ c.app = new c(e);
652
652
  }
653
- return e && (e.api_key !== void 0 && (u.app.api_key = e.api_key), e.seesion_token !== void 0 && (u.app.sessionToken = e.seesion_token), e.env !== void 0 && (u.app.env = e.env)), u.app;
653
+ return e && (e.api_key !== void 0 && (c.app.api_key = e.api_key), e.seesion_token !== void 0 && (c.app.sessionToken = e.seesion_token), e.env !== void 0 && (c.app.env = e.env), e.props !== void 0 && (c.app.props = e.props)), c.app;
654
654
  }
655
655
  static getApiKey() {
656
- if (!u.app)
656
+ if (!c.app)
657
657
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
658
- return u.app.api_key;
658
+ return c.app.api_key;
659
659
  }
660
660
  static getSessionToken() {
661
- if (!u.app)
661
+ if (!c.app)
662
662
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
663
- return u.app.sessionToken;
663
+ return c.app.sessionToken;
664
+ }
665
+ static getProps() {
666
+ if (!c.app)
667
+ throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
668
+ return c.app.props;
664
669
  }
665
670
  static getEnv() {
666
- if (!u.app)
671
+ if (!c.app)
667
672
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
668
- return u.app.env === "internal" ? "staging" : u.app.env;
673
+ return c.app.env === "internal" ? "staging" : c.app.env;
669
674
  }
670
675
  static getBaseUrl() {
671
- if (!u.app)
676
+ if (!c.app)
672
677
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
673
- switch (u.app.env) {
678
+ switch (c.app.env) {
674
679
  case "production":
675
680
  return "https://api.chainrails.io/api/v1";
676
681
  case "staging":
@@ -682,23 +687,23 @@ class u {
682
687
  }
683
688
  }
684
689
  static getPayModalUrl(e) {
685
- if (!u.app)
690
+ if (!c.app)
686
691
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
687
- const s = u.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(e), i = e && !isNaN(Number(e)) && n > 0 ? "/pay/" : "/deposit/", r = `${e && !isNaN(Number(e)) && n > 0 ? n * 100 : ""}`;
692
+ const s = c.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(e), i = e && !isNaN(Number(e)) && n > 0 ? "/pay/" : "/deposit/", r = `${e && !isNaN(Number(e)) && n > 0 ? n * 100 : ""}`;
688
693
  return s + i + r;
689
694
  }
690
695
  }
691
696
  let M = null;
692
697
  function lt() {
693
698
  M = Ee.create({
694
- prefixUrl: u.getBaseUrl(),
699
+ prefixUrl: c.getBaseUrl(),
695
700
  headers: {
696
701
  "Content-Type": "application/json"
697
702
  },
698
703
  hooks: {
699
704
  beforeRequest: [
700
705
  (t) => {
701
- const e = u.getSessionToken() || u.getApiKey();
706
+ const e = c.getSessionToken() || c.getApiKey();
702
707
  t.headers.set("Authorization", `Bearer ${e}`);
703
708
  }
704
709
  ],
@@ -709,83 +714,83 @@ function lt() {
709
714
  }
710
715
  });
711
716
  }
712
- function c() {
717
+ function u() {
713
718
  return M || lt(), M;
714
719
  }
715
720
  class ht {
716
721
  async getById(e) {
717
- return await c().get("intents/" + e).json();
722
+ return await u().get("intents/" + e).json();
718
723
  }
719
724
  async getForSender(e) {
720
- return await c().get("intents/user/" + e).json();
725
+ return await u().get("intents/user/" + e).json();
721
726
  }
722
727
  async getForAddress(e) {
723
- return await c().get("intents/address/" + e).json();
728
+ return await u().get("intents/address/" + e).json();
724
729
  }
725
730
  async getForSession(e) {
726
- return await c().get("modal/sessions/intents/" + e).json();
731
+ return await u().get("modal/sessions/intents/" + e).json();
727
732
  }
728
733
  async getAll(e) {
729
- return await c().get("intents", { searchParams: e }).json();
734
+ return await u().get("intents", { searchParams: e }).json();
730
735
  }
731
736
  async create(e) {
732
- return await c().post("intents", { json: e }).json();
737
+ return await u().post("intents", { json: e }).json();
733
738
  }
734
739
  async createForSession(e) {
735
- return await c().post("modal/sessions/intents", { json: e }).json();
740
+ return await u().post("modal/sessions/intents", { json: e }).json();
736
741
  }
737
742
  async update(e, s) {
738
- return await c().post("intents", { json: s }).json();
743
+ return await u().post("intents", { json: s }).json();
739
744
  }
740
745
  async triggerProcessing(e) {
741
- return await c().post(`intents/${e}/trigger-processing`).json();
746
+ return await u().post(`intents/${e}/trigger-processing`).json();
742
747
  }
743
748
  async triggerProcessingForSession(e) {
744
- return await c().post(`modal/sessions/intents/${e}/process`).json();
749
+ return await u().post(`modal/sessions/intents/${e}/process`).json();
745
750
  }
746
751
  }
747
- class dt {
752
+ class pt {
748
753
  async getFromSpecificBridge(e) {
749
- return await c().get("quotes/single", { searchParams: e }).json();
754
+ return await u().get("quotes/single", { searchParams: e }).json();
750
755
  }
751
756
  async getFromAllBridges(e) {
752
- return await c().get("quotes/multiple", { searchParams: e }).json();
757
+ return await u().get("quotes/multiple", { searchParams: e }).json();
753
758
  }
754
759
  async getBestAcrossBridges(e) {
755
- return await c().get("quotes/best", { searchParams: e }).json();
760
+ return await u().get("quotes/best", { searchParams: e }).json();
756
761
  }
757
762
  async getAll(e) {
758
- return await c().get("quotes/multi-source", { searchParams: e }).json();
763
+ return await u().get("quotes/multi-source", { searchParams: e }).json();
759
764
  }
760
765
  async getAllForSession(e) {
761
- return await c().get("modal/sessions/quotes", { searchParams: e }).json();
766
+ return await u().get("modal/sessions/quotes", { searchParams: e }).json();
762
767
  }
763
768
  }
764
- class pt {
769
+ class dt {
765
770
  async getOptimalRoutes(e) {
766
- return await c().get("router/optimal-route", { searchParams: e }).json();
771
+ return await u().get("router/optimal-route", { searchParams: e }).json();
767
772
  }
768
773
  async getAllSupportedBridges() {
769
- return await c().get("router/supported-bridges/all").json();
774
+ return await u().get("router/supported-bridges/all").json();
770
775
  }
771
776
  async getSupportedBridges(e) {
772
- return await c().get("router/supported-bridges/route", { searchParams: e }).json();
777
+ return await u().get("router/supported-bridges/route", { searchParams: e }).json();
773
778
  }
774
779
  async getSupportedRoutes(e, s) {
775
- return await c().get("router/supported-bridges/bridge/" + e, { searchParams: s }).json();
780
+ return await u().get("router/supported-bridges/bridge/" + e, { searchParams: s }).json();
776
781
  }
777
782
  }
778
783
  class gt {
779
784
  async getSupported(e) {
780
- return await c().get("chains", { searchParams: e }).json();
785
+ return await u().get("chains", { searchParams: e }).json();
781
786
  }
782
787
  }
783
788
  class ft {
784
789
  async getClientInfo() {
785
- return await c().get("client/auth/client-info").json();
790
+ return await u().get("client/auth/client-info").json();
786
791
  }
787
792
  async getClientInfoForSession() {
788
- return await c().get("modal/sessions/client").json();
793
+ return await u().get("modal/sessions/client").json();
789
794
  }
790
795
  }
791
796
  class mt {
@@ -799,19 +804,19 @@ class mt {
799
804
  destinationChain: $[e.destinationChain?.replace("_MAINNET", "")],
800
805
  amount: e.amount
801
806
  };
802
- return c().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
807
+ return u().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
803
808
  }
804
809
  }
805
810
  const bt = {
806
- router: new pt(),
807
- quotes: new dt(),
811
+ router: new dt(),
812
+ quotes: new pt(),
808
813
  intents: new ht(),
809
814
  chains: new gt(),
810
815
  client: new ft(),
811
816
  auth: new mt()
812
817
  };
813
818
  export {
814
- u as Chainrails,
819
+ c as Chainrails,
815
820
  $ as chains,
816
821
  bt as crapi,
817
822
  Ie as environment,
@@ -202,7 +202,7 @@ function De(t, e = {}) {
202
202
  const s = new Uint8Array(1);
203
203
  return s[0] = Number(t), typeof e.size == "number" ? (O(s, { size: e.size }), E(s, { size: e.size })) : s;
204
204
  }
205
- const d = {
205
+ const p = {
206
206
  zero: 48,
207
207
  nine: 57,
208
208
  A: 65,
@@ -211,12 +211,12 @@ const d = {
211
211
  f: 102
212
212
  };
213
213
  function L(t) {
214
- if (t >= d.zero && t <= d.nine)
215
- return t - d.zero;
216
- if (t >= d.A && t <= d.F)
217
- return t - (d.A - 10);
218
- if (t >= d.a && t <= d.f)
219
- return t - (d.a - 10);
214
+ if (t >= p.zero && t <= p.nine)
215
+ return t - p.zero;
216
+ if (t >= p.A && t <= p.F)
217
+ return t - (p.A - 10);
218
+ if (t >= p.a && t <= p.f)
219
+ return t - (p.a - 10);
220
220
  }
221
221
  function ae(t, e = {}) {
222
222
  let s = t;
@@ -268,7 +268,7 @@ function w(t, ...e) {
268
268
  if (e.length > 0 && !e.includes(t.length))
269
269
  throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
270
270
  }
271
- function q(t, e = !0) {
271
+ function K(t, e = !0) {
272
272
  if (t.destroyed)
273
273
  throw new Error("Hash instance has been destroyed");
274
274
  if (e && t.finished)
@@ -296,7 +296,7 @@ function _e(t) {
296
296
  t[e] = Le(t[e]);
297
297
  return t;
298
298
  }
299
- const K = Fe ? (t) => t : _e;
299
+ const q = Fe ? (t) => t : _e;
300
300
  function He(t) {
301
301
  if (typeof t != "string")
302
302
  throw new Error("string expected");
@@ -305,21 +305,21 @@ function He(t) {
305
305
  function le(t) {
306
306
  return typeof t == "string" && (t = He(t)), w(t), t;
307
307
  }
308
- class qe {
308
+ class Ke {
309
309
  }
310
- function Ke(t) {
310
+ function qe(t) {
311
311
  const e = (n) => t().update(le(n)).digest(), s = t();
312
312
  return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
313
313
  }
314
- const Ve = BigInt(0), y = BigInt(1), Xe = BigInt(2), Ge = BigInt(7), Qe = BigInt(256), We = BigInt(113), he = [], de = [], pe = [];
314
+ const Ve = BigInt(0), y = BigInt(1), Xe = BigInt(2), Ge = BigInt(7), Qe = BigInt(256), We = BigInt(113), he = [], pe = [], de = [];
315
315
  for (let t = 0, e = y, s = 1, n = 0; t < 24; t++) {
316
- [s, n] = [n, (2 * s + 3 * n) % 5], he.push(2 * (5 * n + s)), de.push((t + 1) * (t + 2) / 2 % 64);
316
+ [s, n] = [n, (2 * s + 3 * n) % 5], he.push(2 * (5 * n + s)), pe.push((t + 1) * (t + 2) / 2 % 64);
317
317
  let i = Ve;
318
318
  for (let r = 0; r < 7; r++)
319
319
  e = (e << y ^ (e >> Ge) * We) % Qe, e & Xe && (i ^= y << (y << /* @__PURE__ */ BigInt(r)) - y);
320
- pe.push(i);
320
+ de.push(i);
321
321
  }
322
- const ge = ke(pe, !0), Je = ge[0], Ye = ge[1], V = (t, e, s) => s > 32 ? $e(t, e, s) : Be(t, e, s), X = (t, e, s) => s > 32 ? Me(t, e, s) : ze(t, e, s);
322
+ const ge = ke(de, !0), Je = ge[0], Ye = ge[1], V = (t, e, s) => s > 32 ? $e(t, e, s) : Be(t, e, s), X = (t, e, s) => s > 32 ? Me(t, e, s) : ze(t, e, s);
323
323
  function Ze(t, e = 24) {
324
324
  const s = new Uint32Array(10);
325
325
  for (let n = 24 - e; n < 24; n++) {
@@ -332,7 +332,7 @@ function Ze(t, e = 24) {
332
332
  }
333
333
  let i = t[2], r = t[3];
334
334
  for (let o = 0; o < 24; o++) {
335
- const a = de[o], l = V(i, r, a), f = X(i, r, a), m = he[o];
335
+ const a = pe[o], l = V(i, r, a), f = X(i, r, a), m = he[o];
336
336
  i = t[m], r = t[m + 1], t[m] = l, t[m + 1] = f;
337
337
  }
338
338
  for (let o = 0; o < 50; o += 10) {
@@ -345,7 +345,7 @@ function Ze(t, e = 24) {
345
345
  }
346
346
  ue(s);
347
347
  }
348
- class P extends qe {
348
+ class P extends Ke {
349
349
  // NOTE: we accept arguments in bytes instead of bits here.
350
350
  constructor(e, s, n, i = !1, r = 24) {
351
351
  if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = s, this.outputLen = n, this.enableXOF = i, this.rounds = r, H(n), !(0 < e && e < 200))
@@ -356,10 +356,10 @@ class P extends qe {
356
356
  return this._cloneInto();
357
357
  }
358
358
  keccak() {
359
- K(this.state32), Ze(this.state32, this.rounds), K(this.state32), this.posOut = 0, this.pos = 0;
359
+ q(this.state32), Ze(this.state32, this.rounds), q(this.state32), this.posOut = 0, this.pos = 0;
360
360
  }
361
361
  update(e) {
362
- q(this), e = le(e), w(e);
362
+ K(this), e = le(e), w(e);
363
363
  const { blockLen: s, state: n } = this, i = e.length;
364
364
  for (let r = 0; r < i; ) {
365
365
  const o = Math.min(s - this.pos, i - r);
@@ -377,7 +377,7 @@ class P extends qe {
377
377
  e[n] ^= s, (s & 128) !== 0 && n === i - 1 && this.keccak(), e[i - 1] ^= 128, this.keccak();
378
378
  }
379
379
  writeInto(e) {
380
- q(this, !1), w(e), this.finish();
380
+ K(this, !1), w(e), this.finish();
381
381
  const s = this.state, { blockLen: n } = this;
382
382
  for (let i = 0, r = e.length; i < r; ) {
383
383
  this.posOut >= n && this.keccak();
@@ -410,7 +410,7 @@ class P extends qe {
410
410
  return e || (e = new P(s, n, i, o, r)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = n, e.outputLen = i, e.enableXOF = o, e.destroyed = this.destroyed, e;
411
411
  }
412
412
  }
413
- const et = (t, e, s) => Ke(() => new P(e, t, s)), tt = et(1, 136, 256 / 8);
413
+ const et = (t, e, s) => qe(() => new P(e, t, s)), tt = et(1, 136, 256 / 8);
414
414
  function st(t, e) {
415
415
  return tt(j(t, { strict: !1 }) ? Ne(t) : t);
416
416
  }
@@ -456,7 +456,7 @@ function me(t, e) {
456
456
  const r = `0x${i.join("")}`;
457
457
  return A.set(`${t}.${e}`, r), r;
458
458
  }
459
- function p(t, e) {
459
+ function d(t, e) {
460
460
  if (!ot(t, { strict: !1 }))
461
461
  throw new nt({ address: t });
462
462
  return me(t, e);
@@ -471,7 +471,7 @@ function ot(t, e) {
471
471
  }
472
472
  const v = {
473
473
  chainId: Q.chainId,
474
- address: p("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
474
+ address: d("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
475
475
  symbol: "USDC",
476
476
  fiatISO: "USD",
477
477
  decimals: 6,
@@ -479,7 +479,7 @@ const v = {
479
479
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
480
480
  }, C = {
481
481
  chainId: G.chainId,
482
- address: p("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
482
+ address: d("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
483
483
  symbol: "USDC",
484
484
  name: "USD Coin",
485
485
  decimals: 6,
@@ -487,7 +487,7 @@ const v = {
487
487
  /* USDC */
488
488
  }, T = {
489
489
  chainId: se.chainId,
490
- address: p("0x5425890298aed601595a70ab815c96711a31bc65"),
490
+ address: d("0x5425890298aed601595a70ab815c96711a31bc65"),
491
491
  symbol: "USDC",
492
492
  fiatISO: "USD",
493
493
  decimals: 6,
@@ -495,7 +495,7 @@ const v = {
495
495
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
496
496
  }, N = {
497
497
  chainId: te.chainId,
498
- address: p("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
498
+ address: d("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
499
499
  symbol: "USDC",
500
500
  fiatISO: "USD",
501
501
  decimals: 6,
@@ -503,7 +503,7 @@ const v = {
503
503
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
504
504
  }, D = {
505
505
  chainId: J.chainId,
506
- address: p("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
506
+ address: d("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
507
507
  symbol: "USDC",
508
508
  fiatISO: "USD",
509
509
  decimals: 6,
@@ -511,7 +511,7 @@ const v = {
511
511
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
512
512
  }, x = {
513
513
  chainId: W.chainId,
514
- address: p("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
514
+ address: d("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
515
515
  symbol: "USDC",
516
516
  fiatISO: "USD",
517
517
  decimals: 6,
@@ -519,21 +519,21 @@ const v = {
519
519
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
520
520
  }, R = {
521
521
  chainId: Y.chainId,
522
- address: p("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
522
+ address: d("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
523
523
  symbol: "USDC",
524
524
  decimals: 18,
525
525
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
526
526
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
527
527
  }, k = {
528
528
  chainId: ee.chainId,
529
- address: p("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
529
+ address: d("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
530
530
  symbol: "USDC",
531
531
  decimals: 6,
532
532
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
533
533
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
534
534
  }, B = {
535
535
  chainId: Z.chainId,
536
- address: p("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
536
+ address: d("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
537
537
  symbol: "USDC",
538
538
  decimals: 6,
539
539
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
@@ -640,37 +640,42 @@ function ut(t, e) {
640
640
  return ct(t)?.tokens[e]?.address;
641
641
  }
642
642
  var Ie = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(Ie || {});
643
- class u {
644
- constructor({ api_key: e, env: s, seesion_token: n }) {
645
- this.api_key = e || "", this.sessionToken = n || "", this.env = s ?? Ie.PRODUCTION;
643
+ class c {
644
+ constructor({ api_key: e, env: s, seesion_token: n, props: i }) {
645
+ this.api_key = e || "", this.sessionToken = n || "", this.env = s ?? Ie.PRODUCTION, this.props = i;
646
646
  }
647
647
  static async config(e) {
648
- if (!u.app) {
648
+ if (!c.app) {
649
649
  if (!e)
650
650
  throw new Error("Please provide an api_key");
651
- u.app = new u(e);
651
+ c.app = new c(e);
652
652
  }
653
- return e && (e.api_key !== void 0 && (u.app.api_key = e.api_key), e.seesion_token !== void 0 && (u.app.sessionToken = e.seesion_token), e.env !== void 0 && (u.app.env = e.env)), u.app;
653
+ return e && (e.api_key !== void 0 && (c.app.api_key = e.api_key), e.seesion_token !== void 0 && (c.app.sessionToken = e.seesion_token), e.env !== void 0 && (c.app.env = e.env), e.props !== void 0 && (c.app.props = e.props)), c.app;
654
654
  }
655
655
  static getApiKey() {
656
- if (!u.app)
656
+ if (!c.app)
657
657
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
658
- return u.app.api_key;
658
+ return c.app.api_key;
659
659
  }
660
660
  static getSessionToken() {
661
- if (!u.app)
661
+ if (!c.app)
662
662
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
663
- return u.app.sessionToken;
663
+ return c.app.sessionToken;
664
+ }
665
+ static getProps() {
666
+ if (!c.app)
667
+ throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
668
+ return c.app.props;
664
669
  }
665
670
  static getEnv() {
666
- if (!u.app)
671
+ if (!c.app)
667
672
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
668
- return u.app.env === "internal" ? "staging" : u.app.env;
673
+ return c.app.env === "internal" ? "staging" : c.app.env;
669
674
  }
670
675
  static getBaseUrl() {
671
- if (!u.app)
676
+ if (!c.app)
672
677
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
673
- switch (u.app.env) {
678
+ switch (c.app.env) {
674
679
  case "production":
675
680
  return "https://api.chainrails.io/api/v1";
676
681
  case "staging":
@@ -682,23 +687,23 @@ class u {
682
687
  }
683
688
  }
684
689
  static getPayModalUrl(e) {
685
- if (!u.app)
690
+ if (!c.app)
686
691
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
687
- const s = u.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(e), i = e && !isNaN(Number(e)) && n > 0 ? "/pay/" : "/deposit/", r = `${e && !isNaN(Number(e)) && n > 0 ? n * 100 : ""}`;
692
+ const s = c.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(e), i = e && !isNaN(Number(e)) && n > 0 ? "/pay/" : "/deposit/", r = `${e && !isNaN(Number(e)) && n > 0 ? n * 100 : ""}`;
688
693
  return s + i + r;
689
694
  }
690
695
  }
691
696
  let M = null;
692
697
  function lt() {
693
698
  M = Ee.create({
694
- prefixUrl: u.getBaseUrl(),
699
+ prefixUrl: c.getBaseUrl(),
695
700
  headers: {
696
701
  "Content-Type": "application/json"
697
702
  },
698
703
  hooks: {
699
704
  beforeRequest: [
700
705
  (t) => {
701
- const e = u.getSessionToken() || u.getApiKey();
706
+ const e = c.getSessionToken() || c.getApiKey();
702
707
  t.headers.set("Authorization", `Bearer ${e}`);
703
708
  }
704
709
  ],
@@ -709,83 +714,83 @@ function lt() {
709
714
  }
710
715
  });
711
716
  }
712
- function c() {
717
+ function u() {
713
718
  return M || lt(), M;
714
719
  }
715
720
  class ht {
716
721
  async getById(e) {
717
- return await c().get("intents/" + e).json();
722
+ return await u().get("intents/" + e).json();
718
723
  }
719
724
  async getForSender(e) {
720
- return await c().get("intents/user/" + e).json();
725
+ return await u().get("intents/user/" + e).json();
721
726
  }
722
727
  async getForAddress(e) {
723
- return await c().get("intents/address/" + e).json();
728
+ return await u().get("intents/address/" + e).json();
724
729
  }
725
730
  async getForSession(e) {
726
- return await c().get("modal/sessions/intents/" + e).json();
731
+ return await u().get("modal/sessions/intents/" + e).json();
727
732
  }
728
733
  async getAll(e) {
729
- return await c().get("intents", { searchParams: e }).json();
734
+ return await u().get("intents", { searchParams: e }).json();
730
735
  }
731
736
  async create(e) {
732
- return await c().post("intents", { json: e }).json();
737
+ return await u().post("intents", { json: e }).json();
733
738
  }
734
739
  async createForSession(e) {
735
- return await c().post("modal/sessions/intents", { json: e }).json();
740
+ return await u().post("modal/sessions/intents", { json: e }).json();
736
741
  }
737
742
  async update(e, s) {
738
- return await c().post("intents", { json: s }).json();
743
+ return await u().post("intents", { json: s }).json();
739
744
  }
740
745
  async triggerProcessing(e) {
741
- return await c().post(`intents/${e}/trigger-processing`).json();
746
+ return await u().post(`intents/${e}/trigger-processing`).json();
742
747
  }
743
748
  async triggerProcessingForSession(e) {
744
- return await c().post(`modal/sessions/intents/${e}/process`).json();
749
+ return await u().post(`modal/sessions/intents/${e}/process`).json();
745
750
  }
746
751
  }
747
- class dt {
752
+ class pt {
748
753
  async getFromSpecificBridge(e) {
749
- return await c().get("quotes/single", { searchParams: e }).json();
754
+ return await u().get("quotes/single", { searchParams: e }).json();
750
755
  }
751
756
  async getFromAllBridges(e) {
752
- return await c().get("quotes/multiple", { searchParams: e }).json();
757
+ return await u().get("quotes/multiple", { searchParams: e }).json();
753
758
  }
754
759
  async getBestAcrossBridges(e) {
755
- return await c().get("quotes/best", { searchParams: e }).json();
760
+ return await u().get("quotes/best", { searchParams: e }).json();
756
761
  }
757
762
  async getAll(e) {
758
- return await c().get("quotes/multi-source", { searchParams: e }).json();
763
+ return await u().get("quotes/multi-source", { searchParams: e }).json();
759
764
  }
760
765
  async getAllForSession(e) {
761
- return await c().get("modal/sessions/quotes", { searchParams: e }).json();
766
+ return await u().get("modal/sessions/quotes", { searchParams: e }).json();
762
767
  }
763
768
  }
764
- class pt {
769
+ class dt {
765
770
  async getOptimalRoutes(e) {
766
- return await c().get("router/optimal-route", { searchParams: e }).json();
771
+ return await u().get("router/optimal-route", { searchParams: e }).json();
767
772
  }
768
773
  async getAllSupportedBridges() {
769
- return await c().get("router/supported-bridges/all").json();
774
+ return await u().get("router/supported-bridges/all").json();
770
775
  }
771
776
  async getSupportedBridges(e) {
772
- return await c().get("router/supported-bridges/route", { searchParams: e }).json();
777
+ return await u().get("router/supported-bridges/route", { searchParams: e }).json();
773
778
  }
774
779
  async getSupportedRoutes(e, s) {
775
- return await c().get("router/supported-bridges/bridge/" + e, { searchParams: s }).json();
780
+ return await u().get("router/supported-bridges/bridge/" + e, { searchParams: s }).json();
776
781
  }
777
782
  }
778
783
  class gt {
779
784
  async getSupported(e) {
780
- return await c().get("chains", { searchParams: e }).json();
785
+ return await u().get("chains", { searchParams: e }).json();
781
786
  }
782
787
  }
783
788
  class ft {
784
789
  async getClientInfo() {
785
- return await c().get("client/auth/client-info").json();
790
+ return await u().get("client/auth/client-info").json();
786
791
  }
787
792
  async getClientInfoForSession() {
788
- return await c().get("modal/sessions/client").json();
793
+ return await u().get("modal/sessions/client").json();
789
794
  }
790
795
  }
791
796
  class mt {
@@ -799,19 +804,19 @@ class mt {
799
804
  destinationChain: $[e.destinationChain?.replace("_MAINNET", "")],
800
805
  amount: e.amount
801
806
  };
802
- return c().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
807
+ return u().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
803
808
  }
804
809
  }
805
810
  const bt = {
806
- router: new pt(),
807
- quotes: new dt(),
811
+ router: new dt(),
812
+ quotes: new pt(),
808
813
  intents: new ht(),
809
814
  chains: new gt(),
810
815
  client: new ft(),
811
816
  auth: new mt()
812
817
  };
813
818
  export {
814
- u as Chainrails,
819
+ c as Chainrails,
815
820
  $ as chains,
816
821
  bt as crapi,
817
822
  Ie as environment,
@@ -1,2 +1,2 @@
1
- (function(l,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("ky")):typeof define=="function"&&define.amd?define(["exports","ky"],I):(l=typeof globalThis<"u"?globalThis:l||self,I(l.Chainrails={},l.Ky))})(this,(function(l,I){"use strict";var h=(t=>(t.USDC="USDC",t))(h||{});const q={type:"evm",chainId:42161,name:"Arbitrum",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},K={type:"evm",chainId:421614,name:"Arbitrum Sepolia",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},V={type:"evm",chainId:8453,name:"Base",cctpDomain:6,logoURI:"/images/chains/base.webp"},X={type:"evm",chainId:84532,name:"Base Sepolia",cctpDomain:6,logoURI:"/images/chains/base.webp"},G={type:"evm",chainId:56,name:"BNB Chain",cctpDomain:null,logoURI:"/images/chains/bsc.webp"},Q={type:"evm",chainId:1,name:"Ethereum",cctpDomain:0,logoURI:"/images/chains/ethereum.svg"},W={type:"evm",chainId:11155111,name:"Ethereum Sepolia",cctpDomain:0,logoURI:"/images/chains/ethereum.svg"},J={type:"evm",chainId:43114,name:"Avalanche",cctpDomain:1,logoURI:"/images/chains/avalanche.svg"},Y={type:"evm",chainId:43113,name:"Avalanche Fuji",cctpDomain:1,logoURI:"/images/chains/avalanche.svg"},Z={type:"starknet",chainId:"0x534e5f4d41494e",name:"Starknet",cctpDomain:null,logoURI:"/images/chains/starknet.svg"};function v(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function ee(t){return v(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const te="2.43.4";let C={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:s})=>e?`${t??"https://viem.sh"}${e}${s?`#${s}`:""}`:void 0,version:`viem@${te}`};class f extends Error{constructor(e,s={}){const n=s.cause instanceof f?s.cause.details:s.cause?.message?s.cause.message:s.details,i=s.cause instanceof f&&s.cause.docsPath||s.docsPath,r=C.getDocsUrl?.({...s,docsPath:i}),o=[e||"An error occurred.","",...s.metaMessages?[...s.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...n?[`Details: ${n}`]:[],...C.version?[`Version: ${C.version}`]:[]].join(`
2
- `);super(o,s.cause?{cause:s.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=s.metaMessages,this.name=s.name??this.name,this.shortMessage=e,this.version=te}walk(e){return se(this,e)}}function se(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?se(t.cause,e):e?null:t}class ne extends f{constructor({size:e,targetSize:s,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}function w(t,{dir:e,size:s=32}={}){return typeof t=="string"?Ee(t,{dir:e,size:s}):Se(t,{dir:e,size:s})}function Ee(t,{dir:e,size:s=32}={}){if(s===null)return t;const n=t.replace("0x","");if(n.length>s*2)throw new ne({size:Math.ceil(n.length/2),targetSize:s,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](s*2,"0")}`}function Se(t,{dir:e,size:s=32}={}){if(s===null)return t;if(t.length>s)throw new ne({size:t.length,targetSize:s,type:"bytes"});const n=new Uint8Array(s);for(let i=0;i<s;i++){const r=e==="right";n[r?i:s-i-1]=t[r?i:t.length-i-1]}return n}class Ae extends f{constructor({max:e,min:s,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${s} to ${e})`:`(above ${s})`}`,{name:"IntegerOutOfRangeError"})}}class Ue extends f{constructor({givenSize:e,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function T(t,{size:e}){if(ee(t)>e)throw new Ue({givenSize:ee(t),maxSize:e})}function ve(t,e={}){const{signed:s,size:n}=e,i=BigInt(t);let r;n?s?r=(1n<<BigInt(n)*8n-1n)-1n:r=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof r=="bigint"&&s?-r-1n:0;if(r&&i>r||i<o){const d=typeof t=="bigint"?"n":"";throw new Ae({max:r?`${r}${d}`:void 0,min:`${o}${d}`,signed:s,size:n,value:`${t}${d}`})}const a=`0x${(s&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?w(a,{size:n}):a}const Ce=new TextEncoder;function Te(t,e={}){return typeof t=="number"||typeof t=="bigint"?De(t,e):typeof t=="boolean"?Ne(t,e):v(t)?oe(t,e):re(t,e)}function Ne(t,e={}){const s=new Uint8Array(1);return s[0]=Number(t),typeof e.size=="number"?(T(s,{size:e.size}),w(s,{size:e.size})):s}const p={zero:48,nine:57,A:65,F:70,a:97,f:102};function ie(t){if(t>=p.zero&&t<=p.nine)return t-p.zero;if(t>=p.A&&t<=p.F)return t-(p.A-10);if(t>=p.a&&t<=p.f)return t-(p.a-10)}function oe(t,e={}){let s=t;e.size&&(T(s,{size:e.size}),s=w(s,{dir:"right",size:e.size}));let n=s.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,r=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const d=ie(n.charCodeAt(a++)),m=ie(n.charCodeAt(a++));if(d===void 0||m===void 0)throw new f(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);r[o]=d*16+m}return r}function De(t,e){const s=ve(t,e);return oe(s)}function re(t,e={}){const s=Ce.encode(t);return typeof e.size=="number"?(T(s,{size:e.size}),w(s,{dir:"right",size:e.size})):s}const E=BigInt(2**32-1),ae=BigInt(32);function xe(t,e=!1){return e?{h:Number(t&E),l:Number(t>>ae&E)}:{h:Number(t>>ae&E)|0,l:Number(t&E)|0}}function ke(t,e=!1){const s=t.length;let n=new Uint32Array(s),i=new Uint32Array(s);for(let r=0;r<s;r++){const{h:o,l:a}=xe(t[r],e);[n[r],i[r]]=[o,a]}return[n,i]}const Re=(t,e,s)=>t<<s|e>>>32-s,Be=(t,e,s)=>e<<s|t>>>32-s,ze=(t,e,s)=>e<<s-32|t>>>64-s,$e=(t,e,s)=>t<<s-32|e>>>64-s;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Me(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ce(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function S(t,...e){if(!Me(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function ue(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function je(t,e){S(t);const s=e.outputLen;if(t.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function Oe(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function le(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const Pe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Fe(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function Le(t){for(let e=0;e<t.length;e++)t[e]=Fe(t[e]);return t}const he=Pe?t=>t:Le;function _e(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function de(t){return typeof t=="string"&&(t=_e(t)),S(t),t}class He{}function qe(t){const e=n=>t().update(de(n)).digest(),s=t();return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=()=>t(),e}const Ke=BigInt(0),b=BigInt(1),Ve=BigInt(2),Xe=BigInt(7),Ge=BigInt(256),Qe=BigInt(113),pe=[],ge=[],fe=[];for(let t=0,e=b,s=1,n=0;t<24;t++){[s,n]=[n,(2*s+3*n)%5],pe.push(2*(5*n+s)),ge.push((t+1)*(t+2)/2%64);let i=Ke;for(let r=0;r<7;r++)e=(e<<b^(e>>Xe)*Qe)%Ge,e&Ve&&(i^=b<<(b<<BigInt(r))-b);fe.push(i)}const me=ke(fe,!0),We=me[0],Je=me[1],ye=(t,e,s)=>s>32?ze(t,e,s):Re(t,e,s),Ie=(t,e,s)=>s>32?$e(t,e,s):Be(t,e,s);function Ye(t,e=24){const s=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)s[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,d=(o+2)%10,m=s[d],y=s[d+1],It=ye(m,y,1)^s[a],bt=Ie(m,y,1)^s[a+1];for(let U=0;U<50;U+=10)t[o+U]^=It,t[o+U+1]^=bt}let i=t[2],r=t[3];for(let o=0;o<24;o++){const a=ge[o],d=ye(i,r,a),m=Ie(i,r,a),y=pe[o];i=t[y],r=t[y+1],t[y]=d,t[y+1]=m}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)s[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~s[(a+2)%10]&s[(a+4)%10]}t[0]^=We[n],t[1]^=Je[n]}le(s)}class N extends He{constructor(e,s,n,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=s,this.outputLen=n,this.enableXOF=i,this.rounds=r,ce(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Oe(this.state)}clone(){return this._cloneInto()}keccak(){he(this.state32),Ye(this.state32,this.rounds),he(this.state32),this.posOut=0,this.pos=0}update(e){ue(this),e=de(e),S(e);const{blockLen:s,state:n}=this,i=e.length;for(let r=0;r<i;){const o=Math.min(s-this.pos,i-r);for(let a=0;a<o;a++)n[this.pos++]^=e[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:s,pos:n,blockLen:i}=this;e[n]^=s,(s&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){ue(this,!1),S(e),this.finish();const s=this.state,{blockLen:n}=this;for(let i=0,r=e.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);e.set(s.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ce(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(je(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,le(this.state)}_cloneInto(e){const{blockLen:s,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return e||(e=new N(s,n,i,o,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Ze=(t,e,s)=>qe(()=>new N(e,t,s)),et=Ze(1,136,256/8);function tt(t,e){return et(v(t,{strict:!1})?Te(t):t)}class st extends f{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class be extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const s=super.get(e);return super.has(e)&&s!==void 0&&(this.delete(e),super.set(e,s)),s}set(e,s){if(super.set(e,s),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const D=new be(8192);function we(t,e){if(D.has(`${t}.${e}`))return D.get(`${t}.${e}`);const s=t.substring(2).toLowerCase(),n=tt(re(s)),i=s.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const r=`0x${i.join("")}`;return D.set(`${t}.${e}`,r),r}function g(t,e){if(!it(t,{strict:!1}))throw new st({address:t});return we(t,e)}const nt=/^0x[a-fA-F0-9]{40}$/,x=new be(8192);function it(t,e){const{strict:s=!0}=e??{},n=`${t}.${s}`;if(x.has(n))return x.get(n);const i=nt.test(t)?t.toLowerCase()===t?!0:s?we(t)===t:!0:!1;return x.set(n,i),i}const k={chainId:K.chainId,address:g("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},R={chainId:q.chainId,address:g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:"USDC",name:"USD Coin",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png"},B={chainId:Y.chainId,address:g("0x5425890298aed601595a70ab815c96711a31bc65"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},z={chainId:J.chainId,address:g("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},$={chainId:X.chainId,address:g("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},M={chainId:V.chainId,address:g("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},j={chainId:G.chainId,address:g("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),symbol:"USDC",decimals:18,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},O={chainId:W.chainId,address:g("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},P={chainId:Q.chainId,address:g("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},ot={chainId:Z.chainId,address:"0x053C91253BC9682c04929cA02ED00b3E423f6710D2ee7e0D5EBB06F3eCF368A8",symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},rt={[k.chainId]:k,[R.chainId]:R,[B.chainId]:B,[z.chainId]:z,[$.chainId]:$,[M.chainId]:M,[O.chainId]:O,[P.chainId]:P,[j.chainId]:j},F={ARBITRUM_MAINNET:{...q,tokens:{[h.USDC]:R},explorer:"https://arbiscan.io"},ARBITRUM_TESTNET:{...K,explorer:"https://sepolia.arbiscan.io",tokens:{[h.USDC]:k}},AVALANCHE_MAINNET:{...J,tokens:{[h.USDC]:z},explorer:"https://snowtrace.io"},AVALANCHE_TESTNET:{...Y,tokens:{[h.USDC]:B},explorer:"https://testnet.snowtrace.io"},BASE_MAINNET:{...V,tokens:{[h.USDC]:M},explorer:"https://basescan.org"},BASE_TESTNET:{...X,tokens:{[h.USDC]:$},explorer:"https://sepolia.basescan.org"},BSC_MAINNET:{...G,tokens:{[h.USDC]:j},explorer:"https://bscscan.com"},ETHEREUM_MAINNET:{...Q,tokens:{[h.USDC]:P},explorer:"https://etherscan.io"},ETHEREUM_TESTNET:{...W,tokens:{[h.USDC]:O},explorer:"https://sepolia.etherscan.io"},STARKNET_MAINNET:{...Z,tokens:{[h.USDC]:ot},explorer:""}};var A=(t=>(t.ARBITRUM="ARBITRUM_MAINNET",t.ARBITRUM_TESTNET="ARBITRUM_TESTNET",t.AVALANCHE="AVALANCHE_MAINNET",t.AVALANCHE_TESTNET="AVALANCHE_TESTNET",t.BASE="BASE_MAINNET",t.BASE_TESTNET="BASE_TESTNET",t.BSC="BSC_MAINNET",t.ETHEREUM="ETHEREUM_MAINNET",t.ETHEREUM_TESTNET="ETHEREUM_TESTNET",t.STARKNET="STARKNET_MAINNET",t))(A||{}),L=(t=>(t.USDC="USDC",t))(L||{});function at(t){return rt[F[t||""].chainId]?.decimals||6}const ct=t=>{const e=t?.trim().toUpperCase();if(F[e])return F[e]};function ut(t,e){return ct(t)?.tokens[e]?.address}var _=(t=>(t.PRODUCTION="production",t.STAGING="staging",t))(_||{});class c{constructor({api_key:e,env:s,seesion_token:n}){this.api_key=e||"",this.sessionToken=n||"",this.env=s??_.PRODUCTION}static async config(e){if(!c.app){if(!e)throw new Error("Please provide an api_key");c.app=new c(e)}return e&&(e.api_key!==void 0&&(c.app.api_key=e.api_key),e.seesion_token!==void 0&&(c.app.sessionToken=e.seesion_token),e.env!==void 0&&(c.app.env=e.env)),c.app}static getApiKey(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.api_key}static getSessionToken(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.sessionToken}static getEnv(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.env==="internal"?"staging":c.app.env}static getBaseUrl(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(c.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";case"internal":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}static getPayModalUrl(e){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const s=c.app.env==="internal"?"https://chainrails-frontend-git-staging-horus-labs.vercel.app":"https://app.chainrails.io",n=Number(e),i=e&&!isNaN(Number(e))&&n>0?"/pay/":"/deposit/",r=`${e&&!isNaN(Number(e))&&n>0?n*100:""}`;return s+i+r}}let H=null;function lt(){H=I.create({prefixUrl:c.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[t=>{const e=c.getSessionToken()||c.getApiKey();t.headers.set("Authorization",`Bearer ${e}`)}],afterResponse:[(t,e,s)=>s]},retry:{limit:2}})}function u(){return H||lt(),H}class ht{async getById(e){return await u().get("intents/"+e).json()}async getForSender(e){return await u().get("intents/user/"+e).json()}async getForAddress(e){return await u().get("intents/address/"+e).json()}async getForSession(e){return await u().get("modal/sessions/intents/"+e).json()}async getAll(e){return await u().get("intents",{searchParams:e}).json()}async create(e){return await u().post("intents",{json:e}).json()}async createForSession(e){return await u().post("modal/sessions/intents",{json:e}).json()}async update(e,s){return await u().post("intents",{json:s}).json()}async triggerProcessing(e){return await u().post(`intents/${e}/trigger-processing`).json()}async triggerProcessingForSession(e){return await u().post(`modal/sessions/intents/${e}/process`).json()}}class dt{async getFromSpecificBridge(e){return await u().get("quotes/single",{searchParams:e}).json()}async getFromAllBridges(e){return await u().get("quotes/multiple",{searchParams:e}).json()}async getBestAcrossBridges(e){return await u().get("quotes/best",{searchParams:e}).json()}async getAll(e){return await u().get("quotes/multi-source",{searchParams:e}).json()}async getAllForSession(e){return await u().get("modal/sessions/quotes",{searchParams:e}).json()}}class pt{async getOptimalRoutes(e){return await u().get("router/optimal-route",{searchParams:e}).json()}async getAllSupportedBridges(){return await u().get("router/supported-bridges/all").json()}async getSupportedBridges(e){return await u().get("router/supported-bridges/route",{searchParams:e}).json()}async getSupportedRoutes(e,s){return await u().get("router/supported-bridges/bridge/"+e,{searchParams:s}).json()}}class gt{async getSupported(e){return await u().get("chains",{searchParams:e}).json()}}class ft{async getClientInfo(){return await u().get("client/auth/client-info").json()}async getClientInfoForSession(){return await u().get("modal/sessions/client").json()}}class mt{getSessionToken(e){const s={recipient:e.recipient,tokenOut:ut(A[e.destinationChain?.replace("_MAINNET","")],L[e.token]),destinationChain:A[e.destinationChain?.replace("_MAINNET","")],amount:e.amount};return u().post("modal/sessions",{json:s}).json().then(n=>({...n,amount:s.amount}))}}const yt={router:new pt,quotes:new dt,intents:new ht,chains:new gt,client:new ft,auth:new mt};l.Chainrails=c,l.chains=A,l.crapi=yt,l.environment=_,l.getTokenDecimals=at,l.tokens=L,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(l,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("ky")):typeof define=="function"&&define.amd?define(["exports","ky"],I):(l=typeof globalThis<"u"?globalThis:l||self,I(l.Chainrails={},l.Ky))})(this,(function(l,I){"use strict";var h=(t=>(t.USDC="USDC",t))(h||{});const K={type:"evm",chainId:42161,name:"Arbitrum",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},q={type:"evm",chainId:421614,name:"Arbitrum Sepolia",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},V={type:"evm",chainId:8453,name:"Base",cctpDomain:6,logoURI:"/images/chains/base.webp"},X={type:"evm",chainId:84532,name:"Base Sepolia",cctpDomain:6,logoURI:"/images/chains/base.webp"},G={type:"evm",chainId:56,name:"BNB Chain",cctpDomain:null,logoURI:"/images/chains/bsc.webp"},Q={type:"evm",chainId:1,name:"Ethereum",cctpDomain:0,logoURI:"/images/chains/ethereum.svg"},W={type:"evm",chainId:11155111,name:"Ethereum Sepolia",cctpDomain:0,logoURI:"/images/chains/ethereum.svg"},J={type:"evm",chainId:43114,name:"Avalanche",cctpDomain:1,logoURI:"/images/chains/avalanche.svg"},Y={type:"evm",chainId:43113,name:"Avalanche Fuji",cctpDomain:1,logoURI:"/images/chains/avalanche.svg"},Z={type:"starknet",chainId:"0x534e5f4d41494e",name:"Starknet",cctpDomain:null,logoURI:"/images/chains/starknet.svg"};function v(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function ee(t){return v(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const te="2.43.4";let C={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:s})=>e?`${t??"https://viem.sh"}${e}${s?`#${s}`:""}`:void 0,version:`viem@${te}`};class f extends Error{constructor(e,s={}){const n=s.cause instanceof f?s.cause.details:s.cause?.message?s.cause.message:s.details,i=s.cause instanceof f&&s.cause.docsPath||s.docsPath,r=C.getDocsUrl?.({...s,docsPath:i}),o=[e||"An error occurred.","",...s.metaMessages?[...s.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...n?[`Details: ${n}`]:[],...C.version?[`Version: ${C.version}`]:[]].join(`
2
+ `);super(o,s.cause?{cause:s.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=s.metaMessages,this.name=s.name??this.name,this.shortMessage=e,this.version=te}walk(e){return se(this,e)}}function se(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?se(t.cause,e):e?null:t}class ne extends f{constructor({size:e,targetSize:s,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}function w(t,{dir:e,size:s=32}={}){return typeof t=="string"?Ee(t,{dir:e,size:s}):Se(t,{dir:e,size:s})}function Ee(t,{dir:e,size:s=32}={}){if(s===null)return t;const n=t.replace("0x","");if(n.length>s*2)throw new ne({size:Math.ceil(n.length/2),targetSize:s,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](s*2,"0")}`}function Se(t,{dir:e,size:s=32}={}){if(s===null)return t;if(t.length>s)throw new ne({size:t.length,targetSize:s,type:"bytes"});const n=new Uint8Array(s);for(let i=0;i<s;i++){const r=e==="right";n[r?i:s-i-1]=t[r?i:t.length-i-1]}return n}class Ae extends f{constructor({max:e,min:s,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${s} to ${e})`:`(above ${s})`}`,{name:"IntegerOutOfRangeError"})}}class Ue extends f{constructor({givenSize:e,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function T(t,{size:e}){if(ee(t)>e)throw new Ue({givenSize:ee(t),maxSize:e})}function ve(t,e={}){const{signed:s,size:n}=e,i=BigInt(t);let r;n?s?r=(1n<<BigInt(n)*8n-1n)-1n:r=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof r=="bigint"&&s?-r-1n:0;if(r&&i>r||i<o){const d=typeof t=="bigint"?"n":"";throw new Ae({max:r?`${r}${d}`:void 0,min:`${o}${d}`,signed:s,size:n,value:`${t}${d}`})}const a=`0x${(s&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?w(a,{size:n}):a}const Ce=new TextEncoder;function Te(t,e={}){return typeof t=="number"||typeof t=="bigint"?De(t,e):typeof t=="boolean"?Ne(t,e):v(t)?oe(t,e):re(t,e)}function Ne(t,e={}){const s=new Uint8Array(1);return s[0]=Number(t),typeof e.size=="number"?(T(s,{size:e.size}),w(s,{size:e.size})):s}const p={zero:48,nine:57,A:65,F:70,a:97,f:102};function ie(t){if(t>=p.zero&&t<=p.nine)return t-p.zero;if(t>=p.A&&t<=p.F)return t-(p.A-10);if(t>=p.a&&t<=p.f)return t-(p.a-10)}function oe(t,e={}){let s=t;e.size&&(T(s,{size:e.size}),s=w(s,{dir:"right",size:e.size}));let n=s.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,r=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const d=ie(n.charCodeAt(a++)),m=ie(n.charCodeAt(a++));if(d===void 0||m===void 0)throw new f(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);r[o]=d*16+m}return r}function De(t,e){const s=ve(t,e);return oe(s)}function re(t,e={}){const s=Ce.encode(t);return typeof e.size=="number"?(T(s,{size:e.size}),w(s,{dir:"right",size:e.size})):s}const E=BigInt(2**32-1),ae=BigInt(32);function xe(t,e=!1){return e?{h:Number(t&E),l:Number(t>>ae&E)}:{h:Number(t>>ae&E)|0,l:Number(t&E)|0}}function ke(t,e=!1){const s=t.length;let n=new Uint32Array(s),i=new Uint32Array(s);for(let r=0;r<s;r++){const{h:o,l:a}=xe(t[r],e);[n[r],i[r]]=[o,a]}return[n,i]}const Re=(t,e,s)=>t<<s|e>>>32-s,Be=(t,e,s)=>e<<s|t>>>32-s,ze=(t,e,s)=>e<<s-32|t>>>64-s,$e=(t,e,s)=>t<<s-32|e>>>64-s;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Me(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ce(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function S(t,...e){if(!Me(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function ue(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function je(t,e){S(t);const s=e.outputLen;if(t.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function Oe(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function le(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const Pe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Fe(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function Le(t){for(let e=0;e<t.length;e++)t[e]=Fe(t[e]);return t}const he=Pe?t=>t:Le;function _e(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function de(t){return typeof t=="string"&&(t=_e(t)),S(t),t}class He{}function Ke(t){const e=n=>t().update(de(n)).digest(),s=t();return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=()=>t(),e}const qe=BigInt(0),b=BigInt(1),Ve=BigInt(2),Xe=BigInt(7),Ge=BigInt(256),Qe=BigInt(113),pe=[],ge=[],fe=[];for(let t=0,e=b,s=1,n=0;t<24;t++){[s,n]=[n,(2*s+3*n)%5],pe.push(2*(5*n+s)),ge.push((t+1)*(t+2)/2%64);let i=qe;for(let r=0;r<7;r++)e=(e<<b^(e>>Xe)*Qe)%Ge,e&Ve&&(i^=b<<(b<<BigInt(r))-b);fe.push(i)}const me=ke(fe,!0),We=me[0],Je=me[1],ye=(t,e,s)=>s>32?ze(t,e,s):Re(t,e,s),Ie=(t,e,s)=>s>32?$e(t,e,s):Be(t,e,s);function Ye(t,e=24){const s=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)s[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,d=(o+2)%10,m=s[d],y=s[d+1],It=ye(m,y,1)^s[a],bt=Ie(m,y,1)^s[a+1];for(let U=0;U<50;U+=10)t[o+U]^=It,t[o+U+1]^=bt}let i=t[2],r=t[3];for(let o=0;o<24;o++){const a=ge[o],d=ye(i,r,a),m=Ie(i,r,a),y=pe[o];i=t[y],r=t[y+1],t[y]=d,t[y+1]=m}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)s[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~s[(a+2)%10]&s[(a+4)%10]}t[0]^=We[n],t[1]^=Je[n]}le(s)}class N extends He{constructor(e,s,n,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=s,this.outputLen=n,this.enableXOF=i,this.rounds=r,ce(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Oe(this.state)}clone(){return this._cloneInto()}keccak(){he(this.state32),Ye(this.state32,this.rounds),he(this.state32),this.posOut=0,this.pos=0}update(e){ue(this),e=de(e),S(e);const{blockLen:s,state:n}=this,i=e.length;for(let r=0;r<i;){const o=Math.min(s-this.pos,i-r);for(let a=0;a<o;a++)n[this.pos++]^=e[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:s,pos:n,blockLen:i}=this;e[n]^=s,(s&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){ue(this,!1),S(e),this.finish();const s=this.state,{blockLen:n}=this;for(let i=0,r=e.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);e.set(s.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ce(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(je(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,le(this.state)}_cloneInto(e){const{blockLen:s,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return e||(e=new N(s,n,i,o,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Ze=(t,e,s)=>Ke(()=>new N(e,t,s)),et=Ze(1,136,256/8);function tt(t,e){return et(v(t,{strict:!1})?Te(t):t)}class st extends f{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class be extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const s=super.get(e);return super.has(e)&&s!==void 0&&(this.delete(e),super.set(e,s)),s}set(e,s){if(super.set(e,s),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const D=new be(8192);function we(t,e){if(D.has(`${t}.${e}`))return D.get(`${t}.${e}`);const s=t.substring(2).toLowerCase(),n=tt(re(s)),i=s.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const r=`0x${i.join("")}`;return D.set(`${t}.${e}`,r),r}function g(t,e){if(!it(t,{strict:!1}))throw new st({address:t});return we(t,e)}const nt=/^0x[a-fA-F0-9]{40}$/,x=new be(8192);function it(t,e){const{strict:s=!0}=e??{},n=`${t}.${s}`;if(x.has(n))return x.get(n);const i=nt.test(t)?t.toLowerCase()===t?!0:s?we(t)===t:!0:!1;return x.set(n,i),i}const k={chainId:q.chainId,address:g("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},R={chainId:K.chainId,address:g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:"USDC",name:"USD Coin",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png"},B={chainId:Y.chainId,address:g("0x5425890298aed601595a70ab815c96711a31bc65"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},z={chainId:J.chainId,address:g("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},$={chainId:X.chainId,address:g("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},M={chainId:V.chainId,address:g("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},j={chainId:G.chainId,address:g("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),symbol:"USDC",decimals:18,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},O={chainId:W.chainId,address:g("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},P={chainId:Q.chainId,address:g("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},ot={chainId:Z.chainId,address:"0x053C91253BC9682c04929cA02ED00b3E423f6710D2ee7e0D5EBB06F3eCF368A8",symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},rt={[k.chainId]:k,[R.chainId]:R,[B.chainId]:B,[z.chainId]:z,[$.chainId]:$,[M.chainId]:M,[O.chainId]:O,[P.chainId]:P,[j.chainId]:j},F={ARBITRUM_MAINNET:{...K,tokens:{[h.USDC]:R},explorer:"https://arbiscan.io"},ARBITRUM_TESTNET:{...q,explorer:"https://sepolia.arbiscan.io",tokens:{[h.USDC]:k}},AVALANCHE_MAINNET:{...J,tokens:{[h.USDC]:z},explorer:"https://snowtrace.io"},AVALANCHE_TESTNET:{...Y,tokens:{[h.USDC]:B},explorer:"https://testnet.snowtrace.io"},BASE_MAINNET:{...V,tokens:{[h.USDC]:M},explorer:"https://basescan.org"},BASE_TESTNET:{...X,tokens:{[h.USDC]:$},explorer:"https://sepolia.basescan.org"},BSC_MAINNET:{...G,tokens:{[h.USDC]:j},explorer:"https://bscscan.com"},ETHEREUM_MAINNET:{...Q,tokens:{[h.USDC]:P},explorer:"https://etherscan.io"},ETHEREUM_TESTNET:{...W,tokens:{[h.USDC]:O},explorer:"https://sepolia.etherscan.io"},STARKNET_MAINNET:{...Z,tokens:{[h.USDC]:ot},explorer:""}};var A=(t=>(t.ARBITRUM="ARBITRUM_MAINNET",t.ARBITRUM_TESTNET="ARBITRUM_TESTNET",t.AVALANCHE="AVALANCHE_MAINNET",t.AVALANCHE_TESTNET="AVALANCHE_TESTNET",t.BASE="BASE_MAINNET",t.BASE_TESTNET="BASE_TESTNET",t.BSC="BSC_MAINNET",t.ETHEREUM="ETHEREUM_MAINNET",t.ETHEREUM_TESTNET="ETHEREUM_TESTNET",t.STARKNET="STARKNET_MAINNET",t))(A||{}),L=(t=>(t.USDC="USDC",t))(L||{});function at(t){return rt[F[t||""].chainId]?.decimals||6}const ct=t=>{const e=t?.trim().toUpperCase();if(F[e])return F[e]};function ut(t,e){return ct(t)?.tokens[e]?.address}var _=(t=>(t.PRODUCTION="production",t.STAGING="staging",t))(_||{});class c{constructor({api_key:e,env:s,seesion_token:n,props:i}){this.api_key=e||"",this.sessionToken=n||"",this.env=s??_.PRODUCTION,this.props=i}static async config(e){if(!c.app){if(!e)throw new Error("Please provide an api_key");c.app=new c(e)}return e&&(e.api_key!==void 0&&(c.app.api_key=e.api_key),e.seesion_token!==void 0&&(c.app.sessionToken=e.seesion_token),e.env!==void 0&&(c.app.env=e.env),e.props!==void 0&&(c.app.props=e.props)),c.app}static getApiKey(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.api_key}static getSessionToken(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.sessionToken}static getProps(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.props}static getEnv(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.env==="internal"?"staging":c.app.env}static getBaseUrl(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(c.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";case"internal":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}static getPayModalUrl(e){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const s=c.app.env==="internal"?"https://chainrails-frontend-git-staging-horus-labs.vercel.app":"https://app.chainrails.io",n=Number(e),i=e&&!isNaN(Number(e))&&n>0?"/pay/":"/deposit/",r=`${e&&!isNaN(Number(e))&&n>0?n*100:""}`;return s+i+r}}let H=null;function lt(){H=I.create({prefixUrl:c.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[t=>{const e=c.getSessionToken()||c.getApiKey();t.headers.set("Authorization",`Bearer ${e}`)}],afterResponse:[(t,e,s)=>s]},retry:{limit:2}})}function u(){return H||lt(),H}class ht{async getById(e){return await u().get("intents/"+e).json()}async getForSender(e){return await u().get("intents/user/"+e).json()}async getForAddress(e){return await u().get("intents/address/"+e).json()}async getForSession(e){return await u().get("modal/sessions/intents/"+e).json()}async getAll(e){return await u().get("intents",{searchParams:e}).json()}async create(e){return await u().post("intents",{json:e}).json()}async createForSession(e){return await u().post("modal/sessions/intents",{json:e}).json()}async update(e,s){return await u().post("intents",{json:s}).json()}async triggerProcessing(e){return await u().post(`intents/${e}/trigger-processing`).json()}async triggerProcessingForSession(e){return await u().post(`modal/sessions/intents/${e}/process`).json()}}class dt{async getFromSpecificBridge(e){return await u().get("quotes/single",{searchParams:e}).json()}async getFromAllBridges(e){return await u().get("quotes/multiple",{searchParams:e}).json()}async getBestAcrossBridges(e){return await u().get("quotes/best",{searchParams:e}).json()}async getAll(e){return await u().get("quotes/multi-source",{searchParams:e}).json()}async getAllForSession(e){return await u().get("modal/sessions/quotes",{searchParams:e}).json()}}class pt{async getOptimalRoutes(e){return await u().get("router/optimal-route",{searchParams:e}).json()}async getAllSupportedBridges(){return await u().get("router/supported-bridges/all").json()}async getSupportedBridges(e){return await u().get("router/supported-bridges/route",{searchParams:e}).json()}async getSupportedRoutes(e,s){return await u().get("router/supported-bridges/bridge/"+e,{searchParams:s}).json()}}class gt{async getSupported(e){return await u().get("chains",{searchParams:e}).json()}}class ft{async getClientInfo(){return await u().get("client/auth/client-info").json()}async getClientInfoForSession(){return await u().get("modal/sessions/client").json()}}class mt{getSessionToken(e){const s={recipient:e.recipient,tokenOut:ut(A[e.destinationChain?.replace("_MAINNET","")],L[e.token]),destinationChain:A[e.destinationChain?.replace("_MAINNET","")],amount:e.amount};return u().post("modal/sessions",{json:s}).json().then(n=>({...n,amount:s.amount}))}}const yt={router:new pt,quotes:new dt,intents:new ht,chains:new gt,client:new ft,auth:new mt};l.Chainrails=c,l.chains=A,l.crapi=yt,l.environment=_,l.getTokenDecimals=at,l.tokens=L,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
package/dist/index.d.ts CHANGED
@@ -4,7 +4,8 @@ import Router from "./src/Router";
4
4
  import Chains from "./src/Chains";
5
5
  import Client from "./src/Client";
6
6
  import Auth from "./src/Auth";
7
- import { chains, tokens, getTokenDecimals, Chainrails, environment } from "@chainrails/common";
7
+ import { Chainrails } from "./src/req";
8
+ import { chains, tokens, getTokenDecimals, environment } from "@chainrails/common";
8
9
  declare const crapi: {
9
10
  router: Router;
10
11
  quotes: Quotes;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/F,QAAA,MAAM,KAAK;;;;;;;CAOV,CAAC;AAEF,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEnF,QAAA,MAAM,KAAK;;;;;;;CAOV,CAAC;AAEF,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC"}
package/dist/src/req.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import ky from "ky";
2
+ import { Chainrails } from "@chainrails/common";
2
3
  declare global {
3
4
  interface Window {
4
5
  sessionStorage: Storage;
@@ -8,4 +9,5 @@ declare let req: ReturnType<typeof ky.create> | null;
8
9
  export declare function initClient(): void;
9
10
  export declare function getClient(): import("ky").KyInstance;
10
11
  export default req;
12
+ export { Chainrails };
11
13
  //# sourceMappingURL=req.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"req.d.ts","sourceRoot":"","sources":["../../src/req.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,cAAc,EAAE,OAAO,CAAC;KACzB;CACF;AAED,QAAA,IAAI,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,IAAW,CAAC;AAEpD,wBAAgB,UAAU,SAmBzB;AAED,wBAAgB,SAAS,4BAKxB;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"req.d.ts","sourceRoot":"","sources":["../../src/req.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,cAAc,EAAE,OAAO,CAAC;KACzB;CACF;AAED,QAAA,IAAI,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,IAAW,CAAC;AAEpD,wBAAgB,UAAU,SAmBzB;AAED,wBAAgB,SAAS,4BAKxB;AAED,eAAe,GAAG,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chainrails/sdk",
3
3
  "sideEffects": false,
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "main": "./dist/chainrails-sdk.umd.js",
6
6
  "module": "./dist/chainrails-sdk.es.mjs",
7
7
  "license": "MIT",