@chainflip/sdk 1.3.0-beta.6 → 1.4.0-alpha.0

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/funding.js CHANGED
@@ -1396,7 +1396,8 @@ var ADDRESSES = {
1396
1396
  USDT_CONTRACT_ADDRESS: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
1397
1397
  ARBUSDC_CONTRACT_ADDRESS: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
1398
1398
  VAULT_CONTRACT_ADDRESS: "0xB7A5bd0345EF1Cc5E66bf61BdeC17D2461fBd968",
1399
- STATE_CHAIN_GATEWAY_ADDRESS: "0xeEBe00Ac0756308ac4AaBfD76c05c4F3088B8883"
1399
+ STATE_CHAIN_GATEWAY_ADDRESS: "0xeEBe00Ac0756308ac4AaBfD76c05c4F3088B8883",
1400
+ ARB_VAULT_CONTRACT_ADDRESS: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
1400
1401
  },
1401
1402
  [ChainflipNetworks.sisyphos]: {
1402
1403
  FLIP_CONTRACT_ADDRESS: "0xcD079EAB6B5443b545788Fd210C8800FEADd87fa",
@@ -1404,7 +1405,8 @@ var ADDRESSES = {
1404
1405
  USDT_CONTRACT_ADDRESS: SEPOLIA_USDT_CONTRACT_ADDRESS,
1405
1406
  ARBUSDC_CONTRACT_ADDRESS: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
1406
1407
  VAULT_CONTRACT_ADDRESS: "0xa94d6b1853F3cb611Ed3cCb701b4fdA5a9DACe85",
1407
- STATE_CHAIN_GATEWAY_ADDRESS: "0x1F7fE41C798cc7b1D34BdC8de2dDDA4a4bE744D9"
1408
+ STATE_CHAIN_GATEWAY_ADDRESS: "0x1F7fE41C798cc7b1D34BdC8de2dDDA4a4bE744D9",
1409
+ ARB_VAULT_CONTRACT_ADDRESS: ""
1408
1410
  },
1409
1411
  [ChainflipNetworks.perseverance]: {
1410
1412
  FLIP_CONTRACT_ADDRESS: "0xdC27c60956cB065D19F08bb69a707E37b36d8086",
@@ -1412,7 +1414,8 @@ var ADDRESSES = {
1412
1414
  USDT_CONTRACT_ADDRESS: SEPOLIA_USDT_CONTRACT_ADDRESS,
1413
1415
  ARBUSDC_CONTRACT_ADDRESS: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
1414
1416
  VAULT_CONTRACT_ADDRESS: "0x36eaD71325604DC15d35FAE584D7b50646D81753",
1415
- STATE_CHAIN_GATEWAY_ADDRESS: "0xA34a967197Ee90BB7fb28e928388a573c5CFd099"
1417
+ STATE_CHAIN_GATEWAY_ADDRESS: "0xA34a967197Ee90BB7fb28e928388a573c5CFd099",
1418
+ ARB_VAULT_CONTRACT_ADDRESS: ""
1416
1419
  },
1417
1420
  [ChainflipNetworks.mainnet]: {
1418
1421
  FLIP_CONTRACT_ADDRESS: "0x826180541412D574cf1336d22c0C0a287822678A",
@@ -1420,7 +1423,8 @@ var ADDRESSES = {
1420
1423
  USDT_CONTRACT_ADDRESS: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1421
1424
  ARBUSDC_CONTRACT_ADDRESS: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
1422
1425
  VAULT_CONTRACT_ADDRESS: "0xF5e10380213880111522dd0efD3dbb45b9f62Bcc",
1423
- STATE_CHAIN_GATEWAY_ADDRESS: "0x6995Ab7c4D7F4B03f467Cf4c8E920427d9621DBd"
1426
+ STATE_CHAIN_GATEWAY_ADDRESS: "0x6995Ab7c4D7F4B03f467Cf4c8E920427d9621DBd",
1427
+ ARB_VAULT_CONTRACT_ADDRESS: ""
1424
1428
  }
1425
1429
  };
1426
1430
 
@@ -1456,7 +1460,8 @@ var approve = /* @__PURE__ */ __name(async (amount, spenderAddress, erc20, allow
1456
1460
  if (allowance >= amount)
1457
1461
  return null;
1458
1462
  const transaction = await erc20.approve(spenderAddress, amount - allowance, extractOverrides(txOpts));
1459
- return transaction.wait(txOpts.wait);
1463
+ await transaction.wait(txOpts.wait);
1464
+ return transaction;
1460
1465
  }, "approve");
1461
1466
  var getFlipBalance = /* @__PURE__ */ __name(async (network, signer) => {
1462
1467
  const flipAddress = getTokenContractAddress(InternalAssets.Flip, network);
@@ -1464,7 +1469,7 @@ var getFlipBalance = /* @__PURE__ */ __name(async (network, signer) => {
1464
1469
  return flip.balanceOf(await signer.getAddress());
1465
1470
  }, "getFlipBalance");
1466
1471
 
1467
- // ../../node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
1472
+ // ../../node_modules/.pnpm/zod@3.23.0/node_modules/zod/lib/index.mjs
1468
1473
  var util;
1469
1474
  (function(util2) {
1470
1475
  util2.assertEqual = (val) => val;
@@ -1679,6 +1684,11 @@ var _ZodError = class _ZodError extends Error {
1679
1684
  processError(this);
1680
1685
  return fieldErrors;
1681
1686
  }
1687
+ static assert(value) {
1688
+ if (!(value instanceof _ZodError)) {
1689
+ throw new Error(`Not a ZodError: ${value}`);
1690
+ }
1691
+ }
1682
1692
  toString() {
1683
1693
  return this.message;
1684
1694
  }
@@ -1825,6 +1835,13 @@ var makeIssue = /* @__PURE__ */ __name((params) => {
1825
1835
  ...issueData,
1826
1836
  path: fullPath
1827
1837
  };
1838
+ if (issueData.message !== void 0) {
1839
+ return {
1840
+ ...issueData,
1841
+ path: fullPath,
1842
+ message: issueData.message
1843
+ };
1844
+ }
1828
1845
  let errorMessage = "";
1829
1846
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
1830
1847
  for (const map of maps) {
@@ -1833,11 +1850,12 @@ var makeIssue = /* @__PURE__ */ __name((params) => {
1833
1850
  return {
1834
1851
  ...issueData,
1835
1852
  path: fullPath,
1836
- message: issueData.message || errorMessage
1853
+ message: errorMessage
1837
1854
  };
1838
1855
  }, "makeIssue");
1839
1856
  var EMPTY_PATH = [];
1840
1857
  function addIssueToContext(ctx, issueData) {
1858
+ const overrideMap = getErrorMap();
1841
1859
  const issue = makeIssue({
1842
1860
  issueData,
1843
1861
  data: ctx.data,
@@ -1845,8 +1863,8 @@ function addIssueToContext(ctx, issueData) {
1845
1863
  errorMaps: [
1846
1864
  ctx.common.contextualErrorMap,
1847
1865
  ctx.schemaErrorMap,
1848
- getErrorMap(),
1849
- errorMap
1866
+ overrideMap,
1867
+ overrideMap === errorMap ? void 0 : errorMap
1850
1868
  // then global default map
1851
1869
  ].filter((x) => !!x)
1852
1870
  });
@@ -1879,9 +1897,11 @@ var _ParseStatus = class _ParseStatus {
1879
1897
  static async mergeObjectAsync(status, pairs) {
1880
1898
  const syncPairs = [];
1881
1899
  for (const pair of pairs) {
1900
+ const key = await pair.key;
1901
+ const value = await pair.value;
1882
1902
  syncPairs.push({
1883
- key: await pair.key,
1884
- value: await pair.value
1903
+ key,
1904
+ value
1885
1905
  });
1886
1906
  }
1887
1907
  return _ParseStatus.mergeObjectSync(status, syncPairs);
@@ -1916,11 +1936,31 @@ var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted
1916
1936
  var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
1917
1937
  var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
1918
1938
  var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
1939
+ function __classPrivateFieldGet(receiver, state, kind, f) {
1940
+ if (kind === "a" && !f)
1941
+ throw new TypeError("Private accessor was defined without a getter");
1942
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1943
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
1944
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1945
+ }
1946
+ __name(__classPrivateFieldGet, "__classPrivateFieldGet");
1947
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
1948
+ if (kind === "m")
1949
+ throw new TypeError("Private method is not writable");
1950
+ if (kind === "a" && !f)
1951
+ throw new TypeError("Private accessor was defined without a setter");
1952
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1953
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
1954
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
1955
+ }
1956
+ __name(__classPrivateFieldSet, "__classPrivateFieldSet");
1919
1957
  var errorUtil;
1920
1958
  (function(errorUtil2) {
1921
1959
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
1922
1960
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
1923
1961
  })(errorUtil || (errorUtil = {}));
1962
+ var _ZodEnum_cache;
1963
+ var _ZodNativeEnum_cache;
1924
1964
  var _ParseInputLazyPath = class _ParseInputLazyPath {
1925
1965
  constructor(parent, value, path, key) {
1926
1966
  this._cachedPath = [];
@@ -1971,12 +2011,17 @@ function processCreateParams(params) {
1971
2011
  if (errorMap3)
1972
2012
  return { errorMap: errorMap3, description };
1973
2013
  const customMap = /* @__PURE__ */ __name((iss, ctx) => {
1974
- if (iss.code !== "invalid_type")
1975
- return { message: ctx.defaultError };
2014
+ var _a, _b;
2015
+ const { message } = params;
2016
+ if (iss.code === "invalid_enum_value") {
2017
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
2018
+ }
1976
2019
  if (typeof ctx.data === "undefined") {
1977
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
2020
+ return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
1978
2021
  }
1979
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
2022
+ if (iss.code !== "invalid_type")
2023
+ return { message: ctx.defaultError };
2024
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
1980
2025
  }, "customMap");
1981
2026
  return { errorMap: customMap, description };
1982
2027
  }
@@ -2227,35 +2272,43 @@ var _ZodType = class _ZodType {
2227
2272
  __name(_ZodType, "ZodType");
2228
2273
  var ZodType = _ZodType;
2229
2274
  var cuidRegex = /^c[^\s-]{8,}$/i;
2230
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
2275
+ var cuid2Regex = /^[0-9a-z]+$/;
2231
2276
  var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
2232
2277
  var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
2233
- var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
2278
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
2279
+ var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
2280
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
2234
2281
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
2235
2282
  var emojiRegex;
2236
- var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
2283
+ var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
2237
2284
  var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
2238
- var datetimeRegex = /* @__PURE__ */ __name((args) => {
2285
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
2286
+ var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
2287
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
2288
+ function timeRegexSource(args) {
2289
+ let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
2239
2290
  if (args.precision) {
2240
- if (args.offset) {
2241
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
2242
- } else {
2243
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
2244
- }
2245
- } else if (args.precision === 0) {
2246
- if (args.offset) {
2247
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
2248
- } else {
2249
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
2250
- }
2251
- } else {
2252
- if (args.offset) {
2253
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
2254
- } else {
2255
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
2256
- }
2291
+ regex = `${regex}\\.\\d{${args.precision}}`;
2292
+ } else if (args.precision == null) {
2293
+ regex = `${regex}(\\.\\d+)?`;
2257
2294
  }
2258
- }, "datetimeRegex");
2295
+ return regex;
2296
+ }
2297
+ __name(timeRegexSource, "timeRegexSource");
2298
+ function timeRegex(args) {
2299
+ return new RegExp(`^${timeRegexSource(args)}$`);
2300
+ }
2301
+ __name(timeRegex, "timeRegex");
2302
+ function datetimeRegex(args) {
2303
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
2304
+ const opts = [];
2305
+ opts.push(args.local ? `Z?` : `Z`);
2306
+ if (args.offset)
2307
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
2308
+ regex = `${regex}(${opts.join("|")})`;
2309
+ return new RegExp(`^${regex}$`);
2310
+ }
2311
+ __name(datetimeRegex, "datetimeRegex");
2259
2312
  function isValidIP(ip, version) {
2260
2313
  if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
2261
2314
  return true;
@@ -2274,15 +2327,11 @@ var _ZodString = class _ZodString extends ZodType {
2274
2327
  const parsedType = this._getType(input);
2275
2328
  if (parsedType !== ZodParsedType.string) {
2276
2329
  const ctx2 = this._getOrReturnCtx(input);
2277
- addIssueToContext(
2278
- ctx2,
2279
- {
2280
- code: ZodIssueCode.invalid_type,
2281
- expected: ZodParsedType.string,
2282
- received: ctx2.parsedType
2283
- }
2284
- //
2285
- );
2330
+ addIssueToContext(ctx2, {
2331
+ code: ZodIssueCode.invalid_type,
2332
+ expected: ZodParsedType.string,
2333
+ received: ctx2.parsedType
2334
+ });
2286
2335
  return INVALID;
2287
2336
  }
2288
2337
  const status = new ParseStatus();
@@ -2373,6 +2422,16 @@ var _ZodString = class _ZodString extends ZodType {
2373
2422
  });
2374
2423
  status.dirty();
2375
2424
  }
2425
+ } else if (check.kind === "nanoid") {
2426
+ if (!nanoidRegex.test(input.data)) {
2427
+ ctx = this._getOrReturnCtx(input, ctx);
2428
+ addIssueToContext(ctx, {
2429
+ validation: "nanoid",
2430
+ code: ZodIssueCode.invalid_string,
2431
+ message: check.message
2432
+ });
2433
+ status.dirty();
2434
+ }
2376
2435
  } else if (check.kind === "cuid") {
2377
2436
  if (!cuidRegex.test(input.data)) {
2378
2437
  ctx = this._getOrReturnCtx(input, ctx);
@@ -2474,6 +2533,38 @@ var _ZodString = class _ZodString extends ZodType {
2474
2533
  });
2475
2534
  status.dirty();
2476
2535
  }
2536
+ } else if (check.kind === "date") {
2537
+ const regex = dateRegex;
2538
+ if (!regex.test(input.data)) {
2539
+ ctx = this._getOrReturnCtx(input, ctx);
2540
+ addIssueToContext(ctx, {
2541
+ code: ZodIssueCode.invalid_string,
2542
+ validation: "date",
2543
+ message: check.message
2544
+ });
2545
+ status.dirty();
2546
+ }
2547
+ } else if (check.kind === "time") {
2548
+ const regex = timeRegex(check);
2549
+ if (!regex.test(input.data)) {
2550
+ ctx = this._getOrReturnCtx(input, ctx);
2551
+ addIssueToContext(ctx, {
2552
+ code: ZodIssueCode.invalid_string,
2553
+ validation: "time",
2554
+ message: check.message
2555
+ });
2556
+ status.dirty();
2557
+ }
2558
+ } else if (check.kind === "duration") {
2559
+ if (!durationRegex.test(input.data)) {
2560
+ ctx = this._getOrReturnCtx(input, ctx);
2561
+ addIssueToContext(ctx, {
2562
+ validation: "duration",
2563
+ code: ZodIssueCode.invalid_string,
2564
+ message: check.message
2565
+ });
2566
+ status.dirty();
2567
+ }
2477
2568
  } else if (check.kind === "ip") {
2478
2569
  if (!isValidIP(input.data, check.version)) {
2479
2570
  ctx = this._getOrReturnCtx(input, ctx);
@@ -2484,6 +2575,16 @@ var _ZodString = class _ZodString extends ZodType {
2484
2575
  });
2485
2576
  status.dirty();
2486
2577
  }
2578
+ } else if (check.kind === "base64") {
2579
+ if (!base64Regex.test(input.data)) {
2580
+ ctx = this._getOrReturnCtx(input, ctx);
2581
+ addIssueToContext(ctx, {
2582
+ validation: "base64",
2583
+ code: ZodIssueCode.invalid_string,
2584
+ message: check.message
2585
+ });
2586
+ status.dirty();
2587
+ }
2487
2588
  } else {
2488
2589
  util.assertNever(check);
2489
2590
  }
@@ -2515,6 +2616,9 @@ var _ZodString = class _ZodString extends ZodType {
2515
2616
  uuid(message) {
2516
2617
  return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
2517
2618
  }
2619
+ nanoid(message) {
2620
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
2621
+ }
2518
2622
  cuid(message) {
2519
2623
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
2520
2624
  }
@@ -2524,16 +2628,20 @@ var _ZodString = class _ZodString extends ZodType {
2524
2628
  ulid(message) {
2525
2629
  return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
2526
2630
  }
2631
+ base64(message) {
2632
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
2633
+ }
2527
2634
  ip(options) {
2528
2635
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
2529
2636
  }
2530
2637
  datetime(options) {
2531
- var _a;
2638
+ var _a, _b;
2532
2639
  if (typeof options === "string") {
2533
2640
  return this._addCheck({
2534
2641
  kind: "datetime",
2535
2642
  precision: null,
2536
2643
  offset: false,
2644
+ local: false,
2537
2645
  message: options
2538
2646
  });
2539
2647
  }
@@ -2541,9 +2649,30 @@ var _ZodString = class _ZodString extends ZodType {
2541
2649
  kind: "datetime",
2542
2650
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2543
2651
  offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
2652
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
2544
2653
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
2545
2654
  });
2546
2655
  }
2656
+ date(message) {
2657
+ return this._addCheck({ kind: "date", message });
2658
+ }
2659
+ time(options) {
2660
+ if (typeof options === "string") {
2661
+ return this._addCheck({
2662
+ kind: "time",
2663
+ precision: null,
2664
+ message: options
2665
+ });
2666
+ }
2667
+ return this._addCheck({
2668
+ kind: "time",
2669
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2670
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
2671
+ });
2672
+ }
2673
+ duration(message) {
2674
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
2675
+ }
2547
2676
  regex(regex, message) {
2548
2677
  return this._addCheck({
2549
2678
  kind: "regex",
@@ -2622,6 +2751,15 @@ var _ZodString = class _ZodString extends ZodType {
2622
2751
  get isDatetime() {
2623
2752
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
2624
2753
  }
2754
+ get isDate() {
2755
+ return !!this._def.checks.find((ch) => ch.kind === "date");
2756
+ }
2757
+ get isTime() {
2758
+ return !!this._def.checks.find((ch) => ch.kind === "time");
2759
+ }
2760
+ get isDuration() {
2761
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
2762
+ }
2625
2763
  get isEmail() {
2626
2764
  return !!this._def.checks.find((ch) => ch.kind === "email");
2627
2765
  }
@@ -2634,6 +2772,9 @@ var _ZodString = class _ZodString extends ZodType {
2634
2772
  get isUUID() {
2635
2773
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
2636
2774
  }
2775
+ get isNANOID() {
2776
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
2777
+ }
2637
2778
  get isCUID() {
2638
2779
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
2639
2780
  }
@@ -2646,6 +2787,9 @@ var _ZodString = class _ZodString extends ZodType {
2646
2787
  get isIP() {
2647
2788
  return !!this._def.checks.find((ch) => ch.kind === "ip");
2648
2789
  }
2790
+ get isBase64() {
2791
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
2792
+ }
2649
2793
  get minLength() {
2650
2794
  let min = null;
2651
2795
  for (const ch of this._def.checks) {
@@ -3587,9 +3731,10 @@ var _ZodObject = class _ZodObject extends ZodType {
3587
3731
  const syncPairs = [];
3588
3732
  for (const pair of pairs) {
3589
3733
  const key = await pair.key;
3734
+ const value = await pair.value;
3590
3735
  syncPairs.push({
3591
3736
  key,
3592
- value: await pair.value,
3737
+ value,
3593
3738
  alwaysSet: pair.alwaysSet
3594
3739
  });
3595
3740
  }
@@ -3945,15 +4090,25 @@ var getDiscriminator = /* @__PURE__ */ __name((type) => {
3945
4090
  } else if (type instanceof ZodEnum) {
3946
4091
  return type.options;
3947
4092
  } else if (type instanceof ZodNativeEnum) {
3948
- return Object.keys(type.enum);
4093
+ return util.objectValues(type.enum);
3949
4094
  } else if (type instanceof ZodDefault) {
3950
4095
  return getDiscriminator(type._def.innerType);
3951
4096
  } else if (type instanceof ZodUndefined) {
3952
4097
  return [void 0];
3953
4098
  } else if (type instanceof ZodNull) {
3954
4099
  return [null];
4100
+ } else if (type instanceof ZodOptional) {
4101
+ return [void 0, ...getDiscriminator(type.unwrap())];
4102
+ } else if (type instanceof ZodNullable) {
4103
+ return [null, ...getDiscriminator(type.unwrap())];
4104
+ } else if (type instanceof ZodBranded) {
4105
+ return getDiscriminator(type.unwrap());
4106
+ } else if (type instanceof ZodReadonly) {
4107
+ return getDiscriminator(type.unwrap());
4108
+ } else if (type instanceof ZodCatch) {
4109
+ return getDiscriminator(type._def.innerType);
3955
4110
  } else {
3956
- return null;
4111
+ return [];
3957
4112
  }
3958
4113
  }, "getDiscriminator");
3959
4114
  var _ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
@@ -4013,7 +4168,7 @@ var _ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
4013
4168
  const optionsMap = /* @__PURE__ */ new Map();
4014
4169
  for (const type of options) {
4015
4170
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
4016
- if (!discriminatorValues) {
4171
+ if (!discriminatorValues.length) {
4017
4172
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
4018
4173
  }
4019
4174
  for (const value of discriminatorValues) {
@@ -4220,7 +4375,8 @@ var _ZodRecord = class _ZodRecord extends ZodType {
4220
4375
  for (const key in ctx.data) {
4221
4376
  pairs.push({
4222
4377
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
4223
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
4378
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
4379
+ alwaysSet: key in ctx.data
4224
4380
  });
4225
4381
  }
4226
4382
  if (ctx.common.async) {
@@ -4580,6 +4736,10 @@ function createZodEnum(values, params) {
4580
4736
  }
4581
4737
  __name(createZodEnum, "createZodEnum");
4582
4738
  var _ZodEnum = class _ZodEnum extends ZodType {
4739
+ constructor() {
4740
+ super(...arguments);
4741
+ _ZodEnum_cache.set(this, void 0);
4742
+ }
4583
4743
  _parse(input) {
4584
4744
  if (typeof input.data !== "string") {
4585
4745
  const ctx = this._getOrReturnCtx(input);
@@ -4591,7 +4751,10 @@ var _ZodEnum = class _ZodEnum extends ZodType {
4591
4751
  });
4592
4752
  return INVALID;
4593
4753
  }
4594
- if (this._def.values.indexOf(input.data) === -1) {
4754
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
4755
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
4756
+ }
4757
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
4595
4758
  const ctx = this._getOrReturnCtx(input);
4596
4759
  const expectedValues = this._def.values;
4597
4760
  addIssueToContext(ctx, {
@@ -4627,17 +4790,28 @@ var _ZodEnum = class _ZodEnum extends ZodType {
4627
4790
  }
4628
4791
  return enumValues2;
4629
4792
  }
4630
- extract(values) {
4631
- return _ZodEnum.create(values);
4793
+ extract(values, newDef = this._def) {
4794
+ return _ZodEnum.create(values, {
4795
+ ...this._def,
4796
+ ...newDef
4797
+ });
4632
4798
  }
4633
- exclude(values) {
4634
- return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
4799
+ exclude(values, newDef = this._def) {
4800
+ return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
4801
+ ...this._def,
4802
+ ...newDef
4803
+ });
4635
4804
  }
4636
4805
  };
4637
4806
  __name(_ZodEnum, "ZodEnum");
4638
4807
  var ZodEnum = _ZodEnum;
4808
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
4639
4809
  ZodEnum.create = createZodEnum;
4640
4810
  var _ZodNativeEnum = class _ZodNativeEnum extends ZodType {
4811
+ constructor() {
4812
+ super(...arguments);
4813
+ _ZodNativeEnum_cache.set(this, void 0);
4814
+ }
4641
4815
  _parse(input) {
4642
4816
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
4643
4817
  const ctx = this._getOrReturnCtx(input);
@@ -4650,7 +4824,10 @@ var _ZodNativeEnum = class _ZodNativeEnum extends ZodType {
4650
4824
  });
4651
4825
  return INVALID;
4652
4826
  }
4653
- if (nativeEnumValues.indexOf(input.data) === -1) {
4827
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
4828
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
4829
+ }
4830
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
4654
4831
  const expectedValues = util.objectValues(nativeEnumValues);
4655
4832
  addIssueToContext(ctx, {
4656
4833
  received: ctx.data,
@@ -4667,6 +4844,7 @@ var _ZodNativeEnum = class _ZodNativeEnum extends ZodType {
4667
4844
  };
4668
4845
  __name(_ZodNativeEnum, "ZodNativeEnum");
4669
4846
  var ZodNativeEnum = _ZodNativeEnum;
4847
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
4670
4848
  ZodNativeEnum.create = (values, params) => {
4671
4849
  return new ZodNativeEnum({
4672
4850
  values,
@@ -4732,26 +4910,38 @@ var _ZodEffects = class _ZodEffects extends ZodType {
4732
4910
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
4733
4911
  if (effect.type === "preprocess") {
4734
4912
  const processed = effect.transform(ctx.data, checkCtx);
4735
- if (ctx.common.issues.length) {
4736
- return {
4737
- status: "dirty",
4738
- value: ctx.data
4739
- };
4740
- }
4741
4913
  if (ctx.common.async) {
4742
- return Promise.resolve(processed).then((processed2) => {
4743
- return this._def.schema._parseAsync({
4914
+ return Promise.resolve(processed).then(async (processed2) => {
4915
+ if (status.value === "aborted")
4916
+ return INVALID;
4917
+ const result = await this._def.schema._parseAsync({
4744
4918
  data: processed2,
4745
4919
  path: ctx.path,
4746
4920
  parent: ctx
4747
4921
  });
4922
+ if (result.status === "aborted")
4923
+ return INVALID;
4924
+ if (result.status === "dirty")
4925
+ return DIRTY(result.value);
4926
+ if (status.value === "dirty")
4927
+ return DIRTY(result.value);
4928
+ return result;
4748
4929
  });
4749
4930
  } else {
4750
- return this._def.schema._parseSync({
4931
+ if (status.value === "aborted")
4932
+ return INVALID;
4933
+ const result = this._def.schema._parseSync({
4751
4934
  data: processed,
4752
4935
  path: ctx.path,
4753
4936
  parent: ctx
4754
4937
  });
4938
+ if (result.status === "aborted")
4939
+ return INVALID;
4940
+ if (result.status === "dirty")
4941
+ return DIRTY(result.value);
4942
+ if (status.value === "dirty")
4943
+ return DIRTY(result.value);
4944
+ return result;
4755
4945
  }
4756
4946
  }
4757
4947
  if (effect.type === "refinement") {
@@ -5061,6 +5251,9 @@ var _ZodReadonly = class _ZodReadonly extends ZodType {
5061
5251
  }
5062
5252
  return result;
5063
5253
  }
5254
+ unwrap() {
5255
+ return this._def.innerType;
5256
+ }
5064
5257
  };
5065
5258
  __name(_ZodReadonly, "ZodReadonly");
5066
5259
  var ZodReadonly = _ZodReadonly;
@@ -5071,7 +5264,7 @@ ZodReadonly.create = (type, params) => {
5071
5264
  ...processCreateParams(params)
5072
5265
  });
5073
5266
  };
5074
- var custom = /* @__PURE__ */ __name((check, params = {}, fatal) => {
5267
+ function custom(check, params = {}, fatal) {
5075
5268
  if (check)
5076
5269
  return ZodAny.create().superRefine((data, ctx) => {
5077
5270
  var _a, _b;
@@ -5083,7 +5276,8 @@ var custom = /* @__PURE__ */ __name((check, params = {}, fatal) => {
5083
5276
  }
5084
5277
  });
5085
5278
  return ZodAny.create();
5086
- }, "custom");
5279
+ }
5280
+ __name(custom, "custom");
5087
5281
  var late = {
5088
5282
  object: ZodObject.lazycreate
5089
5283
  };
@@ -5202,6 +5396,7 @@ var z = /* @__PURE__ */ Object.freeze({
5202
5396
  ZodParsedType,
5203
5397
  getParsedType,
5204
5398
  ZodType,
5399
+ datetimeRegex,
5205
5400
  ZodString,
5206
5401
  ZodNumber,
5207
5402
  ZodBigInt,
@@ -5345,6 +5540,9 @@ z.union([
5345
5540
  hexString.refine((address) => ethers2__namespace.isAddress(address), (address) => ({
5346
5541
  message: `${address} is not a valid ethereum address`
5347
5542
  }));
5543
+ string.refine((address) => address.startsWith("cF") && utilCrypto.decodeAddress(address), (address) => ({
5544
+ message: `${address} is not a valid chainflip address`
5545
+ }));
5348
5546
  numericString.transform((arg) => BigInt(arg));
5349
5547
  var u128 = z.union([
5350
5548
  number,
@@ -5367,7 +5565,7 @@ var uncheckedAssetAndChain = z.object({
5367
5565
  asset: z.string(),
5368
5566
  chain: z.string()
5369
5567
  });
5370
- uncheckedAssetAndChain.refine(isValidAssetAndChain);
5568
+ uncheckedAssetAndChain.refine((value) => isValidAssetAndChain(value));
5371
5569
  z.union([
5372
5570
  z.object({
5373
5571
  __kind: z.literal("CcmPrincipal"),
@@ -5389,6 +5587,11 @@ z.union([
5389
5587
  type: "SWAP"
5390
5588
  }))
5391
5589
  ]);
5590
+ var chainflipSS58Prefix = 2112;
5591
+ z.union([
5592
+ hexString,
5593
+ string.regex(/^[a-f\d]$/i).transform((value) => `0x${value}`)
5594
+ ]).transform((value) => utilCrypto.encodeAddress(value, chainflipSS58Prefix));
5392
5595
 
5393
5596
  // ../shared/src/rpc/index.ts
5394
5597
  var numberOrHex = z.union([
@@ -5397,8 +5600,10 @@ var numberOrHex = z.union([
5397
5600
  ]).transform((str) => BigInt(str));
5398
5601
  var camelCase = /* @__PURE__ */ __name((str) => str.replace(/_([a-z])/g, (_, char) => char.toUpperCase()), "camelCase");
5399
5602
  var camelCaseKeys = /* @__PURE__ */ __name((obj) => {
5400
- if (typeof obj !== "object" || Array.isArray(obj) || obj === null)
5603
+ if (typeof obj !== "object" || obj === null)
5401
5604
  return obj;
5605
+ if (Array.isArray(obj))
5606
+ return obj.map((item) => camelCaseKeys(item));
5402
5607
  return Object.fromEntries(Object.entries(obj).map(([key, value]) => [
5403
5608
  camelCase(key),
5404
5609
  camelCaseKeys(value)
@@ -5426,6 +5631,24 @@ var createRequest = /* @__PURE__ */ __name((method, responseParser) => async (ur
5426
5631
  cause: data.error
5427
5632
  });
5428
5633
  }, "createRequest");
5634
+ var createRequestWithoutParser = /* @__PURE__ */ __name((method) => async (urlOrNetwork, ...params) => {
5635
+ const url = "network" in urlOrNetwork ? RPC_URLS[urlOrNetwork.network] : urlOrNetwork.rpcUrl;
5636
+ const { data } = await axios__default.default.post(
5637
+ url,
5638
+ {
5639
+ jsonrpc: "2.0",
5640
+ method,
5641
+ params,
5642
+ id: 1
5643
+ },
5644
+ // prevent JSON.parse from being called because the RPC we are requesting
5645
+ // returns numbers that are unsafe to parse
5646
+ {
5647
+ transformResponse: (d) => d
5648
+ }
5649
+ );
5650
+ return data;
5651
+ }, "createRequestWithoutParser");
5429
5652
  var fundingEnvironment = z.object({
5430
5653
  redemption_tax: numberOrHex,
5431
5654
  minimum_funding_amount: numberOrHex
@@ -5484,28 +5707,23 @@ var ingressEgressEnvironment = z.object({
5484
5707
  egress_dust_limits: "minimum_egress_amounts"
5485
5708
  }));
5486
5709
  createRequest("cf_ingress_egress_environment", ingressEgressEnvironment);
5487
- var rpcAsset = z.union([
5488
- z.literal("BTC"),
5710
+ var rpcAssetSchema = z.union([
5489
5711
  z.object({
5490
5712
  chain: z.literal("Bitcoin"),
5491
5713
  asset: z.literal("BTC")
5492
5714
  }),
5493
- z.literal("DOT"),
5494
5715
  z.object({
5495
5716
  chain: z.literal("Polkadot"),
5496
5717
  asset: z.literal("DOT")
5497
5718
  }),
5498
- z.literal("FLIP"),
5499
5719
  z.object({
5500
5720
  chain: z.literal("Ethereum"),
5501
5721
  asset: z.literal("FLIP")
5502
5722
  }),
5503
- z.literal("ETH"),
5504
5723
  z.object({
5505
5724
  chain: z.literal("Ethereum"),
5506
5725
  asset: z.literal("ETH")
5507
5726
  }),
5508
- z.literal("USDC"),
5509
5727
  z.object({
5510
5728
  chain: z.literal("Ethereum"),
5511
5729
  asset: z.literal("USDC")
@@ -5523,39 +5741,6 @@ var rpcAsset = z.union([
5523
5741
  asset: z.literal("USDC")
5524
5742
  })
5525
5743
  ]);
5526
- var poolInfo = z.intersection(z.object({
5527
- limit_order_fee_hundredth_pips: z.number(),
5528
- range_order_fee_hundredth_pips: z.number()
5529
- }), z.union([
5530
- z.object({
5531
- quote_asset: rpcAsset
5532
- }),
5533
- z.object({
5534
- pair_asset: rpcAsset
5535
- }).transform(({ pair_asset }) => ({
5536
- quote_asset: pair_asset
5537
- }))
5538
- ]));
5539
- var feesInfo = z.object({
5540
- Bitcoin: z.object({
5541
- BTC: poolInfo
5542
- }),
5543
- Ethereum: z.object({
5544
- ETH: poolInfo,
5545
- FLIP: poolInfo
5546
- }),
5547
- Polkadot: z.object({
5548
- DOT: poolInfo
5549
- }),
5550
- Arbitrum: z.object({
5551
- ETH: poolInfo,
5552
- USDC: poolInfo
5553
- }).optional()
5554
- });
5555
- var poolsEnvironment = z.object({
5556
- fees: feesInfo
5557
- });
5558
- createRequest("cf_pool_info", poolsEnvironment);
5559
5744
  var environment = z.object({
5560
5745
  ingress_egress: ingressEgressEnvironment,
5561
5746
  swapping: swappingEnvironment,
@@ -5567,30 +5752,21 @@ var swapRate = z.object({
5567
5752
  });
5568
5753
  createRequest("cf_swap_rate", swapRate);
5569
5754
  createRequest("state_getMetadata", hexString);
5570
- var supportedAssetsV120 = z.object({
5571
- Bitcoin: z.array(z.string()),
5572
- Ethereum: z.array(z.string()),
5573
- Polkadot: z.array(z.string())
5574
- }).transform((data) => [
5575
- ...data.Bitcoin.map((asset2) => ({
5576
- chain: "Bitcoin",
5577
- asset: asset2
5578
- })),
5579
- ...data.Ethereum.map((asset2) => ({
5580
- chain: "Ethereum",
5581
- asset: asset2
5582
- })),
5583
- ...data.Polkadot.map((asset2) => ({
5584
- chain: "Polkadot",
5585
- asset: asset2
5586
- }))
5587
- ]);
5588
- var supportedAssetsV130 = z.array(uncheckedAssetAndChain);
5589
- var supportedAssets = z.union([
5590
- supportedAssetsV120,
5591
- supportedAssetsV130
5592
- ]);
5755
+ var supportedAssets = z.array(uncheckedAssetAndChain);
5593
5756
  createRequest("cf_supported_assets", supportedAssets);
5757
+ createRequest("state_getRuntimeVersion", z.object({
5758
+ specVersion: z.number()
5759
+ }));
5760
+ createRequestWithoutParser("cf_pool_orders");
5761
+ createRequest("cf_pool_price_v2", z.object({
5762
+ range_order: numberOrHex
5763
+ }));
5764
+ createRequest("chain_getBlockHash", hexString);
5765
+ var boostPoolsDepthResponseSchema = z.array(z.intersection(rpcAssetSchema, z.object({
5766
+ tier: number,
5767
+ available_amount: u128
5768
+ })));
5769
+ createRequest("cf_boost_pools_depth", boostPoolsDepthResponseSchema);
5594
5770
 
5595
5771
  // ../shared/src/stateChainGateway/utils.ts
5596
5772
  var getStateChainGateway = /* @__PURE__ */ __name((networkOpts) => {
@@ -5613,18 +5789,20 @@ var approveStateChainGateway = /* @__PURE__ */ __name(async (amount, networkOpts
5613
5789
  }, "approveStateChainGateway");
5614
5790
 
5615
5791
  // ../shared/src/stateChainGateway/index.ts
5616
- var fundStateChainAccount = /* @__PURE__ */ __name(async (accountId, amount, networkOpts, txOpts) => {
5792
+ var fundStateChainAccount = /* @__PURE__ */ __name(async (accountId2, amount, networkOpts, txOpts) => {
5617
5793
  const flipContractAddress = networkOpts.network === "localnet" ? networkOpts.flipContractAddress : getTokenContractAddress(InternalAssets.Flip, networkOpts.network);
5618
5794
  const stateChainGateway = getStateChainGateway(networkOpts);
5619
5795
  const { hasSufficientAllowance } = await checkAllowance(amount, await stateChainGateway.getAddress(), flipContractAddress, networkOpts.signer);
5620
5796
  assert(hasSufficientAllowance, "Insufficient allowance");
5621
- const transaction = await stateChainGateway.fundStateChainAccount(accountId, amount, extractOverrides(txOpts));
5622
- return transaction.wait(txOpts.wait);
5797
+ const transaction = await stateChainGateway.fundStateChainAccount(accountId2, amount, extractOverrides(txOpts));
5798
+ await transaction.wait(txOpts.wait);
5799
+ return transaction;
5623
5800
  }, "fundStateChainAccount");
5624
- var executeRedemption = /* @__PURE__ */ __name(async (accountId, networkOpts, txOpts) => {
5801
+ var executeRedemption = /* @__PURE__ */ __name(async (accountId2, networkOpts, txOpts) => {
5625
5802
  const stateChainGateway = getStateChainGateway(networkOpts);
5626
- const transaction = await stateChainGateway.executeRedemption(accountId, extractOverrides(txOpts));
5627
- return transaction.wait(txOpts.wait);
5803
+ const transaction = await stateChainGateway.executeRedemption(accountId2, extractOverrides(txOpts));
5804
+ await transaction.wait(txOpts.wait);
5805
+ return transaction;
5628
5806
  }, "executeRedemption");
5629
5807
  var getMinimumFunding = /* @__PURE__ */ __name((networkOpts) => {
5630
5808
  const stateChainGateway = getStateChainGateway(networkOpts);
@@ -5634,10 +5812,10 @@ var getRedemptionDelay = /* @__PURE__ */ __name((networkOpts) => {
5634
5812
  const stateChainGateway = getStateChainGateway(networkOpts);
5635
5813
  return stateChainGateway.REDEMPTION_DELAY();
5636
5814
  }, "getRedemptionDelay");
5637
- var getPendingRedemption = /* @__PURE__ */ __name(async (accountId, networkOpts) => {
5815
+ var getPendingRedemption = /* @__PURE__ */ __name(async (accountId2, networkOpts) => {
5638
5816
  const stateChainGateway = getStateChainGateway(networkOpts);
5639
- const pendingRedemption = await stateChainGateway.getPendingRedemption(accountId);
5640
- return pendingRedemption.amount !== 0n ? stateChainGateway.getPendingRedemption(accountId) : void 0;
5817
+ const pendingRedemption = await stateChainGateway.getPendingRedemption(accountId2);
5818
+ return pendingRedemption.amount !== 0n ? stateChainGateway.getPendingRedemption(accountId2) : void 0;
5641
5819
  }, "getPendingRedemption");
5642
5820
 
5643
5821
  // src/funding/sdk.ts
@@ -5661,15 +5839,15 @@ var _FundingSDK = class _FundingSDK {
5661
5839
  * @param accountId the hex-encoded validator account id
5662
5840
  * @param amount the amount to fund in base units of FLIP
5663
5841
  */
5664
- async fundStateChainAccount(accountId, amount, txOpts = {}) {
5665
- const tx = await fundStateChainAccount(accountId, amount, this.options, txOpts);
5842
+ async fundStateChainAccount(accountId2, amount, txOpts = {}) {
5843
+ const tx = await fundStateChainAccount(accountId2, amount, this.options, txOpts);
5666
5844
  return tx.hash;
5667
5845
  }
5668
5846
  /**
5669
5847
  * @param accountId the hex-encoded validator account id
5670
5848
  */
5671
- async executeRedemption(accountId, txOpts = {}) {
5672
- const tx = await executeRedemption(accountId, this.options, txOpts);
5849
+ async executeRedemption(accountId2, txOpts = {}) {
5850
+ const tx = await executeRedemption(accountId2, this.options, txOpts);
5673
5851
  return tx.hash;
5674
5852
  }
5675
5853
  async getMinimumFunding() {
@@ -5681,16 +5859,16 @@ var _FundingSDK = class _FundingSDK {
5681
5859
  async getFlipBalance() {
5682
5860
  return getFlipBalance(this.options.network, this.options.signer);
5683
5861
  }
5684
- async getPendingRedemption(accountId) {
5685
- return getPendingRedemption(accountId, this.options);
5862
+ async getPendingRedemption(accountId2) {
5863
+ return getPendingRedemption(accountId2, this.options);
5686
5864
  }
5687
5865
  /**
5688
5866
  * @param the amount of FLIP to request approval for
5689
5867
  * @returns the transaction hash or null if no approval was required
5690
5868
  */
5691
5869
  async approveStateChainGateway(amount, txOpts = {}) {
5692
- const receipt = await approveStateChainGateway(amount, this.options, txOpts);
5693
- return receipt ? receipt.hash : null;
5870
+ const tx = await approveStateChainGateway(amount, this.options, txOpts);
5871
+ return tx ? tx.hash : null;
5694
5872
  }
5695
5873
  async getRedemptionTax() {
5696
5874
  this.redemptionTax ?? (this.redemptionTax = (await getFundingEnvironment(this.rpcConfig)).redemptionTax);