@reyaxyz/sdk 0.12.0 → 0.13.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.
@@ -1,23 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAllowedChainsForMoneyInOut = void 0;
4
- var getAllowedChainsForMoneyInOut = function (_a) {
5
- var
6
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
- destinationChainId = _a.destinationChainId;
8
- // todo: implement
9
- return {
10
- sourceChains: [
11
- {
12
- chainId: 11155111,
13
- tokens: {
14
- '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238': {
15
- vaultAddress: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
16
- },
17
- },
18
- },
19
- ],
20
- };
4
+ var common_1 = require("@reyaxyz/common");
5
+ var getAllowedChainsForMoneyInOut = function (params) {
6
+ return (0, common_1.getAllowedChainsForMoneyInOut)(params);
21
7
  };
22
8
  exports.getAllowedChainsForMoneyInOut = getAllowedChainsForMoneyInOut;
23
9
  //# sourceMappingURL=getAllowedChainsForMoneyInOut.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getAllowedChainsForMoneyInOut.js","sourceRoot":"/","sources":["services/money-flows/getAllowedChainsForMoneyInOut.ts"],"names":[],"mappings":";;;AAKO,IAAM,6BAA6B,GAAG,UAAC,EAGR;;IAFpC,6DAA6D;IAC7D,kBAAkB,wBAAA;IAElB,kBAAkB;IAClB,OAAO;QACL,YAAY,EAAE;YACZ;gBACE,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE;oBACN,4CAA4C,EAAE;wBAC5C,YAAY,EAAE,4CAA4C;qBAC3D;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,6BAA6B,iCAiBxC","sourcesContent":["import {\n GetAllowedChainsForMoneyInOutParams,\n GetAllowedChainsForMoneyInOutResult,\n} from './types';\n\nexport const getAllowedChainsForMoneyInOut = ({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n destinationChainId,\n}: GetAllowedChainsForMoneyInOutParams): GetAllowedChainsForMoneyInOutResult => {\n // todo: implement\n return {\n sourceChains: [\n {\n chainId: 11155111,\n tokens: {\n '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238': {\n vaultAddress: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',\n },\n },\n },\n ],\n };\n};\n"]}
1
+ {"version":3,"file":"getAllowedChainsForMoneyInOut.js","sourceRoot":"/","sources":["services/money-flows/getAllowedChainsForMoneyInOut.ts"],"names":[],"mappings":";;;AAIA,0CAAuG;AAEhG,IAAM,6BAA6B,GAAG,UAC3C,MAA2C;IAE3C,OAAO,IAAA,sCAAmC,EAAC,MAAM,CAAC,CAAC;AACrD,CAAC,CAAC;AAJW,QAAA,6BAA6B,iCAIxC","sourcesContent":["import {\n GetAllowedChainsForMoneyInOutParams,\n GetAllowedChainsForMoneyInOutResult,\n} from './types';\nimport { getAllowedChainsForMoneyInOut as getAllowedChainsForMoneyInOutCommon } from '@reyaxyz/common';\n\nexport const getAllowedChainsForMoneyInOut = (\n params: GetAllowedChainsForMoneyInOutParams,\n): GetAllowedChainsForMoneyInOutResult => {\n return getAllowedChainsForMoneyInOutCommon(params);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["services/money-flows/types.ts"],"names":[],"mappings":"","sourcesContent":["export type GetAllowedChainsForMoneyInOutParams = {\n destinationChainId: number;\n};\n\nexport type GetAllowedChainsForMoneyInOutResult = {\n sourceChains: {\n chainId: number;\n tokens: {\n [tokenAddress: string]: {\n vaultAddress: string;\n };\n };\n }[];\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["services/money-flows/types.ts"],"names":[],"mappings":"","sourcesContent":["import { MoneyInOutChainId, ReyaChainId } from '@reyaxyz/common';\n\nexport type GetAllowedChainsForMoneyInOutParams = {\n destinationChainId: ReyaChainId;\n};\n\nexport type GetAllowedChainsForMoneyInOutResult = MoneyInOutChainId[];\n"]}
@@ -1,3 +1,3 @@
1
1
  import { GetAllowedChainsForMoneyInOutParams, GetAllowedChainsForMoneyInOutResult } from './types';
2
- export declare const getAllowedChainsForMoneyInOut: ({ destinationChainId, }: GetAllowedChainsForMoneyInOutParams) => GetAllowedChainsForMoneyInOutResult;
2
+ export declare const getAllowedChainsForMoneyInOut: (params: GetAllowedChainsForMoneyInOutParams) => GetAllowedChainsForMoneyInOutResult;
3
3
  //# sourceMappingURL=getAllowedChainsForMoneyInOut.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getAllowedChainsForMoneyInOut.d.ts","sourceRoot":"/","sources":["services/money-flows/getAllowedChainsForMoneyInOut.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,EACpC,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,6BAA6B,4BAGvC,mCAAmC,KAAG,mCAcxC,CAAC"}
1
+ {"version":3,"file":"getAllowedChainsForMoneyInOut.d.ts","sourceRoot":"/","sources":["services/money-flows/getAllowedChainsForMoneyInOut.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,EACpC,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,6BAA6B,WAChC,mCAAmC,wCAG5C,CAAC"}
@@ -1,14 +1,6 @@
1
+ import { MoneyInOutChainId, ReyaChainId } from '@reyaxyz/common';
1
2
  export type GetAllowedChainsForMoneyInOutParams = {
2
- destinationChainId: number;
3
- };
4
- export type GetAllowedChainsForMoneyInOutResult = {
5
- sourceChains: {
6
- chainId: number;
7
- tokens: {
8
- [tokenAddress: string]: {
9
- vaultAddress: string;
10
- };
11
- };
12
- }[];
3
+ destinationChainId: ReyaChainId;
13
4
  };
5
+ export type GetAllowedChainsForMoneyInOutResult = MoneyInOutChainId[];
14
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/money-flows/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mCAAmC,GAAG;IAChD,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,YAAY,EAAE;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE;YACN,CAAC,YAAY,EAAE,MAAM,GAAG;gBACtB,YAAY,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;KACH,EAAE,CAAC;CACL,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/money-flows/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,mCAAmC,GAAG;IAChD,kBAAkB,EAAE,WAAW,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,iBAAiB,EAAE,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export type Address = Lowercase<string>;
2
- export type SupportedChainId = 80001 | 1729;
3
2
  export type ContractType = 'core_proxy' | 'passive_pool_proxy';
4
3
  export declare const getAddress: (chainId: number, contractName: ContractType) => string;
5
4
  //# sourceMappingURL=contractAddresses.d.ts.map
@@ -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;AAGxC,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,oBAAoB,CAAC;AAY/D,eAAO,MAAM,UAAU,YACZ,MAAM,gBACD,YAAY,KACzB,MAaF,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;AAY/D,eAAO,MAAM,UAAU,YACZ,MAAM,gBACD,YAAY,KACzB,MAaF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contractAddresses.js","sourceRoot":"/","sources":["utils/contractAddresses.ts"],"names":[],"mappings":";;;AAOA,IAAM,SAAS,GAA4D;IACzE,KAAK,EAAE;QACL,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,4CAA4C;KACjE;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,4CAA4C;KACjE;CACF,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,OAA2B,CAAC,CAAC;IAChE,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\n// @todo update with proper chainId for mainnet\nexport type SupportedChainId = 80001 | 1729;\n\nexport type ContractType = 'core_proxy' | 'passive_pool_proxy';\n\nconst addresses: Record<SupportedChainId, Record<ContractType, Address>> = {\n 80001: {\n core_proxy: '0xc2f1b4a1275b7338e0eb03967fea3858af4bc900',\n passive_pool_proxy: '0x1b9d499f3ac864b8d4da415846d1d1916e00a6ff',\n },\n 1729: {\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 SupportedChainId];\n if (!Object.keys(networkAddresses).includes(contractName)) {\n return `Unspecified address for ${contractName} contract`;\n }\n\n return networkAddresses[contractName];\n};\n"]}
1
+ {"version":3,"file":"contractAddresses.js","sourceRoot":"/","sources":["utils/contractAddresses.ts"],"names":[],"mappings":";;;AAMA,IAAM,SAAS,GAAuD;IACpE,KAAK,EAAE;QACL,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,4CAA4C;KACjE;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,4CAA4C;QACxD,kBAAkB,EAAE,4CAA4C;KACjE;CACF,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 80001: {\n core_proxy: '0xc2f1b4a1275b7338e0eb03967fea3858af4bc900',\n passive_pool_proxy: '0x1b9d499f3ac864b8d4da415846d1d1916e00a6ff',\n },\n 1729: {\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/sdk",
3
- "version": "0.12.0",
3
+ "version": "0.13.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.1.0",
32
+ "@reyaxyz/common": "0.2.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": "d62614e48bb530169bacfc0e359a5cf63d73a86b"
37
+ "gitHead": "36a41222301c1bd971953f34cf7a972c9f6940b2"
38
38
  }
@@ -2,22 +2,10 @@ import {
2
2
  GetAllowedChainsForMoneyInOutParams,
3
3
  GetAllowedChainsForMoneyInOutResult,
4
4
  } from './types';
5
+ import { getAllowedChainsForMoneyInOut as getAllowedChainsForMoneyInOutCommon } from '@reyaxyz/common';
5
6
 
6
- export const getAllowedChainsForMoneyInOut = ({
7
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8
- destinationChainId,
9
- }: GetAllowedChainsForMoneyInOutParams): GetAllowedChainsForMoneyInOutResult => {
10
- // todo: implement
11
- return {
12
- sourceChains: [
13
- {
14
- chainId: 11155111,
15
- tokens: {
16
- '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238': {
17
- vaultAddress: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
18
- },
19
- },
20
- },
21
- ],
22
- };
7
+ export const getAllowedChainsForMoneyInOut = (
8
+ params: GetAllowedChainsForMoneyInOutParams,
9
+ ): GetAllowedChainsForMoneyInOutResult => {
10
+ return getAllowedChainsForMoneyInOutCommon(params);
23
11
  };
@@ -1,14 +1,7 @@
1
+ import { MoneyInOutChainId, ReyaChainId } from '@reyaxyz/common';
2
+
1
3
  export type GetAllowedChainsForMoneyInOutParams = {
2
- destinationChainId: number;
4
+ destinationChainId: ReyaChainId;
3
5
  };
4
6
 
5
- export type GetAllowedChainsForMoneyInOutResult = {
6
- sourceChains: {
7
- chainId: number;
8
- tokens: {
9
- [tokenAddress: string]: {
10
- vaultAddress: string;
11
- };
12
- };
13
- }[];
14
- };
7
+ export type GetAllowedChainsForMoneyInOutResult = MoneyInOutChainId[];
@@ -1,11 +1,10 @@
1
1
  export type Address = Lowercase<string>;
2
-
3
2
  // @todo update with proper chainId for mainnet
4
- export type SupportedChainId = 80001 | 1729;
3
+ import { ReyaChainId } from '@reyaxyz/common';
5
4
 
6
5
  export type ContractType = 'core_proxy' | 'passive_pool_proxy';
7
6
 
8
- const addresses: Record<SupportedChainId, Record<ContractType, Address>> = {
7
+ const addresses: Record<ReyaChainId, Record<ContractType, Address>> = {
9
8
  80001: {
10
9
  core_proxy: '0xc2f1b4a1275b7338e0eb03967fea3858af4bc900',
11
10
  passive_pool_proxy: '0x1b9d499f3ac864b8d4da415846d1d1916e00a6ff',
@@ -25,7 +24,7 @@ export const getAddress = (
25
24
  return `Unspecified addresses for chain id ${keyChainId}`;
26
25
  }
27
26
 
28
- const networkAddresses = addresses[chainId as SupportedChainId];
27
+ const networkAddresses = addresses[chainId as ReyaChainId];
29
28
  if (!Object.keys(networkAddresses).includes(contractName)) {
30
29
  return `Unspecified address for ${contractName} contract`;
31
30
  }