@reyaxyz/sdk 0.81.0 → 0.81.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.
|
@@ -52,7 +52,7 @@ var withdrawPassivePoolAndBridge = function (params) { return __awaiter(void 0,
|
|
|
52
52
|
sharesAmount = (0, common_1.scale)(30)(params.sharesAmount);
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
|
-
sharesAmount = (0, common_1.scale)(30)(params.amount
|
|
55
|
+
sharesAmount = (0, common_1.scale)(30)(params.amount / params.sharePrice);
|
|
56
56
|
}
|
|
57
57
|
return [4 /*yield*/, (0, common_1.signPoolRemoveLiquidity)(params.signer, reyaChainId, (0, common_1.getAddress)(reyaChainId, common_1.ContractType.PERIPHERY_PROXY), params.owner.address, params.pool.id, sharesAmount, BigInt(0), params.owner.poolSigNonce + 1, (0, common_1.getCurrentTimestampInSeconds)() + common_1.BRIDGE_DEADLINE_IN_SECONDS, BigInt('10000000'), //todo
|
|
58
58
|
params.moneyInOutChainId, params.owner.address)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawPassivePoolAndBridge.js","sourceRoot":"/","sources":["services/lp/withdrawPassivePoolAndBridge.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mCAA8D;AAC9D,0CASyB;AAElB,IAAM,4BAA4B,GAAG,UAC1C,MAA0C;;;;;oBAE1B,qBAAM,CAAA,MAAA,MAAM,CAAC,MAAM,CAAC,QAAQ,0CAAE,UAAU,EAAE,CAAA,EAAA;;gBAApD,OAAO,GAAG,SAA0C;gBACpD,WAAW,GAAgB,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,CAAC;gBAG1D,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;oBACvB,YAAY,GAAG,IAAA,cAAK,EAAC,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC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AkDvC","sourcesContent":["import {\n WithdrawPassivePoolAndBridgeParams,\n WithdrawPassivePoolAndBridgeResult,\n} from './types';\nimport { encodeWithdrawPassivePoolAndBridge } from './encode';\nimport {\n ReyaChainId,\n getCurrentTimestampInSeconds,\n scale,\n signPoolRemoveLiquidity,\n ContractType,\n getAddress,\n BRIDGE_DEADLINE_IN_SECONDS,\n executeTransaction,\n} from '@reyaxyz/common';\n\nexport const withdrawPassivePoolAndBridge = async (\n params: WithdrawPassivePoolAndBridgeParams,\n): Promise<WithdrawPassivePoolAndBridgeResult> => {\n const network = await params.signer.provider?.getNetwork();\n const reyaChainId: ReyaChainId = Number(network?.chainId);\n\n let sharesAmount;\n if (params.withdrawMax) {\n sharesAmount = scale(30)(params.sharesAmount);\n } else {\n sharesAmount = scale(30)(params.amount
|
|
1
|
+
{"version":3,"file":"withdrawPassivePoolAndBridge.js","sourceRoot":"/","sources":["services/lp/withdrawPassivePoolAndBridge.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mCAA8D;AAC9D,0CASyB;AAElB,IAAM,4BAA4B,GAAG,UAC1C,MAA0C;;;;;oBAE1B,qBAAM,CAAA,MAAA,MAAM,CAAC,MAAM,CAAC,QAAQ,0CAAE,UAAU,EAAE,CAAA,EAAA;;gBAApD,OAAO,GAAG,SAA0C;gBACpD,WAAW,GAAgB,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,CAAC;gBAG1D,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;oBACvB,YAAY,GAAG,IAAA,cAAK,EAAC,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAChD,CAAC;qBAAM,CAAC;oBACN,YAAY,GAAG,IAAA,cAAK,EAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;gBAC9D,CAAC;gBAEuB,qBAAM,IAAA,gCAAuB,EACnD,MAAM,CAAC,MAAM,EACb,WAAW,EACX,IAAA,mBAAU,EAAC,WAAW,EAAE,qBAAY,CAAC,eAAe,CAAC,EACrD,MAAM,CAAC,KAAK,CAAC,OAAO,EACpB,MAAM,CAAC,IAAI,CAAC,EAAE,EACd,YAAY,EACZ,MAAM,CAAC,CAAC,CAAC,EACT,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,EAC7B,IAAA,qCAA4B,GAAE,GAAG,mCAA0B,EAC3D,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM;oBAC1B,MAAM,CAAC,iBAAiB,EACxB,MAAM,CAAC,KAAK,CAAC,OAAO,CACrB,EAAA;;gBAbK,eAAe,GAAG,SAavB;gBAEK,KAA4B,IAAA,2CAAkC,EAClE,MAAM,CAAC,KAAK,CAAC,OAAO,EACpB,MAAM,CAAC,IAAI,CAAC,EAAE,EACd,YAAY,EACZ,MAAM,CAAC,CAAC,CAAC,EACT,eAAe,EACf,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM;gBAC1B,MAAM,CAAC,iBAAiB,EACxB,MAAM,CAAC,KAAK,CAAC,OAAO,CACrB,EATiB,IAAI,cAAA,EAAE,KAAK,WAAA,CAS3B;gBAEa,qBAAM,IAAA,2BAAkB,EACrC,MAAM,CAAC,MAAM,EACb,IAAI,EACJ,KAAK,EACL,WAAW,EACX,qBAAY,CAAC,eAAe,CAC7B,EAAA;;gBANK,MAAM,GAAG,SAMd;gBAED,sBAAO;wBACL,eAAe,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,KAAI,IAAI;qBACtC,EAAC;;;KACH,CAAC;AAlDW,QAAA,4BAA4B,gCAkDvC","sourcesContent":["import {\n WithdrawPassivePoolAndBridgeParams,\n WithdrawPassivePoolAndBridgeResult,\n} from './types';\nimport { encodeWithdrawPassivePoolAndBridge } from './encode';\nimport {\n ReyaChainId,\n getCurrentTimestampInSeconds,\n scale,\n signPoolRemoveLiquidity,\n ContractType,\n getAddress,\n BRIDGE_DEADLINE_IN_SECONDS,\n executeTransaction,\n} from '@reyaxyz/common';\n\nexport const withdrawPassivePoolAndBridge = async (\n params: WithdrawPassivePoolAndBridgeParams,\n): Promise<WithdrawPassivePoolAndBridgeResult> => {\n const network = await params.signer.provider?.getNetwork();\n const reyaChainId: ReyaChainId = Number(network?.chainId);\n\n let sharesAmount;\n if (params.withdrawMax) {\n sharesAmount = scale(30)(params.sharesAmount);\n } else {\n sharesAmount = scale(30)(params.amount / params.sharePrice);\n }\n\n const eip712Signature = await signPoolRemoveLiquidity(\n params.signer,\n reyaChainId,\n getAddress(reyaChainId, ContractType.PERIPHERY_PROXY),\n params.owner.address,\n params.pool.id,\n sharesAmount,\n BigInt(0),\n params.owner.poolSigNonce + 1,\n getCurrentTimestampInSeconds() + BRIDGE_DEADLINE_IN_SECONDS,\n BigInt('10000000'), //todo\n params.moneyInOutChainId,\n params.owner.address,\n );\n\n const { calldata: data, value } = encodeWithdrawPassivePoolAndBridge(\n params.owner.address,\n params.pool.id,\n sharesAmount,\n BigInt(0),\n eip712Signature,\n BigInt('10000000'), //todo\n params.moneyInOutChainId,\n params.owner.address,\n );\n\n const result = await executeTransaction(\n params.signer,\n data,\n value,\n reyaChainId,\n ContractType.PERIPHERY_PROXY,\n );\n\n return {\n transactionHash: result?.hash || null,\n };\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/sdk",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"ethers": "6.9.0"
|
|
35
35
|
},
|
|
36
36
|
"packageManager": "pnpm@8.3.1",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "1b09eb5acff607fbe420ec85268b96f15df390f3"
|
|
38
38
|
}
|
|
@@ -24,7 +24,7 @@ export const withdrawPassivePoolAndBridge = async (
|
|
|
24
24
|
if (params.withdrawMax) {
|
|
25
25
|
sharesAmount = scale(30)(params.sharesAmount);
|
|
26
26
|
} else {
|
|
27
|
-
sharesAmount = scale(30)(params.amount
|
|
27
|
+
sharesAmount = scale(30)(params.amount / params.sharePrice);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const eip712Signature = await signPoolRemoveLiquidity(
|