@reyaxyz/sdk 0.114.2 → 0.114.3

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.
@@ -48,7 +48,7 @@ var transferMarginBetweenAccounts = function (params) { return __awaiter(void 0,
48
48
  switch (_a.label) {
49
49
  case 0:
50
50
  tokenInfo = (0, common_1.getTokenInfoByAddress)(params.tokenAddress);
51
- amount = (0, common_1.scale)(tokenInfo.decimals)(params.amount);
51
+ amount = (0, common_1.scaleV2)(tokenInfo.decimals)(params.amount);
52
52
  env = (0, config_1.getSdkEnvironment)();
53
53
  chainId = (0, common_1.getReyaNetwork)(env === 'production' ? 'production' : 'test');
54
54
  return [4 /*yield*/, (0, encode_1.encodeTransferMargin)(params.signer, chainId, params.owner.coreSigNonce, params.fromMarginAccountId, params.toMarginAccountId, params.tokenAddress, amount)];
@@ -1 +1 @@
1
- {"version":3,"file":"transferMarginBetweenAccounts.js","sourceRoot":"/","sources":["services/margin-accounts/transferMarginBetweenAccounts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA+E;AAC/E,0CAA+C;AAC/C,8EAA6E;AAC7E,mCAAgD;AAKhD,uCAAiD;AAE1C,IAAM,6BAA6B,GAAG,UAC3C,MAA2C;;;;;gBAErC,SAAS,GAAG,IAAA,8BAAqB,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBACvD,MAAM,GAAG,IAAA,cAAK,EAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAElD,GAAG,GAAG,IAAA,0BAAiB,GAAE,CAAC;gBAC1B,OAAO,GAAG,IAAA,uBAAc,EAAC,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBAElD,qBAAM,IAAA,6BAAoB,EACnD,MAAM,CAAC,MAAM,EACb,OAAO,EACP,MAAM,CAAC,KAAK,CAAC,YAAY,EACzB,MAAM,CAAC,mBAAmB,EAC1B,MAAM,CAAC,iBAAiB,EACxB,MAAM,CAAC,YAAY,EACnB,MAAM,CACP,EAAA;;gBARiB,IAAI,GAAK,CAAA,SAQ1B,CAAA,SARqB;gBAUP,qBAAM,IAAA,yDAA2B,EAC9C,IAAI,EACJ,OAAO,EACP,qBAAY,CAAC,eAAe,EAC5B,EAAE,CACH,EAAA;;gBALK,MAAM,GAAG,SAKd;gBAED,sBAAO;wBACL,eAAe,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,KAAI,IAAI;wBACvC,YAAY,EAAE,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC,IAAI,IAAI;qBACnD,EAAC;;;KACH,CAAC;AA9BW,QAAA,6BAA6B,iCA8BxC","sourcesContent":["import { scale, getTokenInfoByAddress, getReyaNetwork } from '@reyaxyz/common';\nimport { ContractType } from '@reyaxyz/common';\nimport { signAndBroadcastTransaction } from '../signAndBroadcastTransaction';\nimport { encodeTransferMargin } from './encode';\nimport {\n TransferMarginBetweenAccountsParams,\n TransferMarginBetweenAccountsResult,\n} from './types';\nimport { getSdkEnvironment } from '../../config';\n\nexport const transferMarginBetweenAccounts = async (\n params: TransferMarginBetweenAccountsParams,\n): Promise<TransferMarginBetweenAccountsResult> => {\n const tokenInfo = getTokenInfoByAddress(params.tokenAddress);\n const amount = scale(tokenInfo.decimals)(params.amount);\n\n const env = getSdkEnvironment();\n const chainId = getReyaNetwork(env === 'production' ? 'production' : 'test');\n\n const { calldata: data } = await encodeTransferMargin(\n params.signer,\n chainId,\n params.owner.coreSigNonce,\n params.fromMarginAccountId,\n params.toMarginAccountId,\n params.tokenAddress,\n amount,\n );\n\n const result = await signAndBroadcastTransaction(\n data,\n chainId,\n ContractType.PERIPHERY_PROXY,\n {},\n );\n\n return {\n transactionHash: result?.txHash || null,\n coreSigNonce: Number(result?.coreSigNonce) || null,\n };\n};\n"]}
1
+ {"version":3,"file":"transferMarginBetweenAccounts.js","sourceRoot":"/","sources":["services/margin-accounts/transferMarginBetweenAccounts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAIyB;AACzB,0CAA+C;AAC/C,8EAA6E;AAC7E,mCAAgD;AAKhD,uCAAiD;AAE1C,IAAM,6BAA6B,GAAG,UAC3C,MAA2C;;;;;gBAErC,SAAS,GAAG,IAAA,8BAAqB,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBACvD,MAAM,GAAG,IAAA,gBAAO,EAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAEpD,GAAG,GAAG,IAAA,0BAAiB,GAAE,CAAC;gBAC1B,OAAO,GAAG,IAAA,uBAAc,EAAC,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBAElD,qBAAM,IAAA,6BAAoB,EACnD,MAAM,CAAC,MAAM,EACb,OAAO,EACP,MAAM,CAAC,KAAK,CAAC,YAAY,EACzB,MAAM,CAAC,mBAAmB,EAC1B,MAAM,CAAC,iBAAiB,EACxB,MAAM,CAAC,YAAY,EACnB,MAAM,CACP,EAAA;;gBARiB,IAAI,GAAK,CAAA,SAQ1B,CAAA,SARqB;gBAUP,qBAAM,IAAA,yDAA2B,EAC9C,IAAI,EACJ,OAAO,EACP,qBAAY,CAAC,eAAe,EAC5B,EAAE,CACH,EAAA;;gBALK,MAAM,GAAG,SAKd;gBAED,sBAAO;wBACL,eAAe,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,KAAI,IAAI;wBACvC,YAAY,EAAE,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC,IAAI,IAAI;qBACnD,EAAC;;;KACH,CAAC;AA9BW,QAAA,6BAA6B,iCA8BxC","sourcesContent":["import {\n scaleV2,\n getTokenInfoByAddress,\n getReyaNetwork,\n} from '@reyaxyz/common';\nimport { ContractType } from '@reyaxyz/common';\nimport { signAndBroadcastTransaction } from '../signAndBroadcastTransaction';\nimport { encodeTransferMargin } from './encode';\nimport {\n TransferMarginBetweenAccountsParams,\n TransferMarginBetweenAccountsResult,\n} from './types';\nimport { getSdkEnvironment } from '../../config';\n\nexport const transferMarginBetweenAccounts = async (\n params: TransferMarginBetweenAccountsParams,\n): Promise<TransferMarginBetweenAccountsResult> => {\n const tokenInfo = getTokenInfoByAddress(params.tokenAddress);\n const amount = scaleV2(tokenInfo.decimals)(params.amount);\n\n const env = getSdkEnvironment();\n const chainId = getReyaNetwork(env === 'production' ? 'production' : 'test');\n\n const { calldata: data } = await encodeTransferMargin(\n params.signer,\n chainId,\n params.owner.coreSigNonce,\n params.fromMarginAccountId,\n params.toMarginAccountId,\n params.tokenAddress,\n amount,\n );\n\n const result = await signAndBroadcastTransaction(\n data,\n chainId,\n ContractType.PERIPHERY_PROXY,\n {},\n );\n\n return {\n transactionHash: result?.txHash || null,\n coreSigNonce: Number(result?.coreSigNonce) || null,\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"transferMarginBetweenAccounts.d.ts","sourceRoot":"/","sources":["services/margin-accounts/transferMarginBetweenAccounts.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,EACpC,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,6BAA6B,WAChC,mCAAmC,KAC1C,QAAQ,mCAAmC,CA4B7C,CAAC"}
1
+ {"version":3,"file":"transferMarginBetweenAccounts.d.ts","sourceRoot":"/","sources":["services/margin-accounts/transferMarginBetweenAccounts.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,mCAAmC,EACnC,mCAAmC,EACpC,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,6BAA6B,WAChC,mCAAmC,KAC1C,QAAQ,mCAAmC,CA4B7C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/sdk",
3
- "version": "0.114.2",
3
+ "version": "0.114.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -29,11 +29,11 @@
29
29
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
30
30
  },
31
31
  "dependencies": {
32
- "@reyaxyz/common": "0.214.1",
32
+ "@reyaxyz/common": "0.214.2",
33
33
  "axios": "^1.6.2",
34
34
  "bignumber.js": "^9.1.2",
35
35
  "ethers": "6.9.0"
36
36
  },
37
37
  "packageManager": "pnpm@8.3.1",
38
- "gitHead": "436c4f84f279b3fe6d465d9fd40c874c6847b04c"
38
+ "gitHead": "16d781e38a7a8bc0c47f7d254300db6451027141"
39
39
  }
@@ -1,4 +1,8 @@
1
- import { scale, getTokenInfoByAddress, getReyaNetwork } from '@reyaxyz/common';
1
+ import {
2
+ scaleV2,
3
+ getTokenInfoByAddress,
4
+ getReyaNetwork,
5
+ } from '@reyaxyz/common';
2
6
  import { ContractType } from '@reyaxyz/common';
3
7
  import { signAndBroadcastTransaction } from '../signAndBroadcastTransaction';
4
8
  import { encodeTransferMargin } from './encode';
@@ -12,7 +16,7 @@ export const transferMarginBetweenAccounts = async (
12
16
  params: TransferMarginBetweenAccountsParams,
13
17
  ): Promise<TransferMarginBetweenAccountsResult> => {
14
18
  const tokenInfo = getTokenInfoByAddress(params.tokenAddress);
15
- const amount = scale(tokenInfo.decimals)(params.amount);
19
+ const amount = scaleV2(tokenInfo.decimals)(params.amount);
16
20
 
17
21
  const env = getSdkEnvironment();
18
22
  const chainId = getReyaNetwork(env === 'production' ? 'production' : 'test');