nyxora 1.1.8 → 1.3.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.
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOKEN_MAP = exports.ERC20_ABI = void 0;
4
+ exports.resolveToken = resolveToken;
5
+ exports.ERC20_ABI = [
6
+ {
7
+ type: 'function',
8
+ name: 'balanceOf',
9
+ inputs: [{ name: 'account', type: 'address' }],
10
+ outputs: [{ type: 'uint256' }],
11
+ stateMutability: 'view',
12
+ },
13
+ {
14
+ type: 'function',
15
+ name: 'transfer',
16
+ inputs: [
17
+ { name: 'to', type: 'address' },
18
+ { name: 'value', type: 'uint256' }
19
+ ],
20
+ outputs: [{ type: 'bool' }],
21
+ stateMutability: 'nonpayable',
22
+ },
23
+ {
24
+ type: 'function',
25
+ name: 'approve',
26
+ inputs: [
27
+ { name: 'spender', type: 'address' },
28
+ { name: 'value', type: 'uint256' }
29
+ ],
30
+ outputs: [{ type: 'bool' }],
31
+ stateMutability: 'nonpayable',
32
+ },
33
+ {
34
+ type: 'function',
35
+ name: 'allowance',
36
+ inputs: [
37
+ { name: 'owner', type: 'address' },
38
+ { name: 'spender', type: 'address' }
39
+ ],
40
+ outputs: [{ type: 'uint256' }],
41
+ stateMutability: 'view',
42
+ },
43
+ {
44
+ type: 'function',
45
+ name: 'decimals',
46
+ inputs: [],
47
+ outputs: [{ type: 'uint8' }],
48
+ stateMutability: 'view',
49
+ },
50
+ {
51
+ type: 'function',
52
+ name: 'symbol',
53
+ inputs: [],
54
+ outputs: [{ type: 'string' }],
55
+ stateMutability: 'view',
56
+ }
57
+ ];
58
+ exports.TOKEN_MAP = {
59
+ ethereum: {
60
+ ETH: "0x0000000000000000000000000000000000000000",
61
+ WETH: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
62
+ USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
63
+ USDT: "0xdAC17F958D2ee523a2206206994597C13D831ec7"
64
+ },
65
+ arbitrum: {
66
+ ETH: "0x0000000000000000000000000000000000000000",
67
+ WETH: "0x82aF49447D8a07e3bd95BD0d56f352415231Cl11",
68
+ USDC: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
69
+ "USDC.E": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
70
+ USDT: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"
71
+ },
72
+ base: {
73
+ ETH: "0x0000000000000000000000000000000000000000",
74
+ WETH: "0x4200000000000000000000000000000000000006",
75
+ USDC: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
76
+ USDT: "0xf55BEC9cbd4732f1F4143f647652e924540d9d64"
77
+ },
78
+ optimism: {
79
+ ETH: "0x0000000000000000000000000000000000000000",
80
+ WETH: "0x4200000000000000000000000000000000000006",
81
+ USDC: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
82
+ USDT: "0x94b008aA00579c1307b0EF2c499aD98a8ce58e58"
83
+ },
84
+ bsc: {
85
+ BNB: "0x0000000000000000000000000000000000000000",
86
+ WBNB: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
87
+ USDC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32CD580d",
88
+ USDT: "0x55d398326f99059fF775485246999027B3197955"
89
+ },
90
+ sepolia: {
91
+ ETH: "0x0000000000000000000000000000000000000000",
92
+ WETH: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
93
+ USDC: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", // Circle Faucet Sepolia USDC
94
+ USDT: "0xaA8E23Fb1079EA71e0a56F48a2aA51851D8433D0" // Common Sepolia USDT
95
+ }
96
+ };
97
+ function resolveToken(tokenSymbolOrAddress, chainName) {
98
+ if (tokenSymbolOrAddress.startsWith("0x") && tokenSymbolOrAddress.length === 42) {
99
+ return tokenSymbolOrAddress;
100
+ }
101
+ const symbolUpper = tokenSymbolOrAddress.toUpperCase().trim();
102
+ if (["ETH", "MATIC", "POL", "BNB", "AVAX", "NATIVE"].includes(symbolUpper)) {
103
+ return "0x0000000000000000000000000000000000000000";
104
+ }
105
+ const chainTokens = exports.TOKEN_MAP[chainName];
106
+ if (chainTokens && chainTokens[symbolUpper]) {
107
+ return chainTokens[symbolUpper];
108
+ }
109
+ throw new Error(`Token "${tokenSymbolOrAddress}" pada chain ${chainName} tidak ditemukan. Silakan gunakan alamat kontrak langsung (0x...).`);
110
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nyxora",
3
- "version": "1.1.8",
3
+ "version": "1.3.0",
4
4
  "description": "",
5
5
  "main": "dist/gateway/cli.js",
6
6
  "files": [