@mysten/deepbook-v3 1.5.8 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/client.d.mts +5 -0
  3. package/dist/client.d.mts.map +1 -1
  4. package/dist/client.mjs +7 -0
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/contracts/deepbook/account.d.mts +18 -18
  7. package/dist/contracts/deepbook/account.d.mts.map +1 -1
  8. package/dist/contracts/deepbook/balance_manager.mjs +413 -0
  9. package/dist/contracts/deepbook/balance_manager.mjs.map +1 -0
  10. package/dist/contracts/deepbook/big_vector.mjs +43 -0
  11. package/dist/contracts/deepbook/big_vector.mjs.map +1 -0
  12. package/dist/contracts/deepbook/book.mjs +29 -0
  13. package/dist/contracts/deepbook/book.mjs.map +1 -0
  14. package/dist/contracts/deepbook/deep_price.d.mts +3 -3
  15. package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
  16. package/dist/contracts/deepbook/deep_price.mjs +1 -1
  17. package/dist/contracts/deepbook/deps/std/type_name.mjs +17 -0
  18. package/dist/contracts/deepbook/deps/std/type_name.mjs.map +1 -0
  19. package/dist/contracts/deepbook/deps/sui/bag.mjs +43 -0
  20. package/dist/contracts/deepbook/deps/sui/bag.mjs.map +1 -0
  21. package/dist/contracts/deepbook/deps/sui/balance.mjs +21 -0
  22. package/dist/contracts/deepbook/deps/sui/balance.mjs.map +1 -0
  23. package/dist/contracts/deepbook/deps/sui/table.mjs +38 -0
  24. package/dist/contracts/deepbook/deps/sui/table.mjs.map +1 -0
  25. package/dist/contracts/deepbook/deps/sui/vec_map.mjs +37 -0
  26. package/dist/contracts/deepbook/deps/sui/vec_map.mjs.map +1 -0
  27. package/dist/contracts/deepbook/deps/sui/versioned.mjs +19 -0
  28. package/dist/contracts/deepbook/deps/sui/versioned.mjs.map +1 -0
  29. package/dist/contracts/deepbook/governance.mjs +49 -0
  30. package/dist/contracts/deepbook/governance.mjs.map +1 -0
  31. package/dist/contracts/deepbook/history.mjs +56 -0
  32. package/dist/contracts/deepbook/history.mjs.map +1 -0
  33. package/dist/contracts/deepbook/order.d.mts +12 -12
  34. package/dist/contracts/deepbook/pool.mjs +1739 -0
  35. package/dist/contracts/deepbook/pool.mjs.map +1 -0
  36. package/dist/contracts/deepbook/registry.mjs +295 -0
  37. package/dist/contracts/deepbook/registry.mjs.map +1 -0
  38. package/dist/contracts/deepbook/state.mjs +89 -0
  39. package/dist/contracts/deepbook/state.mjs.map +1 -0
  40. package/dist/contracts/deepbook/trade_params.mjs +21 -0
  41. package/dist/contracts/deepbook/trade_params.mjs.map +1 -0
  42. package/dist/contracts/deepbook/vault.mjs +42 -0
  43. package/dist/contracts/deepbook/vault.mjs.map +1 -0
  44. package/dist/contracts/deepbook_margin/deps/deepbook/balance_manager.mjs +53 -0
  45. package/dist/contracts/deepbook_margin/deps/deepbook/balance_manager.mjs.map +1 -0
  46. package/dist/contracts/deepbook_margin/deps/std/type_name.mjs +17 -0
  47. package/dist/contracts/deepbook_margin/deps/std/type_name.mjs.map +1 -0
  48. package/dist/contracts/deepbook_margin/deps/sui/bag.mjs +43 -0
  49. package/dist/contracts/deepbook_margin/deps/sui/bag.mjs.map +1 -0
  50. package/dist/contracts/deepbook_margin/deps/sui/balance.mjs +21 -0
  51. package/dist/contracts/deepbook_margin/deps/sui/balance.mjs.map +1 -0
  52. package/dist/contracts/deepbook_margin/deps/sui/table.mjs +38 -0
  53. package/dist/contracts/deepbook_margin/deps/sui/table.mjs.map +1 -0
  54. package/dist/contracts/deepbook_margin/deps/sui/vec_map.mjs +37 -0
  55. package/dist/contracts/deepbook_margin/deps/sui/vec_map.mjs.map +1 -0
  56. package/dist/contracts/deepbook_margin/deps/sui/vec_set.mjs +26 -0
  57. package/dist/contracts/deepbook_margin/deps/sui/vec_set.mjs.map +1 -0
  58. package/dist/contracts/deepbook_margin/deps/sui/versioned.mjs +19 -0
  59. package/dist/contracts/deepbook_margin/deps/sui/versioned.mjs.map +1 -0
  60. package/dist/contracts/deepbook_margin/margin_manager.mjs +989 -0
  61. package/dist/contracts/deepbook_margin/margin_manager.mjs.map +1 -0
  62. package/dist/contracts/deepbook_margin/margin_pool.mjs +550 -0
  63. package/dist/contracts/deepbook_margin/margin_pool.mjs.map +1 -0
  64. package/dist/contracts/deepbook_margin/margin_registry.mjs +786 -0
  65. package/dist/contracts/deepbook_margin/margin_registry.mjs.map +1 -0
  66. package/dist/contracts/deepbook_margin/margin_state.mjs +30 -0
  67. package/dist/contracts/deepbook_margin/margin_state.mjs.map +1 -0
  68. package/dist/contracts/deepbook_margin/oracle.mjs +82 -0
  69. package/dist/contracts/deepbook_margin/oracle.mjs.map +1 -0
  70. package/dist/contracts/deepbook_margin/pool_proxy.mjs +644 -0
  71. package/dist/contracts/deepbook_margin/pool_proxy.mjs.map +1 -0
  72. package/dist/contracts/deepbook_margin/position_manager.mjs +32 -0
  73. package/dist/contracts/deepbook_margin/position_manager.mjs.map +1 -0
  74. package/dist/contracts/deepbook_margin/protocol_config.mjs +122 -0
  75. package/dist/contracts/deepbook_margin/protocol_config.mjs.map +1 -0
  76. package/dist/contracts/deepbook_margin/protocol_fees.mjs +58 -0
  77. package/dist/contracts/deepbook_margin/protocol_fees.mjs.map +1 -0
  78. package/dist/contracts/deepbook_margin/rate_limiter.mjs +26 -0
  79. package/dist/contracts/deepbook_margin/rate_limiter.mjs.map +1 -0
  80. package/dist/contracts/deepbook_margin/tpsl.mjs +171 -0
  81. package/dist/contracts/deepbook_margin/tpsl.mjs.map +1 -0
  82. package/dist/contracts/margin_liquidation/deps/sui/bag.mjs +43 -0
  83. package/dist/contracts/margin_liquidation/deps/sui/bag.mjs.map +1 -0
  84. package/dist/contracts/margin_liquidation/liquidation_vault.mjs +179 -0
  85. package/dist/contracts/margin_liquidation/liquidation_vault.mjs.map +1 -0
  86. package/dist/contracts/utils/index.d.mts +1 -1
  87. package/dist/contracts/utils/index.mjs +92 -3
  88. package/dist/contracts/utils/index.mjs.map +1 -1
  89. package/dist/queries/registryQueries.mjs +13 -0
  90. package/dist/queries/registryQueries.mjs.map +1 -1
  91. package/dist/transactions/balanceManager.d.mts.map +1 -1
  92. package/dist/transactions/balanceManager.mjs +119 -100
  93. package/dist/transactions/balanceManager.mjs.map +1 -1
  94. package/dist/transactions/deepbook.d.mts.map +1 -1
  95. package/dist/transactions/deepbook.mjs +464 -439
  96. package/dist/transactions/deepbook.mjs.map +1 -1
  97. package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
  98. package/dist/transactions/deepbookAdmin.mjs +151 -135
  99. package/dist/transactions/deepbookAdmin.mjs.map +1 -1
  100. package/dist/transactions/flashLoans.d.mts.map +1 -1
  101. package/dist/transactions/flashLoans.mjs +29 -22
  102. package/dist/transactions/flashLoans.mjs.map +1 -1
  103. package/dist/transactions/governance.d.mts.map +1 -1
  104. package/dist/transactions/governance.mjs +34 -33
  105. package/dist/transactions/governance.mjs.map +1 -1
  106. package/dist/transactions/marginAdmin.d.mts +17 -7
  107. package/dist/transactions/marginAdmin.d.mts.map +1 -1
  108. package/dist/transactions/marginAdmin.mjs +186 -169
  109. package/dist/transactions/marginAdmin.mjs.map +1 -1
  110. package/dist/transactions/marginLiquidations.d.mts +3 -3
  111. package/dist/transactions/marginLiquidations.d.mts.map +1 -1
  112. package/dist/transactions/marginLiquidations.mjs +53 -54
  113. package/dist/transactions/marginLiquidations.mjs.map +1 -1
  114. package/dist/transactions/marginMaintainer.d.mts +5 -5
  115. package/dist/transactions/marginMaintainer.d.mts.map +1 -1
  116. package/dist/transactions/marginMaintainer.mjs +83 -83
  117. package/dist/transactions/marginMaintainer.mjs.map +1 -1
  118. package/dist/transactions/marginManager.d.mts +32 -32
  119. package/dist/transactions/marginManager.d.mts.map +1 -1
  120. package/dist/transactions/marginManager.mjs +330 -317
  121. package/dist/transactions/marginManager.mjs.map +1 -1
  122. package/dist/transactions/marginPool.d.mts +18 -18
  123. package/dist/transactions/marginPool.d.mts.map +1 -1
  124. package/dist/transactions/marginPool.mjs +93 -89
  125. package/dist/transactions/marginPool.mjs.map +1 -1
  126. package/dist/transactions/marginRegistry.d.mts +22 -15
  127. package/dist/transactions/marginRegistry.d.mts.map +1 -1
  128. package/dist/transactions/marginRegistry.mjs +101 -68
  129. package/dist/transactions/marginRegistry.mjs.map +1 -1
  130. package/dist/transactions/marginTPSL.d.mts +27 -9
  131. package/dist/transactions/marginTPSL.d.mts.map +1 -1
  132. package/dist/transactions/marginTPSL.mjs +108 -82
  133. package/dist/transactions/marginTPSL.mjs.map +1 -1
  134. package/dist/transactions/poolProxy.d.mts +37 -5
  135. package/dist/transactions/poolProxy.d.mts.map +1 -1
  136. package/dist/transactions/poolProxy.mjs +269 -189
  137. package/dist/transactions/poolProxy.mjs.map +1 -1
  138. package/dist/utils/constants.mjs +4 -4
  139. package/dist/utils/constants.mjs.map +1 -1
  140. package/package.json +3 -3
  141. package/src/client.ts +8 -0
  142. package/src/contracts/deepbook/balance_manager.ts +46 -5
  143. package/src/contracts/deepbook/constants.ts +13 -0
  144. package/src/contracts/deepbook/pool.ts +133 -0
  145. package/src/contracts/deepbook/registry.ts +136 -1
  146. package/src/contracts/deepbook_margin/deps/deepbook/balance_manager.ts +49 -0
  147. package/src/contracts/deepbook_margin/deps/std/type_name.ts +24 -0
  148. package/src/contracts/deepbook_margin/deps/sui/bag.ts +41 -0
  149. package/src/contracts/deepbook_margin/deps/sui/balance.ts +19 -0
  150. package/src/contracts/deepbook_margin/deps/sui/table.ts +36 -0
  151. package/src/contracts/deepbook_margin/deps/sui/vec_map.ts +33 -0
  152. package/src/contracts/deepbook_margin/deps/sui/vec_set.ts +22 -0
  153. package/src/contracts/deepbook_margin/deps/sui/versioned.ts +13 -0
  154. package/src/contracts/deepbook_margin/margin_constants.ts +329 -0
  155. package/src/contracts/deepbook_margin/margin_manager.ts +1772 -0
  156. package/src/contracts/deepbook_margin/margin_pool.ts +1129 -0
  157. package/src/contracts/deepbook_margin/margin_registry.ts +1207 -0
  158. package/src/contracts/deepbook_margin/margin_state.ts +26 -0
  159. package/src/contracts/deepbook_margin/oracle.ts +99 -0
  160. package/src/contracts/deepbook_margin/pool_proxy.ts +1298 -0
  161. package/src/contracts/deepbook_margin/position_manager.ts +28 -0
  162. package/src/contracts/deepbook_margin/protocol_config.ts +163 -0
  163. package/src/contracts/deepbook_margin/protocol_fees.ts +153 -0
  164. package/src/contracts/deepbook_margin/rate_limiter.ts +80 -0
  165. package/src/contracts/deepbook_margin/tpsl.ts +559 -0
  166. package/src/contracts/margin_liquidation/deps/sui/bag.ts +41 -0
  167. package/src/contracts/margin_liquidation/liquidation_vault.ts +401 -0
  168. package/src/queries/registryQueries.ts +15 -0
  169. package/src/transactions/balanceManager.ts +140 -90
  170. package/src/transactions/deepbook.ts +586 -494
  171. package/src/transactions/deepbookAdmin.ts +154 -146
  172. package/src/transactions/flashLoans.ts +29 -20
  173. package/src/transactions/governance.ts +50 -37
  174. package/src/transactions/marginAdmin.ts +247 -188
  175. package/src/transactions/marginLiquidations.ts +70 -55
  176. package/src/transactions/marginMaintainer.ts +106 -88
  177. package/src/transactions/marginManager.ts +414 -348
  178. package/src/transactions/marginPool.ts +140 -103
  179. package/src/transactions/marginRegistry.ts +103 -70
  180. package/src/transactions/marginTPSL.ts +151 -87
  181. package/src/transactions/poolProxy.ts +384 -205
  182. package/src/utils/constants.ts +4 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.mjs","names":["versioned.Versioned","vec_set.VecSet","bag.Bag","type_name.TypeName"],"sources":["../../../src/contracts/deepbook/registry.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/** Registry holds all created pools. */\n\nimport {\n\tMoveStruct,\n\tMoveTuple,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n} from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';\nimport * as versioned from './deps/sui/versioned.js';\nimport * as vec_set from './deps/sui/vec_set.js';\nimport * as bag from './deps/sui/bag.js';\nimport * as type_name from './deps/std/type_name.js';\nconst $moduleName = '@deepbook/core::registry';\nexport const REGISTRY = new MoveStruct({\n\tname: `${$moduleName}::REGISTRY`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const DeepbookAdminCap = new MoveStruct({\n\tname: `${$moduleName}::DeepbookAdminCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const DeepbookCorePauseCap = new MoveStruct({\n\tname: `${$moduleName}::DeepbookCorePauseCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\nexport const Registry = new MoveStruct({\n\tname: `${$moduleName}::Registry`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tinner: versioned.Versioned,\n\t},\n});\nexport const RegistryInner = new MoveStruct({\n\tname: `${$moduleName}::RegistryInner`,\n\tfields: {\n\t\tallowed_versions: vec_set.VecSet(bcs.u64()),\n\t\tpools: bag.Bag,\n\t\ttreasury_address: bcs.Address,\n\t},\n});\nexport const PoolKey = new MoveStruct({\n\tname: `${$moduleName}::PoolKey`,\n\tfields: {\n\t\tbase: type_name.TypeName,\n\t\tquote: type_name.TypeName,\n\t},\n});\nexport const StableCoinKey = new MoveStruct({\n\tname: `${$moduleName}::StableCoinKey`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const BalanceManagerKey = new MoveStruct({\n\tname: `${$moduleName}::BalanceManagerKey`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const AllowedPauseCapsKey = new MoveTuple({\n\tname: `${$moduleName}::AllowedPauseCapsKey`,\n\tfields: [bcs.bool()],\n});\nexport const AppKey = new MoveStruct({\n\tname: `${$moduleName}::AppKey<phantom App>`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport const AppKeyV2 = new MoveStruct({\n\tname: `${$moduleName}::AppKeyV2<phantom App>`,\n\tfields: {\n\t\tdummy_field: bcs.bool(),\n\t},\n});\nexport interface AuthorizeAppArguments {\n\tself: RawTransactionArgument<string>;\n\tAdminCap: RawTransactionArgument<string>;\n}\nexport interface AuthorizeAppOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AuthorizeAppArguments\n\t\t| [self: RawTransactionArgument<string>, AdminCap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Authorize an application to access protected features of the DeepBook. */\nexport function authorizeApp(options: AuthorizeAppOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'AdminCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'authorize_app',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DeauthorizeAppArguments {\n\tself: RawTransactionArgument<string>;\n\tAdminCap: RawTransactionArgument<string>;\n}\nexport interface DeauthorizeAppOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DeauthorizeAppArguments\n\t\t| [self: RawTransactionArgument<string>, AdminCap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Deauthorize an application by removing its authorization key. */\nexport function deauthorizeApp(options: DeauthorizeAppOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'AdminCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'deauthorize_app',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface AssertAppIsAuthorizedArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface AssertAppIsAuthorizedOptions {\n\tpackage?: string;\n\targuments: AssertAppIsAuthorizedArguments | [self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/**\n * Assert that an application is authorized to access protected features of\n * DeepBook.\n */\nexport function assertAppIsAuthorized(options: AssertAppIsAuthorizedOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'assert_app_is_authorized',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface SetTreasuryAddressArguments {\n\tself: RawTransactionArgument<string>;\n\ttreasuryAddress: RawTransactionArgument<string>;\n\tCap: RawTransactionArgument<string>;\n}\nexport interface SetTreasuryAddressOptions {\n\tpackage?: string;\n\targuments:\n\t\t| SetTreasuryAddressArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\ttreasuryAddress: RawTransactionArgument<string>,\n\t\t\t\tCap: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * Sets the treasury address where the pool creation fees are sent By default, the\n * treasury address is the publisher of the deepbook package\n */\nexport function setTreasuryAddress(options: SetTreasuryAddressOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, 'address', null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'treasuryAddress', 'Cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'set_treasury_address',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface EnableVersionArguments {\n\tself: RawTransactionArgument<string>;\n\tversion: RawTransactionArgument<number | bigint>;\n\tCap: RawTransactionArgument<string>;\n}\nexport interface EnableVersionOptions {\n\tpackage?: string;\n\targuments:\n\t\t| EnableVersionArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tversion: RawTransactionArgument<number | bigint>,\n\t\t\t\tCap: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * Enables a package version Only Admin can enable a package version This function\n * does not have version restrictions\n */\nexport function enableVersion(options: EnableVersionOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, 'u64', null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'version', 'Cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'enable_version',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface DisableVersionArguments {\n\tself: RawTransactionArgument<string>;\n\tversion: RawTransactionArgument<number | bigint>;\n\tCap: RawTransactionArgument<string>;\n}\nexport interface DisableVersionOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DisableVersionArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tversion: RawTransactionArgument<number | bigint>,\n\t\t\t\tCap: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * Disables a package version Only Admin can disable a package version This\n * function does not have version restrictions\n */\nexport function disableVersion(options: DisableVersionOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, 'u64', null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'version', 'Cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'disable_version',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface MintPauseCapArguments {\n\tself: RawTransactionArgument<string>;\n\tCap: RawTransactionArgument<string>;\n}\nexport interface MintPauseCapOptions {\n\tpackage?: string;\n\targuments:\n\t\t| MintPauseCapArguments\n\t\t| [self: RawTransactionArgument<string>, Cap: RawTransactionArgument<string>];\n}\n/**\n * Mint a `DeepbookCorePauseCap`. The new cap's ID is recorded so it can later\n * disable a version via `disable_version_pause_cap`. Only Admin can mint. This\n * function does not have version restrictions.\n */\nexport function mintPauseCap(options: MintPauseCapOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'Cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'mint_pause_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface RevokePauseCapArguments {\n\tself: RawTransactionArgument<string>;\n\tCap: RawTransactionArgument<string>;\n\tpauseCapId: RawTransactionArgument<string>;\n}\nexport interface RevokePauseCapOptions {\n\tpackage?: string;\n\targuments:\n\t\t| RevokePauseCapArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tCap: RawTransactionArgument<string>,\n\t\t\t\tpauseCapId: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * Revoke a previously minted pause cap by ID. Only Admin can revoke. This function\n * does not have version restrictions.\n */\nexport function revokePauseCap(options: RevokePauseCapOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null, '0x2::object::ID'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'Cap', 'pauseCapId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'revoke_pause_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface DisableVersionPauseCapArguments {\n\tself: RawTransactionArgument<string>;\n\tversion: RawTransactionArgument<number | bigint>;\n\tpauseCap: RawTransactionArgument<string>;\n}\nexport interface DisableVersionPauseCapOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DisableVersionPauseCapArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tversion: RawTransactionArgument<number | bigint>,\n\t\t\t\tpauseCap: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * Disable any allowed package version (including the current one) using a valid\n * `DeepbookCorePauseCap`. The pause cap must be in `allowed_pause_caps`. This\n * function is the emergency kill switch; admin can re-enable via `enable_version`.\n * This function does not have version restrictions.\n */\nexport function disableVersionPauseCap(options: DisableVersionPauseCapOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, 'u64', null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'version', 'pauseCap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'disable_version_pause_cap',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface AddStablecoinArguments {\n\tself: RawTransactionArgument<string>;\n\tCap: RawTransactionArgument<string>;\n}\nexport interface AddStablecoinOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AddStablecoinArguments\n\t\t| [self: RawTransactionArgument<string>, Cap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Adds a stablecoin to the whitelist Only Admin can add stablecoin */\nexport function addStablecoin(options: AddStablecoinOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'Cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'add_stablecoin',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface RemoveStablecoinArguments {\n\tself: RawTransactionArgument<string>;\n\tCap: RawTransactionArgument<string>;\n}\nexport interface RemoveStablecoinOptions {\n\tpackage?: string;\n\targuments:\n\t\t| RemoveStablecoinArguments\n\t\t| [self: RawTransactionArgument<string>, Cap: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Removes a stablecoin from the whitelist Only Admin can remove stablecoin */\nexport function removeStablecoin(options: RemoveStablecoinOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'Cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'remove_stablecoin',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface InitBalanceManagerMapArguments {\n\tself: RawTransactionArgument<string>;\n\tCap: RawTransactionArgument<string>;\n}\nexport interface InitBalanceManagerMapOptions {\n\tpackage?: string;\n\targuments:\n\t\t| InitBalanceManagerMapArguments\n\t\t| [self: RawTransactionArgument<string>, Cap: RawTransactionArgument<string>];\n}\n/** Adds the BalanceManagerKey dynamic field to the registry */\nexport function initBalanceManagerMap(options: InitBalanceManagerMapOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'Cap'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'init_balance_manager_map',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface GetBalanceManagerIdsArguments {\n\tself: RawTransactionArgument<string>;\n\towner: RawTransactionArgument<string>;\n}\nexport interface GetBalanceManagerIdsOptions {\n\tpackage?: string;\n\targuments:\n\t\t| GetBalanceManagerIdsArguments\n\t\t| [self: RawTransactionArgument<string>, owner: RawTransactionArgument<string>];\n}\n/** Get the balance manager IDs for a given owner */\nexport function getBalanceManagerIds(options: GetBalanceManagerIdsOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, 'address'] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'owner'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'get_balance_manager_ids',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface AllowedPauseCapsArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface AllowedPauseCapsOptions {\n\tpackage?: string;\n\targuments: AllowedPauseCapsArguments | [self: RawTransactionArgument<string>];\n}\n/**\n * Get the set of pause cap IDs allowed to disable package versions. Returns an\n * empty set if no pause caps have been minted yet.\n */\nexport function allowedPauseCaps(options: AllowedPauseCapsOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'allowed_pause_caps',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface IsStablecoinArguments {\n\tself: RawTransactionArgument<string>;\n\tstableType: TransactionArgument;\n}\nexport interface IsStablecoinOptions {\n\tpackage?: string;\n\targuments:\n\t\t| IsStablecoinArguments\n\t\t| [self: RawTransactionArgument<string>, stableType: TransactionArgument];\n}\n/** Returns whether the given coin is whitelisted */\nexport function isStablecoin(options: IsStablecoinOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'stableType'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'registry',\n\t\t\tfunction: 'is_stablecoin',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,MAAM,cAAc;AACpB,MAAa,WAAW,IAAI,WAAW;CACtC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,mBAAmB,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,IAAI,IAAI,SACR;CACD,CAAC;AACF,MAAa,uBAAuB,IAAI,WAAW;CAClD,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,IAAI,IAAI,SACR;CACD,CAAC;AACF,MAAa,WAAW,IAAI,WAAW;CACtC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,OAAOA;EACP;CACD,CAAC;AACF,MAAa,gBAAgB,IAAI,WAAW;CAC3C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,kBAAkBC,OAAe,IAAI,KAAK,CAAC;EAC3C,OAAOC;EACP,kBAAkB,IAAI;EACtB;CACD,CAAC;AACF,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,MAAMC;EACN,OAAOA;EACP;CACD,CAAC;AACF,MAAa,gBAAgB,IAAI,WAAW;CAC3C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,MAAM,EACvB;CACD,CAAC;AACF,MAAa,oBAAoB,IAAI,WAAW;CAC/C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,aAAa,IAAI,M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,WAAW,gBAAgB,eAAe;EACpF,CAAC;;;;;;AAaJ,SAAgB,iBAAiB,SAAkC;CAClE,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,KAAK;CAC7B,MAAM,iBAAiB,CAAC,OAAO;AAC/B,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import { Balances } from "./balances.mjs";
3
+ import { Table } from "./deps/sui/table.mjs";
4
+ import { History } from "./history.mjs";
5
+ import { Governance } from "./governance.mjs";
6
+ import { bcs } from "@mysten/sui/bcs";
7
+
8
+ //#region src/contracts/deepbook/state.ts
9
+ /**************************************************************
10
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
11
+ **************************************************************/
12
+ /**
13
+ * State module represents the current state of the pool. It maintains all the
14
+ * accounts, history, and governance information. It also processes all the
15
+ * transactions and updates the state accordingly.
16
+ */
17
+ const $moduleName = "@deepbook/core::state";
18
+ const State = new MoveStruct({
19
+ name: `${$moduleName}::State`,
20
+ fields: {
21
+ accounts: Table,
22
+ history: History,
23
+ governance: Governance
24
+ }
25
+ });
26
+ const StakeEvent = new MoveStruct({
27
+ name: `${$moduleName}::StakeEvent`,
28
+ fields: {
29
+ pool_id: bcs.Address,
30
+ balance_manager_id: bcs.Address,
31
+ epoch: bcs.u64(),
32
+ amount: bcs.u64(),
33
+ stake: bcs.bool()
34
+ }
35
+ });
36
+ const ProposalEvent = new MoveStruct({
37
+ name: `${$moduleName}::ProposalEvent`,
38
+ fields: {
39
+ pool_id: bcs.Address,
40
+ balance_manager_id: bcs.Address,
41
+ epoch: bcs.u64(),
42
+ taker_fee: bcs.u64(),
43
+ maker_fee: bcs.u64(),
44
+ stake_required: bcs.u64()
45
+ }
46
+ });
47
+ const VoteEvent = new MoveStruct({
48
+ name: `${$moduleName}::VoteEvent`,
49
+ fields: {
50
+ pool_id: bcs.Address,
51
+ balance_manager_id: bcs.Address,
52
+ epoch: bcs.u64(),
53
+ from_proposal_id: bcs.option(bcs.Address),
54
+ to_proposal_id: bcs.Address,
55
+ stake: bcs.u64()
56
+ }
57
+ });
58
+ const RebateEventV2 = new MoveStruct({
59
+ name: `${$moduleName}::RebateEventV2`,
60
+ fields: {
61
+ pool_id: bcs.Address,
62
+ balance_manager_id: bcs.Address,
63
+ epoch: bcs.u64(),
64
+ claim_amount: Balances
65
+ }
66
+ });
67
+ const RebateEvent = new MoveStruct({
68
+ name: `${$moduleName}::RebateEvent`,
69
+ fields: {
70
+ pool_id: bcs.Address,
71
+ balance_manager_id: bcs.Address,
72
+ epoch: bcs.u64(),
73
+ claim_amount: bcs.u64()
74
+ }
75
+ });
76
+ const TakerFeePenaltyApplied = new MoveStruct({
77
+ name: `${$moduleName}::TakerFeePenaltyApplied`,
78
+ fields: {
79
+ pool_id: bcs.Address,
80
+ balance_manager_id: bcs.Address,
81
+ order_id: bcs.u128(),
82
+ taker_fee_without_penalty: bcs.u64(),
83
+ taker_fee: bcs.u64()
84
+ }
85
+ });
86
+
87
+ //#endregion
88
+ export { State };
89
+ //# sourceMappingURL=state.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.mjs","names":["table.Table","history.History","governance.Governance","balances.Balances"],"sources":["../../../src/contracts/deepbook/state.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * State module represents the current state of the pool. It maintains all the\n * accounts, history, and governance information. It also processes all the\n * transactions and updates the state accordingly.\n */\n\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport * as table from './deps/sui/table.js';\nimport * as history from './history.js';\nimport * as governance from './governance.js';\nimport * as balances from './balances.js';\nconst $moduleName = '@deepbook/core::state';\nexport const State = new MoveStruct({\n\tname: `${$moduleName}::State`,\n\tfields: {\n\t\taccounts: table.Table,\n\t\thistory: history.History,\n\t\tgovernance: governance.Governance,\n\t},\n});\nexport const StakeEvent = new MoveStruct({\n\tname: `${$moduleName}::StakeEvent`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t\tepoch: bcs.u64(),\n\t\tamount: bcs.u64(),\n\t\tstake: bcs.bool(),\n\t},\n});\nexport const ProposalEvent = new MoveStruct({\n\tname: `${$moduleName}::ProposalEvent`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t\tepoch: bcs.u64(),\n\t\ttaker_fee: bcs.u64(),\n\t\tmaker_fee: bcs.u64(),\n\t\tstake_required: bcs.u64(),\n\t},\n});\nexport const VoteEvent = new MoveStruct({\n\tname: `${$moduleName}::VoteEvent`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t\tepoch: bcs.u64(),\n\t\tfrom_proposal_id: bcs.option(bcs.Address),\n\t\tto_proposal_id: bcs.Address,\n\t\tstake: bcs.u64(),\n\t},\n});\nexport const RebateEventV2 = new MoveStruct({\n\tname: `${$moduleName}::RebateEventV2`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t\tepoch: bcs.u64(),\n\t\tclaim_amount: balances.Balances,\n\t},\n});\nexport const RebateEvent = new MoveStruct({\n\tname: `${$moduleName}::RebateEvent`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t\tepoch: bcs.u64(),\n\t\tclaim_amount: bcs.u64(),\n\t},\n});\nexport const TakerFeePenaltyApplied = new MoveStruct({\n\tname: `${$moduleName}::TakerFeePenaltyApplied`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t\torder_id: bcs.u128(),\n\t\ttaker_fee_without_penalty: bc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Y;CACrB,QAAQ;EACP,SAAS,IAAI;EACb,oBAAoB,IAAI;EACxB,UAAU,IAAI,MAAM;EACpB,2BAA2B,IAAI,KAAK;EACpC,WAAW,IAAI,KAAK;EACpB;CACD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook/trade_params.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ /** TradeParams module contains the trade parameters for a trading pair. */
9
+ const $moduleName = "@deepbook/core::trade_params";
10
+ const TradeParams = new MoveStruct({
11
+ name: `${$moduleName}::TradeParams`,
12
+ fields: {
13
+ taker_fee: bcs.u64(),
14
+ maker_fee: bcs.u64(),
15
+ stake_required: bcs.u64()
16
+ }
17
+ });
18
+
19
+ //#endregion
20
+ export { TradeParams };
21
+ //# sourceMappingURL=trade_params.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trade_params.mjs","names":[],"sources":["../../../src/contracts/deepbook/trade_params.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/** TradeParams module contains the trade parameters for a trading pair. */\n\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = '@deepbook/core::trade_params';\nexport const TradeParams = new MoveStruct({\n\tname: `${$moduleName}::TradeParams`,\n\tfields: {\n\t\ttaker_fee: bcs.u64(),\n\t\tmaker_fee: bcs.u64(),\n\t\tstake_required: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,WAAW,IAAI,KAAK;EACpB,WAAW,IAAI,KAAK;EACpB,gBAAgB,IAAI,KAAK;EACzB;CACD,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import { TypeName } from "./deps/std/type_name.mjs";
3
+ import { Balance } from "./deps/sui/balance.mjs";
4
+ import { bcs } from "@mysten/sui/bcs";
5
+
6
+ //#region src/contracts/deepbook/vault.ts
7
+ /**************************************************************
8
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
9
+ **************************************************************/
10
+ /**
11
+ * The vault holds all of the assets for this pool. At the end of all transaction
12
+ * processing, the vault is used to settle the balances for the user.
13
+ */
14
+ const $moduleName = "@deepbook/core::vault";
15
+ const Vault = new MoveStruct({
16
+ name: `${$moduleName}::Vault<phantom BaseAsset, phantom QuoteAsset>`,
17
+ fields: {
18
+ base_balance: Balance,
19
+ quote_balance: Balance,
20
+ deep_balance: Balance
21
+ }
22
+ });
23
+ const FlashLoan = new MoveStruct({
24
+ name: `${$moduleName}::FlashLoan`,
25
+ fields: {
26
+ pool_id: bcs.Address,
27
+ borrow_quantity: bcs.u64(),
28
+ type_name: TypeName
29
+ }
30
+ });
31
+ const FlashLoanBorrowed = new MoveStruct({
32
+ name: `${$moduleName}::FlashLoanBorrowed`,
33
+ fields: {
34
+ pool_id: bcs.Address,
35
+ borrow_quantity: bcs.u64(),
36
+ type_name: TypeName
37
+ }
38
+ });
39
+
40
+ //#endregion
41
+ export { Vault };
42
+ //# sourceMappingURL=vault.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.mjs","names":["balance.Balance","type_name.TypeName"],"sources":["../../../src/contracts/deepbook/vault.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * The vault holds all of the assets for this pool. At the end of all transaction\n * processing, the vault is used to settle the balances for the user.\n */\n\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport * as balance from './deps/sui/balance.js';\nimport * as type_name from './deps/std/type_name.js';\nconst $moduleName = '@deepbook/core::vault';\nexport const Vault = new MoveStruct({\n\tname: `${$moduleName}::Vault<phantom BaseAsset, phantom QuoteAsset>`,\n\tfields: {\n\t\tbase_balance: balance.Balance,\n\t\tquote_balance: balance.Balance,\n\t\tdeep_balance: balance.Balance,\n\t},\n});\nexport const FlashLoan = new MoveStruct({\n\tname: `${$moduleName}::FlashLoan`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tborrow_quantity: bcs.u64(),\n\t\ttype_name: type_name.TypeName,\n\t},\n});\nexport const FlashLoanBorrowed = new MoveStruct({\n\tname: `${$moduleName}::FlashLoanBorrowed`,\n\tfields: {\n\t\tpool_id: bcs.Address,\n\t\tborrow_quantity: bcs.u64(),\n\t\ttype_name: type_name.TypeName,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,cAAcA;EACd,eAAeA;EACf,cAAcA;EACd;CACD,CAAC;AACF,MAAa,YAAY,IAAI,WAAW;CACvC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,SAAS,IAAI;EACb,iBAAiB,IAAI,KAAK;EAC1B,WAAWC;EACX;CACD,CAAC;AACF,MAAa,oBAAoB,IAAI,WAAW;CAC/C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,SAAS,IAAI;EACb,iBAAiB,IAAI,KAAK;EAC1B,WAAWA;EACX;CACD,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { VecSet } from "../sui/vec_set.mjs";
3
+ import { Bag } from "../sui/bag.mjs";
4
+ import { bcs } from "@mysten/sui/bcs";
5
+
6
+ //#region src/contracts/deepbook_margin/deps/deepbook/balance_manager.ts
7
+ /**************************************************************
8
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
9
+ **************************************************************/
10
+ /**
11
+ * The BalanceManager is a shared object that holds all of the balances for
12
+ * different assets. A combination of `BalanceManager` and `TradeProof` are passed
13
+ * into a pool to perform trades. A `TradeProof` can be generated in two ways: by
14
+ * the owner directly, or by any `TradeCap` owner. The owner can generate a
15
+ * `TradeProof` without the risk of equivocation. The `TradeCap` owner, due to it
16
+ * being an owned object, risks equivocation when generating a `TradeProof`.
17
+ * Generally, a high frequency trading engine will trade as the default owner.
18
+ */
19
+ const $moduleName = "deepbook::balance_manager";
20
+ const BalanceManager = new MoveStruct({
21
+ name: `${$moduleName}::BalanceManager`,
22
+ fields: {
23
+ id: bcs.Address,
24
+ owner: bcs.Address,
25
+ balances: Bag,
26
+ allow_listed: VecSet(bcs.Address)
27
+ }
28
+ });
29
+ const DepositCap = new MoveStruct({
30
+ name: `${$moduleName}::DepositCap`,
31
+ fields: {
32
+ id: bcs.Address,
33
+ balance_manager_id: bcs.Address
34
+ }
35
+ });
36
+ const WithdrawCap = new MoveStruct({
37
+ name: `${$moduleName}::WithdrawCap`,
38
+ fields: {
39
+ id: bcs.Address,
40
+ balance_manager_id: bcs.Address
41
+ }
42
+ });
43
+ const TradeCap = new MoveStruct({
44
+ name: `${$moduleName}::TradeCap`,
45
+ fields: {
46
+ id: bcs.Address,
47
+ balance_manager_id: bcs.Address
48
+ }
49
+ });
50
+
51
+ //#endregion
52
+ export { BalanceManager, DepositCap, TradeCap, WithdrawCap };
53
+ //# sourceMappingURL=balance_manager.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance_manager.mjs","names":["bag.Bag","vec_set.VecSet"],"sources":["../../../../../src/contracts/deepbook_margin/deps/deepbook/balance_manager.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * The BalanceManager is a shared object that holds all of the balances for\n * different assets. A combination of `BalanceManager` and `TradeProof` are passed\n * into a pool to perform trades. A `TradeProof` can be generated in two ways: by\n * the owner directly, or by any `TradeCap` owner. The owner can generate a\n * `TradeProof` without the risk of equivocation. The `TradeCap` owner, due to it\n * being an owned object, risks equivocation when generating a `TradeProof`.\n * Generally, a high frequency trading engine will trade as the default owner.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport * as bag from '../sui/bag.js';\nimport * as vec_set from '../sui/vec_set.js';\nconst $moduleName = 'deepbook::balance_manager';\nexport const BalanceManager = new MoveStruct({\n\tname: `${$moduleName}::BalanceManager`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\towner: bcs.Address,\n\t\tbalances: bag.Bag,\n\t\tallow_listed: vec_set.VecSet(bcs.Address),\n\t},\n});\nexport const DepositCap = new MoveStruct({\n\tname: `${$moduleName}::DepositCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t},\n});\nexport const WithdrawCap = new MoveStruct({\n\tname: `${$moduleName}::WithdrawCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t},\n});\nexport const TradeCap = new MoveStruct({\n\tname: `${$moduleName}::TradeCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tbalance_manager_id: bcs.Address,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,cAAc;AACpB,MAAa,iBAAiB,IAAI,WAAW;CAC5C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,OAAO,IAAI;EACX,UAAUA;EACV,cAAcC,OAAe,IAAI,QAAQ;EACzC;CACD,CAAC;AACF,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,oBAAoB,IAAI;EACxB;CACD,CAAC;AACF,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,oBAAoB,IAAI;EACxB;CACD,CAAC;AACF,MAAa,WAAW,IAAI,WAAW;CACtC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,oBAAoB,IAAI;EACxB;CACD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook_margin/deps/std/type_name.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ /** Functionality for converting Move types into values. Use with care! */
9
+ const $moduleName = "std::type_name";
10
+ const TypeName = new MoveStruct({
11
+ name: `${$moduleName}::TypeName`,
12
+ fields: { name: bcs.string() }
13
+ });
14
+
15
+ //#endregion
16
+ export { TypeName };
17
+ //# sourceMappingURL=type_name.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type_name.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_margin/deps/std/type_name.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/** Functionality for converting Move types into values. Use with care! */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = 'std::type_name';\nexport const TypeName = new MoveStruct({\n\tname: `${$moduleName}::TypeName`,\n\tfields: {\n\t\t/**\n\t\t * String representation of the type. All types are represented using their source\n\t\t * syntax: \"u8\", \"u64\", \"bool\", \"address\", \"vector\", and so on for primitive types.\n\t\t * Struct types are represented as fully qualified type names; e.g.\n\t\t * `00000000000000000000000000000001::string::String` or\n\t\t * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`\n\t\t * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or\n\t\t * 32 depending on the Move platform)\n\t\t */\n\t\tname: bcs.string(),\n\t},\n});\n"],"mappings":";;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAa,WAAW,IAAI,WAAW;CACtC,MAAM,GAAG,YAAY;CACrB,QAAQ,EAUP,MAAM,IAAI,QAAQ,EAClB;CACD,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook_margin/deps/sui/bag.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ /**
9
+ * A bag is a heterogeneous map-like collection. The collection is similar to
10
+ * `sui::table` in that its keys and values are not stored within the `Bag` value,
11
+ * but instead are stored using Sui's object system. The `Bag` struct acts only as
12
+ * a handle into the object system to retrieve those keys and values. Note that
13
+ * this means that `Bag` values with exactly the same key-value mapping will not be
14
+ * equal, with `==`, at runtime. For example
15
+ *
16
+ * ```
17
+ * let bag1 = bag::new();
18
+ * let bag2 = bag::new();
19
+ * bag::add(&mut bag1, 0, false);
20
+ * bag::add(&mut bag1, 1, true);
21
+ * bag::add(&mut bag2, 0, false);
22
+ * bag::add(&mut bag2, 1, true);
23
+ * // bag1 does not equal bag2, despite having the same entries
24
+ * assert!(&bag1 != &bag2);
25
+ * ```
26
+ *
27
+ * At it's core, `sui::bag` is a wrapper around `UID` that allows for access to
28
+ * `sui::dynamic_field` while preventing accidentally stranding field values. A
29
+ * `UID` can be deleted, even if it has dynamic fields associated with it, but a
30
+ * bag, on the other hand, must be empty to be destroyed.
31
+ */
32
+ const $moduleName = "0x2::bag";
33
+ const Bag = new MoveStruct({
34
+ name: `${$moduleName}::Bag`,
35
+ fields: {
36
+ id: bcs.Address,
37
+ size: bcs.u64()
38
+ }
39
+ });
40
+
41
+ //#endregion
42
+ export { Bag };
43
+ //# sourceMappingURL=bag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bag.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_margin/deps/sui/bag.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A bag is a heterogeneous map-like collection. The collection is similar to\n * `sui::table` in that its keys and values are not stored within the `Bag` value,\n * but instead are stored using Sui's object system. The `Bag` struct acts only as\n * a handle into the object system to retrieve those keys and values. Note that\n * this means that `Bag` values with exactly the same key-value mapping will not be\n * equal, with `==`, at runtime. For example\n *\n * ```\n * let bag1 = bag::new();\n * let bag2 = bag::new();\n * bag::add(&mut bag1, 0, false);\n * bag::add(&mut bag1, 1, true);\n * bag::add(&mut bag2, 0, false);\n * bag::add(&mut bag2, 1, true);\n * // bag1 does not equal bag2, despite having the same entries\n * assert!(&bag1 != &bag2);\n * ```\n *\n * At it's core, `sui::bag` is a wrapper around `UID` that allows for access to\n * `sui::dynamic_field` while preventing accidentally stranding field values. A\n * `UID` can be deleted, even if it has dynamic fields associated with it, but a\n * bag, on the other hand, must be empty to be destroyed.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = '0x2::bag';\nexport const Bag = new MoveStruct({\n\tname: `${$moduleName}::Bag`,\n\tfields: {\n\t\t/** the ID of this bag */\n\t\tid: bcs.Address,\n\t\t/** the number of key-value pairs in the bag */\n\t\tsize: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAc;AACpB,MAAa,MAAM,IAAI,WAAW;CACjC,MAAM,GAAG,YAAY;CACrB,QAAQ;EAEP,IAAI,IAAI;EAER,MAAM,IAAI,KAAK;EACf;CACD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook_margin/deps/sui/balance.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ /**
9
+ * A storable handler for Balances in general. Is used in the `Coin` module to
10
+ * allow balance operations and can be used to implement custom coins with `Supply`
11
+ * and `Balance`s.
12
+ */
13
+ const $moduleName = "0x2::balance";
14
+ const Balance = new MoveStruct({
15
+ name: `${$moduleName}::Balance<phantom T>`,
16
+ fields: { value: bcs.u64() }
17
+ });
18
+
19
+ //#endregion
20
+ export { Balance };
21
+ //# sourceMappingURL=balance.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_margin/deps/sui/balance.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A storable handler for Balances in general. Is used in the `Coin` module to\n * allow balance operations and can be used to implement custom coins with `Supply`\n * and `Balance`s.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = '0x2::balance';\nexport const Balance = new MoveStruct({\n\tname: `${$moduleName}::Balance<phantom T>`,\n\tfields: {\n\t\tvalue: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,cAAc;AACpB,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,OAAO,IAAI,KAAK,EAChB;CACD,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook_margin/deps/sui/table.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ /**
9
+ * A table is a map-like collection. But unlike a traditional collection, it's keys
10
+ * and values are not stored within the `Table` value, but instead are stored using
11
+ * Sui's object system. The `Table` struct acts only as a handle into the object
12
+ * system to retrieve those keys and values. Note that this means that `Table`
13
+ * values with exactly the same key-value mapping will not be equal, with `==`, at
14
+ * runtime. For example
15
+ *
16
+ * ```
17
+ * let table1 = table::new<u64, bool>();
18
+ * let table2 = table::new<u64, bool>();
19
+ * table::add(&mut table1, 0, false);
20
+ * table::add(&mut table1, 1, true);
21
+ * table::add(&mut table2, 0, false);
22
+ * table::add(&mut table2, 1, true);
23
+ * // table1 does not equal table2, despite having the same entries
24
+ * assert!(&table1 != &table2);
25
+ * ```
26
+ */
27
+ const $moduleName = "0x2::table";
28
+ const Table = new MoveStruct({
29
+ name: `${$moduleName}::Table<phantom K, phantom V>`,
30
+ fields: {
31
+ id: bcs.Address,
32
+ size: bcs.u64()
33
+ }
34
+ });
35
+
36
+ //#endregion
37
+ export { Table };
38
+ //# sourceMappingURL=table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_margin/deps/sui/table.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A table is a map-like collection. But unlike a traditional collection, it's keys\n * and values are not stored within the `Table` value, but instead are stored using\n * Sui's object system. The `Table` struct acts only as a handle into the object\n * system to retrieve those keys and values. Note that this means that `Table`\n * values with exactly the same key-value mapping will not be equal, with `==`, at\n * runtime. For example\n *\n * ```\n * let table1 = table::new<u64, bool>();\n * let table2 = table::new<u64, bool>();\n * table::add(&mut table1, 0, false);\n * table::add(&mut table1, 1, true);\n * table::add(&mut table2, 0, false);\n * table::add(&mut table2, 1, true);\n * // table1 does not equal table2, despite having the same entries\n * assert!(&table1 != &table2);\n * ```\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = '0x2::table';\nexport const Table = new MoveStruct({\n\tname: `${$moduleName}::Table<phantom K, phantom V>`,\n\tfields: {\n\t\t/** the ID of this table */\n\t\tid: bcs.Address,\n\t\t/** the number of key-value pairs in the table */\n\t\tsize: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM,GAAG,YAAY;CACrB,QAAQ;EAEP,IAAI,IAAI;EAER,MAAM,IAAI,KAAK;EACf;CACD,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook_margin/deps/sui/vec_map.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ const $moduleName = "0x2::vec_map";
9
+ /** An entry in the map */
10
+ function Entry(...typeParameters) {
11
+ return new MoveStruct({
12
+ name: `${$moduleName}::Entry<${typeParameters[0].name}, ${typeParameters[1].name}>`,
13
+ fields: {
14
+ key: typeParameters[0],
15
+ value: typeParameters[1]
16
+ }
17
+ });
18
+ }
19
+ /**
20
+ * A map data structure backed by a vector. The map is guaranteed not to contain
21
+ * duplicate keys, but entries are _not_ sorted by key--entries are included in
22
+ * insertion order. All operations are O(N) in the size of the map--the intention
23
+ * of this data structure is only to provide the convenience of programming against
24
+ * a map API. Large maps should use handwritten parent/child relationships instead.
25
+ * Maps that need sorted iteration rather than insertion order iteration should
26
+ * also be handwritten.
27
+ */
28
+ function VecMap(...typeParameters) {
29
+ return new MoveStruct({
30
+ name: `${$moduleName}::VecMap<${typeParameters[0].name}, ${typeParameters[1].name}>`,
31
+ fields: { contents: bcs.vector(Entry(typeParameters[0], typeParameters[1])) }
32
+ });
33
+ }
34
+
35
+ //#endregion
36
+ export { VecMap };
37
+ //# sourceMappingURL=vec_map.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vec_map.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_margin/deps/sui/vec_map.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { type BcsType, bcs } from '@mysten/sui/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::vec_map';\n/** An entry in the map */\nexport function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tkey: typeParameters[0],\n\t\t\tvalue: typeParameters[1],\n\t\t},\n\t});\n}\n/**\n * A map data structure backed by a vector. The map is guaranteed not to contain\n * duplicate keys, but entries are _not_ sorted by key--entries are included in\n * insertion order. All operations are O(N) in the size of the map--the intention\n * of this data structure is only to provide the convenience of programming against\n * a map API. Large maps should use handwritten parent/child relationships instead.\n * Maps that need sorted iteration rather than insertion order iteration should\n * also be handwritten.\n */\nexport function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tcontents: bcs.vector(Entry(typeParameters[0], typeParameters[1])),\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;;AAEpB,SAAgB,MAAsD,GAAG,gBAAwB;AAChG,QAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,UAAU,eAAe,GAAG,KAAkB,IAAI,eAAe,GAAG,KAAkB;EAC3G,QAAQ;GACP,KAAK,eAAe;GACpB,OAAO,eAAe;GACtB;EACD,CAAC;;;;;;;;;;;AAWH,SAAgB,OAAuD,GAAG,gBAAwB;AACjG,QAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,WAAW,eAAe,GAAG,KAAkB,IAAI,eAAe,GAAG,KAAkB;EAC5G,QAAQ,EACP,UAAU,IAAI,OAAO,MAAM,eAAe,IAAI,eAAe,GAAG,CAAC,EACjE;EACD,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook_margin/deps/sui/vec_set.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ const $moduleName = "0x2::vec_set";
9
+ /**
10
+ * A set data structure backed by a vector. The set is guaranteed not to contain
11
+ * duplicate keys. All operations are O(N) in the size of the set
12
+ *
13
+ * - the intention of this data structure is only to provide the convenience of
14
+ * programming against a set API. Sets that need sorted iteration rather than
15
+ * insertion order iteration should be handwritten.
16
+ */
17
+ function VecSet(...typeParameters) {
18
+ return new MoveStruct({
19
+ name: `${$moduleName}::VecSet<${typeParameters[0].name}>`,
20
+ fields: { contents: bcs.vector(typeParameters[0]) }
21
+ });
22
+ }
23
+
24
+ //#endregion
25
+ export { VecSet };
26
+ //# sourceMappingURL=vec_set.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vec_set.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_margin/deps/sui/vec_set.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { type BcsType, bcs } from '@mysten/sui/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::vec_set';\n/**\n * A set data structure backed by a vector. The set is guaranteed not to contain\n * duplicate keys. All operations are O(N) in the size of the set\n *\n * - the intention of this data structure is only to provide the convenience of\n * programming against a set API. Sets that need sorted iteration rather than\n * insertion order iteration should be handwritten.\n */\nexport function VecSet<K extends BcsType<any>>(...typeParameters: [K]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::VecSet<${typeParameters[0].name as K['name']}>`,\n\t\tfields: {\n\t\t\tcontents: bcs.vector(typeParameters[0]),\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;;;;;;;;;AASpB,SAAgB,OAA+B,GAAG,gBAAqB;AACtE,QAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,WAAW,eAAe,GAAG,KAAkB;EACpE,QAAQ,EACP,UAAU,IAAI,OAAO,eAAe,GAAG,EACvC;EACD,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook_margin/deps/sui/versioned.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ const $moduleName = "0x2::versioned";
9
+ const Versioned = new MoveStruct({
10
+ name: `${$moduleName}::Versioned`,
11
+ fields: {
12
+ id: bcs.Address,
13
+ version: bcs.u64()
14
+ }
15
+ });
16
+
17
+ //#endregion
18
+ export { Versioned };
19
+ //# sourceMappingURL=versioned.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versioned.mjs","names":[],"sources":["../../../../../src/contracts/deepbook_margin/deps/sui/versioned.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = '0x2::versioned';\nexport const Versioned = new MoveStruct({\n\tname: `${$moduleName}::Versioned`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tversion: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;AACpB,MAAa,YAAY,IAAI,WAAW;CACvC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,SAAS,IAAI,KAAK;EAClB;CACD,CAAC"}