@reyaxyz/common 0.47.0 → 0.48.1
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/getSocketAddresses.js +74 -52
- package/dist/services/getSocketAddresses.js.map +1 -1
- package/dist/types/services/getSocketAddresses.d.ts +7 -1
- package/dist/types/services/getSocketAddresses.d.ts.map +1 -1
- package/dist/types/types.d.ts +9 -3
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/consts.d.ts +0 -7
- package/dist/types/utils/consts.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/network.d.ts +4 -0
- package/dist/types/utils/network.d.ts.map +1 -0
- package/dist/types/utils/token-info.d.ts +3 -0
- package/dist/types/utils/token-info.d.ts.map +1 -0
- package/dist/types/utils/token.d.ts +3 -6
- package/dist/types/utils/token.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/consts.js +1 -76
- package/dist/utils/consts.js.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/network.js +25 -0
- package/dist/utils/network.js.map +1 -0
- package/dist/utils/socket/reyaCronos.json +77 -0
- package/dist/utils/token-info.js +77 -0
- package/dist/utils/token-info.js.map +1 -0
- package/dist/utils/token.js +38 -20
- package/dist/utils/token.js.map +1 -1
- package/package.json +2 -2
- package/src/services/getSocketAddresses.ts +121 -67
- package/src/types.ts +10 -3
- package/src/utils/consts.ts +0 -90
- package/src/utils/index.ts +1 -0
- package/src/utils/network.ts +23 -0
- package/src/utils/socket/reyaCronos.json +77 -0
- package/src/utils/token-info.ts +75 -0
- package/src/utils/token.ts +62 -24
|
@@ -1,66 +1,88 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
3
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
26
|
exports.getSocketVault = exports.getSocketController = exports.getSocketConnectors = void 0;
|
|
5
27
|
var types_1 = require("../types");
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
deposit: '0x4BFDf43662cdf2Cc0A96C8697AC179819B6E5E91'.toLowerCase(),
|
|
28
|
-
withdraw: '0x1d43076909Ca139BFaC4EbB7194518bE3638fc76'.toLowerCase(),
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
_a);
|
|
28
|
+
var network_1 = require("../utils/network");
|
|
29
|
+
var token_1 = require("../utils/token");
|
|
30
|
+
var REYA_CRONOS = __importStar(require("../utils/socket/reyaCronos.json"));
|
|
31
|
+
var SocketSuperBridgeContracts;
|
|
32
|
+
(function (SocketSuperBridgeContracts) {
|
|
33
|
+
SocketSuperBridgeContracts["MintableToken"] = "MintableToken";
|
|
34
|
+
SocketSuperBridgeContracts["NonMintableToken"] = "NonMintableToken";
|
|
35
|
+
SocketSuperBridgeContracts["Vault"] = "Vault";
|
|
36
|
+
SocketSuperBridgeContracts["Controller"] = "Controller";
|
|
37
|
+
SocketSuperBridgeContracts["FiatTokenV2_1_Controller"] = "FiatTokenV2_1_Controller";
|
|
38
|
+
SocketSuperBridgeContracts["ExchangeRate"] = "ExchangeRate";
|
|
39
|
+
SocketSuperBridgeContracts["ConnectorPlug"] = "ConnectorPlug";
|
|
40
|
+
})(SocketSuperBridgeContracts || (SocketSuperBridgeContracts = {}));
|
|
41
|
+
var getSocketDeploymentJSON = function (reyaChainId) {
|
|
42
|
+
switch (reyaChainId) {
|
|
43
|
+
case types_1.ReyaChainId.reyaNetwork:
|
|
44
|
+
throw new Error('getSocketDeploymentJSON unsupported chain id');
|
|
45
|
+
case types_1.ReyaChainId.reyaCronos:
|
|
46
|
+
return REYA_CRONOS;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
32
49
|
var getSocketConnectors = function (params) {
|
|
33
|
-
|
|
50
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
51
|
+
var reyaChainId = (0, network_1.getReyaNetworkFromMoneyInOutChainId)(params.moneyInOutChainId);
|
|
52
|
+
var deploymentJSON = getSocketDeploymentJSON(reyaChainId);
|
|
53
|
+
var depositConnector = (_d = (_c = (_b = (_a = deploymentJSON === null || deploymentJSON === void 0 ? void 0 : deploymentJSON[params.moneyInOutChainId]) === null || _a === void 0 ? void 0 : _a[params.tokenName]) === null || _b === void 0 ? void 0 : _b.connectors) === null || _c === void 0 ? void 0 : _c[reyaChainId]) === null || _d === void 0 ? void 0 : _d.FAST;
|
|
54
|
+
if (!depositConnector) {
|
|
55
|
+
throw new Error("getSocketConnectors: deposit connector not found ".concat(JSON.stringify(params)));
|
|
56
|
+
}
|
|
57
|
+
var withdrawConnector = (_h = (_g = (_f = (_e = deploymentJSON === null || deploymentJSON === void 0 ? void 0 : deploymentJSON[reyaChainId]) === null || _e === void 0 ? void 0 : _e[params.tokenName]) === null || _f === void 0 ? void 0 : _f.connectors) === null || _g === void 0 ? void 0 : _g[params.moneyInOutChainId]) === null || _h === void 0 ? void 0 : _h.FAST;
|
|
58
|
+
if (!withdrawConnector) {
|
|
59
|
+
throw new Error("getSocketConnectors: withdraw connector not found ".concat(JSON.stringify(params)));
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
deposit: (0, token_1.convertToAddress)(depositConnector),
|
|
63
|
+
withdraw: (0, token_1.convertToAddress)(withdrawConnector),
|
|
64
|
+
};
|
|
34
65
|
};
|
|
35
66
|
exports.getSocketConnectors = getSocketConnectors;
|
|
36
|
-
var socketControllers = (_b = {},
|
|
37
|
-
_b[types_1.ReyaChainId.reyaCronos] = {
|
|
38
|
-
USDC: '0xc5a5Ac67fff82Da72d1F862f1363E2b217a2A61A'.toLowerCase(),
|
|
39
|
-
},
|
|
40
|
-
_b[types_1.ReyaChainId.reyaNetwork] = {
|
|
41
|
-
USDC: '',
|
|
42
|
-
},
|
|
43
|
-
_b);
|
|
44
67
|
var getSocketController = function (params) {
|
|
45
|
-
|
|
68
|
+
var _a, _b;
|
|
69
|
+
var deploymentJSON = getSocketDeploymentJSON(params.reyaChainId);
|
|
70
|
+
var controller = (_b = (_a = deploymentJSON === null || deploymentJSON === void 0 ? void 0 : deploymentJSON[params.reyaChainId]) === null || _a === void 0 ? void 0 : _a[params.tokenName]) === null || _b === void 0 ? void 0 : _b[SocketSuperBridgeContracts.Controller];
|
|
71
|
+
if (!controller) {
|
|
72
|
+
throw new Error("getSocketController: controller not found ".concat(JSON.stringify(params)));
|
|
73
|
+
}
|
|
74
|
+
return (0, token_1.convertToAddress)(controller);
|
|
46
75
|
};
|
|
47
76
|
exports.getSocketController = getSocketController;
|
|
48
|
-
var socketVaults = (_c = {},
|
|
49
|
-
_c[types_1.MoneyInOutChainId.polygonMumbai] = {
|
|
50
|
-
USDC: '0xEC5b7075F581D46983EBe2Be6baB0f58Bf1E8C4b'.toLowerCase(),
|
|
51
|
-
},
|
|
52
|
-
_c[types_1.MoneyInOutChainId.arbitrumSepolia] = {
|
|
53
|
-
USDC: '0x85314b664cB2e443C93F09EDb51088f76b048212'.toLowerCase(),
|
|
54
|
-
},
|
|
55
|
-
_c[types_1.MoneyInOutChainId.opSepolia] = {
|
|
56
|
-
USDC: '0x1019958C2BD43B882a4e1349337a32Ef9563FC4D'.toLowerCase(),
|
|
57
|
-
},
|
|
58
|
-
_c[types_1.MoneyInOutChainId.ethereumSepolia] = {
|
|
59
|
-
USDC: '0x8487daa5864a5cE18E5a89406c11EC748da33fbB'.toLowerCase(),
|
|
60
|
-
},
|
|
61
|
-
_c);
|
|
62
77
|
var getSocketVault = function (params) {
|
|
63
|
-
|
|
78
|
+
var _a, _b;
|
|
79
|
+
var reyaChainId = (0, network_1.getReyaNetworkFromMoneyInOutChainId)(params.moneyInOutChainId);
|
|
80
|
+
var deploymentJSON = getSocketDeploymentJSON(reyaChainId);
|
|
81
|
+
var vault = (_b = (_a = deploymentJSON === null || deploymentJSON === void 0 ? void 0 : deploymentJSON[params.moneyInOutChainId]) === null || _a === void 0 ? void 0 : _a[params.tokenName]) === null || _b === void 0 ? void 0 : _b[SocketSuperBridgeContracts.Vault];
|
|
82
|
+
if (!vault) {
|
|
83
|
+
throw new Error("getSocketVault: vault not found ".concat(JSON.stringify(params)));
|
|
84
|
+
}
|
|
85
|
+
return (0, token_1.convertToAddress)(vault);
|
|
64
86
|
};
|
|
65
87
|
exports.getSocketVault = getSocketVault;
|
|
66
88
|
//# sourceMappingURL=getSocketAddresses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSocketAddresses.js","sourceRoot":"/","sources":["services/getSocketAddresses.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSocketAddresses.js","sourceRoot":"/","sources":["services/getSocketAddresses.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCASkB;AAClB,4CAAuE;AACvE,wCAAkD;AAElD,2EAA+D;AA4B/D,IAAK,0BAQJ;AARD,WAAK,0BAA0B;IAC7B,6DAA+B,CAAA;IAC/B,mEAAqC,CAAA;IACrC,6CAAe,CAAA;IACf,uDAAyB,CAAA;IACzB,mFAAqD,CAAA;IACrD,2DAA6B,CAAA;IAC7B,6DAA+B,CAAA;AACjC,CAAC,EARI,0BAA0B,KAA1B,0BAA0B,QAQ9B;AAUD,IAAM,uBAAuB,GAAG,UAC9B,WAAwB;IAExB,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,mBAAW,CAAC,WAAW;YAC1B,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAClE,KAAK,mBAAW,CAAC,UAAU;YACzB,OAAO,WAAW,CAAC;IACvB,CAAC;AACH,CAAC,CAAC;AAEK,IAAM,mBAAmB,GAAG,UACjC,MAAgC;;IAEhC,IAAM,WAAW,GAAG,IAAA,6CAAmC,EACrD,MAAM,CAAC,iBAAiB,CACzB,CAAC;IACF,IAAM,cAAc,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC5D,IAAM,gBAAgB,GACpB,MAAA,MAAA,MAAA,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,MAAM,CAAC,iBAAiB,CAAC,0CAAG,MAAM,CAAC,SAAS,CAAC,0CAC1D,UAAU,0CAAG,WAAW,CAAC,0CAAE,IAAI,CAAC;IAEtC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK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IACF,IAAM,cAAc,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAE5D,IAAM,KAAK,GAAG,MACZ,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAG,MAAM,CAAC,iBAAiB,CAAC,0CACxC,MAAM,CAAC,SAAS,CAEnB,0CAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAEtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,0CAAmC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAE,CAC5D,CAAC;IACJ,CAAC;IAED,OAAO,IAAA,wBAAgB,EAAC,KAAK,CAAC,CAAC;AACjC,CAAC,CAAC;AAnBW,QAAA,cAAc,kBAmBzB","sourcesContent":["import {\n ReyaChainId,\n GetSocketConnectorParams,\n Address,\n GetSocketControllerParams,\n MoneyInOutChainId,\n GetSocketVaultParams,\n SocketTokenConnectors,\n TokenName,\n} from '../types';\nimport { getReyaNetworkFromMoneyInOutChainId } from '../utils/network';\nimport { convertToAddress } from '../utils/token';\n\nimport * as REYA_CRONOS from '../utils/socket/reyaCronos.json';\n\ntype SocketDeploymentAddresses = {\n [chain in ReyaChainId | MoneyInOutChainId]?: SocketChainAddresses;\n};\n\ntype SocketChainAddresses = {\n [token in TokenName]?: SocketTokenAddresses;\n};\n\ntype SocketTokenAddresses =\n | SocketAppChainAddresses\n | SocketNonAppChainAddresses;\n\ninterface SocketAppChainAddresses {\n isAppChain: true;\n [SocketSuperBridgeContracts.MintableToken]?: string;\n [SocketSuperBridgeContracts.Controller]?: string;\n [SocketSuperBridgeContracts.ExchangeRate]?: string;\n connectors?: SocketConnectors;\n}\ninterface SocketNonAppChainAddresses {\n isAppChain: false;\n [SocketSuperBridgeContracts.NonMintableToken]?: string;\n [SocketSuperBridgeContracts.Vault]?: string;\n connectors?: SocketConnectors;\n}\n\nenum SocketSuperBridgeContracts {\n MintableToken = 'MintableToken',\n NonMintableToken = 'NonMintableToken',\n Vault = 'Vault',\n Controller = 'Controller',\n FiatTokenV2_1_Controller = 'FiatTokenV2_1_Controller',\n ExchangeRate = 'ExchangeRate',\n ConnectorPlug = 'ConnectorPlug',\n}\n\nexport type SocketConnectors = {\n [chainSlug in ReyaChainId | MoneyInOutChainId]?: SocketConnectorAddresses;\n};\n\nexport type SocketConnectorAddresses = {\n ['FAST']?: string;\n};\n\nconst getSocketDeploymentJSON = (\n reyaChainId: ReyaChainId,\n): SocketDeploymentAddresses => {\n switch (reyaChainId) {\n case ReyaChainId.reyaNetwork:\n throw new Error('getSocketDeploymentJSON unsupported chain id');\n case ReyaChainId.reyaCronos:\n return REYA_CRONOS;\n }\n};\n\nexport const getSocketConnectors = (\n params: GetSocketConnectorParams,\n): SocketTokenConnectors => {\n const reyaChainId = getReyaNetworkFromMoneyInOutChainId(\n params.moneyInOutChainId,\n );\n const deploymentJSON = getSocketDeploymentJSON(reyaChainId);\n const depositConnector =\n deploymentJSON?.[params.moneyInOutChainId]?.[params.tokenName]\n ?.connectors?.[reyaChainId]?.FAST;\n\n if (!depositConnector) {\n throw new Error(\n `getSocketConnectors: deposit connector not found ${JSON.stringify(\n params,\n )}`,\n );\n }\n\n const withdrawConnector =\n deploymentJSON?.[reyaChainId]?.[params.tokenName]?.connectors?.[\n params.moneyInOutChainId\n ]?.FAST;\n\n if (!withdrawConnector) {\n throw new Error(\n `getSocketConnectors: withdraw connector not found ${JSON.stringify(\n params,\n )}`,\n );\n }\n\n return {\n deposit: convertToAddress(depositConnector),\n withdraw: convertToAddress(withdrawConnector),\n };\n};\n\nexport const getSocketController = (\n params: GetSocketControllerParams,\n): Address => {\n const deploymentJSON = getSocketDeploymentJSON(params.reyaChainId);\n const controller = (\n deploymentJSON?.[params.reyaChainId]?.[\n params.tokenName\n ] as SocketAppChainAddresses\n )?.[SocketSuperBridgeContracts.Controller];\n\n if (!controller) {\n throw new Error(\n `getSocketController: controller not found ${JSON.stringify(params)}`,\n );\n }\n\n return convertToAddress(controller);\n};\n\nexport const getSocketVault = (params: GetSocketVaultParams): Address => {\n const reyaChainId = getReyaNetworkFromMoneyInOutChainId(\n params.moneyInOutChainId,\n );\n const deploymentJSON = getSocketDeploymentJSON(reyaChainId);\n\n const vault = (\n deploymentJSON?.[params.moneyInOutChainId]?.[\n params.tokenName\n ] as SocketNonAppChainAddresses\n )?.[SocketSuperBridgeContracts.Vault];\n\n if (!vault) {\n throw new Error(\n `getSocketVault: vault not found ${JSON.stringify(params)}`,\n );\n }\n\n return convertToAddress(vault);\n};\n"]}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { GetSocketConnectorParams, Address, GetSocketControllerParams, GetSocketVaultParams, SocketTokenConnectors } from '../types';
|
|
1
|
+
import { ReyaChainId, GetSocketConnectorParams, Address, GetSocketControllerParams, MoneyInOutChainId, GetSocketVaultParams, SocketTokenConnectors } from '../types';
|
|
2
|
+
export type SocketConnectors = {
|
|
3
|
+
[chainSlug in ReyaChainId | MoneyInOutChainId]?: SocketConnectorAddresses;
|
|
4
|
+
};
|
|
5
|
+
export type SocketConnectorAddresses = {
|
|
6
|
+
['FAST']?: string;
|
|
7
|
+
};
|
|
2
8
|
export declare const getSocketConnectors: (params: GetSocketConnectorParams) => SocketTokenConnectors;
|
|
3
9
|
export declare const getSocketController: (params: GetSocketControllerParams) => Address;
|
|
4
10
|
export declare const getSocketVault: (params: GetSocketVaultParams) => Address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSocketAddresses.d.ts","sourceRoot":"/","sources":["services/getSocketAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"getSocketAddresses.d.ts","sourceRoot":"/","sources":["services/getSocketAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,OAAO,EACP,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,UAAU,CAAC;AA0ClB,MAAM,MAAM,gBAAgB,GAAG;KAC5B,SAAS,IAAI,WAAW,GAAG,iBAAiB,CAAC,CAAC,EAAE,wBAAwB;CAC1E,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAaF,eAAO,MAAM,mBAAmB,WACtB,wBAAwB,KAC/B,qBAkCF,CAAC;AAEF,eAAO,MAAM,mBAAmB,WACtB,yBAAyB,KAChC,OAeF,CAAC;AAEF,eAAO,MAAM,cAAc,WAAY,oBAAoB,KAAG,OAmB7D,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
2
|
export type Address = Lowercase<string>;
|
|
3
|
+
export type TokenName = Uppercase<string>;
|
|
3
4
|
export type MarketOrderInfo = {
|
|
4
5
|
counterpartyAccountIds: number[];
|
|
5
6
|
exchangeId: number;
|
|
@@ -208,15 +209,15 @@ export type SocketTokenConnectors = {
|
|
|
208
209
|
};
|
|
209
210
|
export type GetSocketConnectorParams = {
|
|
210
211
|
moneyInOutChainId: MoneyInOutChainId;
|
|
211
|
-
tokenName:
|
|
212
|
+
tokenName: TokenName;
|
|
212
213
|
};
|
|
213
214
|
export type GetSocketControllerParams = {
|
|
214
215
|
reyaChainId: ReyaChainId;
|
|
215
|
-
tokenName:
|
|
216
|
+
tokenName: TokenName;
|
|
216
217
|
};
|
|
217
218
|
export type GetSocketVaultParams = {
|
|
218
219
|
moneyInOutChainId: MoneyInOutChainId;
|
|
219
|
-
tokenName:
|
|
220
|
+
tokenName: TokenName;
|
|
220
221
|
};
|
|
221
222
|
export type GetSocketBridgeTimeParams = {
|
|
222
223
|
moneyInOutChainId: MoneyInOutChainId;
|
|
@@ -365,4 +366,9 @@ export type TokenEntityWithMinValue = TokenEntity & {
|
|
|
365
366
|
minTransferAmount: number;
|
|
366
367
|
stepSize: number;
|
|
367
368
|
};
|
|
369
|
+
export type TokenInfo = {
|
|
370
|
+
name: TokenName;
|
|
371
|
+
address: Address;
|
|
372
|
+
decimals: number;
|
|
373
|
+
};
|
|
368
374
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAG1C,MAAM,MAAM,eAAe,GAAG;IAC5B,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,MAAM,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,eAAe,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC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IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAGF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,QAAQ,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEzC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { Address } from '../types';
|
|
2
1
|
export declare const MAX_UINT128: number;
|
|
3
2
|
export declare const API_TIMEOUT: number;
|
|
4
|
-
export declare const tokenDetails: {
|
|
5
|
-
[address: Address]: {
|
|
6
|
-
tokenName: Uppercase<string>;
|
|
7
|
-
tokenDecimals: number;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
3
|
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"/","sources":["utils/consts.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"/","sources":["utils/consts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAe,CAAC;AACxC,eAAO,MAAM,WAAW,EAAE,MAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MoneyInOutChainId, ReyaChainId } from '../types';
|
|
2
|
+
export declare function getReyaNetwork(env: 'production' | 'test'): ReyaChainId;
|
|
3
|
+
export declare function getReyaNetworkFromMoneyInOutChainId(moneyInOutChainId: MoneyInOutChainId): ReyaChainId;
|
|
4
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE1D,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,GAAG,WAAW,CAKtE;AAED,wBAAgB,mCAAmC,CACjD,iBAAiB,EAAE,iBAAiB,GACnC,WAAW,CAWb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-info.d.ts","sourceRoot":"/","sources":["utils/token-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,WAAW,GAAG,iBAAiB,EAAE,SAAS,EAAE,CAwEzE,CAAC"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Contract, Signer } from 'ethers';
|
|
2
|
-
import { Address, GetERC20AllowanceParams } from '../types';
|
|
2
|
+
import { Address, GetERC20AllowanceParams, MoneyInOutChainId, ReyaChainId, TokenInfo, TokenName } from '../types';
|
|
3
3
|
export declare const descale: (tokenDecimals: number) => (value: bigint) => number;
|
|
4
4
|
export declare const scale: (tokenDecimals: number) => (value: number) => bigint;
|
|
5
5
|
export declare const getERC20TokenContract: (tokenAddress: string, subject: Signer) => Contract;
|
|
6
6
|
export declare const convertToAddress: (str: string) => Address;
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
tokenDecimals: number;
|
|
10
|
-
tokenDescaler: (value: bigint) => number;
|
|
11
|
-
};
|
|
7
|
+
export declare const getTokenInfoByAddress: (tokenAddressParam: Address | string, chainId?: ReyaChainId | MoneyInOutChainId) => TokenInfo;
|
|
8
|
+
export declare const getTokenInfoByName: (tokenName: TokenName, chainId: ReyaChainId | MoneyInOutChainId) => TokenInfo;
|
|
12
9
|
export declare const getERC20Allowance: ({ walletAddress, tokenAddress, spenderAddress, subject, }: GetERC20AllowanceParams) => Promise<number>;
|
|
13
10
|
export type GetERC20BalanceArgs = {
|
|
14
11
|
tokenAddress: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"/","sources":["utils/token.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"/","sources":["utils/token.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,Q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AAyB,CAAA;IACzB,8FAA6B,CAAA;IAC7B,iGAAkC,CAAA;IAClC,oGAAoC,CAAA;IACpC,mGAAoC,CAAA;AACtC,CAAC,EAPW,6BAA6B,6CAA7B,6BAA6B,QAOxC","sourcesContent":["import { Signer } from 'ethers';\n\nexport type Address = Lowercase<string>;\n\n// -- Markets --\nexport type MarketOrderInfo = {\n counterpartyAccountIds: number[];\n exchangeId: number;\n};\n\nexport type MarketEntity = {\n id: number;\n ticker: string;\n underlyingAsset: string;\n quoteToken: string;\n markPrice: number;\n isActive: boolean;\n maxLeverage: number;\n volume24H: number;\n priceChange24H: number;\n priceChange24HPercentage: number;\n openInterest: number;\n fundingRate: number;\n description: string;\n orderInfo: MarketOrderInfo;\n tickSizeDecimals: number;\n minOrderSize: number;\n baseSpacing: number;\n};\n\nexport enum ReyaChainId {\n reyaNetwork = 1729,\n reyaCronos = 89346161,\n}\n\nexport enum MoneyInOutChainId {\n polygonMumbai = 80001,\n arbitrumSepolia = 421614,\n opSepolia = 11155420,\n ethereumSepolia = 11155111,\n}\n\nexport enum CandlesResolution {\n ONE_MINUTE = '1MIN',\n FIVE_MINUTES = '5MINS',\n FIFTEEN_MINUTES = '15MINS',\n THIRTY_MINUTES = '30MINS',\n ONE_HOUR = '1HOUR',\n FOUR_HOURS = '4HOURS',\n ONE_DAY = '1DAY',\n}\n\n// -- Candles --\nexport interface Candle {\n id: string;\n startedAt: string;\n ticker: string;\n resolution: CandlesResolution;\n low: string;\n high: string;\n open: string;\n close: string;\n baseTokenVolume: string;\n usdVolume: string;\n trades: number;\n startingOpenInterest: string;\n}\n\n// -- Account --\n\nexport type Status = 'OPEN' | 'CLOSED' | 'LIQUIDATED' | 'FILLED';\nexport type Side = 'long' | 'short';\n\nexport type CollateralEntity = {\n token: string;\n percentage: number;\n balance: number;\n balanceRUSD: number;\n exchangeRate: number;\n exchangeRateChange24HPercentage: number;\n};\n\nexport type MarginAccountEntity = {\n id: number;\n name: string;\n marginRatioHealth: 'danger' | 'healthy' | 'warning';\n marginRatioPercentage: number;\n totalBalance: number;\n totalBalanceUnderlyingAsset: string;\n totalBalanceChange24HPercentage: 5;\n livePnL: number;\n livePnLUnderlyingAsset: string;\n realizedPnL: number;\n realizedPnLUnderlyingAsset: string;\n totalPositionsCount: number;\n collaterals: CollateralEntity[];\n positions: PositionEntity[];\n};\n\nexport type PositionEntity = {\n id: number;\n side: Side;\n size: number;\n base: number;\n price: number;\n markPrice: number;\n orderStatus: Status;\n realisedPnl?: number | null;\n unrealisedPnl?: number | null;\n liquidationPrice: number;\n fundingRate: number;\n market: MarketEntity;\n};\n\nexport type TradingHistoryEntity = {\n id: number;\n price: number;\n priceUnderlyingToken: string;\n size: number;\n sizeUnderlyingToken: string;\n timestampMillisecondsUTC: number;\n};\n\nexport type OrderType = 'market';\n\nexport type PositionHistoryType =\n | 'long-trade'\n | 'short-trade'\n | 'long-liquidation'\n | 'short-liquidation';\n\nexport type PositionHistoryEntity = {\n id: number;\n action: PositionHistoryType;\n orderType: OrderType;\n base: number;\n executionPrice: number;\n realisedPnl?: number | null;\n fees: number;\n timestamp: number;\n market: MarketEntity;\n};\n\nexport type LpPoolEntity = {\n id: number;\n name: string;\n description: string;\n longDescription: string;\n readMoreLink: string;\n currentAPY: number;\n apyChange24H: number;\n tokenAddress: Address;\n token: string;\n minDepositAmount: number;\n minWithdrawAmount: number;\n minTransferFromMAToPoolAmount: number;\n minTransferFromPoolToMAAmount: number;\n stepSize: number;\n allowedChainsForLiquidity: MoneyInOutChainId[];\n};\n\nexport type LpWithdrawBalanceEntity = {\n withdrawableBalance: number;\n poolSharePrice: number;\n accountShareBalance: number;\n};\n\nexport type TransactionHistoryType = 'deposit' | 'withdrawal';\n\nexport type LpTransactionHistoryEntity = {\n id: number;\n type: TransactionHistoryType;\n token: string;\n amount: number;\n transactionLink: string;\n timestamp: number;\n};\n\nexport type LpPositionEntity = {\n id: number;\n capitalInvested: number;\n currentBalance: number;\n pnl: number;\n lpPool: LpPoolEntity;\n};\n\nexport type MarginAccountTransactionHistoryType =\n | 'deposit'\n | 'withdrawal'\n | 'transfer'\n | 'auto_exchange';\n\nexport type MarginAccountTransactionStatus = 'confirmed' | 'pending';\n\nexport type MarginAccountTransactionHistoryEntity = {\n id: number;\n type: MarginAccountTransactionHistoryType;\n token: string;\n amount: number;\n transactionLink: string;\n status: MarginAccountTransactionStatus;\n timestamp: number;\n};\n\nexport type TokenEntity = {\n id: string;\n address: Address;\n};\n// --- Lp Pool Balance ---\nexport enum LpBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\nexport type GetLpPoolBalanceChartDataResult = {\n data: {\n timestampInMs: number;\n value: number;\n }[];\n tvl: number;\n tvlChangePercentage: number;\n apy: number;\n apyChangePercentage: number;\n};\n\n// - LP Account Performance -\nexport type GetLpPoolPerformanceChartDataResult = {\n capitalInvestedData: {\n timestampInMs: number;\n value: number;\n }[];\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n balance: number;\n balanceChangePercentage: number;\n capitalInvested: number;\n capitalInvestedChangePercentage: number;\n};\n\nexport type SocketTokenConnectors = {\n deposit: Address;\n withdraw: Address;\n};\n\nexport type GetSocketConnectorParams = {\n moneyInOutChainId: MoneyInOutChainId;\n tokenName: Uppercase<string>;\n};\n\nexport type GetSocketControllerParams = {\n reyaChainId: ReyaChainId;\n tokenName: Uppercase<string>;\n};\n\nexport type GetSocketVaultParams = {\n moneyInOutChainId: MoneyInOutChainId;\n tokenName: Uppercase<string>;\n};\n\nexport type GetSocketBridgeTimeParams = {\n moneyInOutChainId: MoneyInOutChainId;\n};\n\nexport type GetSocketBridgeTimeResult = {\n bridgeTimeInMS: number;\n};\n\nexport type GetSocketDepositFeesParams = {\n moneyInOutChainId: MoneyInOutChainId;\n};\n\nexport type GetSocketDepositFeesResult = {\n fees: number;\n feesUnderlyingToken: string;\n};\n\nexport type GetSocketWithdrawFeesParams = {\n reyaChainId: ReyaChainId;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type GetSocketWithdrawFeesResult = {\n fees: number;\n};\n\n// --- Margin Account Balance ---\nexport enum MarginAccountBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\nexport type GetMarginAccountBalanceChartDataResult = {\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n balance: number;\n balanceChangePercentage: number;\n};\n\n// --- Margin Account Collaterals Balance ---\nexport enum MarginAccountCollateralsBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\nexport type GetMarginAccountCollateralsBalanceChartDataResult = {\n data: {\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n token: string;\n }[];\n balance: number;\n balanceChangePercentage: number;\n};\n\nexport type OwnerMetadataEntity = {\n address: Address;\n coreSigNonce: number;\n poolSigNonce: number;\n};\n\nexport type GetAllMarginAccountsBalanceChartDataResult = {\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n balance: number;\n balanceChangePercentage: number;\n};\n\nexport enum AllMarginAccountsBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\n// --- Funding Rate History ----\nexport enum FundingRateHistoryGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\nexport type GetFundingRateChartDataResult = {\n fundingRateData: {\n timestampInMs: number;\n value: number;\n }[];\n fundingRate: number;\n};\n\nexport type GetERC20AllowanceParams = {\n walletAddress: string;\n tokenAddress: LpPoolEntity['tokenAddress'];\n spenderAddress: string;\n subject: Signer;\n};\n\nexport type DepthSimulationState = {\n spotPrice: number;\n maxLongExposure: number;\n maxShortExposure: number;\n netExposure: number;\n};\n\nexport type GetLpPoolDepthChartSimulationDataResult = DepthSimulationState;\n\nexport type SignatureData = {\n signature: string;\n timestamp: number;\n walletAddress: Address;\n message: string;\n};\n\nexport type SaveSignatureResult = {\n signatureSavedSuccessfully: boolean;\n};\n\n// --- Community ----\nexport type VoteDetailsEntity = {\n id: number;\n startDate: number; // timestamp in UTC milliseconds\n endDate: number; // timestamp in UTC milliseconds\n percentageToPass: number; // Example: 4%\n yesCount: number;\n noCount: number;\n voteCountToPass: number; // Example: 1453\n};\n\nexport type VoteStatusEntity = {\n votingPower: number;\n hasVoted: boolean;\n};\n\n// --- XP ----\nexport type XPEntity = {\n value: number;\n valueTimestampMilliseconds: number;\n rate: number;\n};\n\nexport type GetAccountLGEStatusParams = {\n address: string; // wallet address\n};\n\nexport type GetAccountLGEStatusResult = {\n xp: XPEntity;\n currentBoost: number;\n deposited: number;\n};\n\nexport type GetLGEBoostRateParams = void;\n\nexport type GetLGEBoostRateResult = number;\n\nexport type TokenEntityWithMinValue = TokenEntity & {\n minDepositAmount: number;\n minWithdrawAmount: number;\n minTransferAmount: number;\n stepSize: number;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":";;;AA+BA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8DAAkB,CAAA;IAClB,gEAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,+EAAqB,CAAA;IACrB,oFAAwB,CAAA;IACxB,0EAAoB,CAAA;IACpB,sFAA0B,CAAA;AAC5B,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AAED,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,+CAA0B,CAAA;IAC1B,8CAAyB,CAAA;IACzB,uCAAkB,CAAA;IAClB,0CAAqB,CAAA;IACrB,qCAAgB,CAAA;AAClB,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B;AA8JD,0BAA0B;AAC1B,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,+EAAsB,CAAA;IACtB,6EAAyB,CAAA;IACzB,4EAA6B,CAAA;IAC7B,+EAAkC,CAAA;IAClC,kFAAoC,CAAA;IACpC,iFAAoC,CAAA;AACtC,CAAC,EAPW,oBAAoB,oCAApB,oBAAoB,QAO/B;AA0ED,iCAAiC;AACjC,IAAY,+BAOX;AAPD,WAAY,+BAA+B;IACzC,qGAAsB,CAAA;IACtB,mGAAyB,CAAA;IACzB,kGAA6B,CAAA;IAC7B,qGAAkC,CAAA;IAClC,wGAAoC,CAAA;IACpC,uGAAoC,CAAA;AACtC,CAAC,EAPW,+BAA+B,+CAA/B,+BAA+B,QAO1C;AAWD,6CAA6C;AAC7C,IAAY,0CAOX;AAPD,WAAY,0CAA0C;IACpD,2HAAsB,CAAA;IACtB,yHAAyB,CAAA;IACzB,wHAA6B,CAAA;IAC7B,2HAAkC,CAAA;IAClC,8HAAoC,CAAA;IACpC,6HAAoC,CAAA;AACtC,CAAC,EAPW,0CAA0C,0DAA1C,0CAA0C,QAOrD;AA6BD,IAAY,mCAOX;AAPD,WAAY,mCAAmC;IAC7C,6GAAsB,CAAA;IACtB,2GAAyB,CAAA;IACzB,0GAA6B,CAAA;IAC7B,6GAAkC,CAAA;IAClC,gHAAoC,CAAA;IACpC,+GAAoC,CAAA;AACtC,CAAC,EAPW,mCAAmC,mDAAnC,mCAAmC,QAO9C;AAED,gCAAgC;AAChC,IAAY,6BAOX;AAPD,WAAY,6BAA6B;IACvC,iGAAsB,CAAA;IACtB,+FAAyB,CAAA;IACzB,8FAA6B,CAAA;IAC7B,iGAAkC,CAAA;IAClC,oGAAoC,CAAA;IACpC,mGAAoC,CAAA;AACtC,CAAC,EAPW,6BAA6B,6CAA7B,6BAA6B,QAOxC","sourcesContent":["import { Signer } from 'ethers';\n\nexport type Address = Lowercase<string>;\nexport type TokenName = Uppercase<string>;\n\n// -- Markets --\nexport type MarketOrderInfo = {\n counterpartyAccountIds: number[];\n exchangeId: number;\n};\n\nexport type MarketEntity = {\n id: number;\n ticker: string;\n underlyingAsset: string;\n quoteToken: string;\n markPrice: number;\n isActive: boolean;\n maxLeverage: number;\n volume24H: number;\n priceChange24H: number;\n priceChange24HPercentage: number;\n openInterest: number;\n fundingRate: number;\n description: string;\n orderInfo: MarketOrderInfo;\n tickSizeDecimals: number;\n minOrderSize: number;\n baseSpacing: number;\n};\n\nexport enum ReyaChainId {\n reyaNetwork = 1729,\n reyaCronos = 89346161,\n}\n\nexport enum MoneyInOutChainId {\n polygonMumbai = 80001,\n arbitrumSepolia = 421614,\n opSepolia = 11155420,\n ethereumSepolia = 11155111,\n}\n\nexport enum CandlesResolution {\n ONE_MINUTE = '1MIN',\n FIVE_MINUTES = '5MINS',\n FIFTEEN_MINUTES = '15MINS',\n THIRTY_MINUTES = '30MINS',\n ONE_HOUR = '1HOUR',\n FOUR_HOURS = '4HOURS',\n ONE_DAY = '1DAY',\n}\n\n// -- Candles --\nexport interface Candle {\n id: string;\n startedAt: string;\n ticker: string;\n resolution: CandlesResolution;\n low: string;\n high: string;\n open: string;\n close: string;\n baseTokenVolume: string;\n usdVolume: string;\n trades: number;\n startingOpenInterest: string;\n}\n\n// -- Account --\n\nexport type Status = 'OPEN' | 'CLOSED' | 'LIQUIDATED' | 'FILLED';\nexport type Side = 'long' | 'short';\n\nexport type CollateralEntity = {\n token: string;\n percentage: number;\n balance: number;\n balanceRUSD: number;\n exchangeRate: number;\n exchangeRateChange24HPercentage: number;\n};\n\nexport type MarginAccountEntity = {\n id: number;\n name: string;\n marginRatioHealth: 'danger' | 'healthy' | 'warning';\n marginRatioPercentage: number;\n totalBalance: number;\n totalBalanceUnderlyingAsset: string;\n totalBalanceChange24HPercentage: 5;\n livePnL: number;\n livePnLUnderlyingAsset: string;\n realizedPnL: number;\n realizedPnLUnderlyingAsset: string;\n totalPositionsCount: number;\n collaterals: CollateralEntity[];\n positions: PositionEntity[];\n};\n\nexport type PositionEntity = {\n id: number;\n side: Side;\n size: number;\n base: number;\n price: number;\n markPrice: number;\n orderStatus: Status;\n realisedPnl?: number | null;\n unrealisedPnl?: number | null;\n liquidationPrice: number;\n fundingRate: number;\n market: MarketEntity;\n};\n\nexport type TradingHistoryEntity = {\n id: number;\n price: number;\n priceUnderlyingToken: string;\n size: number;\n sizeUnderlyingToken: string;\n timestampMillisecondsUTC: number;\n};\n\nexport type OrderType = 'market';\n\nexport type PositionHistoryType =\n | 'long-trade'\n | 'short-trade'\n | 'long-liquidation'\n | 'short-liquidation';\n\nexport type PositionHistoryEntity = {\n id: number;\n action: PositionHistoryType;\n orderType: OrderType;\n base: number;\n executionPrice: number;\n realisedPnl?: number | null;\n fees: number;\n timestamp: number;\n market: MarketEntity;\n};\n\nexport type LpPoolEntity = {\n id: number;\n name: string;\n description: string;\n longDescription: string;\n readMoreLink: string;\n currentAPY: number;\n apyChange24H: number;\n tokenAddress: Address;\n token: string;\n minDepositAmount: number;\n minWithdrawAmount: number;\n minTransferFromMAToPoolAmount: number;\n minTransferFromPoolToMAAmount: number;\n stepSize: number;\n allowedChainsForLiquidity: MoneyInOutChainId[];\n};\n\nexport type LpWithdrawBalanceEntity = {\n withdrawableBalance: number;\n poolSharePrice: number;\n accountShareBalance: number;\n};\n\nexport type TransactionHistoryType = 'deposit' | 'withdrawal';\n\nexport type LpTransactionHistoryEntity = {\n id: number;\n type: TransactionHistoryType;\n token: string;\n amount: number;\n transactionLink: string;\n timestamp: number;\n};\n\nexport type LpPositionEntity = {\n id: number;\n capitalInvested: number;\n currentBalance: number;\n pnl: number;\n lpPool: LpPoolEntity;\n};\n\nexport type MarginAccountTransactionHistoryType =\n | 'deposit'\n | 'withdrawal'\n | 'transfer'\n | 'auto_exchange';\n\nexport type MarginAccountTransactionStatus = 'confirmed' | 'pending';\n\nexport type MarginAccountTransactionHistoryEntity = {\n id: number;\n type: MarginAccountTransactionHistoryType;\n token: string;\n amount: number;\n transactionLink: string;\n status: MarginAccountTransactionStatus;\n timestamp: number;\n};\n\nexport type TokenEntity = {\n id: string;\n address: Address;\n};\n// --- Lp Pool Balance ---\nexport enum LpBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\nexport type GetLpPoolBalanceChartDataResult = {\n data: {\n timestampInMs: number;\n value: number;\n }[];\n tvl: number;\n tvlChangePercentage: number;\n apy: number;\n apyChangePercentage: number;\n};\n\n// - LP Account Performance -\nexport type GetLpPoolPerformanceChartDataResult = {\n capitalInvestedData: {\n timestampInMs: number;\n value: number;\n }[];\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n balance: number;\n balanceChangePercentage: number;\n capitalInvested: number;\n capitalInvestedChangePercentage: number;\n};\n\nexport type SocketTokenConnectors = {\n deposit: Address;\n withdraw: Address;\n};\n\nexport type GetSocketConnectorParams = {\n moneyInOutChainId: MoneyInOutChainId;\n tokenName: TokenName;\n};\n\nexport type GetSocketControllerParams = {\n reyaChainId: ReyaChainId;\n tokenName: TokenName;\n};\n\nexport type GetSocketVaultParams = {\n moneyInOutChainId: MoneyInOutChainId;\n tokenName: TokenName;\n};\n\nexport type GetSocketBridgeTimeParams = {\n moneyInOutChainId: MoneyInOutChainId;\n};\n\nexport type GetSocketBridgeTimeResult = {\n bridgeTimeInMS: number;\n};\n\nexport type GetSocketDepositFeesParams = {\n moneyInOutChainId: MoneyInOutChainId;\n};\n\nexport type GetSocketDepositFeesResult = {\n fees: number;\n feesUnderlyingToken: string;\n};\n\nexport type GetSocketWithdrawFeesParams = {\n reyaChainId: ReyaChainId;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type GetSocketWithdrawFeesResult = {\n fees: number;\n};\n\n// --- Margin Account Balance ---\nexport enum MarginAccountBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\nexport type GetMarginAccountBalanceChartDataResult = {\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n balance: number;\n balanceChangePercentage: number;\n};\n\n// --- Margin Account Collaterals Balance ---\nexport enum MarginAccountCollateralsBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\nexport type GetMarginAccountCollateralsBalanceChartDataResult = {\n data: {\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n token: string;\n }[];\n balance: number;\n balanceChangePercentage: number;\n};\n\nexport type OwnerMetadataEntity = {\n address: Address;\n coreSigNonce: number;\n poolSigNonce: number;\n};\n\nexport type GetAllMarginAccountsBalanceChartDataResult = {\n balanceData: {\n timestampInMs: number;\n value: number;\n }[];\n balance: number;\n balanceChangePercentage: number;\n};\n\nexport enum AllMarginAccountsBalanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\n// --- Funding Rate History ----\nexport enum FundingRateHistoryGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\nexport type GetFundingRateChartDataResult = {\n fundingRateData: {\n timestampInMs: number;\n value: number;\n }[];\n fundingRate: number;\n};\n\nexport type GetERC20AllowanceParams = {\n walletAddress: string;\n tokenAddress: LpPoolEntity['tokenAddress'];\n spenderAddress: string;\n subject: Signer;\n};\n\nexport type DepthSimulationState = {\n spotPrice: number;\n maxLongExposure: number;\n maxShortExposure: number;\n netExposure: number;\n};\n\nexport type GetLpPoolDepthChartSimulationDataResult = DepthSimulationState;\n\nexport type SignatureData = {\n signature: string;\n timestamp: number;\n walletAddress: Address;\n message: string;\n};\n\nexport type SaveSignatureResult = {\n signatureSavedSuccessfully: boolean;\n};\n\n// --- Community ----\nexport type VoteDetailsEntity = {\n id: number;\n startDate: number; // timestamp in UTC milliseconds\n endDate: number; // timestamp in UTC milliseconds\n percentageToPass: number; // Example: 4%\n yesCount: number;\n noCount: number;\n voteCountToPass: number; // Example: 1453\n};\n\nexport type VoteStatusEntity = {\n votingPower: number;\n hasVoted: boolean;\n};\n\n// --- XP ----\nexport type XPEntity = {\n value: number;\n valueTimestampMilliseconds: number;\n rate: number;\n};\n\nexport type GetAccountLGEStatusParams = {\n address: string; // wallet address\n};\n\nexport type GetAccountLGEStatusResult = {\n xp: XPEntity;\n currentBoost: number;\n deposited: number;\n};\n\nexport type GetLGEBoostRateParams = void;\n\nexport type GetLGEBoostRateResult = number;\n\nexport type TokenEntityWithMinValue = TokenEntity & {\n minDepositAmount: number;\n minWithdrawAmount: number;\n minTransferAmount: number;\n stepSize: number;\n};\n\nexport type TokenInfo = {\n name: TokenName;\n address: Address;\n decimals: number;\n};\n"]}
|
package/dist/utils/consts.js
CHANGED
|
@@ -1,81 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.API_TIMEOUT = exports.MAX_UINT128 = void 0;
|
|
4
4
|
exports.MAX_UINT128 = Math.pow(2, 128) - 1;
|
|
5
5
|
exports.API_TIMEOUT = 2500;
|
|
6
|
-
// todo-token must add addresses of all tokens from all chains below (reya and source chains)
|
|
7
|
-
// @todo update values for mainnet
|
|
8
|
-
exports.tokenDetails = {
|
|
9
|
-
// ====== USDC ======
|
|
10
|
-
// mumbai
|
|
11
|
-
'0xd9edcc943ed9729b08e52bb1e110fe43d1930773': {
|
|
12
|
-
tokenName: 'USDC',
|
|
13
|
-
tokenDecimals: 6,
|
|
14
|
-
},
|
|
15
|
-
// arbitrum sepolia
|
|
16
|
-
'0x8537307810fc40f4073a12a38554d4ff78efff41': {
|
|
17
|
-
tokenName: 'USDC',
|
|
18
|
-
tokenDecimals: 6,
|
|
19
|
-
},
|
|
20
|
-
// op sepolia
|
|
21
|
-
'0x6d290609b3f5f02d52f28d97c75a443ed8564cbf': {
|
|
22
|
-
tokenName: 'USDC',
|
|
23
|
-
tokenDecimals: 6,
|
|
24
|
-
},
|
|
25
|
-
// ethereum sepolia
|
|
26
|
-
'0x565810cbfa3cf1390963e5afa2fb953795686339': {
|
|
27
|
-
tokenName: 'USDC',
|
|
28
|
-
tokenDecimals: 6,
|
|
29
|
-
},
|
|
30
|
-
// reya cronos
|
|
31
|
-
'0x1b700a40a0707dd5f0bc31cbc57d730558e5714d': {
|
|
32
|
-
tokenName: 'USDC',
|
|
33
|
-
tokenDecimals: 6,
|
|
34
|
-
},
|
|
35
|
-
// ====== wETH ======
|
|
36
|
-
// mumbai
|
|
37
|
-
'0xc199807af4fedb02ee567ed0feb814a077de4802': {
|
|
38
|
-
tokenName: 'WETH',
|
|
39
|
-
tokenDecimals: 18,
|
|
40
|
-
},
|
|
41
|
-
// reya cronos
|
|
42
|
-
'0xc123b7aeb9d2b2e8a035217d5c29e317c91842e2': {
|
|
43
|
-
tokenName: 'WETH',
|
|
44
|
-
tokenDecimals: 18,
|
|
45
|
-
},
|
|
46
|
-
// ====== wBTC ======
|
|
47
|
-
// mumbai
|
|
48
|
-
'0x2fa2e7a6deb7bb51b625336dbe1da23511914a8a': {
|
|
49
|
-
tokenName: 'WBTC',
|
|
50
|
-
tokenDecimals: 8,
|
|
51
|
-
},
|
|
52
|
-
// mainnet
|
|
53
|
-
'0xaf21abab55a7c0ab143e0379a3c01054e4ebb514': {
|
|
54
|
-
tokenName: 'WBTC',
|
|
55
|
-
tokenDecimals: 8,
|
|
56
|
-
},
|
|
57
|
-
// reya orbit testnet
|
|
58
|
-
'0xd382e2f0df859ff9e82f963dcad1aaee939c5e4f': {
|
|
59
|
-
tokenName: 'WBTC',
|
|
60
|
-
tokenDecimals: 8,
|
|
61
|
-
},
|
|
62
|
-
// ====== USDT ======
|
|
63
|
-
// reya cronos
|
|
64
|
-
'0x9ade781dacbd220f0161d98f496a2982b231a9d6': {
|
|
65
|
-
tokenName: 'USDT',
|
|
66
|
-
tokenDecimals: 6,
|
|
67
|
-
},
|
|
68
|
-
// ====== dai ======
|
|
69
|
-
// reya cronos
|
|
70
|
-
'0x733299259c45726ee1bfc9bd0deeba58e48a1853': {
|
|
71
|
-
tokenName: 'DAI',
|
|
72
|
-
tokenDecimals: 18,
|
|
73
|
-
},
|
|
74
|
-
// ====== rUSD ======
|
|
75
|
-
// reya cronos
|
|
76
|
-
'0xcfbb14b2a2acb5779b6365a260e4a9d63a12100b': {
|
|
77
|
-
tokenName: 'RUSD',
|
|
78
|
-
tokenDecimals: 6,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
6
|
//# sourceMappingURL=consts.js.map
|
package/dist/utils/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"/","sources":["utils/consts.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"/","sources":["utils/consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,SAAA,CAAC,EAAI,GAAG,CAAA,GAAG,CAAC,CAAC;AAC3B,QAAA,WAAW,GAAW,IAAI,CAAC","sourcesContent":["export const MAX_UINT128 = 2 ** 128 - 1;\nexport const API_TIMEOUT: number = 2500;\n"]}
|
package/dist/utils/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./consts"), exports);
|
|
18
|
+
__exportStar(require("./network"), exports);
|
|
18
19
|
__exportStar(require("./number"), exports);
|
|
19
20
|
__exportStar(require("./retry"), exports);
|
|
20
21
|
__exportStar(require("./timestamp"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,0CAAwB","sourcesContent":["export * from './consts';\nexport * from './number';\nexport * from './retry';\nexport * from './timestamp';\nexport * from './token';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,0CAAwB","sourcesContent":["export * from './consts';\nexport * from './network';\nexport * from './number';\nexport * from './retry';\nexport * from './timestamp';\nexport * from './token';\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReyaNetworkFromMoneyInOutChainId = exports.getReyaNetwork = void 0;
|
|
4
|
+
var types_1 = require("../types");
|
|
5
|
+
function getReyaNetwork(env) {
|
|
6
|
+
if (env === 'production')
|
|
7
|
+
return types_1.ReyaChainId.reyaNetwork;
|
|
8
|
+
if (env === 'test')
|
|
9
|
+
return types_1.ReyaChainId.reyaCronos;
|
|
10
|
+
throw new Error('Unknown error passed');
|
|
11
|
+
}
|
|
12
|
+
exports.getReyaNetwork = getReyaNetwork;
|
|
13
|
+
function getReyaNetworkFromMoneyInOutChainId(moneyInOutChainId) {
|
|
14
|
+
switch (moneyInOutChainId) {
|
|
15
|
+
case types_1.MoneyInOutChainId.polygonMumbai:
|
|
16
|
+
case types_1.MoneyInOutChainId.arbitrumSepolia:
|
|
17
|
+
case types_1.MoneyInOutChainId.opSepolia:
|
|
18
|
+
case types_1.MoneyInOutChainId.ethereumSepolia:
|
|
19
|
+
return getReyaNetwork('test');
|
|
20
|
+
default:
|
|
21
|
+
throw new Error('getReyaNetwork: unexpected moneyInOutChainId');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.getReyaNetworkFromMoneyInOutChainId = getReyaNetworkFromMoneyInOutChainId;
|
|
25
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":";;;AAAA,kCAA0D;AAE1D,SAAgB,cAAc,CAAC,GAA0B;IACvD,IAAI,GAAG,KAAK,YAAY;QAAE,OAAO,mBAAW,CAAC,WAAW,CAAC;IACzD,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,mBAAW,CAAC,UAAU,CAAC;IAElD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC;AALD,wCAKC;AAED,SAAgB,mCAAmC,CACjD,iBAAoC;IAEpC,QAAQ,iBAAiB,EAAE,CAAC;QAC1B,KAAK,yBAAiB,CAAC,aAAa,CAAC;QACrC,KAAK,yBAAiB,CAAC,eAAe,CAAC;QACvC,KAAK,yBAAiB,CAAC,SAAS,CAAC;QACjC,KAAK,yBAAiB,CAAC,eAAe;YACpC,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;QAEhC;YACE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAbD,kFAaC","sourcesContent":["import { MoneyInOutChainId, ReyaChainId } from '../types';\n\nexport function getReyaNetwork(env: 'production' | 'test'): ReyaChainId {\n if (env === 'production') return ReyaChainId.reyaNetwork;\n if (env === 'test') return ReyaChainId.reyaCronos;\n\n throw new Error('Unknown error passed');\n}\n\nexport function getReyaNetworkFromMoneyInOutChainId(\n moneyInOutChainId: MoneyInOutChainId,\n): ReyaChainId {\n switch (moneyInOutChainId) {\n case MoneyInOutChainId.polygonMumbai:\n case MoneyInOutChainId.arbitrumSepolia:\n case MoneyInOutChainId.opSepolia:\n case MoneyInOutChainId.ethereumSepolia:\n return getReyaNetwork('test');\n\n default:\n throw new Error('getReyaNetwork: unexpected moneyInOutChainId');\n }\n}\n"]}
|