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