@sentio/sdk-bundle 4.0.1-rc.2 → 4.0.1-rc.5

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.
Files changed (73) hide show
  1. package/assets/chainlink-oracles-sepolia.json +21 -0
  2. package/assets/chainlink-oracles.json +219 -0
  3. package/dist/{0x1-B_N1Dd6d.js → 0x1-BoDxh-YB.js} +30 -22
  4. package/dist/0x1-BoDxh-YB.js.map +1 -0
  5. package/dist/{AbstractKeylessAccount-dvYSW9Go.js → AbstractKeylessAccount-DE1e2Glg.js} +3 -2
  6. package/dist/{AbstractKeylessAccount-dvYSW9Go.js.map → AbstractKeylessAccount-DE1e2Glg.js.map} +1 -1
  7. package/dist/_md-CZAi2AzY.js +644 -0
  8. package/dist/_md-CZAi2AzY.js.map +1 -0
  9. package/dist/aptos/builtin/0x1.js +2 -2
  10. package/dist/aptos/builtin/0x3.js +3 -3
  11. package/dist/aptos/builtin/0x3.js.map +1 -1
  12. package/dist/aptos/builtin/0x4.js +3 -3
  13. package/dist/aptos/builtin/0x4.js.map +1 -1
  14. package/dist/aptos/builtin/index.js +1 -1
  15. package/dist/aptos/ext/index.js +2 -2
  16. package/dist/aptos/index.js +2 -2
  17. package/dist/{aptos-DPeebJ9j.js → aptos-C3JyHHc4.js} +257 -47
  18. package/dist/{aptos-DPeebJ9j.js.map → aptos-C3JyHHc4.js.map} +1 -1
  19. package/dist/{coin-CWRVUEBa.js → coin-CpgkWpcD.js} +803 -4
  20. package/dist/coin-CpgkWpcD.js.map +1 -0
  21. package/dist/{coin-DREiK-Br.js → coin-D4FF2o2d.js} +1514 -105
  22. package/dist/coin-D4FF2o2d.js.map +1 -0
  23. package/dist/{decode-worker-7st2rUPr.js → decode-worker-C83IoThX.js} +1375 -1456
  24. package/dist/decode-worker-C83IoThX.js.map +1 -0
  25. package/dist/eth/abi-decoder/decode-worker.js +1 -1
  26. package/dist/eth/builtin/eacaggregatorproxy.js +1 -1
  27. package/dist/eth/builtin/erc1155.js +2 -2
  28. package/dist/eth/builtin/erc20.js +1 -1
  29. package/dist/eth/builtin/erc721.js +1 -1
  30. package/dist/eth/builtin/index.js +1 -1
  31. package/dist/eth/builtin/weth9.js +2 -2
  32. package/dist/eth/index.js +3 -3
  33. package/dist/iota/builtin/0x1.js +3 -3
  34. package/dist/iota/builtin/0x2.js +168 -5
  35. package/dist/iota/builtin/0x2.js.map +1 -1
  36. package/dist/iota/builtin/0x3.js +3 -3
  37. package/dist/iota/ext/index.js +1 -1
  38. package/dist/iota/index.js +3 -3
  39. package/dist/{keyless-B3QnUmtL.js → keyless-nGiRkJjM.js} +1278 -976
  40. package/dist/keyless-nGiRkJjM.js.map +1 -0
  41. package/dist/move/index.js +1 -1
  42. package/dist/{move-Dr-DL5zT.js → move-BVvdKH2Q.js} +7 -7
  43. package/dist/{move-Dr-DL5zT.js.map → move-BVvdKH2Q.js.map} +1 -1
  44. package/dist/solana/builtin/index.js +1 -1
  45. package/dist/solana/index.js +1 -1
  46. package/dist/{solana-Cns7Irpe.js → solana-DNjOwr5Y.js} +313 -90
  47. package/dist/solana-DNjOwr5Y.js.map +1 -0
  48. package/dist/sui/builtin/0x1.js +1 -1
  49. package/dist/sui/builtin/0x2.js +4 -4
  50. package/dist/sui/builtin/0x3.js +4 -4
  51. package/dist/sui/builtin/index.js +1 -1
  52. package/dist/sui/ext/index.js +1 -1
  53. package/dist/sui/index.js +3 -3
  54. package/dist/{sui-BbKeYXM3.js → sui-Hqx2uWI-.js} +17 -17
  55. package/dist/{sui-BbKeYXM3.js.map → sui-Hqx2uWI-.js.map} +1 -1
  56. package/dist/testing/index.js +6 -6
  57. package/dist/utils/index.js +1 -1
  58. package/dist/{utils-Jndk-n_F.js → utils-Dloybvj_.js} +3270 -3431
  59. package/dist/utils-Dloybvj_.js.map +1 -0
  60. package/package.json +2 -2
  61. package/assets/chainlink-oracles-sepolia.csv +0 -19
  62. package/assets/chainlink-oracles.csv +0 -217
  63. package/dist/0x1-B_N1Dd6d.js.map +0 -1
  64. package/dist/base-BvfRCgEy.js +0 -959
  65. package/dist/base-BvfRCgEy.js.map +0 -1
  66. package/dist/coin-CWRVUEBa.js.map +0 -1
  67. package/dist/coin-DREiK-Br.js.map +0 -1
  68. package/dist/decode-worker-7st2rUPr.js.map +0 -1
  69. package/dist/dist-CA96PSzE.js +0 -824
  70. package/dist/dist-CA96PSzE.js.map +0 -1
  71. package/dist/keyless-B3QnUmtL.js.map +0 -1
  72. package/dist/solana-Cns7Irpe.js.map +0 -1
  73. package/dist/utils-Jndk-n_F.js.map +0 -1
@@ -1,8 +1,7 @@
1
1
  import { a as __name } from "./bignumber-DddanwOv.js";
2
- import { C as accountTypeString, b as SPLITTER } from "./move-Dr-DL5zT.js";
3
- import { i as getPriceByType } from "./utils-Jndk-n_F.js";
2
+ import { C as accountTypeString, b as SPLITTER } from "./move-BVvdKH2Q.js";
3
+ import { i as getPriceByType } from "./utils-Dloybvj_.js";
4
4
  import { t as fetch$1 } from "./src-Dtwrj-9V.js";
5
- import { S as unknown, _ as record, a as integer, b as tuple, c as literal, d as number, f as object, g as pipe, i as check, l as nullable, m as parse, n as bigint, o as is, p as optional, r as boolean, s as lazy, t as array, u as nullish, v as string, x as union, y as transform } from "./dist-CA96PSzE.js";
6
5
  import { Endpoints } from "@sentio/runtime";
7
6
  import { SuiChainId } from "@sentio/chain";
8
7
 
@@ -1539,6 +1538,806 @@ const bcs = {
1539
1538
  }
1540
1539
  };
1541
1540
 
1541
+ //#endregion
1542
+ //#region ../../node_modules/.pnpm/valibot@1.2.0_typescript@6.0.3/node_modules/valibot/dist/index.mjs
1543
+ let store$4;
1544
+ /**
1545
+ * Returns the global configuration.
1546
+ *
1547
+ * @param config The config to merge.
1548
+ *
1549
+ * @returns The configuration.
1550
+ */
1551
+ /* @__NO_SIDE_EFFECTS__ */
1552
+ function getGlobalConfig(config$1) {
1553
+ return {
1554
+ lang: config$1?.lang ?? store$4?.lang,
1555
+ message: config$1?.message,
1556
+ abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
1557
+ abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
1558
+ };
1559
+ }
1560
+ let store$3;
1561
+ /**
1562
+ * Returns a global error message.
1563
+ *
1564
+ * @param lang The language of the message.
1565
+ *
1566
+ * @returns The error message.
1567
+ */
1568
+ /* @__NO_SIDE_EFFECTS__ */
1569
+ function getGlobalMessage(lang) {
1570
+ return store$3?.get(lang);
1571
+ }
1572
+ let store$2;
1573
+ /**
1574
+ * Returns a schema error message.
1575
+ *
1576
+ * @param lang The language of the message.
1577
+ *
1578
+ * @returns The error message.
1579
+ */
1580
+ /* @__NO_SIDE_EFFECTS__ */
1581
+ function getSchemaMessage(lang) {
1582
+ return store$2?.get(lang);
1583
+ }
1584
+ let store$1;
1585
+ /**
1586
+ * Returns a specific error message.
1587
+ *
1588
+ * @param reference The identifier reference.
1589
+ * @param lang The language of the message.
1590
+ *
1591
+ * @returns The error message.
1592
+ */
1593
+ /* @__NO_SIDE_EFFECTS__ */
1594
+ function getSpecificMessage(reference, lang) {
1595
+ return store$1?.get(reference)?.get(lang);
1596
+ }
1597
+ /**
1598
+ * Stringifies an unknown input to a literal or type string.
1599
+ *
1600
+ * @param input The unknown input.
1601
+ *
1602
+ * @returns A literal or type string.
1603
+ *
1604
+ * @internal
1605
+ */
1606
+ /* @__NO_SIDE_EFFECTS__ */
1607
+ function _stringify(input) {
1608
+ const type = typeof input;
1609
+ if (type === "string") return `"${input}"`;
1610
+ if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
1611
+ if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
1612
+ return type;
1613
+ }
1614
+ /**
1615
+ * Adds an issue to the dataset.
1616
+ *
1617
+ * @param context The issue context.
1618
+ * @param label The issue label.
1619
+ * @param dataset The input dataset.
1620
+ * @param config The configuration.
1621
+ * @param other The optional props.
1622
+ *
1623
+ * @internal
1624
+ */
1625
+ function _addIssue(context, label, dataset, config$1, other) {
1626
+ const input = other && "input" in other ? other.input : dataset.value;
1627
+ const expected = other?.expected ?? context.expects ?? null;
1628
+ const received = other?.received ?? /* @__PURE__ */ _stringify(input);
1629
+ const issue = {
1630
+ kind: context.kind,
1631
+ type: context.type,
1632
+ input,
1633
+ expected,
1634
+ received,
1635
+ message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
1636
+ requirement: context.requirement,
1637
+ path: other?.path,
1638
+ issues: other?.issues,
1639
+ lang: config$1.lang,
1640
+ abortEarly: config$1.abortEarly,
1641
+ abortPipeEarly: config$1.abortPipeEarly
1642
+ };
1643
+ const isSchema = context.kind === "schema";
1644
+ const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
1645
+ if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
1646
+ if (isSchema) dataset.typed = false;
1647
+ if (dataset.issues) dataset.issues.push(issue);
1648
+ else dataset.issues = [issue];
1649
+ }
1650
+ /**
1651
+ * Returns the Standard Schema properties.
1652
+ *
1653
+ * @param context The schema context.
1654
+ *
1655
+ * @returns The Standard Schema properties.
1656
+ */
1657
+ /* @__NO_SIDE_EFFECTS__ */
1658
+ function _getStandardProps(context) {
1659
+ return {
1660
+ version: 1,
1661
+ vendor: "valibot",
1662
+ validate(value$1) {
1663
+ return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
1664
+ }
1665
+ };
1666
+ }
1667
+ /**
1668
+ * Disallows inherited object properties and prevents object prototype
1669
+ * pollution by disallowing certain keys.
1670
+ *
1671
+ * @param object The object to check.
1672
+ * @param key The key to check.
1673
+ *
1674
+ * @returns Whether the key is allowed.
1675
+ *
1676
+ * @internal
1677
+ */
1678
+ /* @__NO_SIDE_EFFECTS__ */
1679
+ function _isValidObjectKey(object$1, key) {
1680
+ return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
1681
+ }
1682
+ /**
1683
+ * Joins multiple `expects` values with the given separator.
1684
+ *
1685
+ * @param values The `expects` values.
1686
+ * @param separator The separator.
1687
+ *
1688
+ * @returns The joined `expects` property.
1689
+ *
1690
+ * @internal
1691
+ */
1692
+ /* @__NO_SIDE_EFFECTS__ */
1693
+ function _joinExpects(values$1, separator) {
1694
+ const list = [...new Set(values$1)];
1695
+ if (list.length > 1) return `(${list.join(` ${separator} `)})`;
1696
+ return list[0] ?? "never";
1697
+ }
1698
+ /**
1699
+ * A Valibot error with useful information.
1700
+ */
1701
+ var ValiError = class extends Error {
1702
+ /**
1703
+ * Creates a Valibot error with useful information.
1704
+ *
1705
+ * @param issues The error issues.
1706
+ */
1707
+ constructor(issues) {
1708
+ super(issues[0].message);
1709
+ this.name = "ValiError";
1710
+ this.issues = issues;
1711
+ }
1712
+ };
1713
+ /* @__NO_SIDE_EFFECTS__ */
1714
+ function check(requirement, message$1) {
1715
+ return {
1716
+ kind: "validation",
1717
+ type: "check",
1718
+ reference: check,
1719
+ async: false,
1720
+ expects: null,
1721
+ requirement,
1722
+ message: message$1,
1723
+ "~run"(dataset, config$1) {
1724
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1);
1725
+ return dataset;
1726
+ }
1727
+ };
1728
+ }
1729
+ /* @__NO_SIDE_EFFECTS__ */
1730
+ function integer(message$1) {
1731
+ return {
1732
+ kind: "validation",
1733
+ type: "integer",
1734
+ reference: integer,
1735
+ async: false,
1736
+ expects: null,
1737
+ requirement: Number.isInteger,
1738
+ message: message$1,
1739
+ "~run"(dataset, config$1) {
1740
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
1741
+ return dataset;
1742
+ }
1743
+ };
1744
+ }
1745
+ /**
1746
+ * Creates a custom transformation action.
1747
+ *
1748
+ * @param operation The transformation operation.
1749
+ *
1750
+ * @returns A transform action.
1751
+ */
1752
+ /* @__NO_SIDE_EFFECTS__ */
1753
+ function transform(operation) {
1754
+ return {
1755
+ kind: "transformation",
1756
+ type: "transform",
1757
+ reference: transform,
1758
+ async: false,
1759
+ operation,
1760
+ "~run"(dataset) {
1761
+ dataset.value = this.operation(dataset.value);
1762
+ return dataset;
1763
+ }
1764
+ };
1765
+ }
1766
+ /**
1767
+ * Returns the fallback value of the schema.
1768
+ *
1769
+ * @param schema The schema to get it from.
1770
+ * @param dataset The output dataset if available.
1771
+ * @param config The config if available.
1772
+ *
1773
+ * @returns The fallback value.
1774
+ */
1775
+ /* @__NO_SIDE_EFFECTS__ */
1776
+ function getFallback(schema, dataset, config$1) {
1777
+ return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
1778
+ }
1779
+ /**
1780
+ * Returns the default value of the schema.
1781
+ *
1782
+ * @param schema The schema to get it from.
1783
+ * @param dataset The input dataset if available.
1784
+ * @param config The config if available.
1785
+ *
1786
+ * @returns The default value.
1787
+ */
1788
+ /* @__NO_SIDE_EFFECTS__ */
1789
+ function getDefault(schema, dataset, config$1) {
1790
+ return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
1791
+ }
1792
+ /**
1793
+ * Checks if the input matches the schema. By using a type predicate, this
1794
+ * function can be used as a type guard.
1795
+ *
1796
+ * @param schema The schema to be used.
1797
+ * @param input The input to be tested.
1798
+ *
1799
+ * @returns Whether the input matches the schema.
1800
+ */
1801
+ /* @__NO_SIDE_EFFECTS__ */
1802
+ function is(schema, input) {
1803
+ return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
1804
+ }
1805
+ /* @__NO_SIDE_EFFECTS__ */
1806
+ function array(item, message$1) {
1807
+ return {
1808
+ kind: "schema",
1809
+ type: "array",
1810
+ reference: array,
1811
+ expects: "Array",
1812
+ async: false,
1813
+ item,
1814
+ message: message$1,
1815
+ get "~standard"() {
1816
+ return /* @__PURE__ */ _getStandardProps(this);
1817
+ },
1818
+ "~run"(dataset, config$1) {
1819
+ const input = dataset.value;
1820
+ if (Array.isArray(input)) {
1821
+ dataset.typed = true;
1822
+ dataset.value = [];
1823
+ for (let key = 0; key < input.length; key++) {
1824
+ const value$1 = input[key];
1825
+ const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
1826
+ if (itemDataset.issues) {
1827
+ const pathItem = {
1828
+ type: "array",
1829
+ origin: "value",
1830
+ input,
1831
+ key,
1832
+ value: value$1
1833
+ };
1834
+ for (const issue of itemDataset.issues) {
1835
+ if (issue.path) issue.path.unshift(pathItem);
1836
+ else issue.path = [pathItem];
1837
+ dataset.issues?.push(issue);
1838
+ }
1839
+ if (!dataset.issues) dataset.issues = itemDataset.issues;
1840
+ if (config$1.abortEarly) {
1841
+ dataset.typed = false;
1842
+ break;
1843
+ }
1844
+ }
1845
+ if (!itemDataset.typed) dataset.typed = false;
1846
+ dataset.value.push(itemDataset.value);
1847
+ }
1848
+ } else _addIssue(this, "type", dataset, config$1);
1849
+ return dataset;
1850
+ }
1851
+ };
1852
+ }
1853
+ /* @__NO_SIDE_EFFECTS__ */
1854
+ function bigint(message$1) {
1855
+ return {
1856
+ kind: "schema",
1857
+ type: "bigint",
1858
+ reference: bigint,
1859
+ expects: "bigint",
1860
+ async: false,
1861
+ message: message$1,
1862
+ get "~standard"() {
1863
+ return /* @__PURE__ */ _getStandardProps(this);
1864
+ },
1865
+ "~run"(dataset, config$1) {
1866
+ if (typeof dataset.value === "bigint") dataset.typed = true;
1867
+ else _addIssue(this, "type", dataset, config$1);
1868
+ return dataset;
1869
+ }
1870
+ };
1871
+ }
1872
+ /* @__NO_SIDE_EFFECTS__ */
1873
+ function boolean(message$1) {
1874
+ return {
1875
+ kind: "schema",
1876
+ type: "boolean",
1877
+ reference: boolean,
1878
+ expects: "boolean",
1879
+ async: false,
1880
+ message: message$1,
1881
+ get "~standard"() {
1882
+ return /* @__PURE__ */ _getStandardProps(this);
1883
+ },
1884
+ "~run"(dataset, config$1) {
1885
+ if (typeof dataset.value === "boolean") dataset.typed = true;
1886
+ else _addIssue(this, "type", dataset, config$1);
1887
+ return dataset;
1888
+ }
1889
+ };
1890
+ }
1891
+ /**
1892
+ * Creates a lazy schema.
1893
+ *
1894
+ * @param getter The schema getter.
1895
+ *
1896
+ * @returns A lazy schema.
1897
+ */
1898
+ /* @__NO_SIDE_EFFECTS__ */
1899
+ function lazy(getter) {
1900
+ return {
1901
+ kind: "schema",
1902
+ type: "lazy",
1903
+ reference: lazy,
1904
+ expects: "unknown",
1905
+ async: false,
1906
+ getter,
1907
+ get "~standard"() {
1908
+ return /* @__PURE__ */ _getStandardProps(this);
1909
+ },
1910
+ "~run"(dataset, config$1) {
1911
+ return this.getter(dataset.value)["~run"](dataset, config$1);
1912
+ }
1913
+ };
1914
+ }
1915
+ /* @__NO_SIDE_EFFECTS__ */
1916
+ function literal(literal_, message$1) {
1917
+ return {
1918
+ kind: "schema",
1919
+ type: "literal",
1920
+ reference: literal,
1921
+ expects: /* @__PURE__ */ _stringify(literal_),
1922
+ async: false,
1923
+ literal: literal_,
1924
+ message: message$1,
1925
+ get "~standard"() {
1926
+ return /* @__PURE__ */ _getStandardProps(this);
1927
+ },
1928
+ "~run"(dataset, config$1) {
1929
+ if (dataset.value === this.literal) dataset.typed = true;
1930
+ else _addIssue(this, "type", dataset, config$1);
1931
+ return dataset;
1932
+ }
1933
+ };
1934
+ }
1935
+ /* @__NO_SIDE_EFFECTS__ */
1936
+ function nullable(wrapped, default_) {
1937
+ return {
1938
+ kind: "schema",
1939
+ type: "nullable",
1940
+ reference: nullable,
1941
+ expects: `(${wrapped.expects} | null)`,
1942
+ async: false,
1943
+ wrapped,
1944
+ default: default_,
1945
+ get "~standard"() {
1946
+ return /* @__PURE__ */ _getStandardProps(this);
1947
+ },
1948
+ "~run"(dataset, config$1) {
1949
+ if (dataset.value === null) {
1950
+ if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
1951
+ if (dataset.value === null) {
1952
+ dataset.typed = true;
1953
+ return dataset;
1954
+ }
1955
+ }
1956
+ return this.wrapped["~run"](dataset, config$1);
1957
+ }
1958
+ };
1959
+ }
1960
+ /* @__NO_SIDE_EFFECTS__ */
1961
+ function nullish(wrapped, default_) {
1962
+ return {
1963
+ kind: "schema",
1964
+ type: "nullish",
1965
+ reference: nullish,
1966
+ expects: `(${wrapped.expects} | null | undefined)`,
1967
+ async: false,
1968
+ wrapped,
1969
+ default: default_,
1970
+ get "~standard"() {
1971
+ return /* @__PURE__ */ _getStandardProps(this);
1972
+ },
1973
+ "~run"(dataset, config$1) {
1974
+ if (dataset.value === null || dataset.value === void 0) {
1975
+ if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
1976
+ if (dataset.value === null || dataset.value === void 0) {
1977
+ dataset.typed = true;
1978
+ return dataset;
1979
+ }
1980
+ }
1981
+ return this.wrapped["~run"](dataset, config$1);
1982
+ }
1983
+ };
1984
+ }
1985
+ /* @__NO_SIDE_EFFECTS__ */
1986
+ function number(message$1) {
1987
+ return {
1988
+ kind: "schema",
1989
+ type: "number",
1990
+ reference: number,
1991
+ expects: "number",
1992
+ async: false,
1993
+ message: message$1,
1994
+ get "~standard"() {
1995
+ return /* @__PURE__ */ _getStandardProps(this);
1996
+ },
1997
+ "~run"(dataset, config$1) {
1998
+ if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
1999
+ else _addIssue(this, "type", dataset, config$1);
2000
+ return dataset;
2001
+ }
2002
+ };
2003
+ }
2004
+ /* @__NO_SIDE_EFFECTS__ */
2005
+ function object(entries$1, message$1) {
2006
+ return {
2007
+ kind: "schema",
2008
+ type: "object",
2009
+ reference: object,
2010
+ expects: "Object",
2011
+ async: false,
2012
+ entries: entries$1,
2013
+ message: message$1,
2014
+ get "~standard"() {
2015
+ return /* @__PURE__ */ _getStandardProps(this);
2016
+ },
2017
+ "~run"(dataset, config$1) {
2018
+ const input = dataset.value;
2019
+ if (input && typeof input === "object") {
2020
+ dataset.typed = true;
2021
+ dataset.value = {};
2022
+ for (const key in this.entries) {
2023
+ const valueSchema = this.entries[key];
2024
+ if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
2025
+ const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
2026
+ const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
2027
+ if (valueDataset.issues) {
2028
+ const pathItem = {
2029
+ type: "object",
2030
+ origin: "value",
2031
+ input,
2032
+ key,
2033
+ value: value$1
2034
+ };
2035
+ for (const issue of valueDataset.issues) {
2036
+ if (issue.path) issue.path.unshift(pathItem);
2037
+ else issue.path = [pathItem];
2038
+ dataset.issues?.push(issue);
2039
+ }
2040
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
2041
+ if (config$1.abortEarly) {
2042
+ dataset.typed = false;
2043
+ break;
2044
+ }
2045
+ }
2046
+ if (!valueDataset.typed) dataset.typed = false;
2047
+ dataset.value[key] = valueDataset.value;
2048
+ } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
2049
+ else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
2050
+ _addIssue(this, "key", dataset, config$1, {
2051
+ input: void 0,
2052
+ expected: `"${key}"`,
2053
+ path: [{
2054
+ type: "object",
2055
+ origin: "key",
2056
+ input,
2057
+ key,
2058
+ value: input[key]
2059
+ }]
2060
+ });
2061
+ if (config$1.abortEarly) break;
2062
+ }
2063
+ }
2064
+ } else _addIssue(this, "type", dataset, config$1);
2065
+ return dataset;
2066
+ }
2067
+ };
2068
+ }
2069
+ /* @__NO_SIDE_EFFECTS__ */
2070
+ function optional(wrapped, default_) {
2071
+ return {
2072
+ kind: "schema",
2073
+ type: "optional",
2074
+ reference: optional,
2075
+ expects: `(${wrapped.expects} | undefined)`,
2076
+ async: false,
2077
+ wrapped,
2078
+ default: default_,
2079
+ get "~standard"() {
2080
+ return /* @__PURE__ */ _getStandardProps(this);
2081
+ },
2082
+ "~run"(dataset, config$1) {
2083
+ if (dataset.value === void 0) {
2084
+ if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
2085
+ if (dataset.value === void 0) {
2086
+ dataset.typed = true;
2087
+ return dataset;
2088
+ }
2089
+ }
2090
+ return this.wrapped["~run"](dataset, config$1);
2091
+ }
2092
+ };
2093
+ }
2094
+ /* @__NO_SIDE_EFFECTS__ */
2095
+ function record(key, value$1, message$1) {
2096
+ return {
2097
+ kind: "schema",
2098
+ type: "record",
2099
+ reference: record,
2100
+ expects: "Object",
2101
+ async: false,
2102
+ key,
2103
+ value: value$1,
2104
+ message: message$1,
2105
+ get "~standard"() {
2106
+ return /* @__PURE__ */ _getStandardProps(this);
2107
+ },
2108
+ "~run"(dataset, config$1) {
2109
+ const input = dataset.value;
2110
+ if (input && typeof input === "object") {
2111
+ dataset.typed = true;
2112
+ dataset.value = {};
2113
+ for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
2114
+ const entryValue = input[entryKey];
2115
+ const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
2116
+ if (keyDataset.issues) {
2117
+ const pathItem = {
2118
+ type: "object",
2119
+ origin: "key",
2120
+ input,
2121
+ key: entryKey,
2122
+ value: entryValue
2123
+ };
2124
+ for (const issue of keyDataset.issues) {
2125
+ issue.path = [pathItem];
2126
+ dataset.issues?.push(issue);
2127
+ }
2128
+ if (!dataset.issues) dataset.issues = keyDataset.issues;
2129
+ if (config$1.abortEarly) {
2130
+ dataset.typed = false;
2131
+ break;
2132
+ }
2133
+ }
2134
+ const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
2135
+ if (valueDataset.issues) {
2136
+ const pathItem = {
2137
+ type: "object",
2138
+ origin: "value",
2139
+ input,
2140
+ key: entryKey,
2141
+ value: entryValue
2142
+ };
2143
+ for (const issue of valueDataset.issues) {
2144
+ if (issue.path) issue.path.unshift(pathItem);
2145
+ else issue.path = [pathItem];
2146
+ dataset.issues?.push(issue);
2147
+ }
2148
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
2149
+ if (config$1.abortEarly) {
2150
+ dataset.typed = false;
2151
+ break;
2152
+ }
2153
+ }
2154
+ if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
2155
+ if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
2156
+ }
2157
+ } else _addIssue(this, "type", dataset, config$1);
2158
+ return dataset;
2159
+ }
2160
+ };
2161
+ }
2162
+ /* @__NO_SIDE_EFFECTS__ */
2163
+ function string(message$1) {
2164
+ return {
2165
+ kind: "schema",
2166
+ type: "string",
2167
+ reference: string,
2168
+ expects: "string",
2169
+ async: false,
2170
+ message: message$1,
2171
+ get "~standard"() {
2172
+ return /* @__PURE__ */ _getStandardProps(this);
2173
+ },
2174
+ "~run"(dataset, config$1) {
2175
+ if (typeof dataset.value === "string") dataset.typed = true;
2176
+ else _addIssue(this, "type", dataset, config$1);
2177
+ return dataset;
2178
+ }
2179
+ };
2180
+ }
2181
+ /* @__NO_SIDE_EFFECTS__ */
2182
+ function tuple(items, message$1) {
2183
+ return {
2184
+ kind: "schema",
2185
+ type: "tuple",
2186
+ reference: tuple,
2187
+ expects: "Array",
2188
+ async: false,
2189
+ items,
2190
+ message: message$1,
2191
+ get "~standard"() {
2192
+ return /* @__PURE__ */ _getStandardProps(this);
2193
+ },
2194
+ "~run"(dataset, config$1) {
2195
+ const input = dataset.value;
2196
+ if (Array.isArray(input)) {
2197
+ dataset.typed = true;
2198
+ dataset.value = [];
2199
+ for (let key = 0; key < this.items.length; key++) {
2200
+ const value$1 = input[key];
2201
+ const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
2202
+ if (itemDataset.issues) {
2203
+ const pathItem = {
2204
+ type: "array",
2205
+ origin: "value",
2206
+ input,
2207
+ key,
2208
+ value: value$1
2209
+ };
2210
+ for (const issue of itemDataset.issues) {
2211
+ if (issue.path) issue.path.unshift(pathItem);
2212
+ else issue.path = [pathItem];
2213
+ dataset.issues?.push(issue);
2214
+ }
2215
+ if (!dataset.issues) dataset.issues = itemDataset.issues;
2216
+ if (config$1.abortEarly) {
2217
+ dataset.typed = false;
2218
+ break;
2219
+ }
2220
+ }
2221
+ if (!itemDataset.typed) dataset.typed = false;
2222
+ dataset.value.push(itemDataset.value);
2223
+ }
2224
+ } else _addIssue(this, "type", dataset, config$1);
2225
+ return dataset;
2226
+ }
2227
+ };
2228
+ }
2229
+ /**
2230
+ * Returns the sub issues of the provided datasets for the union issue.
2231
+ *
2232
+ * @param datasets The datasets.
2233
+ *
2234
+ * @returns The sub issues.
2235
+ *
2236
+ * @internal
2237
+ */
2238
+ /* @__NO_SIDE_EFFECTS__ */
2239
+ function _subIssues(datasets) {
2240
+ let issues;
2241
+ if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
2242
+ else issues = dataset.issues;
2243
+ return issues;
2244
+ }
2245
+ /* @__NO_SIDE_EFFECTS__ */
2246
+ function union(options, message$1) {
2247
+ return {
2248
+ kind: "schema",
2249
+ type: "union",
2250
+ reference: union,
2251
+ expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
2252
+ async: false,
2253
+ options,
2254
+ message: message$1,
2255
+ get "~standard"() {
2256
+ return /* @__PURE__ */ _getStandardProps(this);
2257
+ },
2258
+ "~run"(dataset, config$1) {
2259
+ let validDataset;
2260
+ let typedDatasets;
2261
+ let untypedDatasets;
2262
+ for (const schema of this.options) {
2263
+ const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
2264
+ if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
2265
+ else typedDatasets = [optionDataset];
2266
+ else {
2267
+ validDataset = optionDataset;
2268
+ break;
2269
+ }
2270
+ else if (untypedDatasets) untypedDatasets.push(optionDataset);
2271
+ else untypedDatasets = [optionDataset];
2272
+ }
2273
+ if (validDataset) return validDataset;
2274
+ if (typedDatasets) {
2275
+ if (typedDatasets.length === 1) return typedDatasets[0];
2276
+ _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
2277
+ dataset.typed = true;
2278
+ } else if (untypedDatasets?.length === 1) return untypedDatasets[0];
2279
+ else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
2280
+ return dataset;
2281
+ }
2282
+ };
2283
+ }
2284
+ /**
2285
+ * Creates a unknown schema.
2286
+ *
2287
+ * @returns A unknown schema.
2288
+ */
2289
+ /* @__NO_SIDE_EFFECTS__ */
2290
+ function unknown() {
2291
+ return {
2292
+ kind: "schema",
2293
+ type: "unknown",
2294
+ reference: unknown,
2295
+ expects: "unknown",
2296
+ async: false,
2297
+ get "~standard"() {
2298
+ return /* @__PURE__ */ _getStandardProps(this);
2299
+ },
2300
+ "~run"(dataset) {
2301
+ dataset.typed = true;
2302
+ return dataset;
2303
+ }
2304
+ };
2305
+ }
2306
+ /**
2307
+ * Parses an unknown input based on a schema.
2308
+ *
2309
+ * @param schema The schema to be used.
2310
+ * @param input The input to be parsed.
2311
+ * @param config The parse configuration.
2312
+ *
2313
+ * @returns The parsed input.
2314
+ */
2315
+ function parse(schema, input, config$1) {
2316
+ const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
2317
+ if (dataset.issues) throw new ValiError(dataset.issues);
2318
+ return dataset.value;
2319
+ }
2320
+ /* @__NO_SIDE_EFFECTS__ */
2321
+ function pipe(...pipe$1) {
2322
+ return {
2323
+ ...pipe$1[0],
2324
+ pipe: pipe$1,
2325
+ get "~standard"() {
2326
+ return /* @__PURE__ */ _getStandardProps(this);
2327
+ },
2328
+ "~run"(dataset, config$1) {
2329
+ for (const item of pipe$1) if (item.kind !== "metadata") {
2330
+ if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
2331
+ dataset.typed = false;
2332
+ break;
2333
+ }
2334
+ if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
2335
+ }
2336
+ return dataset;
2337
+ }
2338
+ };
2339
+ }
2340
+
1542
2341
  //#endregion
1543
2342
  //#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
1544
2343
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -6157,4 +6956,4 @@ const DEFAULT_LIST = {
6157
6956
 
6158
6957
  //#endregion
6159
6958
  export { initCoinList as a, IotaNetwork as c, IotaClient as d, Transaction as f, normalizeIotaObjectId as h, getPrice as i, getClient as l, normalizeIotaAddress as m, getCoinInfo as n, whiteListed as o, iotaBcs as p, getCoinInfoWithFallback as r, whitelistCoins as s, calculateValueInUsd as t, getRpcEndpoint as u };
6160
- //# sourceMappingURL=coin-CWRVUEBa.js.map
6959
+ //# sourceMappingURL=coin-CpgkWpcD.js.map