@mysten/deepbook-v3 2.1.4 → 2.3.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/CHANGELOG.md +43 -0
- package/PREDICT.md +17 -5
- package/dist/account.d.mts.map +1 -1
- package/dist/account.mjs +3 -1
- package/dist/account.mjs.map +1 -1
- package/dist/client.d.mts +2 -2
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/deps/sui/vec_map.mjs +37 -0
- package/dist/contracts/deepbook_predict/deps/sui/vec_map.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_cash.mjs +1 -1
- package/dist/contracts/deepbook_predict/expiry_cash.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs +15 -6
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/plp.mjs +53 -31
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_accounting.mjs +7 -7
- package/dist/contracts/deepbook_predict/pool_accounting.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs +1 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.mjs +13 -1
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/registry.mjs +2 -1
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/strike_exposure.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs +13 -1
- package/dist/contracts/deepbook_predict/strike_payout_tree.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs +19 -7
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.d.mts +22 -22
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/deployments/index.d.mts +3 -2
- package/dist/deployments/index.d.mts.map +1 -1
- package/dist/deployments/index.mjs +4 -1
- package/dist/deployments/index.mjs.map +1 -1
- package/dist/deployments/mainnet.d.mts +14 -0
- package/dist/deployments/mainnet.d.mts.map +1 -0
- package/dist/deployments/mainnet.mjs +73 -0
- package/dist/deployments/mainnet.mjs.map +1 -0
- package/dist/deployments/testnet.mjs +23 -23
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/deployments/types.d.mts +1 -1
- package/dist/predict/client.d.mts +25 -4
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +4 -4
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/index.d.mts +2 -0
- package/dist/predict/config/index.d.mts.map +1 -1
- package/dist/predict/config/index.mjs +4 -1
- package/dist/predict/config/index.mjs.map +1 -1
- package/dist/predict/config/mainnet.d.mts +17 -0
- package/dist/predict/config/mainnet.d.mts.map +1 -0
- package/dist/predict/config/mainnet.mjs +26 -0
- package/dist/predict/config/mainnet.mjs.map +1 -0
- package/dist/predict/config/types.d.mts +6 -0
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/index.d.mts +4 -2
- package/dist/predict/index.mjs +3 -1
- package/dist/predict/pricing.d.mts +6 -6
- package/dist/predict/pricing.d.mts.map +1 -1
- package/dist/predict/pricing.mjs +6 -6
- package/dist/predict/pricing.mjs.map +1 -1
- package/dist/predict/reads/balances.mjs.map +1 -1
- package/dist/predict/reads/markets.mjs +1 -1
- package/dist/predict/reads/markets.mjs.map +1 -1
- package/dist/predict/reads/pricing.d.mts +2 -1
- package/dist/predict/reads/pricing.d.mts.map +1 -1
- package/dist/predict/reads/pricing.mjs.map +1 -1
- package/dist/sessions.d.mts.map +1 -1
- package/dist/sessions.mjs +3 -1
- package/dist/sessions.mjs.map +1 -1
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/balanceManager.d.mts.map +1 -1
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbook.d.mts.map +1 -1
- package/dist/transactions/deepbookAdmin.d.mts +4 -4
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginPool.d.mts.map +1 -1
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/dist/transactions/marginTPSL.d.mts +10 -10
- package/dist/transactions/poolProxy.d.mts +8 -8
- package/package.json +3 -3
- package/src/account.ts +3 -1
- package/src/contracts/deepbook_predict/builder_code.ts +3 -3
- package/src/contracts/deepbook_predict/config_events.ts +9 -2
- package/src/contracts/deepbook_predict/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook_predict/expiry_cash.ts +1 -1
- package/src/contracts/deepbook_predict/expiry_market.ts +70 -11
- package/src/contracts/deepbook_predict/market_lifecycle_cap.ts +3 -10
- package/src/contracts/deepbook_predict/market_manager.ts +2 -2
- package/src/contracts/deepbook_predict/order_events.ts +6 -6
- package/src/contracts/deepbook_predict/plp.ts +263 -81
- package/src/contracts/deepbook_predict/pool_accounting.ts +14 -14
- package/src/contracts/deepbook_predict/pool_valuation_cap.ts +69 -0
- package/src/contracts/deepbook_predict/predict_account.ts +1 -1
- package/src/contracts/deepbook_predict/pricing.ts +16 -4
- package/src/contracts/deepbook_predict/protocol_config.ts +202 -7
- package/src/contracts/deepbook_predict/registry.ts +91 -17
- package/src/contracts/deepbook_predict/strike_exposure.ts +1 -1
- package/src/contracts/deepbook_predict/strike_payout_tree.ts +27 -0
- package/src/contracts/deepbook_predict/vault_events.ts +45 -14
- package/src/contracts/propbook/block_scholes_store.ts +8 -42
- package/src/deployments/index.ts +13 -3
- package/src/deployments/mainnet.ts +107 -0
- package/src/deployments/testnet.ts +25 -25
- package/src/deployments/types.ts +1 -1
- package/src/predict/client.ts +45 -15
- package/src/predict/config/index.ts +7 -2
- package/src/predict/config/mainnet.ts +27 -0
- package/src/predict/config/types.ts +7 -1
- package/src/predict/index.ts +5 -0
- package/src/predict/pricing.ts +11 -9
- package/src/predict/reads/balances.ts +1 -1
- package/src/predict/reads/markets.ts +1 -1
- package/src/predict/reads/pricing.ts +2 -1
- package/src/sessions.ts +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions122 from "@mysten/sui/transactions";
|
|
3
3
|
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/marginPool.d.ts
|
|
@@ -16,7 +16,7 @@ declare class MarginPoolContract {
|
|
|
16
16
|
* @description Mint a supplier cap for margin pool
|
|
17
17
|
* @returns A function that takes a Transaction object
|
|
18
18
|
*/
|
|
19
|
-
mintSupplierCap: () => (tx: Transaction) =>
|
|
19
|
+
mintSupplierCap: () => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
20
20
|
/**
|
|
21
21
|
* @description Supply to a margin pool
|
|
22
22
|
* @param {string} coinKey The key to identify the pool
|
|
@@ -33,7 +33,7 @@ declare class MarginPoolContract {
|
|
|
33
33
|
* @param {number} [amountToWithdraw] The amount to withdraw. If omitted, withdraws all.
|
|
34
34
|
* @returns A function that takes a Transaction object
|
|
35
35
|
*/
|
|
36
|
-
withdrawFromMarginPool: (coinKey: string, supplierCap: TransactionObjectArgument, amountToWithdraw?: number) => (tx: Transaction) =>
|
|
36
|
+
withdrawFromMarginPool: (coinKey: string, supplierCap: TransactionObjectArgument, amountToWithdraw?: number) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
37
37
|
/**
|
|
38
38
|
* @description Mint a referral for a margin pool
|
|
39
39
|
* @param {string} coinKey The key to identify the pool
|
|
@@ -46,94 +46,94 @@ declare class MarginPoolContract {
|
|
|
46
46
|
* @param {string} referralId The ID of the referral
|
|
47
47
|
* @returns A function that takes a Transaction object
|
|
48
48
|
*/
|
|
49
|
-
withdrawReferralFees: (coinKey: string, referralId: string) => (tx: Transaction) =>
|
|
49
|
+
withdrawReferralFees: (coinKey: string, referralId: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
50
50
|
/**
|
|
51
51
|
* @description Get the margin pool ID
|
|
52
52
|
* @param {string} coinKey The key to identify the pool
|
|
53
53
|
* @returns A function that takes a Transaction object
|
|
54
54
|
*/
|
|
55
|
-
getId: (coinKey: string) => (tx: Transaction) =>
|
|
55
|
+
getId: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
56
56
|
/**
|
|
57
57
|
* @description Check if a deepbook pool is allowed for borrowing
|
|
58
58
|
* @param {string} coinKey The key to identify the margin pool
|
|
59
59
|
* @param {string} deepbookPoolId The ID of the deepbook pool
|
|
60
60
|
* @returns A function that takes a Transaction object
|
|
61
61
|
*/
|
|
62
|
-
deepbookPoolAllowed: (coinKey: string, deepbookPoolId: string) => (tx: Transaction) =>
|
|
62
|
+
deepbookPoolAllowed: (coinKey: string, deepbookPoolId: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
63
63
|
/**
|
|
64
64
|
* @description Get the total supply amount
|
|
65
65
|
* @param {string} coinKey The key to identify the pool
|
|
66
66
|
* @returns A function that takes a Transaction object
|
|
67
67
|
*/
|
|
68
|
-
totalSupply: (coinKey: string) => (tx: Transaction) =>
|
|
68
|
+
totalSupply: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
69
69
|
/**
|
|
70
70
|
* @description Get the total supply shares
|
|
71
71
|
* @param {string} coinKey The key to identify the pool
|
|
72
72
|
* @returns A function that takes a Transaction object
|
|
73
73
|
*/
|
|
74
|
-
supplyShares: (coinKey: string) => (tx: Transaction) =>
|
|
74
|
+
supplyShares: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
75
75
|
/**
|
|
76
76
|
* @description Get the total borrow amount
|
|
77
77
|
* @param {string} coinKey The key to identify the pool
|
|
78
78
|
* @returns A function that takes a Transaction object
|
|
79
79
|
*/
|
|
80
|
-
totalBorrow: (coinKey: string) => (tx: Transaction) =>
|
|
80
|
+
totalBorrow: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
81
81
|
/**
|
|
82
82
|
* @description Get the total borrow shares
|
|
83
83
|
* @param {string} coinKey The key to identify the pool
|
|
84
84
|
* @returns A function that takes a Transaction object
|
|
85
85
|
*/
|
|
86
|
-
borrowShares: (coinKey: string) => (tx: Transaction) =>
|
|
86
|
+
borrowShares: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
87
87
|
/**
|
|
88
88
|
* @description Get the last update timestamp
|
|
89
89
|
* @param {string} coinKey The key to identify the pool
|
|
90
90
|
* @returns A function that takes a Transaction object
|
|
91
91
|
*/
|
|
92
|
-
lastUpdateTimestamp: (coinKey: string) => (tx: Transaction) =>
|
|
92
|
+
lastUpdateTimestamp: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
93
93
|
/**
|
|
94
94
|
* @description Get the supply cap
|
|
95
95
|
* @param {string} coinKey The key to identify the pool
|
|
96
96
|
* @returns A function that takes a Transaction object
|
|
97
97
|
*/
|
|
98
|
-
supplyCap: (coinKey: string) => (tx: Transaction) =>
|
|
98
|
+
supplyCap: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
99
99
|
/**
|
|
100
100
|
* @description Get the max utilization rate
|
|
101
101
|
* @param {string} coinKey The key to identify the pool
|
|
102
102
|
* @returns A function that takes a Transaction object
|
|
103
103
|
*/
|
|
104
|
-
maxUtilizationRate: (coinKey: string) => (tx: Transaction) =>
|
|
104
|
+
maxUtilizationRate: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
105
105
|
/**
|
|
106
106
|
* @description Get the protocol spread
|
|
107
107
|
* @param {string} coinKey The key to identify the pool
|
|
108
108
|
* @returns A function that takes a Transaction object
|
|
109
109
|
*/
|
|
110
|
-
protocolSpread: (coinKey: string) => (tx: Transaction) =>
|
|
110
|
+
protocolSpread: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
111
111
|
/**
|
|
112
112
|
* @description Get the minimum borrow amount
|
|
113
113
|
* @param {string} coinKey The key to identify the pool
|
|
114
114
|
* @returns A function that takes a Transaction object
|
|
115
115
|
*/
|
|
116
|
-
minBorrow: (coinKey: string) => (tx: Transaction) =>
|
|
116
|
+
minBorrow: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
117
117
|
/**
|
|
118
118
|
* @description Get the current interest rate
|
|
119
119
|
* @param {string} coinKey The key to identify the pool
|
|
120
120
|
* @returns A function that takes a Transaction object
|
|
121
121
|
*/
|
|
122
|
-
interestRate: (coinKey: string) => (tx: Transaction) =>
|
|
122
|
+
interestRate: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
123
123
|
/**
|
|
124
124
|
* @description Get user supply shares for a supplier cap
|
|
125
125
|
* @param {string} coinKey The key to identify the pool
|
|
126
126
|
* @param {string} supplierCapId The ID of the supplier cap
|
|
127
127
|
* @returns A function that takes a Transaction object
|
|
128
128
|
*/
|
|
129
|
-
userSupplyShares: (coinKey: string, supplierCapId: string) => (tx: Transaction) =>
|
|
129
|
+
userSupplyShares: (coinKey: string, supplierCapId: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
130
130
|
/**
|
|
131
131
|
* @description Get user supply amount for a supplier cap
|
|
132
132
|
* @param {string} coinKey The key to identify the pool
|
|
133
133
|
* @param {string} supplierCapId The ID of the supplier cap
|
|
134
134
|
* @returns A function that takes a Transaction object
|
|
135
135
|
*/
|
|
136
|
-
userSupplyAmount: (coinKey: string, supplierCapId: string) => (tx: Transaction) =>
|
|
136
|
+
userSupplyAmount: (coinKey: string, supplierCapId: string) => (tx: Transaction) => _mysten_sui_transactions122.TransactionResult;
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
export { MarginPoolContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginPool.d.mts","names":[],"sources":["../../src/transactions/marginPool.ts"],"mappings":";;;;;;;;cAYa,kBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EA4BL;;;;EApBf,eAAA,SAAyB,EAAA,EAAI,WAAA,KAAW,
|
|
1
|
+
{"version":3,"file":"marginPool.d.mts","names":[],"sources":["../../src/transactions/marginPool.ts"],"mappings":";;;;;;;;cAYa,kBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EA4BL;;;;EApBf,eAAA,SAAyB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAyFO;;;;;;;;EAxE/C,kBAAA,GAEE,OAAA,UACA,WAAA,EAAa,yBAAA,EACb,eAAA,UACA,UAAA,eAEA,EAAA,EAAI,WAAA;EAyJmC;;;;;;;EAlHzC,sBAAA,GACE,OAAA,UAAiB,WAAA,EAAa,yBAAA,EAA2B,gBAAA,eACzD,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAgLqB;;;;;EAxJtC,kBAAA,GAAsB,OAAA,cAAqB,EAAA,EAAI,WAAA;EAwMT;;;;;;EAvLtC,oBAAA,GAAwB,OAAA,UAAiB,UAAA,cAAwB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAyOD;;;;;EAnN/E,KAAA,GAAS,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAxIjC;;;;;;EAyJZ,mBAAA,GAAuB,OAAA,UAAiB,cAAA,cAA4B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EA7HpE;;;;;EA6If,WAAA,GAAe,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAlGnD;;;;;EAkHA,YAAA,GAAgB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAhHlD;;;;;EAgIF,WAAA,GAAe,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAvFnD;;;;;EAuGA,YAAA,GAAgB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAjFpD;;;;;EAiGA,mBAAA,GAAuB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAhFpC;;;;;EAgGvB,SAAA,GAAa,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAhFlC;;;;;EAgGf,kBAAA,GAAsB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAhFjB;;;;;EAgGzC,cAAA,GAAkB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAhFlB;;;;;EAgGpC,SAAA,GAAa,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAhFG;;;;;EAgGpD,YAAA,GAAgB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAhEpD;;;;;;EAiFA,gBAAA,GAAoB,OAAA,UAAiB,aAAA,cAA2B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAjEhC;;;;;;EAkF/C,gBAAA,GAAoB,OAAA,UAAiB,aAAA,cAA2B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions155 from "@mysten/sui/transactions";
|
|
3
3
|
import { Transaction } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/marginRegistry.d.ts
|
|
@@ -17,90 +17,90 @@ declare class MarginRegistryContract {
|
|
|
17
17
|
* @param {string} poolKey The key to identify the pool
|
|
18
18
|
* @returns A function that takes a Transaction object
|
|
19
19
|
*/
|
|
20
|
-
poolEnabled: (poolKey: string) => (tx: Transaction) =>
|
|
20
|
+
poolEnabled: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
21
21
|
/**
|
|
22
22
|
* @description Get the margin pool ID for a given asset
|
|
23
23
|
* @param {string} coinKey The key to identify the coin
|
|
24
24
|
* @returns A function that takes a Transaction object
|
|
25
25
|
*/
|
|
26
|
-
getMarginPoolId: (coinKey: string) => (tx: Transaction) =>
|
|
26
|
+
getMarginPoolId: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
27
27
|
/**
|
|
28
28
|
* @description Get the margin pool IDs (base and quote) for a deepbook pool
|
|
29
29
|
* @param {string} poolKey The key to identify the pool
|
|
30
30
|
* @returns A function that takes a Transaction object
|
|
31
31
|
*/
|
|
32
|
-
getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) =>
|
|
32
|
+
getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
33
33
|
/**
|
|
34
34
|
* @description Get the margin manager IDs for a given owner
|
|
35
35
|
* @param {string} owner The owner address
|
|
36
36
|
* @returns A function that takes a Transaction object
|
|
37
37
|
*/
|
|
38
|
-
getMarginManagerIds: (owner: string) => (tx: Transaction) =>
|
|
38
|
+
getMarginManagerIds: (owner: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
39
39
|
/**
|
|
40
40
|
* @description Get the base margin pool ID for a deepbook pool
|
|
41
41
|
* @param {string} poolKey The key to identify the pool
|
|
42
42
|
* @returns A function that takes a Transaction object
|
|
43
43
|
*/
|
|
44
|
-
baseMarginPoolId: (poolKey: string) => (tx: Transaction) =>
|
|
44
|
+
baseMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
45
45
|
/**
|
|
46
46
|
* @description Get the quote margin pool ID for a deepbook pool
|
|
47
47
|
* @param {string} poolKey The key to identify the pool
|
|
48
48
|
* @returns A function that takes a Transaction object
|
|
49
49
|
*/
|
|
50
|
-
quoteMarginPoolId: (poolKey: string) => (tx: Transaction) =>
|
|
50
|
+
quoteMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
51
51
|
/**
|
|
52
52
|
* @description Get the minimum withdraw risk ratio for a deepbook pool
|
|
53
53
|
* @param {string} poolKey The key to identify the pool
|
|
54
54
|
* @returns A function that takes a Transaction object
|
|
55
55
|
*/
|
|
56
|
-
minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
56
|
+
minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
57
57
|
/**
|
|
58
58
|
* @description Get the minimum borrow risk ratio for a deepbook pool
|
|
59
59
|
* @param {string} poolKey The key to identify the pool
|
|
60
60
|
* @returns A function that takes a Transaction object
|
|
61
61
|
*/
|
|
62
|
-
minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
62
|
+
minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
63
63
|
/**
|
|
64
64
|
* @description Get the minimum risk ratio required to open a new position on
|
|
65
65
|
* a deepbook pool. Distinct from `minBorrowRiskRatio`, which gates borrowing.
|
|
66
66
|
* @param {string} poolKey The key to identify the pool
|
|
67
67
|
* @returns A function that takes a Transaction object
|
|
68
68
|
*/
|
|
69
|
-
minOpenRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
69
|
+
minOpenRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
70
70
|
/**
|
|
71
71
|
* @description Get the liquidation risk ratio for a deepbook pool
|
|
72
72
|
* @param {string} poolKey The key to identify the pool
|
|
73
73
|
* @returns A function that takes a Transaction object
|
|
74
74
|
*/
|
|
75
|
-
liquidationRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
75
|
+
liquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
76
76
|
/**
|
|
77
77
|
* @description Get the target liquidation risk ratio for a deepbook pool
|
|
78
78
|
* @param {string} poolKey The key to identify the pool
|
|
79
79
|
* @returns A function that takes a Transaction object
|
|
80
80
|
*/
|
|
81
|
-
targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
81
|
+
targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
82
82
|
/**
|
|
83
83
|
* @description Get the user liquidation reward for a deepbook pool
|
|
84
84
|
* @param {string} poolKey The key to identify the pool
|
|
85
85
|
* @returns A function that takes a Transaction object
|
|
86
86
|
*/
|
|
87
|
-
userLiquidationReward: (poolKey: string) => (tx: Transaction) =>
|
|
87
|
+
userLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
88
88
|
/**
|
|
89
89
|
* @description Get the pool liquidation reward for a deepbook pool
|
|
90
90
|
* @param {string} poolKey The key to identify the pool
|
|
91
91
|
* @returns A function that takes a Transaction object
|
|
92
92
|
*/
|
|
93
|
-
poolLiquidationReward: (poolKey: string) => (tx: Transaction) =>
|
|
93
|
+
poolLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
94
94
|
/**
|
|
95
95
|
* @description Get all allowed maintainer cap IDs
|
|
96
96
|
* @returns A function that takes a Transaction object
|
|
97
97
|
*/
|
|
98
|
-
allowedMaintainers: () => (tx: Transaction) =>
|
|
98
|
+
allowedMaintainers: () => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
99
99
|
/**
|
|
100
100
|
* @description Get all allowed pause cap IDs
|
|
101
101
|
* @returns A function that takes a Transaction object
|
|
102
102
|
*/
|
|
103
|
-
allowedPauseCaps: () => (tx: Transaction) =>
|
|
103
|
+
allowedPauseCaps: () => (tx: Transaction) => _mysten_sui_transactions155.TransactionResult;
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
export { MarginRegistryContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AddConditionalOrderParams, PendingLimitOrderParams, PendingMarketOrderParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions146 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginTPSL.d.ts
|
|
@@ -20,21 +20,21 @@ declare class MarginTPSLContract {
|
|
|
20
20
|
* @param {number} triggerPrice The price at which to trigger the order
|
|
21
21
|
* @returns A function that takes a Transaction object
|
|
22
22
|
*/
|
|
23
|
-
newCondition: (poolKey: string, triggerBelowPrice: boolean, triggerPrice: number | bigint) => (tx: Transaction) =>
|
|
23
|
+
newCondition: (poolKey: string, triggerBelowPrice: boolean, triggerPrice: number | bigint) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
24
24
|
/**
|
|
25
25
|
* @description Create a new pending limit order for use in conditional orders
|
|
26
26
|
* @param {string} poolKey The key to identify the pool
|
|
27
27
|
* @param {PendingLimitOrderParams} params Parameters for the pending limit order
|
|
28
28
|
* @returns A function that takes a Transaction object
|
|
29
29
|
*/
|
|
30
|
-
newPendingLimitOrder: (poolKey: string, params: PendingLimitOrderParams) => (tx: Transaction) =>
|
|
30
|
+
newPendingLimitOrder: (poolKey: string, params: PendingLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
31
31
|
/**
|
|
32
32
|
* @description Create a new pending market order for use in conditional orders
|
|
33
33
|
* @param {string} poolKey The key to identify the pool
|
|
34
34
|
* @param {PendingMarketOrderParams} params Parameters for the pending market order
|
|
35
35
|
* @returns A function that takes a Transaction object
|
|
36
36
|
*/
|
|
37
|
-
newPendingMarketOrder: (poolKey: string, params: PendingMarketOrderParams) => (tx: Transaction) =>
|
|
37
|
+
newPendingMarketOrder: (poolKey: string, params: PendingMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
38
38
|
/**
|
|
39
39
|
* @description Add a conditional order (take profit or stop loss)
|
|
40
40
|
* @param {AddConditionalOrderParams} params Parameters for adding the conditional order
|
|
@@ -65,7 +65,7 @@ declare class MarginTPSLContract {
|
|
|
65
65
|
* @param {number} maxOrdersToExecute Maximum number of orders to execute in this call
|
|
66
66
|
* @returns A function that takes a Transaction object
|
|
67
67
|
*/
|
|
68
|
-
executeConditionalOrders: (managerAddress: string, poolKey: string, maxOrdersToExecute: number) => (tx: Transaction) =>
|
|
68
|
+
executeConditionalOrders: (managerAddress: string, poolKey: string, maxOrdersToExecute: number) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
69
69
|
/**
|
|
70
70
|
* @description Execute conditional orders, deleveraging on each market-type
|
|
71
71
|
* fill. Permissionless, with the same trigger and cancellation handling as
|
|
@@ -83,14 +83,14 @@ declare class MarginTPSLContract {
|
|
|
83
83
|
* @param {number} maxOrdersToExecute Maximum number of orders to execute in this call
|
|
84
84
|
* @returns A function that takes a Transaction object
|
|
85
85
|
*/
|
|
86
|
-
executeConditionalOrdersV3: (managerAddress: string, poolKey: string, maxOrdersToExecute: number) => (tx: Transaction) =>
|
|
86
|
+
executeConditionalOrdersV3: (managerAddress: string, poolKey: string, maxOrdersToExecute: number) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
87
87
|
/**
|
|
88
88
|
* @description Get all conditional order IDs for a margin manager
|
|
89
89
|
* @param {string} poolKey The key to identify the pool
|
|
90
90
|
* @param {string} marginManagerId The ID of the margin manager
|
|
91
91
|
* @returns A function that takes a Transaction object
|
|
92
92
|
*/
|
|
93
|
-
conditionalOrderIds: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
93
|
+
conditionalOrderIds: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
94
94
|
/**
|
|
95
95
|
* @description Get a specific conditional order by ID
|
|
96
96
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -98,7 +98,7 @@ declare class MarginTPSLContract {
|
|
|
98
98
|
* @param {string} conditionalOrderId The ID of the conditional order
|
|
99
99
|
* @returns A function that takes a Transaction object
|
|
100
100
|
*/
|
|
101
|
-
conditionalOrder: (poolKey: string, marginManagerId: string, conditionalOrderId: string) => (tx: Transaction) =>
|
|
101
|
+
conditionalOrder: (poolKey: string, marginManagerId: string, conditionalOrderId: string) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
102
102
|
/**
|
|
103
103
|
* @description Get the lowest trigger price for trigger_above orders
|
|
104
104
|
* Returns constants::max_u64() if there are no trigger_above orders
|
|
@@ -106,7 +106,7 @@ declare class MarginTPSLContract {
|
|
|
106
106
|
* @param {string} marginManagerId The ID of the margin manager
|
|
107
107
|
* @returns A function that takes a Transaction object
|
|
108
108
|
*/
|
|
109
|
-
lowestTriggerAbovePrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
109
|
+
lowestTriggerAbovePrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
110
110
|
/**
|
|
111
111
|
* @description Get the highest trigger price for trigger_below orders
|
|
112
112
|
* Returns 0 if there are no trigger_below orders
|
|
@@ -114,7 +114,7 @@ declare class MarginTPSLContract {
|
|
|
114
114
|
* @param {string} marginManagerId The ID of the margin manager
|
|
115
115
|
* @returns A function that takes a Transaction object
|
|
116
116
|
*/
|
|
117
|
-
highestTriggerBelowPrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
117
|
+
highestTriggerBelowPrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions146.TransactionResult;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
export { MarginTPSLContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarginProposalParams, PlaceMarginLimitOrderParams, PlaceMarginMarketOrderParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions139 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/poolProxy.d.ts
|
|
@@ -20,7 +20,7 @@ declare class PoolProxyContract {
|
|
|
20
20
|
* @param {PlaceMarginLimitOrderParams} params Parameters for placing a limit order
|
|
21
21
|
* @returns A function that takes a Transaction object
|
|
22
22
|
*/
|
|
23
|
-
placeLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) =>
|
|
23
|
+
placeLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions139.TransactionResult;
|
|
24
24
|
/**
|
|
25
25
|
* @description Place a market order. Enforces a post-trade `risk_ratio >=
|
|
26
26
|
* min_borrow_risk_ratio` invariant on the manager (skipped when the manager
|
|
@@ -28,7 +28,7 @@ declare class PoolProxyContract {
|
|
|
28
28
|
* @param {PlaceMarginMarketOrderParams} params Parameters for placing a market order
|
|
29
29
|
* @returns A function that takes a Transaction object
|
|
30
30
|
*/
|
|
31
|
-
placeMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) =>
|
|
31
|
+
placeMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions139.TransactionResult;
|
|
32
32
|
/**
|
|
33
33
|
* @description Place a reduce only limit order. Requires the manager to have
|
|
34
34
|
* debt on the relevant side; enforces a monotonic `risk_ratio_after >=
|
|
@@ -37,7 +37,7 @@ declare class PoolProxyContract {
|
|
|
37
37
|
* @param {PlaceMarginLimitOrderParams} params Parameters for placing a reduce only limit order
|
|
38
38
|
* @returns A function that takes a Transaction object
|
|
39
39
|
*/
|
|
40
|
-
placeReduceOnlyLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) =>
|
|
40
|
+
placeReduceOnlyLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions139.TransactionResult;
|
|
41
41
|
/**
|
|
42
42
|
* @description Place a reduce only market order. Requires the manager to
|
|
43
43
|
* have debt on the relevant side; enforces a monotonic `risk_ratio_after >=
|
|
@@ -46,7 +46,7 @@ declare class PoolProxyContract {
|
|
|
46
46
|
* @param {PlaceMarginMarketOrderParams} params Parameters for placing a reduce only market order
|
|
47
47
|
* @returns A function that takes a Transaction object
|
|
48
48
|
*/
|
|
49
|
-
placeReduceOnlyMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) =>
|
|
49
|
+
placeReduceOnlyMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions139.TransactionResult;
|
|
50
50
|
/**
|
|
51
51
|
* @description Place a market order and repay the loan from the fill proceeds.
|
|
52
52
|
* The taker fill settles into the manager's balance, so the proceeds (plus any
|
|
@@ -58,7 +58,7 @@ declare class PoolProxyContract {
|
|
|
58
58
|
* @param {PlaceMarginMarketOrderParams} params Parameters for placing a market order
|
|
59
59
|
* @returns A function that takes a Transaction object
|
|
60
60
|
*/
|
|
61
|
-
placeMarketOrderAndRepayLoan: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) =>
|
|
61
|
+
placeMarketOrderAndRepayLoan: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions139.TransactionResult;
|
|
62
62
|
/**
|
|
63
63
|
* @description Place a reduce only limit order and repay the loan from the
|
|
64
64
|
* fill proceeds. Requires debt on the relevant side (a bid needs base debt; an
|
|
@@ -68,7 +68,7 @@ declare class PoolProxyContract {
|
|
|
68
68
|
* @param {PlaceMarginLimitOrderParams} params Parameters for placing a reduce only limit order
|
|
69
69
|
* @returns A function that takes a Transaction object
|
|
70
70
|
*/
|
|
71
|
-
placeReduceOnlyLimitOrderAndRepayLoan: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) =>
|
|
71
|
+
placeReduceOnlyLimitOrderAndRepayLoan: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions139.TransactionResult;
|
|
72
72
|
/**
|
|
73
73
|
* @description Place a reduce only market order and repay the loan from the
|
|
74
74
|
* fill proceeds. Same reduce-only direction guard as
|
|
@@ -78,7 +78,7 @@ declare class PoolProxyContract {
|
|
|
78
78
|
* @param {PlaceMarginMarketOrderParams} params Parameters for placing a reduce only market order
|
|
79
79
|
* @returns A function that takes a Transaction object
|
|
80
80
|
*/
|
|
81
|
-
placeReduceOnlyMarketOrderAndRepayLoan: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) =>
|
|
81
|
+
placeReduceOnlyMarketOrderAndRepayLoan: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions139.TransactionResult;
|
|
82
82
|
/**
|
|
83
83
|
* @description Modify an existing order
|
|
84
84
|
* @param {string} marginManagerKey The key to identify the MarginManager
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@mysten/deepbook-v3",
|
|
3
3
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
4
4
|
"description": "Sui Deepbook SDK",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.3.0",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"ts-retry-promise": "^0.8.1",
|
|
62
62
|
"typescript": "^7.0.2",
|
|
63
63
|
"vite": "^8.2.1",
|
|
64
|
-
"vitest": "^4.1.
|
|
64
|
+
"vitest": "^4.1.11",
|
|
65
65
|
"wait-on": "^9.1.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@mysten/sui": "^2.
|
|
68
|
+
"@mysten/sui": "^2.30.0"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
package/src/account.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { deriveObjectID } from '@mysten/sui/utils';
|
|
|
11
11
|
import * as account from './contracts/account/account.js';
|
|
12
12
|
import * as accountRegistry from './contracts/account/account_registry.js';
|
|
13
13
|
import type { AccountConfig as GeneratedAccountConfig } from './contracts/account/config-arguments.js';
|
|
14
|
+
import { MAINNET_ACCOUNT } from './deployments/mainnet.js';
|
|
14
15
|
import { TESTNET_ACCOUNT } from './deployments/testnet.js';
|
|
15
16
|
import type { NetworkArg } from './deployments/index.js';
|
|
16
17
|
|
|
@@ -53,9 +54,10 @@ export interface AccountConfig extends GeneratedAccountConfig {
|
|
|
53
54
|
*/
|
|
54
55
|
export function getAccountConfig(network: NetworkArg): AccountConfig {
|
|
55
56
|
if (network === 'testnet') return TESTNET_ACCOUNT;
|
|
57
|
+
if (network === 'mainnet') return MAINNET_ACCOUNT;
|
|
56
58
|
throw new Error(
|
|
57
59
|
`@mysten/deepbook-v3/account: no account deployment recorded for network '${network}'. ` +
|
|
58
|
-
'The account primitive is testnet
|
|
60
|
+
'The account primitive is recorded for testnet and mainnet; for your own deployment pass ' +
|
|
59
61
|
'`{ accountPackageId, accountRegistry }` to AccountContract directly.',
|
|
60
62
|
);
|
|
61
63
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**************************************************************/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Owns deterministic builder referral codes and the
|
|
6
|
+
* Owns deterministic builder referral codes and the USDC fees delivered to their
|
|
7
7
|
* object addresses through the funds accumulator. Codes are derived per owner and
|
|
8
8
|
* index, and only the immutable owner may withdraw accumulated fees.
|
|
9
9
|
*/
|
|
@@ -112,7 +112,7 @@ export interface ClaimableBuilderFeesOptions {
|
|
|
112
112
|
predictPackageId?: string;
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
/** Return visible
|
|
115
|
+
/** Return visible USDC builder fees for SDK and devInspect reads. */
|
|
116
116
|
export function claimableBuilderFees(options: ClaimableBuilderFeesOptions) {
|
|
117
117
|
const packageAddress =
|
|
118
118
|
options.package ?? options.config?.predictPackageId ?? '@local-pkg/deepbook_predict';
|
|
@@ -137,7 +137,7 @@ export interface ClaimAllBuilderFeesOptions {
|
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
|
-
* Claims all settled
|
|
140
|
+
* Claims all settled USDC builder fees for the immutable owner; an empty
|
|
141
141
|
* accumulator returns a zero coin.
|
|
142
142
|
*/
|
|
143
143
|
export function claimAllBuilderFees(options: ClaimAllBuilderFeesOptions) {
|
|
@@ -50,6 +50,13 @@ export const PlpFeeRatesUpdated = new MoveStruct({
|
|
|
50
50
|
onchain_timestamp_ms: U64,
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
|
+
export const NoTradeWindowUpdated = new MoveStruct({
|
|
54
|
+
name: `${$moduleName}::NoTradeWindowUpdated`,
|
|
55
|
+
fields: {
|
|
56
|
+
no_trade_window_ms: U64,
|
|
57
|
+
onchain_timestamp_ms: U64,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
53
60
|
export const TradingPausedUpdated = new MoveStruct({
|
|
54
61
|
name: `${$moduleName}::TradingPausedUpdated`,
|
|
55
62
|
fields: {
|
|
@@ -79,9 +86,9 @@ export const MarketCreated = new MoveStruct({
|
|
|
79
86
|
tick_size: U64,
|
|
80
87
|
/** Coarser raw-price step that new finite mint boundaries must align to. */
|
|
81
88
|
admission_tick_size: U64,
|
|
82
|
-
/**
|
|
89
|
+
/** USDC pool allocation cap snapshotted for this expiry. */
|
|
83
90
|
max_expiry_allocation: U64,
|
|
84
|
-
/** Minimum
|
|
91
|
+
/** Minimum USDC cash target snapshotted for this expiry. */
|
|
85
92
|
initial_expiry_cash: U64,
|
|
86
93
|
backing_buffer_lambda: U64,
|
|
87
94
|
base_fee: U64,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType, bcs } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
const $moduleName = '0x2::vec_map';
|
|
7
|
+
/** An entry in the map */
|
|
8
|
+
export function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {
|
|
9
|
+
return new MoveStruct({
|
|
10
|
+
name: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,
|
|
11
|
+
fields: {
|
|
12
|
+
key: typeParameters[0],
|
|
13
|
+
value: typeParameters[1],
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A map data structure backed by a vector. The map is guaranteed not to contain
|
|
19
|
+
* duplicate keys, but entries are _not_ sorted by key--entries are included in
|
|
20
|
+
* insertion order. All operations are O(N) in the size of the map--the intention
|
|
21
|
+
* of this data structure is only to provide the convenience of programming against
|
|
22
|
+
* a map API. Large maps should use handwritten parent/child relationships instead.
|
|
23
|
+
* Maps that need sorted iteration rather than insertion order iteration should
|
|
24
|
+
* also be handwritten.
|
|
25
|
+
*/
|
|
26
|
+
export function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {
|
|
27
|
+
return new MoveStruct({
|
|
28
|
+
name: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,
|
|
29
|
+
fields: {
|
|
30
|
+
contents: bcs.vector(Entry(typeParameters[0], typeParameters[1])),
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**************************************************************/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Expiry-local
|
|
6
|
+
* Expiry-local USDC custody and isolated reserve accounting.
|
|
7
7
|
*
|
|
8
8
|
* This leaf owns cash balance arithmetic and the inventory-impact escrow used only
|
|
9
9
|
* for live-close rebates. It does not decide payment eligibility, pool allocation,
|