@mysten/deepbook-v3 1.6.6 → 2.0.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/_virtual/rolldown_runtime.mjs +18 -0
  3. package/dist/client.d.mts +11 -8
  4. package/dist/client.d.mts.map +1 -1
  5. package/dist/client.mjs +3 -2
  6. package/dist/client.mjs.map +1 -1
  7. package/dist/contracts/deepbook/account.d.mts +18 -18
  8. package/dist/contracts/deepbook/account.d.mts.map +1 -1
  9. package/dist/contracts/deepbook/balances.d.mts +4 -4
  10. package/dist/contracts/deepbook/balances.d.mts.map +1 -1
  11. package/dist/contracts/deepbook/deep_price.d.mts +3 -3
  12. package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
  13. package/dist/contracts/deepbook_margin/margin_manager.mjs +1 -319
  14. package/dist/contracts/deepbook_margin/margin_manager.mjs.map +1 -1
  15. package/dist/contracts/deepbook_margin/margin_manager_upgraded.mjs +386 -0
  16. package/dist/contracts/deepbook_margin/margin_manager_upgraded.mjs.map +1 -0
  17. package/dist/contracts/deepbook_margin/oracle.mjs +9 -0
  18. package/dist/contracts/deepbook_margin/oracle.mjs.map +1 -1
  19. package/dist/contracts/deepbook_margin/pool_proxy.mjs +1 -383
  20. package/dist/contracts/deepbook_margin/pool_proxy.mjs.map +1 -1
  21. package/dist/contracts/deepbook_margin/pool_proxy_upgraded.mjs +340 -0
  22. package/dist/contracts/deepbook_margin/pool_proxy_upgraded.mjs.map +1 -0
  23. package/dist/contracts/margin_liquidation/liquidation_vault.mjs +33 -17
  24. package/dist/contracts/margin_liquidation/liquidation_vault.mjs.map +1 -1
  25. package/dist/index.d.mts +4 -3
  26. package/dist/index.mjs +2 -2
  27. package/dist/pyth/PriceServiceConnection.d.mts +18 -3
  28. package/dist/pyth/PriceServiceConnection.d.mts.map +1 -1
  29. package/dist/pyth/PriceServiceConnection.mjs +35 -4
  30. package/dist/pyth/PriceServiceConnection.mjs.map +1 -1
  31. package/dist/queries/priceFeedQueries.mjs +50 -18
  32. package/dist/queries/priceFeedQueries.mjs.map +1 -1
  33. package/dist/transactions/balanceManager.d.mts +12 -12
  34. package/dist/transactions/deepbook.d.mts +20 -20
  35. package/dist/transactions/deepbookAdmin.d.mts +4 -4
  36. package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
  37. package/dist/transactions/marginAdmin.d.mts +7 -7
  38. package/dist/transactions/marginAdmin.d.mts.map +1 -1
  39. package/dist/transactions/marginAdmin.mjs +2 -2
  40. package/dist/transactions/marginAdmin.mjs.map +1 -1
  41. package/dist/transactions/marginLiquidations.d.mts +3 -3
  42. package/dist/transactions/marginLiquidations.d.mts.map +1 -1
  43. package/dist/transactions/marginLiquidations.mjs +19 -7
  44. package/dist/transactions/marginLiquidations.mjs.map +1 -1
  45. package/dist/transactions/marginMaintainer.d.mts +5 -5
  46. package/dist/transactions/marginManager.d.mts +32 -32
  47. package/dist/transactions/marginManager.d.mts.map +1 -1
  48. package/dist/transactions/marginManager.mjs +43 -34
  49. package/dist/transactions/marginManager.mjs.map +1 -1
  50. package/dist/transactions/marginPool.d.mts +18 -18
  51. package/dist/transactions/marginRegistry.d.mts +16 -16
  52. package/dist/transactions/marginTPSL.d.mts +10 -10
  53. package/dist/transactions/marginTPSL.d.mts.map +1 -1
  54. package/dist/transactions/marginTPSL.mjs +19 -10
  55. package/dist/transactions/marginTPSL.mjs.map +1 -1
  56. package/dist/transactions/poolProxy.d.mts.map +1 -1
  57. package/dist/transactions/poolProxy.mjs +34 -27
  58. package/dist/transactions/poolProxy.mjs.map +1 -1
  59. package/dist/types/index.d.mts +16 -1
  60. package/dist/types/index.d.mts.map +1 -1
  61. package/dist/types/index.mjs.map +1 -1
  62. package/dist/utils/config.d.mts +30 -10
  63. package/dist/utils/config.d.mts.map +1 -1
  64. package/dist/utils/config.mjs +33 -4
  65. package/dist/utils/config.mjs.map +1 -1
  66. package/dist/utils/constants.d.mts +32 -1
  67. package/dist/utils/constants.d.mts.map +1 -1
  68. package/dist/utils/constants.mjs +54 -23
  69. package/dist/utils/constants.mjs.map +1 -1
  70. package/package.json +2 -2
  71. package/src/client.ts +9 -1
  72. package/src/contracts/deepbook_margin/margin_manager.ts +140 -10
  73. package/src/contracts/deepbook_margin/margin_manager_upgraded.ts +651 -0
  74. package/src/contracts/deepbook_margin/oracle.ts +59 -0
  75. package/src/contracts/deepbook_margin/pool_proxy.ts +600 -584
  76. package/src/contracts/deepbook_margin/pool_proxy_upgraded.ts +614 -0
  77. package/src/contracts/margin_liquidation/liquidation_vault.ts +142 -0
  78. package/src/index.ts +4 -0
  79. package/src/pyth/PriceServiceConnection.ts +69 -8
  80. package/src/queries/priceFeedQueries.ts +74 -24
  81. package/src/transactions/marginAdmin.ts +2 -4
  82. package/src/transactions/marginLiquidations.ts +20 -6
  83. package/src/transactions/marginManager.ts +43 -33
  84. package/src/transactions/marginTPSL.ts +19 -9
  85. package/src/transactions/poolProxy.ts +34 -30
  86. package/src/types/index.ts +16 -0
  87. package/src/utils/config.ts +69 -9
  88. package/src/utils/constants.ts +88 -25
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":["#coins","#pools","#marginPools"],"sources":["../../src/utils/config.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport type { SuiClientTypes } from '@mysten/sui/client';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\n\nimport { BalanceManagerContract } from '../transactions/balanceManager.js';\nimport type { BalanceManager, MarginManager, Coin, Pool, MarginPool } from '../types/index.js';\nimport type { CoinMap, PoolMap, MarginPoolMap, DeepbookPackageIds } from './constants.js';\nimport { ResourceNotFoundError, ConfigurationError, ErrorMessages } from './errors.js';\nimport {\n\tmainnetCoins,\n\tmainnetPackageIds,\n\tmainnetPools,\n\ttestnetCoins,\n\ttestnetPackageIds,\n\ttestnetPools,\n\tmainnetMarginPools,\n\ttestnetMarginPools,\n\tmainnetPythConfigs,\n\ttestnetPythConfigs,\n} from './constants.js';\n\n// Constants for numerical precision and scaling\nexport const FLOAT_SCALAR = 1_000_000_000; // 10^9 - Used for floating point representation\nexport const DEEP_SCALAR = 1_000_000; // 10^6 - DEEP token decimal places\n\n// Time-related constants\nexport const MAX_TIMESTAMP = 1_844_674_407_370_955_161n; // Maximum Unix timestamp (approximately year 2554)\nexport const PRICE_INFO_OBJECT_MAX_AGE_MS = 30_000; // 30 seconds in milliseconds\n\n// Transaction and fee constants\nexport const GAS_BUDGET = 250_000_000; // 0.25 SUI (0.5 * 500M MIST)\nexport const POOL_CREATION_FEE_DEEP = 500_000_000; // 500 DEEP tokens (500 * 10^6)\n\nexport class DeepBookConfig {\n\t#coins: CoinMap;\n\t#pools: PoolMap;\n\t#marginPools: MarginPoolMap;\n\tnetwork: SuiClientTypes.Network;\n\tbalanceManagers: { [key: string]: BalanceManager };\n\tmarginManagers: { [key: string]: MarginManager };\n\taddress: string;\n\tpyth: {\n\t\tpythStateId: string;\n\t\twormholeStateId: string;\n\t};\n\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\tadminCap?: string;\n\tmarginAdminCap?: string;\n\tmarginMaintainerCap?: string;\n\n\tbalanceManager: BalanceManagerContract;\n\n\tconstructor({\n\t\tnetwork,\n\t\taddress,\n\t\tadminCap,\n\t\tmarginAdminCap,\n\t\tmarginMaintainerCap,\n\t\tbalanceManagers,\n\t\tmarginManagers,\n\t\tcoins,\n\t\tpools,\n\t\tmarginPools,\n\t\tpackageIds,\n\t\tpyth,\n\t}: {\n\t\tnetwork: SuiClientTypes.Network;\n\t\taddress: string;\n\t\tadminCap?: string;\n\t\tmarginAdminCap?: string;\n\t\tmarginMaintainerCap?: string;\n\t\tbalanceManagers?: { [key: string]: BalanceManager };\n\t\tmarginManagers?: { [key: string]: MarginManager };\n\t\tcoins?: CoinMap;\n\t\tpools?: PoolMap;\n\t\tmarginPools?: MarginPoolMap;\n\t\tpackageIds?: DeepbookPackageIds;\n\t\tpyth?: { pythStateId: string; wormholeStateId: string };\n\t}) {\n\t\tthis.network = network;\n\t\tthis.address = normalizeSuiAddress(address);\n\t\tthis.adminCap = adminCap;\n\t\tthis.marginAdminCap = marginAdminCap;\n\t\tthis.marginMaintainerCap = marginMaintainerCap;\n\t\tthis.balanceManagers = balanceManagers || {};\n\t\tthis.marginManagers = marginManagers || {};\n\n\t\tif (packageIds) {\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = packageIds.DEEPBOOK_PACKAGE_ID || '';\n\t\t\tthis.REGISTRY_ID = packageIds.REGISTRY_ID || '';\n\t\t\tthis.DEEP_TREASURY_ID = packageIds.DEEP_TREASURY_ID || '';\n\t\t\tthis.MARGIN_PACKAGE_ID = packageIds.MARGIN_PACKAGE_ID || '';\n\t\t\tthis.MARGIN_V1 = packageIds.MARGIN_V1 || '';\n\t\t\tthis.MARGIN_REGISTRY_ID = packageIds.MARGIN_REGISTRY_ID || '';\n\t\t\tthis.LIQUIDATION_PACKAGE_ID = packageIds.LIQUIDATION_PACKAGE_ID || '';\n\t\t\tthis.#coins = coins || {};\n\t\t\tthis.#pools = pools || {};\n\t\t\tthis.#marginPools = marginPools || {};\n\t\t\tthis.pyth = pyth || { pythStateId: '', wormholeStateId: '' };\n\t\t} else if (network === 'mainnet') {\n\t\t\tthis.#coins = coins || mainnetCoins;\n\t\t\tthis.#pools = pools || mainnetPools;\n\t\t\tthis.#marginPools = marginPools || mainnetMarginPools;\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = mainnetPackageIds.DEEPBOOK_PACKAGE_ID;\n\t\t\tthis.REGISTRY_ID = mainnetPackageIds.REGISTRY_ID;\n\t\t\tthis.DEEP_TREASURY_ID = mainnetPackageIds.DEEP_TREASURY_ID;\n\t\t\tthis.MARGIN_PACKAGE_ID = mainnetPackageIds.MARGIN_PACKAGE_ID;\n\t\t\tthis.MARGIN_V1 = mainnetPackageIds.MARGIN_V1;\n\t\t\tthis.MARGIN_REGISTRY_ID = mainnetPackageIds.MARGIN_REGISTRY_ID;\n\t\t\tthis.LIQUIDATION_PACKAGE_ID = mainnetPackageIds.LIQUIDATION_PACKAGE_ID;\n\t\t\tthis.pyth = mainnetPythConfigs;\n\t\t} else if (network === 'testnet') {\n\t\t\tthis.#coins = coins || testnetCoins;\n\t\t\tthis.#pools = pools || testnetPools;\n\t\t\tthis.#marginPools = marginPools || testnetMarginPools;\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = testnetPackageIds.DEEPBOOK_PACKAGE_ID;\n\t\t\tthis.REGISTRY_ID = testnetPackageIds.REGISTRY_ID;\n\t\t\tthis.DEEP_TREASURY_ID = testnetPackageIds.DEEP_TREASURY_ID;\n\t\t\tthis.MARGIN_PACKAGE_ID = testnetPackageIds.MARGIN_PACKAGE_ID;\n\t\t\tthis.MARGIN_V1 = testnetPackageIds.MARGIN_V1;\n\t\t\tthis.MARGIN_REGISTRY_ID = testnetPackageIds.MARGIN_REGISTRY_ID;\n\t\t\tthis.LIQUIDATION_PACKAGE_ID = testnetPackageIds.LIQUIDATION_PACKAGE_ID;\n\t\t\tthis.pyth = testnetPythConfigs;\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`Network '${network}' is not supported by default. Provide custom 'packageIds' for non-standard networks.`,\n\t\t\t);\n\t\t}\n\n\t\tthis.balanceManager = new BalanceManagerContract(this);\n\t}\n\n\trequirePyth() {\n\t\tif (!this.pyth.pythStateId || !this.pyth.wormholeStateId) {\n\t\t\tthrow new ConfigurationError(\n\t\t\t\t\"Pyth configuration is required for price feed operations. Provide 'pyth' when using custom packageIds.\",\n\t\t\t);\n\t\t}\n\t}\n\n\t// Getters\n\tgetCoin(key: string): Coin {\n\t\tconst coin = this.#coins[key];\n\t\tif (!coin) {\n\t\t\tthrow new ResourceNotFoundError('Coin', key);\n\t\t}\n\n\t\treturn coin;\n\t}\n\n\tgetPool(key: string): Pool {\n\t\tconst pool = this.#pools[key];\n\t\tif (!pool) {\n\t\t\tthrow new ResourceNotFoundError('Pool', key);\n\t\t}\n\n\t\treturn pool;\n\t}\n\n\tgetMarginPool(key: string): MarginPool {\n\t\tconst pool = this.#marginPools[key];\n\t\tif (!pool) {\n\t\t\tthrow new ResourceNotFoundError('Margin pool', key);\n\t\t}\n\n\t\treturn pool;\n\t}\n\n\t/**\n\t * @description Get the balance manager by key\n\t * @param managerKey Key of the balance manager\n\t * @returns The BalanceManager object\n\t */\n\tgetBalanceManager(managerKey: string): BalanceManager {\n\t\tif (!Object.hasOwn(this.balanceManagers, managerKey)) {\n\t\t\tthrow new Error(ErrorMessages.BALANCE_MANAGER_NOT_FOUND(managerKey));\n\t\t}\n\n\t\treturn this.balanceManagers[managerKey];\n\t}\n\n\t/**\n\t * @description Get the margin manager by key\n\t * @param managerKey Key of the margin manager\n\t * @returns The MarginManager object\n\t */\n\tgetMarginManager(managerKey: string): MarginManager {\n\t\tif (!Object.hasOwn(this.marginManagers, managerKey)) {\n\t\t\tthrow new Error(ErrorMessages.MARGIN_MANAGER_NOT_FOUND(managerKey));\n\t\t}\n\n\t\treturn this.marginManagers[managerKey];\n\t}\n}\n"],"mappings":";;;;;;AAuBA,MAAa,eAAe;AAC5B,MAAa,cAAc;AAG3B,MAAa,gBAAgB;AAC7B,MAAa,+BAA+B;AAG5C,MAAa,aAAa;AAC1B,MAAa,yBAAyB;AAEtC,IAAa,iBAAb,MAA4B;CAC3B;CACA;CACA;CAuBA,YAAY,EACX,SACA,SACA,UACA,gBACA,qBACA,iBACA,gBACA,OACA,OACA,aACA,YACA,QAcE;AACF,OAAK,UAAU;AACf,OAAK,UAAU,oBAAoB,QAAQ;AAC3C,OAAK,WAAW;AAChB,OAAK,iBAAiB;AACtB,OAAK,sBAAsB;AAC3B,OAAK,kBAAkB,mBAAmB,EAAE;AAC5C,OAAK,iBAAiB,kBAAkB,EAAE;AAE1C,MAAI,YAAY;AACf,QAAK,sBAAsB,WAAW,uBAAuB;AAC7D,QAAK,cAAc,WAAW,eAAe;AAC7C,QAAK,mBAAmB,WAAW,oBAAoB;AACvD,QAAK,oBAAoB,WAAW,qBAAqB;AACzD,QAAK,YAAY,WAAW,aAAa;AACzC,QAAK,qBAAqB,WAAW,sBAAsB;AAC3D,QAAK,yBAAyB,WAAW,0BAA0B;AACnE,SAAKA,QAAS,SAAS,EAAE;AACzB,SAAKC,QAAS,SAAS,EAAE;AACzB,SAAKC,cAAe,eAAe,EAAE;AACrC,QAAK,OAAO,QAAQ;IAAE,aAAa;IAAI,iBAAiB;IAAI;aAClD,YAAY,WAAW;AACjC,SAAKF,QAAS,SAAS;AACvB,SAAKC,QAAS,SAAS;AACvB,SAAKC,cAAe,eAAe;AACnC,QAAK,sBAAsB,kBAAkB;AAC7C,QAAK,cAAc,kBAAkB;AACrC,QAAK,mBAAmB,kBAAkB;AAC1C,QAAK,oBAAoB,kBAAkB;AAC3C,QAAK,YAAY,kBAAkB;AACnC,QAAK,qBAAqB,kBAAkB;AAC5C,QAAK,yBAAyB,kBAAkB;AAChD,QAAK,OAAO;aACF,YAAY,WAAW;AACjC,SAAKF,QAAS,SAAS;AACvB,SAAKC,QAAS,SAAS;AACvB,SAAKC,cAAe,eAAe;AACnC,QAAK,sBAAsB,kBAAkB;AAC7C,QAAK,cAAc,kBAAkB;AACrC,QAAK,mBAAmB,kBAAkB;AAC1C,QAAK,oBAAoB,kBAAkB;AAC3C,QAAK,YAAY,kBAAkB;AACnC,QAAK,qBAAqB,kBAAkB;AAC5C,QAAK,yBAAyB,kBAAkB;AAChD,QAAK,OAAO;QAEZ,OAAM,IAAI,MACT,YAAY,QAAQ,uFACpB;AAGF,OAAK,iBAAiB,IAAI,uBAAuB,KAAK;;CAGvD,cAAc;AACb,MAAI,CAAC,KAAK,KAAK,eAAe,CAAC,KAAK,KAAK,gBACxC,OAAM,IAAI,mBACT,yGACA;;CAKH,QAAQ,KAAmB;EAC1B,MAAM,OAAO,MAAKF,MAAO;AACzB,MAAI,CAAC,KACJ,OAAM,IAAI,sBAAsB,QAAQ,IAAI;AAG7C,SAAO;;CAGR,QAAQ,KAAmB;EAC1B,MAAM,OAAO,MAAKC,MAAO;AACzB,MAAI,CAAC,KACJ,OAAM,IAAI,sBAAsB,QAAQ,IAAI;AAG7C,SAAO;;CAGR,cAAc,KAAyB;EACtC,MAAM,OAAO,MAAKC,YAAa;AAC/B,MAAI,CAAC,KACJ,OAAM,IAAI,sBAAsB,eAAe,IAAI;AAGpD,SAAO;;;;;;;CAQR,kBAAkB,YAAoC;AACrD,MAAI,CAAC,OAAO,OAAO,KAAK,iBAAiB,WAAW,CACnD,OAAM,IAAI,MAAM,cAAc,0BAA0B,WAAW,CAAC;AAGrE,SAAO,KAAK,gBAAgB;;;;;;;CAQ7B,iBAAiB,YAAmC;AACnD,MAAI,CAAC,OAAO,OAAO,KAAK,gBAAgB,WAAW,CAClD,OAAM,IAAI,MAAM,cAAc,yBAAyB,WAAW,CAAC;AAGpE,SAAO,KAAK,eAAe"}
1
+ {"version":3,"file":"config.mjs","names":["#coins","#pools","#marginPools"],"sources":["../../src/utils/config.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport type { SuiClientTypes } from '@mysten/sui/client';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\n\nimport { BalanceManagerContract } from '../transactions/balanceManager.js';\nimport type {\n\tBalanceManager,\n\tMarginManager,\n\tCoin,\n\tPool,\n\tMarginPool,\n\tPythConfig,\n} from '../types/index.js';\nimport type { CoinMap, PoolMap, MarginPoolMap, DeepbookPackageIds } from './constants.js';\nimport { ResourceNotFoundError, ConfigurationError, ErrorMessages } from './errors.js';\nimport {\n\tmainnetCoins,\n\tmainnetPackageIds,\n\tmainnetPools,\n\ttestnetCoins,\n\ttestnetPackageIds,\n\ttestnetPools,\n\tmainnetMarginPools,\n\ttestnetMarginPools,\n\tmainnetPythConfigs,\n\ttestnetPythConfigs,\n} from './constants.js';\n\n// Constants for numerical precision and scaling\nexport const FLOAT_SCALAR = 1_000_000_000; // 10^9 - Used for floating point representation\nexport const DEEP_SCALAR = 1_000_000; // 10^6 - DEEP token decimal places\n\n// Time-related constants\nexport const MAX_TIMESTAMP = 1_844_674_407_370_955_161n; // Maximum Unix timestamp (approximately year 2554)\nexport const PRICE_INFO_OBJECT_MAX_AGE_MS = 30_000; // 30 seconds in milliseconds\n\n// Transaction and fee constants\nexport const GAS_BUDGET = 250_000_000; // 0.25 SUI (0.5 * 500M MIST)\nexport const POOL_CREATION_FEE_DEEP = 500_000_000; // 500 DEEP tokens (500 * 10^6)\n\nexport class DeepBookConfig {\n\t#coins: CoinMap;\n\t#pools: PoolMap;\n\t#marginPools: MarginPoolMap;\n\tnetwork: SuiClientTypes.Network;\n\tbalanceManagers: { [key: string]: BalanceManager };\n\tmarginManagers: { [key: string]: MarginManager };\n\taddress: string;\n\tpyth: PythConfig;\n\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\tadminCap?: string;\n\tmarginAdminCap?: string;\n\tmarginMaintainerCap?: string;\n\n\tbalanceManager: BalanceManagerContract;\n\n\tconstructor({\n\t\tnetwork,\n\t\taddress,\n\t\tadminCap,\n\t\tmarginAdminCap,\n\t\tmarginMaintainerCap,\n\t\tbalanceManagers,\n\t\tmarginManagers,\n\t\tcoins,\n\t\tpools,\n\t\tmarginPools,\n\t\tpackageIds,\n\t\tpyth,\n\t\tpythAccessToken,\n\t}: {\n\t\tnetwork: SuiClientTypes.Network;\n\t\taddress: string;\n\t\tadminCap?: string;\n\t\tmarginAdminCap?: string;\n\t\tmarginMaintainerCap?: string;\n\t\tbalanceManagers?: { [key: string]: BalanceManager };\n\t\tmarginManagers?: { [key: string]: MarginManager };\n\t\tcoins?: CoinMap;\n\t\tpools?: PoolMap;\n\t\tmarginPools?: MarginPoolMap;\n\t\tpackageIds?: DeepbookPackageIds;\n\t\tpyth?: PythConfig;\n\t\t/**\n\t\t * Bearer token for the Hermes serving Pyth's upgraded Core, which answers 401\n\t\t * without one. Set this rather than `pyth` when the built-in state objects are\n\t\t * correct and only the credential is missing — `pyth` replaces the whole config,\n\t\t * so setting a token through it means restating the state object ids.\n\t\t *\n\t\t * Applied after `pyth`, so if both carry a token this one wins.\n\t\t */\n\t\tpythAccessToken?: string;\n\t}) {\n\t\tthis.network = network;\n\t\tthis.address = normalizeSuiAddress(address);\n\t\tthis.adminCap = adminCap;\n\t\tthis.marginAdminCap = marginAdminCap;\n\t\tthis.marginMaintainerCap = marginMaintainerCap;\n\t\tthis.balanceManagers = balanceManagers || {};\n\t\tthis.marginManagers = marginManagers || {};\n\n\t\tif (packageIds) {\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = packageIds.DEEPBOOK_PACKAGE_ID || '';\n\t\t\tthis.REGISTRY_ID = packageIds.REGISTRY_ID || '';\n\t\t\tthis.DEEP_TREASURY_ID = packageIds.DEEP_TREASURY_ID || '';\n\t\t\tthis.MARGIN_PACKAGE_ID = packageIds.MARGIN_PACKAGE_ID || '';\n\t\t\tthis.MARGIN_V1 = packageIds.MARGIN_V1 || '';\n\t\t\tthis.MARGIN_REGISTRY_ID = packageIds.MARGIN_REGISTRY_ID || '';\n\t\t\tthis.LIQUIDATION_PACKAGE_ID = packageIds.LIQUIDATION_PACKAGE_ID || '';\n\t\t\tthis.#coins = coins || {};\n\t\t\tthis.#pools = pools || {};\n\t\t\tthis.#marginPools = marginPools || {};\n\t\t\tthis.pyth = pyth || { pythStateId: '', wormholeStateId: '' };\n\t\t} else if (network === 'mainnet') {\n\t\t\tthis.#coins = coins || mainnetCoins;\n\t\t\tthis.#pools = pools || mainnetPools;\n\t\t\tthis.#marginPools = marginPools || mainnetMarginPools;\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = mainnetPackageIds.DEEPBOOK_PACKAGE_ID;\n\t\t\tthis.REGISTRY_ID = mainnetPackageIds.REGISTRY_ID;\n\t\t\tthis.DEEP_TREASURY_ID = mainnetPackageIds.DEEP_TREASURY_ID;\n\t\t\tthis.MARGIN_PACKAGE_ID = mainnetPackageIds.MARGIN_PACKAGE_ID;\n\t\t\tthis.MARGIN_V1 = mainnetPackageIds.MARGIN_V1;\n\t\t\tthis.MARGIN_REGISTRY_ID = mainnetPackageIds.MARGIN_REGISTRY_ID;\n\t\t\tthis.LIQUIDATION_PACKAGE_ID = mainnetPackageIds.LIQUIDATION_PACKAGE_ID;\n\t\t\tthis.pyth = pyth || mainnetPythConfigs;\n\t\t} else if (network === 'testnet') {\n\t\t\tthis.#coins = coins || testnetCoins;\n\t\t\tthis.#pools = pools || testnetPools;\n\t\t\tthis.#marginPools = marginPools || testnetMarginPools;\n\t\t\tthis.DEEPBOOK_PACKAGE_ID = testnetPackageIds.DEEPBOOK_PACKAGE_ID;\n\t\t\tthis.REGISTRY_ID = testnetPackageIds.REGISTRY_ID;\n\t\t\tthis.DEEP_TREASURY_ID = testnetPackageIds.DEEP_TREASURY_ID;\n\t\t\tthis.MARGIN_PACKAGE_ID = testnetPackageIds.MARGIN_PACKAGE_ID;\n\t\t\tthis.MARGIN_V1 = testnetPackageIds.MARGIN_V1;\n\t\t\tthis.MARGIN_REGISTRY_ID = testnetPackageIds.MARGIN_REGISTRY_ID;\n\t\t\tthis.LIQUIDATION_PACKAGE_ID = testnetPackageIds.LIQUIDATION_PACKAGE_ID;\n\t\t\tthis.pyth = pyth || testnetPythConfigs;\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`Network '${network}' is not supported by default. Provide custom 'packageIds' for non-standard networks.`,\n\t\t\t);\n\t\t}\n\n\t\t// Applied after the branches so a token composes with the built-in state objects\n\t\t// instead of forcing the caller to restate them.\n\t\t// Empty is treated as absent rather than as a credential: `PYTH_TOKEN=` exported\n\t\t// blank is the common way this arrives, and a blank bearer header 401s with a\n\t\t// worse message than the configuration error.\n\t\tif (pythAccessToken) {\n\t\t\tthis.pyth = { ...this.pyth, accessToken: pythAccessToken };\n\t\t}\n\n\t\tthis.balanceManager = new BalanceManagerContract(this);\n\t}\n\n\trequirePyth() {\n\t\tconst { pythStateId, wormholeStateId } = this.pyth;\n\t\tif (!pythStateId || !wormholeStateId) {\n\t\t\tthrow new ConfigurationError(\n\t\t\t\t\"Pyth configuration is required for price feed operations. Provide 'pyth' when using custom packageIds.\",\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * The Pyth feed id for a coin under the active deployment.\n\t *\n\t * Pairs with {@link getPriceInfoObjectId}: Hermes is queried by feed id and the Move\n\t * call takes the object, so the two must come from the same deployment or the update\n\t * lands on an object the on-chain feed-id check then rejects.\n\t */\n\tgetFeedId(coinKey: string): string {\n\t\tconst { feed } = this.getCoin(coinKey);\n\n\t\tif (!feed) {\n\t\t\tthrow new ConfigurationError(`Coin '${coinKey}' has no Pyth feed id configured.`);\n\t\t}\n\n\t\treturn feed;\n\t}\n\n\t/**\n\t * The `PriceInfoObject` id for a coin on Pyth's upgraded Core.\n\t *\n\t * Throws rather than passing `undefined` into a move call: a feed may simply have no\n\t * object on the upgraded deployment yet, and the resulting on-chain abort\n\t * (`EPriceFeedIdMismatch`) does not say which coin was at fault.\n\t */\n\tgetPriceInfoObjectId(coinKey: string): string {\n\t\tconst { priceInfoObjectId } = this.getCoin(coinKey);\n\n\t\tif (!priceInfoObjectId) {\n\t\t\tthrow new ConfigurationError(\n\t\t\t\t`Coin '${coinKey}' has no priceInfoObjectId. Pyth's upgraded Core has no price feed object for it on ${this.network}, or the id is missing from your coin config.`,\n\t\t\t);\n\t\t}\n\n\t\treturn priceInfoObjectId;\n\t}\n\n\t// Getters\n\tgetCoin(key: string): Coin {\n\t\tconst coin = this.#coins[key];\n\t\tif (!coin) {\n\t\t\tthrow new ResourceNotFoundError('Coin', key);\n\t\t}\n\n\t\treturn coin;\n\t}\n\n\tgetPool(key: string): Pool {\n\t\tconst pool = this.#pools[key];\n\t\tif (!pool) {\n\t\t\tthrow new ResourceNotFoundError('Pool', key);\n\t\t}\n\n\t\treturn pool;\n\t}\n\n\tgetMarginPool(key: string): MarginPool {\n\t\tconst pool = this.#marginPools[key];\n\t\tif (!pool) {\n\t\t\tthrow new ResourceNotFoundError('Margin pool', key);\n\t\t}\n\n\t\treturn pool;\n\t}\n\n\t/**\n\t * @description Get the balance manager by key\n\t * @param managerKey Key of the balance manager\n\t * @returns The BalanceManager object\n\t */\n\tgetBalanceManager(managerKey: string): BalanceManager {\n\t\tif (!Object.hasOwn(this.balanceManagers, managerKey)) {\n\t\t\tthrow new Error(ErrorMessages.BALANCE_MANAGER_NOT_FOUND(managerKey));\n\t\t}\n\n\t\treturn this.balanceManagers[managerKey];\n\t}\n\n\t/**\n\t * @description Get the margin manager by key\n\t * @param managerKey Key of the margin manager\n\t * @returns The MarginManager object\n\t */\n\tgetMarginManager(managerKey: string): MarginManager {\n\t\tif (!Object.hasOwn(this.marginManagers, managerKey)) {\n\t\t\tthrow new Error(ErrorMessages.MARGIN_MANAGER_NOT_FOUND(managerKey));\n\t\t}\n\n\t\treturn this.marginManagers[managerKey];\n\t}\n}\n"],"mappings":";;;;;;AA8BA,MAAa,eAAe;AAC5B,MAAa,cAAc;AAG3B,MAAa,gBAAgB;AAC7B,MAAa,+BAA+B;AAG5C,MAAa,aAAa;AAC1B,MAAa,yBAAyB;AAEtC,IAAa,iBAAb,MAA4B;CAC3B;CACA;CACA;CAoBA,YAAY,EACX,SACA,SACA,UACA,gBACA,qBACA,iBACA,gBACA,OACA,OACA,aACA,YACA,MACA,mBAuBE;AACF,OAAK,UAAU;AACf,OAAK,UAAU,oBAAoB,QAAQ;AAC3C,OAAK,WAAW;AAChB,OAAK,iBAAiB;AACtB,OAAK,sBAAsB;AAC3B,OAAK,kBAAkB,mBAAmB,EAAE;AAC5C,OAAK,iBAAiB,kBAAkB,EAAE;AAE1C,MAAI,YAAY;AACf,QAAK,sBAAsB,WAAW,uBAAuB;AAC7D,QAAK,cAAc,WAAW,eAAe;AAC7C,QAAK,mBAAmB,WAAW,oBAAoB;AACvD,QAAK,oBAAoB,WAAW,qBAAqB;AACzD,QAAK,YAAY,WAAW,aAAa;AACzC,QAAK,qBAAqB,WAAW,sBAAsB;AAC3D,QAAK,yBAAyB,WAAW,0BAA0B;AACnE,SAAKA,QAAS,SAAS,EAAE;AACzB,SAAKC,QAAS,SAAS,EAAE;AACzB,SAAKC,cAAe,eAAe,EAAE;AACrC,QAAK,OAAO,QAAQ;IAAE,aAAa;IAAI,iBAAiB;IAAI;aAClD,YAAY,WAAW;AACjC,SAAKF,QAAS,SAAS;AACvB,SAAKC,QAAS,SAAS;AACvB,SAAKC,cAAe,eAAe;AACnC,QAAK,sBAAsB,kBAAkB;AAC7C,QAAK,cAAc,kBAAkB;AACrC,QAAK,mBAAmB,kBAAkB;AAC1C,QAAK,oBAAoB,kBAAkB;AAC3C,QAAK,YAAY,kBAAkB;AACnC,QAAK,qBAAqB,kBAAkB;AAC5C,QAAK,yBAAyB,kBAAkB;AAChD,QAAK,OAAO,QAAQ;aACV,YAAY,WAAW;AACjC,SAAKF,QAAS,SAAS;AACvB,SAAKC,QAAS,SAAS;AACvB,SAAKC,cAAe,eAAe;AACnC,QAAK,sBAAsB,kBAAkB;AAC7C,QAAK,cAAc,kBAAkB;AACrC,QAAK,mBAAmB,kBAAkB;AAC1C,QAAK,oBAAoB,kBAAkB;AAC3C,QAAK,YAAY,kBAAkB;AACnC,QAAK,qBAAqB,kBAAkB;AAC5C,QAAK,yBAAyB,kBAAkB;AAChD,QAAK,OAAO,QAAQ;QAEpB,OAAM,IAAI,MACT,YAAY,QAAQ,uFACpB;AAQF,MAAI,gBACH,MAAK,OAAO;GAAE,GAAG,KAAK;GAAM,aAAa;GAAiB;AAG3D,OAAK,iBAAiB,IAAI,uBAAuB,KAAK;;CAGvD,cAAc;EACb,MAAM,EAAE,aAAa,oBAAoB,KAAK;AAC9C,MAAI,CAAC,eAAe,CAAC,gBACpB,OAAM,IAAI,mBACT,yGACA;;;;;;;;;CAWH,UAAU,SAAyB;EAClC,MAAM,EAAE,SAAS,KAAK,QAAQ,QAAQ;AAEtC,MAAI,CAAC,KACJ,OAAM,IAAI,mBAAmB,SAAS,QAAQ,mCAAmC;AAGlF,SAAO;;;;;;;;;CAUR,qBAAqB,SAAyB;EAC7C,MAAM,EAAE,sBAAsB,KAAK,QAAQ,QAAQ;AAEnD,MAAI,CAAC,kBACJ,OAAM,IAAI,mBACT,SAAS,QAAQ,sFAAsF,KAAK,QAAQ,+CACpH;AAGF,SAAO;;CAIR,QAAQ,KAAmB;EAC1B,MAAM,OAAO,MAAKF,MAAO;AACzB,MAAI,CAAC,KACJ,OAAM,IAAI,sBAAsB,QAAQ,IAAI;AAG7C,SAAO;;CAGR,QAAQ,KAAmB;EAC1B,MAAM,OAAO,MAAKC,MAAO;AACzB,MAAI,CAAC,KACJ,OAAM,IAAI,sBAAsB,QAAQ,IAAI;AAG7C,SAAO;;CAGR,cAAc,KAAyB;EACtC,MAAM,OAAO,MAAKC,YAAa;AAC/B,MAAI,CAAC,KACJ,OAAM,IAAI,sBAAsB,eAAe,IAAI;AAGpD,SAAO;;;;;;;CAQR,kBAAkB,YAAoC;AACrD,MAAI,CAAC,OAAO,OAAO,KAAK,iBAAiB,WAAW,CACnD,OAAM,IAAI,MAAM,cAAc,0BAA0B,WAAW,CAAC;AAGrE,SAAO,KAAK,gBAAgB;;;;;;;CAQ7B,iBAAiB,YAAmC;AACnD,MAAI,CAAC,OAAO,OAAO,KAAK,gBAAgB,WAAW,CAClD,OAAM,IAAI,MAAM,cAAc,yBAAyB,WAAW,CAAC;AAGpE,SAAO,KAAK,eAAe"}
@@ -31,6 +31,19 @@ declare const mainnetPackageIds: {
31
31
  MARGIN_REGISTRY_ID: string;
32
32
  LIQUIDATION_PACKAGE_ID: string;
33
33
  };
34
+ /**
35
+ * Feed ids and price objects on Pyth's upgraded Core, the only deployment this SDK targets.
36
+ *
37
+ * The testnet `MarginRegistry` was migrated (2026-08-11) off Pyth's beta feed ids and onto
38
+ * the ids upgraded testnet Core carries, which are the mainnet-style ids — the beta ids
39
+ * have no upgraded price objects and the upgraded Hermes does not serve them.
40
+ *
41
+ * DBTC is testnet's wrapped BTC and takes Crypto.XBTC/USD — the same feed mainnet XBTC
42
+ * uses. The upgraded deployment carries no distinct DBTC feed. Plain Crypto.BTC/USD is
43
+ * NOT an accepted substitute for either: XBTC is a distinct asset with its own peg and
44
+ * redemption risk, so pricing it off BTC would misstate collateral in exactly the stress
45
+ * where the two diverge.
46
+ */
34
47
  declare const testnetCoins: CoinMap;
35
48
  declare const mainnetCoins: CoinMap;
36
49
  declare const testnetPools: PoolMap;
@@ -91,6 +104,24 @@ declare const mainnetPythConfigs: {
91
104
  pythStateId: string;
92
105
  wormholeStateId: string;
93
106
  };
107
+ /**
108
+ * Hermes serving Pyth's upgraded Core. Requires an `Authorization: Bearer <token>` header
109
+ * and answers 401 without one. Note that from the Core cutover this also becomes true of
110
+ * legacy Hermes, so an unauthenticated price push has no long-term path.
111
+ */
112
+ declare const PYTH_UPGRADED_HERMES = "https://pyth.dourolabs.app/hermes";
113
+ /**
114
+ * DeepBook-operated Hermes proxy: forwards to {@link PYTH_UPGRADED_HERMES} supplying
115
+ * credentials server-side, so consumers without their own Pyth plan can still push price
116
+ * updates. Used only when no `accessToken` is configured — bring your own token and the
117
+ * SDK talks to Pyth directly, with no DeepBook infrastructure in the path.
118
+ *
119
+ * `undefined` until the proxy is deployed. It must stay `undefined` rather than a
120
+ * placeholder URL: it is the default endpoint whenever a consumer supplies no credentials,
121
+ * so a non-resolving value here surfaces as an opaque `Invalid URL`/DNS error from inside
122
+ * axios instead of a configuration error naming the field to set.
123
+ */
124
+ declare const DEEPBOOK_HERMES_PROXY: string | undefined;
94
125
  //#endregion
95
- export { CoinMap, DeepbookPackageIds, MarginPoolMap, PoolMap, mainnetCoins, mainnetMarginPools, mainnetPackageIds, mainnetPools, mainnetPythConfigs, testnetCoins, testnetMarginPools, testnetPackageIds, testnetPools, testnetPythConfigs };
126
+ export { CoinMap, DEEPBOOK_HERMES_PROXY, DeepbookPackageIds, MarginPoolMap, PYTH_UPGRADED_HERMES, PoolMap, mainnetCoins, mainnetMarginPools, mainnetPackageIds, mainnetPools, mainnetPythConfigs, testnetCoins, testnetMarginPools, testnetPackageIds, testnetPools, testnetPythConfigs };
96
127
  //# sourceMappingURL=constants.d.mts.map
@@ -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;;;;;;;;;cAUA,iBAAA;;;;;;;;;cAUA,YAAA,EAAc,OAAA;AAAA,cA6Cd,YAAA,EAAc,OAAA;AAAA,cAiId,YAAA,EAAc,OAAA;AAAA,cAsCd,YAAA,EAAc,OAAA;AAAA,cA2Hd,kBAAA;;;;;;;;;;;;;;;;;;cAmBA,kBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BA,kBAAA;EAGZ,WAAA;EAAA,eAAA;AAAA;AAAA,cAEY,kBAAA;EAGZ,WAAA;EAAA,eAAA;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;;;;;;;;;cAYA,iBAAA;;;;;;;;;AAZb;;;;;;;;;;;;;AAAA,cA6Ca,YAAA,EAAc,OAAA;AAAA,cAiDd,YAAA,EAAc,OAAA;AAAA,cA+Id,YAAA,EAAc,OAAA;AAAA,cAsCd,YAAA,EAAc,OAAA;AAAA,cA2Hd,kBAAA;;;;;;;;;;;;;;;;;;cAmBA,kBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BA,kBAAA;EAGS,WAAA;EAAA,eAAA;AAAA;AAAA,cAET,kBAAA;EAGS,WAAA;EAAA,eAAA;AAAA;;;;;;cAOT,oBAAA;;;;;;;;;;;;cAaA,qBAAA"}
@@ -3,52 +3,65 @@ const testnetPackageIds = {
3
3
  DEEPBOOK_PACKAGE_ID: "0xd874d2417a55bfa6479bffa06ad950fea144ef93a94cc6c49f32b03e386bbb24",
4
4
  REGISTRY_ID: "0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1",
5
5
  DEEP_TREASURY_ID: "0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb",
6
- MARGIN_PACKAGE_ID: "0xe52c1dece2bb5d5645689d6da8b8debe8347e3446011704a4fcb386746876580",
6
+ MARGIN_PACKAGE_ID: "0xce6ab6290458f597fc078793335f4b1d98479f29ebc02198ae960e9401d0c72f",
7
7
  MARGIN_V1: "0xb8620c24c9ea1a4a41e79613d2b3d1d93648d1bb6f6b789a7c8f261c94110e4b",
8
8
  MARGIN_REGISTRY_ID: "0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75",
9
- LIQUIDATION_PACKAGE_ID: "0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24"
9
+ LIQUIDATION_PACKAGE_ID: "0x29bccec5261b7d040555a13e98bbc6bef7bad007d62759aac8b71c19916f6476"
10
10
  };
11
11
  const mainnetPackageIds = {
12
12
  DEEPBOOK_PACKAGE_ID: "0x0e735f8c93a95722efd73521aca7a7652c0bb71ed1daf41b26dfd7d1ff71f748",
13
13
  REGISTRY_ID: "0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d",
14
14
  DEEP_TREASURY_ID: "0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe",
15
- MARGIN_PACKAGE_ID: "0x8af25e44bcdfb8b19ceffef5a1bd457a89a4270b8237e1025f30cd26acb4edbe",
15
+ MARGIN_PACKAGE_ID: "0x55ee8099674e46266df2bf0ffed9569e1511aa269f2a9b8c63a2c72f16404e72",
16
16
  MARGIN_V1: "0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
17
17
  MARGIN_REGISTRY_ID: "0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742",
18
18
  LIQUIDATION_PACKAGE_ID: "0xf17bff1bf21e9587acc5708714e520aa967f82f256f626938a33c4109b08adb9"
19
19
  };
20
+ /**
21
+ * Feed ids and price objects on Pyth's upgraded Core, the only deployment this SDK targets.
22
+ *
23
+ * The testnet `MarginRegistry` was migrated (2026-08-11) off Pyth's beta feed ids and onto
24
+ * the ids upgraded testnet Core carries, which are the mainnet-style ids — the beta ids
25
+ * have no upgraded price objects and the upgraded Hermes does not serve them.
26
+ *
27
+ * DBTC is testnet's wrapped BTC and takes Crypto.XBTC/USD — the same feed mainnet XBTC
28
+ * uses. The upgraded deployment carries no distinct DBTC feed. Plain Crypto.BTC/USD is
29
+ * NOT an accepted substitute for either: XBTC is a distinct asset with its own peg and
30
+ * redemption risk, so pricing it off BTC would misstate collateral in exactly the stress
31
+ * where the two diverge.
32
+ */
20
33
  const testnetCoins = {
21
34
  DEEP: {
22
35
  address: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,
23
36
  type: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,
24
37
  scalar: 1e6,
25
- feed: "0x99137a18354efa7fb6840889d059fdb04c46a6ce21be97ab60d9ad93e91ac758",
38
+ feed: "0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
26
39
  currencyId: "0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613",
27
- priceInfoObjectId: "0x3d52fffa2cd9e54b39bb36d282bdda560b15b8b4fdf4766a3c58499ef172bafc"
40
+ priceInfoObjectId: "0x27882b43c2cc62bbd8fb5f4ebc20be004b14454b2c98755033f5446d35474339"
28
41
  },
29
42
  SUI: {
30
43
  address: `0x0000000000000000000000000000000000000000000000000000000000000002`,
31
44
  type: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,
32
45
  scalar: 1e9,
33
- feed: "0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266",
46
+ feed: "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
34
47
  currencyId: "0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc",
35
- priceInfoObjectId: "0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0"
48
+ priceInfoObjectId: "0x867877562b5d8ac262d93b02062e04b428a2f9bfbb2f05b8af52e04cd98bd241"
36
49
  },
37
50
  DBUSDC: {
38
51
  address: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,
39
52
  type: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,
40
53
  scalar: 1e6,
41
- feed: "0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722",
54
+ feed: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
42
55
  currencyId: "0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784",
43
- priceInfoObjectId: "0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81"
56
+ priceInfoObjectId: "0x17de8d80e8efedfd1053c46fb921e51824479ed32c6aded5f7279995bb84db05"
44
57
  },
45
58
  DBTC: {
46
59
  address: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,
47
60
  type: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,
48
61
  scalar: 1e8,
49
- feed: "0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b",
62
+ feed: "0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4",
50
63
  currencyId: "0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f",
51
- priceInfoObjectId: "0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba"
64
+ priceInfoObjectId: "0x88387b85b9a53c4365219aee4d77e62213877f110eb859d8e03812a5bea0d1f7"
52
65
  },
53
66
  DBUSDT: {
54
67
  address: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,
@@ -68,7 +81,7 @@ const mainnetCoins = {
68
81
  scalar: 1e6,
69
82
  feed: "0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
70
83
  currencyId: "0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9",
71
- priceInfoObjectId: "0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed"
84
+ priceInfoObjectId: "0x562957f70afaf8a0870e2959abc3e3f327a8159f803d8c56cff27ac2df260477"
72
85
  },
73
86
  SUI: {
74
87
  address: `0x0000000000000000000000000000000000000000000000000000000000000002`,
@@ -76,7 +89,7 @@ const mainnetCoins = {
76
89
  scalar: 1e9,
77
90
  feed: "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
78
91
  currencyId: "0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc",
79
- priceInfoObjectId: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
92
+ priceInfoObjectId: "0x89b2add829cb6fcd017153fff428bc9faec4d06d643ecfc435af5b55a9e987f0"
80
93
  },
81
94
  USDC: {
82
95
  address: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,
@@ -84,7 +97,7 @@ const mainnetCoins = {
84
97
  scalar: 1e6,
85
98
  feed: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
86
99
  currencyId: "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a",
87
- priceInfoObjectId: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
100
+ priceInfoObjectId: "0x6ddfc6f9921e55998cbc2e68f78eba897981d79ac17f66c5277bc38954a2a3f8"
88
101
  },
89
102
  WAL: {
90
103
  address: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,
@@ -92,7 +105,7 @@ const mainnetCoins = {
92
105
  scalar: 1e9,
93
106
  feed: "0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341",
94
107
  currencyId: "0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa",
95
- priceInfoObjectId: "0xeb7e669f74d976c0b99b6ef9801e3a77716a95f1a15754e0f1399ce3fb60973d"
108
+ priceInfoObjectId: "0xdbea8600eeeb0399df58c28e73b8201ae880a954813131d33bfa6902ccdadd24"
96
109
  },
97
110
  SUIUSDE: {
98
111
  address: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,
@@ -100,7 +113,7 @@ const mainnetCoins = {
100
113
  scalar: 1e6,
101
114
  feed: "0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f",
102
115
  currencyId: "0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576",
103
- priceInfoObjectId: "0x9b2028bfc829127d2e5ead1691dc3002de9e9b8d8076b4915e5ecc7d9b99d63f"
116
+ priceInfoObjectId: "0xa8023b552578bd5036be60d3132306882469d1871cb4bec3099c47dece08c4cd"
104
117
  },
105
118
  XBTC: {
106
119
  address: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,
@@ -108,7 +121,7 @@ const mainnetCoins = {
108
121
  scalar: 1e8,
109
122
  feed: "0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4",
110
123
  currencyId: "0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc",
111
- priceInfoObjectId: "0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b"
124
+ priceInfoObjectId: "0x4f7ff4518b4cf33b162d76e70632d8f0a6e04441a058a138959d7a2384cffe60"
112
125
  },
113
126
  USDSUI: {
114
127
  address: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,
@@ -116,7 +129,7 @@ const mainnetCoins = {
116
129
  scalar: 1e6,
117
130
  feed: "0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a",
118
131
  currencyId: "0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731",
119
- priceInfoObjectId: "0x68644a3ab7a1aab113a4a68b6115a5b51eba4cb6aaac2d99b734be2e5e748425"
132
+ priceInfoObjectId: "0x6896ccc8c08a84e47f0ab8affbd3fce2623a72c76f9092e59f8f6ece450119cd"
120
133
  },
121
134
  WUSDC: {
122
135
  address: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,
@@ -397,14 +410,32 @@ const mainnetMarginPools = {
397
410
  }
398
411
  };
399
412
  const testnetPythConfigs = {
400
- pythStateId: "0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c",
401
- wormholeStateId: "0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"
413
+ pythStateId: "0x3c48fe392912de6c18087a2b3f5fdbfbfdb4598e180947feff1f12f8e9ea073e",
414
+ wormholeStateId: "0x750da8e6d16b6a363a39fe2eaa8295ac224a1e6fce4e47b58845e2e8746164f0"
402
415
  };
403
416
  const mainnetPythConfigs = {
404
- pythStateId: "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8",
405
- wormholeStateId: "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"
417
+ pythStateId: "0x03719fae774ddab3cfcaa53bbc046f0cbe21410019b6280811bf3f9f4b05839d",
418
+ wormholeStateId: "0xdbca52b9fb4f712e25f61f974586d93ac541bcf8389564f0323bb07215168b5c"
406
419
  };
420
+ /**
421
+ * Hermes serving Pyth's upgraded Core. Requires an `Authorization: Bearer <token>` header
422
+ * and answers 401 without one. Note that from the Core cutover this also becomes true of
423
+ * legacy Hermes, so an unauthenticated price push has no long-term path.
424
+ */
425
+ const PYTH_UPGRADED_HERMES = "https://pyth.dourolabs.app/hermes";
426
+ /**
427
+ * DeepBook-operated Hermes proxy: forwards to {@link PYTH_UPGRADED_HERMES} supplying
428
+ * credentials server-side, so consumers without their own Pyth plan can still push price
429
+ * updates. Used only when no `accessToken` is configured — bring your own token and the
430
+ * SDK talks to Pyth directly, with no DeepBook infrastructure in the path.
431
+ *
432
+ * `undefined` until the proxy is deployed. It must stay `undefined` rather than a
433
+ * placeholder URL: it is the default endpoint whenever a consumer supplies no credentials,
434
+ * so a non-resolving value here surfaces as an opaque `Invalid URL`/DNS error from inside
435
+ * axios instead of a configuration error naming the field to set.
436
+ */
437
+ const DEEPBOOK_HERMES_PROXY = void 0;
407
438
 
408
439
  //#endregion
409
- export { mainnetCoins, mainnetMarginPools, mainnetPackageIds, mainnetPools, mainnetPythConfigs, testnetCoins, testnetMarginPools, testnetPackageIds, testnetPools, testnetPythConfigs };
440
+ export { DEEPBOOK_HERMES_PROXY, PYTH_UPGRADED_HERMES, mainnetCoins, mainnetMarginPools, mainnetPackageIds, mainnetPools, mainnetPythConfigs, testnetCoins, testnetMarginPools, testnetPackageIds, testnetPools, testnetPythConfigs };
410
441
  //# sourceMappingURL=constants.mjs.map
@@ -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 } 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\tDEEPBOOK_PACKAGE_ID: '0xd874d2417a55bfa6479bffa06ad950fea144ef93a94cc6c49f32b03e386bbb24',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\tMARGIN_PACKAGE_ID: '0xe52c1dece2bb5d5645689d6da8b8debe8347e3446011704a4fcb386746876580',\n\tMARGIN_V1: '0xb8620c24c9ea1a4a41e79613d2b3d1d93648d1bb6f6b789a7c8f261c94110e4b',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\tLIQUIDATION_PACKAGE_ID: '0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x0e735f8c93a95722efd73521aca7a7652c0bb71ed1daf41b26dfd7d1ff71f748',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '0x8af25e44bcdfb8b19ceffef5a1bd457a89a4270b8237e1025f30cd26acb4edbe',\n\tMARGIN_V1: '0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0xf17bff1bf21e9587acc5708714e520aa967f82f256f626938a33c4109b08adb9',\n} satisfies DeepbookPackageIds;\n\nexport const testnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,\n\t\ttype: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x99137a18354efa7fb6840889d059fdb04c46a6ce21be97ab60d9ad93e91ac758', // DEEP uses HFT feed on testnet\n\t\tcurrencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',\n\t\tpriceInfoObjectId: '0x3d52fffa2cd9e54b39bb36d282bdda560b15b8b4fdf4766a3c58499ef172bafc',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0',\n\t},\n\tDBUSDC: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722',\n\t\tcurrencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',\n\t\tpriceInfoObjectId: '0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81',\n\t},\n\tDBTC: {\n\t\taddress: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,\n\t\ttype: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b',\n\t\tcurrencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',\n\t\tpriceInfoObjectId: '0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba',\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: '0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed',\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: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',\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: '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',\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: '0xeb7e669f74d976c0b99b6ef9801e3a77716a95f1a15754e0f1399ce3fb60973d',\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: '0x9b2028bfc829127d2e5ead1691dc3002de9e9b8d8076b4915e5ecc7d9b99d63f',\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',\n\t\tpriceInfoObjectId: '0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b',\n\t},\n\tUSDSUI: {\n\t\taddress: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,\n\t\ttype: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',\n\t\tcurrencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',\n\t\tpriceInfoObjectId: '0x68644a3ab7a1aab113a4a68b6115a5b51eba4cb6aaac2d99b734be2e5e748425',\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};\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};\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: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c',\n\twormholeStateId: '0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790',\n};\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8',\n\twormholeStateId: '0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c',\n};\n"],"mappings":";AAkBA,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,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;EACR,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;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR,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;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;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"}
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\tDEEPBOOK_PACKAGE_ID: '0xd874d2417a55bfa6479bffa06ad950fea144ef93a94cc6c49f32b03e386bbb24',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\t// deepbook_margin v16 — the first testnet package carrying the upgraded-Pyth modules.\n\tMARGIN_PACKAGE_ID: '0xce6ab6290458f597fc078793335f4b1d98479f29ebc02198ae960e9401d0c72f',\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\tDEEPBOOK_PACKAGE_ID: '0x0e735f8c93a95722efd73521aca7a7652c0bb71ed1daf41b26dfd7d1ff71f748',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\t// deepbook_margin v7 — the first mainnet package carrying the upgraded-Pyth modules.\n\t// Its gate constant is `MARGIN_VERSION = 7`, and every entrypoint asserts the registry\n\t// allows that version, so this id only works once `enable_version(7)` has run on the\n\t// mainnet MarginRegistry. Until then v7 flows abort `EPackageVersionDisabled`.\n\tMARGIN_PACKAGE_ID: '0x55ee8099674e46266df2bf0ffed9569e1511aa269f2a9b8c63a2c72f16404e72',\n\tMARGIN_V1: '0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\t// margin_liquidation v4 — the latest mainnet publication, and it predates the upgraded\n\t// entrypoints: its `liquidation_vault` exposes only `liquidate_base`/`liquidate_quote`.\n\t// `MarginLiquidationsContract` targets the `_upgraded` pair, so those two builders have\n\t// no mainnet target until `margin_liquidation` is upgraded there. Every other vault\n\t// entrypoint (deposit, withdraw, balance, swaps, trader authorization) takes no oracle\n\t// and works against this id today.\n\tLIQUIDATION_PACKAGE_ID: '0xf17bff1bf21e9587acc5708714e520aa967f82f256f626938a33c4109b08adb9',\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};\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};\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;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAElB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CAEpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAKlB,mBAAmB;CACnB,WAAW;CACX,oBAAoB;CAOpB,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;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;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
@@ -2,7 +2,7 @@
2
2
  "name": "@mysten/deepbook-v3",
3
3
  "author": "Mysten Labs <build@mystenlabs.com>",
4
4
  "description": "Sui Deepbook SDK",
5
- "version": "1.6.6",
5
+ "version": "2.0.0",
6
6
  "license": "Apache-2.0",
7
7
  "type": "module",
8
8
  "main": "./dist/index.mjs",
@@ -48,7 +48,7 @@
48
48
  "wait-on": "^9.0.10"
49
49
  },
50
50
  "peerDependencies": {
51
- "@mysten/sui": "^2.26.0"
51
+ "@mysten/sui": "^2.26.1"
52
52
  },
53
53
  "scripts": {
54
54
  "clean": "rm -rf tsconfig.tsbuildinfo ./dist",
package/src/client.ts CHANGED
@@ -51,6 +51,7 @@ import type {
51
51
  PoolBookParams,
52
52
  PoolDeepPrice,
53
53
  PoolTradeParams,
54
+ PythConfig,
54
55
  QuantityOut,
55
56
  QuoteQuantityIn,
56
57
  QuoteQuantityOut,
@@ -73,7 +74,12 @@ export interface DeepBookOptions<Name = 'deepbook'> {
73
74
  marginAdminCap?: string;
74
75
  marginMaintainerCap?: string;
75
76
  packageIds?: DeepbookPackageIds;
76
- pyth?: { pythStateId: string; wormholeStateId: string };
77
+ pyth?: PythConfig;
78
+ /**
79
+ * Bearer token for the Hermes serving Pyth's upgraded Core. Matches the option of the
80
+ * same name in `@mysten/suins`, which takes the same credential.
81
+ */
82
+ pythAccessToken?: string;
77
83
  name?: Name;
78
84
  }
79
85
 
@@ -144,6 +150,7 @@ export class DeepBookClient {
144
150
  marginMaintainerCap,
145
151
  packageIds,
146
152
  pyth,
153
+ pythAccessToken,
147
154
  }: DeepBookClientOptions) {
148
155
  const normalizedAddress = normalizeSuiAddress(address);
149
156
  const config = new DeepBookConfig({
@@ -158,6 +165,7 @@ export class DeepBookClient {
158
165
  marginMaintainerCap,
159
166
  packageIds,
160
167
  pyth,
168
+ pythAccessToken,
161
169
  });
162
170
 
163
171
  this.balanceManager = new BalanceManagerContract(config);