myxl-core 1.0.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/README.md +15 -0
- package/dist/@types/payment.d.ts +10 -0
- package/dist/auth.d.ts +20 -0
- package/dist/auth.js +157 -0
- package/dist/ciam.d.ts +259 -0
- package/dist/ciam.js +351 -0
- package/dist/client.d.ts +56 -0
- package/dist/client.js +276 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.js +70 -0
- package/dist/device.d.ts +23 -0
- package/dist/device.js +107 -0
- package/dist/encrypt.d.ts +37 -0
- package/dist/encrypt.js +259 -0
- package/dist/family-plan.d.ts +28 -0
- package/dist/family-plan.js +325 -0
- package/dist/family.d.ts +146 -0
- package/dist/family.js +365 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1487 -0
- package/dist/lib/decoy.d.ts +17 -0
- package/dist/lib/decoy.js +117 -0
- package/dist/lib/encrypt-helper.d.ts +71 -0
- package/dist/lib/encrypt-helper.js +166 -0
- package/dist/lib/payment.d.ts +116 -0
- package/dist/lib/payment.js +271 -0
- package/dist/lib/utils.d.ts +15 -0
- package/dist/lib/utils.js +290 -0
- package/dist/notification.d.ts +28 -0
- package/dist/notification.js +275 -0
- package/dist/package.d.ts +259 -0
- package/dist/package.js +387 -0
- package/dist/payments/balance.d.ts +2 -0
- package/dist/payments/balance.js +408 -0
- package/dist/payments/decoy.d.ts +1 -0
- package/dist/payments/decoy.js +6 -0
- package/dist/payments/ewallet.d.ts +11 -0
- package/dist/payments/ewallet.js +373 -0
- package/dist/payments/index.d.ts +3 -0
- package/dist/payments/index.js +632 -0
- package/dist/payments/qris.d.ts +2 -0
- package/dist/payments/qris.js +378 -0
- package/dist/profile.d.ts +1 -0
- package/dist/profile.js +266 -0
- package/dist/verification.d.ts +2 -0
- package/dist/verification.js +279 -0
- package/package.json +116 -0
package/dist/ciam.js
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
function __accessProp(key) {
|
|
7
|
+
return this[key];
|
|
8
|
+
}
|
|
9
|
+
var __toCommonJS = (from) => {
|
|
10
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
11
|
+
if (entry)
|
|
12
|
+
return entry;
|
|
13
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (var key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(entry, key))
|
|
17
|
+
__defProp(entry, key, {
|
|
18
|
+
get: __accessProp.bind(from, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
__moduleCache.set(from, entry);
|
|
23
|
+
return entry;
|
|
24
|
+
};
|
|
25
|
+
var __moduleCache;
|
|
26
|
+
var __returnValue = (v) => v;
|
|
27
|
+
function __exportSetter(name, newValue) {
|
|
28
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
29
|
+
}
|
|
30
|
+
var __export = (target, all) => {
|
|
31
|
+
for (var name in all)
|
|
32
|
+
__defProp(target, name, {
|
|
33
|
+
get: all[name],
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
set: __exportSetter.bind(all, name)
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
40
|
+
|
|
41
|
+
// src/lib/encrypt-helper.ts
|
|
42
|
+
var exports_encrypt_helper = {};
|
|
43
|
+
__export(exports_encrypt_helper, {
|
|
44
|
+
makeXSignaturePayment: () => makeXSignaturePayment,
|
|
45
|
+
makeXSignatureLoyalty: () => makeXSignatureLoyalty,
|
|
46
|
+
makeXSignatureBountyAllotment: () => makeXSignatureBountyAllotment,
|
|
47
|
+
makeXSignatureBounty: () => makeXSignatureBounty,
|
|
48
|
+
makeXSignatureBasic: () => makeXSignatureBasic,
|
|
49
|
+
makeXSignature: () => makeXSignature,
|
|
50
|
+
makeAxApiSignature: () => makeAxApiSignature,
|
|
51
|
+
encryptXData: () => encryptXData,
|
|
52
|
+
encryptEncryptedField: () => encryptEncryptedField,
|
|
53
|
+
decryptXData: () => decryptXData,
|
|
54
|
+
decryptEncryptedField: () => decryptEncryptedField
|
|
55
|
+
});
|
|
56
|
+
import crypto from "crypto";
|
|
57
|
+
function pkcs7Pad(buf, blockSize = 16) {
|
|
58
|
+
const pad = blockSize - buf.length % blockSize;
|
|
59
|
+
const padBuf = Buffer.alloc(pad, pad);
|
|
60
|
+
return Buffer.concat([buf, padBuf]);
|
|
61
|
+
}
|
|
62
|
+
function pkcs7Unpad(buf) {
|
|
63
|
+
const pad = buf[buf.length - 1] ?? 16;
|
|
64
|
+
if (pad < 1 || pad > 16)
|
|
65
|
+
throw new Error("Invalid PKCS7 padding");
|
|
66
|
+
return buf.slice(0, buf.length - pad);
|
|
67
|
+
}
|
|
68
|
+
function deriveIv(xtimeMs) {
|
|
69
|
+
const sha = crypto.createHash("sha256").update(String(xtimeMs)).digest("hex");
|
|
70
|
+
return Buffer.from(sha.slice(0, 16), "ascii");
|
|
71
|
+
}
|
|
72
|
+
function urlsafeB64Encode(buf) {
|
|
73
|
+
return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_");
|
|
74
|
+
}
|
|
75
|
+
function urlsafeB64Decode(s) {
|
|
76
|
+
const b64 = s.replace(/-/g, "+").replace(/_/g, "/");
|
|
77
|
+
const padded = b64 + "=".repeat((4 - b64.length % 4) % 4);
|
|
78
|
+
return Buffer.from(padded, "base64");
|
|
79
|
+
}
|
|
80
|
+
function encryptXData(plaintext, xtimeMs) {
|
|
81
|
+
const key = Buffer.from(XDATA_KEY, "ascii");
|
|
82
|
+
const iv = deriveIv(xtimeMs);
|
|
83
|
+
const padded = pkcs7Pad(Buffer.from(plaintext, "utf-8"));
|
|
84
|
+
const cipher = crypto.createCipheriv("aes-256-cbc", key, iv);
|
|
85
|
+
cipher.setAutoPadding(false);
|
|
86
|
+
const ct = Buffer.concat([cipher.update(padded), cipher.final()]);
|
|
87
|
+
return urlsafeB64Encode(ct);
|
|
88
|
+
}
|
|
89
|
+
function decryptXData(xdata, xtimeMs) {
|
|
90
|
+
const key = Buffer.from(XDATA_KEY, "ascii");
|
|
91
|
+
const iv = deriveIv(xtimeMs);
|
|
92
|
+
const ct = urlsafeB64Decode(xdata);
|
|
93
|
+
const decipher = crypto.createDecipheriv("aes-256-cbc", key, iv);
|
|
94
|
+
decipher.setAutoPadding(false);
|
|
95
|
+
const pt = Buffer.concat([decipher.update(ct), decipher.final()]);
|
|
96
|
+
return pkcs7Unpad(pt).toString("utf-8");
|
|
97
|
+
}
|
|
98
|
+
function makeXSignature(idToken, method, path, sigTimeSec) {
|
|
99
|
+
const keyStr = `${X_API_BASE_SECRET};${idToken};${method};${path};${sigTimeSec}`;
|
|
100
|
+
const msg = `${idToken};${sigTimeSec};`;
|
|
101
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
102
|
+
}
|
|
103
|
+
function makeXSignaturePayment(accessToken, sigTimeSec, packageCode, tokenPayment, paymentMethod, paymentFor, path) {
|
|
104
|
+
const keyStr = `${X_API_BASE_SECRET};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;POST;${path};${sigTimeSec}`;
|
|
105
|
+
const msg = `${accessToken};${tokenPayment};${sigTimeSec};${paymentFor};${paymentMethod};${packageCode};`;
|
|
106
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
107
|
+
}
|
|
108
|
+
function makeXSignatureBounty(accessToken, sigTimeSec, packageCode, tokenPayment) {
|
|
109
|
+
const path = "api/v8/personalization/bounties-exchange";
|
|
110
|
+
const keyStr = `${X_API_BASE_SECRET};${accessToken};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;POST;${path};${sigTimeSec}`;
|
|
111
|
+
const msg = `${accessToken};${tokenPayment};${sigTimeSec};${packageCode};`;
|
|
112
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
113
|
+
}
|
|
114
|
+
function makeXSignatureLoyalty(sigTimeSec, packageCode, tokenConfirmation, path) {
|
|
115
|
+
const keyStr = `${X_API_BASE_SECRET};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;POST;${path};${sigTimeSec}`;
|
|
116
|
+
const msg = `${tokenConfirmation};${sigTimeSec};${packageCode};`;
|
|
117
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
118
|
+
}
|
|
119
|
+
function makeXSignatureBountyAllotment(sigTimeSec, packageCode, tokenConfirmation, path, destinationMsisdn) {
|
|
120
|
+
const keyStr = `${X_API_BASE_SECRET};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;${destinationMsisdn};POST;${path};${sigTimeSec}`;
|
|
121
|
+
const msg = `${tokenConfirmation};${sigTimeSec};${destinationMsisdn};${packageCode};`;
|
|
122
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
123
|
+
}
|
|
124
|
+
function makeXSignatureBasic(method, path, sigTimeSec) {
|
|
125
|
+
const keyStr = `${X_API_BASE_SECRET};${method};${path};${sigTimeSec}`;
|
|
126
|
+
const msg = `${sigTimeSec};en;`;
|
|
127
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
128
|
+
}
|
|
129
|
+
function makeAxApiSignature(tsForSign, contact, code, contactType) {
|
|
130
|
+
const preimage = `${tsForSign}password${contactType}${contact}${code}openid`;
|
|
131
|
+
const digest = crypto.createHmac("sha256", Buffer.from(AX_API_SIG_KEY, "ascii")).update(preimage).digest();
|
|
132
|
+
return digest.toString("base64");
|
|
133
|
+
}
|
|
134
|
+
function decryptEncryptedField(encryptedB64) {
|
|
135
|
+
const ivAscii = encryptedB64.slice(-16);
|
|
136
|
+
const b64Part = encryptedB64.slice(0, -16);
|
|
137
|
+
const key = Buffer.from(ENCRYPTED_FIELD_KEY, "ascii");
|
|
138
|
+
const iv = Buffer.from(ivAscii, "ascii");
|
|
139
|
+
const ct = urlsafeB64Decode(b64Part);
|
|
140
|
+
const decipher = crypto.createDecipheriv("aes-128-cbc", key, iv);
|
|
141
|
+
decipher.setAutoPadding(false);
|
|
142
|
+
const pt = Buffer.concat([decipher.update(ct), decipher.final()]);
|
|
143
|
+
return pkcs7Unpad(pt).toString("utf-8");
|
|
144
|
+
}
|
|
145
|
+
function encryptEncryptedField(plaintext) {
|
|
146
|
+
const key = Buffer.from(ENCRYPTED_FIELD_KEY, "ascii");
|
|
147
|
+
const ivHex = crypto.randomBytes(8).toString("hex");
|
|
148
|
+
const iv = Buffer.from(ivHex, "ascii");
|
|
149
|
+
const padded = pkcs7Pad(Buffer.from(plaintext, "utf-8"));
|
|
150
|
+
const cipher = crypto.createCipheriv("aes-128-cbc", key, iv);
|
|
151
|
+
cipher.setAutoPadding(false);
|
|
152
|
+
const ct = Buffer.concat([cipher.update(padded), cipher.final()]);
|
|
153
|
+
return urlsafeB64Encode(ct) + ivHex;
|
|
154
|
+
}
|
|
155
|
+
var init_encrypt_helper = __esm(() => {
|
|
156
|
+
init_config();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// src/encrypt.ts
|
|
160
|
+
function encryptSignXData(method, path, idToken, payload) {
|
|
161
|
+
const plainBody = JSON.stringify(payload);
|
|
162
|
+
const xtime = Date.now();
|
|
163
|
+
const xdata = encryptXData(plainBody, xtime);
|
|
164
|
+
const sigTimeSec = Math.floor(xtime / 1000);
|
|
165
|
+
const xSignature = makeXSignature(idToken, method, path, sigTimeSec);
|
|
166
|
+
return {
|
|
167
|
+
x_signature: xSignature,
|
|
168
|
+
encrypted_body: { xdata, xtime }
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
async function decryptXData2(xdata, xtimeMs) {
|
|
172
|
+
const { decryptXData: _decrypt } = (init_encrypt_helper(), __toCommonJS(exports_encrypt_helper));
|
|
173
|
+
return JSON.parse(_decrypt(xdata, xtimeMs));
|
|
174
|
+
}
|
|
175
|
+
var init_encrypt = __esm(() => {
|
|
176
|
+
init_config();
|
|
177
|
+
init_encrypt_helper();
|
|
178
|
+
init_encrypt_helper();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// src/lib/utils.ts
|
|
182
|
+
import axios from "axios";
|
|
183
|
+
import { v4 as uuidv4 } from "uuid";
|
|
184
|
+
import { DateTime } from "luxon";
|
|
185
|
+
function javaLikeTimestamp(dt = DateTime.now()) {
|
|
186
|
+
return dt.toMillis().toString();
|
|
187
|
+
}
|
|
188
|
+
async function sendApiRequest(path, payloadDict, idToken, method = "POST") {
|
|
189
|
+
const encryptedPayload = encryptSignXData(method, path, idToken, payloadDict);
|
|
190
|
+
const xtime = Number(encryptedPayload.encrypted_body.xtime);
|
|
191
|
+
const sigTimeSec = Math.floor(xtime / 1000);
|
|
192
|
+
const body = encryptedPayload.encrypted_body;
|
|
193
|
+
const x_sig = encryptedPayload.x_signature;
|
|
194
|
+
const headers = {
|
|
195
|
+
host: BASE_API_URL.replace(/^https?:\/\//, ""),
|
|
196
|
+
"content-type": "application/json; charset=utf-8",
|
|
197
|
+
"user-agent": UA,
|
|
198
|
+
"x-api-key": API_KEY,
|
|
199
|
+
authorization: `Bearer ${idToken}`,
|
|
200
|
+
"x-hv": "v3",
|
|
201
|
+
"x-signature-time": String(sigTimeSec),
|
|
202
|
+
"x-signature": x_sig,
|
|
203
|
+
"x-request-id": uuidv4(),
|
|
204
|
+
"x-request-at": javaLikeTimestamp(),
|
|
205
|
+
"x-version-app": X_APP_VERSION
|
|
206
|
+
};
|
|
207
|
+
const url = `${BASE_API_URL.replace(/\/$/, "")}/${path.replace(/^\//, "")}`;
|
|
208
|
+
const resp = await axios.post(url, body, {
|
|
209
|
+
headers,
|
|
210
|
+
timeout: 30000
|
|
211
|
+
});
|
|
212
|
+
const respData = resp.data;
|
|
213
|
+
const decryptedXData = await decryptXData2(respData.xdata, respData.xtime);
|
|
214
|
+
if (decryptedXData.status === "FAILED") {
|
|
215
|
+
throw new Error(JSON.stringify(decryptedXData));
|
|
216
|
+
}
|
|
217
|
+
return decryptedXData;
|
|
218
|
+
}
|
|
219
|
+
function unseal(getter, fallback) {
|
|
220
|
+
try {
|
|
221
|
+
const hex = getter();
|
|
222
|
+
if (!hex || typeof __SEED__ === "undefined")
|
|
223
|
+
return fallback;
|
|
224
|
+
const seed = Buffer.from(__SEED__, "hex");
|
|
225
|
+
const data = Buffer.from(hex, "hex");
|
|
226
|
+
return Buffer.from(data.map((b, i) => b ^ seed[i % seed.length])).toString("utf8");
|
|
227
|
+
} catch {
|
|
228
|
+
return fallback;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
var init_utils = __esm(() => {
|
|
232
|
+
init_config();
|
|
233
|
+
init_encrypt();
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
// src/config.ts
|
|
237
|
+
var BASE_API_URL, BASE_CIAM_URL, BASIC_AUTH, AX_FP_KEY, UA, API_KEY, ENCRYPTED_FIELD_KEY, XDATA_KEY, AX_API_SIG_KEY, X_API_BASE_SECRET, CIRCLE_MSISDN_KEY, X_APP_VERSION = "8.9.0";
|
|
238
|
+
var init_config = __esm(() => {
|
|
239
|
+
init_utils();
|
|
240
|
+
BASE_API_URL = unseal(() => __E_BASE_API_URL__, "https://api.myxl.xlaxiata.co.id");
|
|
241
|
+
BASE_CIAM_URL = unseal(() => __E_BASE_CIAM_URL__, "https://gede.ciam.xlaxiata.co.id");
|
|
242
|
+
BASIC_AUTH = unseal(() => __E_BASIC_AUTH__, "OWZjOTdlZDEtNmEzMC00OGQ1LTk1MTYtNjBjNTNjZTNhMTM1OllEV21GNExKajlYSUt3UW56eTJlMmxiMHRKUWIyOW8z");
|
|
243
|
+
AX_FP_KEY = unseal(() => __E_AX_FP_KEY__, "18b4d589826af50241177961590e6693");
|
|
244
|
+
UA = unseal(() => __E_UA__, "myXL / 8.9.0(1202); com.android.vending; (samsung; SM-N935F; SDK 33; Android 13)");
|
|
245
|
+
API_KEY = unseal(() => __E_API_KEY__, "vT8tINqHaOxXbGE7eOWAhA==");
|
|
246
|
+
ENCRYPTED_FIELD_KEY = unseal(() => __E_ENCRYPTED_FIELD_KEY__, "5dccbf08920a5527");
|
|
247
|
+
XDATA_KEY = unseal(() => __E_XDATA_KEY__, "5dccbf08920a5527b99e222789c34bb7");
|
|
248
|
+
AX_API_SIG_KEY = unseal(() => __E_AX_API_SIG_KEY__, "18b4d589826af50241177961590e6693");
|
|
249
|
+
X_API_BASE_SECRET = unseal(() => __E_X_API_BASE_SECRET__, "mU1Y4n1vBjf3M7tMnRkFU08mVyUJHed8B5En3EAniu1mXLixeuASmBmKnkyzVziOye7rG5nIekMdthensbQMcOJ6SLnrkGyfXALD7mrBC6vuWv6G01pmD3XlU5rT7Tzx");
|
|
250
|
+
CIRCLE_MSISDN_KEY = unseal(() => __E_CIRCLE_MSISDN_KEY__, "5dccbf08920a5527");
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// src/ciam.ts
|
|
254
|
+
init_config();
|
|
255
|
+
init_utils();
|
|
256
|
+
import axios2 from "axios";
|
|
257
|
+
import { DateTime as DateTime2, FixedOffsetZone } from "luxon";
|
|
258
|
+
import { v4 as uuidv42 } from "uuid";
|
|
259
|
+
async function getNewToken(refreshToken, axDeviceId, axFingerprint) {
|
|
260
|
+
try {
|
|
261
|
+
const url = `${BASE_CIAM_URL}/realms/xl-ciam/protocol/openid-connect/token`;
|
|
262
|
+
const gmt7Zone = FixedOffsetZone.instance(420);
|
|
263
|
+
const now = DateTime2.now().setZone(gmt7Zone);
|
|
264
|
+
const ax_request_at = now.toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS") + "+0700";
|
|
265
|
+
const ax_request_id = uuidv42();
|
|
266
|
+
const headers = {
|
|
267
|
+
Host: BASE_CIAM_URL.replace("https://", ""),
|
|
268
|
+
"ax-request-at": ax_request_at,
|
|
269
|
+
"ax-device-id": axDeviceId,
|
|
270
|
+
"ax-request-id": ax_request_id,
|
|
271
|
+
"ax-request-device": "samsung",
|
|
272
|
+
"ax-request-device-model": "SM-N935F",
|
|
273
|
+
"ax-fingerprint": axFingerprint,
|
|
274
|
+
authorization: `Basic ${BASIC_AUTH}`,
|
|
275
|
+
"user-agent": UA,
|
|
276
|
+
"ax-substype": "PREPAID",
|
|
277
|
+
"content-type": "application/x-www-form-urlencoded"
|
|
278
|
+
};
|
|
279
|
+
const data = new URLSearchParams({
|
|
280
|
+
grant_type: "refresh_token",
|
|
281
|
+
refresh_token: refreshToken
|
|
282
|
+
});
|
|
283
|
+
const resp = await axios2.post(url, data.toString(), {
|
|
284
|
+
headers,
|
|
285
|
+
timeout: 30000
|
|
286
|
+
});
|
|
287
|
+
return resp.data;
|
|
288
|
+
} catch (error) {
|
|
289
|
+
console.error("Refresh token tidak valid:", error);
|
|
290
|
+
throw new Error("Refresh token tidak valid.");
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async function getProfile(accessToken, idToken) {
|
|
294
|
+
const path = "api/v8/profile";
|
|
295
|
+
const rawPayload = {
|
|
296
|
+
access_token: accessToken,
|
|
297
|
+
app_version: X_APP_VERSION,
|
|
298
|
+
is_enterprise: false,
|
|
299
|
+
lang: "en"
|
|
300
|
+
};
|
|
301
|
+
const res = await sendApiRequest(path, rawPayload, idToken, "POST");
|
|
302
|
+
return res.data.profile;
|
|
303
|
+
}
|
|
304
|
+
async function getBalance(idToken) {
|
|
305
|
+
const path = "api/v8/packages/balance-and-credit";
|
|
306
|
+
const rawPayload = {
|
|
307
|
+
is_enterprise: false,
|
|
308
|
+
lang: "en"
|
|
309
|
+
};
|
|
310
|
+
return await sendApiRequest(path, rawPayload, idToken, "POST");
|
|
311
|
+
}
|
|
312
|
+
async function getTieringInfo(idToken) {
|
|
313
|
+
const path = "gamification/api/v8/loyalties/tiering/info";
|
|
314
|
+
const rawPayload = {
|
|
315
|
+
is_enterprise: false,
|
|
316
|
+
lang: "en"
|
|
317
|
+
};
|
|
318
|
+
return await sendApiRequest(path, rawPayload, idToken, "POST");
|
|
319
|
+
}
|
|
320
|
+
async function getRedeemables({ idToken, isEnterprise }) {
|
|
321
|
+
const path = "api/v8/personalization/redeemables";
|
|
322
|
+
const rawPayload = {
|
|
323
|
+
is_enterprise: isEnterprise,
|
|
324
|
+
lang: "en"
|
|
325
|
+
};
|
|
326
|
+
return await sendApiRequest(path, rawPayload, idToken, "POST");
|
|
327
|
+
}
|
|
328
|
+
async function checkQuota(msisdn) {
|
|
329
|
+
const url = `https://xl-ku.my.id/end.php?check=package&number=${msisdn}&version=2`;
|
|
330
|
+
console.log(`Fetching quota for ${msisdn} from external API...`);
|
|
331
|
+
const response = await axios2.get(url);
|
|
332
|
+
return response.data;
|
|
333
|
+
}
|
|
334
|
+
async function fetchMyPackages({ idToken }) {
|
|
335
|
+
const path = "api/v8/packages/quota-details";
|
|
336
|
+
const rawPayload = {
|
|
337
|
+
is_enterprise: false,
|
|
338
|
+
lang: "en",
|
|
339
|
+
family_member_id: ""
|
|
340
|
+
};
|
|
341
|
+
return await sendApiRequest(path, rawPayload, idToken, "POST");
|
|
342
|
+
}
|
|
343
|
+
export {
|
|
344
|
+
getTieringInfo,
|
|
345
|
+
getRedeemables,
|
|
346
|
+
getProfile,
|
|
347
|
+
getNewToken,
|
|
348
|
+
getBalance,
|
|
349
|
+
fetchMyPackages,
|
|
350
|
+
checkQuota
|
|
351
|
+
};
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
type GetTransactionHistoryProps = {
|
|
2
|
+
idToken: string;
|
|
3
|
+
};
|
|
4
|
+
export type TransactionHistoryItem = {
|
|
5
|
+
category: string;
|
|
6
|
+
code: string;
|
|
7
|
+
formated_date: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
payment_method: string;
|
|
10
|
+
payment_method_icon: string;
|
|
11
|
+
payment_method_label: string;
|
|
12
|
+
payment_status: string;
|
|
13
|
+
price: string;
|
|
14
|
+
raw_price: number;
|
|
15
|
+
show_time: boolean;
|
|
16
|
+
status: string;
|
|
17
|
+
target_msisdn: string;
|
|
18
|
+
timestamp: number;
|
|
19
|
+
title: string;
|
|
20
|
+
trx_code: string;
|
|
21
|
+
validity: string;
|
|
22
|
+
};
|
|
23
|
+
type TransactionHistory = TransactionHistoryItem[];
|
|
24
|
+
export declare function getTransactionHistory({ idToken }: GetTransactionHistoryProps): Promise<TransactionHistory>;
|
|
25
|
+
export type NotificationItem = {
|
|
26
|
+
brief_message: string;
|
|
27
|
+
category: string;
|
|
28
|
+
category_title: string;
|
|
29
|
+
full_message: string;
|
|
30
|
+
is_read: boolean;
|
|
31
|
+
notification_id: string;
|
|
32
|
+
timestamp: string;
|
|
33
|
+
};
|
|
34
|
+
export type NotificationData = {
|
|
35
|
+
data: NotificationItem[];
|
|
36
|
+
error: null | string;
|
|
37
|
+
};
|
|
38
|
+
export type DashboardData = {
|
|
39
|
+
contextual_message: Record<string, unknown>;
|
|
40
|
+
datadog_rum_flag: boolean;
|
|
41
|
+
loyalty: Record<string, unknown>;
|
|
42
|
+
notification: NotificationData;
|
|
43
|
+
profile: Record<string, unknown>;
|
|
44
|
+
special_for_you: Record<string, unknown>;
|
|
45
|
+
};
|
|
46
|
+
export type DashboardResponse = {
|
|
47
|
+
code: string;
|
|
48
|
+
data: DashboardData;
|
|
49
|
+
status: string;
|
|
50
|
+
};
|
|
51
|
+
type DashboardSegmentsProps = {
|
|
52
|
+
idToken: string;
|
|
53
|
+
accessToken: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function dashboardSegments({ idToken, accessToken }: DashboardSegmentsProps): Promise<DashboardResponse>;
|
|
56
|
+
export {};
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
function __accessProp(key) {
|
|
7
|
+
return this[key];
|
|
8
|
+
}
|
|
9
|
+
var __toCommonJS = (from) => {
|
|
10
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
11
|
+
if (entry)
|
|
12
|
+
return entry;
|
|
13
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (var key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(entry, key))
|
|
17
|
+
__defProp(entry, key, {
|
|
18
|
+
get: __accessProp.bind(from, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
__moduleCache.set(from, entry);
|
|
23
|
+
return entry;
|
|
24
|
+
};
|
|
25
|
+
var __moduleCache;
|
|
26
|
+
var __returnValue = (v) => v;
|
|
27
|
+
function __exportSetter(name, newValue) {
|
|
28
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
29
|
+
}
|
|
30
|
+
var __export = (target, all) => {
|
|
31
|
+
for (var name in all)
|
|
32
|
+
__defProp(target, name, {
|
|
33
|
+
get: all[name],
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
set: __exportSetter.bind(all, name)
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
40
|
+
|
|
41
|
+
// src/config.ts
|
|
42
|
+
var BASE_API_URL, BASE_CIAM_URL, BASIC_AUTH, AX_FP_KEY, UA, API_KEY, ENCRYPTED_FIELD_KEY, XDATA_KEY, AX_API_SIG_KEY, X_API_BASE_SECRET, CIRCLE_MSISDN_KEY, X_APP_VERSION = "8.9.0";
|
|
43
|
+
var init_config = __esm(() => {
|
|
44
|
+
init_utils();
|
|
45
|
+
BASE_API_URL = unseal(() => __E_BASE_API_URL__, "https://api.myxl.xlaxiata.co.id");
|
|
46
|
+
BASE_CIAM_URL = unseal(() => __E_BASE_CIAM_URL__, "https://gede.ciam.xlaxiata.co.id");
|
|
47
|
+
BASIC_AUTH = unseal(() => __E_BASIC_AUTH__, "OWZjOTdlZDEtNmEzMC00OGQ1LTk1MTYtNjBjNTNjZTNhMTM1OllEV21GNExKajlYSUt3UW56eTJlMmxiMHRKUWIyOW8z");
|
|
48
|
+
AX_FP_KEY = unseal(() => __E_AX_FP_KEY__, "18b4d589826af50241177961590e6693");
|
|
49
|
+
UA = unseal(() => __E_UA__, "myXL / 8.9.0(1202); com.android.vending; (samsung; SM-N935F; SDK 33; Android 13)");
|
|
50
|
+
API_KEY = unseal(() => __E_API_KEY__, "vT8tINqHaOxXbGE7eOWAhA==");
|
|
51
|
+
ENCRYPTED_FIELD_KEY = unseal(() => __E_ENCRYPTED_FIELD_KEY__, "5dccbf08920a5527");
|
|
52
|
+
XDATA_KEY = unseal(() => __E_XDATA_KEY__, "5dccbf08920a5527b99e222789c34bb7");
|
|
53
|
+
AX_API_SIG_KEY = unseal(() => __E_AX_API_SIG_KEY__, "18b4d589826af50241177961590e6693");
|
|
54
|
+
X_API_BASE_SECRET = unseal(() => __E_X_API_BASE_SECRET__, "mU1Y4n1vBjf3M7tMnRkFU08mVyUJHed8B5En3EAniu1mXLixeuASmBmKnkyzVziOye7rG5nIekMdthensbQMcOJ6SLnrkGyfXALD7mrBC6vuWv6G01pmD3XlU5rT7Tzx");
|
|
55
|
+
CIRCLE_MSISDN_KEY = unseal(() => __E_CIRCLE_MSISDN_KEY__, "5dccbf08920a5527");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// src/lib/encrypt-helper.ts
|
|
59
|
+
var exports_encrypt_helper = {};
|
|
60
|
+
__export(exports_encrypt_helper, {
|
|
61
|
+
makeXSignaturePayment: () => makeXSignaturePayment,
|
|
62
|
+
makeXSignatureLoyalty: () => makeXSignatureLoyalty,
|
|
63
|
+
makeXSignatureBountyAllotment: () => makeXSignatureBountyAllotment,
|
|
64
|
+
makeXSignatureBounty: () => makeXSignatureBounty,
|
|
65
|
+
makeXSignatureBasic: () => makeXSignatureBasic,
|
|
66
|
+
makeXSignature: () => makeXSignature,
|
|
67
|
+
makeAxApiSignature: () => makeAxApiSignature,
|
|
68
|
+
encryptXData: () => encryptXData,
|
|
69
|
+
encryptEncryptedField: () => encryptEncryptedField,
|
|
70
|
+
decryptXData: () => decryptXData,
|
|
71
|
+
decryptEncryptedField: () => decryptEncryptedField
|
|
72
|
+
});
|
|
73
|
+
import crypto from "crypto";
|
|
74
|
+
function pkcs7Pad(buf, blockSize = 16) {
|
|
75
|
+
const pad = blockSize - buf.length % blockSize;
|
|
76
|
+
const padBuf = Buffer.alloc(pad, pad);
|
|
77
|
+
return Buffer.concat([buf, padBuf]);
|
|
78
|
+
}
|
|
79
|
+
function pkcs7Unpad(buf) {
|
|
80
|
+
const pad = buf[buf.length - 1] ?? 16;
|
|
81
|
+
if (pad < 1 || pad > 16)
|
|
82
|
+
throw new Error("Invalid PKCS7 padding");
|
|
83
|
+
return buf.slice(0, buf.length - pad);
|
|
84
|
+
}
|
|
85
|
+
function deriveIv(xtimeMs) {
|
|
86
|
+
const sha = crypto.createHash("sha256").update(String(xtimeMs)).digest("hex");
|
|
87
|
+
return Buffer.from(sha.slice(0, 16), "ascii");
|
|
88
|
+
}
|
|
89
|
+
function urlsafeB64Encode(buf) {
|
|
90
|
+
return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_");
|
|
91
|
+
}
|
|
92
|
+
function urlsafeB64Decode(s) {
|
|
93
|
+
const b64 = s.replace(/-/g, "+").replace(/_/g, "/");
|
|
94
|
+
const padded = b64 + "=".repeat((4 - b64.length % 4) % 4);
|
|
95
|
+
return Buffer.from(padded, "base64");
|
|
96
|
+
}
|
|
97
|
+
function encryptXData(plaintext, xtimeMs) {
|
|
98
|
+
const key = Buffer.from(XDATA_KEY, "ascii");
|
|
99
|
+
const iv = deriveIv(xtimeMs);
|
|
100
|
+
const padded = pkcs7Pad(Buffer.from(plaintext, "utf-8"));
|
|
101
|
+
const cipher = crypto.createCipheriv("aes-256-cbc", key, iv);
|
|
102
|
+
cipher.setAutoPadding(false);
|
|
103
|
+
const ct = Buffer.concat([cipher.update(padded), cipher.final()]);
|
|
104
|
+
return urlsafeB64Encode(ct);
|
|
105
|
+
}
|
|
106
|
+
function decryptXData(xdata, xtimeMs) {
|
|
107
|
+
const key = Buffer.from(XDATA_KEY, "ascii");
|
|
108
|
+
const iv = deriveIv(xtimeMs);
|
|
109
|
+
const ct = urlsafeB64Decode(xdata);
|
|
110
|
+
const decipher = crypto.createDecipheriv("aes-256-cbc", key, iv);
|
|
111
|
+
decipher.setAutoPadding(false);
|
|
112
|
+
const pt = Buffer.concat([decipher.update(ct), decipher.final()]);
|
|
113
|
+
return pkcs7Unpad(pt).toString("utf-8");
|
|
114
|
+
}
|
|
115
|
+
function makeXSignature(idToken, method, path, sigTimeSec) {
|
|
116
|
+
const keyStr = `${X_API_BASE_SECRET};${idToken};${method};${path};${sigTimeSec}`;
|
|
117
|
+
const msg = `${idToken};${sigTimeSec};`;
|
|
118
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
119
|
+
}
|
|
120
|
+
function makeXSignaturePayment(accessToken, sigTimeSec, packageCode, tokenPayment, paymentMethod, paymentFor, path) {
|
|
121
|
+
const keyStr = `${X_API_BASE_SECRET};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;POST;${path};${sigTimeSec}`;
|
|
122
|
+
const msg = `${accessToken};${tokenPayment};${sigTimeSec};${paymentFor};${paymentMethod};${packageCode};`;
|
|
123
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
124
|
+
}
|
|
125
|
+
function makeXSignatureBounty(accessToken, sigTimeSec, packageCode, tokenPayment) {
|
|
126
|
+
const path = "api/v8/personalization/bounties-exchange";
|
|
127
|
+
const keyStr = `${X_API_BASE_SECRET};${accessToken};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;POST;${path};${sigTimeSec}`;
|
|
128
|
+
const msg = `${accessToken};${tokenPayment};${sigTimeSec};${packageCode};`;
|
|
129
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
130
|
+
}
|
|
131
|
+
function makeXSignatureLoyalty(sigTimeSec, packageCode, tokenConfirmation, path) {
|
|
132
|
+
const keyStr = `${X_API_BASE_SECRET};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;POST;${path};${sigTimeSec}`;
|
|
133
|
+
const msg = `${tokenConfirmation};${sigTimeSec};${packageCode};`;
|
|
134
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
135
|
+
}
|
|
136
|
+
function makeXSignatureBountyAllotment(sigTimeSec, packageCode, tokenConfirmation, path, destinationMsisdn) {
|
|
137
|
+
const keyStr = `${X_API_BASE_SECRET};${sigTimeSec}#ae-hei_9Tee6he+Ik3Gais5=;${destinationMsisdn};POST;${path};${sigTimeSec}`;
|
|
138
|
+
const msg = `${tokenConfirmation};${sigTimeSec};${destinationMsisdn};${packageCode};`;
|
|
139
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
140
|
+
}
|
|
141
|
+
function makeXSignatureBasic(method, path, sigTimeSec) {
|
|
142
|
+
const keyStr = `${X_API_BASE_SECRET};${method};${path};${sigTimeSec}`;
|
|
143
|
+
const msg = `${sigTimeSec};en;`;
|
|
144
|
+
return crypto.createHmac("sha512", keyStr).update(msg).digest("hex");
|
|
145
|
+
}
|
|
146
|
+
function makeAxApiSignature(tsForSign, contact, code, contactType) {
|
|
147
|
+
const preimage = `${tsForSign}password${contactType}${contact}${code}openid`;
|
|
148
|
+
const digest = crypto.createHmac("sha256", Buffer.from(AX_API_SIG_KEY, "ascii")).update(preimage).digest();
|
|
149
|
+
return digest.toString("base64");
|
|
150
|
+
}
|
|
151
|
+
function decryptEncryptedField(encryptedB64) {
|
|
152
|
+
const ivAscii = encryptedB64.slice(-16);
|
|
153
|
+
const b64Part = encryptedB64.slice(0, -16);
|
|
154
|
+
const key = Buffer.from(ENCRYPTED_FIELD_KEY, "ascii");
|
|
155
|
+
const iv = Buffer.from(ivAscii, "ascii");
|
|
156
|
+
const ct = urlsafeB64Decode(b64Part);
|
|
157
|
+
const decipher = crypto.createDecipheriv("aes-128-cbc", key, iv);
|
|
158
|
+
decipher.setAutoPadding(false);
|
|
159
|
+
const pt = Buffer.concat([decipher.update(ct), decipher.final()]);
|
|
160
|
+
return pkcs7Unpad(pt).toString("utf-8");
|
|
161
|
+
}
|
|
162
|
+
function encryptEncryptedField(plaintext) {
|
|
163
|
+
const key = Buffer.from(ENCRYPTED_FIELD_KEY, "ascii");
|
|
164
|
+
const ivHex = crypto.randomBytes(8).toString("hex");
|
|
165
|
+
const iv = Buffer.from(ivHex, "ascii");
|
|
166
|
+
const padded = pkcs7Pad(Buffer.from(plaintext, "utf-8"));
|
|
167
|
+
const cipher = crypto.createCipheriv("aes-128-cbc", key, iv);
|
|
168
|
+
cipher.setAutoPadding(false);
|
|
169
|
+
const ct = Buffer.concat([cipher.update(padded), cipher.final()]);
|
|
170
|
+
return urlsafeB64Encode(ct) + ivHex;
|
|
171
|
+
}
|
|
172
|
+
var init_encrypt_helper = __esm(() => {
|
|
173
|
+
init_config();
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// src/encrypt.ts
|
|
177
|
+
function encryptSignXData(method, path, idToken, payload) {
|
|
178
|
+
const plainBody = JSON.stringify(payload);
|
|
179
|
+
const xtime = Date.now();
|
|
180
|
+
const xdata = encryptXData(plainBody, xtime);
|
|
181
|
+
const sigTimeSec = Math.floor(xtime / 1000);
|
|
182
|
+
const xSignature = makeXSignature(idToken, method, path, sigTimeSec);
|
|
183
|
+
return {
|
|
184
|
+
x_signature: xSignature,
|
|
185
|
+
encrypted_body: { xdata, xtime }
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
async function decryptXData2(xdata, xtimeMs) {
|
|
189
|
+
const { decryptXData: _decrypt } = (init_encrypt_helper(), __toCommonJS(exports_encrypt_helper));
|
|
190
|
+
return JSON.parse(_decrypt(xdata, xtimeMs));
|
|
191
|
+
}
|
|
192
|
+
var init_encrypt = __esm(() => {
|
|
193
|
+
init_config();
|
|
194
|
+
init_encrypt_helper();
|
|
195
|
+
init_encrypt_helper();
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// src/lib/utils.ts
|
|
199
|
+
import axios from "axios";
|
|
200
|
+
import { v4 as uuidv4 } from "uuid";
|
|
201
|
+
import { DateTime } from "luxon";
|
|
202
|
+
function javaLikeTimestamp(dt = DateTime.now()) {
|
|
203
|
+
return dt.toMillis().toString();
|
|
204
|
+
}
|
|
205
|
+
async function sendApiRequest(path, payloadDict, idToken, method = "POST") {
|
|
206
|
+
const encryptedPayload = encryptSignXData(method, path, idToken, payloadDict);
|
|
207
|
+
const xtime = Number(encryptedPayload.encrypted_body.xtime);
|
|
208
|
+
const sigTimeSec = Math.floor(xtime / 1000);
|
|
209
|
+
const body = encryptedPayload.encrypted_body;
|
|
210
|
+
const x_sig = encryptedPayload.x_signature;
|
|
211
|
+
const headers = {
|
|
212
|
+
host: BASE_API_URL.replace(/^https?:\/\//, ""),
|
|
213
|
+
"content-type": "application/json; charset=utf-8",
|
|
214
|
+
"user-agent": UA,
|
|
215
|
+
"x-api-key": API_KEY,
|
|
216
|
+
authorization: `Bearer ${idToken}`,
|
|
217
|
+
"x-hv": "v3",
|
|
218
|
+
"x-signature-time": String(sigTimeSec),
|
|
219
|
+
"x-signature": x_sig,
|
|
220
|
+
"x-request-id": uuidv4(),
|
|
221
|
+
"x-request-at": javaLikeTimestamp(),
|
|
222
|
+
"x-version-app": X_APP_VERSION
|
|
223
|
+
};
|
|
224
|
+
const url = `${BASE_API_URL.replace(/\/$/, "")}/${path.replace(/^\//, "")}`;
|
|
225
|
+
const resp = await axios.post(url, body, {
|
|
226
|
+
headers,
|
|
227
|
+
timeout: 30000
|
|
228
|
+
});
|
|
229
|
+
const respData = resp.data;
|
|
230
|
+
const decryptedXData = await decryptXData2(respData.xdata, respData.xtime);
|
|
231
|
+
if (decryptedXData.status === "FAILED") {
|
|
232
|
+
throw new Error(JSON.stringify(decryptedXData));
|
|
233
|
+
}
|
|
234
|
+
return decryptedXData;
|
|
235
|
+
}
|
|
236
|
+
function unseal(getter, fallback) {
|
|
237
|
+
try {
|
|
238
|
+
const hex = getter();
|
|
239
|
+
if (!hex || typeof __SEED__ === "undefined")
|
|
240
|
+
return fallback;
|
|
241
|
+
const seed = Buffer.from(__SEED__, "hex");
|
|
242
|
+
const data = Buffer.from(hex, "hex");
|
|
243
|
+
return Buffer.from(data.map((b, i) => b ^ seed[i % seed.length])).toString("utf8");
|
|
244
|
+
} catch {
|
|
245
|
+
return fallback;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
var init_utils = __esm(() => {
|
|
249
|
+
init_config();
|
|
250
|
+
init_encrypt();
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// src/client.ts
|
|
254
|
+
init_utils();
|
|
255
|
+
async function getTransactionHistory({ idToken }) {
|
|
256
|
+
const path = "payments/api/v8/transaction-history";
|
|
257
|
+
const payload = {
|
|
258
|
+
is_enterprise: false,
|
|
259
|
+
lang: "en"
|
|
260
|
+
};
|
|
261
|
+
console.log("Fetching transaction history...");
|
|
262
|
+
const res = await sendApiRequest(path, payload, idToken, "POST");
|
|
263
|
+
return res.data.list;
|
|
264
|
+
}
|
|
265
|
+
async function dashboardSegments({ idToken, accessToken }) {
|
|
266
|
+
const path = "dashboard/api/v8/segments";
|
|
267
|
+
const rawPayload = {
|
|
268
|
+
access_token: accessToken
|
|
269
|
+
};
|
|
270
|
+
const res = await sendApiRequest(path, rawPayload, idToken, "POST");
|
|
271
|
+
return res;
|
|
272
|
+
}
|
|
273
|
+
export {
|
|
274
|
+
getTransactionHistory,
|
|
275
|
+
dashboardSegments
|
|
276
|
+
};
|