@mysten/deepbook-v3 2.9.2 → 2.10.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 +47 -0
- package/README.md +21 -0
- package/dist/account-bindings/account-registry.d.mts +109 -0
- package/dist/account-bindings/account-registry.d.mts.map +1 -0
- package/dist/account-bindings/account-registry.mjs +56 -0
- package/dist/account-bindings/account-registry.mjs.map +1 -0
- package/dist/account-bindings/account.d.mts +176 -0
- package/dist/account-bindings/account.d.mts.map +1 -0
- package/dist/account-bindings/account.mjs +94 -0
- package/dist/account-bindings/account.mjs.map +1 -0
- package/dist/account-bindings/latest.d.mts +12 -0
- package/dist/account-bindings/latest.d.mts.map +1 -0
- package/dist/account-bindings/latest.mjs +19 -0
- package/dist/account-bindings/latest.mjs.map +1 -0
- package/dist/account.d.mts +46 -3
- package/dist/account.d.mts.map +1 -1
- package/dist/account.mjs +51 -2
- package/dist/account.mjs.map +1 -1
- package/dist/contracts/account/account.d.mts +25 -97
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account.mjs +43 -35
- package/dist/contracts/account/account.mjs.map +1 -1
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_registry.d.mts +7 -54
- package/dist/contracts/account/account_registry.d.mts.map +1 -1
- package/dist/contracts/account/account_registry.mjs +2 -22
- package/dist/contracts/account/account_registry.mjs.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +4 -4
- package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code.d.mts +60 -13
- package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code.mjs +55 -1
- package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +10 -10
- package/dist/contracts/deepbook_predict/config_events.d.mts +88 -84
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.mjs +8 -0
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +262 -101
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs +320 -41
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/market_manager.d.mts +27 -27
- package/dist/contracts/deepbook_predict/market_manager.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.d.mts +56 -54
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/pause_cap.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/plp.d.mts +74 -74
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/predict_account.d.mts +22 -17
- package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs +12 -6
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.d.mts +67 -67
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +127 -83
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs +59 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/range_codec.d.mts +2 -2
- package/dist/contracts/deepbook_predict/range_codec.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/registry.d.mts +32 -32
- package/dist/contracts/deepbook_predict/registry.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +131 -131
- package/dist/contracts/deepbook_predict_math/lazer_price.d.mts +13 -13
- package/dist/contracts/deepbook_predict_math/math.d.mts +14 -14
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts +30 -30
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs +6 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_orders/desk.d.mts +28 -28
- package/dist/contracts/deepbook_predict_orders/desk.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict_orders/order_queue.d.mts +187 -187
- package/dist/contracts/deepbook_predict_orders/queue.d.mts +240 -62
- package/dist/contracts/deepbook_predict_orders/queue.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict_orders/queue.mjs +306 -41
- package/dist/contracts/deepbook_predict_orders/queue.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_orders/queue_events.d.mts +140 -140
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/sessions.d.mts +271 -31
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.mjs +363 -3
- package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -1
- package/dist/deployments/mainnet.mjs.map +1 -1
- package/dist/deployments/testnet.d.mts.map +1 -1
- package/dist/deployments/testnet.mjs +7 -4
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/predict/bindings/expiry-market.d.mts +57 -7
- package/dist/predict/bindings/expiry-market.d.mts.map +1 -1
- package/dist/predict/bindings/expiry-market.mjs +48 -2
- package/dist/predict/bindings/expiry-market.mjs.map +1 -1
- package/dist/predict/bindings/protocol-config.d.mts +5 -5
- package/dist/predict/bindings/protocol-config.d.mts.map +1 -1
- package/dist/predict/bindings/protocol-config.mjs +4 -1
- package/dist/predict/bindings/protocol-config.mjs.map +1 -1
- package/dist/predict/bindings/queue.d.mts +30 -0
- package/dist/predict/bindings/queue.d.mts.map +1 -0
- package/dist/predict/bindings/queue.mjs +59 -0
- package/dist/predict/bindings/queue.mjs.map +1 -0
- package/dist/predict/bindings/rename.mjs +5 -1
- package/dist/predict/bindings/rename.mjs.map +1 -1
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +11 -5
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/generated.d.mts +1 -1
- package/dist/predict/config/generated.d.mts.map +1 -1
- package/dist/predict/config/generated.mjs +1 -0
- package/dist/predict/config/generated.mjs.map +1 -1
- package/dist/predict/config/mainnet.mjs +3 -1
- package/dist/predict/config/mainnet.mjs.map +1 -1
- package/dist/predict/config/testnet.mjs +3 -1
- package/dist/predict/config/testnet.mjs.map +1 -1
- package/dist/predict/config/types.d.mts +23 -0
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/cost.d.mts +9 -1
- package/dist/predict/cost.d.mts.map +1 -1
- package/dist/predict/cost.mjs.map +1 -1
- package/dist/predict/errors.d.mts.map +1 -1
- package/dist/predict/errors.mjs +6 -2
- package/dist/predict/errors.mjs.map +1 -1
- package/dist/predict/index.d.mts +1 -1
- package/dist/predict/index.mjs +2 -2
- package/dist/predict/queue.d.mts +8 -4
- package/dist/predict/queue.d.mts.map +1 -1
- package/dist/predict/queue.mjs +8 -4
- package/dist/predict/queue.mjs.map +1 -1
- package/dist/predict/reads/balances.mjs +1 -1
- package/dist/predict/reads/queue.d.mts +3 -2
- package/dist/predict/reads/queue.d.mts.map +1 -1
- package/dist/predict/reads/queue.mjs +5 -4
- package/dist/predict/reads/queue.mjs.map +1 -1
- package/dist/predict/tx/authed.mjs +1 -1
- package/dist/predict/tx/common.d.mts.map +1 -1
- package/dist/predict/tx/common.mjs +3 -2
- package/dist/predict/tx/common.mjs.map +1 -1
- package/dist/predict/tx/trade.d.mts.map +1 -1
- package/dist/predict/tx/trade.mjs +3 -2
- package/dist/predict/tx/trade.mjs.map +1 -1
- package/dist/sessions.d.mts +10 -1
- package/dist/sessions.d.mts.map +1 -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/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginMaintainer.d.mts.map +1 -1
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginManager.d.mts.map +1 -1
- 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/marginTPSL.d.mts.map +1 -1
- package/dist/transactions/poolProxy.d.mts +8 -8
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +1 -1
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +1 -1
- package/src/account-bindings/account-registry.ts +39 -0
- package/src/account-bindings/account.ts +73 -0
- package/src/account-bindings/latest.ts +41 -0
- package/src/account.ts +89 -5
- package/src/contracts/account/account.ts +73 -4
- package/src/contracts/account/account_registry.ts +1 -1
- package/src/contracts/deepbook_predict/builder_code.ts +94 -2
- package/src/contracts/deepbook_predict/config_events.ts +7 -0
- package/src/contracts/deepbook_predict/expiry_market.ts +490 -44
- package/src/contracts/deepbook_predict/order_events.ts +6 -4
- package/src/contracts/deepbook_predict/predict_account.ts +12 -6
- package/src/contracts/deepbook_predict/protocol_config.ts +85 -0
- package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts +14 -0
- package/src/contracts/deepbook_predict_orders/order_flow.ts +4 -0
- package/src/contracts/deepbook_predict_orders/queue.ts +495 -9
- package/src/contracts/deepbook_sessions/sessions.ts +538 -3
- package/src/deployments/mainnet.ts +4 -4
- package/src/deployments/testnet.ts +18 -7
- package/src/deployments/types.ts +14 -0
- package/src/predict/bindings/expiry-market.ts +87 -0
- package/src/predict/bindings/queue.ts +42 -0
- package/src/predict/bindings/rename.ts +5 -1
- package/src/predict/client.ts +25 -3
- package/src/predict/config/generated.ts +3 -0
- package/src/predict/config/mainnet.ts +4 -0
- package/src/predict/config/testnet.ts +4 -0
- package/src/predict/config/types.ts +23 -0
- package/src/predict/cost.ts +9 -1
- package/src/predict/errors.ts +11 -1
- package/src/predict/index.ts +1 -1
- package/src/predict/queue.ts +8 -4
- package/src/predict/reads/queue.ts +7 -4
- package/src/predict/tx/common.ts +2 -0
- package/src/predict/tx/trade.ts +3 -1
- package/src/sessions.ts +10 -1
- package/src/utils/constants.ts +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginTPSL.d.mts","names":[],"sources":["../../src/transactions/marginTPSL.ts"],"mappings":";;;;;;;;;cAoBa,kBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EAiDO;;;;;;;EA3B3B,YAAA,GACE,OAAA,UAAiB,iBAAA,WAA4B,YAAA,uBAC7C,EAAA,EAAI,WAAA,KAAW,
|
|
1
|
+
{"version":3,"file":"marginTPSL.d.mts","names":[],"sources":["../../src/transactions/marginTPSL.ts"],"mappings":";;;;;;;;;cAoBa,kBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EAiDO;;;;;;;EA3B3B,YAAA,GACE,OAAA,UAAiB,iBAAA,WAA4B,YAAA,uBAC7C,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAyI+C;;;;;;EAjHhE,oBAAA,GACE,OAAA,UAAiB,MAAA,EAAQ,uBAAA,MAA6B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAyOa;;;;;;EAlMpF,qBAAA,GACE,OAAA,UAAiB,MAAA,EAAQ,wBAAA,MAA8B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EA8PiB;;;;;EA9NzF,mBAAA,GAAuB,MAAA,EAAQ,yBAAA,MAA+B,EAAA,EAAI,WAAA;EAnGlE;;;;;EA2IA,0BAAA,GAA8B,gBAAA,cAA8B,EAAA,EAAI,WAAA;EAzI/C;;;;;;EA6JjB,sBAAA,GACE,gBAAA,UAA0B,kBAAA,cAAgC,EAAA,EAAI,WAAA;EArIO;;;;;;;;;;;EA8JvE,wBAAA,GACE,cAAA,UAAwB,OAAA,UAAiB,kBAAA,cAAgC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAvF5B;;;;;;;;;;;;;;;;;EAgI9D,0BAAA,GACE,cAAA,UAAwB,OAAA,UAAiB,kBAAA,cAAgC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAAxF;;;;;;EAgCF,mBAAA,GAAuB,OAAA,UAAiB,eAAA,cAA6B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAA7D;;;;;;;EAoBvB,gBAAA,GACE,OAAA,UAAiB,eAAA,UAAyB,kBAAA,cAAgC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAA/C;;;;;;;EAoB5C,uBAAA,GAA2B,OAAA,UAAiB,eAAA,cAA6B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAAf;;;;;;;EAoBzE,wBAAA,GAA4B,OAAA,UAAiB,eAAA,cAA6B,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;AAAA"}
|
|
@@ -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_transactions274 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_transactions274.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_transactions274.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_transactions274.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_transactions274.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_transactions274.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_transactions274.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_transactions274.TransactionResult;
|
|
82
82
|
/**
|
|
83
83
|
* @description Modify an existing order
|
|
84
84
|
* @param {string} marginManagerKey The key to identify the MarginManager
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poolProxy.d.mts","names":[],"sources":["../../src/transactions/poolProxy.ts"],"mappings":";;;;;;;;;cAmBa,iBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EAoBuD;;;;;;;EAA3E,eAAA,GAAmB,MAAA,EAAQ,2BAAA,MAAiC,EAAA,EAAI,WAAA,KAAW,
|
|
1
|
+
{"version":3,"file":"poolProxy.d.mts","names":[],"sources":["../../src/transactions/poolProxy.ts"],"mappings":";;;;;;;;;cAmBa,iBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EAoBuD;;;;;;;EAA3E,eAAA,GAAmB,MAAA,EAAQ,2BAAA,MAAiC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EA0JC;;;;;;;EArG5E,gBAAA,GAAoB,MAAA,EAAQ,4BAAA,MAAkC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAgQnE;;;;;;;;EAjNV,yBAAA,GAA6B,MAAA,EAAQ,2BAAA,MAAiC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAsZxC;;;;;;;;EAhW7C,0BAAA,GAA8B,MAAA,EAAQ,4BAAA,MAAkC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;;;;;;;;;;;;EAkDvF,4BAAA,GAAgC,MAAA,EAAQ,4BAAA,MAAkC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAvJrE;;;;;;;;;EAuMpB,qCAAA,GACE,MAAA,EAAQ,2BAAA,MAAiC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAnG1D;;;;;;;;;EA0JA,sCAAA,GACE,MAAA,EAAQ,4BAAA,MAAkC,EAAA,EAAI,WAAA,KAAW,2BAAA,CAAA,iBAAA;EAzGe;;;;;;;EAuJ1E,WAAA,GACE,gBAAA,UAA0B,OAAA,UAAiB,WAAA,cAAyB,EAAA,EAAI,WAAA;EAhD1E;;;;;;EA4EA,WAAA,GAAe,gBAAA,UAA0B,OAAA,cAAqB,EAAA,EAAI,WAAA;EA5BhE;;;;;;EAqDF,YAAA,GAAgB,gBAAA,UAA0B,QAAA,gBAAwB,EAAA,EAAI,WAAA;EAzB7B;;;;;EAiDzC,eAAA,GAAmB,gBAAA,cAA8B,EAAA,EAAI,WAAA;EAxBiB;;;;;EA+CtE,sBAAA,GAA0B,gBAAA,cAA8B,EAAA,EAAI,WAAA;EAA5D;;;;;;EAwBA,KAAA,GAAS,gBAAA,UAA0B,WAAA,cAAyB,EAAA,EAAI,WAAA;EAAA;;;;;EA0BhE,OAAA,GAAW,gBAAA,cAA8B,EAAA,EAAI,WAAA;EAwB7C;;;;;;EAAA,cAAA,GACE,gBAAA,UAA0B,MAAA,EAAQ,oBAAA,MAA0B,EAAA,EAAI,WAAA;EA+B1D;;;;;;EAAR,IAAA,GAAQ,gBAAA,UAA0B,UAAA,cAAwB,EAAA,EAAI,WAAA;EAwBjB;;;;;EAA7C,WAAA,GAAe,gBAAA,cAA8B,EAAA,EAAI,WAAA;EA+CjD;;;;;;EAvBA,4BAAA,GACE,OAAA,UAAiB,eAAA,cAA6B,EAAA,EAAI,WAAA;;;;;;EAsBpD,kBAAA,GAAsB,OAAA,cAAqB,EAAA,EAAI,WAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.mts","names":[],"sources":["../../src/utils/constants.ts"],"mappings":";;;KAKY,OAAA,GAAU,MAAA,SAAe,IAAA;AAAA,KACzB,OAAA,GAAU,MAAA,SAAe,IAAA;AAAA,KACzB,aAAA,GAAgB,MAAA,SAAe,UAAA;AAAA,UAC1B,kBAAA;EAChB,mBAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EACA,SAAA;EACA,kBAAA;EACA,sBAAA;AAAA;AAAA,cAGY,iBAAA;;;;;;;;;cAcA,iBAAA;;;;;;;;;AAdb;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"constants.d.mts","names":[],"sources":["../../src/utils/constants.ts"],"mappings":";;;KAKY,OAAA,GAAU,MAAA,SAAe,IAAA;AAAA,KACzB,OAAA,GAAU,MAAA,SAAe,IAAA;AAAA,KACzB,aAAA,GAAgB,MAAA,SAAe,UAAA;AAAA,UAC1B,kBAAA;EAChB,mBAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EACA,SAAA;EACA,kBAAA;EACA,sBAAA;AAAA;AAAA,cAGY,iBAAA;;;;;;;;;cAcA,iBAAA;;;;;;;;;AAdb;;;;;;;;;;;;;AAAA,cA+Ca,YAAA,EAAc,OAAA;AAAA,cAiDd,YAAA,EAAc,OAAA;AAAA,cAqJd,YAAA,EAAc,OAAA;AAAA,cAsCd,YAAA,EAAc,OAAA;AAAA,cAgId,kBAAA;;;;;;;;;;;;;;;;;;cAmBA,kBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BA,kBAAA;EAGS,WAAA;EAAA,eAAA;AAAA;AAAA,cAET,kBAAA;EAGS,WAAA;EAAA,eAAA;AAAA;;;;;;cAOT,oBAAA;;;;;;;;;;;;cAaA,qBAAA"}
|
package/dist/utils/constants.mjs
CHANGED
|
@@ -15,7 +15,7 @@ const mainnetPackageIds = {
|
|
|
15
15
|
MARGIN_PACKAGE_ID: "0x40fa183b5602cd0f6c4d7b16c08766ad8d7d581608fbe3b2570fe72ab4f5625f",
|
|
16
16
|
MARGIN_V1: "0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
|
|
17
17
|
MARGIN_REGISTRY_ID: "0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742",
|
|
18
|
-
LIQUIDATION_PACKAGE_ID: "
|
|
18
|
+
LIQUIDATION_PACKAGE_ID: "0xd61f264aaf707285a712347fccfb8e905e99d7dc72a6bd1053829ddebf420c2b"
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Feed ids and price objects on Pyth's upgraded Core, the only deployment this SDK targets.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Coin, Pool, MarginPool, PythConfig } from '../types/index.js';\n\nexport type CoinMap = Record<string, Coin>;\nexport type PoolMap = Record<string, Pool>;\nexport type MarginPoolMap = Record<string, MarginPool>;\nexport interface DeepbookPackageIds {\n\tDEEPBOOK_PACKAGE_ID?: string;\n\tREGISTRY_ID?: string;\n\tDEEP_TREASURY_ID?: string;\n\tMARGIN_PACKAGE_ID?: string;\n\tMARGIN_V1?: string;\n\tMARGIN_REGISTRY_ID?: string;\n\tLIQUIDATION_PACKAGE_ID?: string;\n}\n\nexport const testnetPackageIds = {\n\t// deepbook core v21, kept in step with MARGIN_PACKAGE_ID (see the mainnet ids below).\n\tDEEPBOOK_PACKAGE_ID: '0x4b1c2a827983d8fa73f6dc366cfab23636ae52e81e499d8724b71408fe6a00a4',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\t// deepbook_margin v17, linked to core v21 — the same source as mainnet margin v8\n\t// (`MARGIN_VERSION = 8`, legacy-Pyth entrypoints retired).\n\tMARGIN_PACKAGE_ID: '0x0ad965f35189c7eca57d4718c8f5bf1b7f9f7eb4ced6d5b7aa6496a16d71e8d2',\n\tMARGIN_V1: '0xb8620c24c9ea1a4a41e79613d2b3d1d93648d1bb6f6b789a7c8f261c94110e4b',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\t// margin_liquidation v4 — carries liquidate_base_upgraded / liquidate_quote_upgraded.\n\tLIQUIDATION_PACKAGE_ID: '0x29bccec5261b7d040555a13e98bbc6bef7bad007d62759aac8b71c19916f6476',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\t// deepbook core v9. Keep it in step with MARGIN_PACKAGE_ID: margin v8 links core v9, and a\n\t// transaction that calls core v8 directly next to margin v8 fails with `InvalidLinkage`.\n\tDEEPBOOK_PACKAGE_ID: '0xbca0cefe720330e7bb4f2283438b68de6a0e656688db4ac90d61e71fe6151fe8',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\t// deepbook_margin v8, linked to core v9. Its gate constant is `MARGIN_VERSION = 8`, which the\n\t// upgrade transaction enabled on the mainnet MarginRegistry. v8 retires the legacy-Pyth\n\t// entrypoints in the base modules (they abort `EDeprecatedUseUpgradedPyth`); every\n\t// oracle-taking builder here already targets the `_upgraded` modules.\n\tMARGIN_PACKAGE_ID: '0x40fa183b5602cd0f6c4d7b16c08766ad8d7d581608fbe3b2570fe72ab4f5625f',\n\tMARGIN_V1: '0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0xba2b39c026650fef52038c93c526fc5314a4286318a0d2a7054b65815178fb74',\n} satisfies DeepbookPackageIds;\n\n/**\n * Feed ids and price objects on Pyth's upgraded Core, the only deployment this SDK targets.\n *\n * The testnet `MarginRegistry` was migrated (2026-08-11) off Pyth's beta feed ids and onto\n * the ids upgraded testnet Core carries, which are the mainnet-style ids — the beta ids\n * have no upgraded price objects and the upgraded Hermes does not serve them.\n *\n * DBTC is testnet's wrapped BTC and takes Crypto.XBTC/USD — the same feed mainnet XBTC\n * uses. The upgraded deployment carries no distinct DBTC feed. Plain Crypto.BTC/USD is\n * NOT an accepted substitute for either: XBTC is a distinct asset with its own peg and\n * redemption risk, so pricing it off BTC would misstate collateral in exactly the stress\n * where the two diverge.\n */\nexport const testnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,\n\t\ttype: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',\n\t\tpriceInfoObjectId: '0x27882b43c2cc62bbd8fb5f4ebc20be004b14454b2c98755033f5446d35474339',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x867877562b5d8ac262d93b02062e04b428a2f9bfbb2f05b8af52e04cd98bd241',\n\t},\n\tDBUSDC: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',\n\t\tpriceInfoObjectId: '0x17de8d80e8efedfd1053c46fb921e51824479ed32c6aded5f7279995bb84db05',\n\t},\n\tDBTC: {\n\t\taddress: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,\n\t\ttype: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,\n\t\tscalar: 100000000,\n\t\t// Crypto.XBTC/USD — DBTC is testnet's wrapped BTC, so it takes the same feed mainnet\n\t\t// XBTC does. Never plain BTC/USD: that is a different asset, and standing it in\n\t\t// would misprice DBTC collateral whenever XBTC's peg moves. Object created on\n\t\t// upgraded testnet Core 2026-08-11.\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',\n\t\tpriceInfoObjectId: '0x88387b85b9a53c4365219aee4d77e62213877f110eb859d8e03812a5bea0d1f7',\n\t},\n\tDBUSDT: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDT::DBUSDT`,\n\t\tscalar: 1000000,\n\t},\n\tWAL: {\n\t\taddress: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76`,\n\t\ttype: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76::wal::WAL`,\n\t\tscalar: 1000000000,\n\t},\n};\n\nexport const mainnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,\n\t\ttype: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9',\n\t\tpriceInfoObjectId: '0x562957f70afaf8a0870e2959abc3e3f327a8159f803d8c56cff27ac2df260477',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x89b2add829cb6fcd017153fff428bc9faec4d06d643ecfc435af5b55a9e987f0',\n\t},\n\tUSDC: {\n\t\taddress: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,\n\t\ttype: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a',\n\t\tpriceInfoObjectId: '0x6ddfc6f9921e55998cbc2e68f78eba897981d79ac17f66c5277bc38954a2a3f8',\n\t},\n\tWAL: {\n\t\taddress: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,\n\t\ttype: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341',\n\t\tcurrencyId: '0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa',\n\t\tpriceInfoObjectId: '0xdbea8600eeeb0399df58c28e73b8201ae880a954813131d33bfa6902ccdadd24',\n\t},\n\tSUIUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f',\n\t\tcurrencyId: '0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576',\n\t\tpriceInfoObjectId: '0xa8023b552578bd5036be60d3132306882469d1871cb4bec3099c47dece08c4cd',\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\n\t\t// Crypto.XBTC/USD, always. XBTC must never be priced off Crypto.BTC/USD\n\t\t// (`0xe62df6c8…`): it is a distinct asset carrying its own peg and redemption risk,\n\t\t// so a BTC substitute misstates collateral precisely when the two diverge. This\n\t\t// holds regardless of XBTC's wider confidence band — that is a bound to set on the\n\t\t// registry's `max_conf_bps`, not a reason to price a different asset.\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',\n\t\t// Created 2026-08-17 (tx `3SbNisBM…ePnSx`) — XBTC is absent from Pyth's Sui push-feed\n\t\t// list, so they never maintained an object for it here; ours is kept fresh by our own\n\t\t// price pusher, as on legacy Core. Creation is permissionless, so no admin action was\n\t\t// involved. Verified: registered in the upgraded price table and updatable.\n\t\tpriceInfoObjectId: '0x4f7ff4518b4cf33b162d76e70632d8f0a6e04441a058a138959d7a2384cffe60',\n\t},\n\tUSDSUI: {\n\t\taddress: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,\n\t\ttype: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,\n\t\tscalar: 1000000,\n\t\t// Valid Pyth data, but margin cannot price USDSUI: the mainnet MarginRegistry's\n\t\t// PythConfig configures six currencies and USDSUI is not among them (read on chain\n\t\t// 2026-08-11), so an oracle-taking call aborts in the registry's currency lookup\n\t\t// before the feed id is ever compared. Lending is unaffected — margin_pool supply\n\t\t// and withdraw take no oracle — and no USDSUI DeepBook pool is margin-registered.\n\t\tfeed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',\n\t\tcurrencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',\n\t\tpriceInfoObjectId: '0x6896ccc8c08a84e47f0ab8affbd3fce2623a72c76f9092e59f8f6ece450119cd',\n\t},\n\tWUSDC: {\n\t\taddress: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,\n\t\ttype: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tWETH: {\n\t\taddress: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5`,\n\t\ttype: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tBETH: {\n\t\taddress: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29`,\n\t\ttype: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH`,\n\t\tscalar: 100000000,\n\t},\n\tWBTC: {\n\t\taddress: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881`,\n\t\ttype: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tWUSDT: {\n\t\taddress: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c`,\n\t\ttype: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tNS: {\n\t\taddress: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178`,\n\t\ttype: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS`,\n\t\tscalar: 1000000,\n\t},\n\tTYPUS: {\n\t\taddress: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385`,\n\t\ttype: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS`,\n\t\tscalar: 1000000000,\n\t},\n\tAUSD: {\n\t\taddress: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2`,\n\t\ttype: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD`,\n\t\tscalar: 1000000,\n\t},\n\tDRF: {\n\t\taddress: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e`,\n\t\ttype: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF`,\n\t\tscalar: 1000000,\n\t},\n\tSEND: {\n\t\taddress: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7`,\n\t\ttype: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,\n\t\tscalar: 1000000,\n\t},\n\tIKA: {\n\t\taddress: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa`,\n\t\ttype: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa::ika::IKA`,\n\t\tscalar: 1000000000,\n\t},\n\tALKIMI: {\n\t\taddress: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489`,\n\t\ttype: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489::alkimi::ALKIMI`,\n\t\tscalar: 1000000000,\n\t},\n\tLZWBTC: {\n\t\taddress: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942`,\n\t\ttype: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC`,\n\t\tscalar: 100000000,\n\t},\n\tUSDT: {\n\t\taddress: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068`,\n\t\ttype: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,\n\t\tscalar: 1000000,\n\t},\n\t// Hashi BTC (on-chain symbol hBTC).\n\tHBTC: {\n\t\taddress: `0xd30fb3f8914efdbeb7b8e85fae1d65dc584b44a1281f66737b92bb9f03a59d06`,\n\t\ttype: `0xd30fb3f8914efdbeb7b8e85fae1d65dc584b44a1281f66737b92bb9f03a59d06::btc::BTC`,\n\t\tscalar: 100000000,\n\t},\n};\n\nexport const testnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0x48c95963e9eac37a316b7ae04a0deb761bcdcc2b67912374d6036e7f0e9bae9f`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_DBUSDC: {\n\t\taddress: `0x1c19362ca52b8ffd7a33cee805a67d40f31e6ba303753fd3a4cfdfacea7163a5`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDEEP_DBUSDC: {\n\t\taddress: `0xe86b991f8632217505fd859445f9803967ac84a9d4a1219065bf191fcb74b622`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDBUSDT_DBUSDC: {\n\t\taddress: `0x83970bb02e3636efdff8c141ab06af5e3c9a22e2f74d7f02a9c3430d0d10c1ca`,\n\t\tbaseCoin: 'DBUSDT',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_DBUSDC: {\n\t\taddress: `0xeb524b6aea0ec4b494878582e0b78924208339d360b62aec4a8ecd4031520dbb`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x8c1c1b186c4fddab1ebd53e0895a36c1d1b3b9a77cd34e607bef49a38af0150a`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tDBTC_DBUSDC: {\n\t\taddress: `0x0dce0aa771074eb83d1f4a29d48be8248d4d2190976a5241f66b43ec18fa34de`,\n\t\tbaseCoin: 'DBTC',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n};\n\nexport const mainnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_USDC: {\n\t\taddress: `0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDEEP_USDC: {\n\t\taddress: `0xf948981b806057580f91622417534f491da5f61aeaf33d0ed8e69fd5691c95ce`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDT_USDC: {\n\t\taddress: `0x4e2ca3988246e1d50b9bf209abb9c1cbfec65bd95afdacc620a36c67bdb8452f`,\n\t\tbaseCoin: 'WUSDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDC_USDC: {\n\t\taddress: `0xa0b9ebefb38c963fd115f52d71fa64501b79d1adcb5270563f92ce0442376545`,\n\t\tbaseCoin: 'WUSDC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tBETH_USDC: {\n\t\taddress: `0x1109352b9112717bd2a7c3eb9a416fff1ba6951760f5bdd5424cf5e4e5b3e65c`,\n\t\tbaseCoin: 'BETH',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_USDC: {\n\t\taddress: `0x0c0fdd4008740d81a8a7d4281322aee71a1b62c449eb5b142656753d89ebc060`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_SUI: {\n\t\taddress: `0x27c4fdb3b846aa3ae4a65ef5127a309aa3c1f466671471a806d8912a18b253e8`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tTYPUS_SUI: {\n\t\taddress: `0xe8e56f377ab5a261449b92ac42c8ddaacd5671e9fec2179d7933dd1a91200eec`,\n\t\tbaseCoin: 'TYPUS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_AUSD: {\n\t\taddress: `0x183df694ebc852a5f90a959f0f563b82ac9691e42357e9a9fe961d71a1b809c8`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'AUSD',\n\t},\n\tAUSD_USDC: {\n\t\taddress: `0x5661fc7f88fbeb8cb881150a810758cf13700bb4e1f31274a244581b37c303c3`,\n\t\tbaseCoin: 'AUSD',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDRF_SUI: {\n\t\taddress: `0x126865a0197d6ab44bfd15fd052da6db92fd2eb831ff9663451bbfa1219e2af2`,\n\t\tbaseCoin: 'DRF',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSEND_USDC: {\n\t\taddress: `0x1fe7b99c28ded39774f37327b509d58e2be7fff94899c06d22b407496a6fa990`,\n\t\tbaseCoin: 'SEND',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_USDC: {\n\t\taddress: `0x56a1c985c1f1123181d6b881714793689321ba24301b3585eec427436eb1c76d`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x81f5339934c83ea19dd6bcc75c52e83509629a5f71d3257428c2ce47cc94d08b`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tXBTC_USDC: {\n\t\taddress: `0x20b9a3ec7a02d4f344aa1ebc5774b7b0ccafa9a5d76230662fdc0300bb215307`,\n\t\tbaseCoin: 'XBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tIKA_USDC: {\n\t\taddress: `0xfa732993af2b60d04d7049511f801e79426b2b6a5103e22769c0cead982b0f47`,\n\t\tbaseCoin: 'IKA',\n\t\tquoteCoin: 'USDC',\n\t},\n\tALKIMI_SUI: {\n\t\taddress: `0x84752993c6dc6fce70e25ddeb4daddb6592d6b9b0912a0a91c07cfff5a721d89`,\n\t\tbaseCoin: 'ALKIMI',\n\t\tquoteCoin: 'SUI',\n\t},\n\tLZWBTC_USDC: {\n\t\taddress: `0xf5142aafa24866107df628bf92d0358c7da6acc46c2f10951690fd2b8570f117`,\n\t\tbaseCoin: 'LZWBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tUSDT_USDC: {\n\t\taddress: '0xfc28a2fb22579c16d672a1152039cbf671e5f4b9f103feddff4ea06ef3c2bc25',\n\t\tbaseCoin: 'USDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUIUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'SUIUSDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_SUIUSDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'SUIUSDE',\n\t},\n\tSUI_USDSUI: {\n\t\taddress: '0x826eeacb2799726334aa580396338891205a41cf9344655e526aae6ddd5dc03f',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDSUI',\n\t},\n\tUSDSUI_USDC: {\n\t\taddress: '0xa374264d43e6baa5aa8b35ff18ff24fdba7443b4bcb884cb4c2f568d32cdac36',\n\t\tbaseCoin: 'USDSUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tHBTC_USDC: {\n\t\taddress: '0x61368ab907934d7840d2e639b7fc2ee74785ffe3d46427d70e1ab8545f320c9b',\n\t\tbaseCoin: 'HBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n};\n\nexport const testnetMarginPools = {\n\tSUI: {\n\t\taddress: '0xcdbbe6a72e639b647296788e2e4b1cac5cea4246028ba388ba1332ff9a382eea',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tDBUSDC: {\n\t\taddress: '0xf08568da93834e1ee04f09902ac7b1e78d3fdf113ab4d2106c7265e95318b14d',\n\t\ttype: '0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x610640613f21d9e688d6f8103d17df22315c32e0c80590ce64951a1991378b55',\n\t\ttype: '0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP',\n\t},\n\tDBTC: {\n\t\taddress: '0xf3440b4aafcc8b12fc4b242e9590c52873b8238a0d0e52fbf9dae61d2970796a',\n\t\ttype: '0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC',\n\t},\n};\n\nexport const mainnetMarginPools = {\n\tSUI: {\n\t\taddress: '0x53041c6f86c4782aabbfc1d4fe234a6d37160310c7ee740c915f0a01b7127344',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '0xba473d9ae278f10af75c50a8fa341e9c6a1c087dc91a3f23e8048baf67d0754f',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x1d723c5cd113296868b55208f2ab5a905184950dd59c48eb7345607d6b5e6af7',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t},\n\tWAL: {\n\t\taddress: '0x38decd3dbb62bd4723144349bf57bc403b393aee86a51596846a824a1e0c2c01',\n\t\ttype: '0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL',\n\t},\n\tSUIUSDE: {\n\t\taddress: '0xbb990ca04a7743e6c0a25a7fb16f60fc6f6d8bf213624ff03a63f1bb04c3a12f',\n\t\ttype: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n\t},\n\tXBTC: {\n\t\taddress: '0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4',\n\t\ttype: '0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC',\n\t},\n\tUSDSUI: {\n\t\taddress: '0x78a0ddd02745d9b500fb7e9aae2ff8b665d974f00fd1f6060d59f4a8e891402c',\n\t\ttype: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',\n\t},\n};\n\nexport const testnetPythConfigs = {\n\tpythStateId: '0x3c48fe392912de6c18087a2b3f5fdbfbfdb4598e180947feff1f12f8e9ea073e',\n\twormholeStateId: '0x750da8e6d16b6a363a39fe2eaa8295ac224a1e6fce4e47b58845e2e8746164f0',\n} satisfies PythConfig;\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x03719fae774ddab3cfcaa53bbc046f0cbe21410019b6280811bf3f9f4b05839d',\n\twormholeStateId: '0xdbca52b9fb4f712e25f61f974586d93ac541bcf8389564f0323bb07215168b5c',\n} satisfies PythConfig;\n\n/**\n * Hermes serving Pyth's upgraded Core. Requires an `Authorization: Bearer <token>` header\n * and answers 401 without one. Note that from the Core cutover this also becomes true of\n * legacy Hermes, so an unauthenticated price push has no long-term path.\n */\nexport const PYTH_UPGRADED_HERMES = 'https://pyth.dourolabs.app/hermes';\n\n/**\n * DeepBook-operated Hermes proxy: forwards to {@link PYTH_UPGRADED_HERMES} supplying\n * credentials server-side, so consumers without their own Pyth plan can still push price\n * updates. Used only when no `accessToken` is configured — bring your own token and the\n * SDK talks to Pyth directly, with no DeepBook infrastructure in the path.\n *\n * `undefined` until the proxy is deployed. It must stay `undefined` rather than a\n * placeholder URL: it is the default endpoint whenever a consumer supplies no credentials,\n * so a non-resolving value here surfaces as an opaque `Invalid URL`/DNS error from inside\n * axios instead of a configuration error naming the field to set.\n */\nexport const DEEPBOOK_HERMES_PROXY: string | undefined = undefined;\n"],"mappings":";AAkBA,MAAa,oBAAoB;CAEhC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAGlB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CAEpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAGhC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAKlB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CACpB,wBAAwB;CACxB;;;;;;;;;;;;;;AAeD,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EAKR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EAMR,MAAM;EACN,YAAY;EAKZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EAMR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,IAAI;EACH,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CAED,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,eAAe;EACd,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,QAAQ;EACP,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,cAAc;EACb,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;;;;;;AAOD,MAAa,uBAAuB;;;;;;;;;;;;AAapC,MAAa,wBAA4C"}
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Coin, Pool, MarginPool, PythConfig } from '../types/index.js';\n\nexport type CoinMap = Record<string, Coin>;\nexport type PoolMap = Record<string, Pool>;\nexport type MarginPoolMap = Record<string, MarginPool>;\nexport interface DeepbookPackageIds {\n\tDEEPBOOK_PACKAGE_ID?: string;\n\tREGISTRY_ID?: string;\n\tDEEP_TREASURY_ID?: string;\n\tMARGIN_PACKAGE_ID?: string;\n\tMARGIN_V1?: string;\n\tMARGIN_REGISTRY_ID?: string;\n\tLIQUIDATION_PACKAGE_ID?: string;\n}\n\nexport const testnetPackageIds = {\n\t// deepbook core v21, kept in step with MARGIN_PACKAGE_ID (see the mainnet ids below).\n\tDEEPBOOK_PACKAGE_ID: '0x4b1c2a827983d8fa73f6dc366cfab23636ae52e81e499d8724b71408fe6a00a4',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\t// deepbook_margin v17, linked to core v21 — the same source as mainnet margin v8\n\t// (`MARGIN_VERSION = 8`, legacy-Pyth entrypoints retired).\n\tMARGIN_PACKAGE_ID: '0x0ad965f35189c7eca57d4718c8f5bf1b7f9f7eb4ced6d5b7aa6496a16d71e8d2',\n\tMARGIN_V1: '0xb8620c24c9ea1a4a41e79613d2b3d1d93648d1bb6f6b789a7c8f261c94110e4b',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\t// margin_liquidation v4 — carries liquidate_base_upgraded / liquidate_quote_upgraded.\n\tLIQUIDATION_PACKAGE_ID: '0x29bccec5261b7d040555a13e98bbc6bef7bad007d62759aac8b71c19916f6476',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\t// deepbook core v9. Keep it in step with MARGIN_PACKAGE_ID: margin v8 links core v9, and a\n\t// transaction that calls core v8 directly next to margin v8 fails with `InvalidLinkage`.\n\tDEEPBOOK_PACKAGE_ID: '0xbca0cefe720330e7bb4f2283438b68de6a0e656688db4ac90d61e71fe6151fe8',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\t// deepbook_margin v8, linked to core v9. Its gate constant is `MARGIN_VERSION = 8`, which the\n\t// upgrade transaction enabled on the mainnet MarginRegistry. v8 retires the legacy-Pyth\n\t// entrypoints in the base modules (they abort `EDeprecatedUseUpgradedPyth`); every\n\t// oracle-taking builder here already targets the `_upgraded` modules.\n\tMARGIN_PACKAGE_ID: '0x40fa183b5602cd0f6c4d7b16c08766ad8d7d581608fbe3b2570fe72ab4f5625f',\n\tMARGIN_V1: '0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\t// margin_liquidation v6, linked to core v9 and margin v8. Older versions link margin v7, so\n\t// their liquidations abort once margin version 7 is disabled on the MarginRegistry. v6\n\t// retires the legacy-Pyth liquidate_base / liquidate_quote; the builders here call the\n\t// _upgraded pair.\n\tLIQUIDATION_PACKAGE_ID: '0xd61f264aaf707285a712347fccfb8e905e99d7dc72a6bd1053829ddebf420c2b',\n} satisfies DeepbookPackageIds;\n\n/**\n * Feed ids and price objects on Pyth's upgraded Core, the only deployment this SDK targets.\n *\n * The testnet `MarginRegistry` was migrated (2026-08-11) off Pyth's beta feed ids and onto\n * the ids upgraded testnet Core carries, which are the mainnet-style ids — the beta ids\n * have no upgraded price objects and the upgraded Hermes does not serve them.\n *\n * DBTC is testnet's wrapped BTC and takes Crypto.XBTC/USD — the same feed mainnet XBTC\n * uses. The upgraded deployment carries no distinct DBTC feed. Plain Crypto.BTC/USD is\n * NOT an accepted substitute for either: XBTC is a distinct asset with its own peg and\n * redemption risk, so pricing it off BTC would misstate collateral in exactly the stress\n * where the two diverge.\n */\nexport const testnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,\n\t\ttype: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',\n\t\tpriceInfoObjectId: '0x27882b43c2cc62bbd8fb5f4ebc20be004b14454b2c98755033f5446d35474339',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x867877562b5d8ac262d93b02062e04b428a2f9bfbb2f05b8af52e04cd98bd241',\n\t},\n\tDBUSDC: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',\n\t\tpriceInfoObjectId: '0x17de8d80e8efedfd1053c46fb921e51824479ed32c6aded5f7279995bb84db05',\n\t},\n\tDBTC: {\n\t\taddress: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,\n\t\ttype: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,\n\t\tscalar: 100000000,\n\t\t// Crypto.XBTC/USD — DBTC is testnet's wrapped BTC, so it takes the same feed mainnet\n\t\t// XBTC does. Never plain BTC/USD: that is a different asset, and standing it in\n\t\t// would misprice DBTC collateral whenever XBTC's peg moves. Object created on\n\t\t// upgraded testnet Core 2026-08-11.\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',\n\t\tpriceInfoObjectId: '0x88387b85b9a53c4365219aee4d77e62213877f110eb859d8e03812a5bea0d1f7',\n\t},\n\tDBUSDT: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDT::DBUSDT`,\n\t\tscalar: 1000000,\n\t},\n\tWAL: {\n\t\taddress: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76`,\n\t\ttype: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76::wal::WAL`,\n\t\tscalar: 1000000000,\n\t},\n};\n\nexport const mainnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,\n\t\ttype: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9',\n\t\tpriceInfoObjectId: '0x562957f70afaf8a0870e2959abc3e3f327a8159f803d8c56cff27ac2df260477',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x89b2add829cb6fcd017153fff428bc9faec4d06d643ecfc435af5b55a9e987f0',\n\t},\n\tUSDC: {\n\t\taddress: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,\n\t\ttype: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a',\n\t\tpriceInfoObjectId: '0x6ddfc6f9921e55998cbc2e68f78eba897981d79ac17f66c5277bc38954a2a3f8',\n\t},\n\tWAL: {\n\t\taddress: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,\n\t\ttype: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341',\n\t\tcurrencyId: '0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa',\n\t\tpriceInfoObjectId: '0xdbea8600eeeb0399df58c28e73b8201ae880a954813131d33bfa6902ccdadd24',\n\t},\n\tSUIUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f',\n\t\tcurrencyId: '0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576',\n\t\tpriceInfoObjectId: '0xa8023b552578bd5036be60d3132306882469d1871cb4bec3099c47dece08c4cd',\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\n\t\t// Crypto.XBTC/USD, always. XBTC must never be priced off Crypto.BTC/USD\n\t\t// (`0xe62df6c8…`): it is a distinct asset carrying its own peg and redemption risk,\n\t\t// so a BTC substitute misstates collateral precisely when the two diverge. This\n\t\t// holds regardless of XBTC's wider confidence band — that is a bound to set on the\n\t\t// registry's `max_conf_bps`, not a reason to price a different asset.\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',\n\t\t// Created 2026-08-17 (tx `3SbNisBM…ePnSx`) — XBTC is absent from Pyth's Sui push-feed\n\t\t// list, so they never maintained an object for it here; ours is kept fresh by our own\n\t\t// price pusher, as on legacy Core. Creation is permissionless, so no admin action was\n\t\t// involved. Verified: registered in the upgraded price table and updatable.\n\t\tpriceInfoObjectId: '0x4f7ff4518b4cf33b162d76e70632d8f0a6e04441a058a138959d7a2384cffe60',\n\t},\n\tUSDSUI: {\n\t\taddress: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,\n\t\ttype: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,\n\t\tscalar: 1000000,\n\t\t// Valid Pyth data, but margin cannot price USDSUI: the mainnet MarginRegistry's\n\t\t// PythConfig configures six currencies and USDSUI is not among them (read on chain\n\t\t// 2026-08-11), so an oracle-taking call aborts in the registry's currency lookup\n\t\t// before the feed id is ever compared. Lending is unaffected — margin_pool supply\n\t\t// and withdraw take no oracle — and no USDSUI DeepBook pool is margin-registered.\n\t\tfeed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',\n\t\tcurrencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',\n\t\tpriceInfoObjectId: '0x6896ccc8c08a84e47f0ab8affbd3fce2623a72c76f9092e59f8f6ece450119cd',\n\t},\n\tWUSDC: {\n\t\taddress: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,\n\t\ttype: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tWETH: {\n\t\taddress: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5`,\n\t\ttype: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tBETH: {\n\t\taddress: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29`,\n\t\ttype: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH`,\n\t\tscalar: 100000000,\n\t},\n\tWBTC: {\n\t\taddress: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881`,\n\t\ttype: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tWUSDT: {\n\t\taddress: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c`,\n\t\ttype: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tNS: {\n\t\taddress: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178`,\n\t\ttype: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS`,\n\t\tscalar: 1000000,\n\t},\n\tTYPUS: {\n\t\taddress: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385`,\n\t\ttype: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS`,\n\t\tscalar: 1000000000,\n\t},\n\tAUSD: {\n\t\taddress: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2`,\n\t\ttype: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD`,\n\t\tscalar: 1000000,\n\t},\n\tDRF: {\n\t\taddress: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e`,\n\t\ttype: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF`,\n\t\tscalar: 1000000,\n\t},\n\tSEND: {\n\t\taddress: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7`,\n\t\ttype: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,\n\t\tscalar: 1000000,\n\t},\n\tIKA: {\n\t\taddress: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa`,\n\t\ttype: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa::ika::IKA`,\n\t\tscalar: 1000000000,\n\t},\n\tALKIMI: {\n\t\taddress: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489`,\n\t\ttype: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489::alkimi::ALKIMI`,\n\t\tscalar: 1000000000,\n\t},\n\tLZWBTC: {\n\t\taddress: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942`,\n\t\ttype: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC`,\n\t\tscalar: 100000000,\n\t},\n\tUSDT: {\n\t\taddress: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068`,\n\t\ttype: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,\n\t\tscalar: 1000000,\n\t},\n\t// Hashi BTC (on-chain symbol hBTC).\n\tHBTC: {\n\t\taddress: `0xd30fb3f8914efdbeb7b8e85fae1d65dc584b44a1281f66737b92bb9f03a59d06`,\n\t\ttype: `0xd30fb3f8914efdbeb7b8e85fae1d65dc584b44a1281f66737b92bb9f03a59d06::btc::BTC`,\n\t\tscalar: 100000000,\n\t},\n};\n\nexport const testnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0x48c95963e9eac37a316b7ae04a0deb761bcdcc2b67912374d6036e7f0e9bae9f`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_DBUSDC: {\n\t\taddress: `0x1c19362ca52b8ffd7a33cee805a67d40f31e6ba303753fd3a4cfdfacea7163a5`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDEEP_DBUSDC: {\n\t\taddress: `0xe86b991f8632217505fd859445f9803967ac84a9d4a1219065bf191fcb74b622`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDBUSDT_DBUSDC: {\n\t\taddress: `0x83970bb02e3636efdff8c141ab06af5e3c9a22e2f74d7f02a9c3430d0d10c1ca`,\n\t\tbaseCoin: 'DBUSDT',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_DBUSDC: {\n\t\taddress: `0xeb524b6aea0ec4b494878582e0b78924208339d360b62aec4a8ecd4031520dbb`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x8c1c1b186c4fddab1ebd53e0895a36c1d1b3b9a77cd34e607bef49a38af0150a`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tDBTC_DBUSDC: {\n\t\taddress: `0x0dce0aa771074eb83d1f4a29d48be8248d4d2190976a5241f66b43ec18fa34de`,\n\t\tbaseCoin: 'DBTC',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n};\n\nexport const mainnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_USDC: {\n\t\taddress: `0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDEEP_USDC: {\n\t\taddress: `0xf948981b806057580f91622417534f491da5f61aeaf33d0ed8e69fd5691c95ce`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDT_USDC: {\n\t\taddress: `0x4e2ca3988246e1d50b9bf209abb9c1cbfec65bd95afdacc620a36c67bdb8452f`,\n\t\tbaseCoin: 'WUSDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDC_USDC: {\n\t\taddress: `0xa0b9ebefb38c963fd115f52d71fa64501b79d1adcb5270563f92ce0442376545`,\n\t\tbaseCoin: 'WUSDC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tBETH_USDC: {\n\t\taddress: `0x1109352b9112717bd2a7c3eb9a416fff1ba6951760f5bdd5424cf5e4e5b3e65c`,\n\t\tbaseCoin: 'BETH',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_USDC: {\n\t\taddress: `0x0c0fdd4008740d81a8a7d4281322aee71a1b62c449eb5b142656753d89ebc060`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_SUI: {\n\t\taddress: `0x27c4fdb3b846aa3ae4a65ef5127a309aa3c1f466671471a806d8912a18b253e8`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tTYPUS_SUI: {\n\t\taddress: `0xe8e56f377ab5a261449b92ac42c8ddaacd5671e9fec2179d7933dd1a91200eec`,\n\t\tbaseCoin: 'TYPUS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_AUSD: {\n\t\taddress: `0x183df694ebc852a5f90a959f0f563b82ac9691e42357e9a9fe961d71a1b809c8`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'AUSD',\n\t},\n\tAUSD_USDC: {\n\t\taddress: `0x5661fc7f88fbeb8cb881150a810758cf13700bb4e1f31274a244581b37c303c3`,\n\t\tbaseCoin: 'AUSD',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDRF_SUI: {\n\t\taddress: `0x126865a0197d6ab44bfd15fd052da6db92fd2eb831ff9663451bbfa1219e2af2`,\n\t\tbaseCoin: 'DRF',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSEND_USDC: {\n\t\taddress: `0x1fe7b99c28ded39774f37327b509d58e2be7fff94899c06d22b407496a6fa990`,\n\t\tbaseCoin: 'SEND',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_USDC: {\n\t\taddress: `0x56a1c985c1f1123181d6b881714793689321ba24301b3585eec427436eb1c76d`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x81f5339934c83ea19dd6bcc75c52e83509629a5f71d3257428c2ce47cc94d08b`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tXBTC_USDC: {\n\t\taddress: `0x20b9a3ec7a02d4f344aa1ebc5774b7b0ccafa9a5d76230662fdc0300bb215307`,\n\t\tbaseCoin: 'XBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tIKA_USDC: {\n\t\taddress: `0xfa732993af2b60d04d7049511f801e79426b2b6a5103e22769c0cead982b0f47`,\n\t\tbaseCoin: 'IKA',\n\t\tquoteCoin: 'USDC',\n\t},\n\tALKIMI_SUI: {\n\t\taddress: `0x84752993c6dc6fce70e25ddeb4daddb6592d6b9b0912a0a91c07cfff5a721d89`,\n\t\tbaseCoin: 'ALKIMI',\n\t\tquoteCoin: 'SUI',\n\t},\n\tLZWBTC_USDC: {\n\t\taddress: `0xf5142aafa24866107df628bf92d0358c7da6acc46c2f10951690fd2b8570f117`,\n\t\tbaseCoin: 'LZWBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tUSDT_USDC: {\n\t\taddress: '0xfc28a2fb22579c16d672a1152039cbf671e5f4b9f103feddff4ea06ef3c2bc25',\n\t\tbaseCoin: 'USDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUIUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'SUIUSDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_SUIUSDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'SUIUSDE',\n\t},\n\tSUI_USDSUI: {\n\t\taddress: '0x826eeacb2799726334aa580396338891205a41cf9344655e526aae6ddd5dc03f',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDSUI',\n\t},\n\tUSDSUI_USDC: {\n\t\taddress: '0xa374264d43e6baa5aa8b35ff18ff24fdba7443b4bcb884cb4c2f568d32cdac36',\n\t\tbaseCoin: 'USDSUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tHBTC_USDC: {\n\t\taddress: '0x61368ab907934d7840d2e639b7fc2ee74785ffe3d46427d70e1ab8545f320c9b',\n\t\tbaseCoin: 'HBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n};\n\nexport const testnetMarginPools = {\n\tSUI: {\n\t\taddress: '0xcdbbe6a72e639b647296788e2e4b1cac5cea4246028ba388ba1332ff9a382eea',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tDBUSDC: {\n\t\taddress: '0xf08568da93834e1ee04f09902ac7b1e78d3fdf113ab4d2106c7265e95318b14d',\n\t\ttype: '0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x610640613f21d9e688d6f8103d17df22315c32e0c80590ce64951a1991378b55',\n\t\ttype: '0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP',\n\t},\n\tDBTC: {\n\t\taddress: '0xf3440b4aafcc8b12fc4b242e9590c52873b8238a0d0e52fbf9dae61d2970796a',\n\t\ttype: '0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC',\n\t},\n};\n\nexport const mainnetMarginPools = {\n\tSUI: {\n\t\taddress: '0x53041c6f86c4782aabbfc1d4fe234a6d37160310c7ee740c915f0a01b7127344',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '0xba473d9ae278f10af75c50a8fa341e9c6a1c087dc91a3f23e8048baf67d0754f',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x1d723c5cd113296868b55208f2ab5a905184950dd59c48eb7345607d6b5e6af7',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t},\n\tWAL: {\n\t\taddress: '0x38decd3dbb62bd4723144349bf57bc403b393aee86a51596846a824a1e0c2c01',\n\t\ttype: '0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL',\n\t},\n\tSUIUSDE: {\n\t\taddress: '0xbb990ca04a7743e6c0a25a7fb16f60fc6f6d8bf213624ff03a63f1bb04c3a12f',\n\t\ttype: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n\t},\n\tXBTC: {\n\t\taddress: '0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4',\n\t\ttype: '0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC',\n\t},\n\tUSDSUI: {\n\t\taddress: '0x78a0ddd02745d9b500fb7e9aae2ff8b665d974f00fd1f6060d59f4a8e891402c',\n\t\ttype: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',\n\t},\n};\n\nexport const testnetPythConfigs = {\n\tpythStateId: '0x3c48fe392912de6c18087a2b3f5fdbfbfdb4598e180947feff1f12f8e9ea073e',\n\twormholeStateId: '0x750da8e6d16b6a363a39fe2eaa8295ac224a1e6fce4e47b58845e2e8746164f0',\n} satisfies PythConfig;\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x03719fae774ddab3cfcaa53bbc046f0cbe21410019b6280811bf3f9f4b05839d',\n\twormholeStateId: '0xdbca52b9fb4f712e25f61f974586d93ac541bcf8389564f0323bb07215168b5c',\n} satisfies PythConfig;\n\n/**\n * Hermes serving Pyth's upgraded Core. Requires an `Authorization: Bearer <token>` header\n * and answers 401 without one. Note that from the Core cutover this also becomes true of\n * legacy Hermes, so an unauthenticated price push has no long-term path.\n */\nexport const PYTH_UPGRADED_HERMES = 'https://pyth.dourolabs.app/hermes';\n\n/**\n * DeepBook-operated Hermes proxy: forwards to {@link PYTH_UPGRADED_HERMES} supplying\n * credentials server-side, so consumers without their own Pyth plan can still push price\n * updates. Used only when no `accessToken` is configured — bring your own token and the\n * SDK talks to Pyth directly, with no DeepBook infrastructure in the path.\n *\n * `undefined` until the proxy is deployed. It must stay `undefined` rather than a\n * placeholder URL: it is the default endpoint whenever a consumer supplies no credentials,\n * so a non-resolving value here surfaces as an opaque `Invalid URL`/DNS error from inside\n * axios instead of a configuration error naming the field to set.\n */\nexport const DEEPBOOK_HERMES_PROXY: string | undefined = undefined;\n"],"mappings":";AAkBA,MAAa,oBAAoB;CAEhC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAGlB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CAEpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAGhC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAKlB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CAKpB,wBAAwB;CACxB;;;;;;;;;;;;;;AAeD,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EAKR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EAMR,MAAM;EACN,YAAY;EAKZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EAMR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,IAAI;EACH,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CAED,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,eAAe;EACd,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,QAAQ;EACP,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,cAAc;EACb,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;;;;;;AAOD,MAAa,uBAAuB;;;;;;;;;;;;AAapC,MAAa,wBAA4C"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// The public `account_registry` bindings: the generated ones, each calling the latest account package
|
|
5
|
+
// (see `latest.ts`). Types and BCS layouts are re-exported unchanged.
|
|
6
|
+
|
|
7
|
+
import * as generated from '../contracts/account/account_registry.js';
|
|
8
|
+
import { latestAccountPackage } from './latest.js';
|
|
9
|
+
|
|
10
|
+
export * from '../contracts/account/account_registry.js';
|
|
11
|
+
|
|
12
|
+
export const derivedAddress = latestAccountPackage(generated.derivedAddress);
|
|
13
|
+
export const derivedWrapperAddress = latestAccountPackage(generated.derivedWrapperAddress);
|
|
14
|
+
export const derivedExists = latestAccountPackage(generated.derivedExists);
|
|
15
|
+
export const derivedWrapperExists = latestAccountPackage(generated.derivedWrapperExists);
|
|
16
|
+
export const _new = latestAccountPackage(generated._new);
|
|
17
|
+
export const newWithReferrer = latestAccountPackage(generated.newWithReferrer);
|
|
18
|
+
export const newSelfOwned = latestAccountPackage(generated.newSelfOwned);
|
|
19
|
+
export const isAppAuthorized = latestAccountPackage(generated.isAppAuthorized);
|
|
20
|
+
export const authorizeApp = latestAccountPackage(generated.authorizeApp);
|
|
21
|
+
export const deauthorizeApp = latestAccountPackage(generated.deauthorizeApp);
|
|
22
|
+
export const assertAppIsAuthorized = latestAccountPackage(generated.assertAppIsAuthorized);
|
|
23
|
+
export const generateAuthAsApp = latestAccountPackage(generated.generateAuthAsApp);
|
|
24
|
+
|
|
25
|
+
/** Every generated function wrapped above, for the completeness test. */
|
|
26
|
+
export const WRAPPED = Object.freeze([
|
|
27
|
+
'derivedAddress',
|
|
28
|
+
'derivedWrapperAddress',
|
|
29
|
+
'derivedExists',
|
|
30
|
+
'derivedWrapperExists',
|
|
31
|
+
'_new',
|
|
32
|
+
'newWithReferrer',
|
|
33
|
+
'newSelfOwned',
|
|
34
|
+
'isAppAuthorized',
|
|
35
|
+
'authorizeApp',
|
|
36
|
+
'deauthorizeApp',
|
|
37
|
+
'assertAppIsAuthorized',
|
|
38
|
+
'generateAuthAsApp',
|
|
39
|
+
] as const);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// The public `account` bindings: the generated ones, each calling the latest account package
|
|
5
|
+
// (see `latest.ts`). Types and BCS layouts are re-exported unchanged.
|
|
6
|
+
|
|
7
|
+
import * as generated from '../contracts/account/account.js';
|
|
8
|
+
import type { BcsType } from '@mysten/sui/bcs';
|
|
9
|
+
import { latestAccountPackage, type WithLatestConfig } from './latest.js';
|
|
10
|
+
|
|
11
|
+
export * from '../contracts/account/account.js';
|
|
12
|
+
|
|
13
|
+
export const id = latestAccountPackage(generated.id);
|
|
14
|
+
export const loadAccount = latestAccountPackage(generated.loadAccount);
|
|
15
|
+
export const balance = latestAccountPackage(generated.balance);
|
|
16
|
+
export const owner = latestAccountPackage(generated.owner);
|
|
17
|
+
export const accountId = latestAccountPackage(generated.accountId);
|
|
18
|
+
export const referrerAccountId = latestAccountPackage(generated.referrerAccountId);
|
|
19
|
+
export const referrerReceiveAddress = latestAccountPackage(generated.referrerReceiveAddress);
|
|
20
|
+
export const receiveAddress = latestAccountPackage(generated.receiveAddress);
|
|
21
|
+
export const generateAuth = latestAccountPackage(generated.generateAuth);
|
|
22
|
+
export const generateAuthAsObject = latestAccountPackage(generated.generateAuthAsObject);
|
|
23
|
+
export const share = latestAccountPackage(generated.share);
|
|
24
|
+
export const loadAccountMut = latestAccountPackage(generated.loadAccountMut);
|
|
25
|
+
export const settle = latestAccountPackage(generated.settle);
|
|
26
|
+
export const receiveCoin = latestAccountPackage(generated.receiveCoin);
|
|
27
|
+
export const receiveCoinAtAccountId = latestAccountPackage(generated.receiveCoinAtAccountId);
|
|
28
|
+
export const deposit = latestAccountPackage(generated.deposit);
|
|
29
|
+
export const withdraw = latestAccountPackage(generated.withdraw);
|
|
30
|
+
export const depositFunds = latestAccountPackage(generated.depositFunds);
|
|
31
|
+
export const withdrawFunds = latestAccountPackage(generated.withdrawFunds);
|
|
32
|
+
// Generic, so written out to keep `Data`.
|
|
33
|
+
export function attach<Data extends BcsType<any>>(
|
|
34
|
+
options: WithLatestConfig<generated.AttachOptions<Data>>,
|
|
35
|
+
) {
|
|
36
|
+
return (
|
|
37
|
+
latestAccountPackage(generated.attach) as (
|
|
38
|
+
options: WithLatestConfig<generated.AttachOptions<Data>>,
|
|
39
|
+
) => ReturnType<typeof generated.attach<Data>>
|
|
40
|
+
)(options);
|
|
41
|
+
}
|
|
42
|
+
export const hasData = latestAccountPackage(generated.hasData);
|
|
43
|
+
export const borrowData = latestAccountPackage(generated.borrowData);
|
|
44
|
+
export const borrowDataMut = latestAccountPackage(generated.borrowDataMut);
|
|
45
|
+
export const detach = latestAccountPackage(generated.detach);
|
|
46
|
+
|
|
47
|
+
/** Every generated function wrapped above, for the completeness test. */
|
|
48
|
+
export const WRAPPED = Object.freeze([
|
|
49
|
+
'id',
|
|
50
|
+
'loadAccount',
|
|
51
|
+
'balance',
|
|
52
|
+
'owner',
|
|
53
|
+
'accountId',
|
|
54
|
+
'referrerAccountId',
|
|
55
|
+
'referrerReceiveAddress',
|
|
56
|
+
'receiveAddress',
|
|
57
|
+
'generateAuth',
|
|
58
|
+
'generateAuthAsObject',
|
|
59
|
+
'share',
|
|
60
|
+
'loadAccountMut',
|
|
61
|
+
'settle',
|
|
62
|
+
'receiveCoin',
|
|
63
|
+
'receiveCoinAtAccountId',
|
|
64
|
+
'deposit',
|
|
65
|
+
'withdraw',
|
|
66
|
+
'depositFunds',
|
|
67
|
+
'withdrawFunds',
|
|
68
|
+
'attach',
|
|
69
|
+
'hasData',
|
|
70
|
+
'borrowData',
|
|
71
|
+
'borrowDataMut',
|
|
72
|
+
'detach',
|
|
73
|
+
] as const);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// Account calls target the latest `account` package, while `accountPackageId` stays the
|
|
5
|
+
// original id everywhere: the derived wrapper and account addresses and every type tag are
|
|
6
|
+
// built from it, because Move types keep their defining package across upgrades. A PTB can't
|
|
7
|
+
// call a package at an older version than another package in it links, and Predict's Version 5
|
|
8
|
+
// links account v2, so an account call at the original id beside it aborts `InvalidLinkage`.
|
|
9
|
+
// The generated bindings resolve their package from `config.accountPackageId`, so every one is
|
|
10
|
+
// wrapped here to resolve `package`, then `config.accountPackageIdLatest`, then that.
|
|
11
|
+
|
|
12
|
+
export interface AccountCallOptions {
|
|
13
|
+
package?: string;
|
|
14
|
+
config?: { accountPackageId?: string; accountPackageIdLatest?: string };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** An options type whose `config` also accepts the latest account package. */
|
|
18
|
+
export type WithLatestConfig<Options> = Options extends { config?: infer Config }
|
|
19
|
+
? Omit<Options, 'config'> & { config?: Config & { accountPackageIdLatest?: string } }
|
|
20
|
+
: Options;
|
|
21
|
+
|
|
22
|
+
/** A generated call whose options' `config` also accepts `accountPackageIdLatest`. */
|
|
23
|
+
export type LatestAccountCall<Call> = Call extends (...args: infer Args) => infer Result
|
|
24
|
+
? (...args: { [K in keyof Args]: WithLatestConfig<Args[K]> }) => Result
|
|
25
|
+
: never;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The generated call with its package resolved to the latest account package. Options stay
|
|
29
|
+
* optional where the generated call's are; `config` also accepts `accountPackageIdLatest`.
|
|
30
|
+
*/
|
|
31
|
+
export function latestAccountPackage<Call extends (options: never) => unknown>(
|
|
32
|
+
call: Call,
|
|
33
|
+
): LatestAccountCall<Call> {
|
|
34
|
+
const wrapped = (options?: AccountCallOptions) => {
|
|
35
|
+
const target = options?.package ?? options?.config?.accountPackageIdLatest;
|
|
36
|
+
return (call as unknown as (options?: AccountCallOptions) => unknown)(
|
|
37
|
+
target ? { ...options, package: target } : options,
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
return wrapped as unknown as LatestAccountCall<Call>;
|
|
41
|
+
}
|
package/src/account.ts
CHANGED
|
@@ -8,8 +8,8 @@ import type {
|
|
|
8
8
|
} from '@mysten/sui/transactions';
|
|
9
9
|
import { deriveObjectID } from '@mysten/sui/utils';
|
|
10
10
|
|
|
11
|
-
import * as account from './
|
|
12
|
-
import * as accountRegistry from './
|
|
11
|
+
import * as account from './account-bindings/account.js';
|
|
12
|
+
import * as accountRegistry from './account-bindings/account-registry.js';
|
|
13
13
|
import type { AccountConfig as GeneratedAccountConfig } from './contracts/account/config-arguments.js';
|
|
14
14
|
import { MAINNET_ACCOUNT } from './deployments/mainnet.js';
|
|
15
15
|
import { TESTNET_ACCOUNT } from './deployments/testnet.js';
|
|
@@ -36,10 +36,21 @@ export type { DeployedNetwork } from './deployments/index.js';
|
|
|
36
36
|
* wrapper-address derivation needs plain ids.
|
|
37
37
|
*/
|
|
38
38
|
export interface AccountConfig extends GeneratedAccountConfig {
|
|
39
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The ORIGINAL `account` Move package id. Type tags and the derived wrapper address are built
|
|
41
|
+
* from it, so it never moves to an upgraded package: that would derive addresses nothing lives
|
|
42
|
+
* at, and a coin sent to one is lost.
|
|
43
|
+
*/
|
|
40
44
|
accountPackageId: string;
|
|
41
45
|
/** The shared `AccountRegistry` object id. */
|
|
42
46
|
accountRegistry: string;
|
|
47
|
+
/**
|
|
48
|
+
* The latest `account` package, once the network has upgraded it: the call target of every
|
|
49
|
+
* builder here. A PTB can't call account at an older version than another package in it links
|
|
50
|
+
* (Predict's Version 5 links account v2), and `receiveCoin` / `receiveCoinAtAccountId` exist
|
|
51
|
+
* only from v2. Absent while the network runs v1: calls then target `accountPackageId`.
|
|
52
|
+
*/
|
|
53
|
+
accountPackageIdLatest?: string;
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
/**
|
|
@@ -192,6 +203,77 @@ export class AccountContract {
|
|
|
192
203
|
};
|
|
193
204
|
}
|
|
194
205
|
|
|
206
|
+
/**
|
|
207
|
+
* @description Move a `Coin<T>` that was transferred to an account's wrapper address into
|
|
208
|
+
* the account's stored balance (`receive_coin`). Permissionless: anyone may submit it, and
|
|
209
|
+
* value only enters the account the coin was addressed to. A sender that can only transfer a
|
|
210
|
+
* coin to an address (a bridge mint, for example) sends it to `deriveAccountWrapperId(owner)`.
|
|
211
|
+
* The coin can arrive before the account exists and waits there until the owner creates it.
|
|
212
|
+
* @param {object} params Wrapper id, the received coin's object id (or a `Receiving` input),
|
|
213
|
+
* and its coin type
|
|
214
|
+
* @returns A function that takes a Transaction object
|
|
215
|
+
* @throws if the config has no `accountPackageIdLatest`, i.e. the network still runs account v1
|
|
216
|
+
*/
|
|
217
|
+
receiveCoin(params: {
|
|
218
|
+
wrapperId: string;
|
|
219
|
+
coin: string | TransactionObjectArgument;
|
|
220
|
+
coinType: string;
|
|
221
|
+
}) {
|
|
222
|
+
const packageId = this.#latestPackage('receiveCoin');
|
|
223
|
+
return (tx: Transaction): TransactionResult =>
|
|
224
|
+
tx.add(
|
|
225
|
+
account.receiveCoin({
|
|
226
|
+
package: packageId,
|
|
227
|
+
arguments: {
|
|
228
|
+
wrapper: params.wrapperId,
|
|
229
|
+
coin: typeof params.coin === 'string' ? tx.object(params.coin) : params.coin,
|
|
230
|
+
},
|
|
231
|
+
typeArguments: [params.coinType],
|
|
232
|
+
}),
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @description `receiveCoin` for a coin sent to the account's canonical ID (`account_id`,
|
|
238
|
+
* the address `account_registry::derived_address` returns) instead of its wrapper address.
|
|
239
|
+
* A `Receiving` input can't name its owner, so pick the call from where the coin sits: the
|
|
240
|
+
* wrong one aborts `EUnableToReceiveObject`. Senders should use the wrapper address.
|
|
241
|
+
* @param {object} params Wrapper id, the received coin's object id (or a `Receiving` input),
|
|
242
|
+
* and its coin type
|
|
243
|
+
* @returns A function that takes a Transaction object
|
|
244
|
+
* @throws if the config has no `accountPackageIdLatest`, i.e. the network still runs account v1
|
|
245
|
+
*/
|
|
246
|
+
receiveCoinAtAccountId(params: {
|
|
247
|
+
wrapperId: string;
|
|
248
|
+
coin: string | TransactionObjectArgument;
|
|
249
|
+
coinType: string;
|
|
250
|
+
}) {
|
|
251
|
+
const packageId = this.#latestPackage('receiveCoinAtAccountId');
|
|
252
|
+
return (tx: Transaction): TransactionResult =>
|
|
253
|
+
tx.add(
|
|
254
|
+
account.receiveCoinAtAccountId({
|
|
255
|
+
package: packageId,
|
|
256
|
+
arguments: {
|
|
257
|
+
wrapper: params.wrapperId,
|
|
258
|
+
coin: typeof params.coin === 'string' ? tx.object(params.coin) : params.coin,
|
|
259
|
+
},
|
|
260
|
+
typeArguments: [params.coinType],
|
|
261
|
+
}),
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// The call target for the functions added in account v2, which v1 doesn't have.
|
|
266
|
+
#latestPackage(builder: string): string {
|
|
267
|
+
const latest = this.#config.accountPackageIdLatest;
|
|
268
|
+
if (!latest) {
|
|
269
|
+
throw new Error(
|
|
270
|
+
`@mysten/deepbook-v3/account: ${builder} calls a function added in account v2, and this ` +
|
|
271
|
+
'config has no `accountPackageIdLatest` (the network still runs account v1).',
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
return latest;
|
|
275
|
+
}
|
|
276
|
+
|
|
195
277
|
/**
|
|
196
278
|
* @description Borrow the `Account` out of its wrapper — the read-side entry point apps
|
|
197
279
|
* chain their own getters onto (`account::balance<T>`, an app's own data accessors).
|
|
@@ -235,7 +317,9 @@ export class AccountContract {
|
|
|
235
317
|
// package's root — the root already exports a different `Account`
|
|
236
318
|
// (`@deepbook/core::account::Account`, the per-pool trading account) and the two
|
|
237
319
|
// have unrelated layouts. Keep them separated by subpath.
|
|
238
|
-
|
|
239
|
-
|
|
320
|
+
// The move calls resolve their package to `config.accountPackageIdLatest` when the config has one
|
|
321
|
+
// (see `account-bindings/latest.ts`); `accountPackageId` stays the original for derivation.
|
|
322
|
+
export * as accountMoveCalls from './account-bindings/account.js';
|
|
323
|
+
export * as accountRegistryMoveCalls from './account-bindings/account-registry.js';
|
|
240
324
|
export * as accountEvents from './contracts/account/account_events.js';
|
|
241
325
|
export { Account, AccountWrapper } from './contracts/account/account.js';
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* application-scoped data. Consuming `Auth` is the mutable-borrow boundary: owner
|
|
8
8
|
* auth is checked against the account, while package-issued app auth yields the
|
|
9
9
|
* same full `&mut Account` and is not bound to an owner or operation. The wrapper
|
|
10
|
-
* address receives accumulator funds; a distinct derived
|
|
11
|
-
* the account and anchors app data, while typed balances
|
|
12
|
-
* account. App data is namespaced by witness type, requires
|
|
13
|
-
* mutate, and remains publicly readable.
|
|
10
|
+
* address receives accumulator funds and transferred coins; a distinct derived
|
|
11
|
+
* account UID identifies the account and anchors app data, while typed balances
|
|
12
|
+
* remain embedded in the account. App data is namespaced by witness type, requires
|
|
13
|
+
* `Permit<App>` to mutate, and remains publicly readable.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import {
|
|
@@ -407,6 +407,75 @@ export function settle(options: SettleOptions) {
|
|
|
407
407
|
typeArguments: options.typeArguments,
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
+
export interface ReceiveCoinArguments {
|
|
411
|
+
wrapper: RawTransactionArgument<string>;
|
|
412
|
+
coin: TransactionArgument;
|
|
413
|
+
}
|
|
414
|
+
export interface ReceiveCoinOptions {
|
|
415
|
+
package?: string;
|
|
416
|
+
arguments:
|
|
417
|
+
ReceiveCoinArguments | [wrapper: RawTransactionArgument<string>, coin: TransactionArgument];
|
|
418
|
+
config?: {
|
|
419
|
+
accountPackageId?: string;
|
|
420
|
+
};
|
|
421
|
+
typeArguments: [string];
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Permissionlessly folds a `Coin<T>` transferred to the wrapper address into
|
|
425
|
+
* stored account balance, for senders that can only transfer a coin and owners who
|
|
426
|
+
* have not signed. Value only enters the account, and only the wrapper UID the
|
|
427
|
+
* coin was addressed to can receive it. A coin may arrive before the account
|
|
428
|
+
* exists: `account_registry::derived_wrapper_address` is its recipient.
|
|
429
|
+
*/
|
|
430
|
+
export function receiveCoin(options: ReceiveCoinOptions) {
|
|
431
|
+
const packageAddress =
|
|
432
|
+
options.package ?? options.config?.accountPackageId ?? '@local-pkg/account';
|
|
433
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
434
|
+
const parameterNames = ['wrapper', 'coin'];
|
|
435
|
+
return (tx: Transaction) =>
|
|
436
|
+
tx.moveCall({
|
|
437
|
+
package: packageAddress,
|
|
438
|
+
module: 'account',
|
|
439
|
+
function: 'receive_coin',
|
|
440
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
441
|
+
typeArguments: options.typeArguments,
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
export interface ReceiveCoinAtAccountIdArguments {
|
|
445
|
+
wrapper: RawTransactionArgument<string>;
|
|
446
|
+
coin: TransactionArgument;
|
|
447
|
+
}
|
|
448
|
+
export interface ReceiveCoinAtAccountIdOptions {
|
|
449
|
+
package?: string;
|
|
450
|
+
arguments:
|
|
451
|
+
| ReceiveCoinAtAccountIdArguments
|
|
452
|
+
| [wrapper: RawTransactionArgument<string>, coin: TransactionArgument];
|
|
453
|
+
config?: {
|
|
454
|
+
accountPackageId?: string;
|
|
455
|
+
};
|
|
456
|
+
typeArguments: [string];
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* `receive_coin` for a coin sent to the canonical account address, the account's
|
|
460
|
+
* public identity, which can get copied as a destination. Senders should still use
|
|
461
|
+
* the wrapper address, the one that also takes `send_funds`. A `Receiving` cannot
|
|
462
|
+
* reveal its owner, so the caller picks the function from the coin's owner; the
|
|
463
|
+
* wrong one aborts.
|
|
464
|
+
*/
|
|
465
|
+
export function receiveCoinAtAccountId(options: ReceiveCoinAtAccountIdOptions) {
|
|
466
|
+
const packageAddress =
|
|
467
|
+
options.package ?? options.config?.accountPackageId ?? '@local-pkg/account';
|
|
468
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
469
|
+
const parameterNames = ['wrapper', 'coin'];
|
|
470
|
+
return (tx: Transaction) =>
|
|
471
|
+
tx.moveCall({
|
|
472
|
+
package: packageAddress,
|
|
473
|
+
module: 'account',
|
|
474
|
+
function: 'receive_coin_at_account_id',
|
|
475
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
476
|
+
typeArguments: options.typeArguments,
|
|
477
|
+
});
|
|
478
|
+
}
|
|
410
479
|
export interface DepositArguments {
|
|
411
480
|
self: TransactionArgument;
|
|
412
481
|
coin: RawTransactionArgument<string>;
|
|
@@ -94,7 +94,7 @@ export interface DerivedWrapperAddressOptions {
|
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Returns the deterministic wrapper address for external discovery, accumulator
|
|
97
|
-
* delivery, and PTB construction.
|
|
97
|
+
* and coin delivery, and PTB construction.
|
|
98
98
|
*/
|
|
99
99
|
export function derivedWrapperAddress(options: DerivedWrapperAddressOptions) {
|
|
100
100
|
const packageAddress =
|