@reyaxyz/sdk 0.13.1 → 0.15.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/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/contractAddresses.d.ts.map +1 -1
- package/dist/types/utils/network.d.ts +3 -0
- package/dist/types/utils/network.d.ts.map +1 -0
- package/dist/utils/contractAddresses.js +12 -4
- package/dist/utils/contractAddresses.js.map +1 -1
- package/dist/utils/network.js +13 -0
- package/dist/utils/network.js.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/utils/contractAddresses.ts +7 -2
- package/src/utils/network.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -19,4 +19,5 @@ __exportStar(require("./services/margin-accounts"), exports);
|
|
|
19
19
|
__exportStar(require("./services/money-flows"), exports);
|
|
20
20
|
__exportStar(require("./services/orders"), exports);
|
|
21
21
|
__exportStar(require("./services/token"), exports);
|
|
22
|
+
__exportStar(require("./utils/network"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,6DAA2C;AAC3C,yDAAuC;AACvC,oDAAkC;AAClC,mDAAiC","sourcesContent":["export * from './services/lp';\nexport * from './services/margin-accounts';\nexport * from './services/money-flows';\nexport * from './services/orders';\nexport * from './services/token';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,6DAA2C;AAC3C,yDAAuC;AACvC,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC","sourcesContent":["export * from './services/lp';\nexport * from './services/margin-accounts';\nexport * from './services/money-flows';\nexport * from './services/orders';\nexport * from './services/token';\nexport * from './utils/network';\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractAddresses.d.ts","sourceRoot":"/","sources":["utils/contractAddresses.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAIxC,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"contractAddresses.d.ts","sourceRoot":"/","sources":["utils/contractAddresses.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAIxC,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,oBAAoB,CAAC;AAiB/D,eAAO,MAAM,UAAU,YACZ,MAAM,gBACD,YAAY,KACzB,MAaF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,GAAG,WAAW,CAKtE"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.getAddress = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
// @todo update with proper chainId for mainnet
|
|
6
|
+
var common_1 = require("@reyaxyz/common");
|
|
7
|
+
var addresses = (_a = {},
|
|
8
|
+
_a[common_1.ReyaChainId.polygonMumbai] = {
|
|
6
9
|
core_proxy: '0xc2f1b4a1275b7338e0eb03967fea3858af4bc900',
|
|
7
10
|
passive_pool_proxy: '0x1b9d499f3ac864b8d4da415846d1d1916e00a6ff',
|
|
8
11
|
},
|
|
9
|
-
|
|
12
|
+
_a[common_1.ReyaChainId.reyaCronos] = {
|
|
10
13
|
core_proxy: '0x2cb06a22ee9b823a307d22f131380dbe151ece5f',
|
|
11
14
|
passive_pool_proxy: '0x63df38878c5b8e84d7dcb347b934072add64bdc5',
|
|
12
15
|
},
|
|
13
|
-
|
|
16
|
+
// TODO: add proper config
|
|
17
|
+
_a[common_1.ReyaChainId.reyaNetwork] = {
|
|
18
|
+
core_proxy: '0x2cb06a22ee9b823a307d22f131380dbe151ece5f',
|
|
19
|
+
passive_pool_proxy: '0x63df38878c5b8e84d7dcb347b934072add64bdc5',
|
|
20
|
+
},
|
|
21
|
+
_a);
|
|
14
22
|
var getAddress = function (chainId, contractName) {
|
|
15
23
|
var keyChainId = chainId.toString();
|
|
16
24
|
if (!Object.keys(addresses).includes(keyChainId)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractAddresses.js","sourceRoot":"/","sources":["utils/contractAddresses.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contractAddresses.js","sourceRoot":"/","sources":["utils/contractAddresses.ts"],"names":[],"mappings":";;;;AACA,+CAA+C;AAC/C,0CAA8C;AAI9C,IAAM,SAAS;IACb,GAAC,oBAAW,CAAC,aAAa,IAAG;QAC3B,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,4CAA4C;KACjE;IACD,GAAC,oBAAW,CAAC,UAAU,IAAG;QACxB,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,4CAA4C;KACjE;IACD,0BAA0B;IAC1B,GAAC,oBAAW,CAAC,WAAW,IAAG;QACzB,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,4CAA4C;KACjE;OACF,CAAC;AACK,IAAM,UAAU,GAAG,UACxB,OAAe,EACf,YAA0B;IAE1B,IAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAEtC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACjD,OAAO,6CAAsC,UAAU,CAAE,CAAC;IAC5D,CAAC;IAED,IAAM,gBAAgB,GAAG,SAAS,CAAC,OAAsB,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QAC1D,OAAO,kCAA2B,YAAY,cAAW,CAAC;IAC5D,CAAC;IAED,OAAO,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACxC,CAAC,CAAC;AAhBW,QAAA,UAAU,cAgBrB","sourcesContent":["export type Address = Lowercase<string>;\n// @todo update with proper chainId for mainnet\nimport { ReyaChainId } from '@reyaxyz/common';\n\nexport type ContractType = 'core_proxy' | 'passive_pool_proxy';\n\nconst addresses: Record<ReyaChainId, Record<ContractType, Address>> = {\n [ReyaChainId.polygonMumbai]: {\n core_proxy: '0xc2f1b4a1275b7338e0eb03967fea3858af4bc900',\n passive_pool_proxy: '0x1b9d499f3ac864b8d4da415846d1d1916e00a6ff',\n },\n [ReyaChainId.reyaCronos]: {\n core_proxy: '0x2cb06a22ee9b823a307d22f131380dbe151ece5f',\n passive_pool_proxy: '0x63df38878c5b8e84d7dcb347b934072add64bdc5',\n },\n // TODO: add proper config\n [ReyaChainId.reyaNetwork]: {\n core_proxy: '0x2cb06a22ee9b823a307d22f131380dbe151ece5f',\n passive_pool_proxy: '0x63df38878c5b8e84d7dcb347b934072add64bdc5',\n },\n};\nexport const getAddress = (\n chainId: number,\n contractName: ContractType,\n): string => {\n const keyChainId = chainId.toString();\n\n if (!Object.keys(addresses).includes(keyChainId)) {\n return `Unspecified addresses for chain id ${keyChainId}`;\n }\n\n const networkAddresses = addresses[chainId as ReyaChainId];\n if (!Object.keys(networkAddresses).includes(contractName)) {\n return `Unspecified address for ${contractName} contract`;\n }\n\n return networkAddresses[contractName];\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReyaNetwork = void 0;
|
|
4
|
+
var common_1 = require("@reyaxyz/common");
|
|
5
|
+
function getReyaNetwork(env) {
|
|
6
|
+
if (env === 'production')
|
|
7
|
+
return common_1.ReyaChainId.reyaNetwork;
|
|
8
|
+
if (env === 'test')
|
|
9
|
+
return common_1.ReyaChainId.reyaCronos;
|
|
10
|
+
throw new Error('Unknown error passed');
|
|
11
|
+
}
|
|
12
|
+
exports.getReyaNetwork = getReyaNetwork;
|
|
13
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"/","sources":["utils/network.ts"],"names":[],"mappings":";;;AAAA,0CAA8C;AAE9C,SAAgB,cAAc,CAAC,GAA0B;IACvD,IAAI,GAAG,KAAK,YAAY;QAAE,OAAO,oBAAW,CAAC,WAAW,CAAC;IACzD,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,oBAAW,CAAC,UAAU,CAAC;IAElD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC;AALD,wCAKC","sourcesContent":["import { ReyaChainId } from '@reyaxyz/common';\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@reyaxyz/common": "0.
|
|
32
|
+
"@reyaxyz/common": "0.4.0",
|
|
33
33
|
"bignumber.js": "^9.1.2",
|
|
34
34
|
"ethers": "6.9.0"
|
|
35
35
|
},
|
|
36
36
|
"packageManager": "pnpm@8.10.4",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "97ba4c6bdb6da053613cdc311179c442a8dbb487"
|
|
38
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,16 @@ import { ReyaChainId } from '@reyaxyz/common';
|
|
|
5
5
|
export type ContractType = 'core_proxy' | 'passive_pool_proxy';
|
|
6
6
|
|
|
7
7
|
const addresses: Record<ReyaChainId, Record<ContractType, Address>> = {
|
|
8
|
-
|
|
8
|
+
[ReyaChainId.polygonMumbai]: {
|
|
9
9
|
core_proxy: '0xc2f1b4a1275b7338e0eb03967fea3858af4bc900',
|
|
10
10
|
passive_pool_proxy: '0x1b9d499f3ac864b8d4da415846d1d1916e00a6ff',
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
[ReyaChainId.reyaCronos]: {
|
|
13
|
+
core_proxy: '0x2cb06a22ee9b823a307d22f131380dbe151ece5f',
|
|
14
|
+
passive_pool_proxy: '0x63df38878c5b8e84d7dcb347b934072add64bdc5',
|
|
15
|
+
},
|
|
16
|
+
// TODO: add proper config
|
|
17
|
+
[ReyaChainId.reyaNetwork]: {
|
|
13
18
|
core_proxy: '0x2cb06a22ee9b823a307d22f131380dbe151ece5f',
|
|
14
19
|
passive_pool_proxy: '0x63df38878c5b8e84d7dcb347b934072add64bdc5',
|
|
15
20
|
},
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReyaChainId } from '@reyaxyz/common';
|
|
2
|
+
|
|
3
|
+
export function getReyaNetwork(env: 'production' | 'test'): ReyaChainId {
|
|
4
|
+
if (env === 'production') return ReyaChainId.reyaNetwork;
|
|
5
|
+
if (env === 'test') return ReyaChainId.reyaCronos;
|
|
6
|
+
|
|
7
|
+
throw new Error('Unknown error passed');
|
|
8
|
+
}
|