@gearbox-protocol/sdk 13.7.0-kyc.3 → 14.0.0-next.10

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 (214) hide show
  1. package/dist/cjs/dev/AccountOpener.js +5 -45
  2. package/dist/cjs/dev/RevolverTransport.js +10 -4
  3. package/dist/cjs/dev/index.js +0 -2
  4. package/dist/cjs/dev/logSplitterTransport.js +10 -1
  5. package/dist/cjs/permissionless/utils/create2.js +2 -2
  6. package/dist/cjs/permissionless/utils/price-update/get-price-feeds.js +11 -5
  7. package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +11 -5
  8. package/dist/cjs/permissionless/utils/price-update/get-prices.js +12 -6
  9. package/dist/cjs/sdk/MultichainSDK.js +232 -0
  10. package/dist/cjs/sdk/OnchainSDK.js +478 -0
  11. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +16 -324
  12. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +1 -7
  13. package/dist/cjs/sdk/base/TokensMeta.js +42 -22
  14. package/dist/cjs/sdk/base/token-types.js +0 -9
  15. package/dist/cjs/sdk/chain/chains.js +1 -2
  16. package/dist/cjs/sdk/constants/address-provider.js +0 -3
  17. package/dist/cjs/sdk/core/errors.js +77 -0
  18. package/dist/cjs/sdk/core/index.js +2 -0
  19. package/dist/cjs/sdk/index.js +4 -2
  20. package/dist/cjs/sdk/market/MarketRegister.js +116 -70
  21. package/dist/cjs/sdk/market/MarketSuite.js +0 -3
  22. package/dist/cjs/sdk/market/index.js +0 -2
  23. package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
  24. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -11
  25. package/dist/cjs/sdk/market/pool/index.js +0 -2
  26. package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +10 -3
  27. package/dist/cjs/sdk/market/pricefeeds/updates/PythAccumulatorUpdateData.js +20 -23
  28. package/dist/cjs/sdk/market/pricefeeds/updates/PythUpdater.js +7 -4
  29. package/dist/cjs/sdk/market/pricefeeds/updates/RedstoneUpdater.js +4 -4
  30. package/dist/cjs/sdk/market/pricefeeds/updates/fetchPythPayloads.js +1 -1
  31. package/dist/cjs/sdk/market/pricefeeds/updates/index.js +3 -0
  32. package/dist/cjs/sdk/options.js +24 -52
  33. package/dist/cjs/sdk/plugins/BasePlugin.js +11 -4
  34. package/dist/cjs/sdk/pools/PoolService.js +12 -104
  35. package/dist/cjs/sdk/utils/formatter.js +99 -20
  36. package/dist/cjs/sdk/utils/viem/index.js +3 -3
  37. package/dist/cjs/sdk/utils/viem/watchBlocksAsync.js +76 -0
  38. package/dist/esm/dev/AccountOpener.js +6 -47
  39. package/dist/esm/dev/RevolverTransport.js +10 -4
  40. package/dist/esm/dev/index.js +0 -1
  41. package/dist/esm/dev/logSplitterTransport.js +10 -1
  42. package/dist/esm/permissionless/utils/create2.js +1 -1
  43. package/dist/esm/permissionless/utils/price-update/get-price-feeds.js +12 -6
  44. package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +13 -7
  45. package/dist/esm/permissionless/utils/price-update/get-prices.js +13 -7
  46. package/dist/esm/sdk/MultichainSDK.js +217 -0
  47. package/dist/esm/sdk/OnchainSDK.js +472 -0
  48. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +17 -328
  49. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +1 -7
  50. package/dist/esm/sdk/base/TokensMeta.js +44 -22
  51. package/dist/esm/sdk/base/token-types.js +0 -6
  52. package/dist/esm/sdk/chain/chains.js +1 -2
  53. package/dist/esm/sdk/constants/address-provider.js +0 -2
  54. package/dist/esm/sdk/core/errors.js +48 -0
  55. package/dist/esm/sdk/core/index.js +1 -0
  56. package/dist/esm/sdk/index.js +2 -1
  57. package/dist/esm/sdk/market/MarketRegister.js +118 -74
  58. package/dist/esm/sdk/market/MarketSuite.js +0 -3
  59. package/dist/esm/sdk/market/index.js +0 -1
  60. package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
  61. package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -11
  62. package/dist/esm/sdk/market/pool/index.js +0 -1
  63. package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +10 -3
  64. package/dist/esm/sdk/market/pricefeeds/updates/PythAccumulatorUpdateData.js +20 -13
  65. package/dist/esm/sdk/market/pricefeeds/updates/PythUpdater.js +7 -4
  66. package/dist/esm/sdk/market/pricefeeds/updates/RedstoneUpdater.js +4 -4
  67. package/dist/esm/sdk/market/pricefeeds/updates/fetchPythPayloads.js +1 -1
  68. package/dist/esm/sdk/market/pricefeeds/updates/index.js +2 -0
  69. package/dist/esm/sdk/options.js +22 -51
  70. package/dist/esm/sdk/plugins/BasePlugin.js +11 -4
  71. package/dist/esm/sdk/pools/PoolService.js +13 -109
  72. package/dist/esm/sdk/utils/formatter.js +99 -10
  73. package/dist/esm/sdk/utils/viem/index.js +1 -1
  74. package/dist/esm/sdk/utils/viem/watchBlocksAsync.js +52 -0
  75. package/dist/types/dev/RevolverTransport.d.ts +2 -1
  76. package/dist/types/dev/calcLiquidatableLTs.d.ts +2 -2
  77. package/dist/types/dev/claimFromFaucet.d.ts +2 -2
  78. package/dist/types/dev/create2.d.ts +3 -4
  79. package/dist/types/dev/index.d.ts +0 -1
  80. package/dist/types/dev/logSplitterTransport.d.ts +3 -1
  81. package/dist/types/dev/migrateFaucet.d.ts +2 -2
  82. package/dist/types/dev/mint/AbstractMinter.d.ts +2 -2
  83. package/dist/types/dev/mint/FallbackMinter.d.ts +2 -2
  84. package/dist/types/dev/mint/factory.d.ts +2 -2
  85. package/dist/types/dev/replaceStorage.d.ts +1 -1
  86. package/dist/types/permissionless/utils/price-update/get-updatable-feeds.d.ts +2 -2
  87. package/dist/types/plugins/accounts/AccountsPlugin.d.ts +2 -2
  88. package/dist/types/plugins/accounts-counter/AccountsCounterPlugin.d.ts +2 -2
  89. package/dist/types/plugins/adapters/AdaptersPlugin.d.ts +2 -2
  90. package/dist/types/plugins/apy/ApyPlugin.d.ts +2 -2
  91. package/dist/types/plugins/bots/BotsPlugin.d.ts +2 -2
  92. package/dist/types/plugins/bots/PartialLiquidationBotV310Contract.d.ts +2 -2
  93. package/dist/types/plugins/degen-distributors/DegenDistributorsPlugin.d.ts +2 -2
  94. package/dist/types/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.d.ts +2 -2
  95. package/dist/types/sdk/MultichainSDK.d.ts +144 -0
  96. package/dist/types/sdk/OnchainSDK.d.ts +257 -0
  97. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +4 -54
  98. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  99. package/dist/types/sdk/accounts/createCreditAccountService.d.ts +2 -2
  100. package/dist/types/sdk/accounts/types.d.ts +15 -95
  101. package/dist/types/sdk/base/SDKConstruct.d.ts +4 -4
  102. package/dist/types/sdk/base/TokensMeta.d.ts +3 -14
  103. package/dist/types/sdk/base/token-types.d.ts +4 -44
  104. package/dist/types/sdk/base/types.d.ts +2 -116
  105. package/dist/types/sdk/chain/chains.d.ts +1 -5
  106. package/dist/types/sdk/constants/address-provider.d.ts +0 -1
  107. package/dist/types/sdk/core/createAddressProvider.d.ts +3 -3
  108. package/dist/types/sdk/core/errors.d.ts +51 -0
  109. package/dist/types/sdk/core/index.d.ts +1 -0
  110. package/dist/types/sdk/index.d.ts +2 -1
  111. package/dist/types/sdk/market/MarketRegister.d.ts +11 -8
  112. package/dist/types/sdk/market/MarketSuite.d.ts +2 -4
  113. package/dist/types/sdk/market/adapters/createAdapter.d.ts +2 -2
  114. package/dist/types/sdk/market/credit/CreditConfiguratorV310Contract.d.ts +3 -3
  115. package/dist/types/sdk/market/credit/CreditManagerV310Contract.d.ts +2 -2
  116. package/dist/types/sdk/market/credit/CreditSuite.d.ts +2 -2
  117. package/dist/types/sdk/market/credit/createCreditConfigurator.d.ts +2 -2
  118. package/dist/types/sdk/market/credit/createCreditFacade.d.ts +2 -2
  119. package/dist/types/sdk/market/credit/createCreditManager.d.ts +2 -2
  120. package/dist/types/sdk/market/credit/types.d.ts +1 -1
  121. package/dist/types/sdk/market/index.d.ts +0 -1
  122. package/dist/types/sdk/market/loss-policy/AliasLossPolicyV310Contract.d.ts +3 -3
  123. package/dist/types/sdk/market/loss-policy/createLossPolicy.d.ts +2 -2
  124. package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +5 -6
  125. package/dist/types/sdk/market/oracle/PriceOracleV310Contract.d.ts +2 -2
  126. package/dist/types/sdk/market/oracle/createPriceOracle.d.ts +2 -2
  127. package/dist/types/sdk/market/oracle/types.d.ts +10 -3
  128. package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -4
  129. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
  130. package/dist/types/sdk/market/pool/createInterestRateModel.d.ts +2 -2
  131. package/dist/types/sdk/market/pool/createPool.d.ts +2 -2
  132. package/dist/types/sdk/market/pool/createPoolQuotaKeeper.d.ts +2 -2
  133. package/dist/types/sdk/market/pool/createRateKeeper.d.ts +2 -2
  134. package/dist/types/sdk/market/pool/index.d.ts +0 -1
  135. package/dist/types/sdk/market/pricefeeds/PriceFeedsRegister.d.ts +8 -3
  136. package/dist/types/sdk/market/pricefeeds/updates/PythAccumulatorUpdateData.d.ts +12 -13
  137. package/dist/types/sdk/market/pricefeeds/updates/PythUpdater.d.ts +8 -3
  138. package/dist/types/sdk/market/pricefeeds/updates/RedstoneUpdater.d.ts +8 -3
  139. package/dist/types/sdk/market/pricefeeds/updates/index.d.ts +1 -0
  140. package/dist/types/sdk/market/pricefeeds/updates/types.d.ts +4 -0
  141. package/dist/types/sdk/market/types.d.ts +1 -1
  142. package/dist/types/sdk/options.d.ts +15 -16
  143. package/dist/types/sdk/plugins/BasePlugin.d.ts +12 -6
  144. package/dist/types/sdk/plugins/errors.d.ts +2 -2
  145. package/dist/types/sdk/plugins/types.d.ts +16 -6
  146. package/dist/types/sdk/pools/PoolService.d.ts +8 -8
  147. package/dist/types/sdk/pools/types.d.ts +2 -3
  148. package/dist/types/sdk/router/AbstractRouterContract.d.ts +3 -3
  149. package/dist/types/sdk/router/RouterV310Contract.d.ts +2 -2
  150. package/dist/types/sdk/router/createRouter.d.ts +2 -2
  151. package/dist/types/sdk/router/helpers.d.ts +1 -1
  152. package/dist/types/sdk/types/state-human.d.ts +10 -2
  153. package/dist/types/sdk/types/state.d.ts +14 -8
  154. package/dist/types/sdk/utils/filterDust.d.ts +2 -2
  155. package/dist/types/sdk/utils/formatter.d.ts +1 -1
  156. package/dist/types/sdk/utils/isDust.d.ts +2 -2
  157. package/dist/types/sdk/utils/toAddress.d.ts +1 -1
  158. package/dist/types/sdk/utils/viem/getLogsPaginated.d.ts +1 -2
  159. package/dist/types/sdk/utils/viem/getLogsSafe.d.ts +1 -1
  160. package/dist/types/sdk/utils/viem/index.d.ts +1 -1
  161. package/dist/types/sdk/utils/viem/simulateWithPriceUpdates.d.ts +1 -2
  162. package/dist/types/sdk/utils/viem/watchBlocksAsync.d.ts +74 -0
  163. package/package.json +3 -6
  164. package/dist/cjs/abi/kyc/iDSRegistryService.js +0 -70
  165. package/dist/cjs/abi/kyc/iDSToken.js +0 -71
  166. package/dist/cjs/abi/kyc/iKYCCompressor.js +0 -196
  167. package/dist/cjs/abi/kyc/iKYCFactory.js +0 -122
  168. package/dist/cjs/abi/kyc/iKYCUnderlying.js +0 -401
  169. package/dist/cjs/abi/kyc/iSecuritizeDegenNFT.js +0 -326
  170. package/dist/cjs/abi/kyc/iSecuritizeKYCFactory.js +0 -319
  171. package/dist/cjs/dev/CachedStateSubscriber.js +0 -78
  172. package/dist/cjs/sdk/GearboxSDK.js +0 -696
  173. package/dist/cjs/sdk/market/kyc/KYCRegistry.js +0 -269
  174. package/dist/cjs/sdk/market/kyc/index.js +0 -26
  175. package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +0 -244
  176. package/dist/cjs/sdk/market/kyc/securitize/constants.js +0 -28
  177. package/dist/cjs/sdk/market/kyc/securitize/index.js +0 -26
  178. package/dist/cjs/sdk/market/kyc/securitize/types.js +0 -16
  179. package/dist/cjs/sdk/market/kyc/types.js +0 -34
  180. package/dist/cjs/sdk/utils/viem/executeDelegatedMulticalls.js +0 -38
  181. package/dist/esm/abi/kyc/iDSRegistryService.js +0 -46
  182. package/dist/esm/abi/kyc/iDSToken.js +0 -47
  183. package/dist/esm/abi/kyc/iKYCCompressor.js +0 -172
  184. package/dist/esm/abi/kyc/iKYCFactory.js +0 -98
  185. package/dist/esm/abi/kyc/iKYCUnderlying.js +0 -377
  186. package/dist/esm/abi/kyc/iSecuritizeDegenNFT.js +0 -302
  187. package/dist/esm/abi/kyc/iSecuritizeKYCFactory.js +0 -295
  188. package/dist/esm/dev/CachedStateSubscriber.js +0 -54
  189. package/dist/esm/sdk/GearboxSDK.js +0 -689
  190. package/dist/esm/sdk/market/kyc/KYCRegistry.js +0 -253
  191. package/dist/esm/sdk/market/kyc/index.js +0 -3
  192. package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +0 -220
  193. package/dist/esm/sdk/market/kyc/securitize/constants.js +0 -4
  194. package/dist/esm/sdk/market/kyc/securitize/index.js +0 -3
  195. package/dist/esm/sdk/market/kyc/securitize/types.js +0 -0
  196. package/dist/esm/sdk/market/kyc/types.js +0 -9
  197. package/dist/esm/sdk/utils/viem/executeDelegatedMulticalls.js +0 -14
  198. package/dist/types/abi/kyc/iDSRegistryService.d.ts +0 -71
  199. package/dist/types/abi/kyc/iDSToken.d.ts +0 -67
  200. package/dist/types/abi/kyc/iKYCCompressor.d.ts +0 -228
  201. package/dist/types/abi/kyc/iKYCFactory.d.ts +0 -139
  202. package/dist/types/abi/kyc/iKYCUnderlying.d.ts +0 -548
  203. package/dist/types/abi/kyc/iSecuritizeDegenNFT.d.ts +0 -404
  204. package/dist/types/abi/kyc/iSecuritizeKYCFactory.d.ts +0 -376
  205. package/dist/types/dev/CachedStateSubscriber.d.ts +0 -21
  206. package/dist/types/sdk/GearboxSDK.d.ts +0 -324
  207. package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +0 -52
  208. package/dist/types/sdk/market/kyc/index.d.ts +0 -3
  209. package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +0 -428
  210. package/dist/types/sdk/market/kyc/securitize/constants.d.ts +0 -1
  211. package/dist/types/sdk/market/kyc/securitize/index.d.ts +0 -3
  212. package/dist/types/sdk/market/kyc/securitize/types.d.ts +0 -127
  213. package/dist/types/sdk/market/kyc/types.d.ts +0 -170
  214. package/dist/types/sdk/utils/viem/executeDelegatedMulticalls.d.ts +0 -28
@@ -18,65 +18,20 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var options_exports = {};
20
20
  __export(options_exports, {
21
- SDKOptions: () => SDKOptions
21
+ AttachOptionsSchema: () => AttachOptionsSchema,
22
+ OnchainSDKOptionsSchema: () => OnchainSDKOptionsSchema
22
23
  });
23
24
  module.exports = __toCommonJS(options_exports);
24
25
  var import_v4 = require("zod/v4");
25
26
  var import_updates = require("./market/pricefeeds/updates/index.js");
26
27
  var import_utils = require("./utils/index.js");
27
- const SDKOptions = import_v4.z.object({
28
- /**
29
- * Override address of the Gearbox AddressProvider contract.
30
- * If not set, uses default universal address provider address {@link ADDRESS_PROVIDER_V310}
31
- **/
32
- addressProvider: (0, import_utils.ZodAddress)().optional(),
33
- /**
34
- * Addresses of market configurator contracts to load.
35
- * If not set, all default market configurators for the chain are loaded
36
- * (from {@link GearboxChain.defaultMarketConfigurators})
37
- **/
38
- marketConfigurators: import_v4.z.array((0, import_utils.ZodAddress)()).optional(),
39
- /**
40
- * Addresses of KYC factory contracts to load.
41
- * If not set, all default KYC factories for the chain are loaded
42
- * (from {@link GearboxChain.kycFactories})
43
- **/
44
- kycFactories: import_v4.z.array((0, import_utils.ZodAddress)()).optional(),
45
- /**
46
- * Pin SDK to a specific block number during attach.
47
- * When set, all on-chain reads use this block instead of `latest`.
48
- **/
49
- blockNumber: import_v4.z.union([import_v4.z.bigint().nonnegative(), import_v4.z.number().int().nonnegative()]).optional(),
50
- /**
51
- * Skip fetching updatable price feeds on attach and sync.
52
- * Speeds up initialisation when prices are not needed.
53
- **/
54
- ignoreUpdateablePrices: import_v4.z.boolean().optional(),
55
- /**
56
- * Pool addresses whose markets should be skipped during attach/hydrate/sync.
57
- **/
58
- ignoreMarkets: import_v4.z.array((0, import_utils.ZodAddress)()).optional(),
59
- /**
60
- * When `true`, throw on unrecognised contract types instead of falling
61
- * back to a generic contract wrapper.
62
- **/
28
+ const OnchainSDKOptionsSchema = import_v4.z.object({
29
+ /** When `true`, throw on unrecognised contract types. */
63
30
  strictContractTypes: import_v4.z.boolean().optional(),
64
- /**
65
- * Plugins that extend SDK functionality.
66
- **/
31
+ /** Plugins that extend SDK functionality. */
67
32
  plugins: import_v4.z.record(import_v4.z.string(), import_v4.z.any()).optional(),
68
- /**
69
- * Custom logger implementation.
70
- **/
33
+ /** Custom logger implementation. */
71
34
  logger: import_v4.z.any(),
72
- /**
73
- * Options for Redstone price-feed updates.
74
- **/
75
- redstone: import_updates.RedstoneOptions.optional(),
76
- /**
77
- * Options for Pyth price-feed updates.
78
- **/
79
- pyth: import_updates.PythOptions.optional(),
80
35
  /**
81
36
  * Explicit gas limit for read-only `eth_call` requests.
82
37
  * `null` disables the gas limit entirely; `undefined` uses the SDK default.
@@ -84,7 +39,24 @@ const SDKOptions = import_v4.z.object({
84
39
  **/
85
40
  gasLimit: import_v4.z.bigint().nonnegative().nullable().optional()
86
41
  });
42
+ const AttachOptionsSchema = import_v4.z.object({
43
+ /** Override address of the Gearbox AddressProvider contract. */
44
+ addressProvider: (0, import_utils.ZodAddress)().optional(),
45
+ /** Addresses of market configurator contracts to load. */
46
+ marketConfigurators: import_v4.z.array((0, import_utils.ZodAddress)()).optional(),
47
+ /** Pin SDK to a specific block number during attach. */
48
+ blockNumber: import_v4.z.union([import_v4.z.bigint().nonnegative(), import_v4.z.number().int().nonnegative()]).optional(),
49
+ /** Skip fetching updatable price feeds on attach and sync. */
50
+ ignoreUpdateablePrices: import_v4.z.boolean().optional(),
51
+ /** Pool addresses whose markets should be skipped. */
52
+ ignoreMarkets: import_v4.z.array((0, import_utils.ZodAddress)()).optional(),
53
+ /** Options for Redstone price-feed updates. */
54
+ redstone: import_updates.RedstoneOptions.optional(),
55
+ /** Options for Pyth price-feed updates. */
56
+ pyth: import_updates.PythOptions.optional()
57
+ });
87
58
  // Annotate the CommonJS export names for ESM import in node:
88
59
  0 && (module.exports = {
89
- SDKOptions
60
+ AttachOptionsSchema,
61
+ OnchainSDKOptionsSchema
90
62
  });
@@ -21,6 +21,7 @@ __export(BasePlugin_exports, {
21
21
  BasePlugin: () => BasePlugin
22
22
  });
23
23
  module.exports = __toCommonJS(BasePlugin_exports);
24
+ var import_core = require("../core/index.js");
24
25
  class BasePlugin {
25
26
  #sdk;
26
27
  logger;
@@ -43,19 +44,25 @@ class BasePlugin {
43
44
  **/
44
45
  get sdk() {
45
46
  if (!this.#sdk) {
46
- throw new Error("SDK is not attached");
47
+ throw new import_core.SdkNotAttachedError();
47
48
  }
48
49
  return this.#sdk;
49
50
  }
51
+ /**
52
+ * @internal
53
+ * Set the SDK instance. Called by the SDK constructor.
54
+ * @param sdk - The SDK instance.
55
+ * @throws Error if the SDK is already attached.
56
+ */
50
57
  set sdk(sdk) {
51
58
  if (this.#sdk) {
52
- throw new Error("SDK is already attached");
59
+ throw new import_core.SdkAlreadyAttachedError();
53
60
  }
54
61
  this.#sdk = sdk;
55
62
  this.logger = sdk.logger?.child?.({ name: this.constructor.name }) ?? sdk.logger;
56
63
  }
57
64
  /**
58
- * {@inheritDoc IGearboxSDKPlugin.attach}
65
+ * {@inheritDoc IOnchainSDKPlugin.attach}
59
66
  **/
60
67
  async attach() {
61
68
  if (this.loadOnAttach) {
@@ -63,7 +70,7 @@ class BasePlugin {
63
70
  }
64
71
  }
65
72
  /**
66
- * {@inheritDoc IGearboxSDKPlugin.syncState}
73
+ * {@inheritDoc IOnchainSDKPlugin.syncState}
67
74
  **/
68
75
  async syncState() {
69
76
  await this.load(false);
@@ -22,7 +22,6 @@ __export(PoolService_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(PoolService_exports);
24
24
  var import_generated = require("../../abi/310/generated.js");
25
- var import_iERC20 = require("../../abi/iERC20.js");
26
25
  var import_iERC20ZapperDeposits = require("../../abi/iERC20ZapperDeposits.js");
27
26
  var import_iETHZapperDeposits = require("../../abi/iETHZapperDeposits.js");
28
27
  var import_iZapper = require("../../abi/iZapper.js");
@@ -31,73 +30,28 @@ var import_constants = require("../constants/index.js");
31
30
  var import_utils = require("../utils/index.js");
32
31
  class PoolService extends import_base.SDKConstruct {
33
32
  /**
34
- * {@inheritDoc IPoolsService.getDepositTokensIn}
33
+ * @inheritdoc IPoolsService.getDepositTokensIn
35
34
  */
36
35
  getDepositTokensIn(pool) {
37
- const underlying = this.#describeUnderlying(pool);
38
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
39
- switch (underlying.contractType) {
40
- case import_base.KYC_UNDERLYING_DEFAULT:
41
- return this.#depositTokensIn(pool, false);
42
- case import_base.KYC_UNDERLYING_ON_DEMAND:
43
- return [underlying.asset];
44
- }
45
- }
46
36
  return this.#depositTokensIn(pool, true);
47
37
  }
48
38
  /**
49
- * {@inheritDoc IPoolsService.getDepositTokensOut}
39
+ * @inheritdoc IPoolsService.getDepositTokensOut
50
40
  */
51
41
  getDepositTokensOut(pool, tokenIn) {
52
- const underlying = this.#describeUnderlying(pool);
53
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
54
- switch (underlying.contractType) {
55
- case import_base.KYC_UNDERLYING_DEFAULT:
56
- return this.#depositTokensOut(pool, tokenIn, false);
57
- case import_base.KYC_UNDERLYING_ON_DEMAND:
58
- return [];
59
- }
60
- }
61
42
  return this.#depositTokensOut(pool, tokenIn, true);
62
43
  }
63
44
  /**
64
- * {@inheritDoc IPoolsService.getDepositMetadata}
45
+ * @inheritdoc IPoolsService.getDepositMetadata
65
46
  */
66
47
  getDepositMetadata(pool, tokenIn, tokenOut) {
67
- const underlying = this.#describeUnderlying(pool);
68
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
69
- switch (underlying.contractType) {
70
- case import_base.KYC_UNDERLYING_DEFAULT: {
71
- return this.#depositMetadata(
72
- "kyc-default",
73
- pool,
74
- tokenIn,
75
- tokenOut,
76
- false
77
- );
78
- }
79
- case import_base.KYC_UNDERLYING_ON_DEMAND:
80
- return {
81
- zapper: void 0,
82
- approveTarget: underlying.liquidityProvider.addr,
83
- permissible: false,
84
- type: "kyc-on-demand"
85
- };
86
- }
87
- }
88
48
  return this.#depositMetadata("classic", pool, tokenIn, tokenOut, true);
89
49
  }
90
50
  /**
91
- * {@inheritDoc IPoolsService.addLiquidity}
51
+ * @inheritdoc IPoolsService.addLiquidity
92
52
  */
93
53
  addLiquidity(props) {
94
54
  const { collateral, meta, permit, referralCode, pool, wallet } = props;
95
- const underlying = this.#describeUnderlying(pool);
96
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
97
- if (underlying.contractType === import_base.KYC_UNDERLYING_ON_DEMAND) {
98
- return void 0;
99
- }
100
- }
101
55
  const { zapper } = meta;
102
56
  if (zapper && (0, import_utils.hexEq)(zapper.tokenIn.addr, import_constants.NATIVE_ADDRESS)) {
103
57
  return {
@@ -137,51 +91,22 @@ class PoolService extends import_base.SDKConstruct {
137
91
  }
138
92
  }
139
93
  /**
140
- * {@inheritDoc IPoolsService.getWithdrawalTokensIn}
94
+ * @inheritdoc IPoolsService.getWithdrawalTokensIn
141
95
  */
142
96
  getWithdrawalTokensIn(pool) {
143
- const underlying = this.#describeUnderlying(pool);
144
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
145
- switch (underlying.contractType) {
146
- case import_base.KYC_UNDERLYING_DEFAULT:
147
- return this.#withdrawalTokensIn(pool, false);
148
- case import_base.KYC_UNDERLYING_ON_DEMAND:
149
- return [];
150
- }
151
- }
152
97
  return this.#withdrawalTokensIn(pool, true);
153
98
  }
154
99
  /**
155
- * {@inheritDoc IPoolsService.getWithdrawalTokensOut}
100
+ * @inheritdoc IPoolsService.getWithdrawalTokensOut
156
101
  */
157
102
  getWithdrawalTokensOut(pool, tokenIn) {
158
- const underlying = this.#describeUnderlying(pool);
159
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
160
- switch (underlying.contractType) {
161
- case import_base.KYC_UNDERLYING_DEFAULT:
162
- return this.#withdrawalTokensOut(pool, tokenIn, false);
163
- case import_base.KYC_UNDERLYING_ON_DEMAND:
164
- return [underlying.asset];
165
- }
166
- }
167
103
  return this.#withdrawalTokensOut(pool, tokenIn, true);
168
104
  }
169
105
  /**
170
- * {@inheritDoc IPoolsService.removeLiquidity}
106
+ * @inheritdoc IPoolsService.removeLiquidity
171
107
  */
172
108
  removeLiquidity(props) {
173
109
  const { pool, amount, meta, wallet, permit } = props;
174
- const underlying = this.#describeUnderlying(pool);
175
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
176
- if (underlying.contractType === import_base.KYC_UNDERLYING_ON_DEMAND) {
177
- return {
178
- abi: import_iERC20.ierc20Abi,
179
- functionName: "approve",
180
- args: [underlying.liquidityProvider, 0n],
181
- target: underlying.asset
182
- };
183
- }
184
- }
185
110
  if (meta.zapper) {
186
111
  return permit ? {
187
112
  target: meta.zapper.baseParams.addr,
@@ -210,30 +135,9 @@ class PoolService extends import_base.SDKConstruct {
210
135
  };
211
136
  }
212
137
  /**
213
- * {@inheritDoc IPoolsService.getWithdrawalMetadata}
138
+ * @inheritdoc IPoolsService.getWithdrawalMetadata
214
139
  */
215
140
  getWithdrawalMetadata(pool, tokenIn, tokenOut) {
216
- const underlying = this.#describeUnderlying(pool);
217
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
218
- switch (underlying.contractType) {
219
- case import_base.KYC_UNDERLYING_DEFAULT: {
220
- return this.#withdrawalMetadata(
221
- "kyc-default",
222
- pool,
223
- tokenIn,
224
- tokenOut,
225
- false
226
- );
227
- }
228
- case import_base.KYC_UNDERLYING_ON_DEMAND:
229
- return {
230
- zapper: void 0,
231
- approveTarget: void 0,
232
- permissible: false,
233
- type: "kyc-on-demand"
234
- };
235
- }
236
- }
237
141
  return this.#withdrawalMetadata("classic", pool, tokenIn, tokenOut, true);
238
142
  }
239
143
  /**
@@ -393,6 +297,8 @@ class PoolService extends import_base.SDKConstruct {
393
297
  zapper,
394
298
  // Approval target is zapper when routed, otherwise the pool contract.
395
299
  approveTarget: zapper?.baseParams.addr ?? pool.pool.address,
300
+ // TODO: instead of permissible, return permitType depending on tokenIn
301
+ // "none" | "eip2612" | "dai_like";
396
302
  permissible: !!zapper && !(0, import_utils.hexEq)(tokenIn, import_constants.NATIVE_ADDRESS),
397
303
  type
398
304
  };
@@ -420,6 +326,8 @@ class PoolService extends import_base.SDKConstruct {
420
326
  zapper,
421
327
  // Approval target exists only for zapper-based withdrawals.
422
328
  approveTarget: zapper?.baseParams.addr,
329
+ // TODO: instead of permissible, return permitType depending on tokenIn
330
+ // "none" | "eip2612" | "dai_like";
423
331
  permissible: !!zapper,
424
332
  type
425
333
  };
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var formatter_exports = {};
30
20
  __export(formatter_exports, {
@@ -47,7 +37,6 @@ __export(formatter_exports, {
47
37
  });
48
38
  module.exports = __toCommonJS(formatter_exports);
49
39
  var import_date_fns = require("date-fns");
50
- var import_decimal = __toESM(require("decimal.js-light"));
51
40
  var import_constants = require("../constants/index.js");
52
41
  const toBigInt = (v) => {
53
42
  const value = typeof v === "object" && v.type === "BigNumber" ? v.hex : v.toString();
@@ -151,17 +140,22 @@ function formatTimestamp(timestamp, raw = true) {
151
140
  function rayToNumber(num) {
152
141
  return Number(toBigInt(num) / 10n ** 21n) / 1e6;
153
142
  }
154
- function toSignificant(num, decimals, precision = 6) {
155
- if (num === 1n) return "0";
156
- const divider = new import_decimal.default(10).toPower(decimals);
157
- const number = new import_decimal.default(num.toString()).div(divider);
158
- return number.toSignificantDigits(precision, 4).toString();
159
- }
160
143
  function toBN(num, decimals) {
161
144
  if (num === "") return 0n;
162
- const multiplier = new import_decimal.default(10).toPower(decimals);
163
- const number = new import_decimal.default(num).mul(multiplier);
164
- return BigInt(number.toFixed(0));
145
+ const negative = num.startsWith("-");
146
+ const abs = negative ? num.slice(1) : num;
147
+ const [intPart = "0", fracPart = ""] = abs.split(".");
148
+ let frac = fracPart;
149
+ let roundUp = false;
150
+ if (frac.length > decimals) {
151
+ roundUp = frac.charCodeAt(decimals) >= 53;
152
+ frac = frac.slice(0, decimals);
153
+ } else {
154
+ frac = frac.padEnd(decimals, "0");
155
+ }
156
+ let result = BigInt(intPart + frac);
157
+ if (roundUp) result += 1n;
158
+ return negative ? -result : result;
165
159
  }
166
160
  function shortAddress(address) {
167
161
  return address === void 0 ? "" : `${address.slice(0, 6)}...${address.slice(address.length - 4)}`;
@@ -175,6 +169,91 @@ function formatPercentage(healthFactor, decimals = 2) {
175
169
  function formatLeverage(leverage, decimals = 2) {
176
170
  return (leverage / Number(import_constants.LEVERAGE_DECIMALS)).toFixed(decimals);
177
171
  }
172
+ function formatDecimalJsLikeToString(digits, base10exp) {
173
+ const len = digits.length;
174
+ const isExp = base10exp <= -7 || base10exp >= 21;
175
+ if (isExp) {
176
+ let coeff = digits;
177
+ if (len > 1) {
178
+ coeff = `${digits[0]}.${digits.slice(1)}`;
179
+ }
180
+ const exp = base10exp;
181
+ const expStr = exp < 0 ? `e${exp}` : `e+${exp}`;
182
+ return `${coeff}${expStr}`;
183
+ }
184
+ if (base10exp < 0) {
185
+ return `0.${"0".repeat(-base10exp - 1)}${digits}`;
186
+ }
187
+ if (base10exp >= len) {
188
+ return `${digits}${"0".repeat(base10exp + 1 - len)}`;
189
+ }
190
+ const k = base10exp + 1;
191
+ if (k === len) return digits;
192
+ return `${digits.slice(0, k)}.${digits.slice(k)}`;
193
+ }
194
+ function roundToSignificantDigitsHalfUp(digits, base10exp, precision) {
195
+ if (precision < 1) {
196
+ throw new Error(`Invalid precision: ${precision}`);
197
+ }
198
+ if (digits === "0") return { digits: "0", base10exp: 0 };
199
+ let norm = digits;
200
+ while (norm.length > 1 && norm.endsWith("0")) {
201
+ norm = norm.slice(0, -1);
202
+ }
203
+ digits = norm;
204
+ if (digits.length <= precision) {
205
+ return { digits, base10exp };
206
+ }
207
+ const cut = digits.slice(0, precision).split("");
208
+ const next = digits.charCodeAt(precision) - 48;
209
+ if (next >= 5) {
210
+ let i = cut.length - 1;
211
+ while (i >= 0) {
212
+ const cur = cut[i];
213
+ if (cur === void 0) {
214
+ throw new Error("roundToSignificantDigitsHalfUp: invalid state");
215
+ }
216
+ const d = cur.charCodeAt(0) - 48;
217
+ if (d !== 9) {
218
+ cut[i] = String.fromCharCode(48 + d + 1);
219
+ break;
220
+ }
221
+ cut[i] = "0";
222
+ i -= 1;
223
+ }
224
+ if (i < 0) {
225
+ cut.unshift("1");
226
+ base10exp += 1;
227
+ }
228
+ }
229
+ let rounded = cut.join("");
230
+ let tz = 0;
231
+ for (let i = rounded.length - 1; i >= 0 && rounded[i] === "0"; i -= 1) {
232
+ tz += 1;
233
+ }
234
+ if (tz > 0) {
235
+ rounded = rounded.slice(0, -tz);
236
+ }
237
+ if (rounded === "") {
238
+ return { digits: "0", base10exp: 0 };
239
+ }
240
+ return { digits: rounded, base10exp };
241
+ }
242
+ function toSignificant(num, decimals, precision = 6) {
243
+ if (num === 1n) return "0";
244
+ if (num === 0n) return "0";
245
+ const negative = num < 0n;
246
+ const abs = negative ? -num : num;
247
+ const rawDigits = abs.toString();
248
+ const base10exp = rawDigits.length - decimals - 1;
249
+ const rounded = roundToSignificantDigitsHalfUp(
250
+ rawDigits,
251
+ base10exp,
252
+ precision
253
+ );
254
+ const body = formatDecimalJsLikeToString(rounded.digits, rounded.base10exp);
255
+ return negative ? `-${body}` : body;
256
+ }
178
257
  // Annotate the CommonJS export names for ESM import in node:
179
258
  0 && (module.exports = {
180
259
  fmtBinaryMask,
@@ -16,19 +16,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  var viem_exports = {};
17
17
  module.exports = __toCommonJS(viem_exports);
18
18
  __reExport(viem_exports, require("./cast.js"), module.exports);
19
- __reExport(viem_exports, require("./executeDelegatedMulticalls.js"), module.exports);
20
19
  __reExport(viem_exports, require("./getLogsPaginated.js"), module.exports);
21
20
  __reExport(viem_exports, require("./getLogsSafe.js"), module.exports);
22
21
  __reExport(viem_exports, require("./sendRawTx.js"), module.exports);
23
22
  __reExport(viem_exports, require("./simulateMulticall.js"), module.exports);
24
23
  __reExport(viem_exports, require("./simulateWithPriceUpdates.js"), module.exports);
24
+ __reExport(viem_exports, require("./watchBlocksAsync.js"), module.exports);
25
25
  // Annotate the CommonJS export names for ESM import in node:
26
26
  0 && (module.exports = {
27
27
  ...require("./cast.js"),
28
- ...require("./executeDelegatedMulticalls.js"),
29
28
  ...require("./getLogsPaginated.js"),
30
29
  ...require("./getLogsSafe.js"),
31
30
  ...require("./sendRawTx.js"),
32
31
  ...require("./simulateMulticall.js"),
33
- ...require("./simulateWithPriceUpdates.js")
32
+ ...require("./simulateWithPriceUpdates.js"),
33
+ ...require("./watchBlocksAsync.js")
34
34
  });
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var watchBlocksAsync_exports = {};
20
+ __export(watchBlocksAsync_exports, {
21
+ watchBlocksAsync: () => watchBlocksAsync
22
+ });
23
+ module.exports = __toCommonJS(watchBlocksAsync_exports);
24
+ var import_actions = require("viem/actions");
25
+ var import_utils = require("viem/utils");
26
+ function watchBlocksAsync(client, parameters) {
27
+ const {
28
+ onBlock,
29
+ onError,
30
+ onDrop,
31
+ pollingInterval = client.pollingInterval
32
+ } = parameters;
33
+ let active = true;
34
+ let busy = false;
35
+ let prevBlock;
36
+ const poll = async () => {
37
+ if (!active) return;
38
+ let block;
39
+ try {
40
+ block = await (0, import_utils.getAction)(
41
+ client,
42
+ import_actions.getBlock,
43
+ "getBlock"
44
+ )({});
45
+ } catch (err) {
46
+ onError?.(err);
47
+ return;
48
+ }
49
+ if (!active) return;
50
+ if (block.number !== null && prevBlock?.number != null && block.number <= prevBlock.number) {
51
+ return;
52
+ }
53
+ if (busy) {
54
+ onDrop?.(block);
55
+ return;
56
+ }
57
+ busy = true;
58
+ try {
59
+ await onBlock(block, prevBlock);
60
+ prevBlock = block;
61
+ } catch (err) {
62
+ onError?.(err);
63
+ } finally {
64
+ busy = false;
65
+ }
66
+ };
67
+ const timer = setInterval(poll, pollingInterval);
68
+ return () => {
69
+ active = false;
70
+ clearInterval(timer);
71
+ };
72
+ }
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ watchBlocksAsync
76
+ });
@@ -6,7 +6,7 @@ import {
6
6
  parseEventLogs
7
7
  } from "viem";
8
8
  import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
9
- import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
9
+ import { iCreditFacadeV310Abi, iPoolV310Abi } from "../abi/310/generated.js";
10
10
  import { ierc20Abi } from "../abi/iERC20.js";
11
11
  import {
12
12
  ADDRESS_0X0,
@@ -15,7 +15,6 @@ import {
15
15
  childLogger,
16
16
  MAX_UINT256,
17
17
  PERCENTAGE_FACTOR,
18
- PoolService,
19
18
  SDKConstruct,
20
19
  sendRawTx
21
20
  } from "../sdk/index.js";
@@ -44,7 +43,6 @@ class AccountOpener extends SDKConstruct {
44
43
  #minDebtMultiplier;
45
44
  #allowMint;
46
45
  #leverageDelta;
47
- #poolService;
48
46
  constructor(service, options_ = {}) {
49
47
  super(service.sdk);
50
48
  const {
@@ -70,7 +68,6 @@ class AccountOpener extends SDKConstruct {
70
68
  this.#poolDepositMultiplier = BigInt(poolDepositMultiplier);
71
69
  this.#minDebtMultiplier = BigInt(minDebtMultiplier);
72
70
  this.#leverageDelta = BigInt(leverageDelta);
73
- this.#poolService = new PoolService(service.sdk);
74
71
  this.#logger?.info(
75
72
  {
76
73
  borrower: privateKeyToAccount(this.borrowerKey).address,
@@ -108,10 +105,6 @@ class AccountOpener extends SDKConstruct {
108
105
  },
109
106
  "opening credit accounts"
110
107
  );
111
- await Promise.all([
112
- this.sdk.tokensMeta.loadTokenData(),
113
- this.sdk.marketRegister.loadZappers()
114
- ]);
115
108
  let deposits = [];
116
109
  if (depositIntoPools) {
117
110
  try {
@@ -463,34 +456,9 @@ class AccountOpener extends SDKConstruct {
463
456
  this.#logger?.debug(
464
457
  `depositor balance in underlying: ${this.sdk.tokensMeta.formatBN(pool.underlying, allowance, { symbol: true })}`
465
458
  );
466
- const tokensOut = this.#poolService.getDepositTokensOut(
467
- address,
468
- underlying
469
- );
470
- this.#logger?.debug(
471
- { tokensOut: tokensOut.map((t) => this.labelAddress(t)) },
472
- "deposit tokens out"
473
- );
474
- if (tokensOut.length === 0) {
475
- throw new Error(`no tokens out found for pool ${poolName}`);
476
- }
477
- const tokenOut = tokensOut[0];
478
- const metadata = this.#poolService.getDepositMetadata(
479
- address,
480
- underlying,
481
- tokenOut
482
- );
483
- this.logger?.debug(
484
- {
485
- underlying: this.labelAddress(underlying),
486
- tokenOut: this.labelAddress(tokenOut),
487
- ...metadata
488
- },
489
- "pool deposit metadata"
490
- );
491
459
  txHash = await this.#anvil.writeContract({
492
460
  account: depositor,
493
- address: metadata.approveTarget,
461
+ address: underlying,
494
462
  abi: ierc20Abi,
495
463
  functionName: "approve",
496
464
  args: [address, allowance],
@@ -507,21 +475,12 @@ class AccountOpener extends SDKConstruct {
507
475
  this.#logger?.debug(
508
476
  `depositor approved underlying for pool ${poolName}: ${txHash}`
509
477
  );
510
- const depositCall = this.#poolService.addLiquidity({
511
- collateral: { token: underlying, balance: amount },
512
- pool: address,
513
- wallet: depositor.address,
514
- meta: metadata
515
- });
516
- if (!depositCall) {
517
- throw new Error(`no deposit call could be created for ${poolName}`);
518
- }
519
478
  txHash = await this.#anvil.writeContract({
520
479
  account: depositor,
521
- address: depositCall.target,
522
- abi: depositCall.abi,
523
- functionName: depositCall.functionName,
524
- args: depositCall.args,
480
+ address,
481
+ abi: iPoolV310Abi,
482
+ functionName: "deposit",
483
+ args: [amount, depositor.address],
525
484
  chain: this.#anvil.chain
526
485
  });
527
486
  receipt = await this.#anvil.waitForTransactionReceipt({ hash: txHash });