@reyaxyz/sdk 0.137.0 → 0.138.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.
- package/dist/services/lp/types.js.map +1 -1
- package/dist/services/margin-accounts/types.js.map +1 -1
- package/dist/services/orders/types.js.map +1 -1
- package/dist/types/services/lp/types.d.ts +4 -4
- package/dist/types/services/lp/types.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/types.d.ts +18 -18
- package/dist/types/services/margin-accounts/types.d.ts.map +1 -1
- package/dist/types/services/orders/types.d.ts +6 -6
- package/dist/types/services/orders/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/services/lp/types.ts +3 -4
- package/src/services/margin-accounts/types.ts +18 -18
- package/src/services/orders/types.ts +5 -6
|
@@ -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
|
|
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 MoneyInOutChainId,\n OwnerMetadataEntity,\n ReyaChainId,\n SocketDepositFees,\n TokenEntity,\n TokenName,\n} from '@reyaxyz/common';\n\nexport type TransferStakeToMarginAccountParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;\n marginAccountId: number;\n pool: Pick<LpPoolEntity, 'id'>;\n srusdAmount: number;\n};\n\nexport type TransferStakeToMarginAccountResult = {\n transactionHash: string | null;\n poolSigNonce: OwnerMetadataEntity['poolSigNonce'] | null;\n};\n\nexport type UnstakeFromMarginAccountParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;\n marginAccountId: number;\n pool: Pick<LpPoolEntity, 'id'>;\n srusdAmount: number;\n};\n\nexport type UnstakeFromMarginAccountResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type StakeFromMarginAccountParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;\n marginAccountId: number;\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n};\n\nexport type StakeFromMarginAccountResult = {\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 WithdrawPassivePoolAndBridgeParamsV2 = {\n signer: Signer | JsonRpcSigner;\n moneyInOutChainId: MoneyInOutChainId;\n owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;\n pool: Pick<LpPoolEntity, 'id'>;\n amount: number;\n sharePrice: LpWithdrawBalanceEntity['poolSharePrice'];\n priceTokenToRusd: LpWithdrawBalanceEntity['balanceBreakdown'][string]['priceTokenToRusd'];\n sharesAmount: number;\n withdrawMax: boolean;\n tokenAddress: TokenEntity['address']; // address from reya chain\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 BridgeAndDepositPassivePoolParamsV2 = {\n signer: Signer | JsonRpcSigner;\n ownerAddress: OwnerMetadataEntity['address'];\n pool: Pick<LpPoolEntity, 'id'>;\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n tokenAddress: TokenEntity['address'];\n};\n\nexport type BridgeAndDepositPassivePoolResult = {\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
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["services/margin-accounts/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n MarginRatioHealth,\n MoneyInOutChainId,\n OwnerMetadataEntity,\n SocketDepositFees,\n TokenEntity,\n} from '@reyaxyz/common';\n\nexport type CreateAccountParams = {\n ownerAddress: string;\n name: string;\n source?: string;\n};\n\nexport type CreateAccountResult = {\n transactionHash: string | null;\n accountId: number | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n};\n\nexport type DepositParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\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: number;\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: MarginRatioHealth;\n marginRatio: number;\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateDepositParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type SimulateWithdrawResult = {\n bridgeGasFees: number;\n\n marginRatioHealth: MarginRatioHealth;\n marginRatio: number;\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateWithdrawParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n\nexport type TransferMarginBetweenAccountsParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;\n fromMarginAccountId: number;\n toMarginAccountId: number;\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: number;\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: number;\n tokenAddress: TokenEntity['address'];\n amount: number;\n socketDepositFees: SocketDepositFees['fees'];\n moneyInOutChainId?: MoneyInOutChainId;\n};\n\nexport type BridgeAndDepositExistingMAResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateTransferMarginBetweenAccountsResult = {\n bridgeGasFees: number;\n marginRatioHealth: MarginRatioHealth;\n marginRatio: number;\n};\n\n// TODO: Milan reevaluate these params\nexport type SimulateTransferMarginBetweenAccountsParams = {\n signer: Signer | JsonRpcSigner;\n fromMarginAccountId: number;\n toMarginAccountId: number;\n tokenAddress: TokenEntity['address'];\n amount: number;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["services/orders/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Signer, JsonRpcSigner } from 'ethers';\nimport {\n CoreCommandsEIP712SignatureAndPayload,\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["services/orders/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Signer, JsonRpcSigner } from 'ethers';\nimport {\n CoreCommandsEIP712SignatureAndPayload,\n MarketEntity,\n MethodParameters,\n OrdersGatewayOrderType,\n OwnerMetadataEntity,\n PositionEntity,\n TransactionExecutionOutput,\n} from '@reyaxyz/common';\n\nexport type MarketParams = {\n id: MarketEntity['id'];\n exchangeId: MarketEntity['orderInfo']['exchangeId'];\n counterpartyAccountIds: MarketEntity['orderInfo']['counterpartyAccountIds'];\n minOrderSizeBase: MarketEntity['minOrderSizeBase'];\n baseSpacing: MarketEntity['baseSpacing'];\n};\n\nexport type MatchOrderParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\n amountInBase: number; // amount in base\n market: MarketParams;\n tradeSource?: 'reya' | 'rage' | 'other';\n};\n\nexport type CloseOrderParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\n orderBase: PositionEntity['base'];\n market: MarketParams;\n} & (\n | {\n type: 'full';\n }\n | {\n type: 'partial';\n closingOrderBase: number;\n }\n);\n\nexport type MatchOrderResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n xpBoost: number;\n lotteryXpBoost: number;\n isNftWon: boolean;\n marginAccountId: number;\n xpEarned: number;\n executionPrice: number;\n base: number;\n positions?: TransactionExecutionOutput['positions'];\n orders?: TransactionExecutionOutput['orders'];\n accounts?: TransactionExecutionOutput['accounts'];\n};\n\nexport type CloseOrderResult = {\n transactionHash: string | null;\n coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;\n xpBoost: number;\n lotteryXpBoost: number;\n isNftWon: boolean;\n marginAccountId: number;\n xpEarned: number;\n executionPrice: number;\n base: number;\n};\n\nexport type MethodParametersAndEIP712Payload = MethodParameters &\n CoreCommandsEIP712SignatureAndPayload;\n\nexport type OrdersGatewayMarketOrderParams = {\n signer: Signer | JsonRpcSigner;\n marginAccountId: number;\n marketId: MarketEntity['id'];\n counterpartyAccountIds: MarketEntity['orderInfo']['counterpartyAccountIds'];\n exchangeId: MarketEntity['orderInfo']['exchangeId'];\n order: {\n baseE18: bigint;\n priceLimitE18: bigint;\n type:\n | OrdersGatewayOrderType.MARKET_ORDER\n | OrdersGatewayOrderType.REDUCE_ONLY_MARKET_ORDER;\n };\n tradeSource?: 'reya' | 'rage' | 'other';\n};\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JsonRpcSigner, Signer } from 'ethers';
|
|
2
|
-
import { LpPoolEntity, LpWithdrawBalanceEntity,
|
|
2
|
+
import { LpPoolEntity, LpWithdrawBalanceEntity, MoneyInOutChainId, OwnerMetadataEntity, ReyaChainId, SocketDepositFees, TokenEntity, TokenName } from '@reyaxyz/common';
|
|
3
3
|
export type TransferStakeToMarginAccountParams = {
|
|
4
4
|
signer: Signer | JsonRpcSigner;
|
|
5
5
|
owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;
|
|
6
|
-
marginAccountId:
|
|
6
|
+
marginAccountId: number;
|
|
7
7
|
pool: Pick<LpPoolEntity, 'id'>;
|
|
8
8
|
srusdAmount: number;
|
|
9
9
|
};
|
|
@@ -14,7 +14,7 @@ export type TransferStakeToMarginAccountResult = {
|
|
|
14
14
|
export type UnstakeFromMarginAccountParams = {
|
|
15
15
|
signer: Signer | JsonRpcSigner;
|
|
16
16
|
owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;
|
|
17
|
-
marginAccountId:
|
|
17
|
+
marginAccountId: number;
|
|
18
18
|
pool: Pick<LpPoolEntity, 'id'>;
|
|
19
19
|
srusdAmount: number;
|
|
20
20
|
};
|
|
@@ -25,7 +25,7 @@ export type UnstakeFromMarginAccountResult = {
|
|
|
25
25
|
export type StakeFromMarginAccountParams = {
|
|
26
26
|
signer: Signer | JsonRpcSigner;
|
|
27
27
|
owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;
|
|
28
|
-
marginAccountId:
|
|
28
|
+
marginAccountId: number;
|
|
29
29
|
pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;
|
|
30
30
|
amount: number;
|
|
31
31
|
};
|
|
@@ -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,
|
|
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,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,SAAS,EACV,MA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|
import { JsonRpcSigner, Signer } from 'ethers';
|
|
2
|
-
import {
|
|
2
|
+
import { MarginRatioHealth, MoneyInOutChainId, OwnerMetadataEntity, SocketDepositFees, TokenEntity } from '@reyaxyz/common';
|
|
3
3
|
export type CreateAccountParams = {
|
|
4
4
|
ownerAddress: string;
|
|
5
5
|
name: string;
|
|
@@ -7,12 +7,12 @@ export type CreateAccountParams = {
|
|
|
7
7
|
};
|
|
8
8
|
export type CreateAccountResult = {
|
|
9
9
|
transactionHash: string | null;
|
|
10
|
-
accountId:
|
|
10
|
+
accountId: number | null;
|
|
11
11
|
coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;
|
|
12
12
|
};
|
|
13
13
|
export type DepositParams = {
|
|
14
14
|
signer: Signer | JsonRpcSigner;
|
|
15
|
-
marginAccountId:
|
|
15
|
+
marginAccountId: number;
|
|
16
16
|
tokenAddress: TokenEntity['address'];
|
|
17
17
|
amount: number;
|
|
18
18
|
};
|
|
@@ -21,7 +21,7 @@ export type DepositResult = {
|
|
|
21
21
|
};
|
|
22
22
|
export type WithdrawParams = {
|
|
23
23
|
signer: Signer | JsonRpcSigner;
|
|
24
|
-
marginAccountId:
|
|
24
|
+
marginAccountId: number;
|
|
25
25
|
tokenAddress: TokenEntity['address'];
|
|
26
26
|
amount: number;
|
|
27
27
|
};
|
|
@@ -30,31 +30,31 @@ export type WithdrawResult = {
|
|
|
30
30
|
};
|
|
31
31
|
export type SimulateDepositResult = {
|
|
32
32
|
bridgeGasFees: number;
|
|
33
|
-
marginRatioHealth:
|
|
34
|
-
marginRatio:
|
|
33
|
+
marginRatioHealth: MarginRatioHealth;
|
|
34
|
+
marginRatio: number;
|
|
35
35
|
};
|
|
36
36
|
export type SimulateDepositParams = {
|
|
37
37
|
signer: Signer | JsonRpcSigner;
|
|
38
|
-
marginAccountId:
|
|
38
|
+
marginAccountId: number;
|
|
39
39
|
tokenAddress: TokenEntity['address'];
|
|
40
40
|
amount: number;
|
|
41
41
|
};
|
|
42
42
|
export type SimulateWithdrawResult = {
|
|
43
43
|
bridgeGasFees: number;
|
|
44
|
-
marginRatioHealth:
|
|
45
|
-
marginRatio:
|
|
44
|
+
marginRatioHealth: MarginRatioHealth;
|
|
45
|
+
marginRatio: number;
|
|
46
46
|
};
|
|
47
47
|
export type SimulateWithdrawParams = {
|
|
48
48
|
signer: Signer | JsonRpcSigner;
|
|
49
|
-
marginAccountId:
|
|
49
|
+
marginAccountId: number;
|
|
50
50
|
tokenAddress: TokenEntity['address'];
|
|
51
51
|
amount: number;
|
|
52
52
|
};
|
|
53
53
|
export type TransferMarginBetweenAccountsParams = {
|
|
54
54
|
signer: Signer | JsonRpcSigner;
|
|
55
55
|
owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;
|
|
56
|
-
fromMarginAccountId:
|
|
57
|
-
toMarginAccountId:
|
|
56
|
+
fromMarginAccountId: number;
|
|
57
|
+
toMarginAccountId: number;
|
|
58
58
|
tokenAddress: TokenEntity['address'];
|
|
59
59
|
amount: number;
|
|
60
60
|
};
|
|
@@ -66,7 +66,7 @@ export type WithdrawMAAndBridgeParams = {
|
|
|
66
66
|
signer: Signer | JsonRpcSigner;
|
|
67
67
|
moneyInOutChainId: MoneyInOutChainId;
|
|
68
68
|
owner: Pick<OwnerMetadataEntity, 'address' | 'coreSigNonce'>;
|
|
69
|
-
marginAccountId:
|
|
69
|
+
marginAccountId: number;
|
|
70
70
|
tokenAddress: TokenEntity['address'];
|
|
71
71
|
amount: number;
|
|
72
72
|
receiverAddress?: Lowercase<string>;
|
|
@@ -87,7 +87,7 @@ export type BridgeAndDepositNewMAResult = {
|
|
|
87
87
|
};
|
|
88
88
|
export type BridgeAndDepositExistingMAParams = {
|
|
89
89
|
signer: Signer | JsonRpcSigner;
|
|
90
|
-
marginAccountId:
|
|
90
|
+
marginAccountId: number;
|
|
91
91
|
tokenAddress: TokenEntity['address'];
|
|
92
92
|
amount: number;
|
|
93
93
|
socketDepositFees: SocketDepositFees['fees'];
|
|
@@ -98,13 +98,13 @@ export type BridgeAndDepositExistingMAResult = {
|
|
|
98
98
|
};
|
|
99
99
|
export type SimulateTransferMarginBetweenAccountsResult = {
|
|
100
100
|
bridgeGasFees: number;
|
|
101
|
-
marginRatioHealth:
|
|
102
|
-
marginRatio:
|
|
101
|
+
marginRatioHealth: MarginRatioHealth;
|
|
102
|
+
marginRatio: number;
|
|
103
103
|
};
|
|
104
104
|
export type SimulateTransferMarginBetweenAccountsParams = {
|
|
105
105
|
signer: Signer | JsonRpcSigner;
|
|
106
|
-
fromMarginAccountId:
|
|
107
|
-
toMarginAccountId:
|
|
106
|
+
fromMarginAccountId: number;
|
|
107
|
+
toMarginAccountId: number;
|
|
108
108
|
tokenAddress: TokenEntity['address'];
|
|
109
109
|
amount: number;
|
|
110
110
|
};
|
|
@@ -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,
|
|
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,iBAAiB,EACjB,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;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,GAAG,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,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC7C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAGF,MAAM,MAAM,2CAA2C,GAAG;IACxD,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signer, JsonRpcSigner } from 'ethers';
|
|
2
|
-
import { CoreCommandsEIP712SignatureAndPayload,
|
|
2
|
+
import { CoreCommandsEIP712SignatureAndPayload, MarketEntity, MethodParameters, OrdersGatewayOrderType, OwnerMetadataEntity, PositionEntity, TransactionExecutionOutput } from '@reyaxyz/common';
|
|
3
3
|
export type MarketParams = {
|
|
4
4
|
id: MarketEntity['id'];
|
|
5
5
|
exchangeId: MarketEntity['orderInfo']['exchangeId'];
|
|
@@ -9,14 +9,14 @@ export type MarketParams = {
|
|
|
9
9
|
};
|
|
10
10
|
export type MatchOrderParams = {
|
|
11
11
|
signer: Signer | JsonRpcSigner;
|
|
12
|
-
marginAccountId:
|
|
12
|
+
marginAccountId: number;
|
|
13
13
|
amountInBase: number;
|
|
14
14
|
market: MarketParams;
|
|
15
15
|
tradeSource?: 'reya' | 'rage' | 'other';
|
|
16
16
|
};
|
|
17
17
|
export type CloseOrderParams = {
|
|
18
18
|
signer: Signer | JsonRpcSigner;
|
|
19
|
-
marginAccountId:
|
|
19
|
+
marginAccountId: number;
|
|
20
20
|
orderBase: PositionEntity['base'];
|
|
21
21
|
market: MarketParams;
|
|
22
22
|
} & ({
|
|
@@ -31,7 +31,7 @@ export type MatchOrderResult = {
|
|
|
31
31
|
xpBoost: number;
|
|
32
32
|
lotteryXpBoost: number;
|
|
33
33
|
isNftWon: boolean;
|
|
34
|
-
marginAccountId:
|
|
34
|
+
marginAccountId: number;
|
|
35
35
|
xpEarned: number;
|
|
36
36
|
executionPrice: number;
|
|
37
37
|
base: number;
|
|
@@ -45,7 +45,7 @@ export type CloseOrderResult = {
|
|
|
45
45
|
xpBoost: number;
|
|
46
46
|
lotteryXpBoost: number;
|
|
47
47
|
isNftWon: boolean;
|
|
48
|
-
marginAccountId:
|
|
48
|
+
marginAccountId: number;
|
|
49
49
|
xpEarned: number;
|
|
50
50
|
executionPrice: number;
|
|
51
51
|
base: number;
|
|
@@ -53,7 +53,7 @@ export type CloseOrderResult = {
|
|
|
53
53
|
export type MethodParametersAndEIP712Payload = MethodParameters & CoreCommandsEIP712SignatureAndPayload;
|
|
54
54
|
export type OrdersGatewayMarketOrderParams = {
|
|
55
55
|
signer: Signer | JsonRpcSigner;
|
|
56
|
-
marginAccountId:
|
|
56
|
+
marginAccountId: number;
|
|
57
57
|
marketId: MarketEntity['id'];
|
|
58
58
|
counterpartyAccountIds: MarketEntity['orderInfo']['counterpartyAccountIds'];
|
|
59
59
|
exchangeId: MarketEntity['orderInfo']['exchangeId'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/orders/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,qCAAqC,EACrC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/orders/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,CAAC;IACpD,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,wBAAwB,CAAC,CAAC;IAC5E,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACnD,WAAW,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,CACA;IACE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C;IAC7B,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,wBAAwB,CAAC,CAAC;IAC5E,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,CAAC;IACpD,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,IAAI,EACA,sBAAsB,CAAC,YAAY,GACnC,sBAAsB,CAAC,wBAAwB,CAAC;KACrD,CAAC;IACF,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACzC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.138.0",
|
|
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.
|
|
32
|
+
"@reyaxyz/common": "0.312.0",
|
|
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": "
|
|
38
|
+
"gitHead": "9466fb19baa2841b90d1d99f5eb4ca44bf457e73"
|
|
39
39
|
}
|
package/src/services/lp/types.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { JsonRpcSigner, Signer } from 'ethers';
|
|
|
2
2
|
import {
|
|
3
3
|
LpPoolEntity,
|
|
4
4
|
LpWithdrawBalanceEntity,
|
|
5
|
-
MarginAccountEntity,
|
|
6
5
|
MoneyInOutChainId,
|
|
7
6
|
OwnerMetadataEntity,
|
|
8
7
|
ReyaChainId,
|
|
@@ -14,7 +13,7 @@ import {
|
|
|
14
13
|
export type TransferStakeToMarginAccountParams = {
|
|
15
14
|
signer: Signer | JsonRpcSigner;
|
|
16
15
|
owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;
|
|
17
|
-
marginAccountId:
|
|
16
|
+
marginAccountId: number;
|
|
18
17
|
pool: Pick<LpPoolEntity, 'id'>;
|
|
19
18
|
srusdAmount: number;
|
|
20
19
|
};
|
|
@@ -27,7 +26,7 @@ export type TransferStakeToMarginAccountResult = {
|
|
|
27
26
|
export type UnstakeFromMarginAccountParams = {
|
|
28
27
|
signer: Signer | JsonRpcSigner;
|
|
29
28
|
owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;
|
|
30
|
-
marginAccountId:
|
|
29
|
+
marginAccountId: number;
|
|
31
30
|
pool: Pick<LpPoolEntity, 'id'>;
|
|
32
31
|
srusdAmount: number;
|
|
33
32
|
};
|
|
@@ -40,7 +39,7 @@ export type UnstakeFromMarginAccountResult = {
|
|
|
40
39
|
export type StakeFromMarginAccountParams = {
|
|
41
40
|
signer: Signer | JsonRpcSigner;
|
|
42
41
|
owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;
|
|
43
|
-
marginAccountId:
|
|
42
|
+
marginAccountId: number;
|
|
44
43
|
pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;
|
|
45
44
|
amount: number;
|
|
46
45
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JsonRpcSigner, Signer } from 'ethers';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
MarginRatioHealth,
|
|
4
4
|
MoneyInOutChainId,
|
|
5
5
|
OwnerMetadataEntity,
|
|
6
6
|
SocketDepositFees,
|
|
@@ -15,13 +15,13 @@ export type CreateAccountParams = {
|
|
|
15
15
|
|
|
16
16
|
export type CreateAccountResult = {
|
|
17
17
|
transactionHash: string | null;
|
|
18
|
-
accountId:
|
|
18
|
+
accountId: number | null;
|
|
19
19
|
coreSigNonce: OwnerMetadataEntity['coreSigNonce'] | null;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export type DepositParams = {
|
|
23
23
|
signer: Signer | JsonRpcSigner;
|
|
24
|
-
marginAccountId:
|
|
24
|
+
marginAccountId: number;
|
|
25
25
|
tokenAddress: TokenEntity['address'];
|
|
26
26
|
amount: number;
|
|
27
27
|
};
|
|
@@ -32,7 +32,7 @@ export type DepositResult = {
|
|
|
32
32
|
|
|
33
33
|
export type WithdrawParams = {
|
|
34
34
|
signer: Signer | JsonRpcSigner;
|
|
35
|
-
marginAccountId:
|
|
35
|
+
marginAccountId: number;
|
|
36
36
|
tokenAddress: TokenEntity['address'];
|
|
37
37
|
amount: number;
|
|
38
38
|
};
|
|
@@ -43,14 +43,14 @@ export type WithdrawResult = {
|
|
|
43
43
|
|
|
44
44
|
export type SimulateDepositResult = {
|
|
45
45
|
bridgeGasFees: number;
|
|
46
|
-
marginRatioHealth:
|
|
47
|
-
marginRatio:
|
|
46
|
+
marginRatioHealth: MarginRatioHealth;
|
|
47
|
+
marginRatio: number;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// TODO: Milan reevaluate these params
|
|
51
51
|
export type SimulateDepositParams = {
|
|
52
52
|
signer: Signer | JsonRpcSigner;
|
|
53
|
-
marginAccountId:
|
|
53
|
+
marginAccountId: number;
|
|
54
54
|
tokenAddress: TokenEntity['address'];
|
|
55
55
|
amount: number;
|
|
56
56
|
};
|
|
@@ -58,14 +58,14 @@ export type SimulateDepositParams = {
|
|
|
58
58
|
export type SimulateWithdrawResult = {
|
|
59
59
|
bridgeGasFees: number;
|
|
60
60
|
|
|
61
|
-
marginRatioHealth:
|
|
62
|
-
marginRatio:
|
|
61
|
+
marginRatioHealth: MarginRatioHealth;
|
|
62
|
+
marginRatio: number;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
// TODO: Milan reevaluate these params
|
|
66
66
|
export type SimulateWithdrawParams = {
|
|
67
67
|
signer: Signer | JsonRpcSigner;
|
|
68
|
-
marginAccountId:
|
|
68
|
+
marginAccountId: number;
|
|
69
69
|
tokenAddress: TokenEntity['address'];
|
|
70
70
|
amount: number;
|
|
71
71
|
};
|
|
@@ -73,8 +73,8 @@ export type SimulateWithdrawParams = {
|
|
|
73
73
|
export type TransferMarginBetweenAccountsParams = {
|
|
74
74
|
signer: Signer | JsonRpcSigner;
|
|
75
75
|
owner: Pick<OwnerMetadataEntity, 'coreSigNonce'>;
|
|
76
|
-
fromMarginAccountId:
|
|
77
|
-
toMarginAccountId:
|
|
76
|
+
fromMarginAccountId: number;
|
|
77
|
+
toMarginAccountId: number;
|
|
78
78
|
tokenAddress: TokenEntity['address'];
|
|
79
79
|
amount: number;
|
|
80
80
|
};
|
|
@@ -88,7 +88,7 @@ export type WithdrawMAAndBridgeParams = {
|
|
|
88
88
|
signer: Signer | JsonRpcSigner;
|
|
89
89
|
moneyInOutChainId: MoneyInOutChainId;
|
|
90
90
|
owner: Pick<OwnerMetadataEntity, 'address' | 'coreSigNonce'>;
|
|
91
|
-
marginAccountId:
|
|
91
|
+
marginAccountId: number;
|
|
92
92
|
tokenAddress: TokenEntity['address'];
|
|
93
93
|
amount: number;
|
|
94
94
|
// if not provided it has same value as owner.address
|
|
@@ -114,7 +114,7 @@ export type BridgeAndDepositNewMAResult = {
|
|
|
114
114
|
|
|
115
115
|
export type BridgeAndDepositExistingMAParams = {
|
|
116
116
|
signer: Signer | JsonRpcSigner;
|
|
117
|
-
marginAccountId:
|
|
117
|
+
marginAccountId: number;
|
|
118
118
|
tokenAddress: TokenEntity['address'];
|
|
119
119
|
amount: number;
|
|
120
120
|
socketDepositFees: SocketDepositFees['fees'];
|
|
@@ -127,15 +127,15 @@ export type BridgeAndDepositExistingMAResult = {
|
|
|
127
127
|
|
|
128
128
|
export type SimulateTransferMarginBetweenAccountsResult = {
|
|
129
129
|
bridgeGasFees: number;
|
|
130
|
-
marginRatioHealth:
|
|
131
|
-
marginRatio:
|
|
130
|
+
marginRatioHealth: MarginRatioHealth;
|
|
131
|
+
marginRatio: number;
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
// TODO: Milan reevaluate these params
|
|
135
135
|
export type SimulateTransferMarginBetweenAccountsParams = {
|
|
136
136
|
signer: Signer | JsonRpcSigner;
|
|
137
|
-
fromMarginAccountId:
|
|
138
|
-
toMarginAccountId:
|
|
137
|
+
fromMarginAccountId: number;
|
|
138
|
+
toMarginAccountId: number;
|
|
139
139
|
tokenAddress: TokenEntity['address'];
|
|
140
140
|
amount: number;
|
|
141
141
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Signer, JsonRpcSigner } from 'ethers';
|
|
2
2
|
import {
|
|
3
3
|
CoreCommandsEIP712SignatureAndPayload,
|
|
4
|
-
MarginAccountEntity,
|
|
5
4
|
MarketEntity,
|
|
6
5
|
MethodParameters,
|
|
7
6
|
OrdersGatewayOrderType,
|
|
@@ -20,7 +19,7 @@ export type MarketParams = {
|
|
|
20
19
|
|
|
21
20
|
export type MatchOrderParams = {
|
|
22
21
|
signer: Signer | JsonRpcSigner;
|
|
23
|
-
marginAccountId:
|
|
22
|
+
marginAccountId: number;
|
|
24
23
|
amountInBase: number; // amount in base
|
|
25
24
|
market: MarketParams;
|
|
26
25
|
tradeSource?: 'reya' | 'rage' | 'other';
|
|
@@ -28,7 +27,7 @@ export type MatchOrderParams = {
|
|
|
28
27
|
|
|
29
28
|
export type CloseOrderParams = {
|
|
30
29
|
signer: Signer | JsonRpcSigner;
|
|
31
|
-
marginAccountId:
|
|
30
|
+
marginAccountId: number;
|
|
32
31
|
orderBase: PositionEntity['base'];
|
|
33
32
|
market: MarketParams;
|
|
34
33
|
} & (
|
|
@@ -47,7 +46,7 @@ export type MatchOrderResult = {
|
|
|
47
46
|
xpBoost: number;
|
|
48
47
|
lotteryXpBoost: number;
|
|
49
48
|
isNftWon: boolean;
|
|
50
|
-
marginAccountId:
|
|
49
|
+
marginAccountId: number;
|
|
51
50
|
xpEarned: number;
|
|
52
51
|
executionPrice: number;
|
|
53
52
|
base: number;
|
|
@@ -62,7 +61,7 @@ export type CloseOrderResult = {
|
|
|
62
61
|
xpBoost: number;
|
|
63
62
|
lotteryXpBoost: number;
|
|
64
63
|
isNftWon: boolean;
|
|
65
|
-
marginAccountId:
|
|
64
|
+
marginAccountId: number;
|
|
66
65
|
xpEarned: number;
|
|
67
66
|
executionPrice: number;
|
|
68
67
|
base: number;
|
|
@@ -73,7 +72,7 @@ export type MethodParametersAndEIP712Payload = MethodParameters &
|
|
|
73
72
|
|
|
74
73
|
export type OrdersGatewayMarketOrderParams = {
|
|
75
74
|
signer: Signer | JsonRpcSigner;
|
|
76
|
-
marginAccountId:
|
|
75
|
+
marginAccountId: number;
|
|
77
76
|
marketId: MarketEntity['id'];
|
|
78
77
|
counterpartyAccountIds: MarketEntity['orderInfo']['counterpartyAccountIds'];
|
|
79
78
|
exchangeId: MarketEntity['orderInfo']['exchangeId'];
|