@chainrails/sdk 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import ae from "ky";
2
- const c = {
2
+ const d = {
3
3
  ARBITRUM: "ARBITRUM_MAINNET",
4
4
  ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
5
5
  AVALANCHE: "AVALANCHE_MAINNET",
@@ -18,7 +18,7 @@ const c = {
18
18
  POLYGON: "POLYGON_MAINNET",
19
19
  STARKNET: "STARKNET_MAINNET",
20
20
  STARKNET_TESTNET: "STARKNET_TESTNET"
21
- }, ts = {
21
+ }, as = {
22
22
  ARBITRUM: "ARBITRUM",
23
23
  ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
24
24
  AVALANCHE: "AVALANCHE",
@@ -38,20 +38,20 @@ const c = {
38
38
  STARKNET: "STARKNET",
39
39
  STARKNET_TESTNET: "STARKNET_TESTNET"
40
40
  };
41
- function w(s, { strict: e = !0 } = {}) {
41
+ function v(s, { strict: e = !0 } = {}) {
42
42
  return !s || typeof s != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(s) : s.startsWith("0x");
43
43
  }
44
44
  function x(s) {
45
- return w(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
45
+ return v(s, { strict: !1 }) ? Math.ceil((s.length - 2) / 2) : s.length;
46
46
  }
47
- const L = "2.43.4";
47
+ const j = "2.43.4";
48
48
  let I = {
49
49
  getDocsUrl: ({ docsBaseUrl: s, docsPath: e = "", docsSlug: n }) => e ? `${s ?? "https://viem.sh"}${e}${n ? `#${n}` : ""}` : void 0,
50
- version: `viem@${L}`
50
+ version: `viem@${j}`
51
51
  };
52
- class E extends Error {
52
+ class T extends Error {
53
53
  constructor(e, n = {}) {
54
- const a = n.cause instanceof E ? n.cause.details : n.cause?.message ? n.cause.message : n.details, o = n.cause instanceof E && n.cause.docsPath || n.docsPath, r = I.getDocsUrl?.({ ...n, docsPath: o }), i = [
54
+ const a = n.cause instanceof T ? n.cause.details : n.cause?.message ? n.cause.message : n.details, o = n.cause instanceof T && n.cause.docsPath || n.docsPath, r = I.getDocsUrl?.({ ...n, docsPath: o }), i = [
55
55
  e || "An error occurred.",
56
56
  "",
57
57
  ...n.metaMessages ? [...n.metaMessages, ""] : [],
@@ -90,16 +90,16 @@ class E extends Error {
90
90
  configurable: !0,
91
91
  writable: !0,
92
92
  value: "BaseError"
93
- }), this.details = a, this.docsPath = o, this.metaMessages = n.metaMessages, this.name = n.name ?? this.name, this.shortMessage = e, this.version = L;
93
+ }), this.details = a, this.docsPath = o, this.metaMessages = n.metaMessages, this.name = n.name ?? this.name, this.shortMessage = e, this.version = j;
94
94
  }
95
95
  walk(e) {
96
- return j(this, e);
96
+ return z(this, e);
97
97
  }
98
98
  }
99
- function j(s, e) {
100
- return e?.(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? j(s.cause, e) : e ? null : s;
99
+ function z(s, e) {
100
+ return e?.(s) ? s : s && typeof s == "object" && "cause" in s && s.cause !== void 0 ? z(s.cause, e) : e ? null : s;
101
101
  }
102
- class K extends E {
102
+ class K extends T {
103
103
  constructor({ size: e, targetSize: n, type: a }) {
104
104
  super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`, { name: "SizeExceedsPaddingSizeError" });
105
105
  }
@@ -135,17 +135,17 @@ function ie(s, { dir: e, size: n = 32 } = {}) {
135
135
  }
136
136
  return a;
137
137
  }
138
- class re extends E {
138
+ class re extends T {
139
139
  constructor({ max: e, min: n, signed: a, size: o, value: r }) {
140
140
  super(`Number "${r}" is not in safe ${o ? `${o * 8}-bit ${a ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${n} to ${e})` : `(above ${n})`}`, { name: "IntegerOutOfRangeError" });
141
141
  }
142
142
  }
143
- class ce extends E {
143
+ class ce extends T {
144
144
  constructor({ givenSize: e, maxSize: n }) {
145
145
  super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
146
146
  }
147
147
  }
148
- function N(s, { size: e }) {
148
+ function w(s, { size: e }) {
149
149
  if (x(s) > e)
150
150
  throw new ce({
151
151
  givenSize: x(s),
@@ -158,27 +158,27 @@ function de(s, e = {}) {
158
158
  a ? n ? r = (1n << BigInt(a) * 8n - 1n) - 1n : r = 2n ** (BigInt(a) * 8n) - 1n : typeof s == "number" && (r = BigInt(Number.MAX_SAFE_INTEGER));
159
159
  const i = typeof r == "bigint" && n ? -r - 1n : 0;
160
160
  if (r && o > r || o < i) {
161
- const m = typeof s == "bigint" ? "n" : "";
161
+ const h = typeof s == "bigint" ? "n" : "";
162
162
  throw new re({
163
- max: r ? `${r}${m}` : void 0,
164
- min: `${i}${m}`,
163
+ max: r ? `${r}${h}` : void 0,
164
+ min: `${i}${h}`,
165
165
  signed: n,
166
166
  size: a,
167
- value: `${s}${m}`
167
+ value: `${s}${h}`
168
168
  });
169
169
  }
170
- const d = `0x${(n && o < 0 ? (1n << BigInt(a * 8)) + BigInt(o) : o).toString(16)}`;
171
- return a ? U(d, { size: a }) : d;
170
+ const l = `0x${(n && o < 0 ? (1n << BigInt(a * 8)) + BigInt(o) : o).toString(16)}`;
171
+ return a ? U(l, { size: a }) : l;
172
172
  }
173
173
  const le = /* @__PURE__ */ new TextEncoder();
174
174
  function ue(s, e = {}) {
175
- return typeof s == "number" || typeof s == "bigint" ? fe(s, e) : typeof s == "boolean" ? ge(s, e) : w(s) ? W(s, e) : V(s, e);
175
+ return typeof s == "number" || typeof s == "bigint" ? me(s, e) : typeof s == "boolean" ? ge(s, e) : v(s) ? W(s, e) : V(s, e);
176
176
  }
177
177
  function ge(s, e = {}) {
178
178
  const n = new Uint8Array(1);
179
- return n[0] = Number(s), typeof e.size == "number" ? (N(n, { size: e.size }), U(n, { size: e.size })) : n;
179
+ return n[0] = Number(s), typeof e.size == "number" ? (w(n, { size: e.size }), U(n, { size: e.size })) : n;
180
180
  }
181
- const T = {
181
+ const E = {
182
182
  zero: 48,
183
183
  nine: 57,
184
184
  A: 65,
@@ -186,50 +186,50 @@ const T = {
186
186
  a: 97,
187
187
  f: 102
188
188
  };
189
- function M(s) {
190
- if (s >= T.zero && s <= T.nine)
191
- return s - T.zero;
192
- if (s >= T.A && s <= T.F)
193
- return s - (T.A - 10);
194
- if (s >= T.a && s <= T.f)
195
- return s - (T.a - 10);
189
+ function O(s) {
190
+ if (s >= E.zero && s <= E.nine)
191
+ return s - E.zero;
192
+ if (s >= E.A && s <= E.F)
193
+ return s - (E.A - 10);
194
+ if (s >= E.a && s <= E.f)
195
+ return s - (E.a - 10);
196
196
  }
197
197
  function W(s, e = {}) {
198
198
  let n = s;
199
- e.size && (N(n, { size: e.size }), n = U(n, { dir: "right", size: e.size }));
199
+ e.size && (w(n, { size: e.size }), n = U(n, { dir: "right", size: e.size }));
200
200
  let a = n.slice(2);
201
201
  a.length % 2 && (a = `0${a}`);
202
202
  const o = a.length / 2, r = new Uint8Array(o);
203
- for (let i = 0, d = 0; i < o; i++) {
204
- const m = M(a.charCodeAt(d++)), S = M(a.charCodeAt(d++));
205
- if (m === void 0 || S === void 0)
206
- throw new E(`Invalid byte sequence ("${a[d - 2]}${a[d - 1]}" in "${a}").`);
207
- r[i] = m * 16 + S;
203
+ for (let i = 0, l = 0; i < o; i++) {
204
+ const h = O(a.charCodeAt(l++)), S = O(a.charCodeAt(l++));
205
+ if (h === void 0 || S === void 0)
206
+ throw new T(`Invalid byte sequence ("${a[l - 2]}${a[l - 1]}" in "${a}").`);
207
+ r[i] = h * 16 + S;
208
208
  }
209
209
  return r;
210
210
  }
211
- function fe(s, e) {
211
+ function me(s, e) {
212
212
  const n = de(s, e);
213
213
  return W(n);
214
214
  }
215
215
  function V(s, e = {}) {
216
216
  const n = le.encode(s);
217
- return typeof e.size == "number" ? (N(n, { size: e.size }), U(n, { dir: "right", size: e.size })) : n;
217
+ return typeof e.size == "number" ? (w(n, { size: e.size }), U(n, { dir: "right", size: e.size })) : n;
218
218
  }
219
- const A = /* @__PURE__ */ BigInt(2 ** 32 - 1), O = /* @__PURE__ */ BigInt(32);
220
- function he(s, e = !1) {
221
- return e ? { h: Number(s & A), l: Number(s >> O & A) } : { h: Number(s >> O & A) | 0, l: Number(s & A) | 0 };
219
+ const b = /* @__PURE__ */ BigInt(2 ** 32 - 1), M = /* @__PURE__ */ BigInt(32);
220
+ function fe(s, e = !1) {
221
+ return e ? { h: Number(s & b), l: Number(s >> M & b) } : { h: Number(s >> M & b) | 0, l: Number(s & b) | 0 };
222
222
  }
223
- function me(s, e = !1) {
223
+ function he(s, e = !1) {
224
224
  const n = s.length;
225
225
  let a = new Uint32Array(n), o = new Uint32Array(n);
226
226
  for (let r = 0; r < n; r++) {
227
- const { h: i, l: d } = he(s[r], e);
228
- [a[r], o[r]] = [i, d];
227
+ const { h: i, l } = fe(s[r], e);
228
+ [a[r], o[r]] = [i, l];
229
229
  }
230
230
  return [a, o];
231
231
  }
232
- const Te = (s, e, n) => s << n | e >>> 32 - n, Ee = (s, e, n) => e << n | s >>> 32 - n, Se = (s, e, n) => e << n - 32 | s >>> 64 - n, pe = (s, e, n) => s << n - 32 | e >>> 64 - n;
232
+ const Ee = (s, e, n) => s << n | e >>> 32 - n, Te = (s, e, n) => e << n | s >>> 32 - n, Se = (s, e, n) => e << n - 32 | s >>> 64 - n, pe = (s, e, n) => s << n - 32 | e >>> 64 - n;
233
233
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
234
234
  function Ce(s) {
235
235
  return s instanceof Uint8Array || ArrayBuffer.isView(s) && s.constructor.name === "Uint8Array";
@@ -238,32 +238,32 @@ function F(s) {
238
238
  if (!Number.isSafeInteger(s) || s < 0)
239
239
  throw new Error("positive integer expected, got " + s);
240
240
  }
241
- function D(s, ...e) {
241
+ function A(s, ...e) {
242
242
  if (!Ce(s))
243
243
  throw new Error("Uint8Array expected");
244
244
  if (e.length > 0 && !e.includes(s.length))
245
245
  throw new Error("Uint8Array expected of length " + e + ", got length=" + s.length);
246
246
  }
247
- function H(s, e = !0) {
247
+ function P(s, e = !0) {
248
248
  if (s.destroyed)
249
249
  throw new Error("Hash instance has been destroyed");
250
250
  if (e && s.finished)
251
251
  throw new Error("Hash#digest() has already been called");
252
252
  }
253
- function be(s, e) {
254
- D(s);
253
+ function De(s, e) {
254
+ A(s);
255
255
  const n = e.outputLen;
256
256
  if (s.length < n)
257
257
  throw new Error("digestInto() expects output buffer of length at least " + n);
258
258
  }
259
- function Ae(s) {
259
+ function be(s) {
260
260
  return new Uint32Array(s.buffer, s.byteOffset, Math.floor(s.byteLength / 4));
261
261
  }
262
- function Y(...s) {
262
+ function G(...s) {
263
263
  for (let e = 0; e < s.length; e++)
264
264
  s[e].fill(0);
265
265
  }
266
- const De = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
266
+ const Ae = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
267
267
  function Ue(s) {
268
268
  return s << 24 & 4278190080 | s << 8 & 16711680 | s >>> 8 & 65280 | s >>> 24 & 255;
269
269
  }
@@ -272,74 +272,74 @@ function Ie(s) {
272
272
  s[e] = Ue(s[e]);
273
273
  return s;
274
274
  }
275
- const $ = De ? (s) => s : Ie;
275
+ const H = Ae ? (s) => s : Ie;
276
276
  function ye(s) {
277
277
  if (typeof s != "string")
278
278
  throw new Error("string expected");
279
279
  return new Uint8Array(new TextEncoder().encode(s));
280
280
  }
281
- function G(s) {
282
- return typeof s == "string" && (s = ye(s)), D(s), s;
281
+ function Y(s) {
282
+ return typeof s == "string" && (s = ye(s)), A(s), s;
283
283
  }
284
- class ke {
284
+ class Re {
285
285
  }
286
- function Re(s) {
287
- const e = (a) => s().update(G(a)).digest(), n = s();
286
+ function ke(s) {
287
+ const e = (a) => s().update(Y(a)).digest(), n = s();
288
288
  return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = () => s(), e;
289
289
  }
290
- const ve = BigInt(0), C = BigInt(1), we = BigInt(2), Ne = BigInt(7), Be = BigInt(256), xe = BigInt(113), q = [], X = [], Q = [];
290
+ const Ne = BigInt(0), C = BigInt(1), ve = BigInt(2), we = BigInt(7), Be = BigInt(256), xe = BigInt(113), q = [], X = [], Q = [];
291
291
  for (let s = 0, e = C, n = 1, a = 0; s < 24; s++) {
292
292
  [n, a] = [a, (2 * n + 3 * a) % 5], q.push(2 * (5 * a + n)), X.push((s + 1) * (s + 2) / 2 % 64);
293
- let o = ve;
293
+ let o = Ne;
294
294
  for (let r = 0; r < 7; r++)
295
- e = (e << C ^ (e >> Ne) * xe) % Be, e & we && (o ^= C << (C << /* @__PURE__ */ BigInt(r)) - C);
295
+ e = (e << C ^ (e >> we) * xe) % Be, e & ve && (o ^= C << (C << /* @__PURE__ */ BigInt(r)) - C);
296
296
  Q.push(o);
297
297
  }
298
- const J = me(Q, !0), Me = J[0], Oe = J[1], P = (s, e, n) => n > 32 ? Se(s, e, n) : Te(s, e, n), z = (s, e, n) => n > 32 ? pe(s, e, n) : Ee(s, e, n);
298
+ const J = he(Q, !0), Oe = J[0], Me = J[1], $ = (s, e, n) => n > 32 ? Se(s, e, n) : Ee(s, e, n), L = (s, e, n) => n > 32 ? pe(s, e, n) : Te(s, e, n);
299
299
  function Fe(s, e = 24) {
300
300
  const n = new Uint32Array(10);
301
301
  for (let a = 24 - e; a < 24; a++) {
302
302
  for (let i = 0; i < 10; i++)
303
303
  n[i] = s[i] ^ s[i + 10] ^ s[i + 20] ^ s[i + 30] ^ s[i + 40];
304
304
  for (let i = 0; i < 10; i += 2) {
305
- const d = (i + 8) % 10, m = (i + 2) % 10, S = n[m], p = n[m + 1], ne = P(S, p, 1) ^ n[d], te = z(S, p, 1) ^ n[d + 1];
306
- for (let b = 0; b < 50; b += 10)
307
- s[i + b] ^= ne, s[i + b + 1] ^= te;
305
+ const l = (i + 8) % 10, h = (i + 2) % 10, S = n[h], p = n[h + 1], ne = $(S, p, 1) ^ n[l], te = L(S, p, 1) ^ n[l + 1];
306
+ for (let D = 0; D < 50; D += 10)
307
+ s[i + D] ^= ne, s[i + D + 1] ^= te;
308
308
  }
309
309
  let o = s[2], r = s[3];
310
310
  for (let i = 0; i < 24; i++) {
311
- const d = X[i], m = P(o, r, d), S = z(o, r, d), p = q[i];
312
- o = s[p], r = s[p + 1], s[p] = m, s[p + 1] = S;
311
+ const l = X[i], h = $(o, r, l), S = L(o, r, l), p = q[i];
312
+ o = s[p], r = s[p + 1], s[p] = h, s[p + 1] = S;
313
313
  }
314
314
  for (let i = 0; i < 50; i += 10) {
315
- for (let d = 0; d < 10; d++)
316
- n[d] = s[i + d];
317
- for (let d = 0; d < 10; d++)
318
- s[i + d] ^= ~n[(d + 2) % 10] & n[(d + 4) % 10];
315
+ for (let l = 0; l < 10; l++)
316
+ n[l] = s[i + l];
317
+ for (let l = 0; l < 10; l++)
318
+ s[i + l] ^= ~n[(l + 2) % 10] & n[(l + 4) % 10];
319
319
  }
320
- s[0] ^= Me[a], s[1] ^= Oe[a];
320
+ s[0] ^= Oe[a], s[1] ^= Me[a];
321
321
  }
322
- Y(n);
322
+ G(n);
323
323
  }
324
- class B extends ke {
324
+ class B extends Re {
325
325
  // NOTE: we accept arguments in bytes instead of bits here.
326
326
  constructor(e, n, a, o = !1, r = 24) {
327
327
  if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = n, this.outputLen = a, this.enableXOF = o, this.rounds = r, F(a), !(0 < e && e < 200))
328
328
  throw new Error("only keccak-f1600 function is supported");
329
- this.state = new Uint8Array(200), this.state32 = Ae(this.state);
329
+ this.state = new Uint8Array(200), this.state32 = be(this.state);
330
330
  }
331
331
  clone() {
332
332
  return this._cloneInto();
333
333
  }
334
334
  keccak() {
335
- $(this.state32), Fe(this.state32, this.rounds), $(this.state32), this.posOut = 0, this.pos = 0;
335
+ H(this.state32), Fe(this.state32, this.rounds), H(this.state32), this.posOut = 0, this.pos = 0;
336
336
  }
337
337
  update(e) {
338
- H(this), e = G(e), D(e);
338
+ P(this), e = Y(e), A(e);
339
339
  const { blockLen: n, state: a } = this, o = e.length;
340
340
  for (let r = 0; r < o; ) {
341
341
  const i = Math.min(n - this.pos, o - r);
342
- for (let d = 0; d < i; d++)
342
+ for (let l = 0; l < i; l++)
343
343
  a[this.pos++] ^= e[r++];
344
344
  this.pos === n && this.keccak();
345
345
  }
@@ -353,7 +353,7 @@ class B extends ke {
353
353
  e[a] ^= n, (n & 128) !== 0 && a === o - 1 && this.keccak(), e[o - 1] ^= 128, this.keccak();
354
354
  }
355
355
  writeInto(e) {
356
- H(this, !1), D(e), this.finish();
356
+ P(this, !1), A(e), this.finish();
357
357
  const n = this.state, { blockLen: a } = this;
358
358
  for (let o = 0, r = e.length; o < r; ) {
359
359
  this.posOut >= a && this.keccak();
@@ -371,7 +371,7 @@ class B extends ke {
371
371
  return F(e), this.xofInto(new Uint8Array(e));
372
372
  }
373
373
  digestInto(e) {
374
- if (be(e, this), this.finished)
374
+ if (De(e, this), this.finished)
375
375
  throw new Error("digest() was already called");
376
376
  return this.writeInto(e), this.destroy(), e;
377
377
  }
@@ -379,18 +379,18 @@ class B extends ke {
379
379
  return this.digestInto(new Uint8Array(this.outputLen));
380
380
  }
381
381
  destroy() {
382
- this.destroyed = !0, Y(this.state);
382
+ this.destroyed = !0, G(this.state);
383
383
  }
384
384
  _cloneInto(e) {
385
385
  const { blockLen: n, suffix: a, outputLen: o, rounds: r, enableXOF: i } = this;
386
386
  return e || (e = new B(n, a, o, i, r)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = a, e.outputLen = o, e.enableXOF = i, e.destroyed = this.destroyed, e;
387
387
  }
388
388
  }
389
- const He = (s, e, n) => Re(() => new B(e, s, n)), $e = He(1, 136, 256 / 8);
390
- function Pe(s, e) {
391
- return $e(w(s, { strict: !1 }) ? ue(s) : s);
389
+ const Pe = (s, e, n) => ke(() => new B(e, s, n)), He = Pe(1, 136, 256 / 8);
390
+ function $e(s, e) {
391
+ return He(v(s, { strict: !1 }) ? ue(s) : s);
392
392
  }
393
- class ze extends E {
393
+ class Le extends T {
394
394
  constructor({ address: e }) {
395
395
  super(`Address "${e}" is invalid.`, {
396
396
  metaMessages: [
@@ -426,24 +426,24 @@ const y = /* @__PURE__ */ new Z(8192);
426
426
  function ee(s, e) {
427
427
  if (y.has(`${s}.${e}`))
428
428
  return y.get(`${s}.${e}`);
429
- const n = s.substring(2).toLowerCase(), a = Pe(V(n)), o = n.split("");
429
+ const n = s.substring(2).toLowerCase(), a = $e(V(n)), o = n.split("");
430
430
  for (let i = 0; i < 40; i += 2)
431
431
  a[i >> 1] >> 4 >= 8 && o[i] && (o[i] = o[i].toUpperCase()), (a[i >> 1] & 15) >= 8 && o[i + 1] && (o[i + 1] = o[i + 1].toUpperCase());
432
432
  const r = `0x${o.join("")}`;
433
433
  return y.set(`${s}.${e}`, r), r;
434
434
  }
435
435
  function g(s, e) {
436
- if (!Le(s, { strict: !1 }))
437
- throw new ze({ address: s });
436
+ if (!je(s, { strict: !1 }))
437
+ throw new Le({ address: s });
438
438
  return ee(s, e);
439
439
  }
440
- const _e = /^0x[a-fA-F0-9]{40}$/, k = /* @__PURE__ */ new Z(8192);
441
- function Le(s, e) {
440
+ const _e = /^0x[a-fA-F0-9]{40}$/, R = /* @__PURE__ */ new Z(8192);
441
+ function je(s, e) {
442
442
  const { strict: n = !0 } = e ?? {}, a = `${s}.${n}`;
443
- if (k.has(a))
444
- return k.get(a);
443
+ if (R.has(a))
444
+ return R.get(a);
445
445
  const o = _e.test(s) ? s.toLowerCase() === s ? !0 : n ? ee(s) === s : !0 : !1;
446
- return k.set(a, o), o;
446
+ return R.set(a, o), o;
447
447
  }
448
448
  const t = {
449
449
  USDC: "USDC",
@@ -458,8 +458,8 @@ const t = {
458
458
  LORDS: "LORDS"
459
459
  };
460
460
  t.USDC;
461
- const h = {
462
- [c.ARBITRUM]: {
461
+ const f = {
462
+ [d.ARBITRUM]: {
463
463
  [t.DAI]: {
464
464
  address: g("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
465
465
  symbol: t.DAI,
@@ -501,7 +501,7 @@ const h = {
501
501
  nativeToken: !1
502
502
  }
503
503
  },
504
- [c.ARBITRUM_TESTNET]: {
504
+ [d.ARBITRUM_TESTNET]: {
505
505
  [t.USDC]: {
506
506
  address: g("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
507
507
  symbol: t.USDC,
@@ -513,7 +513,7 @@ const h = {
513
513
  nativeToken: !1
514
514
  }
515
515
  },
516
- [c.AVALANCHE]: {
516
+ [d.AVALANCHE]: {
517
517
  [t.DAI]: {
518
518
  address: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",
519
519
  symbol: t.DAI,
@@ -549,7 +549,7 @@ const h = {
549
549
  nativeToken: !1
550
550
  }
551
551
  },
552
- [c.AVALANCHE_TESTNET]: {
552
+ [d.AVALANCHE_TESTNET]: {
553
553
  [t.USDC]: {
554
554
  address: g("0x5425890298aed601595a70AB815c96711a31Bc65"),
555
555
  symbol: t.USDC,
@@ -561,7 +561,7 @@ const h = {
561
561
  nativeToken: !1
562
562
  }
563
563
  },
564
- [c.BASE]: {
564
+ [d.BASE]: {
565
565
  [t.DAI]: {
566
566
  address: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
567
567
  symbol: t.DAI,
@@ -605,7 +605,7 @@ const h = {
605
605
  nativeToken: !1
606
606
  }
607
607
  },
608
- [c.BASE_TESTNET]: {
608
+ [d.BASE_TESTNET]: {
609
609
  [t.USDC]: {
610
610
  address: g("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
611
611
  symbol: t.USDC,
@@ -617,7 +617,7 @@ const h = {
617
617
  nativeToken: !1
618
618
  }
619
619
  },
620
- [c.BSC]: {
620
+ [d.BSC]: {
621
621
  [t.BNB]: {
622
622
  address: "0x0000000000000000000000000000000000000000",
623
623
  symbol: t.BNB,
@@ -668,7 +668,7 @@ const h = {
668
668
  nativeToken: !1
669
669
  }
670
670
  },
671
- [c.ETHEREUM]: {
671
+ [d.ETHEREUM]: {
672
672
  [t.BUSD]: {
673
673
  address: "0x4Fabb145d64652a948d72533023f6E7A623C7C53",
674
674
  symbol: t.BUSD,
@@ -735,7 +735,7 @@ const h = {
735
735
  nativeToken: !1
736
736
  }
737
737
  },
738
- [c.ETHEREUM_TESTNET]: {
738
+ [d.ETHEREUM_TESTNET]: {
739
739
  [t.USDC]: {
740
740
  address: g("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
741
741
  symbol: t.USDC,
@@ -746,7 +746,7 @@ const h = {
746
746
  nativeToken: !1
747
747
  }
748
748
  },
749
- [c.HYPEREVM]: {
749
+ [d.HYPEREVM]: {
750
750
  [t.USDC]: {
751
751
  address: "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
752
752
  symbol: t.USDC,
@@ -756,7 +756,7 @@ const h = {
756
756
  nativeToken: !1
757
757
  }
758
758
  },
759
- [c.LISK]: {
759
+ [d.LISK]: {
760
760
  [t.USDC]: {
761
761
  address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
762
762
  symbol: t.USDC,
@@ -766,7 +766,7 @@ const h = {
766
766
  nativeToken: !1
767
767
  }
768
768
  },
769
- [c.MONAD]: {
769
+ [d.MONAD]: {
770
770
  [t.USDC]: {
771
771
  address: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
772
772
  symbol: t.USDC,
@@ -776,7 +776,7 @@ const h = {
776
776
  nativeToken: !1
777
777
  }
778
778
  },
779
- [c.MONAD_TESTNET]: {
779
+ [d.MONAD_TESTNET]: {
780
780
  [t.USDC]: {
781
781
  address: "0x534b2f3A21130d7a60830c2Df862319e593943A3",
782
782
  symbol: t.USDC,
@@ -786,7 +786,7 @@ const h = {
786
786
  nativeToken: !1
787
787
  }
788
788
  },
789
- [c.OPTIMISM]: {
789
+ [d.OPTIMISM]: {
790
790
  [t.DAI]: {
791
791
  address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
792
792
  symbol: t.DAI,
@@ -828,7 +828,7 @@ const h = {
828
828
  nativeToken: !1
829
829
  }
830
830
  },
831
- [c.OPTIMISM_TESTNET]: {
831
+ [d.OPTIMISM_TESTNET]: {
832
832
  [t.USDC]: {
833
833
  address: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7",
834
834
  symbol: t.USDC,
@@ -838,7 +838,7 @@ const h = {
838
838
  nativeToken: !1
839
839
  }
840
840
  },
841
- [c.POLYGON]: {
841
+ [d.POLYGON]: {
842
842
  [t.DAI]: {
843
843
  address: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
844
844
  symbol: t.DAI,
@@ -872,7 +872,7 @@ const h = {
872
872
  nativeToken: !1
873
873
  }
874
874
  },
875
- [c.STARKNET]: {
875
+ [d.STARKNET]: {
876
876
  [t.DAI]: {
877
877
  address: "0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",
878
878
  symbol: t.DAI,
@@ -923,7 +923,7 @@ const h = {
923
923
  nativeToken: !1
924
924
  }
925
925
  },
926
- [c.STARKNET_TESTNET]: {
926
+ [d.STARKNET_TESTNET]: {
927
927
  [t.USDC]: {
928
928
  address: "0x0512feAc6339Ff7889822cb5aA2a86C848e9D392bB0E3E237C008674feeD8343",
929
929
  symbol: t.USDC,
@@ -933,31 +933,31 @@ const h = {
933
933
  nativeToken: !1
934
934
  }
935
935
  }
936
- }, as = {
937
- ARBITRUM: h[c.ARBITRUM],
938
- ARBITRUM_TESTNET: h[c.ARBITRUM_TESTNET],
939
- AVALANCHE: h[c.AVALANCHE],
940
- AVALANCHE_TESTNET: h[c.AVALANCHE_TESTNET],
941
- BASE: h[c.BASE],
942
- BASE_TESTNET: h[c.BASE_TESTNET],
943
- BSC: h[c.BSC],
944
- ETHEREUM: h[c.ETHEREUM],
945
- ETHEREUM_TESTNET: h[c.ETHEREUM_TESTNET],
946
- STARKNET: h[c.STARKNET]
947
- }, je = new Set(Object.values(c));
948
- function f(s) {
936
+ }, os = {
937
+ ARBITRUM: f[d.ARBITRUM],
938
+ ARBITRUM_TESTNET: f[d.ARBITRUM_TESTNET],
939
+ AVALANCHE: f[d.AVALANCHE],
940
+ AVALANCHE_TESTNET: f[d.AVALANCHE_TESTNET],
941
+ BASE: f[d.BASE],
942
+ BASE_TESTNET: f[d.BASE_TESTNET],
943
+ BSC: f[d.BSC],
944
+ ETHEREUM: f[d.ETHEREUM],
945
+ ETHEREUM_TESTNET: f[d.ETHEREUM_TESTNET],
946
+ STARKNET: f[d.STARKNET]
947
+ }, ze = new Set(Object.values(d));
948
+ function m(s) {
949
949
  if (Ke(s))
950
950
  return s;
951
- const e = c[s];
951
+ const e = d[s];
952
952
  if (!e)
953
953
  throw new Error(`Invalid chain: ${s}. Chain must be a valid chain alias or internal chain value from Chains.`);
954
954
  return e;
955
955
  }
956
956
  function Ke(s) {
957
- return je.has(s);
957
+ return ze.has(s);
958
958
  }
959
959
  function We(s, e) {
960
- const n = e.toLowerCase().trim(), a = h[s];
960
+ const n = e.toLowerCase().trim(), a = f[s];
961
961
  if (!a)
962
962
  throw new Error(
963
963
  `Chain not found: ${s}. The chain key must be a valid chain identifier.`
@@ -976,7 +976,7 @@ function We(s, e) {
976
976
  );
977
977
  return o;
978
978
  }
979
- function R(s, e, n) {
979
+ function k(s, e, n) {
980
980
  const a = We(s, e);
981
981
  if (a.symbol !== n)
982
982
  throw new Error(
@@ -985,7 +985,7 @@ function R(s, e, n) {
985
985
  return a;
986
986
  }
987
987
  function Ve(s, e) {
988
- return h[s]?.[e];
988
+ return f[s]?.[e];
989
989
  }
990
990
  function _(s, e) {
991
991
  return Ve(s, e)?.address;
@@ -1044,9 +1044,9 @@ class u {
1044
1044
  return n + o + r;
1045
1045
  }
1046
1046
  }
1047
- let v = null;
1048
- function Ye() {
1049
- v = ae.create({
1047
+ let N = null;
1048
+ function Ge() {
1049
+ N = ae.create({
1050
1050
  prefixUrl: u.getBaseUrl(),
1051
1051
  headers: {
1052
1052
  "Content-Type": "application/json"
@@ -1065,28 +1065,28 @@ function Ye() {
1065
1065
  }
1066
1066
  });
1067
1067
  }
1068
- function l() {
1069
- return v || Ye(), v;
1068
+ function c() {
1069
+ return N || Ge(), N;
1070
1070
  }
1071
- class Ge {
1071
+ class Ye {
1072
1072
  async getById(e) {
1073
- return await l().get("intents/" + e).json();
1073
+ return await c().get("intents/" + e).json();
1074
1074
  }
1075
1075
  async getForSender(e) {
1076
- return await l().get("intents/user/" + e).json();
1076
+ return await c().get("intents/user/" + e).json();
1077
1077
  }
1078
1078
  async getForAddress(e) {
1079
- return await l().get("intents/address/" + e).json();
1079
+ return await c().get("intents/address/" + e).json();
1080
1080
  }
1081
1081
  async getForSession(e) {
1082
- return await l().get("modal/sessions/intents/" + e).json();
1082
+ return await c().get("modal/sessions/intents/" + e).json();
1083
1083
  }
1084
1084
  async getAll(e) {
1085
- return await l().get("intents", { searchParams: e }).json();
1085
+ return await c().get("intents", { searchParams: e }).json();
1086
1086
  }
1087
1087
  async create(e) {
1088
- const n = f(e.source_chain), a = f(e.destination_chain);
1089
- return await l().post("intents", {
1088
+ const n = m(e.source_chain), a = m(e.destination_chain);
1089
+ return await c().post("intents", {
1090
1090
  json: {
1091
1091
  ...e,
1092
1092
  source_chain: n,
@@ -1095,27 +1095,27 @@ class Ge {
1095
1095
  }).json();
1096
1096
  }
1097
1097
  async createForSession(e) {
1098
- const n = f(e.sourceChain);
1099
- return await l().post("modal/sessions/intents", {
1098
+ const n = m(e.sourceChain);
1099
+ return await c().post("modal/sessions/intents", {
1100
1100
  json: { ...e, sourceChain: n }
1101
1101
  }).json();
1102
1102
  }
1103
1103
  async update(e, n) {
1104
- return await l().post("intents", { json: n }).json();
1104
+ return await c().post("intents", { json: n }).json();
1105
1105
  }
1106
1106
  async triggerProcessing(e) {
1107
- return await l().post(`intents/${e}/trigger-processing`).json();
1107
+ return await c().post(`intents/${e}/trigger-processing`).json();
1108
1108
  }
1109
1109
  async triggerProcessingForSession(e) {
1110
- return await l().post(`modal/sessions/intents/${e}/process`).json();
1110
+ return await c().post(`modal/sessions/intents/${e}/process`).json();
1111
1111
  }
1112
1112
  }
1113
1113
  class qe {
1114
1114
  async getFromSpecificBridge(e) {
1115
- const n = f(e.sourceChain);
1116
- R(n, e.tokenIn, e.amountSymbol);
1117
- const a = f(e.destinationChain);
1118
- return await l().get("quotes/single", {
1115
+ const n = m(e.sourceChain);
1116
+ k(n, e.tokenIn, e.amountSymbol);
1117
+ const a = m(e.destinationChain);
1118
+ return await c().get("quotes/single", {
1119
1119
  searchParams: {
1120
1120
  ...e,
1121
1121
  sourceChain: n,
@@ -1124,10 +1124,10 @@ class qe {
1124
1124
  }).json();
1125
1125
  }
1126
1126
  async getFromAllBridges(e) {
1127
- const n = f(e.sourceChain);
1128
- R(n, e.tokenIn, e.amountSymbol);
1129
- const a = f(e.destinationChain);
1130
- return await l().get("quotes/multiple", {
1127
+ const n = m(e.sourceChain);
1128
+ k(n, e.tokenIn, e.amountSymbol);
1129
+ const a = m(e.destinationChain);
1130
+ return await c().get("quotes/multiple", {
1131
1131
  searchParams: {
1132
1132
  ...e,
1133
1133
  sourceChain: n,
@@ -1136,30 +1136,30 @@ class qe {
1136
1136
  }).json();
1137
1137
  }
1138
1138
  async getBestAcrossBridges(e) {
1139
- const n = f(e.sourceChain);
1140
- R(n, e.tokenIn, e.amountSymbol);
1141
- const a = f(e.destinationChain);
1142
- return await l().get("quotes/best", { searchParams: {
1139
+ const n = m(e.sourceChain);
1140
+ k(n, e.tokenIn, e.amountSymbol);
1141
+ const a = m(e.destinationChain);
1142
+ return await c().get("quotes/best", { searchParams: {
1143
1143
  ...e,
1144
1144
  sourceChain: n,
1145
1145
  destinationChain: a
1146
1146
  } }).json();
1147
1147
  }
1148
1148
  async getAll(e) {
1149
- const n = f(e.destinationChain);
1150
- return await l().get("quotes/multi-source", { searchParams: {
1149
+ const n = m(e.destinationChain);
1150
+ return await c().get("quotes/multi-source", { searchParams: {
1151
1151
  ...e,
1152
1152
  destinationChain: n
1153
1153
  } }).json();
1154
1154
  }
1155
1155
  async getAllForSession(e) {
1156
- return await l().get("modal/sessions/quotes", { searchParams: e }).json();
1156
+ return await c().get("modal/sessions/quotes", { searchParams: e }).json();
1157
1157
  }
1158
1158
  }
1159
1159
  class Xe {
1160
1160
  async getOptimalRoutes(e) {
1161
- const n = f(e.sourceChain), a = f(e.destinationChain);
1162
- return await l().get("router/optimal-route", {
1161
+ const n = m(e.sourceChain), a = m(e.destinationChain);
1162
+ return await c().get("router/optimal-route", {
1163
1163
  searchParams: {
1164
1164
  ...e,
1165
1165
  sourceChain: n,
@@ -1168,39 +1168,39 @@ class Xe {
1168
1168
  }).json();
1169
1169
  }
1170
1170
  async getAllSupportedBridges() {
1171
- return await l().get("router/supported-bridges/all").json();
1171
+ return await c().get("router/supported-bridges/all").json();
1172
1172
  }
1173
1173
  async getSupportedBridges(e) {
1174
- const n = f(e.sourceChain), a = f(e.destinationChain);
1175
- return await l().get("router/supported-bridges/route", { searchParams: {
1174
+ const n = m(e.sourceChain), a = m(e.destinationChain);
1175
+ return await c().get("router/supported-bridges/route", { searchParams: {
1176
1176
  ...e,
1177
1177
  sourceChain: n,
1178
1178
  destinationChain: a
1179
1179
  } }).json();
1180
1180
  }
1181
1181
  async getSupportedRoutes(e) {
1182
- return await l().get("router/supported-routes/bridge/" + e).json();
1182
+ return await c().get("router/supported-routes/bridge/" + e).json();
1183
1183
  }
1184
1184
  }
1185
1185
  class Qe {
1186
1186
  async getSupported(e) {
1187
- return await l().get("chains", { searchParams: e }).json();
1187
+ return await c().get("chains", { searchParams: e }).json();
1188
1188
  }
1189
1189
  async getBalance(e) {
1190
- return await l().get(`chains/balances/${e.address}`, { searchParams: e }).json();
1190
+ return await c().get(`chains/balances/${e.address}`, { searchParams: e }).json();
1191
1191
  }
1192
1192
  }
1193
1193
  class Je {
1194
1194
  async getClientInfo() {
1195
- return await l().get("client/auth/client-info").json();
1195
+ return await c().get("client/auth/client-info").json();
1196
1196
  }
1197
1197
  async getClientInfoForSession() {
1198
- return await l().get("modal/sessions/client").json();
1198
+ return await c().get("modal/sessions/client").json();
1199
1199
  }
1200
1200
  }
1201
1201
  class Ze {
1202
1202
  async getSessionToken(e) {
1203
- const n = f(e.destinationChain);
1203
+ const n = m(e.destinationChain);
1204
1204
  let a = _(n, e.token);
1205
1205
  a || (console.error(
1206
1206
  `${e.token} on ${e.destinationChain} is currently unsupported, defaulting to usdc`
@@ -1211,41 +1211,117 @@ class Ze {
1211
1211
  destinationChain: n,
1212
1212
  amount: e.amount
1213
1213
  };
1214
- return l().post("modal/sessions", { json: o }).json().then((r) => ({ ...r, amount: o.amount }));
1214
+ return c().post("modal/sessions", { json: o }).json().then((r) => ({ ...r, amount: o.amount }));
1215
1215
  }
1216
1216
  async getHandOffToken() {
1217
- return l().post("modal/sessions/handoff-token").json();
1217
+ return c().post("modal/sessions/handoff-token").json();
1218
1218
  }
1219
1219
  async resumeSession(e) {
1220
- return l().post(`modal/sessions/${e.sessionId}/resume`, { json: e }).json();
1220
+ return c().post(`modal/sessions/${e.sessionId}/resume`, { json: e }).json();
1221
1221
  }
1222
1222
  }
1223
1223
  const es = "modal/sessions/history";
1224
1224
  class ss {
1225
1225
  async getHistoryForSession(e) {
1226
- return l().post(es, { json: e }).json();
1226
+ return c().post(es, { json: e }).json();
1227
+ }
1228
+ }
1229
+ const is = {
1230
+ FONBNK: "FONBNK",
1231
+ ONRAMP_MONEY: "ONRAMP_MONEY"
1232
+ }, rs = {
1233
+ PENDING: "PENDING",
1234
+ INITIATED: "INITIATED",
1235
+ PROCESSING: "PROCESSING",
1236
+ COMPLETED: "COMPLETED",
1237
+ FAILED: "FAILED",
1238
+ CANCELLED: "CANCELLED",
1239
+ EXPIRED: "EXPIRED",
1240
+ REFUNDED: "REFUNDED"
1241
+ };
1242
+ class ns {
1243
+ /**
1244
+ * Get aggregated fiat-to-crypto quotes from all eligible providers.
1245
+ * Fans out to multiple providers and picks the cheapest path.
1246
+ */
1247
+ async getQuotes(e) {
1248
+ return await c().get("ramp/quotes", { searchParams: e }).json();
1249
+ }
1250
+ /**
1251
+ * Get all supported countries with currency details.
1252
+ * Use this as the primary discovery endpoint.
1253
+ */
1254
+ async getCountries(e) {
1255
+ return await c().get("ramp/countries", { searchParams: e }).json();
1256
+ }
1257
+ /**
1258
+ * Get a deduplicated list of supported fiat currencies.
1259
+ * Useful for currency dropdowns.
1260
+ */
1261
+ async getCurrencies(e) {
1262
+ return await c().get("ramp/currencies", { searchParams: e }).json();
1263
+ }
1264
+ /**
1265
+ * Create a fiat-to-crypto order.
1266
+ * Returns a provider widget URL for the user to complete payment.
1267
+ */
1268
+ async createOrder(e) {
1269
+ return await c().post("ramp/orders", { json: e }).json();
1270
+ }
1271
+ /**
1272
+ * Get an order by ID.
1273
+ */
1274
+ async getOrder(e) {
1275
+ return await c().get(`ramp/orders/${e}`).json();
1276
+ }
1277
+ /**
1278
+ * Get an order by intent address.
1279
+ */
1280
+ async getOrderByIntent(e) {
1281
+ return await c().get(`ramp/orders/by-intent/${e}`).json();
1282
+ }
1283
+ /**
1284
+ * List all orders (newest first).
1285
+ */
1286
+ async listOrders(e) {
1287
+ return await c().get("ramp/orders", { searchParams: e }).json();
1288
+ }
1289
+ /**
1290
+ * Confirm an order after the user completes the deposit action.
1291
+ */
1292
+ async confirmOrder(e) {
1293
+ return await c().post(`ramp/orders/${e}/confirm`).json();
1294
+ }
1295
+ /**
1296
+ * Cancel an order if it's still in a cancellable state.
1297
+ */
1298
+ async cancelOrder(e) {
1299
+ return await c().post(`ramp/orders/${e}/cancel`).json();
1227
1300
  }
1228
1301
  }
1229
- const os = {
1302
+ const cs = {
1230
1303
  ACROSS: "ACROSS",
1231
1304
  CCTP: "CCTP",
1232
1305
  GATEWAY: "GATEWAY",
1233
1306
  RHINOFI: "RHINOFI"
1234
- }, is = {
1307
+ }, ds = {
1235
1308
  router: new Xe(),
1236
1309
  quotes: new qe(),
1237
- intents: new Ge(),
1310
+ intents: new Ye(),
1238
1311
  chains: new Qe(),
1239
1312
  client: new Je(),
1240
1313
  auth: new Ze(),
1241
- history: new ss()
1314
+ history: new ss(),
1315
+ ramp: new ns()
1242
1316
  };
1243
1317
  export {
1244
1318
  t as AmountSymbols,
1245
- os as Bridges,
1319
+ cs as Bridges,
1246
1320
  u as Chainrails,
1247
- ts as Chains,
1248
- as as Tokens,
1249
- is as crapi,
1321
+ as as Chains,
1322
+ rs as RampOrderStatuses,
1323
+ is as RampProviders,
1324
+ os as Tokens,
1325
+ ds as crapi,
1250
1326
  se as environment
1251
1327
  };