@mysten/deepbook-v3 0.26.2 → 0.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mysten/deepbook-v3
2
2
 
3
+ ## 0.26.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 86d1c96: Mainnet feed and currency IDs
8
+
9
+ ## 0.26.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 9bb895e: Revoke TradeCap
14
+
3
15
  ## 0.26.2
4
16
 
5
17
  ### Patch Changes
@@ -158,4 +158,11 @@ export declare class BalanceManagerContract {
158
158
  * @returns A function that takes a Transaction object
159
159
  */
160
160
  getBalanceManagerReferralId: (managerKey: string, poolKey: string) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
161
+ /**
162
+ * @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.
163
+ * @param {string} managerKey The name of the BalanceManager
164
+ * @param {string} tradeCapId The ID of the TradeCap to revoke
165
+ * @returns A function that takes a Transaction object
166
+ */
167
+ revokeTradeCap: (managerKey: string, tradeCapId: string) => (tx: Transaction) => void;
161
168
  }
@@ -364,6 +364,19 @@ class BalanceManagerContract {
364
364
  arguments: [tx.object(managerId), tx.pure.id(poolId)]
365
365
  });
366
366
  };
367
+ /**
368
+ * @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.
369
+ * @param {string} managerKey The name of the BalanceManager
370
+ * @param {string} tradeCapId The ID of the TradeCap to revoke
371
+ * @returns A function that takes a Transaction object
372
+ */
373
+ this.revokeTradeCap = (managerKey, tradeCapId) => (tx) => {
374
+ const managerId = __privateGet(this, _config).getBalanceManager(managerKey).address;
375
+ tx.moveCall({
376
+ target: `${__privateGet(this, _config).DEEPBOOK_PACKAGE_ID}::balance_manager::revoke_trade_cap`,
377
+ arguments: [tx.object(managerId), tx.pure.id(tradeCapId)]
378
+ });
379
+ };
367
380
  __privateSet(this, _config, config);
368
381
  }
369
382
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/transactions/balanceManager.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { coinWithBalance } from '@mysten/sui/transactions';\nimport type { Transaction, TransactionArgument } from '@mysten/sui/transactions';\n\nimport type { DeepBookConfig } from '../utils/config.js';\n\n/**\n * BalanceManagerContract class for managing BalanceManager operations.\n */\nexport class BalanceManagerContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for BalanceManagerContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Create and share a new BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateAndShareBalanceManager = () => (tx: Transaction) => {\n\t\tconst manager = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new`,\n\t\t});\n\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Create a new BalanceManager, manually set the owner. Returns the manager.\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateBalanceManagerWithOwner = (ownerAddress: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new_with_custom_owner`,\n\t\t\targuments: [tx.pure.address(ownerAddress)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Share the BalanceManager\n\t * @param {TransactionArgument} manager The BalanceManager to share\n\t * @returns A function that takes a Transaction object\n\t */\n\tshareBalanceManager = (manager: TransactionArgument) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit funds into the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositIntoManager =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit`,\n\t\t\t\targuments: [tx.object(managerId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawFromManager =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number, recipient: string) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawInput = Math.round(amountToWithdraw * coin.scalar);\n\t\t\tconst coinObject = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.u64(withdrawInput)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([coinObject], recipient);\n\t\t};\n\n\t/**\n\t * @description Withdraw all funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawAllFromManager =\n\t\t(managerKey: string, coinKey: string, recipient: string) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawalCoin = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_all`,\n\t\t\t\targuments: [tx.object(managerId)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([withdrawalCoin], recipient);\n\t\t};\n\n\t/**\n\t * @description Check the balance of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to check the balance of\n\t * @returns A function that takes a Transaction object\n\t */\n\tcheckManagerBalance = (managerKey: string, coinKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t\ttypeArguments: [coin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof for the BalanceManager. Calls the appropriate function based on whether tradeCap is set.\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProof = (managerKey: string) => (tx: Transaction) => {\n\t\tconst balanceManager = this.#config.getBalanceManager(managerKey);\n\t\treturn tx.add(\n\t\t\tbalanceManager.tradeCap\n\t\t\t\t? this.generateProofAsTrader(balanceManager.address, balanceManager.tradeCap)\n\t\t\t\t: this.generateProofAsOwner(balanceManager.address),\n\t\t);\n\t};\n\n\t/**\n\t * @description Generate a trade proof as the owner\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsOwner = (managerId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof as a trader\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @param {string} tradeCapId The ID of the tradeCap\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsTrader = (managerId: string, tradeCapId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_trader`,\n\t\t\targuments: [tx.object(managerId), tx.object(tradeCapId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a TradeCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintTradeCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_trade_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintDepositCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_deposit_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a WithdrawalCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintWithdrawalCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_withdraw_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit using the DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositWithCap =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.depositCap) {\n\t\t\t\tthrow new Error(`DepositCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst depositCapId = manager.depositCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(depositCapId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw using the WithdrawCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawWithCap =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.withdrawCap) {\n\t\t\t\tthrow new Error(`WithdrawCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst withdrawCapId = manager.withdrawCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawAmount = Math.round(amountToWithdraw * coin.scalar);\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(withdrawCapId), tx.pure.u64(withdrawAmount)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Set the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} referral The referral (DeepBookPoolReferral) to set the BalanceManager to\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tsetBalanceManagerReferral =\n\t\t(managerKey: string, referral: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::set_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(referral), tradeCap],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Unset the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey The key of the pool to unset the referral for\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tunsetBalanceManagerReferral =\n\t\t(managerKey: string, poolKey: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::unset_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId), tradeCap],\n\t\t\t});\n\t\t};\n\n\tregisterBalanceManager = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::register_balance_manager`,\n\t\t\targuments: [tx.object(managerId), tx.object(this.#config.REGISTRY_ID)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\towner = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the ID of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tid = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::id`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the owner of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralOwner = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_owner`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool ID associated with a referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the pool ID of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralPoolId = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_pool_id`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the referral ID from the balance manager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey Key of the pool to get the referral for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBalanceManagerReferralId = (managerKey: string, poolKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::get_balance_manager_referral_id`,\n\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId)],\n\t\t});\n\t};\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAgC;AAFhC;AAUO,MAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAMnC,YAAY,QAAwB;AALpC;AAaA;AAAA;AAAA;AAAA;AAAA,wCAA+B,MAAM,CAAC,OAAoB;AACzD,YAAM,UAAU,GAAG,SAAS;AAAA,QAC3B,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,MAC5C,CAAC;AAED,SAAG,SAAS;AAAA,QACX,QAAQ;AAAA,QACR,WAAW,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,MAClC,CAAC;AAAA,IACF;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAA8B,CAAC,YAAoB,YAAoB,CAAC,OAAoB;AAC3F,YAAM,YAAY,mBAAK,SAAQ,kBAAkB,UAAU,EAAE;AAC7D,YAAM,SAAS,mBAAK,SAAQ,QAAQ,OAAO,EAAE;AAC7C,aAAO,GAAG,SAAS;AAAA,QAClB,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,SAAS,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC;AAAA,MACrD,CAAC;AAAA,IACF;AA9WC,uBAAK,SAAU;AAAA,EAChB;AA8WD;AArXC;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { coinWithBalance } from '@mysten/sui/transactions';\nimport type { Transaction, TransactionArgument } from '@mysten/sui/transactions';\n\nimport type { DeepBookConfig } from '../utils/config.js';\n\n/**\n * BalanceManagerContract class for managing BalanceManager operations.\n */\nexport class BalanceManagerContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for BalanceManagerContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Create and share a new BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateAndShareBalanceManager = () => (tx: Transaction) => {\n\t\tconst manager = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new`,\n\t\t});\n\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Create a new BalanceManager, manually set the owner. Returns the manager.\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateBalanceManagerWithOwner = (ownerAddress: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new_with_custom_owner`,\n\t\t\targuments: [tx.pure.address(ownerAddress)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Share the BalanceManager\n\t * @param {TransactionArgument} manager The BalanceManager to share\n\t * @returns A function that takes a Transaction object\n\t */\n\tshareBalanceManager = (manager: TransactionArgument) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit funds into the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositIntoManager =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit`,\n\t\t\t\targuments: [tx.object(managerId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawFromManager =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number, recipient: string) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawInput = Math.round(amountToWithdraw * coin.scalar);\n\t\t\tconst coinObject = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.u64(withdrawInput)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([coinObject], recipient);\n\t\t};\n\n\t/**\n\t * @description Withdraw all funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawAllFromManager =\n\t\t(managerKey: string, coinKey: string, recipient: string) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawalCoin = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_all`,\n\t\t\t\targuments: [tx.object(managerId)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([withdrawalCoin], recipient);\n\t\t};\n\n\t/**\n\t * @description Check the balance of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to check the balance of\n\t * @returns A function that takes a Transaction object\n\t */\n\tcheckManagerBalance = (managerKey: string, coinKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t\ttypeArguments: [coin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof for the BalanceManager. Calls the appropriate function based on whether tradeCap is set.\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProof = (managerKey: string) => (tx: Transaction) => {\n\t\tconst balanceManager = this.#config.getBalanceManager(managerKey);\n\t\treturn tx.add(\n\t\t\tbalanceManager.tradeCap\n\t\t\t\t? this.generateProofAsTrader(balanceManager.address, balanceManager.tradeCap)\n\t\t\t\t: this.generateProofAsOwner(balanceManager.address),\n\t\t);\n\t};\n\n\t/**\n\t * @description Generate a trade proof as the owner\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsOwner = (managerId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof as a trader\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @param {string} tradeCapId The ID of the tradeCap\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsTrader = (managerId: string, tradeCapId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_trader`,\n\t\t\targuments: [tx.object(managerId), tx.object(tradeCapId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a TradeCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintTradeCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_trade_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintDepositCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_deposit_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a WithdrawalCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintWithdrawalCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_withdraw_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit using the DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositWithCap =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.depositCap) {\n\t\t\t\tthrow new Error(`DepositCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst depositCapId = manager.depositCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(depositCapId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw using the WithdrawCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawWithCap =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.withdrawCap) {\n\t\t\t\tthrow new Error(`WithdrawCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst withdrawCapId = manager.withdrawCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawAmount = Math.round(amountToWithdraw * coin.scalar);\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(withdrawCapId), tx.pure.u64(withdrawAmount)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Set the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} referral The referral (DeepBookPoolReferral) to set the BalanceManager to\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tsetBalanceManagerReferral =\n\t\t(managerKey: string, referral: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::set_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(referral), tradeCap],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Unset the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey The key of the pool to unset the referral for\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tunsetBalanceManagerReferral =\n\t\t(managerKey: string, poolKey: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::unset_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId), tradeCap],\n\t\t\t});\n\t\t};\n\n\tregisterBalanceManager = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::register_balance_manager`,\n\t\t\targuments: [tx.object(managerId), tx.object(this.#config.REGISTRY_ID)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\towner = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the ID of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tid = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::id`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the owner of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralOwner = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_owner`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool ID associated with a referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the pool ID of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralPoolId = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_pool_id`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the referral ID from the balance manager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey Key of the pool to get the referral for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBalanceManagerReferralId = (managerKey: string, poolKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::get_balance_manager_referral_id`,\n\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} tradeCapId The ID of the TradeCap to revoke\n\t * @returns A function that takes a Transaction object\n\t */\n\trevokeTradeCap = (managerKey: string, tradeCapId: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::revoke_trade_cap`,\n\t\t\targuments: [tx.object(managerId), tx.pure.id(tradeCapId)],\n\t\t});\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAgC;AAFhC;AAUO,MAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAMnC,YAAY,QAAwB;AALpC;AAaA;AAAA;AAAA;AAAA;AAAA,wCAA+B,MAAM,CAAC,OAAoB;AACzD,YAAM,UAAU,GAAG,SAAS;AAAA,QAC3B,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,MAC5C,CAAC;AAED,SAAG,SAAS;AAAA,QACX,QAAQ;AAAA,QACR,WAAW,CAAC,OAAO;AAAA,QACnB,eAAe,CAAC,GAAG,mBAAK,SAAQ,mBAAmB,mCAAmC;AAAA,MACvF,CAAC;AAAA,IACF;AAMA;AAAA;AAAA;AAAA;AAAA,yCAAgC,CAAC,iBAAyB,CAAC,OAAoB;AAC9E,aAAO,GAAG,SAAS;AAAA,QAClB,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,KAAK,QAAQ,YAAY,CAAC;AAAA,MAC1C,CAAC;AAAA,IACF;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAsB,CAAC,YAAiC,CAAC,OAAoB;AAC5E,SAAG,SAAS;AAAA,QACX,QAAQ;AAAA,QACR,WAAW,CAAC,OAAO;AAAA,QACnB,eAAe,CAAC,GAAG,mBAAK,SA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,SAAQ,kBAAkB,UAAU,EAAE;AAC7D,SAAG,SAAS;AAAA,QACX,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,SAAS,GAAG,GAAG,KAAK,GAAG,UAAU,CAAC;AAAA,MACzD,CAAC;AAAA,IACF;AA5XC,uBAAK,SAAU;AAAA,EAChB;AA4XD;AAnYC;",
6
6
  "names": []
7
7
  }
@@ -39,7 +39,7 @@ const testnetPackageIds = {
39
39
  LIQUIDATION_PACKAGE_ID: "0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24"
40
40
  };
41
41
  const mainnetPackageIds = {
42
- DEEPBOOK_PACKAGE_ID: "0x00c1a56ec8c4c623a848b2ed2f03d23a25d17570b670c22106f336eb933785cc",
42
+ DEEPBOOK_PACKAGE_ID: "0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497",
43
43
  REGISTRY_ID: "0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d",
44
44
  DEEP_TREASURY_ID: "0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe",
45
45
  MARGIN_PACKAGE_ID: "",
@@ -96,22 +96,29 @@ const mainnetCoins = {
96
96
  address: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,
97
97
  type: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,
98
98
  scalar: 1e6,
99
- feed: "",
100
- currencyId: ""
99
+ feed: "0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
100
+ currencyId: "0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9"
101
101
  },
102
102
  SUI: {
103
103
  address: `0x0000000000000000000000000000000000000000000000000000000000000002`,
104
104
  type: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,
105
105
  scalar: 1e9,
106
106
  feed: "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
107
- currencyId: ""
107
+ currencyId: "0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc"
108
108
  },
109
109
  USDC: {
110
110
  address: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,
111
111
  type: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,
112
112
  scalar: 1e6,
113
113
  feed: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
114
- currencyId: ""
114
+ currencyId: "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a"
115
+ },
116
+ WAL: {
117
+ address: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,
118
+ type: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,
119
+ scalar: 1e9,
120
+ feed: "0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341",
121
+ currencyId: "0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa"
115
122
  },
116
123
  WUSDC: {
117
124
  address: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,
@@ -163,11 +170,6 @@ const mainnetCoins = {
163
170
  type: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,
164
171
  scalar: 1e6
165
172
  },
166
- WAL: {
167
- address: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,
168
- type: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,
169
- scalar: 1e9
170
- },
171
173
  XBTC: {
172
174
  address: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,
173
175
  type: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/constants.ts"],
4
- "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_REGISTRY_ID: string;\n\tLIQUIDATION_PACKAGE_ID: string;\n}\n\nexport const testnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x22be4cade64bf2d02412c7e8d0e8beea2f78828b948118d46735315409371a3c',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\tMARGIN_PACKAGE_ID: '0xd6a42f4df4db73d68cbeb52be66698d2fe6a9464f45ad113ca52b0c6ebd918b6',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\tLIQUIDATION_PACKAGE_ID: '0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x00c1a56ec8c4c623a848b2ed2f03d23a25d17570b670c22106f336eb933785cc',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '',\n\tMARGIN_REGISTRY_ID: '',\n\tLIQUIDATION_PACKAGE_ID: '',\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: '',\n\t\tcurrencyId: '',\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: '',\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: '',\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\tWAL: {\n\t\taddress: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,\n\t\ttype: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,\n\t\tscalar: 1000000000,\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\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\t// This coin is experimental\n\tWGIGA: {\n\t\taddress: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b`,\n\t\ttype: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b::coin::COIN`,\n\t\tscalar: 100000,\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};\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: '',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,MAAM,oBAAoB;AAAA,EAChC,qBAAqB;AAAA,EACrB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,wBAAwB;AACzB;AAEO,MAAM,oBAAoB;AAAA,EAChC,qBAAqB;AAAA,EACrB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB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AS;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AACD;AAEO,MAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,iBAAiB;AAClB;AAEO,MAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,iBAAiB;AAClB;",
4
+ "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_REGISTRY_ID: string;\n\tLIQUIDATION_PACKAGE_ID: string;\n}\n\nexport const testnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x22be4cade64bf2d02412c7e8d0e8beea2f78828b948118d46735315409371a3c',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\tMARGIN_PACKAGE_ID: '0xd6a42f4df4db73d68cbeb52be66698d2fe6a9464f45ad113ca52b0c6ebd918b6',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\tLIQUIDATION_PACKAGE_ID: '0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '',\n\tMARGIN_REGISTRY_ID: '',\n\tLIQUIDATION_PACKAGE_ID: '',\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},\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},\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},\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},\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\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\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\t// This coin is experimental\n\tWGIGA: {\n\t\taddress: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b`,\n\t\ttype: `0xec32640add6d02a1d5f0425d72705eb76d9de7edfd4f34e0dba68e62ecceb05b::coin::COIN`,\n\t\tscalar: 100000,\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};\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: '',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t},\n};\n\nexport const testnetPythConfigs = {\n\tpythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c',\n\twormholeStateId: '0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790',\n};\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8',\n\twormholeStateId: '0xaeab97f96cf9877fee2883315d459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SAAS;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,EACZ;AACD;AAEO,MAAM,qBAAqB;AAAA,EACjC,KAAK;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,QAAQ;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AACD;AAEO,MAAM,qBAAqB;AAAA,EACjC,KAAK;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,MAAM;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,EACP;AACD;AAEO,MAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,iBAAiB;AAClB;AAEO,MAAM,qBAAqB;AAAA,EACjC,aAAa;AAAA,EACb,iBAAiB;AAClB;",
6
6
  "names": []
7
7
  }
@@ -158,4 +158,11 @@ export declare class BalanceManagerContract {
158
158
  * @returns A function that takes a Transaction object
159
159
  */
160
160
  getBalanceManagerReferralId: (managerKey: string, poolKey: string) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
161
+ /**
162
+ * @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.
163
+ * @param {string} managerKey The name of the BalanceManager
164
+ * @param {string} tradeCapId The ID of the TradeCap to revoke
165
+ * @returns A function that takes a Transaction object
166
+ */
167
+ revokeTradeCap: (managerKey: string, tradeCapId: string) => (tx: Transaction) => void;
161
168
  }
@@ -341,6 +341,19 @@ class BalanceManagerContract {
341
341
  arguments: [tx.object(managerId), tx.pure.id(poolId)]
342
342
  });
343
343
  };
344
+ /**
345
+ * @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.
346
+ * @param {string} managerKey The name of the BalanceManager
347
+ * @param {string} tradeCapId The ID of the TradeCap to revoke
348
+ * @returns A function that takes a Transaction object
349
+ */
350
+ this.revokeTradeCap = (managerKey, tradeCapId) => (tx) => {
351
+ const managerId = __privateGet(this, _config).getBalanceManager(managerKey).address;
352
+ tx.moveCall({
353
+ target: `${__privateGet(this, _config).DEEPBOOK_PACKAGE_ID}::balance_manager::revoke_trade_cap`,
354
+ arguments: [tx.object(managerId), tx.pure.id(tradeCapId)]
355
+ });
356
+ };
344
357
  __privateSet(this, _config, config);
345
358
  }
346
359
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/transactions/balanceManager.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { coinWithBalance } from '@mysten/sui/transactions';\nimport type { Transaction, TransactionArgument } from '@mysten/sui/transactions';\n\nimport type { DeepBookConfig } from '../utils/config.js';\n\n/**\n * BalanceManagerContract class for managing BalanceManager operations.\n */\nexport class BalanceManagerContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for BalanceManagerContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Create and share a new BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateAndShareBalanceManager = () => (tx: Transaction) => {\n\t\tconst manager = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new`,\n\t\t});\n\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Create a new BalanceManager, manually set the owner. Returns the manager.\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateBalanceManagerWithOwner = (ownerAddress: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new_with_custom_owner`,\n\t\t\targuments: [tx.pure.address(ownerAddress)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Share the BalanceManager\n\t * @param {TransactionArgument} manager The BalanceManager to share\n\t * @returns A function that takes a Transaction object\n\t */\n\tshareBalanceManager = (manager: TransactionArgument) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit funds into the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositIntoManager =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit`,\n\t\t\t\targuments: [tx.object(managerId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawFromManager =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number, recipient: string) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawInput = Math.round(amountToWithdraw * coin.scalar);\n\t\t\tconst coinObject = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.u64(withdrawInput)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([coinObject], recipient);\n\t\t};\n\n\t/**\n\t * @description Withdraw all funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawAllFromManager =\n\t\t(managerKey: string, coinKey: string, recipient: string) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawalCoin = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_all`,\n\t\t\t\targuments: [tx.object(managerId)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([withdrawalCoin], recipient);\n\t\t};\n\n\t/**\n\t * @description Check the balance of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to check the balance of\n\t * @returns A function that takes a Transaction object\n\t */\n\tcheckManagerBalance = (managerKey: string, coinKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t\ttypeArguments: [coin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof for the BalanceManager. Calls the appropriate function based on whether tradeCap is set.\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProof = (managerKey: string) => (tx: Transaction) => {\n\t\tconst balanceManager = this.#config.getBalanceManager(managerKey);\n\t\treturn tx.add(\n\t\t\tbalanceManager.tradeCap\n\t\t\t\t? this.generateProofAsTrader(balanceManager.address, balanceManager.tradeCap)\n\t\t\t\t: this.generateProofAsOwner(balanceManager.address),\n\t\t);\n\t};\n\n\t/**\n\t * @description Generate a trade proof as the owner\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsOwner = (managerId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof as a trader\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @param {string} tradeCapId The ID of the tradeCap\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsTrader = (managerId: string, tradeCapId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_trader`,\n\t\t\targuments: [tx.object(managerId), tx.object(tradeCapId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a TradeCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintTradeCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_trade_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintDepositCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_deposit_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a WithdrawalCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintWithdrawalCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_withdraw_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit using the DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositWithCap =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.depositCap) {\n\t\t\t\tthrow new Error(`DepositCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst depositCapId = manager.depositCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(depositCapId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw using the WithdrawCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawWithCap =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.withdrawCap) {\n\t\t\t\tthrow new Error(`WithdrawCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst withdrawCapId = manager.withdrawCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawAmount = Math.round(amountToWithdraw * coin.scalar);\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(withdrawCapId), tx.pure.u64(withdrawAmount)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Set the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} referral The referral (DeepBookPoolReferral) to set the BalanceManager to\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tsetBalanceManagerReferral =\n\t\t(managerKey: string, referral: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::set_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(referral), tradeCap],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Unset the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey The key of the pool to unset the referral for\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tunsetBalanceManagerReferral =\n\t\t(managerKey: string, poolKey: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::unset_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId), tradeCap],\n\t\t\t});\n\t\t};\n\n\tregisterBalanceManager = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::register_balance_manager`,\n\t\t\targuments: [tx.object(managerId), tx.object(this.#config.REGISTRY_ID)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\towner = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the ID of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tid = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::id`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the owner of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralOwner = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_owner`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool ID associated with a referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the pool ID of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralPoolId = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_pool_id`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the referral ID from the balance manager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey Key of the pool to get the referral for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBalanceManagerReferralId = (managerKey: string, poolKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::get_balance_manager_referral_id`,\n\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId)],\n\t\t});\n\t};\n}\n"],
5
- "mappings": ";;;;;;;AAAA;AAEA,SAAS,uBAAuB;AAQzB,M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,QAC3C,WAAW,CAAC,GAAG,OAAO,UAAU,CAAC;AAAA,MAClC,CAAC;AAAA,IACF;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAA+B,CAAC,eAAuB,CAAC,OAAoB;AAC3E,aAAO,GAAG,SAAS;AAAA,QAClB,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,UAAU,CAAC;AAAA,MAClC,CAAC;AAAA,IACF;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAA8B,CAAC,YAAoB,YAAoB,CAAC,OAAoB;AAC3F,YAAM,YAAY,mBAAK,SAAQ,kBAAkB,UAAU,EAAE;AAC7D,YAAM,SAAS,mBAAK,SAAQ,QAAQ,OAAO,EAAE;AAC7C,aAAO,GAAG,SAAS;AAAA,QAClB,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,SAAS,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC;AAAA,MACrD,CAAC;AAAA,IACF;AA9WC,uBAAK,SAAU;AAAA,EAChB;AA8WD;AArXC;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { coinWithBalance } from '@mysten/sui/transactions';\nimport type { Transaction, TransactionArgument } from '@mysten/sui/transactions';\n\nimport type { DeepBookConfig } from '../utils/config.js';\n\n/**\n * BalanceManagerContract class for managing BalanceManager operations.\n */\nexport class BalanceManagerContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for BalanceManagerContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Create and share a new BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateAndShareBalanceManager = () => (tx: Transaction) => {\n\t\tconst manager = tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new`,\n\t\t});\n\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Create a new BalanceManager, manually set the owner. Returns the manager.\n\t * @returns A function that takes a Transaction object\n\t */\n\tcreateBalanceManagerWithOwner = (ownerAddress: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::new_with_custom_owner`,\n\t\t\targuments: [tx.pure.address(ownerAddress)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Share the BalanceManager\n\t * @param {TransactionArgument} manager The BalanceManager to share\n\t * @returns A function that takes a Transaction object\n\t */\n\tshareBalanceManager = (manager: TransactionArgument) => (tx: Transaction) => {\n\t\ttx.moveCall({\n\t\t\ttarget: '0x2::transfer::public_share_object',\n\t\t\targuments: [manager],\n\t\t\ttypeArguments: [`${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::BalanceManager`],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit funds into the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositIntoManager =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit`,\n\t\t\t\targuments: [tx.object(managerId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawFromManager =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number, recipient: string) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawInput = Math.round(amountToWithdraw * coin.scalar);\n\t\t\tconst coinObject = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.u64(withdrawInput)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([coinObject], recipient);\n\t\t};\n\n\t/**\n\t * @description Withdraw all funds from the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to withdraw\n\t * @param {string} recipient The recipient of the withdrawn funds\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawAllFromManager =\n\t\t(managerKey: string, coinKey: string, recipient: string) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawalCoin = tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_all`,\n\t\t\t\targuments: [tx.object(managerId)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\n\t\t\ttx.transferObjects([withdrawalCoin], recipient);\n\t\t};\n\n\t/**\n\t * @description Check the balance of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @param {string} coinKey The key of the coin to check the balance of\n\t * @returns A function that takes a Transaction object\n\t */\n\tcheckManagerBalance = (managerKey: string, coinKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t\ttypeArguments: [coin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof for the BalanceManager. Calls the appropriate function based on whether tradeCap is set.\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProof = (managerKey: string) => (tx: Transaction) => {\n\t\tconst balanceManager = this.#config.getBalanceManager(managerKey);\n\t\treturn tx.add(\n\t\t\tbalanceManager.tradeCap\n\t\t\t\t? this.generateProofAsTrader(balanceManager.address, balanceManager.tradeCap)\n\t\t\t\t: this.generateProofAsOwner(balanceManager.address),\n\t\t);\n\t};\n\n\t/**\n\t * @description Generate a trade proof as the owner\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsOwner = (managerId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Generate a trade proof as a trader\n\t * @param {string} managerId The ID of the BalanceManager\n\t * @param {string} tradeCapId The ID of the tradeCap\n\t * @returns A function that takes a Transaction object\n\t */\n\tgenerateProofAsTrader = (managerId: string, tradeCapId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::generate_proof_as_trader`,\n\t\t\targuments: [tx.object(managerId), tx.object(tradeCapId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a TradeCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintTradeCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_trade_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintDepositCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_deposit_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Mint a WithdrawalCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmintWithdrawalCap = (managerKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\tconst managerId = manager.address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::mint_withdraw_cap`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit using the DepositCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to deposit\n\t * @param {number} amountToDeposit The amount to deposit\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositWithCap =\n\t\t(managerKey: string, coinKey: string, amountToDeposit: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.depositCap) {\n\t\t\t\tthrow new Error(`DepositCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst depositCapId = manager.depositCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst depositInput = Math.round(amountToDeposit * coin.scalar);\n\t\t\tconst deposit = coinWithBalance({\n\t\t\t\ttype: coin.type,\n\t\t\t\tbalance: depositInput,\n\t\t\t});\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::deposit_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(depositCapId), deposit],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Withdraw using the WithdrawCap\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} coinKey The name of the coin to withdraw\n\t * @param {number} amountToWithdraw The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawWithCap =\n\t\t(managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) => {\n\t\t\ttx.setSenderIfNotSet(this.#config.address);\n\t\t\tconst manager = this.#config.getBalanceManager(managerKey);\n\t\t\tconst managerId = manager.address;\n\t\t\tif (!manager.withdrawCap) {\n\t\t\t\tthrow new Error(`WithdrawCap not set for ${managerKey}`);\n\t\t\t}\n\t\t\tconst withdrawCapId = manager.withdrawCap;\n\t\t\tconst coin = this.#config.getCoin(coinKey);\n\t\t\tconst withdrawAmount = Math.round(amountToWithdraw * coin.scalar);\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::withdraw_with_cap`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(withdrawCapId), tx.pure.u64(withdrawAmount)],\n\t\t\t\ttypeArguments: [coin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Set the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} referral The referral (DeepBookPoolReferral) to set the BalanceManager to\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tsetBalanceManagerReferral =\n\t\t(managerKey: string, referral: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::set_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.object(referral), tradeCap],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Unset the referral for the BalanceManager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey The key of the pool to unset the referral for\n\t * @param {TransactionArgument} tradeCap The tradeCap for permission checking\n\t * @returns A function that takes a Transaction object\n\t */\n\tunsetBalanceManagerReferral =\n\t\t(managerKey: string, poolKey: string, tradeCap: TransactionArgument) => (tx: Transaction) => {\n\t\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::unset_balance_manager_referral`,\n\t\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId), tradeCap],\n\t\t\t});\n\t\t};\n\n\tregisterBalanceManager = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::register_balance_manager`,\n\t\t\targuments: [tx.object(managerId), tx.object(this.#config.REGISTRY_ID)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\towner = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::owner`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the ID of the BalanceManager\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns A function that takes a Transaction object\n\t */\n\tid = (managerKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::id`,\n\t\t\targuments: [tx.object(managerId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the owner of the referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the owner of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralOwner = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_owner`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool ID associated with a referral (DeepBookPoolReferral)\n\t * @param {string} referralId The ID of the referral to get the pool ID of\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManagerReferralPoolId = (referralId: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::balance_manager_referral_pool_id`,\n\t\t\targuments: [tx.object(referralId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the referral ID from the balance manager for a specific pool\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} poolKey Key of the pool to get the referral for\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetBalanceManagerReferralId = (managerKey: string, poolKey: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\tconst poolId = this.#config.getPool(poolKey).address;\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::get_balance_manager_referral_id`,\n\t\t\targuments: [tx.object(managerId), tx.pure.id(poolId)],\n\t\t});\n\t};\n\n\t/**\n\t * @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.\n\t * @param {string} managerKey The name of the BalanceManager\n\t * @param {string} tradeCapId The ID of the TradeCap to revoke\n\t * @returns A function that takes a Transaction object\n\t */\n\trevokeTradeCap = (managerKey: string, tradeCapId: string) => (tx: Transaction) => {\n\t\tconst managerId = this.#config.getBalanceManager(managerKey).address;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.DEEPBOOK_PACKAGE_ID}::balance_manager::revoke_trade_cap`,\n\t\t\targuments: [tx.object(managerId), tx.pure.id(tradeCapId)],\n\t\t});\n\t};\n}\n"],
5
+ "mappings": ";;;;;;;AAAA;AAEA,SAAS,uBAAuB;AAQzB,MAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA,EAMnC,YAAY,QAAwB;AALpC;AAaA;AAAA;AAAA;AAAA;AAAA,wCAA+B,MAAM,CAAC,OAAoB;AACzD,YAAM,UAAU,GAAG,SAAS;AAAA,QAC3B,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,MAC5C,CAAC;AAED,SAAG,SAAS;AAAA,QACX,QAAQ;AAAA,QACR,WAAW,CAAC,OAAO;AAAA,QACnB,eAAe,CAAC,GAAG,mBAAK,SAAQ,mBAAmB,mCAAmC;AAAA,MACvF,CAAC;AAAA,IACF;AAMA;AAAA;AAAA;AAAA;AAAA,yCAAgC,CAAC,iBAAyB,CAAC,OAAoB;AAC9E,aAAO,GAAG,SAAS;AAAA,QAClB,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,KAAK,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,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,SAAS,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC;AAAA,MACrD,CAAC;AAAA,IACF;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAiB,CAAC,YAAoB,eAAuB,CAAC,OAAoB;AACjF,YAAM,YAAY,mBAAK,SAAQ,kBAAkB,UAAU,EAAE;AAC7D,SAAG,SAAS;AAAA,QACX,QAAQ,GAAG,mBAAK,SAAQ,mBAAmB;AAAA,QAC3C,WAAW,CAAC,GAAG,OAAO,SAAS,GAAG,GAAG,KAAK,GAAG,UAAU,CAAC;AAAA,MACzD,CAAC;AAAA,IACF;AA5XC,uBAAK,SAAU;AAAA,EAChB;AA4XD;AAnYC;",
6
6
  "names": []
7
7
  }
@@ -7,7 +7,7 @@ const testnetPackageIds = {
7
7
  LIQUIDATION_PACKAGE_ID: "0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24"
8
8
  };
9
9
  const mainnetPackageIds = {
10
- DEEPBOOK_PACKAGE_ID: "0x00c1a56ec8c4c623a848b2ed2f03d23a25d17570b670c22106f336eb933785cc",
10
+ DEEPBOOK_PACKAGE_ID: "0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497",
11
11
  REGISTRY_ID: "0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d",
12
12
  DEEP_TREASURY_ID: "0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe",
13
13
  MARGIN_PACKAGE_ID: "",
@@ -64,22 +64,29 @@ const mainnetCoins = {
64
64
  address: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,
65
65
  type: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,
66
66
  scalar: 1e6,
67
- feed: "",
68
- currencyId: ""
67
+ feed: "0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
68
+ currencyId: "0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9"
69
69
  },
70
70
  SUI: {
71
71
  address: `0x0000000000000000000000000000000000000000000000000000000000000002`,
72
72
  type: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,
73
73
  scalar: 1e9,
74
74
  feed: "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
75
- currencyId: ""
75
+ currencyId: "0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc"
76
76
  },
77
77
  USDC: {
78
78
  address: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,
79
79
  type: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,
80
80
  scalar: 1e6,
81
81
  feed: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
82
- currencyId: ""
82
+ currencyId: "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a"
83
+ },
84
+ WAL: {
85
+ address: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,
86
+ type: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,
87
+ scalar: 1e9,
88
+ feed: "0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341",
89
+ currencyId: "0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa"
83
90
  },
84
91
  WUSDC: {
85
92
  address: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,
@@ -131,11 +138,6 @@ const mainnetCoins = {
131
138
  type: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,
132
139
  scalar: 1e6
133
140
  },
134
- WAL: {
135
- address: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,
136
- type: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,
137
- scalar: 1e9
138
- },
139
141
  XBTC: {
140
142
  address: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,
141
143
  type: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,