@reyaxyz/sdk 0.95.0 → 0.96.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/README.md CHANGED
@@ -6,5 +6,5 @@
6
6
 
7
7
  | Statements | Branches | Functions | Lines |
8
8
  | --------------------------- | ----------------------- | ------------------------- | ----------------- |
9
- | ![Statements](https://img.shields.io/badge/statements-13.59%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-6.81%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-10%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-12.79%25-red.svg?style=flat) |
9
+ | ![Statements](https://img.shields.io/badge/statements-13.59%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-6.66%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-10%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-12.79%25-red.svg?style=flat) |
10
10
 
@@ -89,6 +89,7 @@ var isolatedOrder = function (params) { return __awaiter(void 0, void 0, void 0,
89
89
  matchOrderResult = _b.sent();
90
90
  return [2 /*return*/, {
91
91
  transactionHash: (matchOrderResult === null || matchOrderResult === void 0 ? void 0 : matchOrderResult.transactionHash) || null,
92
+ coreSigNonce: matchOrderResult.coreSigNonce,
92
93
  xpBoost: matchOrderResult.xpBoost,
93
94
  // TODO: costin please fix implementation
94
95
  isNftWon: Math.random() < 0.5,
@@ -1 +1 @@
1
- {"version":3,"file":"isolatedOrder.js","sourceRoot":"/","sources":["services/isolated-order/isolatedOrder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sDAG4B;AAC5B,oCAAuC;AAGhC,IAAM,aAAa,GAAG,UAC3B,MAA2B;;;;oBAQC,qBAAM,IAAA,+BAAa,EAAC;oBAC9C,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;oBAClC,IAAI,EAAE,wBAAwB;iBAC/B,C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,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG;qBAC9B,EAAC;;;KACH,CAAC;AA7DW,QAAA,aAAa,iBA6DxB","sourcesContent":["import { IsolatedOrderParams, IsolatedOrderResult } from './types';\nimport {\n createAccount,\n transferMarginBetweenAccounts,\n} from '../margin-accounts';\nimport { matchOrder } from '../orders';\nimport { OwnerMetadataEntity } from '@reyaxyz/common';\n\nexport const isolatedOrder = async (\n params: IsolatedOrderParams,\n): Promise<IsolatedOrderResult> => {\n // todo: p2 consider performing all steps in api and only call one api function from here?\n\n // step 1: create new account\n\n // todo: p2: consider having a function that creates an account and auto-generates a name in one go, use it t&cs also\n // todo: p2: error handling & logging\n const createAccountResult = await createAccount({\n ownerAddress: params.owner.address,\n name: 'Isolated Trade Account',\n });\n\n if (!createAccountResult.accountId) {\n throw new Error('New Account Id not available to execute isolated trade');\n }\n\n // step 2: transfer margin from source to destination account\n\n for (const action of params.editCollateralActions) {\n // todo: p1: pack transfers into a single tx with multiple transfer commands (core sig issue)\n await transferMarginBetweenAccounts({\n signer: params.signer,\n owner: params.owner,\n fromMarginAccountId: params.fromMarginAccountId,\n toMarginAccountId: createAccountResult.accountId,\n amount: Math.abs(action.collateralDelta),\n tokenAddress: action.collateralAddress,\n });\n }\n\n // step 3: execute trade\n\n /*\n * We need to bump the nonce since we've just executed a transfer transaction\n * */\n\n const ownerWithBumpedNonce: Pick<\n OwnerMetadataEntity,\n 'coreSigNonce' | 'address'\n > = {\n coreSigNonce: params.owner.coreSigNonce + 1,\n address: params.owner.address,\n };\n\n // todo: p1: need to increase the nonce for this tx as well\n const matchOrderResult = await matchOrder({\n signer: params.signer,\n owner: ownerWithBumpedNonce,\n marginAccountId: createAccountResult.accountId,\n amountInBase: params.amountInBase,\n market: params.market,\n });\n\n return {\n transactionHash: matchOrderResult?.transactionHash || null,\n xpBoost: matchOrderResult.xpBoost,\n // TODO: costin please fix implementation\n isNftWon: Math.random() < 0.5,\n };\n};\n"]}
1
+ {"version":3,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,CAAC,SAAS;wBAC9C,YAAY,EAAE,MAAM,CAAC,YAAY;wBACjC,MAAM,EAAE,MAAM,CAAC,MAAM;qBACtB,CAAC,EAAA;;gBANI,gBAAgB,GAAG,SAMvB;gBAEF,sBAAO;wBACL,eAAe,EAAE,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,eAAe,KAAI,IAAI;wBAC1D,YAAY,EAAE,gBAAgB,CAAC,YAAY;wBAC3C,OAAO,EAAE,gBAAgB,CAAC,OAAO;wBACjC,yCAAyC;wBACzC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG;qBAC9B,EAAC;;;KACH,CAAC;AA9DW,QAAA,aAAa,iBA8DxB","sourcesContent":["import { IsolatedOrderParams, IsolatedOrderResult } from './types';\nimport {\n createAccount,\n transferMarginBetweenAccounts,\n} from '../margin-accounts';\nimport { matchOrder } from '../orders';\nimport { OwnerMetadataEntity } from '@reyaxyz/common';\n\nexport const isolatedOrder = async (\n params: IsolatedOrderParams,\n): Promise<IsolatedOrderResult> => {\n // todo: p2 consider performing all steps in api and only call one api function from here?\n\n // step 1: create new account\n\n // todo: p2: consider having a function that creates an account and auto-generates a name in one go, use it t&cs also\n // todo: p2: error handling & logging\n const createAccountResult = await createAccount({\n ownerAddress: params.owner.address,\n name: 'Isolated Trade Account',\n });\n\n if (!createAccountResult.accountId) {\n throw new Error('New Account Id not available to execute isolated trade');\n }\n\n // step 2: transfer margin from source to destination account\n\n for (const action of params.editCollateralActions) {\n // todo: p1: pack transfers into a single tx with multiple transfer commands (core sig issue)\n await transferMarginBetweenAccounts({\n signer: params.signer,\n owner: params.owner,\n fromMarginAccountId: params.fromMarginAccountId,\n toMarginAccountId: createAccountResult.accountId,\n amount: Math.abs(action.collateralDelta),\n tokenAddress: action.collateralAddress,\n });\n }\n\n // step 3: execute trade\n\n /*\n * We need to bump the nonce since we've just executed a transfer transaction\n * */\n\n const ownerWithBumpedNonce: Pick<\n OwnerMetadataEntity,\n 'coreSigNonce' | 'address'\n > = {\n coreSigNonce: params.owner.coreSigNonce + 1,\n address: params.owner.address,\n };\n\n // todo: p1: need to increase the nonce for this tx as well\n const matchOrderResult = await matchOrder({\n signer: params.signer,\n owner: ownerWithBumpedNonce,\n marginAccountId: createAccountResult.accountId,\n amountInBase: params.amountInBase,\n market: params.market,\n });\n\n return {\n transactionHash: matchOrderResult?.transactionHash || null,\n coreSigNonce: matchOrderResult.coreSigNonce,\n xpBoost: matchOrderResult.xpBoost,\n // TODO: costin please fix implementation\n isNftWon: Math.random() < 0.5,\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["services/isolated-order/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Signer, JsonRpcSigner } from 'ethers';\nimport {\n EditCollateralAction,\n MarginAccountEntity,\n OwnerMetadataEntity,\n} from '@reyaxyz/common';\nimport { MarketParams } from '../orders';\n\nexport type IsolatedOrderParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce' | 'address'>;\n fromMarginAccountId: MarginAccountEntity['id'];\n editCollateralActions: EditCollateralAction[]; // todo: p2: consider abstracting this such that UI doesn't pass this\n amountInBase: number;\n market: MarketParams;\n};\n\nexport type IsolatedOrderResult = {\n transactionHash: string | null;\n xpBoost: number;\n isNftWon: boolean;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["services/isolated-order/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Signer, JsonRpcSigner } from 'ethers';\nimport {\n EditCollateralAction,\n MarginAccountEntity,\n OwnerMetadataEntity,\n} from '@reyaxyz/common';\nimport { MarketParams } from '../orders';\n\nexport type IsolatedOrderParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce' | 'address'>;\n fromMarginAccountId: MarginAccountEntity['id'];\n editCollateralActions: EditCollateralAction[]; // todo: p2: consider abstracting this such that UI doesn't pass this\n amountInBase: number;\n market: MarketParams;\n};\n\nexport type IsolatedOrderResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n xpBoost: number;\n isNftWon: boolean;\n};\n"]}
@@ -45,6 +45,7 @@ var common_4 = require("@reyaxyz/common");
45
45
  var common_5 = require("@reyaxyz/common");
46
46
  var encode_2 = require("../encode");
47
47
  var ethers_1 = require("ethers");
48
+ var signAndBroadcastTransaction_1 = require("../signAndBroadcastTransaction");
48
49
  var transferFromMAToPool = function (params) { return __awaiter(void 0, void 0, void 0, function () {
49
50
  var network, reyaChainId, tokenInfo, amount, minShares, multiAction, eip712Signature, _a, data, value, result;
50
51
  var _b;
@@ -63,11 +64,12 @@ var transferFromMAToPool = function (params) { return __awaiter(void 0, void 0,
63
64
  case 2:
64
65
  eip712Signature = _c.sent();
65
66
  _a = (0, encode_1.encodeTransferFromMAToPool)(params.marginAccountId, amount, eip712Signature, params.pool.id, minShares, params.owner.address), data = _a.calldata, value = _a.value;
66
- return [4 /*yield*/, (0, common_2.executeTransaction)(params.signer, data, value, reyaChainId, common_2.ContractType.PERIPHERY_PROXY)];
67
+ return [4 /*yield*/, (0, signAndBroadcastTransaction_1.signAndBroadcastTransaction)(params.signer, data, value, reyaChainId, common_2.ContractType.PERIPHERY_PROXY, {})];
67
68
  case 3:
68
69
  result = _c.sent();
69
70
  return [2 /*return*/, {
70
- transactionHash: (result === null || result === void 0 ? void 0 : result.hash) || null,
71
+ transactionHash: (result === null || result === void 0 ? void 0 : result.txHash) || null,
72
+ coreSigNonce: Number(result === null || result === void 0 ? void 0 : result.coreSigNonce) || null,
71
73
  }];
72
74
  }
73
75
  });
@@ -1 +1 @@
1
- {"version":3,"file":"transferFromMAToPool.js","sourceRoot":"/","sources":["services/lp/transferFromMAToPool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAKyB;AACzB,0CAA+E;AAC/E,0CAAmD;AACnD,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,EAC1D,MAAM,CAAC,eAAe,EACtB,MAAM,EACN,eAAe,EACf,MAAM,CAAC,IAAI,CAAC,EAAE,EACd,SAAS,EACT,MAAM,CAAC,KAAK,CAAC,OAAO,CACrB,EAPiB,IAAI,cAAA,EAAE,KAAK,WAAA,CAO3B;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;AAhDW,QAAA,oBAAoB,wBAgD/B","sourcesContent":["import {\n getCurrentTimestampInSeconds,\n scale,\n ReyaChainId,\n getTokenInfoByAddress,\n} from '@reyaxyz/common';\nimport { ContractType, getAddress, executeTransaction } from '@reyaxyz/common';\nimport { signCoreCommands } from '@reyaxyz/common';\nimport { encodeTransferFromMAToPool } from './encode';\nimport {\n TransferFromMAToPoolParams,\n TransferFromMAToPoolResult,\n} from './types';\nimport { BRIDGE_DEADLINE_IN_SECONDS } from '@reyaxyz/common';\nimport { MultiAction } from '@reyaxyz/common';\nimport { encodeSingleWithdraw } from '../encode';\nimport { ethers } from 'ethers';\n\nexport const transferFromMAToPool = async (\n params: TransferFromMAToPoolParams,\n): Promise<TransferFromMAToPoolResult> => {\n const network = await params.signer.provider?.getNetwork();\n const reyaChainId: ReyaChainId = Number(network?.chainId);\n\n const tokenInfo = getTokenInfoByAddress(params.pool.tokenAddress);\n const amount = scale(tokenInfo.decimals)(params.amount);\n\n const minShares = BigInt(0);\n\n // transfer from MA to pool involves a core withdrawal\n const multiAction = new MultiAction();\n encodeSingleWithdraw(params.pool.tokenAddress, amount, multiAction);\n const eip712Signature = await signCoreCommands(\n params.signer,\n reyaChainId,\n getAddress(reyaChainId, ContractType.PERIPHERY_PROXY),\n params.marginAccountId,\n multiAction.commands,\n params.owner.coreSigNonce + 1,\n getCurrentTimestampInSeconds() + BRIDGE_DEADLINE_IN_SECONDS,\n ethers.AbiCoder.defaultAbiCoder().encode(\n ['uint128', 'address', 'uint256'],\n [params.pool.id, params.owner.address, minShares],\n ),\n );\n\n const { calldata: data, value } = encodeTransferFromMAToPool(\n params.marginAccountId,\n amount,\n eip712Signature,\n params.pool.id,\n minShares,\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"]}
1
+ {"version":3,"file":"transferFromMAToPool.js","sourceRoot":"/","sources":["services/lp/transferFromMAToPool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAKyB;AACzB,0CAA2D;AAC3D,0CAAmD;AACnD,mCAAsD;AAKtD,0CAA6D;AAC7D,0CAA8C;AAC9C,oCAAiD;AACjD,iCAAgC;AAChC,8EAA6E;AAEtE,IAAM,oBAAoB,GAAG,UAClC,MAAkC;;;;;oBAElB,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;gBAEpD,SAAS,GAAG,IAAA,8BAAqB,EAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC5D,MAAM,GAAG,IAAA,cAAK,EAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAElD,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBAGtB,WAAW,GAAG,IAAI,oBAAW,EAAE,CAAC;gBACtC,IAAA,6BAAoB,EAAC,MAAM,CAAC,I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getTokenInfoByAddress,\n} from '@reyaxyz/common';\nimport { ContractType, getAddress } from '@reyaxyz/common';\nimport { signCoreCommands } from '@reyaxyz/common';\nimport { encodeTransferFromMAToPool } from './encode';\nimport {\n TransferFromMAToPoolParams,\n TransferFromMAToPoolResult,\n} from './types';\nimport { BRIDGE_DEADLINE_IN_SECONDS } from '@reyaxyz/common';\nimport { MultiAction } from '@reyaxyz/common';\nimport { encodeSingleWithdraw } from '../encode';\nimport { ethers } from 'ethers';\nimport { signAndBroadcastTransaction } from '../signAndBroadcastTransaction';\n\nexport const transferFromMAToPool = async (\n params: TransferFromMAToPoolParams,\n): Promise<TransferFromMAToPoolResult> => {\n const network = await params.signer.provider?.getNetwork();\n const reyaChainId: ReyaChainId = Number(network?.chainId);\n\n const tokenInfo = getTokenInfoByAddress(params.pool.tokenAddress);\n const amount = scale(tokenInfo.decimals)(params.amount);\n\n const minShares = BigInt(0);\n\n // transfer from MA to pool involves a core withdrawal\n const multiAction = new MultiAction();\n encodeSingleWithdraw(params.pool.tokenAddress, amount, multiAction);\n const eip712Signature = await signCoreCommands(\n params.signer,\n reyaChainId,\n getAddress(reyaChainId, ContractType.PERIPHERY_PROXY),\n params.marginAccountId,\n multiAction.commands,\n params.owner.coreSigNonce + 1,\n getCurrentTimestampInSeconds() + BRIDGE_DEADLINE_IN_SECONDS,\n ethers.AbiCoder.defaultAbiCoder().encode(\n ['uint128', 'address', 'uint256'],\n [params.pool.id, params.owner.address, minShares],\n ),\n );\n\n const { calldata: data, value } = encodeTransferFromMAToPool(\n params.marginAccountId,\n amount,\n eip712Signature,\n params.pool.id,\n minShares,\n params.owner.address,\n );\n\n const result = await signAndBroadcastTransaction(\n params.signer,\n data,\n value,\n reyaChainId,\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":"types.js","sourceRoot":"/","sources":["services/lp/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n LpPoolEntity,\n LpWithdrawBalanceEntity,\n MarginAccountEntity,\n MoneyInOutChainId,\n OwnerMetadataEntity,\n ReyaChainId,\n SocketDepositFees,\n TokenEntity,\n TokenName,\n} from '@reyaxyz/common';\n\nexport type ProvideLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n amount: number;\n lpPoolId: LpPoolEntity['id'];\n};\n\nexport type RemoveLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n lpPoolId: LpPoolEntity['id'];\n amount: number;\n};\n\nexport type ProvideLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type RemoveLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type TransferFromMAToPoolParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce' | 'address'>;\n marginAccountId: MarginAccountEntity['id'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n};\n\nexport type TransferFromMAToPoolResult = {\n transactionHash: string | null;\n};\n\nexport type WithdrawPassivePoolAndBridgeParams = {\n signer: Signer | JsonRpcSigner;\n moneyInOutChainId: MoneyInOutChainId;\n owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n sharePrice: LpWithdrawBalanceEntity['poolSharePrice'];\n sharesAmount: number;\n withdrawMax: boolean;\n};\n\nexport type WithdrawPassivePoolAndBridgeResult = {\n transactionHash: string | null;\n poolSigNonce: OwnerMetadataEntity['poolSigNonce'] | null;\n};\n\nexport type BridgeAndDepositPassivePoolParams = {\n signer: Signer | JsonRpcSigner;\n ownerAddress: OwnerMetadataEntity['address'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n};\n\nexport type BridgeAndDepositPassivePoolResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositPassivePoolUnderAlphaTermsParams =\n BridgeAndDepositPassivePoolParams & {\n signedLink: string;\n };\n\nexport type BridgeAndDepositPassivePoolUnderAlphaTermsResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateBridgeAndDepositPassivePoolResult = {\n fees: number;\n feesUnderlyingToken: TokenName;\n bridgeTimeInMS: number;\n};\n\nexport type SimulateBridgeAndDepositPassivePoolParams = {\n moneyInOutChainId: MoneyInOutChainId;\n};\n\nexport type SimulateWithdrawPassivePoolAndBridgeResult = {\n fees: number;\n feesUnderlyingToken: TokenName;\n bridgeTimeInMS: number;\n};\n\nexport type SimulateWithdrawPassivePoolAndBridgeParams = {\n reyaChainId: ReyaChainId;\n moneyInOutChainId: MoneyInOutChainId;\n tokenAddress: TokenEntity['address'];\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["services/lp/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n LpPoolEntity,\n LpWithdrawBalanceEntity,\n MarginAccountEntity,\n MoneyInOutChainId,\n OwnerMetadataEntity,\n ReyaChainId,\n SocketDepositFees,\n TokenEntity,\n TokenName,\n} from '@reyaxyz/common';\n\nexport type ProvideLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n amount: number;\n lpPoolId: LpPoolEntity['id'];\n};\n\nexport type RemoveLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n lpPoolId: LpPoolEntity['id'];\n amount: number;\n};\n\nexport type ProvideLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type RemoveLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type TransferFromMAToPoolParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce' | 'address'>;\n marginAccountId: MarginAccountEntity['id'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n};\n\nexport type TransferFromMAToPoolResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type WithdrawPassivePoolAndBridgeParams = {\n signer: Signer | JsonRpcSigner;\n moneyInOutChainId: MoneyInOutChainId;\n owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n sharePrice: LpWithdrawBalanceEntity['poolSharePrice'];\n sharesAmount: number;\n withdrawMax: boolean;\n};\n\nexport type WithdrawPassivePoolAndBridgeResult = {\n transactionHash: string | null;\n poolSigNonce: OwnerMetadataEntity['poolSigNonce'] | null;\n};\n\nexport type BridgeAndDepositPassivePoolParams = {\n signer: Signer | JsonRpcSigner;\n ownerAddress: OwnerMetadataEntity['address'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n};\n\nexport type BridgeAndDepositPassivePoolResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositPassivePoolUnderAlphaTermsParams =\n BridgeAndDepositPassivePoolParams & {\n signedLink: string;\n };\n\nexport type BridgeAndDepositPassivePoolUnderAlphaTermsResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateBridgeAndDepositPassivePoolResult = {\n fees: number;\n feesUnderlyingToken: TokenName;\n bridgeTimeInMS: number;\n};\n\nexport type SimulateBridgeAndDepositPassivePoolParams = {\n moneyInOutChainId: MoneyInOutChainId;\n};\n\nexport type SimulateWithdrawPassivePoolAndBridgeResult = {\n fees: number;\n feesUnderlyingToken: TokenName;\n bridgeTimeInMS: number;\n};\n\nexport type SimulateWithdrawPassivePoolAndBridgeParams = {\n reyaChainId: ReyaChainId;\n moneyInOutChainId: MoneyInOutChainId;\n tokenAddress: TokenEntity['address'];\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["services/margin-accounts/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n MarginAccountEntity,\n MoneyInOutChainId,\n OwnerMetadataEntity,\n SocketDepositFees,\n TokenEntity,\n} from '@reyaxyz/common';\n\nexport type CreateAccountParams = {\n ownerAddress: string;\n name: string;\n};\n\nexport type CreateAccountResult = {\n transactionHash: string | null;\n accountId: MarginAccountEntity['id'] | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type DepositParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type DepositResult = {\n transactionHash: string | null;\n};\n\nexport type WithdrawParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type WithdrawResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateDepositResult = {\n bridgeGasFees: number;\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateDepositParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type SimulateWithdrawResult = {\n bridgeGasFees: number;\n\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateWithdrawParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type TransferMarginBetweenAccountsParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;\n fromMarginAccountId: MarginAccountEntity['id'];\n toMarginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type TransferMarginBetweenAccountsResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type WithdrawMAAndBridgeParams = {\n signer: Signer | JsonRpcSigner;\n moneyInOutChainId: MoneyInOutChainId;\n owner: Pick<OwnerMetadataEntity, 'address' | 'coreSigNonce'>;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n // if not provided it has same value as owner.address\n receiverAddress?: Lowercase<string>;\n};\n\nexport type WithdrawMAAndBridgeParamsResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type BridgeAndDepositNewMAParams = {\n signer: Signer | JsonRpcSigner;\n ownerAddress: OwnerMetadataEntity['address'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n};\n\nexport type BridgeAndDepositNewMAResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositExistingMAParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'address' | 'coreSigNonce'>;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n};\n\nexport type BridgeAndDepositExistingMAResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateTransferMarginBetweenAccountsResult = {\n bridgeGasFees: number;\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateTransferMarginBetweenAccountsParams = {\n signer: Signer | JsonRpcSigner;\n fromMarginAccountId: MarginAccountEntity['id'];\n toMarginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["services/margin-accounts/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n MarginAccountEntity,\n MoneyInOutChainId,\n OwnerMetadataEntity,\n SocketDepositFees,\n TokenEntity,\n} from '@reyaxyz/common';\n\nexport type CreateAccountParams = {\n ownerAddress: string;\n name: string;\n};\n\nexport type CreateAccountResult = {\n transactionHash: string | null;\n accountId: MarginAccountEntity['id'] | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type DepositParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type DepositResult = {\n transactionHash: string | null;\n};\n\nexport type WithdrawParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type WithdrawResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateDepositResult = {\n bridgeGasFees: number;\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateDepositParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type SimulateWithdrawResult = {\n bridgeGasFees: number;\n\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateWithdrawParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type TransferMarginBetweenAccountsParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;\n fromMarginAccountId: MarginAccountEntity['id'];\n toMarginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type TransferMarginBetweenAccountsResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type WithdrawMAAndBridgeParams = {\n signer: Signer | JsonRpcSigner;\n moneyInOutChainId: MoneyInOutChainId;\n owner: Pick<OwnerMetadataEntity, 'address' | 'coreSigNonce'>;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n // if not provided it has same value as owner.address\n receiverAddress?: Lowercase<string>;\n};\n\nexport type WithdrawMAAndBridgeParamsResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type BridgeAndDepositNewMAParams = {\n signer: Signer | JsonRpcSigner;\n ownerAddress: OwnerMetadataEntity['address'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n};\n\nexport type BridgeAndDepositNewMAResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositExistingMAParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n};\n\nexport type BridgeAndDepositExistingMAResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateTransferMarginBetweenAccountsResult = {\n bridgeGasFees: number;\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateTransferMarginBetweenAccountsParams = {\n signer: Signer | JsonRpcSigner;\n fromMarginAccountId: MarginAccountEntity['id'];\n toMarginAccountId: MarginAccountEntity['id'];\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"isolatedOrder.d.ts","sourceRoot":"/","sources":["services/isolated-order/isolatedOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAQnE,eAAO,MAAM,aAAa,WAChB,mBAAmB,KAC1B,QAAQ,mBAAmB,CA2D7B,CAAC"}
1
+ {"version":3,"file":"isolatedOrder.d.ts","sourceRoot":"/","sources":["services/isolated-order/isolatedOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAQnE,eAAO,MAAM,aAAa,WAChB,mBAAmB,KAC1B,QAAQ,mBAAmB,CA4D7B,CAAC"}
@@ -11,6 +11,7 @@ export type IsolatedOrderParams = {
11
11
  };
12
12
  export type IsolatedOrderResult = {
13
13
  transactionHash: string | null;
14
+ coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;
14
15
  xpBoost: number;
15
16
  isNftWon: boolean;
16
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/isolated-order/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;IAC7D,mBAAmB,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC/C,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/isolated-order/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;IAC7D,mBAAmB,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC/C,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transferFromMAToPool.d.ts","sourceRoot":"/","sources":["services/lp/transferFromMAToPool.ts"],"names":[],"mappings":"AASA,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAMjB,eAAO,MAAM,oBAAoB,WACvB,0BAA0B,KACjC,QAAQ,0BAA0B,CA8CpC,CAAC"}
1
+ {"version":3,"file":"transferFromMAToPool.d.ts","sourceRoot":"/","sources":["services/lp/transferFromMAToPool.ts"],"names":[],"mappings":"AASA,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAOjB,eAAO,MAAM,oBAAoB,WACvB,0BAA0B,KACjC,QAAQ,0BAA0B,CAgDpC,CAAC"}
@@ -25,6 +25,7 @@ export type TransferFromMAToPoolParams = {
25
25
  };
26
26
  export type TransferFromMAToPoolResult = {
27
27
  transactionHash: string | null;
28
+ coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;
28
29
  };
29
30
  export type WithdrawPassivePoolAndBridgeParams = {
30
31
  signer: Signer | JsonRpcSigner;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/lp/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;IAC7D,eAAe,EAAE,mBAAmB,CAAC,IAA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,MAAM,MAAM,iCAAiC,GAAG;IAC9C,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,YAAY,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7C,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,cAAc,CAAC,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gDAAgD,GAC1D,iCAAiC,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEJ,MAAM,MAAM,gDAAgD,GAAG;IAC7D,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,SAAS,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG;IACtD,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,SAAS,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC"}
@@ -86,7 +86,6 @@ export type BridgeAndDepositNewMAResult = {
86
86
  };
87
87
  export type BridgeAndDepositExistingMAParams = {
88
88
  signer: Signer | JsonRpcSigner;
89
- owner: Pick<OwnerMetadataEntity, 'address' | 'coreSigNonce'>;
90
89
  marginAccountId: MarginAccountEntity['id'];
91
90
  tokenAddress: TokenEntity['address'];
92
91
  amount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/margin-accounts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,mBAAmB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC3C,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI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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.112.0",
32
+ "@reyaxyz/common": "0.113.0",
33
33
  "bignumber.js": "^9.1.2",
34
34
  "ethers": "6.9.0"
35
35
  },
36
36
  "packageManager": "pnpm@8.3.1",
37
- "gitHead": "e24a305d805dc3a4d38a124538e5a7285aa9344e"
37
+ "gitHead": "21d078afc658b56f6bfa4fd352a3bf7016ddb369"
38
38
  }
@@ -63,6 +63,7 @@ export const isolatedOrder = async (
63
63
 
64
64
  return {
65
65
  transactionHash: matchOrderResult?.transactionHash || null,
66
+ coreSigNonce: matchOrderResult.coreSigNonce,
66
67
  xpBoost: matchOrderResult.xpBoost,
67
68
  // TODO: costin please fix implementation
68
69
  isNftWon: Math.random() < 0.5,
@@ -17,6 +17,7 @@ export type IsolatedOrderParams = {
17
17
 
18
18
  export type IsolatedOrderResult = {
19
19
  transactionHash: string | null;
20
+ coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;
20
21
  xpBoost: number;
21
22
  isNftWon: boolean;
22
23
  };
@@ -4,7 +4,7 @@ import {
4
4
  ReyaChainId,
5
5
  getTokenInfoByAddress,
6
6
  } from '@reyaxyz/common';
7
- import { ContractType, getAddress, executeTransaction } from '@reyaxyz/common';
7
+ import { ContractType, getAddress } from '@reyaxyz/common';
8
8
  import { signCoreCommands } from '@reyaxyz/common';
9
9
  import { encodeTransferFromMAToPool } from './encode';
10
10
  import {
@@ -15,6 +15,7 @@ import { BRIDGE_DEADLINE_IN_SECONDS } from '@reyaxyz/common';
15
15
  import { MultiAction } from '@reyaxyz/common';
16
16
  import { encodeSingleWithdraw } from '../encode';
17
17
  import { ethers } from 'ethers';
18
+ import { signAndBroadcastTransaction } from '../signAndBroadcastTransaction';
18
19
 
19
20
  export const transferFromMAToPool = async (
20
21
  params: TransferFromMAToPoolParams,
@@ -53,15 +54,17 @@ export const transferFromMAToPool = async (
53
54
  params.owner.address,
54
55
  );
55
56
 
56
- const result = await executeTransaction(
57
+ const result = await signAndBroadcastTransaction(
57
58
  params.signer,
58
59
  data,
59
60
  value,
60
61
  reyaChainId,
61
62
  ContractType.PERIPHERY_PROXY,
63
+ {},
62
64
  );
63
65
 
64
66
  return {
65
- transactionHash: result?.hash || null,
67
+ transactionHash: result?.txHash || null,
68
+ coreSigNonce: Number(result?.coreSigNonce) || null,
66
69
  };
67
70
  };
@@ -41,6 +41,7 @@ export type TransferFromMAToPoolParams = {
41
41
 
42
42
  export type TransferFromMAToPoolResult = {
43
43
  transactionHash: string | null;
44
+ coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;
44
45
  };
45
46
 
46
47
  export type WithdrawPassivePoolAndBridgeParams = {
@@ -113,7 +113,6 @@ export type BridgeAndDepositNewMAResult = {
113
113
 
114
114
  export type BridgeAndDepositExistingMAParams = {
115
115
  signer: Signer | JsonRpcSigner;
116
- owner: Pick<OwnerMetadataEntity, 'address' | 'coreSigNonce'>;
117
116
  marginAccountId: MarginAccountEntity['id'];
118
117
  tokenAddress: TokenEntity['address'];
119
118
  amount: number;