@one_deploy/sdk 1.0.3 → 1.0.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 (53) hide show
  1. package/dist/{engine-CrlhH0nw.d.mts → engine-BeVuHpVx.d.mts} +163 -0
  2. package/dist/{engine-5ndtBaCr.d.ts → engine-DSc1Em4V.d.ts} +163 -0
  3. package/dist/hooks/index.d.mts +132 -3
  4. package/dist/hooks/index.d.ts +132 -3
  5. package/dist/hooks/index.js +351 -0
  6. package/dist/hooks/index.js.map +1 -1
  7. package/dist/hooks/index.mjs +345 -2
  8. package/dist/hooks/index.mjs.map +1 -1
  9. package/dist/index.d.mts +3 -3
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +352 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +345 -2
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/providers/index.d.mts +1 -1
  16. package/dist/providers/index.d.ts +1 -1
  17. package/dist/providers/index.js +98 -0
  18. package/dist/providers/index.js.map +1 -1
  19. package/dist/providers/index.mjs +98 -0
  20. package/dist/providers/index.mjs.map +1 -1
  21. package/dist/react-native.d.mts +140 -3
  22. package/dist/react-native.d.ts +140 -3
  23. package/dist/react-native.js +642 -0
  24. package/dist/react-native.js.map +1 -1
  25. package/dist/react-native.mjs +636 -1
  26. package/dist/react-native.mjs.map +1 -1
  27. package/dist/services/index.d.mts +99 -79
  28. package/dist/services/index.d.ts +99 -79
  29. package/dist/services/index.js +254 -0
  30. package/dist/services/index.js.map +1 -1
  31. package/dist/services/index.mjs +252 -1
  32. package/dist/services/index.mjs.map +1 -1
  33. package/dist/supabase-BT0c7q9e.d.mts +82 -0
  34. package/dist/supabase-BT0c7q9e.d.ts +82 -0
  35. package/package.json +5 -1
  36. package/src/components/OneSwapWidget.tsx +1 -1
  37. package/src/components/ai/OneChainSelector.tsx +183 -0
  38. package/src/components/ai/OneCycleSelector.tsx +187 -0
  39. package/src/components/ai/OnePairSelector.tsx +181 -0
  40. package/src/components/ai/OneTierSelector.tsx +187 -0
  41. package/src/components/ai/index.ts +17 -0
  42. package/src/components/index.ts +3 -0
  43. package/src/hooks/index.ts +20 -0
  44. package/src/hooks/useAITrading.ts +444 -0
  45. package/src/index.ts +20 -0
  46. package/src/react-native.ts +23 -0
  47. package/src/services/engine.ts +184 -0
  48. package/src/services/index.ts +16 -0
  49. package/src/services/usage.ts +249 -0
  50. package/.turbo/turbo-build.log +0 -0
  51. package/.turbo/turbo-type-check.log +0 -0
  52. package/tsconfig.json +0 -22
  53. package/tsup.config.ts +0 -25
@@ -1,3 +1,6 @@
1
+ import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+
1
4
  // src/config/index.ts
2
5
  var DEFAULT_ENGINE_URL = "https://api.one23.io";
3
6
  var DEFAULT_CLIENT_ID = "one_pk_e8f647bfa643fdcfaa3a23f760488e49be09f929296eed4a6c399d437d907f60";
@@ -1155,6 +1158,43 @@ var OneEngineClient = class {
1155
1158
  async adminClearRateLimits(identifier) {
1156
1159
  return this.request(`/api/v1/admin/rate-limits/${identifier}`, { method: "DELETE" });
1157
1160
  }
1161
+ // ========== AI Agent Configuration ==========
1162
+ /**
1163
+ * Get all AI agent configurations
1164
+ * This returns the full agent setup including tiers, cycles, and trading parameters
1165
+ */
1166
+ async getAgentConfigs(options) {
1167
+ const params = new URLSearchParams();
1168
+ if (options?.includeInactive) params.set("includeInactive", "true");
1169
+ if (options?.agentId) params.set("agentId", options.agentId);
1170
+ const query = params.toString();
1171
+ return this.request(`/api/v1/agents${query ? `?${query}` : ""}`, { method: "GET" });
1172
+ }
1173
+ /**
1174
+ * Calculate subscription parameters for an agent
1175
+ */
1176
+ async calculateAgentParams(params) {
1177
+ return this.request("/api/v1/agents/calculate", {
1178
+ method: "POST",
1179
+ body: JSON.stringify(params)
1180
+ });
1181
+ }
1182
+ /**
1183
+ * Get supported trading pairs from agents
1184
+ */
1185
+ async getTradingPairs() {
1186
+ const result = await this.getAgentConfigs();
1187
+ if (result.success && result.data?.agents) {
1188
+ const allPairs = /* @__PURE__ */ new Set();
1189
+ const byAgent = {};
1190
+ for (const agent of result.data.agents) {
1191
+ byAgent[agent.id] = agent.supported_pairs;
1192
+ agent.supported_pairs.forEach((p) => allPairs.add(p));
1193
+ }
1194
+ return { success: true, data: { pairs: Array.from(allPairs), byAgent } };
1195
+ }
1196
+ return { success: false, error: result.error };
1197
+ }
1158
1198
  // ========== AI Quant Trading ==========
1159
1199
  /**
1160
1200
  * Get all AI trading strategies
@@ -1293,6 +1333,67 @@ var OneEngineClient = class {
1293
1333
  async getCryptoMarketOverview() {
1294
1334
  return this.request("/api/v1/prices?type=overview", { method: "GET" });
1295
1335
  }
1336
+ // ========== Project Management ==========
1337
+ /**
1338
+ * Get user's projects
1339
+ */
1340
+ async getProjects(options) {
1341
+ const params = new URLSearchParams();
1342
+ if (options?.isActive !== void 0) params.set("isActive", String(options.isActive));
1343
+ const query = params.toString();
1344
+ return this.request(`/api/v1/projects${query ? `?${query}` : ""}`, { method: "GET" });
1345
+ }
1346
+ /**
1347
+ * Create a new project for ecosystem partners
1348
+ */
1349
+ async createProject(params) {
1350
+ return this.request("/api/v1/projects", {
1351
+ method: "POST",
1352
+ body: JSON.stringify(params)
1353
+ });
1354
+ }
1355
+ /**
1356
+ * Get project details
1357
+ */
1358
+ async getProject(projectId) {
1359
+ return this.request(`/api/v1/projects/${projectId}`, { method: "GET" });
1360
+ }
1361
+ /**
1362
+ * Update project settings
1363
+ */
1364
+ async updateProject(projectId, updates) {
1365
+ return this.request(`/api/v1/projects/${projectId}`, {
1366
+ method: "PATCH",
1367
+ body: JSON.stringify(updates)
1368
+ });
1369
+ }
1370
+ /**
1371
+ * Get project features status
1372
+ */
1373
+ async getProjectFeatures(projectId) {
1374
+ return this.request(`/api/v1/projects/${projectId}/features`, { method: "GET" });
1375
+ }
1376
+ /**
1377
+ * Enable/disable features for a project
1378
+ */
1379
+ async updateProjectFeatures(projectId, features) {
1380
+ return this.request(`/api/v1/projects/${projectId}/features`, {
1381
+ method: "PATCH",
1382
+ body: JSON.stringify(features)
1383
+ });
1384
+ }
1385
+ /**
1386
+ * Regenerate project API key
1387
+ */
1388
+ async regenerateProjectApiKey(projectId) {
1389
+ return this.request(`/api/v1/projects/${projectId}/api-key`, { method: "POST" });
1390
+ }
1391
+ /**
1392
+ * Delete project
1393
+ */
1394
+ async deleteProject(projectId) {
1395
+ return this.request(`/api/v1/projects/${projectId}`, { method: "DELETE" });
1396
+ }
1296
1397
  };
1297
1398
  function createOneEngineClient(options) {
1298
1399
  return new OneEngineClient(options);
@@ -1570,6 +1671,540 @@ var OneSDKError = class extends Error {
1570
1671
  function isOneSDKError(error) {
1571
1672
  return error instanceof OneSDKError;
1572
1673
  }
1674
+ var CHAIN_CONFIG = {
1675
+ ethereum: { name: "Ethereum", icon: "\u039E", color: "#627EEA" },
1676
+ arbitrum: { name: "Arbitrum", icon: "\u25C6", color: "#28A0F0" },
1677
+ bsc: { name: "BSC", icon: "\u25C6", color: "#F3BA2F" },
1678
+ base: { name: "Base", icon: "\u25CF", color: "#0052FF" },
1679
+ polygon: { name: "Polygon", icon: "\u2B21", color: "#8247E5" },
1680
+ optimism: { name: "Optimism", icon: "\u25C9", color: "#FF0420" },
1681
+ avalanche: { name: "Avalanche", icon: "\u25B2", color: "#E84142" },
1682
+ linea: { name: "Linea", icon: "\u2550", color: "#121212" },
1683
+ zksync: { name: "zkSync", icon: "\u2B22", color: "#8C8DFC" },
1684
+ scroll: { name: "Scroll", icon: "\u25CE", color: "#FFEEDA" }
1685
+ };
1686
+ var OneChainSelector = ({
1687
+ supportedChains,
1688
+ selectedChains,
1689
+ onSelectChain,
1690
+ multiSelect = true,
1691
+ accentColor = "#188775",
1692
+ title,
1693
+ subtitle,
1694
+ minSelections = 1,
1695
+ style,
1696
+ titleStyle
1697
+ }) => {
1698
+ const handleSelect = (chain) => {
1699
+ if (multiSelect) {
1700
+ if (selectedChains.includes(chain) && selectedChains.length <= minSelections) {
1701
+ return;
1702
+ }
1703
+ onSelectChain(chain);
1704
+ } else {
1705
+ if (!selectedChains.includes(chain)) {
1706
+ onSelectChain(chain);
1707
+ }
1708
+ }
1709
+ };
1710
+ return /* @__PURE__ */ jsxs(View, { style: [styles.container, style], children: [
1711
+ title && /* @__PURE__ */ jsx(Text, { style: [styles.title, titleStyle], children: title }),
1712
+ subtitle && /* @__PURE__ */ jsx(Text, { style: styles.subtitle, children: subtitle }),
1713
+ /* @__PURE__ */ jsx(View, { style: styles.chainsContainer, children: supportedChains.map((chain) => {
1714
+ const chainInfo = CHAIN_CONFIG[chain] || { name: chain, icon: "\u25CF", color: "#888" };
1715
+ const isSelected = selectedChains.includes(chain);
1716
+ return /* @__PURE__ */ jsxs(
1717
+ TouchableOpacity,
1718
+ {
1719
+ style: [
1720
+ styles.chainChip,
1721
+ isSelected && styles.chainChipSelected,
1722
+ isSelected && { borderColor: accentColor, backgroundColor: accentColor + "15" }
1723
+ ],
1724
+ onPress: () => handleSelect(chain),
1725
+ activeOpacity: 0.7,
1726
+ children: [
1727
+ /* @__PURE__ */ jsx(View, { style: [styles.chainIconBg, { backgroundColor: chainInfo.color + "20" }], children: /* @__PURE__ */ jsx(Text, { style: [styles.chainIcon, { color: chainInfo.color }], children: chainInfo.icon }) }),
1728
+ /* @__PURE__ */ jsx(Text, { style: [
1729
+ styles.chainText,
1730
+ isSelected && { color: accentColor, fontWeight: "600" }
1731
+ ], children: chainInfo.name }),
1732
+ isSelected && /* @__PURE__ */ jsx(Text, { style: [styles.checkmark, { color: accentColor }], children: "\u2713" })
1733
+ ]
1734
+ },
1735
+ chain
1736
+ );
1737
+ }) }),
1738
+ multiSelect && selectedChains.length > 0 && /* @__PURE__ */ jsx(View, { style: styles.selectedInfo, children: /* @__PURE__ */ jsxs(Text, { style: styles.selectedText, children: [
1739
+ selectedChains.length,
1740
+ " chain",
1741
+ selectedChains.length > 1 ? "s" : "",
1742
+ " selected"
1743
+ ] }) })
1744
+ ] });
1745
+ };
1746
+ var styles = StyleSheet.create({
1747
+ container: {
1748
+ marginBottom: 16
1749
+ },
1750
+ title: {
1751
+ fontSize: 16,
1752
+ fontWeight: "600",
1753
+ color: "#1a1a1a",
1754
+ marginBottom: 4
1755
+ },
1756
+ subtitle: {
1757
+ fontSize: 12,
1758
+ color: "#666",
1759
+ marginBottom: 12
1760
+ },
1761
+ chainsContainer: {
1762
+ flexDirection: "row",
1763
+ flexWrap: "wrap",
1764
+ gap: 8
1765
+ },
1766
+ chainChip: {
1767
+ flexDirection: "row",
1768
+ alignItems: "center",
1769
+ paddingHorizontal: 12,
1770
+ paddingVertical: 8,
1771
+ backgroundColor: "#fff",
1772
+ borderRadius: 12,
1773
+ borderWidth: 2,
1774
+ borderColor: "#e5e5e5",
1775
+ gap: 8
1776
+ },
1777
+ chainChipSelected: {
1778
+ borderWidth: 2
1779
+ },
1780
+ chainIconBg: {
1781
+ width: 28,
1782
+ height: 28,
1783
+ borderRadius: 14,
1784
+ alignItems: "center",
1785
+ justifyContent: "center"
1786
+ },
1787
+ chainIcon: {
1788
+ fontSize: 14,
1789
+ fontWeight: "700"
1790
+ },
1791
+ chainText: {
1792
+ fontSize: 14,
1793
+ color: "#666"
1794
+ },
1795
+ checkmark: {
1796
+ fontSize: 16,
1797
+ fontWeight: "700"
1798
+ },
1799
+ selectedInfo: {
1800
+ marginTop: 8,
1801
+ paddingVertical: 4
1802
+ },
1803
+ selectedText: {
1804
+ fontSize: 12,
1805
+ color: "#888"
1806
+ }
1807
+ });
1808
+ var OneTierSelector = ({
1809
+ tiers,
1810
+ selectedTier,
1811
+ onSelectTier,
1812
+ accentColor = "#188775",
1813
+ title,
1814
+ subtitle,
1815
+ showRecommended = true,
1816
+ recommendedLabel = "Recommended",
1817
+ useZhLabels = false,
1818
+ style,
1819
+ titleStyle
1820
+ }) => {
1821
+ const recommendedTierIndex = Math.floor(tiers.length / 2);
1822
+ return /* @__PURE__ */ jsxs(View, { style: [styles2.container, style], children: [
1823
+ title && /* @__PURE__ */ jsx(Text, { style: [styles2.title, titleStyle], children: title }),
1824
+ subtitle && /* @__PURE__ */ jsx(Text, { style: styles2.subtitle, children: subtitle }),
1825
+ /* @__PURE__ */ jsx(View, { style: styles2.tiersContainer, children: tiers.map((tier, index) => {
1826
+ const isSelected = selectedTier?.tier === tier.tier;
1827
+ const isRecommended = showRecommended && index === recommendedTierIndex;
1828
+ return /* @__PURE__ */ jsxs(
1829
+ TouchableOpacity,
1830
+ {
1831
+ style: [
1832
+ styles2.tierCard,
1833
+ isSelected && styles2.tierCardSelected,
1834
+ isSelected && { borderColor: accentColor }
1835
+ ],
1836
+ onPress: () => onSelectTier(tier),
1837
+ activeOpacity: 0.7,
1838
+ children: [
1839
+ isRecommended && /* @__PURE__ */ jsx(View, { style: [styles2.recommendedBadge, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsx(Text, { style: styles2.recommendedText, children: recommendedLabel }) }),
1840
+ /* @__PURE__ */ jsx(Text, { style: [
1841
+ styles2.tierLabel,
1842
+ isSelected && { color: accentColor },
1843
+ isRecommended && styles2.tierLabelWithBadge
1844
+ ], children: useZhLabels && tier.label_zh ? tier.label_zh : tier.label }),
1845
+ /* @__PURE__ */ jsxs(Text, { style: [
1846
+ styles2.tierAmount,
1847
+ isSelected && { color: accentColor }
1848
+ ], children: [
1849
+ "$",
1850
+ tier.amount.toLocaleString()
1851
+ ] }),
1852
+ isSelected && /* @__PURE__ */ jsx(View, { style: [styles2.checkCircle, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsx(Text, { style: styles2.checkmark, children: "\u2713" }) })
1853
+ ]
1854
+ },
1855
+ tier.tier
1856
+ );
1857
+ }) })
1858
+ ] });
1859
+ };
1860
+ var styles2 = StyleSheet.create({
1861
+ container: {
1862
+ marginBottom: 16
1863
+ },
1864
+ title: {
1865
+ fontSize: 16,
1866
+ fontWeight: "600",
1867
+ color: "#1a1a1a",
1868
+ marginBottom: 4
1869
+ },
1870
+ subtitle: {
1871
+ fontSize: 12,
1872
+ color: "#666",
1873
+ marginBottom: 12
1874
+ },
1875
+ tiersContainer: {
1876
+ flexDirection: "row",
1877
+ gap: 8
1878
+ },
1879
+ tierCard: {
1880
+ flex: 1,
1881
+ padding: 16,
1882
+ backgroundColor: "#fff",
1883
+ borderRadius: 12,
1884
+ borderWidth: 2,
1885
+ borderColor: "#e5e5e5",
1886
+ alignItems: "center",
1887
+ position: "relative",
1888
+ overflow: "hidden"
1889
+ },
1890
+ tierCardSelected: {
1891
+ backgroundColor: "#fff"
1892
+ },
1893
+ tierLabel: {
1894
+ fontSize: 12,
1895
+ color: "#666",
1896
+ marginBottom: 4
1897
+ },
1898
+ tierLabelWithBadge: {
1899
+ marginTop: 16
1900
+ },
1901
+ tierAmount: {
1902
+ fontSize: 20,
1903
+ fontWeight: "700",
1904
+ color: "#1a1a1a"
1905
+ },
1906
+ checkCircle: {
1907
+ position: "absolute",
1908
+ top: -8,
1909
+ right: -8,
1910
+ width: 28,
1911
+ height: 28,
1912
+ borderRadius: 14,
1913
+ alignItems: "center",
1914
+ justifyContent: "center"
1915
+ },
1916
+ checkmark: {
1917
+ fontSize: 14,
1918
+ fontWeight: "700",
1919
+ color: "#fff"
1920
+ },
1921
+ recommendedBadge: {
1922
+ position: "absolute",
1923
+ top: 0,
1924
+ left: 0,
1925
+ right: 0,
1926
+ paddingVertical: 4,
1927
+ alignItems: "center"
1928
+ },
1929
+ recommendedText: {
1930
+ fontSize: 10,
1931
+ fontWeight: "700",
1932
+ color: "#fff",
1933
+ textTransform: "uppercase"
1934
+ }
1935
+ });
1936
+ var DEFAULT_SHARE_RATES = {
1937
+ 7: 25,
1938
+ 14: 22,
1939
+ 30: 18,
1940
+ 60: 15,
1941
+ 90: 12
1942
+ };
1943
+ var OneCycleSelector = ({
1944
+ supportedCycles,
1945
+ selectedCycle,
1946
+ onSelectCycle,
1947
+ accentColor = "#188775",
1948
+ title,
1949
+ subtitle,
1950
+ shareRates = DEFAULT_SHARE_RATES,
1951
+ daysLabel = "days",
1952
+ yourShareLabel = "Your share",
1953
+ platformFeeLabel = "Platform fee",
1954
+ style,
1955
+ titleStyle
1956
+ }) => {
1957
+ return /* @__PURE__ */ jsxs(View, { style: [styles3.container, style], children: [
1958
+ title && /* @__PURE__ */ jsx(Text, { style: [styles3.title, titleStyle], children: title }),
1959
+ subtitle && /* @__PURE__ */ jsx(Text, { style: styles3.subtitle, children: subtitle }),
1960
+ /* @__PURE__ */ jsx(View, { style: styles3.cyclesContainer, children: supportedCycles.map((cycle) => {
1961
+ const isSelected = selectedCycle === cycle;
1962
+ const shareRate = shareRates[cycle] || 20;
1963
+ const userRate = 100 - shareRate;
1964
+ return /* @__PURE__ */ jsxs(
1965
+ TouchableOpacity,
1966
+ {
1967
+ style: [
1968
+ styles3.cycleOption,
1969
+ isSelected && styles3.cycleOptionSelected,
1970
+ isSelected && { borderColor: accentColor, backgroundColor: accentColor + "10" }
1971
+ ],
1972
+ onPress: () => onSelectCycle(cycle),
1973
+ activeOpacity: 0.7,
1974
+ children: [
1975
+ /* @__PURE__ */ jsx(Text, { style: [
1976
+ styles3.cycleDays,
1977
+ isSelected && { color: accentColor }
1978
+ ], children: cycle }),
1979
+ /* @__PURE__ */ jsx(Text, { style: styles3.cycleDaysLabel, children: daysLabel }),
1980
+ /* @__PURE__ */ jsxs(View, { style: styles3.cycleEarnings, children: [
1981
+ /* @__PURE__ */ jsxs(Text, { style: [
1982
+ styles3.cycleEarningsValue,
1983
+ isSelected && { color: accentColor }
1984
+ ], children: [
1985
+ userRate,
1986
+ "%"
1987
+ ] }),
1988
+ /* @__PURE__ */ jsx(Text, { style: styles3.cycleEarningsLabel, children: yourShareLabel })
1989
+ ] }),
1990
+ /* @__PURE__ */ jsxs(Text, { style: styles3.cycleFee, children: [
1991
+ shareRate,
1992
+ "% ",
1993
+ platformFeeLabel
1994
+ ] })
1995
+ ]
1996
+ },
1997
+ cycle
1998
+ );
1999
+ }) }),
2000
+ /* @__PURE__ */ jsx(View, { style: styles3.infoBox, children: /* @__PURE__ */ jsx(Text, { style: styles3.infoText, children: "Longer cycles = higher user share" }) })
2001
+ ] });
2002
+ };
2003
+ var styles3 = StyleSheet.create({
2004
+ container: {
2005
+ marginBottom: 16
2006
+ },
2007
+ title: {
2008
+ fontSize: 16,
2009
+ fontWeight: "600",
2010
+ color: "#1a1a1a",
2011
+ marginBottom: 4
2012
+ },
2013
+ subtitle: {
2014
+ fontSize: 12,
2015
+ color: "#666",
2016
+ marginBottom: 12
2017
+ },
2018
+ cyclesContainer: {
2019
+ flexDirection: "row",
2020
+ flexWrap: "wrap",
2021
+ gap: 8
2022
+ },
2023
+ cycleOption: {
2024
+ flex: 1,
2025
+ minWidth: "45%",
2026
+ padding: 16,
2027
+ borderRadius: 12,
2028
+ borderWidth: 2,
2029
+ borderColor: "#e5e5e5",
2030
+ backgroundColor: "#fff",
2031
+ alignItems: "center"
2032
+ },
2033
+ cycleOptionSelected: {
2034
+ borderWidth: 2
2035
+ },
2036
+ cycleDays: {
2037
+ fontSize: 28,
2038
+ fontWeight: "700",
2039
+ color: "#1a1a1a"
2040
+ },
2041
+ cycleDaysLabel: {
2042
+ fontSize: 12,
2043
+ color: "#666",
2044
+ marginBottom: 8
2045
+ },
2046
+ cycleEarnings: {
2047
+ alignItems: "center"
2048
+ },
2049
+ cycleEarningsValue: {
2050
+ fontSize: 18,
2051
+ fontWeight: "700",
2052
+ color: "#10B981"
2053
+ },
2054
+ cycleEarningsLabel: {
2055
+ fontSize: 11,
2056
+ color: "#666"
2057
+ },
2058
+ cycleFee: {
2059
+ fontSize: 11,
2060
+ color: "#888",
2061
+ marginTop: 4
2062
+ },
2063
+ infoBox: {
2064
+ marginTop: 12,
2065
+ padding: 8,
2066
+ backgroundColor: "#f5f5f5",
2067
+ borderRadius: 8
2068
+ },
2069
+ infoText: {
2070
+ fontSize: 12,
2071
+ color: "#666",
2072
+ textAlign: "center"
2073
+ }
2074
+ });
2075
+ var PAIR_ICONS = {
2076
+ "BTC/USDT": "\u20BF",
2077
+ "ETH/USDT": "\u039E",
2078
+ "SOL/USDT": "\u25CE",
2079
+ "BNB/USDT": "\u25C6",
2080
+ "XRP/USDT": "\u2715",
2081
+ "DOGE/USDT": "\xD0",
2082
+ "ADA/USDT": "\u25C8",
2083
+ "AVAX/USDT": "\u25B2",
2084
+ "DOT/USDT": "\u25CF",
2085
+ "MATIC/USDT": "\u2B21",
2086
+ "LINK/USDT": "\u25C7",
2087
+ "UNI/USDT": "\u{1F984}",
2088
+ "ATOM/USDT": "\u269B",
2089
+ "LTC/USDT": "\u0141",
2090
+ "ARB/USDT": "\u25C6",
2091
+ "OP/USDT": "\u25C9"
2092
+ };
2093
+ var OnePairSelector = ({
2094
+ supportedPairs,
2095
+ selectedPairs,
2096
+ onTogglePair,
2097
+ accentColor = "#188775",
2098
+ title,
2099
+ subtitle,
2100
+ minSelections = 1,
2101
+ maxSelections = 0,
2102
+ style,
2103
+ titleStyle
2104
+ }) => {
2105
+ const handleToggle = (pair) => {
2106
+ const isSelected = selectedPairs.includes(pair);
2107
+ if (isSelected && selectedPairs.length <= minSelections) {
2108
+ return;
2109
+ }
2110
+ if (!isSelected && maxSelections > 0 && selectedPairs.length >= maxSelections) {
2111
+ return;
2112
+ }
2113
+ onTogglePair(pair);
2114
+ };
2115
+ return /* @__PURE__ */ jsxs(View, { style: [styles4.container, style], children: [
2116
+ title && /* @__PURE__ */ jsx(Text, { style: [styles4.title, titleStyle], children: title }),
2117
+ subtitle && /* @__PURE__ */ jsx(Text, { style: styles4.subtitle, children: subtitle }),
2118
+ /* @__PURE__ */ jsx(View, { style: styles4.pairsContainer, children: supportedPairs.map((pair) => {
2119
+ const isSelected = selectedPairs.includes(pair);
2120
+ const icon = PAIR_ICONS[pair] || "\u25CF";
2121
+ const baseSymbol = pair.split("/")[0];
2122
+ return /* @__PURE__ */ jsxs(
2123
+ TouchableOpacity,
2124
+ {
2125
+ style: [
2126
+ styles4.pairChip,
2127
+ isSelected && styles4.pairChipSelected,
2128
+ isSelected && { backgroundColor: accentColor + "15", borderColor: accentColor }
2129
+ ],
2130
+ onPress: () => handleToggle(pair),
2131
+ activeOpacity: 0.7,
2132
+ children: [
2133
+ /* @__PURE__ */ jsx(Text, { style: styles4.pairIcon, children: icon }),
2134
+ /* @__PURE__ */ jsx(Text, { style: [
2135
+ styles4.pairText,
2136
+ isSelected && { color: accentColor, fontWeight: "600" }
2137
+ ], children: baseSymbol }),
2138
+ isSelected && /* @__PURE__ */ jsx(Text, { style: [styles4.checkmark, { color: accentColor }], children: "\u2713" })
2139
+ ]
2140
+ },
2141
+ pair
2142
+ );
2143
+ }) }),
2144
+ /* @__PURE__ */ jsx(View, { style: styles4.selectedInfo, children: /* @__PURE__ */ jsxs(Text, { style: styles4.selectedText, children: [
2145
+ selectedPairs.length,
2146
+ " pair",
2147
+ selectedPairs.length !== 1 ? "s" : "",
2148
+ " selected",
2149
+ minSelections > 0 && ` (min: ${minSelections})`,
2150
+ maxSelections > 0 && ` (max: ${maxSelections})`
2151
+ ] }) })
2152
+ ] });
2153
+ };
2154
+ var styles4 = StyleSheet.create({
2155
+ container: {
2156
+ marginBottom: 16
2157
+ },
2158
+ title: {
2159
+ fontSize: 16,
2160
+ fontWeight: "600",
2161
+ color: "#1a1a1a",
2162
+ marginBottom: 4
2163
+ },
2164
+ subtitle: {
2165
+ fontSize: 12,
2166
+ color: "#666",
2167
+ marginBottom: 12
2168
+ },
2169
+ pairsContainer: {
2170
+ flexDirection: "row",
2171
+ flexWrap: "wrap",
2172
+ gap: 8
2173
+ },
2174
+ pairChip: {
2175
+ flexDirection: "row",
2176
+ alignItems: "center",
2177
+ paddingHorizontal: 12,
2178
+ paddingVertical: 8,
2179
+ backgroundColor: "#fff",
2180
+ borderRadius: 8,
2181
+ borderWidth: 1,
2182
+ borderColor: "#e5e5e5",
2183
+ gap: 6
2184
+ },
2185
+ pairChipSelected: {
2186
+ borderWidth: 2
2187
+ },
2188
+ pairIcon: {
2189
+ fontSize: 14
2190
+ },
2191
+ pairText: {
2192
+ fontSize: 14,
2193
+ color: "#666"
2194
+ },
2195
+ checkmark: {
2196
+ fontSize: 14,
2197
+ fontWeight: "700"
2198
+ },
2199
+ selectedInfo: {
2200
+ marginTop: 8,
2201
+ paddingVertical: 4
2202
+ },
2203
+ selectedText: {
2204
+ fontSize: 12,
2205
+ color: "#888"
2206
+ }
2207
+ });
1573
2208
 
1574
2209
  // src/react-native.ts
1575
2210
  function createCachedEngineClient(storage, options) {
@@ -1752,6 +2387,6 @@ function getExplorerUrl(chainId, hash, type = "tx") {
1752
2387
  return `${baseUrl}/${type}/${hash}`;
1753
2388
  }
1754
2389
 
1755
- export { CHAIN_CONFIGS, COINGECKO_IDS, OneEngineClient, OneSDKError, PriceService, TOKEN_NAMES, capitalize, checksumAddress, createCachedEngineClient, createDeepLinkHandler, createOneEngineClient, formatCryptoAmount, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTokenAmount, formatUSD, generateShareContent, getConfig, getExplorerUrl, initOneSDK, isOneSDKError, isValidAddress, isValidEmail, isValidPhone, omit, parseQRCode, pick, priceService, retry, shortenAddress, sleep, slugify, truncate };
2390
+ export { CHAIN_CONFIG, CHAIN_CONFIGS, COINGECKO_IDS, DEFAULT_SHARE_RATES, OneChainSelector, OneCycleSelector, OneEngineClient, OnePairSelector, OneSDKError, OneTierSelector, PAIR_ICONS, PriceService, TOKEN_NAMES, capitalize, checksumAddress, createCachedEngineClient, createDeepLinkHandler, createOneEngineClient, formatCryptoAmount, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTokenAmount, formatUSD, generateShareContent, getConfig, getExplorerUrl, initOneSDK, isOneSDKError, isValidAddress, isValidEmail, isValidPhone, omit, parseQRCode, pick, priceService, retry, shortenAddress, sleep, slugify, truncate };
1756
2391
  //# sourceMappingURL=react-native.mjs.map
1757
2392
  //# sourceMappingURL=react-native.mjs.map