@reyaxyz/sdk 0.24.7 → 0.25.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/dist/services/lp/bridgeAndDepositPassivePool.js +2 -2
- package/dist/services/lp/bridgeAndDepositPassivePool.js.map +1 -1
- package/dist/services/lp/index.js +0 -2
- package/dist/services/lp/index.js.map +1 -1
- package/dist/services/lp/simulateBridgeAndDepositPassivePool.js +13 -60
- package/dist/services/lp/simulateBridgeAndDepositPassivePool.js.map +1 -1
- package/dist/services/lp/simulateWithdrawPassivePoolAndBridge.js +14 -58
- package/dist/services/lp/simulateWithdrawPassivePoolAndBridge.js.map +1 -1
- package/dist/services/lp/transferFromMAToPool.js +1 -1
- package/dist/services/lp/transferFromMAToPool.js.map +1 -1
- package/dist/services/lp/types.js.map +1 -1
- package/dist/services/lp/withdrawPassivePoolAndBridge.js +1 -2
- package/dist/services/lp/withdrawPassivePoolAndBridge.js.map +1 -1
- package/dist/services/margin-accounts/bridgeAndDepositExistingMA.js +2 -2
- package/dist/services/margin-accounts/bridgeAndDepositExistingMA.js.map +1 -1
- package/dist/services/margin-accounts/bridgeAndDepositNewMA.js +2 -2
- package/dist/services/margin-accounts/bridgeAndDepositNewMA.js.map +1 -1
- package/dist/services/margin-accounts/deposit.js +2 -1
- package/dist/services/margin-accounts/deposit.js.map +1 -1
- package/dist/services/margin-accounts/index.js +0 -3
- package/dist/services/margin-accounts/index.js.map +1 -1
- package/dist/services/margin-accounts/transferMarginBetweenAccounts.js +3 -2
- package/dist/services/margin-accounts/transferMarginBetweenAccounts.js.map +1 -1
- package/dist/services/margin-accounts/withdraw.js +2 -1
- package/dist/services/margin-accounts/withdraw.js.map +1 -1
- package/dist/services/margin-accounts/withdrawMAAndBridge.js +1 -1
- package/dist/services/margin-accounts/withdrawMAAndBridge.js.map +1 -1
- package/dist/services/token/common.js +5 -18
- package/dist/services/token/common.js.map +1 -1
- package/dist/types/services/lp/bridgeAndDepositPassivePool.d.ts.map +1 -1
- package/dist/types/services/lp/index.d.ts +0 -2
- package/dist/types/services/lp/index.d.ts.map +1 -1
- package/dist/types/services/lp/simulateBridgeAndDepositPassivePool.d.ts +1 -1
- package/dist/types/services/lp/simulateBridgeAndDepositPassivePool.d.ts.map +1 -1
- package/dist/types/services/lp/simulateWithdrawPassivePoolAndBridge.d.ts +1 -1
- package/dist/types/services/lp/simulateWithdrawPassivePoolAndBridge.d.ts.map +1 -1
- package/dist/types/services/lp/types.d.ts +10 -22
- package/dist/types/services/lp/types.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/bridgeAndDepositExistingMA.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/bridgeAndDepositNewMA.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/deposit.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/index.d.ts +0 -3
- package/dist/types/services/margin-accounts/index.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/transferMarginBetweenAccounts.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/withdraw.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/withdrawMAAndBridge.d.ts.map +1 -1
- package/dist/types/services/token/common.d.ts +0 -2
- package/dist/types/services/token/common.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/services/lp/bridgeAndDepositPassivePool.ts +4 -3
- package/src/services/lp/index.ts +0 -2
- package/src/services/lp/simulateBridgeAndDepositPassivePool.ts +16 -23
- package/src/services/lp/simulateWithdrawPassivePoolAndBridge.ts +17 -22
- package/src/services/lp/transferFromMAToPool.ts +2 -2
- package/src/services/lp/types.ts +12 -29
- package/src/services/lp/withdrawPassivePoolAndBridge.ts +1 -1
- package/src/services/margin-accounts/bridgeAndDepositExistingMA.ts +4 -3
- package/src/services/margin-accounts/bridgeAndDepositNewMA.ts +4 -3
- package/src/services/margin-accounts/deposit.ts +2 -1
- package/src/services/margin-accounts/index.ts +0 -3
- package/src/services/margin-accounts/transferMarginBetweenAccounts.ts +2 -1
- package/src/services/margin-accounts/withdraw.ts +2 -1
- package/src/services/margin-accounts/withdrawMAAndBridge.ts +2 -1
- package/src/services/token/common.ts +2 -19
- package/dist/services/lp/simulateTransferFromMAToPool.js +0 -67
- package/dist/services/lp/simulateTransferFromMAToPool.js.map +0 -1
- package/dist/services/margin-accounts/simulateDeposit.js +0 -68
- package/dist/services/margin-accounts/simulateDeposit.js.map +0 -1
- package/dist/services/margin-accounts/simulateTransferMarginBetweenAccounts.js +0 -68
- package/dist/services/margin-accounts/simulateTransferMarginBetweenAccounts.js.map +0 -1
- package/dist/services/margin-accounts/simulateWithdraw.js +0 -68
- package/dist/services/margin-accounts/simulateWithdraw.js.map +0 -1
- package/dist/types/services/lp/simulateTransferFromMAToPool.d.ts +0 -3
- package/dist/types/services/lp/simulateTransferFromMAToPool.d.ts.map +0 -1
- package/dist/types/services/margin-accounts/simulateDeposit.d.ts +0 -3
- package/dist/types/services/margin-accounts/simulateDeposit.d.ts.map +0 -1
- package/dist/types/services/margin-accounts/simulateTransferMarginBetweenAccounts.d.ts +0 -3
- package/dist/types/services/margin-accounts/simulateTransferMarginBetweenAccounts.d.ts.map +0 -1
- package/dist/types/services/margin-accounts/simulateWithdraw.d.ts +0 -3
- package/dist/types/services/margin-accounts/simulateWithdraw.d.ts.map +0 -1
- package/src/services/lp/simulateTransferFromMAToPool.ts +0 -32
- package/src/services/margin-accounts/simulateDeposit.ts +0 -30
- package/src/services/margin-accounts/simulateTransferMarginBetweenAccounts.ts +0 -33
- package/src/services/margin-accounts/simulateWithdraw.ts +0 -30
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.simulateTransferFromMAToPool = void 0;
|
|
40
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
41
|
-
function getRandomIntInclusive(min, max) {
|
|
42
|
-
min = Math.ceil(min);
|
|
43
|
-
max = Math.floor(max);
|
|
44
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
45
|
-
}
|
|
46
|
-
var randomSimulation = function () {
|
|
47
|
-
return {
|
|
48
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
49
|
-
estimatedDepositedAmount: getRandomIntInclusive(1000, 100000),
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
var simulateTransferFromMAToPool = function (
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
|
-
params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
return __generator(this, function (_a) {
|
|
56
|
-
switch (_a.label) {
|
|
57
|
-
case 0: return [4 /*yield*/, new Promise(function (resolve) {
|
|
58
|
-
setTimeout(function () {
|
|
59
|
-
resolve(randomSimulation());
|
|
60
|
-
}, Math.random() * 100 + 1000);
|
|
61
|
-
})];
|
|
62
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}); };
|
|
66
|
-
exports.simulateTransferFromMAToPool = simulateTransferFromMAToPool;
|
|
67
|
-
//# sourceMappingURL=simulateTransferFromMAToPool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateTransferFromMAToPool.js","sourceRoot":"/","sources":["services/lp/simulateTransferFromMAToPool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wDAAwD;AACxD,SAAS,qBAAqB,CAAC,GAAW,EAAE,GAAW;IACrD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,IAAM,gBAAgB,GAAG;IACvB,OAAO;QACL,aAAa,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC;QAClD,wBAAwB,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC;KAC9D,CAAC;AACJ,CAAC,CAAC;AAEK,IAAM,4BAA4B,GAAG;AAC1C,6DAA6D;AAC7D,MAA0C;;;oBAEnC,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO;oBAC/B,UAAU,CACR;wBACE,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;oBAC9B,CAAC,EACD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAC3B,CAAC;gBACJ,CAAC,CAAC,EAAA;oBAPF,sBAAO,SAOL,EAAC;;;KACJ,CAAC;AAZW,QAAA,4BAA4B,gCAYvC","sourcesContent":["import {\n SimulateTransferFromMAToPoolParams,\n SimulateTransferFromMAToPoolResult,\n} from './types';\n\n// The maximum is inclusive and the minimum is inclusive\nfunction getRandomIntInclusive(min: number, max: number) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min);\n}\n\nconst randomSimulation = (): SimulateTransferFromMAToPoolResult => {\n return {\n bridgeGasFees: getRandomIntInclusive(1000, 100000),\n estimatedDepositedAmount: getRandomIntInclusive(1000, 100000),\n };\n};\n\nexport const simulateTransferFromMAToPool = async (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n params: SimulateTransferFromMAToPoolParams,\n): Promise<SimulateTransferFromMAToPoolResult> => {\n return await new Promise((resolve) => {\n setTimeout(\n () => {\n resolve(randomSimulation());\n },\n Math.random() * 100 + 1000,\n );\n });\n};\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.simulateDeposit = void 0;
|
|
40
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
41
|
-
function getRandomIntInclusive(min, max) {
|
|
42
|
-
min = Math.ceil(min);
|
|
43
|
-
max = Math.floor(max);
|
|
44
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
45
|
-
}
|
|
46
|
-
var randomSimulation = function () {
|
|
47
|
-
return {
|
|
48
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
49
|
-
marginRatio: getRandomIntInclusive(1, 100),
|
|
50
|
-
marginRatioHealth: 'danger',
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
var simulateDeposit = function (
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
55
|
-
params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
return __generator(this, function (_a) {
|
|
57
|
-
switch (_a.label) {
|
|
58
|
-
case 0: return [4 /*yield*/, new Promise(function (resolve) {
|
|
59
|
-
setTimeout(function () {
|
|
60
|
-
resolve(randomSimulation());
|
|
61
|
-
}, Math.random() * 100 + 1000);
|
|
62
|
-
})];
|
|
63
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}); };
|
|
67
|
-
exports.simulateDeposit = simulateDeposit;
|
|
68
|
-
//# sourceMappingURL=simulateDeposit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateDeposit.js","sourceRoot":"/","sources":["services/margin-accounts/simulateDeposit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wDAAwD;AACxD,SAAS,qBAAqB,CAAC,GAAW,EAAE,GAAW;IACrD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,IAAM,gBAAgB,GAAG;IACvB,OAAO;QACL,aAAa,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC;QAClD,WAAW,EAAE,qBAAqB,CAAC,CAAC,EAAE,GAAG,CAAC;QAC1C,iBAAiB,EAAE,QAAQ;KAC5B,CAAC;AACJ,CAAC,CAAC;AAEK,IAAM,eAAe,GAAG;AAC7B,6DAA6D;AAC7D,MAA6B;;;oBAEtB,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO;oBAC/B,UAAU,CACR;wBACE,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;oBAC9B,CAAC,EACD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAC3B,CAAC;gBACJ,CAAC,CAAC,EAAA;oBAPF,sBAAO,SAOL,EAAC;;;KACJ,CAAC;AAZW,QAAA,eAAe,mBAY1B","sourcesContent":["import { SimulateDepositParams, SimulateDepositResult } from './types';\n\n// The maximum is inclusive and the minimum is inclusive\nfunction getRandomIntInclusive(min: number, max: number) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min);\n}\n\nconst randomSimulation = (): SimulateDepositResult => {\n return {\n bridgeGasFees: getRandomIntInclusive(1000, 100000),\n marginRatio: getRandomIntInclusive(1, 100),\n marginRatioHealth: 'danger',\n };\n};\n\nexport const simulateDeposit = async (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n params: SimulateDepositParams,\n): Promise<SimulateDepositResult> => {\n return await new Promise((resolve) => {\n setTimeout(\n () => {\n resolve(randomSimulation());\n },\n Math.random() * 100 + 1000,\n );\n });\n};\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.simulateTransferMarginBetweenAccounts = void 0;
|
|
40
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
41
|
-
function getRandomIntInclusive(min, max) {
|
|
42
|
-
min = Math.ceil(min);
|
|
43
|
-
max = Math.floor(max);
|
|
44
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
45
|
-
}
|
|
46
|
-
var randomSimulation = function () {
|
|
47
|
-
return {
|
|
48
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
49
|
-
marginRatio: getRandomIntInclusive(1, 100),
|
|
50
|
-
marginRatioHealth: 'danger',
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
var simulateTransferMarginBetweenAccounts = function (
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
55
|
-
params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
return __generator(this, function (_a) {
|
|
57
|
-
switch (_a.label) {
|
|
58
|
-
case 0: return [4 /*yield*/, new Promise(function (resolve) {
|
|
59
|
-
setTimeout(function () {
|
|
60
|
-
resolve(randomSimulation());
|
|
61
|
-
}, Math.random() * 100 + 1000);
|
|
62
|
-
})];
|
|
63
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}); };
|
|
67
|
-
exports.simulateTransferMarginBetweenAccounts = simulateTransferMarginBetweenAccounts;
|
|
68
|
-
//# sourceMappingURL=simulateTransferMarginBetweenAccounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateTransferMarginBetweenAccounts.js","sourceRoot":"/","sources":["services/margin-accounts/simulateTransferMarginBetweenAccounts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wDAAwD;AACxD,SAAS,qBAAqB,CAAC,GAAW,EAAE,GAAW;IACrD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,IAAM,gBAAgB,GAAG;IACvB,OAAO;QACL,aAAa,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC;QAClD,WAAW,EAAE,qBAAqB,CAAC,CAAC,EAAE,GAAG,CAAC;QAC1C,iBAAiB,EAAE,QAAQ;KAC5B,CAAC;AACJ,CAAC,CAAC;AAEK,IAAM,qCAAqC,GAAG;AACnD,6DAA6D;AAC7D,MAAmD;;;oBAE5C,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO;oBAC/B,UAAU,CACR;wBACE,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;oBAC9B,CAAC,EACD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAC3B,CAAC;gBACJ,CAAC,CAAC,EAAA;oBAPF,sBAAO,SAOL,EAAC;;;KACJ,CAAC;AAZW,QAAA,qCAAqC,yCAYhD","sourcesContent":["import {\n SimulateTransferMarginBetweenAccountsParams,\n SimulateTransferMarginBetweenAccountsResult,\n} from './types';\n\n// The maximum is inclusive and the minimum is inclusive\nfunction getRandomIntInclusive(min: number, max: number) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min);\n}\n\nconst randomSimulation = (): SimulateTransferMarginBetweenAccountsResult => {\n return {\n bridgeGasFees: getRandomIntInclusive(1000, 100000),\n marginRatio: getRandomIntInclusive(1, 100),\n marginRatioHealth: 'danger',\n };\n};\n\nexport const simulateTransferMarginBetweenAccounts = async (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n params: SimulateTransferMarginBetweenAccountsParams,\n): Promise<SimulateTransferMarginBetweenAccountsResult> => {\n return await new Promise((resolve) => {\n setTimeout(\n () => {\n resolve(randomSimulation());\n },\n Math.random() * 100 + 1000,\n );\n });\n};\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.simulateWithdraw = void 0;
|
|
40
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
41
|
-
function getRandomIntInclusive(min, max) {
|
|
42
|
-
min = Math.ceil(min);
|
|
43
|
-
max = Math.floor(max);
|
|
44
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
45
|
-
}
|
|
46
|
-
var randomSimulation = function () {
|
|
47
|
-
return {
|
|
48
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
49
|
-
marginRatio: getRandomIntInclusive(1, 100),
|
|
50
|
-
marginRatioHealth: 'danger',
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
var simulateWithdraw = function (
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
55
|
-
params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
return __generator(this, function (_a) {
|
|
57
|
-
switch (_a.label) {
|
|
58
|
-
case 0: return [4 /*yield*/, new Promise(function (resolve) {
|
|
59
|
-
setTimeout(function () {
|
|
60
|
-
resolve(randomSimulation());
|
|
61
|
-
}, Math.random() * 100 + 1000);
|
|
62
|
-
})];
|
|
63
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}); };
|
|
67
|
-
exports.simulateWithdraw = simulateWithdraw;
|
|
68
|
-
//# sourceMappingURL=simulateWithdraw.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateWithdraw.js","sourceRoot":"/","sources":["services/margin-accounts/simulateWithdraw.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wDAAwD;AACxD,SAAS,qBAAqB,CAAC,GAAW,EAAE,GAAW;IACrD,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED,IAAM,gBAAgB,GAAG;IACvB,OAAO;QACL,aAAa,EAAE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC;QAClD,WAAW,EAAE,qBAAqB,CAAC,CAAC,EAAE,GAAG,CAAC;QAC1C,iBAAiB,EAAE,QAAQ;KAC5B,CAAC;AACJ,CAAC,CAAC;AAEK,IAAM,gBAAgB,GAAG;AAC9B,6DAA6D;AAC7D,MAA8B;;;oBAEvB,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO;oBAC/B,UAAU,CACR;wBACE,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;oBAC9B,CAAC,EACD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAC3B,CAAC;gBACJ,CAAC,CAAC,EAAA;oBAPF,sBAAO,SAOL,EAAC;;;KACJ,CAAC;AAZW,QAAA,gBAAgB,oBAY3B","sourcesContent":["import { SimulateWithdrawParams, SimulateWithdrawResult } from './types';\n\n// The maximum is inclusive and the minimum is inclusive\nfunction getRandomIntInclusive(min: number, max: number) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min);\n}\n\nconst randomSimulation = (): SimulateWithdrawResult => {\n return {\n bridgeGasFees: getRandomIntInclusive(1000, 100000),\n marginRatio: getRandomIntInclusive(1, 100),\n marginRatioHealth: 'danger',\n };\n};\n\nexport const simulateWithdraw = async (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n params: SimulateWithdrawParams,\n): Promise<SimulateWithdrawResult> => {\n return await new Promise((resolve) => {\n setTimeout(\n () => {\n resolve(randomSimulation());\n },\n Math.random() * 100 + 1000,\n );\n });\n};\n"]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { SimulateTransferFromMAToPoolParams, SimulateTransferFromMAToPoolResult } from './types';
|
|
2
|
-
export declare const simulateTransferFromMAToPool: (params: SimulateTransferFromMAToPoolParams) => Promise<SimulateTransferFromMAToPoolResult>;
|
|
3
|
-
//# sourceMappingURL=simulateTransferFromMAToPool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateTransferFromMAToPool.d.ts","sourceRoot":"/","sources":["services/lp/simulateTransferFromMAToPool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,SAAS,CAAC;AAgBjB,eAAO,MAAM,4BAA4B,WAE/B,kCAAkC,KACzC,QAAQ,kCAAkC,CAS5C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateDeposit.d.ts","sourceRoot":"/","sources":["services/margin-accounts/simulateDeposit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAiBvE,eAAO,MAAM,eAAe,WAElB,qBAAqB,KAC5B,QAAQ,qBAAqB,CAS/B,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { SimulateTransferMarginBetweenAccountsParams, SimulateTransferMarginBetweenAccountsResult } from './types';
|
|
2
|
-
export declare const simulateTransferMarginBetweenAccounts: (params: SimulateTransferMarginBetweenAccountsParams) => Promise<SimulateTransferMarginBetweenAccountsResult>;
|
|
3
|
-
//# sourceMappingURL=simulateTransferMarginBetweenAccounts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateTransferMarginBetweenAccounts.d.ts","sourceRoot":"/","sources":["services/margin-accounts/simulateTransferMarginBetweenAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,2CAA2C,EAC5C,MAAM,SAAS,CAAC;AAiBjB,eAAO,MAAM,qCAAqC,WAExC,2CAA2C,KAClD,QAAQ,2CAA2C,CASrD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simulateWithdraw.d.ts","sourceRoot":"/","sources":["services/margin-accounts/simulateWithdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAiBzE,eAAO,MAAM,gBAAgB,WAEnB,sBAAsB,KAC7B,QAAQ,sBAAsB,CAShC,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SimulateTransferFromMAToPoolParams,
|
|
3
|
-
SimulateTransferFromMAToPoolResult,
|
|
4
|
-
} from './types';
|
|
5
|
-
|
|
6
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
7
|
-
function getRandomIntInclusive(min: number, max: number) {
|
|
8
|
-
min = Math.ceil(min);
|
|
9
|
-
max = Math.floor(max);
|
|
10
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const randomSimulation = (): SimulateTransferFromMAToPoolResult => {
|
|
14
|
-
return {
|
|
15
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
16
|
-
estimatedDepositedAmount: getRandomIntInclusive(1000, 100000),
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const simulateTransferFromMAToPool = async (
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
-
params: SimulateTransferFromMAToPoolParams,
|
|
23
|
-
): Promise<SimulateTransferFromMAToPoolResult> => {
|
|
24
|
-
return await new Promise((resolve) => {
|
|
25
|
-
setTimeout(
|
|
26
|
-
() => {
|
|
27
|
-
resolve(randomSimulation());
|
|
28
|
-
},
|
|
29
|
-
Math.random() * 100 + 1000,
|
|
30
|
-
);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SimulateDepositParams, SimulateDepositResult } from './types';
|
|
2
|
-
|
|
3
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
4
|
-
function getRandomIntInclusive(min: number, max: number) {
|
|
5
|
-
min = Math.ceil(min);
|
|
6
|
-
max = Math.floor(max);
|
|
7
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const randomSimulation = (): SimulateDepositResult => {
|
|
11
|
-
return {
|
|
12
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
13
|
-
marginRatio: getRandomIntInclusive(1, 100),
|
|
14
|
-
marginRatioHealth: 'danger',
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const simulateDeposit = async (
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
-
params: SimulateDepositParams,
|
|
21
|
-
): Promise<SimulateDepositResult> => {
|
|
22
|
-
return await new Promise((resolve) => {
|
|
23
|
-
setTimeout(
|
|
24
|
-
() => {
|
|
25
|
-
resolve(randomSimulation());
|
|
26
|
-
},
|
|
27
|
-
Math.random() * 100 + 1000,
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SimulateTransferMarginBetweenAccountsParams,
|
|
3
|
-
SimulateTransferMarginBetweenAccountsResult,
|
|
4
|
-
} from './types';
|
|
5
|
-
|
|
6
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
7
|
-
function getRandomIntInclusive(min: number, max: number) {
|
|
8
|
-
min = Math.ceil(min);
|
|
9
|
-
max = Math.floor(max);
|
|
10
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const randomSimulation = (): SimulateTransferMarginBetweenAccountsResult => {
|
|
14
|
-
return {
|
|
15
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
16
|
-
marginRatio: getRandomIntInclusive(1, 100),
|
|
17
|
-
marginRatioHealth: 'danger',
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const simulateTransferMarginBetweenAccounts = async (
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
-
params: SimulateTransferMarginBetweenAccountsParams,
|
|
24
|
-
): Promise<SimulateTransferMarginBetweenAccountsResult> => {
|
|
25
|
-
return await new Promise((resolve) => {
|
|
26
|
-
setTimeout(
|
|
27
|
-
() => {
|
|
28
|
-
resolve(randomSimulation());
|
|
29
|
-
},
|
|
30
|
-
Math.random() * 100 + 1000,
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SimulateWithdrawParams, SimulateWithdrawResult } from './types';
|
|
2
|
-
|
|
3
|
-
// The maximum is inclusive and the minimum is inclusive
|
|
4
|
-
function getRandomIntInclusive(min: number, max: number) {
|
|
5
|
-
min = Math.ceil(min);
|
|
6
|
-
max = Math.floor(max);
|
|
7
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const randomSimulation = (): SimulateWithdrawResult => {
|
|
11
|
-
return {
|
|
12
|
-
bridgeGasFees: getRandomIntInclusive(1000, 100000),
|
|
13
|
-
marginRatio: getRandomIntInclusive(1, 100),
|
|
14
|
-
marginRatioHealth: 'danger',
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const simulateWithdraw = async (
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
-
params: SimulateWithdrawParams,
|
|
21
|
-
): Promise<SimulateWithdrawResult> => {
|
|
22
|
-
return await new Promise((resolve) => {
|
|
23
|
-
setTimeout(
|
|
24
|
-
() => {
|
|
25
|
-
resolve(randomSimulation());
|
|
26
|
-
},
|
|
27
|
-
Math.random() * 100 + 1000,
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
};
|