@reyaxyz/common 0.105.0 → 0.105.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.
|
@@ -20,7 +20,7 @@ var ABI_DEFINITION = (_a = {},
|
|
|
20
20
|
_a[CommandType.DEPOSIT] = ['address', 'uint256'],
|
|
21
21
|
_a[CommandType.WITHDRAW] = ['address', 'uint256'],
|
|
22
22
|
_a[CommandType.MATCH_ORDER] = ['uint128[]', 'bytes'],
|
|
23
|
-
_a[CommandType.DUTCH_LIQUIDATION] = ['tuple(uint128,address,uint128[],bytes)'],
|
|
23
|
+
_a[CommandType.DUTCH_LIQUIDATION] = ['tuple(uint128,address,uint128[],bytes[])'],
|
|
24
24
|
_a[CommandType.TRANSFER_MARGIN_ACCOUNT] = ['tuple(uint128,address,uint256)'],
|
|
25
25
|
_a);
|
|
26
26
|
function createCommand(type, parameters, marketId, exchangeId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routerCommands.js","sourceRoot":"/","sources":["transactions/routerCommands.ts"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAGlC;;;;GAIG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,mDAAO,CAAA;IACP,qDAAQ,CAAA;IACR,uEAAiB,CAAA;IACjB,2DAAW,CAAA;IACX,mFAAuB,CAAA;AACzB,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAED,IAAM,cAAc;IAClB,GAAC,WAAW,CAAC,OAAO,IAAG,CAAC,SAAS,EAAE,SAAS,CAAC;IAC7C,GAAC,WAAW,CAAC,QAAQ,IAAG,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9C,GAAC,WAAW,CAAC,WAAW,IAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IACjD,GAAC,WAAW,CAAC,iBAAiB,IAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"routerCommands.js","sourceRoot":"/","sources":["transactions/routerCommands.ts"],"names":[],"mappings":";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CAAC;AAfD,gCAeC","sourcesContent":["import { AbiCoder } from 'ethers';\nimport { SingleAction } from './action';\n\n/**\n * CommandTypes\n * @description Flags that modify a command's execution\n * @enum {number}\n */\nexport enum CommandType {\n DEPOSIT,\n WITHDRAW,\n DUTCH_LIQUIDATION,\n MATCH_ORDER,\n TRANSFER_MARGIN_ACCOUNT,\n}\n\nconst ABI_DEFINITION: { [key in CommandType]: string[] } = {\n [CommandType.DEPOSIT]: ['address', 'uint256'],\n [CommandType.WITHDRAW]: ['address', 'uint256'],\n [CommandType.MATCH_ORDER]: ['uint128[]', 'bytes'],\n [CommandType.DUTCH_LIQUIDATION]: ['tuple(uint128,address,uint128[],bytes[])'],\n [CommandType.TRANSFER_MARGIN_ACCOUNT]: ['tuple(uint128,address,uint256)'], // @todo update once needed\n};\n\nexport type RouterCommand = {\n type: CommandType;\n encodedInput: string;\n marketId: number;\n exchangeId: number;\n};\n\nexport function createCommand(\n type: CommandType,\n parameters: unknown[],\n marketId: number,\n exchangeId: number,\n): RouterCommand {\n const encodedInput = AbiCoder.defaultAbiCoder().encode(\n ABI_DEFINITION[type],\n parameters,\n );\n return { type, encodedInput, marketId, exchangeId };\n}\n\nexport function getCommand(\n type: CommandType,\n parameters: unknown[],\n marketId: number,\n exchangeId: number,\n): SingleAction {\n const command = createCommand(type, parameters, marketId, exchangeId);\n return {\n command: {\n commandType: command.type,\n inputs: command.encodedInput,\n marketId: command.marketId,\n exchangeId: command.exchangeId,\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/common",
|
|
3
|
-
"version": "0.105.
|
|
3
|
+
"version": "0.105.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
43
43
|
},
|
|
44
44
|
"packageManager": "pnpm@8.3.1",
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "9343c5063fa541031bc107dfcc4aecaab4be04c3"
|
|
46
46
|
}
|
|
@@ -18,7 +18,7 @@ const ABI_DEFINITION: { [key in CommandType]: string[] } = {
|
|
|
18
18
|
[CommandType.DEPOSIT]: ['address', 'uint256'],
|
|
19
19
|
[CommandType.WITHDRAW]: ['address', 'uint256'],
|
|
20
20
|
[CommandType.MATCH_ORDER]: ['uint128[]', 'bytes'],
|
|
21
|
-
[CommandType.DUTCH_LIQUIDATION]: ['tuple(uint128,address,uint128[],bytes)'],
|
|
21
|
+
[CommandType.DUTCH_LIQUIDATION]: ['tuple(uint128,address,uint128[],bytes[])'],
|
|
22
22
|
[CommandType.TRANSFER_MARGIN_ACCOUNT]: ['tuple(uint128,address,uint256)'], // @todo update once needed
|
|
23
23
|
};
|
|
24
24
|
|