@chainrails/sdk 0.0.40 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chainrails-sdk.es.js +48 -36
- package/dist/chainrails-sdk.es.mjs +48 -36
- package/dist/chainrails-sdk.umd.js +2 -2
- package/dist/src/Intents/index.d.ts +4 -1
- package/dist/src/Intents/index.d.ts.map +1 -1
- package/dist/src/Intents/types.d.ts +12 -0
- package/dist/src/Intents/types.d.ts.map +1 -1
- package/dist/src/Quotes/index.d.ts +2 -1
- package/dist/src/Quotes/index.d.ts.map +1 -1
- package/dist/src/Quotes/types.d.ts +9 -0
- package/dist/src/Quotes/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import pe from "ky";
|
|
2
2
|
var h = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(h || {});
|
|
3
|
-
const
|
|
3
|
+
const P = {
|
|
4
4
|
type: "evm",
|
|
5
5
|
chainId: 42161,
|
|
6
6
|
name: "Arbitrum",
|
|
7
7
|
cctpDomain: 3,
|
|
8
8
|
logoURI: "/images/chains/arbitrum.svg"
|
|
9
|
-
},
|
|
9
|
+
}, F = {
|
|
10
10
|
type: "evm",
|
|
11
11
|
chainId: 421614,
|
|
12
12
|
name: "Arbitrum Sepolia",
|
|
13
13
|
cctpDomain: 3,
|
|
14
14
|
logoURI: "/images/chains/arbitrum.svg"
|
|
15
|
-
},
|
|
15
|
+
}, _ = {
|
|
16
16
|
type: "evm",
|
|
17
17
|
chainId: 8453,
|
|
18
18
|
name: "Base",
|
|
@@ -30,13 +30,13 @@ const j = {
|
|
|
30
30
|
name: "BNB Chain",
|
|
31
31
|
cctpDomain: null,
|
|
32
32
|
logoURI: "/images/chains/bsc.webp"
|
|
33
|
-
},
|
|
33
|
+
}, q = {
|
|
34
34
|
type: "evm",
|
|
35
35
|
chainId: 1,
|
|
36
36
|
name: "Ethereum",
|
|
37
37
|
cctpDomain: 0,
|
|
38
38
|
logoURI: "/images/chains/ethereum.svg"
|
|
39
|
-
},
|
|
39
|
+
}, K = {
|
|
40
40
|
type: "evm",
|
|
41
41
|
chainId: 11155111,
|
|
42
42
|
name: "Ethereum Sepolia",
|
|
@@ -128,7 +128,7 @@ class J extends g {
|
|
|
128
128
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function E(e, { dir: t, size: s = 32 } = {}) {
|
|
132
132
|
return typeof e == "string" ? de(e, { dir: t, size: s }) : ge(e, { dir: t, size: s });
|
|
133
133
|
}
|
|
134
134
|
function de(e, { dir: t, size: s = 32 } = {}) {
|
|
@@ -192,15 +192,15 @@ function ye(e, t = {}) {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
const a = `0x${(s && i < 0 ? (1n << BigInt(n * 8)) + BigInt(i) : i).toString(16)}`;
|
|
195
|
-
return n ?
|
|
195
|
+
return n ? E(a, { size: n }) : a;
|
|
196
196
|
}
|
|
197
197
|
const be = /* @__PURE__ */ new TextEncoder();
|
|
198
198
|
function Ie(e, t = {}) {
|
|
199
|
-
return typeof e == "number" || typeof e == "bigint" ?
|
|
199
|
+
return typeof e == "number" || typeof e == "bigint" ? Ee(e, t) : typeof e == "boolean" ? we(e, t) : T(e) ? Y(e, t) : Z(e, t);
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function we(e, t = {}) {
|
|
202
202
|
const s = new Uint8Array(1);
|
|
203
|
-
return s[0] = Number(e), typeof t.size == "number" ? (x(s, { size: t.size }),
|
|
203
|
+
return s[0] = Number(e), typeof t.size == "number" ? (x(s, { size: t.size }), E(s, { size: t.size })) : s;
|
|
204
204
|
}
|
|
205
205
|
const p = {
|
|
206
206
|
zero: 48,
|
|
@@ -220,7 +220,7 @@ function k(e) {
|
|
|
220
220
|
}
|
|
221
221
|
function Y(e, t = {}) {
|
|
222
222
|
let s = e;
|
|
223
|
-
t.size && (x(s, { size: t.size }), s =
|
|
223
|
+
t.size && (x(s, { size: t.size }), s = E(s, { dir: "right", size: t.size }));
|
|
224
224
|
let n = s.slice(2);
|
|
225
225
|
n.length % 2 && (n = `0${n}`);
|
|
226
226
|
const i = n.length / 2, r = new Uint8Array(i);
|
|
@@ -232,13 +232,13 @@ function Y(e, t = {}) {
|
|
|
232
232
|
}
|
|
233
233
|
return r;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Ee(e, t) {
|
|
236
236
|
const s = ye(e, t);
|
|
237
237
|
return Y(s);
|
|
238
238
|
}
|
|
239
239
|
function Z(e, t = {}) {
|
|
240
240
|
const s = be.encode(e);
|
|
241
|
-
return typeof t.size == "number" ? (x(s, { size: t.size }),
|
|
241
|
+
return typeof t.size == "number" ? (x(s, { size: t.size }), E(s, { dir: "right", size: t.size })) : s;
|
|
242
242
|
}
|
|
243
243
|
const I = /* @__PURE__ */ BigInt(2 ** 32 - 1), N = /* @__PURE__ */ BigInt(32);
|
|
244
244
|
function Se(e, t = !1) {
|
|
@@ -262,7 +262,7 @@ function B(e) {
|
|
|
262
262
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
263
263
|
throw new Error("positive integer expected, got " + e);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function w(e, ...t) {
|
|
266
266
|
if (!xe(e))
|
|
267
267
|
throw new Error("Uint8Array expected");
|
|
268
268
|
if (t.length > 0 && !t.includes(e.length))
|
|
@@ -275,7 +275,7 @@ function $(e, t = !0) {
|
|
|
275
275
|
throw new Error("Hash#digest() has already been called");
|
|
276
276
|
}
|
|
277
277
|
function De(e, t) {
|
|
278
|
-
|
|
278
|
+
w(e);
|
|
279
279
|
const s = t.outputLen;
|
|
280
280
|
if (e.length < s)
|
|
281
281
|
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
@@ -303,7 +303,7 @@ function $e(e) {
|
|
|
303
303
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
304
304
|
}
|
|
305
305
|
function te(e) {
|
|
306
|
-
return typeof e == "string" && (e = $e(e)),
|
|
306
|
+
return typeof e == "string" && (e = $e(e)), w(e), e;
|
|
307
307
|
}
|
|
308
308
|
class ze {
|
|
309
309
|
}
|
|
@@ -311,16 +311,16 @@ function Me(e) {
|
|
|
311
311
|
const t = (n) => e().update(te(n)).digest(), s = e();
|
|
312
312
|
return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
|
|
313
313
|
}
|
|
314
|
-
const Oe = BigInt(0), y = BigInt(1),
|
|
314
|
+
const Oe = BigInt(0), y = BigInt(1), je = BigInt(2), Pe = BigInt(7), Fe = BigInt(256), _e = BigInt(113), se = [], ne = [], ie = [];
|
|
315
315
|
for (let e = 0, t = y, s = 1, n = 0; e < 24; e++) {
|
|
316
316
|
[s, n] = [n, (2 * s + 3 * n) % 5], se.push(2 * (5 * n + s)), ne.push((e + 1) * (e + 2) / 2 % 64);
|
|
317
317
|
let i = Oe;
|
|
318
318
|
for (let r = 0; r < 7; r++)
|
|
319
|
-
t = (t << y ^ (t >>
|
|
319
|
+
t = (t << y ^ (t >> Pe) * _e) % Fe, t & je && (i ^= y << (y << /* @__PURE__ */ BigInt(r)) - y);
|
|
320
320
|
ie.push(i);
|
|
321
321
|
}
|
|
322
322
|
const oe = Ae(ie, !0), Le = oe[0], He = oe[1], M = (e, t, s) => s > 32 ? Ce(e, t, s) : Ue(e, t, s), O = (e, t, s) => s > 32 ? Te(e, t, s) : ve(e, t, s);
|
|
323
|
-
function
|
|
323
|
+
function qe(e, t = 24) {
|
|
324
324
|
const s = new Uint32Array(10);
|
|
325
325
|
for (let n = 24 - t; n < 24; n++) {
|
|
326
326
|
for (let o = 0; o < 10; o++)
|
|
@@ -356,10 +356,10 @@ class D extends ze {
|
|
|
356
356
|
return this._cloneInto();
|
|
357
357
|
}
|
|
358
358
|
keccak() {
|
|
359
|
-
z(this.state32),
|
|
359
|
+
z(this.state32), qe(this.state32, this.rounds), z(this.state32), this.posOut = 0, this.pos = 0;
|
|
360
360
|
}
|
|
361
361
|
update(t) {
|
|
362
|
-
$(this), t = te(t),
|
|
362
|
+
$(this), t = te(t), w(t);
|
|
363
363
|
const { blockLen: s, state: n } = this, i = t.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 D extends ze {
|
|
|
377
377
|
t[n] ^= s, (s & 128) !== 0 && n === i - 1 && this.keccak(), t[i - 1] ^= 128, this.keccak();
|
|
378
378
|
}
|
|
379
379
|
writeInto(t) {
|
|
380
|
-
$(this, !1),
|
|
380
|
+
$(this, !1), w(t), this.finish();
|
|
381
381
|
const s = this.state, { blockLen: n } = this;
|
|
382
382
|
for (let i = 0, r = t.length; i < r; ) {
|
|
383
383
|
this.posOut >= n && this.keccak();
|
|
@@ -410,7 +410,7 @@ class D extends ze {
|
|
|
410
410
|
return t || (t = new D(s, n, i, o, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = n, t.outputLen = i, t.enableXOF = o, t.destroyed = this.destroyed, t;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
const
|
|
413
|
+
const Ke = (e, t, s) => Me(() => new D(t, e, s)), Ve = Ke(1, 136, 256 / 8);
|
|
414
414
|
function Xe(e, t) {
|
|
415
415
|
return Ve(T(e, { strict: !1 }) ? Ie(e) : e);
|
|
416
416
|
}
|
|
@@ -470,7 +470,7 @@ function We(e, t) {
|
|
|
470
470
|
return U.set(n, i), i;
|
|
471
471
|
}
|
|
472
472
|
const Je = {
|
|
473
|
-
chainId:
|
|
473
|
+
chainId: F.chainId,
|
|
474
474
|
address: d("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
|
|
475
475
|
symbol: "USDC",
|
|
476
476
|
fiatISO: "USD",
|
|
@@ -478,7 +478,7 @@ const Je = {
|
|
|
478
478
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
479
479
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
480
480
|
}, Ye = {
|
|
481
|
-
chainId:
|
|
481
|
+
chainId: P.chainId,
|
|
482
482
|
address: d("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
483
483
|
symbol: "USDC",
|
|
484
484
|
name: "USD Coin",
|
|
@@ -510,7 +510,7 @@ const Je = {
|
|
|
510
510
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
511
511
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
512
512
|
}, st = {
|
|
513
|
-
chainId:
|
|
513
|
+
chainId: _.chainId,
|
|
514
514
|
address: d("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
515
515
|
symbol: "USDC",
|
|
516
516
|
fiatISO: "USD",
|
|
@@ -525,14 +525,14 @@ const Je = {
|
|
|
525
525
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
526
526
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
527
527
|
}, it = {
|
|
528
|
-
chainId:
|
|
528
|
+
chainId: K.chainId,
|
|
529
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
|
}, ot = {
|
|
535
|
-
chainId:
|
|
535
|
+
chainId: q.chainId,
|
|
536
536
|
address: d("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
|
|
537
537
|
symbol: "USDC",
|
|
538
538
|
decimals: 6,
|
|
@@ -545,16 +545,16 @@ const Je = {
|
|
|
545
545
|
decimals: 6,
|
|
546
546
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
547
547
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
548
|
-
},
|
|
548
|
+
}, j = {
|
|
549
549
|
ARBITRUM_MAINNET: {
|
|
550
|
-
...
|
|
550
|
+
...P,
|
|
551
551
|
tokens: {
|
|
552
552
|
[h.USDC]: Ye
|
|
553
553
|
},
|
|
554
554
|
explorer: "https://arbiscan.io"
|
|
555
555
|
},
|
|
556
556
|
ARBITRUM_TESTNET: {
|
|
557
|
-
...
|
|
557
|
+
...F,
|
|
558
558
|
explorer: "https://sepolia.arbiscan.io",
|
|
559
559
|
tokens: {
|
|
560
560
|
[h.USDC]: Je
|
|
@@ -575,7 +575,7 @@ const Je = {
|
|
|
575
575
|
explorer: "https://testnet.snowtrace.io"
|
|
576
576
|
},
|
|
577
577
|
BASE_MAINNET: {
|
|
578
|
-
...
|
|
578
|
+
..._,
|
|
579
579
|
tokens: {
|
|
580
580
|
[h.USDC]: st
|
|
581
581
|
},
|
|
@@ -596,14 +596,14 @@ const Je = {
|
|
|
596
596
|
explorer: "https://bscscan.com"
|
|
597
597
|
},
|
|
598
598
|
ETHEREUM_MAINNET: {
|
|
599
|
-
...
|
|
599
|
+
...q,
|
|
600
600
|
tokens: {
|
|
601
601
|
[h.USDC]: ot
|
|
602
602
|
},
|
|
603
603
|
explorer: "https://etherscan.io"
|
|
604
604
|
},
|
|
605
605
|
ETHEREUM_TESTNET: {
|
|
606
|
-
...
|
|
606
|
+
...K,
|
|
607
607
|
tokens: {
|
|
608
608
|
[h.USDC]: it
|
|
609
609
|
},
|
|
@@ -620,8 +620,8 @@ const Je = {
|
|
|
620
620
|
var v = /* @__PURE__ */ ((e) => (e.ARBITRUM = "ARBITRUM_MAINNET", e.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", e.AVALANCHE = "AVALANCHE_MAINNET", e.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", e.BASE = "BASE_MAINNET", e.BASE_TESTNET = "BASE_TESTNET", e.BSC = "BSC_MAINNET", e.ETHEREUM = "ETHEREUM_MAINNET", e.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", e.STARKNET = "STARKNET_MAINNET", e))(v || {}), ce = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(ce || {});
|
|
621
621
|
const at = (e) => {
|
|
622
622
|
const t = e?.trim().toUpperCase();
|
|
623
|
-
if (
|
|
624
|
-
return
|
|
623
|
+
if (j[t])
|
|
624
|
+
return j[t];
|
|
625
625
|
};
|
|
626
626
|
function ct(e, t) {
|
|
627
627
|
return at(e)?.tokens[t]?.address;
|
|
@@ -709,18 +709,27 @@ class lt {
|
|
|
709
709
|
async getForAddress(t) {
|
|
710
710
|
return await u().get("intents/address/" + t).json();
|
|
711
711
|
}
|
|
712
|
+
async getForSession(t) {
|
|
713
|
+
return await u().get("modal/sessions/intents/" + t).json();
|
|
714
|
+
}
|
|
712
715
|
async getAll(t) {
|
|
713
716
|
return await u().get("intents", { searchParams: t }).json();
|
|
714
717
|
}
|
|
715
718
|
async create(t) {
|
|
716
719
|
return await u().post("intents", { json: t }).json();
|
|
717
720
|
}
|
|
721
|
+
async createForSession(t) {
|
|
722
|
+
return await u().post("modal/sessions/intents", { json: t }).json();
|
|
723
|
+
}
|
|
718
724
|
async update(t, s) {
|
|
719
725
|
return await u().post("intents", { json: s }).json();
|
|
720
726
|
}
|
|
721
727
|
async triggerProcessing(t) {
|
|
722
728
|
return await u().post(`intents/${t}/trigger-processing`).json();
|
|
723
729
|
}
|
|
730
|
+
async triggerProcessingForSession(t) {
|
|
731
|
+
return await u().post(`modal/sessions/intents/${t}/process`).json();
|
|
732
|
+
}
|
|
724
733
|
}
|
|
725
734
|
class ht {
|
|
726
735
|
async getFromSpecificBridge(t) {
|
|
@@ -735,6 +744,9 @@ class ht {
|
|
|
735
744
|
async getAll(t) {
|
|
736
745
|
return await u().get("quotes/multi-source", { searchParams: t }).json();
|
|
737
746
|
}
|
|
747
|
+
async getAllForSession(t) {
|
|
748
|
+
return await u().get("modal/sessions/quotes", { searchParams: t }).json();
|
|
749
|
+
}
|
|
738
750
|
}
|
|
739
751
|
class pt {
|
|
740
752
|
async getOptimalRoutes(t) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import pe from "ky";
|
|
2
2
|
var h = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(h || {});
|
|
3
|
-
const
|
|
3
|
+
const P = {
|
|
4
4
|
type: "evm",
|
|
5
5
|
chainId: 42161,
|
|
6
6
|
name: "Arbitrum",
|
|
7
7
|
cctpDomain: 3,
|
|
8
8
|
logoURI: "/images/chains/arbitrum.svg"
|
|
9
|
-
},
|
|
9
|
+
}, F = {
|
|
10
10
|
type: "evm",
|
|
11
11
|
chainId: 421614,
|
|
12
12
|
name: "Arbitrum Sepolia",
|
|
13
13
|
cctpDomain: 3,
|
|
14
14
|
logoURI: "/images/chains/arbitrum.svg"
|
|
15
|
-
},
|
|
15
|
+
}, _ = {
|
|
16
16
|
type: "evm",
|
|
17
17
|
chainId: 8453,
|
|
18
18
|
name: "Base",
|
|
@@ -30,13 +30,13 @@ const j = {
|
|
|
30
30
|
name: "BNB Chain",
|
|
31
31
|
cctpDomain: null,
|
|
32
32
|
logoURI: "/images/chains/bsc.webp"
|
|
33
|
-
},
|
|
33
|
+
}, q = {
|
|
34
34
|
type: "evm",
|
|
35
35
|
chainId: 1,
|
|
36
36
|
name: "Ethereum",
|
|
37
37
|
cctpDomain: 0,
|
|
38
38
|
logoURI: "/images/chains/ethereum.svg"
|
|
39
|
-
},
|
|
39
|
+
}, K = {
|
|
40
40
|
type: "evm",
|
|
41
41
|
chainId: 11155111,
|
|
42
42
|
name: "Ethereum Sepolia",
|
|
@@ -128,7 +128,7 @@ class J extends g {
|
|
|
128
128
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function E(e, { dir: t, size: s = 32 } = {}) {
|
|
132
132
|
return typeof e == "string" ? de(e, { dir: t, size: s }) : ge(e, { dir: t, size: s });
|
|
133
133
|
}
|
|
134
134
|
function de(e, { dir: t, size: s = 32 } = {}) {
|
|
@@ -192,15 +192,15 @@ function ye(e, t = {}) {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
const a = `0x${(s && i < 0 ? (1n << BigInt(n * 8)) + BigInt(i) : i).toString(16)}`;
|
|
195
|
-
return n ?
|
|
195
|
+
return n ? E(a, { size: n }) : a;
|
|
196
196
|
}
|
|
197
197
|
const be = /* @__PURE__ */ new TextEncoder();
|
|
198
198
|
function Ie(e, t = {}) {
|
|
199
|
-
return typeof e == "number" || typeof e == "bigint" ?
|
|
199
|
+
return typeof e == "number" || typeof e == "bigint" ? Ee(e, t) : typeof e == "boolean" ? we(e, t) : T(e) ? Y(e, t) : Z(e, t);
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function we(e, t = {}) {
|
|
202
202
|
const s = new Uint8Array(1);
|
|
203
|
-
return s[0] = Number(e), typeof t.size == "number" ? (x(s, { size: t.size }),
|
|
203
|
+
return s[0] = Number(e), typeof t.size == "number" ? (x(s, { size: t.size }), E(s, { size: t.size })) : s;
|
|
204
204
|
}
|
|
205
205
|
const p = {
|
|
206
206
|
zero: 48,
|
|
@@ -220,7 +220,7 @@ function k(e) {
|
|
|
220
220
|
}
|
|
221
221
|
function Y(e, t = {}) {
|
|
222
222
|
let s = e;
|
|
223
|
-
t.size && (x(s, { size: t.size }), s =
|
|
223
|
+
t.size && (x(s, { size: t.size }), s = E(s, { dir: "right", size: t.size }));
|
|
224
224
|
let n = s.slice(2);
|
|
225
225
|
n.length % 2 && (n = `0${n}`);
|
|
226
226
|
const i = n.length / 2, r = new Uint8Array(i);
|
|
@@ -232,13 +232,13 @@ function Y(e, t = {}) {
|
|
|
232
232
|
}
|
|
233
233
|
return r;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Ee(e, t) {
|
|
236
236
|
const s = ye(e, t);
|
|
237
237
|
return Y(s);
|
|
238
238
|
}
|
|
239
239
|
function Z(e, t = {}) {
|
|
240
240
|
const s = be.encode(e);
|
|
241
|
-
return typeof t.size == "number" ? (x(s, { size: t.size }),
|
|
241
|
+
return typeof t.size == "number" ? (x(s, { size: t.size }), E(s, { dir: "right", size: t.size })) : s;
|
|
242
242
|
}
|
|
243
243
|
const I = /* @__PURE__ */ BigInt(2 ** 32 - 1), N = /* @__PURE__ */ BigInt(32);
|
|
244
244
|
function Se(e, t = !1) {
|
|
@@ -262,7 +262,7 @@ function B(e) {
|
|
|
262
262
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
263
263
|
throw new Error("positive integer expected, got " + e);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function w(e, ...t) {
|
|
266
266
|
if (!xe(e))
|
|
267
267
|
throw new Error("Uint8Array expected");
|
|
268
268
|
if (t.length > 0 && !t.includes(e.length))
|
|
@@ -275,7 +275,7 @@ function $(e, t = !0) {
|
|
|
275
275
|
throw new Error("Hash#digest() has already been called");
|
|
276
276
|
}
|
|
277
277
|
function De(e, t) {
|
|
278
|
-
|
|
278
|
+
w(e);
|
|
279
279
|
const s = t.outputLen;
|
|
280
280
|
if (e.length < s)
|
|
281
281
|
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
@@ -303,7 +303,7 @@ function $e(e) {
|
|
|
303
303
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
304
304
|
}
|
|
305
305
|
function te(e) {
|
|
306
|
-
return typeof e == "string" && (e = $e(e)),
|
|
306
|
+
return typeof e == "string" && (e = $e(e)), w(e), e;
|
|
307
307
|
}
|
|
308
308
|
class ze {
|
|
309
309
|
}
|
|
@@ -311,16 +311,16 @@ function Me(e) {
|
|
|
311
311
|
const t = (n) => e().update(te(n)).digest(), s = e();
|
|
312
312
|
return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
|
|
313
313
|
}
|
|
314
|
-
const Oe = BigInt(0), y = BigInt(1),
|
|
314
|
+
const Oe = BigInt(0), y = BigInt(1), je = BigInt(2), Pe = BigInt(7), Fe = BigInt(256), _e = BigInt(113), se = [], ne = [], ie = [];
|
|
315
315
|
for (let e = 0, t = y, s = 1, n = 0; e < 24; e++) {
|
|
316
316
|
[s, n] = [n, (2 * s + 3 * n) % 5], se.push(2 * (5 * n + s)), ne.push((e + 1) * (e + 2) / 2 % 64);
|
|
317
317
|
let i = Oe;
|
|
318
318
|
for (let r = 0; r < 7; r++)
|
|
319
|
-
t = (t << y ^ (t >>
|
|
319
|
+
t = (t << y ^ (t >> Pe) * _e) % Fe, t & je && (i ^= y << (y << /* @__PURE__ */ BigInt(r)) - y);
|
|
320
320
|
ie.push(i);
|
|
321
321
|
}
|
|
322
322
|
const oe = Ae(ie, !0), Le = oe[0], He = oe[1], M = (e, t, s) => s > 32 ? Ce(e, t, s) : Ue(e, t, s), O = (e, t, s) => s > 32 ? Te(e, t, s) : ve(e, t, s);
|
|
323
|
-
function
|
|
323
|
+
function qe(e, t = 24) {
|
|
324
324
|
const s = new Uint32Array(10);
|
|
325
325
|
for (let n = 24 - t; n < 24; n++) {
|
|
326
326
|
for (let o = 0; o < 10; o++)
|
|
@@ -356,10 +356,10 @@ class D extends ze {
|
|
|
356
356
|
return this._cloneInto();
|
|
357
357
|
}
|
|
358
358
|
keccak() {
|
|
359
|
-
z(this.state32),
|
|
359
|
+
z(this.state32), qe(this.state32, this.rounds), z(this.state32), this.posOut = 0, this.pos = 0;
|
|
360
360
|
}
|
|
361
361
|
update(t) {
|
|
362
|
-
$(this), t = te(t),
|
|
362
|
+
$(this), t = te(t), w(t);
|
|
363
363
|
const { blockLen: s, state: n } = this, i = t.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 D extends ze {
|
|
|
377
377
|
t[n] ^= s, (s & 128) !== 0 && n === i - 1 && this.keccak(), t[i - 1] ^= 128, this.keccak();
|
|
378
378
|
}
|
|
379
379
|
writeInto(t) {
|
|
380
|
-
$(this, !1),
|
|
380
|
+
$(this, !1), w(t), this.finish();
|
|
381
381
|
const s = this.state, { blockLen: n } = this;
|
|
382
382
|
for (let i = 0, r = t.length; i < r; ) {
|
|
383
383
|
this.posOut >= n && this.keccak();
|
|
@@ -410,7 +410,7 @@ class D extends ze {
|
|
|
410
410
|
return t || (t = new D(s, n, i, o, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = n, t.outputLen = i, t.enableXOF = o, t.destroyed = this.destroyed, t;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
const
|
|
413
|
+
const Ke = (e, t, s) => Me(() => new D(t, e, s)), Ve = Ke(1, 136, 256 / 8);
|
|
414
414
|
function Xe(e, t) {
|
|
415
415
|
return Ve(T(e, { strict: !1 }) ? Ie(e) : e);
|
|
416
416
|
}
|
|
@@ -470,7 +470,7 @@ function We(e, t) {
|
|
|
470
470
|
return U.set(n, i), i;
|
|
471
471
|
}
|
|
472
472
|
const Je = {
|
|
473
|
-
chainId:
|
|
473
|
+
chainId: F.chainId,
|
|
474
474
|
address: d("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
|
|
475
475
|
symbol: "USDC",
|
|
476
476
|
fiatISO: "USD",
|
|
@@ -478,7 +478,7 @@ const Je = {
|
|
|
478
478
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
479
479
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
480
480
|
}, Ye = {
|
|
481
|
-
chainId:
|
|
481
|
+
chainId: P.chainId,
|
|
482
482
|
address: d("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
483
483
|
symbol: "USDC",
|
|
484
484
|
name: "USD Coin",
|
|
@@ -510,7 +510,7 @@ const Je = {
|
|
|
510
510
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
511
511
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
512
512
|
}, st = {
|
|
513
|
-
chainId:
|
|
513
|
+
chainId: _.chainId,
|
|
514
514
|
address: d("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
515
515
|
symbol: "USDC",
|
|
516
516
|
fiatISO: "USD",
|
|
@@ -525,14 +525,14 @@ const Je = {
|
|
|
525
525
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
526
526
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
527
527
|
}, it = {
|
|
528
|
-
chainId:
|
|
528
|
+
chainId: K.chainId,
|
|
529
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
|
}, ot = {
|
|
535
|
-
chainId:
|
|
535
|
+
chainId: q.chainId,
|
|
536
536
|
address: d("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
|
|
537
537
|
symbol: "USDC",
|
|
538
538
|
decimals: 6,
|
|
@@ -545,16 +545,16 @@ const Je = {
|
|
|
545
545
|
decimals: 6,
|
|
546
546
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
547
547
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
548
|
-
},
|
|
548
|
+
}, j = {
|
|
549
549
|
ARBITRUM_MAINNET: {
|
|
550
|
-
...
|
|
550
|
+
...P,
|
|
551
551
|
tokens: {
|
|
552
552
|
[h.USDC]: Ye
|
|
553
553
|
},
|
|
554
554
|
explorer: "https://arbiscan.io"
|
|
555
555
|
},
|
|
556
556
|
ARBITRUM_TESTNET: {
|
|
557
|
-
...
|
|
557
|
+
...F,
|
|
558
558
|
explorer: "https://sepolia.arbiscan.io",
|
|
559
559
|
tokens: {
|
|
560
560
|
[h.USDC]: Je
|
|
@@ -575,7 +575,7 @@ const Je = {
|
|
|
575
575
|
explorer: "https://testnet.snowtrace.io"
|
|
576
576
|
},
|
|
577
577
|
BASE_MAINNET: {
|
|
578
|
-
...
|
|
578
|
+
..._,
|
|
579
579
|
tokens: {
|
|
580
580
|
[h.USDC]: st
|
|
581
581
|
},
|
|
@@ -596,14 +596,14 @@ const Je = {
|
|
|
596
596
|
explorer: "https://bscscan.com"
|
|
597
597
|
},
|
|
598
598
|
ETHEREUM_MAINNET: {
|
|
599
|
-
...
|
|
599
|
+
...q,
|
|
600
600
|
tokens: {
|
|
601
601
|
[h.USDC]: ot
|
|
602
602
|
},
|
|
603
603
|
explorer: "https://etherscan.io"
|
|
604
604
|
},
|
|
605
605
|
ETHEREUM_TESTNET: {
|
|
606
|
-
...
|
|
606
|
+
...K,
|
|
607
607
|
tokens: {
|
|
608
608
|
[h.USDC]: it
|
|
609
609
|
},
|
|
@@ -620,8 +620,8 @@ const Je = {
|
|
|
620
620
|
var v = /* @__PURE__ */ ((e) => (e.ARBITRUM = "ARBITRUM_MAINNET", e.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", e.AVALANCHE = "AVALANCHE_MAINNET", e.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", e.BASE = "BASE_MAINNET", e.BASE_TESTNET = "BASE_TESTNET", e.BSC = "BSC_MAINNET", e.ETHEREUM = "ETHEREUM_MAINNET", e.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", e.STARKNET = "STARKNET_MAINNET", e))(v || {}), ce = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(ce || {});
|
|
621
621
|
const at = (e) => {
|
|
622
622
|
const t = e?.trim().toUpperCase();
|
|
623
|
-
if (
|
|
624
|
-
return
|
|
623
|
+
if (j[t])
|
|
624
|
+
return j[t];
|
|
625
625
|
};
|
|
626
626
|
function ct(e, t) {
|
|
627
627
|
return at(e)?.tokens[t]?.address;
|
|
@@ -709,18 +709,27 @@ class lt {
|
|
|
709
709
|
async getForAddress(t) {
|
|
710
710
|
return await u().get("intents/address/" + t).json();
|
|
711
711
|
}
|
|
712
|
+
async getForSession(t) {
|
|
713
|
+
return await u().get("modal/sessions/intents/" + t).json();
|
|
714
|
+
}
|
|
712
715
|
async getAll(t) {
|
|
713
716
|
return await u().get("intents", { searchParams: t }).json();
|
|
714
717
|
}
|
|
715
718
|
async create(t) {
|
|
716
719
|
return await u().post("intents", { json: t }).json();
|
|
717
720
|
}
|
|
721
|
+
async createForSession(t) {
|
|
722
|
+
return await u().post("modal/sessions/intents", { json: t }).json();
|
|
723
|
+
}
|
|
718
724
|
async update(t, s) {
|
|
719
725
|
return await u().post("intents", { json: s }).json();
|
|
720
726
|
}
|
|
721
727
|
async triggerProcessing(t) {
|
|
722
728
|
return await u().post(`intents/${t}/trigger-processing`).json();
|
|
723
729
|
}
|
|
730
|
+
async triggerProcessingForSession(t) {
|
|
731
|
+
return await u().post(`modal/sessions/intents/${t}/process`).json();
|
|
732
|
+
}
|
|
724
733
|
}
|
|
725
734
|
class ht {
|
|
726
735
|
async getFromSpecificBridge(t) {
|
|
@@ -735,6 +744,9 @@ class ht {
|
|
|
735
744
|
async getAll(t) {
|
|
736
745
|
return await u().get("quotes/multi-source", { searchParams: t }).json();
|
|
737
746
|
}
|
|
747
|
+
async getAllForSession(t) {
|
|
748
|
+
return await u().get("modal/sessions/quotes", { searchParams: t }).json();
|
|
749
|
+
}
|
|
738
750
|
}
|
|
739
751
|
class pt {
|
|
740
752
|
async getOptimalRoutes(t) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(l,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("ky")):typeof define=="function"&&define.amd?define(["exports","ky"],b):(l=typeof globalThis<"u"?globalThis:l||self,b(l.Chainrails={},l.Ky))})(this,(function(l,b){"use strict";var h=(e=>(e.USDC="USDC",e))(h||{});const $={type:"evm",chainId:42161,name:"Arbitrum",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},z={type:"evm",chainId:421614,name:"Arbitrum Sepolia",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},M={type:"evm",chainId:8453,name:"Base",cctpDomain:6,logoURI:"/images/chains/base.webp"},O={type:"evm",chainId:84532,name:"Base Sepolia",cctpDomain:6,logoURI:"/images/chains/base.webp"},j={type:"evm",chainId:56,name:"BNB Chain",cctpDomain:null,logoURI:"/images/chains/bsc.webp"},P={type:"evm",chainId:1,name:"Ethereum",cctpDomain:0,logoURI:"/images/chains/ethereum.svg"},
|
|
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=t,this.version=q}walk(t){return V(this,t)}}function V(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?V(e.cause,t):t?null:e}class X extends f{constructor({size:t,targetSize:s,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}function E(e,{dir:t,size:s=32}={}){return typeof e=="string"?de(e,{dir:t,size:s}):pe(e,{dir:t,size:s})}function de(e,{dir:t,size:s=32}={}){if(s===null)return e;const n=e.replace("0x","");if(n.length>s*2)throw new X({size:Math.ceil(n.length/2),targetSize:s,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](s*2,"0")}`}function pe(e,{dir:t,size:s=32}={}){if(s===null)return e;if(e.length>s)throw new X({size:e.length,targetSize:s,type:"bytes"});const n=new Uint8Array(s);for(let i=0;i<s;i++){const r=t==="right";n[r?i:s-i-1]=e[r?i:e.length-i-1]}return n}class ge extends f{constructor({max:t,min:s,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${s} to ${t})`:`(above ${s})`}`,{name:"IntegerOutOfRangeError"})}}class fe extends f{constructor({givenSize:t,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function T(e,{size:t}){if(K(e)>t)throw new fe({givenSize:K(e),maxSize:t})}function me(e,t={}){const{signed:s,size:n}=t,i=BigInt(e);let r;n?s?r=(1n<<BigInt(n)*8n-1n)-1n:r=2n**(BigInt(n)*8n)-1n:typeof e=="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 e=="bigint"?"n":"";throw new ge({max:r?`${r}${d}`:void 0,min:`${o}${d}`,signed:s,size:n,value:`${e}${d}`})}const a=`0x${(s&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?E(a,{size:n}):a}const ye=new TextEncoder;function be(e,t={}){return typeof e=="number"||typeof e=="bigint"?Ee(e,t):typeof e=="boolean"?Ie(e,t):v(e)?Q(e,t):W(e,t)}function Ie(e,t={}){const s=new Uint8Array(1);return s[0]=Number(e),typeof t.size=="number"?(T(s,{size:t.size}),E(s,{size:t.size})):s}const p={zero:48,nine:57,A:65,F:70,a:97,f:102};function G(e){if(e>=p.zero&&e<=p.nine)return e-p.zero;if(e>=p.A&&e<=p.F)return e-(p.A-10);if(e>=p.a&&e<=p.f)return e-(p.a-10)}function Q(e,t={}){let s=e;t.size&&(T(s,{size:t.size}),s=E(s,{dir:"right",size:t.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=G(n.charCodeAt(a++)),m=G(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 Ee(e,t){const s=me(e,t);return Q(s)}function W(e,t={}){const s=ye.encode(e);return typeof t.size=="number"?(T(s,{size:t.size}),E(s,{dir:"right",size:t.size})):s}const w=BigInt(2**32-1),J=BigInt(32);function we(e,t=!1){return t?{h:Number(e&w),l:Number(e>>J&w)}:{h:Number(e>>J&w)|0,l:Number(e&w)|0}}function Se(e,t=!1){const s=e.length;let n=new Uint32Array(s),i=new Uint32Array(s);for(let r=0;r<s;r++){const{h:o,l:a}=we(e[r],t);[n[r],i[r]]=[o,a]}return[n,i]}const Ae=(e,t,s)=>e<<s|t>>>32-s,Ue=(e,t,s)=>t<<s|e>>>32-s,ve=(e,t,s)=>t<<s-32|e>>>64-s,Ce=(e,t,s)=>e<<s-32|t>>>64-s;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Te(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Y(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function S(e,...t){if(!Te(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Z(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function De(e,t){S(e);const s=t.outputLen;if(e.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function xe(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ee(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const ke=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Re(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Ne(e){for(let t=0;t<e.length;t++)e[t]=Re(e[t]);return e}const te=ke?e=>e:Ne;function Be(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function se(e){return typeof e=="string"&&(e=Be(e)),S(e),e}class $e{}function ze(e){const t=n=>e().update(se(n)).digest(),s=e();return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=()=>e(),t}const Me=BigInt(0),I=BigInt(1),Oe=BigInt(2),je=BigInt(7),Pe=BigInt(256),_e=BigInt(113),ne=[],ie=[],oe=[];for(let e=0,t=I,s=1,n=0;e<24;e++){[s,n]=[n,(2*s+3*n)%5],ne.push(2*(5*n+s)),ie.push((e+1)*(e+2)/2%64);let i=Me;for(let r=0;r<7;r++)t=(t<<I^(t>>je)*_e)%Pe,t&Oe&&(i^=I<<(I<<BigInt(r))-I);oe.push(i)}const re=Se(oe,!0),Fe=re[0],Le=re[1],ae=(e,t,s)=>s>32?ve(e,t,s):Ae(e,t,s),ce=(e,t,s)=>s>32?Ce(e,t,s):Ue(e,t,s);function He(e,t=24){const s=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let o=0;o<10;o++)s[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[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],mt=ae(m,y,1)^s[a],yt=ce(m,y,1)^s[a+1];for(let U=0;U<50;U+=10)e[o+U]^=mt,e[o+U+1]^=yt}let i=e[2],r=e[3];for(let o=0;o<24;o++){const a=ie[o],d=ae(i,r,a),m=ce(i,r,a),y=ne[o];i=e[y],r=e[y+1],e[y]=d,e[y+1]=m}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)s[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~s[(a+2)%10]&s[(a+4)%10]}e[0]^=Fe[n],e[1]^=Le[n]}ee(s)}class D extends $e{constructor(t,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=t,this.suffix=s,this.outputLen=n,this.enableXOF=i,this.rounds=r,Y(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=xe(this.state)}clone(){return this._cloneInto()}keccak(){te(this.state32),He(this.state32,this.rounds),te(this.state32),this.posOut=0,this.pos=0}update(t){Z(this),t=se(t),S(t);const{blockLen:s,state:n}=this,i=t.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++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:n,blockLen:i}=this;t[n]^=s,(s&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){Z(this,!1),S(t),this.finish();const s=this.state,{blockLen:n}=this;for(let i=0,r=t.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);t.set(s.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Y(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(De(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ee(this.state)}_cloneInto(t){const{blockLen:s,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return t||(t=new D(s,n,i,o,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=n,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}const Ke=(e,t,s)=>ze(()=>new D(t,e,s)),qe=Ke(1,136,256/8);function Ve(e,t){return qe(v(e,{strict:!1})?be(e):e)}class Xe extends f{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class ue extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const s=super.get(t);return super.has(t)&&s!==void 0&&(this.delete(t),super.set(t,s)),s}set(t,s){if(super.set(t,s),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const x=new ue(8192);function le(e,t){if(x.has(`${e}.${t}`))return x.get(`${e}.${t}`);const s=e.substring(2).toLowerCase(),n=Ve(W(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 x.set(`${e}.${t}`,r),r}function g(e,t){if(!Qe(e,{strict:!1}))throw new Xe({address:e});return le(e,t)}const Ge=/^0x[a-fA-F0-9]{40}$/,k=new ue(8192);function Qe(e,t){const{strict:s=!0}=t??{},n=`${e}.${s}`;if(k.has(n))return k.get(n);const i=Ge.test(e)?e.toLowerCase()===e?!0:s?le(e)===e:!0:!1;return k.set(n,i),i}const We={chainId:z.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"},Je={chainId:$.chainId,address:g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:"USDC",name:"USD Coin",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png"},Ye={chainId:L.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"},Ze={chainId:F.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"},et={chainId:O.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"},tt={chainId:M.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"},st={chainId:j.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"},nt={chainId:_.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"},it={chainId:P.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:H.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"},he={ARBITRUM_MAINNET:{...$,tokens:{[h.USDC]:Je},explorer:"https://arbiscan.io"},ARBITRUM_TESTNET:{...z,explorer:"https://sepolia.arbiscan.io",tokens:{[h.USDC]:We}},AVALANCHE_MAINNET:{...F,tokens:{[h.USDC]:Ze},explorer:"https://snowtrace.io"},AVALANCHE_TESTNET:{...L,tokens:{[h.USDC]:Ye},explorer:"https://testnet.snowtrace.io"},BASE_MAINNET:{...M,tokens:{[h.USDC]:tt},explorer:"https://basescan.org"},BASE_TESTNET:{...O,tokens:{[h.USDC]:et},explorer:"https://sepolia.basescan.org"},BSC_MAINNET:{...j,tokens:{[h.USDC]:st},explorer:"https://bscscan.com"},ETHEREUM_MAINNET:{...P,tokens:{[h.USDC]:it},explorer:"https://etherscan.io"},ETHEREUM_TESTNET:{..._,tokens:{[h.USDC]:nt},explorer:"https://sepolia.etherscan.io"},STARKNET_MAINNET:{...H,tokens:{[h.USDC]:ot},explorer:""}};var A=(e=>(e.ARBITRUM="ARBITRUM_MAINNET",e.ARBITRUM_TESTNET="ARBITRUM_TESTNET",e.AVALANCHE="AVALANCHE_MAINNET",e.AVALANCHE_TESTNET="AVALANCHE_TESTNET",e.BASE="BASE_MAINNET",e.BASE_TESTNET="BASE_TESTNET",e.BSC="BSC_MAINNET",e.ETHEREUM="ETHEREUM_MAINNET",e.ETHEREUM_TESTNET="ETHEREUM_TESTNET",e.STARKNET="STARKNET_MAINNET",e))(A||{}),R=(e=>(e.USDC="USDC",e))(R||{});const rt=e=>{const t=e?.trim().toUpperCase();if(he[t])return he[t]};function at(e,t){return rt(e)?.tokens[t]?.address}var N=(e=>(e.PRODUCTION="production",e.STAGING="staging",e))(N||{});class c{constructor({api_key:t,env:s,seesion_token:n}){this.api_key=t||"",this.sessionToken=n||"",this.env=s??N.PRODUCTION}static async config(t){if(!c.app){if(!t)throw new Error("Please provide an api_key");c.app=new c(t)}return t&&(t.api_key!==void 0&&(c.app.api_key=t.api_key),t.seesion_token!==void 0&&(c.app.sessionToken=t.seesion_token),t.env!==void 0&&(c.app.env=t.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(t,s,n,i){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const r=c.app.env==="internal"?"https://chainrails-frontend-git-staging-horus-labs.vercel.app":"https://app.chainrails.io",o=i&&i>0?"/pay/":"/deposit/",a=`_chain_/${t}/_token_/${s}/_to_/${n}${i?"/_amount_/"+i*100:""}`;return r+o+a}}let B=null;function ct(){B=b.create({prefixUrl:c.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[e=>{const t=c.getSessionToken()||c.getApiKey();e.headers.set("Authorization",`Bearer ${t}`)}],afterResponse:[(e,t,s)=>s]},retry:{limit:2}})}function u(){return B||ct(),B}class ut{async getById(t){return await u().get("intents/"+t).json()}async getForSender(t){return await u().get("intents/user/"+t).json()}async getForAddress(t){return await u().get("intents/address/"+t).json()}async getAll(t){return await u().get("intents",{searchParams:t}).json()}async create(t){return await u().post("intents",{json:t}).json()}async update(t,s){return await u().post("intents",{json:s}).json()}async triggerProcessing(t){return await u().post(`intents/${t}/trigger-processing`).json()}}class lt{async getFromSpecificBridge(t){return await u().get("quotes/single",{searchParams:t}).json()}async getFromAllBridges(t){return await u().get("quotes/multiple",{searchParams:t}).json()}async getBestAcrossBridges(t){return await u().get("quotes/best",{searchParams:t}).json()}async getAll(t){return await u().get("quotes/multi-source",{searchParams:t}).json()}}class ht{async getOptimalRoutes(t){return await u().get("router/optimal-route",{searchParams:t}).json()}async getAllSupportedBridges(){return await u().get("router/supported-bridges/all").json()}async getSupportedBridges(t){return await u().get("router/supported-bridges/route",{searchParams:t}).json()}async getSupportedRoutes(t,s){return await u().get("router/supported-bridges/bridge/"+t,{searchParams:s}).json()}}class dt{async getSupported(t){return await u().get("chains",{searchParams:t}).json()}}class pt{async getClientInfo(){return await u().get("client/auth/client-info").json()}}class gt{getSessionToken(t){const s={recipient:t.recipient,tokenOut:at(A[t.destinationChain],R[t.token]),destinationChain:A[t.destinationChain],amount:t.amount};return u().post("modal/sessions",{json:s}).json()}}const ft={router:new ht,quotes:new lt,intents:new ut,chains:new dt,client:new pt,auth:new gt};l.Chainrails=c,l.chains=A,l.crapi=ft,l.environment=N,l.tokens=R,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(l,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("ky")):typeof define=="function"&&define.amd?define(["exports","ky"],b):(l=typeof globalThis<"u"?globalThis:l||self,b(l.Chainrails={},l.Ky))})(this,(function(l,b){"use strict";var h=(e=>(e.USDC="USDC",e))(h||{});const $={type:"evm",chainId:42161,name:"Arbitrum",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},z={type:"evm",chainId:421614,name:"Arbitrum Sepolia",cctpDomain:3,logoURI:"/images/chains/arbitrum.svg"},M={type:"evm",chainId:8453,name:"Base",cctpDomain:6,logoURI:"/images/chains/base.webp"},O={type:"evm",chainId:84532,name:"Base Sepolia",cctpDomain:6,logoURI:"/images/chains/base.webp"},j={type:"evm",chainId:56,name:"BNB Chain",cctpDomain:null,logoURI:"/images/chains/bsc.webp"},P={type:"evm",chainId:1,name:"Ethereum",cctpDomain:0,logoURI:"/images/chains/ethereum.svg"},F={type:"evm",chainId:11155111,name:"Ethereum Sepolia",cctpDomain:0,logoURI:"/images/chains/ethereum.svg"},_={type:"evm",chainId:43114,name:"Avalanche",cctpDomain:1,logoURI:"/images/chains/avalanche.svg"},L={type:"evm",chainId:43113,name:"Avalanche Fuji",cctpDomain:1,logoURI:"/images/chains/avalanche.svg"},H={type:"starknet",chainId:"0x534e5f4d41494e",name:"Starknet",cctpDomain:null,logoURI:"/images/chains/starknet.svg"};function v(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function q(e){return v(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const K="2.43.4";let C={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:s})=>t?`${e??"https://viem.sh"}${t}${s?`#${s}`:""}`:void 0,version:`viem@${K}`};class f extends Error{constructor(t,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=[t||"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=t,this.version=K}walk(t){return V(this,t)}}function V(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?V(e.cause,t):t?null:e}class X extends f{constructor({size:t,targetSize:s,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}function w(e,{dir:t,size:s=32}={}){return typeof e=="string"?de(e,{dir:t,size:s}):pe(e,{dir:t,size:s})}function de(e,{dir:t,size:s=32}={}){if(s===null)return e;const n=e.replace("0x","");if(n.length>s*2)throw new X({size:Math.ceil(n.length/2),targetSize:s,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](s*2,"0")}`}function pe(e,{dir:t,size:s=32}={}){if(s===null)return e;if(e.length>s)throw new X({size:e.length,targetSize:s,type:"bytes"});const n=new Uint8Array(s);for(let i=0;i<s;i++){const r=t==="right";n[r?i:s-i-1]=e[r?i:e.length-i-1]}return n}class ge extends f{constructor({max:t,min:s,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${s} to ${t})`:`(above ${s})`}`,{name:"IntegerOutOfRangeError"})}}class fe extends f{constructor({givenSize:t,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function T(e,{size:t}){if(q(e)>t)throw new fe({givenSize:q(e),maxSize:t})}function me(e,t={}){const{signed:s,size:n}=t,i=BigInt(e);let r;n?s?r=(1n<<BigInt(n)*8n-1n)-1n:r=2n**(BigInt(n)*8n)-1n:typeof e=="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 e=="bigint"?"n":"";throw new ge({max:r?`${r}${d}`:void 0,min:`${o}${d}`,signed:s,size:n,value:`${e}${d}`})}const a=`0x${(s&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?w(a,{size:n}):a}const ye=new TextEncoder;function be(e,t={}){return typeof e=="number"||typeof e=="bigint"?we(e,t):typeof e=="boolean"?Ie(e,t):v(e)?Q(e,t):W(e,t)}function Ie(e,t={}){const s=new Uint8Array(1);return s[0]=Number(e),typeof t.size=="number"?(T(s,{size:t.size}),w(s,{size:t.size})):s}const p={zero:48,nine:57,A:65,F:70,a:97,f:102};function G(e){if(e>=p.zero&&e<=p.nine)return e-p.zero;if(e>=p.A&&e<=p.F)return e-(p.A-10);if(e>=p.a&&e<=p.f)return e-(p.a-10)}function Q(e,t={}){let s=e;t.size&&(T(s,{size:t.size}),s=w(s,{dir:"right",size:t.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=G(n.charCodeAt(a++)),m=G(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 we(e,t){const s=me(e,t);return Q(s)}function W(e,t={}){const s=ye.encode(e);return typeof t.size=="number"?(T(s,{size:t.size}),w(s,{dir:"right",size:t.size})):s}const E=BigInt(2**32-1),J=BigInt(32);function Ee(e,t=!1){return t?{h:Number(e&E),l:Number(e>>J&E)}:{h:Number(e>>J&E)|0,l:Number(e&E)|0}}function Se(e,t=!1){const s=e.length;let n=new Uint32Array(s),i=new Uint32Array(s);for(let r=0;r<s;r++){const{h:o,l:a}=Ee(e[r],t);[n[r],i[r]]=[o,a]}return[n,i]}const Ae=(e,t,s)=>e<<s|t>>>32-s,Ue=(e,t,s)=>t<<s|e>>>32-s,ve=(e,t,s)=>t<<s-32|e>>>64-s,Ce=(e,t,s)=>e<<s-32|t>>>64-s;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Te(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Y(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function S(e,...t){if(!Te(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Z(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function De(e,t){S(e);const s=t.outputLen;if(e.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function xe(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ee(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const ke=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Re(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Ne(e){for(let t=0;t<e.length;t++)e[t]=Re(e[t]);return e}const te=ke?e=>e:Ne;function Be(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function se(e){return typeof e=="string"&&(e=Be(e)),S(e),e}class $e{}function ze(e){const t=n=>e().update(se(n)).digest(),s=e();return t.outputLen=s.outputLen,t.blockLen=s.blockLen,t.create=()=>e(),t}const Me=BigInt(0),I=BigInt(1),Oe=BigInt(2),je=BigInt(7),Pe=BigInt(256),Fe=BigInt(113),ne=[],ie=[],oe=[];for(let e=0,t=I,s=1,n=0;e<24;e++){[s,n]=[n,(2*s+3*n)%5],ne.push(2*(5*n+s)),ie.push((e+1)*(e+2)/2%64);let i=Me;for(let r=0;r<7;r++)t=(t<<I^(t>>je)*Fe)%Pe,t&Oe&&(i^=I<<(I<<BigInt(r))-I);oe.push(i)}const re=Se(oe,!0),_e=re[0],Le=re[1],ae=(e,t,s)=>s>32?ve(e,t,s):Ae(e,t,s),ce=(e,t,s)=>s>32?Ce(e,t,s):Ue(e,t,s);function He(e,t=24){const s=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let o=0;o<10;o++)s[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[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],mt=ae(m,y,1)^s[a],yt=ce(m,y,1)^s[a+1];for(let U=0;U<50;U+=10)e[o+U]^=mt,e[o+U+1]^=yt}let i=e[2],r=e[3];for(let o=0;o<24;o++){const a=ie[o],d=ae(i,r,a),m=ce(i,r,a),y=ne[o];i=e[y],r=e[y+1],e[y]=d,e[y+1]=m}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)s[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~s[(a+2)%10]&s[(a+4)%10]}e[0]^=_e[n],e[1]^=Le[n]}ee(s)}class D extends $e{constructor(t,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=t,this.suffix=s,this.outputLen=n,this.enableXOF=i,this.rounds=r,Y(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=xe(this.state)}clone(){return this._cloneInto()}keccak(){te(this.state32),He(this.state32,this.rounds),te(this.state32),this.posOut=0,this.pos=0}update(t){Z(this),t=se(t),S(t);const{blockLen:s,state:n}=this,i=t.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++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:n,blockLen:i}=this;t[n]^=s,(s&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){Z(this,!1),S(t),this.finish();const s=this.state,{blockLen:n}=this;for(let i=0,r=t.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);t.set(s.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Y(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(De(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ee(this.state)}_cloneInto(t){const{blockLen:s,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return t||(t=new D(s,n,i,o,r)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=n,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}const qe=(e,t,s)=>ze(()=>new D(t,e,s)),Ke=qe(1,136,256/8);function Ve(e,t){return Ke(v(e,{strict:!1})?be(e):e)}class Xe extends f{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class ue extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const s=super.get(t);return super.has(t)&&s!==void 0&&(this.delete(t),super.set(t,s)),s}set(t,s){if(super.set(t,s),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const x=new ue(8192);function le(e,t){if(x.has(`${e}.${t}`))return x.get(`${e}.${t}`);const s=e.substring(2).toLowerCase(),n=Ve(W(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 x.set(`${e}.${t}`,r),r}function g(e,t){if(!Qe(e,{strict:!1}))throw new Xe({address:e});return le(e,t)}const Ge=/^0x[a-fA-F0-9]{40}$/,k=new ue(8192);function Qe(e,t){const{strict:s=!0}=t??{},n=`${e}.${s}`;if(k.has(n))return k.get(n);const i=Ge.test(e)?e.toLowerCase()===e?!0:s?le(e)===e:!0:!1;return k.set(n,i),i}const We={chainId:z.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"},Je={chainId:$.chainId,address:g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:"USDC",name:"USD Coin",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png"},Ye={chainId:L.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"},Ze={chainId:_.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"},et={chainId:O.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"},tt={chainId:M.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"},st={chainId:j.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"},nt={chainId:F.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"},it={chainId:P.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:H.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"},he={ARBITRUM_MAINNET:{...$,tokens:{[h.USDC]:Je},explorer:"https://arbiscan.io"},ARBITRUM_TESTNET:{...z,explorer:"https://sepolia.arbiscan.io",tokens:{[h.USDC]:We}},AVALANCHE_MAINNET:{..._,tokens:{[h.USDC]:Ze},explorer:"https://snowtrace.io"},AVALANCHE_TESTNET:{...L,tokens:{[h.USDC]:Ye},explorer:"https://testnet.snowtrace.io"},BASE_MAINNET:{...M,tokens:{[h.USDC]:tt},explorer:"https://basescan.org"},BASE_TESTNET:{...O,tokens:{[h.USDC]:et},explorer:"https://sepolia.basescan.org"},BSC_MAINNET:{...j,tokens:{[h.USDC]:st},explorer:"https://bscscan.com"},ETHEREUM_MAINNET:{...P,tokens:{[h.USDC]:it},explorer:"https://etherscan.io"},ETHEREUM_TESTNET:{...F,tokens:{[h.USDC]:nt},explorer:"https://sepolia.etherscan.io"},STARKNET_MAINNET:{...H,tokens:{[h.USDC]:ot},explorer:""}};var A=(e=>(e.ARBITRUM="ARBITRUM_MAINNET",e.ARBITRUM_TESTNET="ARBITRUM_TESTNET",e.AVALANCHE="AVALANCHE_MAINNET",e.AVALANCHE_TESTNET="AVALANCHE_TESTNET",e.BASE="BASE_MAINNET",e.BASE_TESTNET="BASE_TESTNET",e.BSC="BSC_MAINNET",e.ETHEREUM="ETHEREUM_MAINNET",e.ETHEREUM_TESTNET="ETHEREUM_TESTNET",e.STARKNET="STARKNET_MAINNET",e))(A||{}),R=(e=>(e.USDC="USDC",e))(R||{});const rt=e=>{const t=e?.trim().toUpperCase();if(he[t])return he[t]};function at(e,t){return rt(e)?.tokens[t]?.address}var N=(e=>(e.PRODUCTION="production",e.STAGING="staging",e))(N||{});class c{constructor({api_key:t,env:s,seesion_token:n}){this.api_key=t||"",this.sessionToken=n||"",this.env=s??N.PRODUCTION}static async config(t){if(!c.app){if(!t)throw new Error("Please provide an api_key");c.app=new c(t)}return t&&(t.api_key!==void 0&&(c.app.api_key=t.api_key),t.seesion_token!==void 0&&(c.app.sessionToken=t.seesion_token),t.env!==void 0&&(c.app.env=t.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(t,s,n,i){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const r=c.app.env==="internal"?"https://chainrails-frontend-git-staging-horus-labs.vercel.app":"https://app.chainrails.io",o=i&&i>0?"/pay/":"/deposit/",a=`_chain_/${t}/_token_/${s}/_to_/${n}${i?"/_amount_/"+i*100:""}`;return r+o+a}}let B=null;function ct(){B=b.create({prefixUrl:c.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[e=>{const t=c.getSessionToken()||c.getApiKey();e.headers.set("Authorization",`Bearer ${t}`)}],afterResponse:[(e,t,s)=>s]},retry:{limit:2}})}function u(){return B||ct(),B}class ut{async getById(t){return await u().get("intents/"+t).json()}async getForSender(t){return await u().get("intents/user/"+t).json()}async getForAddress(t){return await u().get("intents/address/"+t).json()}async getForSession(t){return await u().get("modal/sessions/intents/"+t).json()}async getAll(t){return await u().get("intents",{searchParams:t}).json()}async create(t){return await u().post("intents",{json:t}).json()}async createForSession(t){return await u().post("modal/sessions/intents",{json:t}).json()}async update(t,s){return await u().post("intents",{json:s}).json()}async triggerProcessing(t){return await u().post(`intents/${t}/trigger-processing`).json()}async triggerProcessingForSession(t){return await u().post(`modal/sessions/intents/${t}/process`).json()}}class lt{async getFromSpecificBridge(t){return await u().get("quotes/single",{searchParams:t}).json()}async getFromAllBridges(t){return await u().get("quotes/multiple",{searchParams:t}).json()}async getBestAcrossBridges(t){return await u().get("quotes/best",{searchParams:t}).json()}async getAll(t){return await u().get("quotes/multi-source",{searchParams:t}).json()}async getAllForSession(t){return await u().get("modal/sessions/quotes",{searchParams:t}).json()}}class ht{async getOptimalRoutes(t){return await u().get("router/optimal-route",{searchParams:t}).json()}async getAllSupportedBridges(){return await u().get("router/supported-bridges/all").json()}async getSupportedBridges(t){return await u().get("router/supported-bridges/route",{searchParams:t}).json()}async getSupportedRoutes(t,s){return await u().get("router/supported-bridges/bridge/"+t,{searchParams:s}).json()}}class dt{async getSupported(t){return await u().get("chains",{searchParams:t}).json()}}class pt{async getClientInfo(){return await u().get("client/auth/client-info").json()}}class gt{getSessionToken(t){const s={recipient:t.recipient,tokenOut:at(A[t.destinationChain],R[t.token]),destinationChain:A[t.destinationChain],amount:t.amount};return u().post("modal/sessions",{json:s}).json()}}const ft={router:new ht,quotes:new lt,intents:new ut,chains:new dt,client:new pt,auth:new gt};l.Chainrails=c,l.chains=A,l.crapi=ft,l.environment=N,l.tokens=R,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { Intent, Status } from "src/types";
|
|
2
|
-
import { createIntentInput, getAllIntentsInput, getAllIntentsOutput, triggerProcessingOutput } from "./types";
|
|
2
|
+
import { createIntentForSessionInput, createIntentInput, getAllIntentsInput, getAllIntentsOutput, triggerProcessingOutput } from "./types";
|
|
3
3
|
export default class Intents {
|
|
4
4
|
getById(id: string): Promise<Intent>;
|
|
5
5
|
getForSender(sender: `0x${string}`): Promise<Intent[]>;
|
|
6
6
|
getForAddress(address: `0x${string}`): Promise<Intent>;
|
|
7
|
+
getForSession(address: `0x${string}`): Promise<Intent[]>;
|
|
7
8
|
getAll(searchParams: getAllIntentsInput): Promise<getAllIntentsOutput>;
|
|
8
9
|
create(json: createIntentInput): Promise<Intent>;
|
|
10
|
+
createForSession(json: createIntentForSessionInput): Promise<Intent>;
|
|
9
11
|
update(id: string, json: {
|
|
10
12
|
status: Status;
|
|
11
13
|
}): Promise<Intent>;
|
|
12
14
|
triggerProcessing(intentAddress: `0x${string}`): Promise<triggerProcessingOutput>;
|
|
15
|
+
triggerProcessingForSession(intentAddress: `0x${string}`): Promise<triggerProcessingOutput>;
|
|
13
16
|
}
|
|
14
17
|
export * from "./types";
|
|
15
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Intents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,OAAO;IACpB,OAAO,CAAC,EAAE,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Intents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,OAAO;IACpB,OAAO,CAAC,EAAE,EAAE,MAAM;IAMlB,YAAY,CAAC,MAAM,EAAE,KAAK,MAAM,EAAE;IAMlC,aAAa,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE;IAMpC,aAAa,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE;IAMpC,MAAM,CAAC,YAAY,EAAE,kBAAkB;IAIvC,MAAM,CAAC,IAAI,EAAE,iBAAiB;IAI9B,gBAAgB,CAAC,IAAI,EAAE,2BAA2B;IAIlD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAI3C,iBAAiB,CAAC,aAAa,EAAE,KAAK,MAAM,EAAE;IAI9C,2BAA2B,CAAC,aAAa,EAAE,KAAK,MAAM,EAAE;CAG/D;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -23,6 +23,18 @@ export interface createIntentInput {
|
|
|
23
23
|
reference: string;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
+
export interface createIntentForSessionInput {
|
|
27
|
+
sender: `0x${string}`;
|
|
28
|
+
amount: string;
|
|
29
|
+
tokenIn: `0x${string}`;
|
|
30
|
+
source_chain: string;
|
|
31
|
+
recipient: `0x${string}`;
|
|
32
|
+
refund_address: `0x${string}`;
|
|
33
|
+
metadata: {
|
|
34
|
+
description: string;
|
|
35
|
+
reference: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
26
38
|
export interface triggerProcessingOutput {
|
|
27
39
|
success: boolean;
|
|
28
40
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Intents/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC5D,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Intents/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC5D,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { getAllInput, getAllOutput, getBestAcrossBridgesInput, getBestAcrossBridgesOutput, getFromAllBridgesInput, getFromAllBridgesOutput, getFromSpecificBridgeInput, getFromSpecificBridgeOutput } from "./types";
|
|
1
|
+
import { getAllForSessionInput, getAllInput, getAllOutput, getBestAcrossBridgesInput, getBestAcrossBridgesOutput, getFromAllBridgesInput, getFromAllBridgesOutput, getFromSpecificBridgeInput, getFromSpecificBridgeOutput } from "./types";
|
|
2
2
|
export default class Quotes {
|
|
3
3
|
getFromSpecificBridge(input: getFromSpecificBridgeInput): Promise<getFromSpecificBridgeOutput>;
|
|
4
4
|
getFromAllBridges(input: getFromAllBridgesInput): Promise<getFromAllBridgesOutput>;
|
|
5
5
|
getBestAcrossBridges(input: getBestAcrossBridgesInput): Promise<getBestAcrossBridgesOutput>;
|
|
6
6
|
getAll(input: getAllInput): Promise<getAllOutput>;
|
|
7
|
+
getAllForSession(input: getAllForSessionInput): Promise<getBestAcrossBridgesOutput>;
|
|
7
8
|
}
|
|
8
9
|
export * from "./types";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Quotes/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,MAAM;IACnB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Quotes/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,MAAM;IACnB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B;IAIvD,iBAAiB,CAAC,KAAK,EAAE,sBAAsB;IAI/C,oBAAoB,CAAC,KAAK,EAAE,yBAAyB;IAIrD,MAAM,CAAC,KAAK,EAAE,WAAW;IAIzB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB;CAGpD;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -57,4 +57,13 @@ export interface getAllOutput {
|
|
|
57
57
|
quotes: Quote[];
|
|
58
58
|
cheapestOption: Quote;
|
|
59
59
|
}
|
|
60
|
+
export interface getAllForSessionInput {
|
|
61
|
+
amount: string;
|
|
62
|
+
[key: string]: string | number | boolean | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface getAllForSessionOutput {
|
|
65
|
+
destinationChain: chains;
|
|
66
|
+
quotes: Quote[];
|
|
67
|
+
cheapestOption: Quote;
|
|
68
|
+
}
|
|
60
69
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Quotes/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Quotes/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,2BAA2B;IAC1C,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,cAAc,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,cAAc,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACxC,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,cAAc,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,cAAc,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,cAAc,EAAE,KAAK,CAAC;CACvB"}
|