@gearbox-protocol/sdk 3.0.0-vfourabi.1 → 3.0.0-vfourabi.3

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 (275) hide show
  1. package/.eslintignore +3 -0
  2. package/.github/workflows/lint_pr.yml +18 -0
  3. package/.github/workflows/pr.yml +39 -0
  4. package/.github/workflows/release.yml +47 -0
  5. package/.gitignore +19 -0
  6. package/.husky/commit-msg +1 -0
  7. package/.husky/pre-commit +1 -0
  8. package/.nvmrc +1 -0
  9. package/.releaserc.json +34 -0
  10. package/.vscode/extensions.json +7 -0
  11. package/.vscode/settings.json +16 -0
  12. package/.yarn/install-state.gz +0 -0
  13. package/.yarnrc.yml +1 -0
  14. package/ContributionAgreement +72 -0
  15. package/dist/cjs/abi/iZapper.cjs +85 -0
  16. package/dist/cjs/abi/iZapper.d.ts +123 -0
  17. package/dist/cjs/sdk/index.cjs +19830 -19764
  18. package/dist/cjs/sdk/index.d.ts +3746 -3061
  19. package/dist/esm/abi/iZapper.d.mts +123 -0
  20. package/dist/esm/abi/iZapper.mjs +83 -0
  21. package/dist/esm/sdk/index.d.mts +3746 -3061
  22. package/dist/esm/sdk/index.mjs +19807 -19765
  23. package/jest.config.js +7 -0
  24. package/package.json +32 -2
  25. package/scripts/example.ts +30 -0
  26. package/src/abi/compressors.ts +3962 -0
  27. package/src/abi/errors.ts +196 -0
  28. package/src/abi/iERC20.ts +122 -0
  29. package/src/abi/iPausable.ts +35 -0
  30. package/src/abi/iPriceFeedStore.ts +227 -0
  31. package/src/abi/iUpdatablePriceFeed.ts +16 -0
  32. package/src/abi/iVersion.ts +28 -0
  33. package/src/abi/iZapper.ts +84 -0
  34. package/src/abi/routerV300.ts +378 -0
  35. package/src/abi/v300.ts +4151 -0
  36. package/src/abi/v310.ts +5179 -0
  37. package/src/adapters/AbstractAdapter.ts +28 -0
  38. package/src/adapters/BalancerV2VaultAdapterContract.ts +19 -0
  39. package/src/adapters/BalancerV3RouterAdapterContract.ts +19 -0
  40. package/src/adapters/CamelotV3AdapterContract.ts +20 -0
  41. package/src/adapters/ConvexV1BaseRewardPoolAdapterContract.ts +20 -0
  42. package/src/adapters/ConvexV1BoosterAdapterContract.ts +20 -0
  43. package/src/adapters/Curve2AssetsAdapterContract.ts +20 -0
  44. package/src/adapters/Curve3AssetsAdapterContract.ts +20 -0
  45. package/src/adapters/Curve4AssetsAdapterContract.ts +20 -0
  46. package/src/adapters/CurveV1AdapterStETHContract.ts +20 -0
  47. package/src/adapters/CurveV1StableNGAdapterContract.ts +20 -0
  48. package/src/adapters/DaiUsdsAdapterContract.ts +21 -0
  49. package/src/adapters/ERC4626AdapterContract.ts +20 -0
  50. package/src/adapters/MellowERC4626VaultAdapterContract.ts +20 -0
  51. package/src/adapters/MellowVaultAdapterContract.ts +20 -0
  52. package/src/adapters/PendleRouterAdapterContract.ts +21 -0
  53. package/src/adapters/StakingRewardsAdapterContract.ts +21 -0
  54. package/src/adapters/UniswapV2AdapterContract.ts +20 -0
  55. package/src/adapters/UniswapV3AdapterContract.ts +170 -0
  56. package/src/adapters/VelodromeV2AdapterContract.ts +20 -0
  57. package/src/adapters/WstETHV1AdapterContract.ts +20 -0
  58. package/src/adapters/YearnV2AdapterContract.ts +20 -0
  59. package/src/adapters/abi/adapters.ts +4325 -0
  60. package/src/adapters/abi/iBalancerV3RouterAdapter.ts +126 -0
  61. package/src/adapters/abi/index.ts +2 -0
  62. package/src/adapters/index.ts +2 -0
  63. package/src/adapters/plugin.ts +90 -0
  64. package/src/adapters/types.ts +62 -0
  65. package/src/dev/AccountOpener.ts +611 -0
  66. package/src/dev/PriceFeedStore.ts +95 -0
  67. package/src/dev/SDKExample.ts +167 -0
  68. package/src/dev/abi.ts +14 -0
  69. package/src/dev/calcLiquidatableLTs.ts +77 -0
  70. package/src/dev/createAnvilClient.ts +155 -0
  71. package/src/dev/index.ts +7 -0
  72. package/src/dev/setLTZero.ts +127 -0
  73. package/src/dev/setLTs.ts +68 -0
  74. package/src/sdk/GearboxSDK.ts +488 -0
  75. package/src/sdk/abi/index.ts +1 -0
  76. package/src/sdk/abi/oracles.ts +4614 -0
  77. package/src/sdk/accounts/CreditAccountsService.ts +1123 -0
  78. package/src/sdk/accounts/index.ts +1 -0
  79. package/src/sdk/base/AddressLabeller.ts +35 -0
  80. package/src/sdk/base/BaseContract.ts +237 -0
  81. package/src/sdk/base/IAddressLabeller.ts +13 -0
  82. package/src/sdk/base/PlaceholderContract.ts +12 -0
  83. package/src/sdk/base/SDKConstruct.ts +35 -0
  84. package/src/sdk/base/TokensMeta.ts +45 -0
  85. package/src/sdk/base/index.ts +6 -0
  86. package/src/sdk/base/types.ts +102 -0
  87. package/src/sdk/bots/BotsService.ts +92 -0
  88. package/src/sdk/bots/index.ts +2 -0
  89. package/src/sdk/bots/utils.ts +19 -0
  90. package/src/sdk/chain/Provider.ts +99 -0
  91. package/src/sdk/chain/chains.ts +41 -0
  92. package/src/sdk/chain/detectChain.ts +21 -0
  93. package/src/sdk/chain/index.ts +3 -0
  94. package/src/sdk/constants/address-provider.ts +47 -0
  95. package/src/sdk/constants/addresses.ts +82 -0
  96. package/src/sdk/constants/bot-permissions.ts +36 -0
  97. package/src/sdk/constants/index.ts +6 -0
  98. package/src/sdk/constants/math.ts +23 -0
  99. package/src/sdk/constants/networks.ts +38 -0
  100. package/src/sdk/constants/periphery.ts +7 -0
  101. package/src/sdk/core/BotListV3Contract.ts +103 -0
  102. package/src/sdk/core/GearStakingV3Contract.ts +84 -0
  103. package/src/sdk/core/address-provider/AbstractAddressProviderContract.ts +101 -0
  104. package/src/sdk/core/address-provider/AddressProviderV3Contract.ts +105 -0
  105. package/src/sdk/core/address-provider/AddressProviderV3_1Contract.ts +92 -0
  106. package/src/sdk/core/address-provider/getAddressProvider.ts +45 -0
  107. package/src/sdk/core/address-provider/index.ts +4 -0
  108. package/src/sdk/core/address-provider/types.ts +17 -0
  109. package/src/sdk/core/index.ts +3 -0
  110. package/src/sdk/gauges/GaugeStakingService.ts +100 -0
  111. package/src/sdk/gauges/index.ts +2 -0
  112. package/src/sdk/gauges/utils.ts +25 -0
  113. package/src/sdk/index.ts +17 -0
  114. package/src/sdk/market/MarketConfiguratorContract.ts +78 -0
  115. package/src/sdk/market/MarketRegister.ts +330 -0
  116. package/src/sdk/market/MarketSuite.ts +83 -0
  117. package/src/sdk/market/adapters/PlaceholderAdapterContracts.ts +18 -0
  118. package/src/sdk/market/adapters/factory.ts +34 -0
  119. package/src/sdk/market/adapters/index.ts +3 -0
  120. package/src/sdk/market/adapters/types.ts +7 -0
  121. package/src/sdk/market/credit/CreditConfiguratorV300Contract.ts +164 -0
  122. package/src/sdk/market/credit/CreditConfiguratorV310Contract.ts +139 -0
  123. package/src/sdk/market/credit/CreditFacadeV300Contract.ts +206 -0
  124. package/src/sdk/market/credit/CreditFacadeV310Contract.ts +190 -0
  125. package/src/sdk/market/credit/CreditManagerV300Contract.ts +122 -0
  126. package/src/sdk/market/credit/CreditManagerV310Contract.ts +122 -0
  127. package/src/sdk/market/credit/CreditSuite.ts +65 -0
  128. package/src/sdk/market/credit/createCreditConfigurator.ts +18 -0
  129. package/src/sdk/market/credit/createCreditFacade.ts +18 -0
  130. package/src/sdk/market/credit/createCreditManager.ts +18 -0
  131. package/src/sdk/market/credit/index.ts +8 -0
  132. package/src/sdk/market/credit/types.ts +42 -0
  133. package/src/sdk/market/index.ts +7 -0
  134. package/src/sdk/market/oracle/PriceOracleBaseContract.ts +376 -0
  135. package/src/sdk/market/oracle/PriceOracleV300Contract.ts +71 -0
  136. package/src/sdk/market/oracle/PriceOracleV310Contract.ts +43 -0
  137. package/src/sdk/market/oracle/createPriceOracle.ts +22 -0
  138. package/src/sdk/market/oracle/index.ts +4 -0
  139. package/src/sdk/market/oracle/types.ts +48 -0
  140. package/src/sdk/market/pool/GaugeContract.ts +120 -0
  141. package/src/sdk/market/pool/LinearInterestRateModelContract.ts +75 -0
  142. package/src/sdk/market/pool/PoolQuotaKeeperV300Contract.ts +89 -0
  143. package/src/sdk/market/pool/PoolQuotaKeeperV310Contract.ts +89 -0
  144. package/src/sdk/market/pool/PoolSuite.ts +76 -0
  145. package/src/sdk/market/pool/PoolV300Contract.ts +144 -0
  146. package/src/sdk/market/pool/PoolV310Contract.ts +144 -0
  147. package/src/sdk/market/pool/TumblerContract.ts +73 -0
  148. package/src/sdk/market/pool/createInterestRateModel.ts +33 -0
  149. package/src/sdk/market/pool/createPool.ts +19 -0
  150. package/src/sdk/market/pool/createPoolQuotaKeeper.ts +20 -0
  151. package/src/sdk/market/pool/createRateKeeper.ts +25 -0
  152. package/src/sdk/market/pool/index.ts +6 -0
  153. package/src/sdk/market/pool/types.ts +28 -0
  154. package/src/sdk/market/pricefeeds/AbstractLPPriceFeed.ts +71 -0
  155. package/src/sdk/market/pricefeeds/AbstractPriceFeed.ts +137 -0
  156. package/src/sdk/market/pricefeeds/BalancerStablePriceFeed.ts +24 -0
  157. package/src/sdk/market/pricefeeds/BalancerWeightedPriceFeed.ts +70 -0
  158. package/src/sdk/market/pricefeeds/BoundedPriceFeed.ts +34 -0
  159. package/src/sdk/market/pricefeeds/ChainlinkPriceFeed.ts +16 -0
  160. package/src/sdk/market/pricefeeds/CompositePriceFeed.ts +25 -0
  161. package/src/sdk/market/pricefeeds/CurveCryptoPriceFeed.ts +24 -0
  162. package/src/sdk/market/pricefeeds/CurveStablePriceFeed.ts +24 -0
  163. package/src/sdk/market/pricefeeds/CurveUSDPriceFeed.ts +24 -0
  164. package/src/sdk/market/pricefeeds/Erc4626PriceFeed.ts +36 -0
  165. package/src/sdk/market/pricefeeds/MellowLRTPriceFeed.ts +26 -0
  166. package/src/sdk/market/pricefeeds/PendleTWAPPTPriceFeed.ts +44 -0
  167. package/src/sdk/market/pricefeeds/PriceFeedRef.ts +34 -0
  168. package/src/sdk/market/pricefeeds/PriceFeedsRegister.ts +293 -0
  169. package/src/sdk/market/pricefeeds/RedstonePriceFeed.ts +65 -0
  170. package/src/sdk/market/pricefeeds/RedstoneUpdater.ts +304 -0
  171. package/src/sdk/market/pricefeeds/WstETHPriceFeed.ts +24 -0
  172. package/src/sdk/market/pricefeeds/YearnPriceFeed.ts +24 -0
  173. package/src/sdk/market/pricefeeds/ZeroPriceFeed.ts +17 -0
  174. package/src/sdk/market/pricefeeds/index.ts +20 -0
  175. package/src/sdk/market/pricefeeds/types.ts +82 -0
  176. package/src/sdk/market/pricefeeds/utils.ts +24 -0
  177. package/src/sdk/plugins/index.ts +10 -0
  178. package/src/sdk/router/PathOptionFactory.ts +147 -0
  179. package/src/sdk/router/RouterV3Contract.ts +558 -0
  180. package/src/sdk/router/index.ts +2 -0
  181. package/src/sdk/router/types.ts +48 -0
  182. package/src/sdk/sdk-gov-legacy/contracts/adapters.ts +39 -0
  183. package/src/sdk/sdk-gov-legacy/contracts/contracts.ts +647 -0
  184. package/src/sdk/sdk-gov-legacy/contracts/index.ts +2 -0
  185. package/src/sdk/sdk-gov-legacy/core/constants.ts +11 -0
  186. package/src/sdk/sdk-gov-legacy/index.ts +4 -0
  187. package/src/sdk/sdk-gov-legacy/oracles/PriceFeedType.ts +24 -0
  188. package/src/sdk/sdk-gov-legacy/oracles/index.ts +1 -0
  189. package/src/sdk/sdk-gov-legacy/tokens/aave.ts +101 -0
  190. package/src/sdk/sdk-gov-legacy/tokens/aura.ts +284 -0
  191. package/src/sdk/sdk-gov-legacy/tokens/balancer.ts +421 -0
  192. package/src/sdk/sdk-gov-legacy/tokens/compound.ts +79 -0
  193. package/src/sdk/sdk-gov-legacy/tokens/convex.ts +561 -0
  194. package/src/sdk/sdk-gov-legacy/tokens/curveLP.ts +480 -0
  195. package/src/sdk/sdk-gov-legacy/tokens/decimals.ts +301 -0
  196. package/src/sdk/sdk-gov-legacy/tokens/erc4626.ts +75 -0
  197. package/src/sdk/sdk-gov-legacy/tokens/gear.ts +273 -0
  198. package/src/sdk/sdk-gov-legacy/tokens/index.ts +18 -0
  199. package/src/sdk/sdk-gov-legacy/tokens/normal.ts +613 -0
  200. package/src/sdk/sdk-gov-legacy/tokens/quoted.ts +10 -0
  201. package/src/sdk/sdk-gov-legacy/tokens/stakingRewards.ts +41 -0
  202. package/src/sdk/sdk-gov-legacy/tokens/token.ts +2354 -0
  203. package/src/sdk/sdk-gov-legacy/tokens/tokenData.ts +44 -0
  204. package/src/sdk/sdk-gov-legacy/tokens/tokenType.ts +33 -0
  205. package/src/sdk/sdk-gov-legacy/tokens/wrapped.ts +28 -0
  206. package/src/sdk/sdk-gov-legacy/tokens/yearn.ts +122 -0
  207. package/src/sdk/sdk-gov-legacy/tokens/zircuit.ts +44 -0
  208. package/src/sdk/sdk-legacy/apy/index.ts +149 -0
  209. package/src/sdk/sdk-legacy/core/assets.ts +200 -0
  210. package/src/sdk/sdk-legacy/core/creditAccount.spec.ts +1966 -0
  211. package/src/sdk/sdk-legacy/core/creditAccount.ts +816 -0
  212. package/src/sdk/sdk-legacy/core/creditManager.ts +316 -0
  213. package/src/sdk/sdk-legacy/core/creditSession.ts +352 -0
  214. package/src/sdk/sdk-legacy/core/endpoint.ts +131 -0
  215. package/src/sdk/sdk-legacy/core/eventOrTx.ts +101 -0
  216. package/src/sdk/sdk-legacy/core/pool.ts +439 -0
  217. package/src/sdk/sdk-legacy/core/strategy.ts +82 -0
  218. package/src/sdk/sdk-legacy/core/transactions.ts +865 -0
  219. package/src/sdk/sdk-legacy/gearboxRewards/api.ts +704 -0
  220. package/src/sdk/sdk-legacy/gearboxRewards/apy.ts +267 -0
  221. package/src/sdk/sdk-legacy/gearboxRewards/extraAPY.ts +165 -0
  222. package/src/sdk/sdk-legacy/gearboxRewards/index.ts +3 -0
  223. package/src/sdk/sdk-legacy/gearboxRewards/merklAPI.ts +151 -0
  224. package/src/sdk/sdk-legacy/index.ts +21 -0
  225. package/src/sdk/sdk-legacy/pathfinder/core.ts +18 -0
  226. package/src/sdk/sdk-legacy/pathfinder/index.ts +1 -0
  227. package/src/sdk/sdk-legacy/payload/creditAccount.ts +48 -0
  228. package/src/sdk/sdk-legacy/payload/creditManager.ts +133 -0
  229. package/src/sdk/sdk-legacy/payload/creditSession.ts +143 -0
  230. package/src/sdk/sdk-legacy/payload/graphPayload.ts +10 -0
  231. package/src/sdk/sdk-legacy/payload/pool.ts +198 -0
  232. package/src/sdk/sdk-legacy/payload/token.ts +13 -0
  233. package/src/sdk/sdk-legacy/tokens/tokenData.ts +57 -0
  234. package/src/sdk/sdk-legacy/types/IAirdropDistributor.ts +103 -0
  235. package/src/sdk/sdk-legacy/types/IBaseRewardPool.ts +249 -0
  236. package/src/sdk/sdk-legacy/types/IDataCompressorV3.ts +957 -0
  237. package/src/sdk/sdk-legacy/types/IDegenDistributor.ts +70 -0
  238. package/src/sdk/sdk-legacy/types/IERC20Permit.ts +35 -0
  239. package/src/sdk/sdk-legacy/types/IERC20ZapperDeposits.ts +99 -0
  240. package/src/sdk/sdk-legacy/types/IETHZapperDeposits.ts +27 -0
  241. package/src/sdk/sdk-legacy/types/IFarmingPool.ts +229 -0
  242. package/src/sdk/sdk-legacy/types/IInterestRateModel.ts +23 -0
  243. package/src/sdk/sdk-legacy/types/IMulticall3.ts +242 -0
  244. package/src/sdk/sdk-legacy/types/IOffchainOracle.ts +31 -0
  245. package/src/sdk/sdk-legacy/types/index.ts +11 -0
  246. package/src/sdk/sdk-legacy/utils/formatter.ts +46 -0
  247. package/src/sdk/sdk-legacy/utils/index.ts +3 -0
  248. package/src/sdk/sdk-legacy/utils/math.ts +6 -0
  249. package/src/sdk/sdk-legacy/utils/price.ts +27 -0
  250. package/src/sdk/types/index.ts +5 -0
  251. package/src/sdk/types/logger.ts +13 -0
  252. package/src/sdk/types/state-human.ts +224 -0
  253. package/src/sdk/types/state.ts +8 -0
  254. package/src/sdk/types/transactions.ts +22 -0
  255. package/src/sdk/types/tvl.ts +4 -0
  256. package/src/sdk/utils/AddressMap.ts +111 -0
  257. package/src/sdk/utils/bytes32ToString.ts +6 -0
  258. package/src/sdk/utils/childLogger.ts +8 -0
  259. package/src/sdk/utils/createRawTx.ts +86 -0
  260. package/src/sdk/utils/etherscan.ts +42 -0
  261. package/src/sdk/utils/filterDust.ts +20 -0
  262. package/src/sdk/utils/formatter.ts +124 -0
  263. package/src/sdk/utils/index.ts +10 -0
  264. package/src/sdk/utils/internal/Hooks.ts +51 -0
  265. package/src/sdk/utils/internal/index.ts +1 -0
  266. package/src/sdk/utils/json.ts +27 -0
  267. package/src/sdk/utils/mappers.ts +38 -0
  268. package/src/sdk/utils/retry.ts +24 -0
  269. package/src/sdk/utils/viem/detectNetwork.ts +27 -0
  270. package/src/sdk/utils/viem/index.ts +3 -0
  271. package/src/sdk/utils/viem/sendRawTx.ts +36 -0
  272. package/src/sdk/utils/viem/simulateMulticall.ts +262 -0
  273. package/tsconfig.build.json +4 -0
  274. package/tsconfig.json +16 -0
  275. package/tsup.config.ts +77 -0
@@ -0,0 +1,865 @@
1
+ import type { Address } from "viem";
2
+
3
+ import type { Asset } from "../../router";
4
+ import { formatBN } from "../../utils";
5
+ import type { TokenData } from "../tokens/tokenData";
6
+ import { BigIntMath } from "../utils/math";
7
+ import type { EVMTxProps } from "./eventOrTx";
8
+ import { EVMTx } from "./eventOrTx";
9
+
10
+ const GEAR_DECIMALS = 18;
11
+
12
+ export interface TxSerialized {
13
+ type:
14
+ | "TxAddLiquidity"
15
+ | "TxRemoveLiquidity"
16
+ | "TxSwap"
17
+ | "TxAddCollateral"
18
+ | "TxIncreaseBorrowAmount"
19
+ | "TxDecreaseBorrowAmount"
20
+ | "TxRepayAccount"
21
+ | "TxCloseAccount"
22
+ | "TxApprove"
23
+ | "TxOpenMultitokenAccount"
24
+ | "TxClaimNFT"
25
+ | "TxClaimRewards"
26
+ | "TxUpdateQuota"
27
+ | "TxGaugeStake"
28
+ | "TxGaugeUnstake"
29
+ | "TxGaugeClaim"
30
+ | "TxGaugeVote"
31
+ | "TxWithdrawCollateral"
32
+ | "TxAddBot"
33
+ | "TxRemoveBot"
34
+ | "TxLiquidateAccount"
35
+ | "TxStakeDiesel"
36
+ | "TxUnstakeDiesel";
37
+ content: string;
38
+ }
39
+
40
+ export class TxSerializer {
41
+ static serialize(items: Array<EVMTx>): string {
42
+ return JSON.stringify(items.map(i => i.serialize()));
43
+ }
44
+
45
+ static deserialize(data: string): Array<EVMTx> {
46
+ return (JSON.parse(data) as Array<TxSerialized>).map(e => {
47
+ const params = JSON.parse(e.content);
48
+ switch (e.type) {
49
+ case "TxAddLiquidity":
50
+ return new TxAddLiquidity(params);
51
+ case "TxRemoveLiquidity":
52
+ return new TxRemoveLiquidity(params);
53
+ case "TxSwap":
54
+ return new TXSwap(params);
55
+ case "TxAddCollateral":
56
+ return new TxAddCollateral(params);
57
+ case "TxIncreaseBorrowAmount":
58
+ return new TxIncreaseBorrowAmount(params);
59
+ case "TxDecreaseBorrowAmount":
60
+ return new TxDecreaseBorrowAmount(params);
61
+ case "TxRepayAccount":
62
+ return new TxRepayAccount(params);
63
+ case "TxCloseAccount":
64
+ return new TxCloseAccount(params);
65
+ case "TxApprove":
66
+ return new TxApprove(params);
67
+ case "TxOpenMultitokenAccount":
68
+ return new TxOpenMultitokenAccount(params);
69
+ case "TxClaimNFT":
70
+ return new TxClaimNFT(params);
71
+ case "TxClaimRewards":
72
+ return new TxClaimRewards(params);
73
+ case "TxUpdateQuota":
74
+ return new TxUpdateQuota(params);
75
+ case "TxGaugeStake":
76
+ return new TxGaugeStake(params);
77
+ case "TxGaugeUnstake":
78
+ return new TxGaugeUnstake(params);
79
+ case "TxGaugeClaim":
80
+ return new TxGaugeClaim(params);
81
+ case "TxGaugeVote":
82
+ return new TxGaugeVote(params);
83
+ case "TxWithdrawCollateral":
84
+ return new TxWithdrawCollateral(params);
85
+ case "TxAddBot":
86
+ return new TxAddBot(params);
87
+ case "TxRemoveBot":
88
+ return new TxRemoveBot(params);
89
+ case "TxLiquidateAccount":
90
+ return new TxLiquidateAccount(params);
91
+ case "TxStakeDiesel":
92
+ return new TxStakeDiesel(params);
93
+ case "TxUnstakeDiesel":
94
+ return new TxUnstakeDiesel(params);
95
+
96
+ default:
97
+ throw new Error(`Unknown transaction for parsing: ${e.type}`);
98
+ }
99
+ });
100
+ }
101
+ }
102
+
103
+ interface AddLiquidityProps extends EVMTxProps {
104
+ amount: bigint;
105
+ token: Address;
106
+ poolName: string;
107
+
108
+ tokensList: Record<Address, TokenData>;
109
+ }
110
+
111
+ export class TxAddLiquidity extends EVMTx {
112
+ readonly amount: bigint;
113
+ readonly token: TokenData;
114
+ readonly poolName: string;
115
+
116
+ constructor(opts: AddLiquidityProps) {
117
+ super(opts);
118
+ this.amount = opts.amount;
119
+ this.token = opts.tokensList[opts.token];
120
+ this.poolName = opts.poolName;
121
+ }
122
+
123
+ toString() {
124
+ const { title, decimals = 18 } = this.token;
125
+
126
+ return `${this.poolName}: Deposit ${formatBN(
127
+ this.amount,
128
+ decimals,
129
+ )} ${title}`;
130
+ }
131
+
132
+ serialize(): TxSerialized {
133
+ return {
134
+ type: "TxAddLiquidity",
135
+ content: JSON.stringify(this),
136
+ };
137
+ }
138
+ }
139
+
140
+ interface RemoveLiquidityProps extends EVMTxProps {
141
+ amount: bigint;
142
+ token: Address;
143
+ poolName: string;
144
+
145
+ tokensList: Record<Address, TokenData>;
146
+ }
147
+
148
+ export class TxRemoveLiquidity extends EVMTx {
149
+ readonly amount: bigint;
150
+ readonly token: TokenData;
151
+ readonly poolName: string;
152
+
153
+ constructor(opts: RemoveLiquidityProps) {
154
+ super(opts);
155
+ this.amount = opts.amount;
156
+ this.token = opts.tokensList[opts.token];
157
+ this.poolName = opts.poolName;
158
+ }
159
+
160
+ toString() {
161
+ const { title, decimals = 18 } = this.token;
162
+
163
+ return `${this.poolName}: Withdraw ${formatBN(
164
+ this.amount,
165
+ decimals,
166
+ )} ${title}`;
167
+ }
168
+
169
+ serialize(): TxSerialized {
170
+ return {
171
+ type: "TxRemoveLiquidity",
172
+ content: JSON.stringify(this),
173
+ };
174
+ }
175
+ }
176
+
177
+ interface TxStakeDieselProps extends EVMTxProps {
178
+ amount: bigint;
179
+ tokenFrom: Address;
180
+ tokenTo: Address;
181
+ poolName: string;
182
+
183
+ tokensList: Record<Address, TokenData>;
184
+ }
185
+
186
+ export class TxStakeDiesel extends EVMTx {
187
+ readonly amount: bigint;
188
+ readonly tokenFrom: TokenData;
189
+ readonly tokenTo: TokenData;
190
+ readonly poolName: string;
191
+
192
+ constructor(opts: TxStakeDieselProps) {
193
+ super(opts);
194
+ this.amount = opts.amount;
195
+ this.tokenFrom = opts.tokensList[opts.tokenFrom];
196
+ this.tokenTo = opts.tokensList[opts.tokenTo];
197
+ this.poolName = opts.poolName;
198
+ }
199
+
200
+ toString() {
201
+ const { title: fromSymbol, decimals: fromDecimals = 18 } = this.tokenFrom;
202
+ const { title: toSymbol } = this.tokenTo;
203
+
204
+ return `${this.poolName}: Stake ${formatBN(
205
+ this.amount,
206
+ fromDecimals,
207
+ )} ${fromSymbol} => ${toSymbol}`;
208
+ }
209
+
210
+ serialize(): TxSerialized {
211
+ return {
212
+ type: "TxStakeDiesel",
213
+ content: JSON.stringify(this),
214
+ };
215
+ }
216
+ }
217
+
218
+ export class TxUnstakeDiesel extends EVMTx {
219
+ readonly amount: bigint;
220
+ readonly tokenFrom: TokenData;
221
+ readonly tokenTo: TokenData;
222
+ readonly poolName: string;
223
+
224
+ constructor(opts: TxStakeDieselProps) {
225
+ super(opts);
226
+ this.amount = opts.amount;
227
+ this.tokenFrom = opts.tokensList[opts.tokenFrom];
228
+ this.tokenTo = opts.tokensList[opts.tokenTo];
229
+ this.poolName = opts.poolName;
230
+ }
231
+
232
+ toString() {
233
+ const { title: fromSymbol, decimals: fromDecimals = 18 } = this.tokenFrom;
234
+ const { title: toSymbol } = this.tokenTo;
235
+
236
+ return `${this.poolName}: Unstake ${formatBN(
237
+ this.amount,
238
+ fromDecimals,
239
+ )} ${fromSymbol} => ${toSymbol}`;
240
+ }
241
+
242
+ serialize(): TxSerialized {
243
+ return {
244
+ type: "TxUnstakeDiesel",
245
+ content: JSON.stringify(this),
246
+ };
247
+ }
248
+ }
249
+
250
+ interface SwapProps extends EVMTxProps {
251
+ operation: string;
252
+ amountFrom: bigint;
253
+ amountTo?: bigint;
254
+ tokenFrom: Address;
255
+ tokenTo?: Address;
256
+ creditManagerName: string;
257
+
258
+ tokensList: Record<Address, TokenData>;
259
+ }
260
+
261
+ export class TXSwap extends EVMTx {
262
+ readonly operation: string;
263
+ readonly amountFrom: bigint;
264
+ readonly amountTo?: bigint;
265
+ readonly tokenFrom: TokenData;
266
+ readonly tokenTo?: TokenData;
267
+ readonly creditManagerName: string;
268
+
269
+ constructor(opts: SwapProps) {
270
+ super(opts);
271
+ this.operation = opts.operation;
272
+ this.amountFrom = opts.amountFrom;
273
+ this.amountTo = opts.amountTo;
274
+ this.tokenFrom = opts.tokensList[opts.tokenFrom];
275
+ this.tokenTo = opts.tokenTo ? opts.tokensList[opts.tokenTo] : undefined;
276
+ this.creditManagerName = opts.creditManagerName;
277
+ }
278
+
279
+ toString() {
280
+ let toPart = "";
281
+ if (this.tokenTo && this.amountTo) {
282
+ const { title: toSymbol, decimals: toDecimals = 18 } = this.tokenTo;
283
+
284
+ toPart = ` ⇒ ${formatBN(this.amountTo, toDecimals)} ${toSymbol}`;
285
+ }
286
+
287
+ const { title: fromSymbol, decimals: fromDecimals = 18 } = this.tokenFrom;
288
+
289
+ return `Credit Account ${this.creditManagerName}: ${
290
+ this.operation
291
+ } ${formatBN(this.amountFrom, fromDecimals)} ${fromSymbol} ${toPart}`;
292
+ }
293
+
294
+ serialize(): TxSerialized {
295
+ return {
296
+ type: "TxSwap",
297
+ content: JSON.stringify(this),
298
+ };
299
+ }
300
+ }
301
+
302
+ interface AddCollateralProps extends EVMTxProps {
303
+ amount: bigint;
304
+ token: Address;
305
+ creditManagerName: string;
306
+
307
+ tokensList: Record<Address, TokenData>;
308
+ }
309
+
310
+ export class TxAddCollateral extends EVMTx {
311
+ readonly amount: bigint;
312
+ readonly token: TokenData;
313
+ readonly creditManagerName: string;
314
+
315
+ constructor(opts: AddCollateralProps) {
316
+ super(opts);
317
+ this.amount = opts.amount;
318
+ this.token = opts.tokensList[opts.token];
319
+ this.creditManagerName = opts.creditManagerName;
320
+ }
321
+
322
+ toString() {
323
+ const { title: addedSymbol, decimals: addedDecimals = 18 } = this.token;
324
+
325
+ return `Credit Account ${this.creditManagerName}: Added ${formatBN(
326
+ this.amount,
327
+ addedDecimals,
328
+ )} ${addedSymbol} as collateral`;
329
+ }
330
+
331
+ serialize(): TxSerialized {
332
+ return {
333
+ type: "TxAddCollateral",
334
+ content: JSON.stringify(this),
335
+ };
336
+ }
337
+ }
338
+
339
+ interface IncreaseBorrowAmountProps extends EVMTxProps {
340
+ amount: bigint;
341
+ token: Address;
342
+ creditManagerName: string;
343
+
344
+ tokensList: Record<Address, TokenData>;
345
+ }
346
+
347
+ export class TxIncreaseBorrowAmount extends EVMTx {
348
+ readonly amount: bigint;
349
+ readonly token: TokenData;
350
+ readonly creditManagerName: string;
351
+
352
+ constructor(opts: IncreaseBorrowAmountProps) {
353
+ super(opts);
354
+ this.amount = opts.amount;
355
+ this.token = opts.tokensList[opts.token];
356
+ this.creditManagerName = opts.creditManagerName;
357
+ }
358
+
359
+ toString() {
360
+ const { title: tokenSymbol, decimals: tokenDecimals } = this.token;
361
+
362
+ return `Credit Account ${
363
+ this.creditManagerName
364
+ }: Borrowed amount was increased for ${formatBN(
365
+ this.amount,
366
+ tokenDecimals || 18,
367
+ )} ${tokenSymbol}`;
368
+ }
369
+
370
+ serialize(): TxSerialized {
371
+ return {
372
+ type: "TxIncreaseBorrowAmount",
373
+ content: JSON.stringify(this),
374
+ };
375
+ }
376
+ }
377
+
378
+ interface DecreaseBorrowAmountProps extends EVMTxProps {
379
+ amount: bigint;
380
+ token: Address;
381
+ creditManagerName: string;
382
+
383
+ tokensList: Record<Address, TokenData>;
384
+ }
385
+
386
+ export class TxDecreaseBorrowAmount extends EVMTx {
387
+ readonly amount: bigint;
388
+ readonly token: TokenData;
389
+ readonly creditManagerName: string;
390
+
391
+ constructor(opts: DecreaseBorrowAmountProps) {
392
+ super(opts);
393
+ this.amount = opts.amount;
394
+ this.token = opts.tokensList[opts.token];
395
+ this.creditManagerName = opts.creditManagerName;
396
+ }
397
+
398
+ toString() {
399
+ const { title: tokenSymbol, decimals: tokenDecimals } = this.token;
400
+
401
+ return `Credit Account ${
402
+ this.creditManagerName
403
+ }: Borrowed amount was decreased for ${formatBN(
404
+ this.amount,
405
+ tokenDecimals || 18,
406
+ )} ${tokenSymbol}`;
407
+ }
408
+
409
+ serialize(): TxSerialized {
410
+ return {
411
+ type: "TxIncreaseBorrowAmount",
412
+ content: JSON.stringify(this),
413
+ };
414
+ }
415
+ }
416
+
417
+ interface TxOpenMultitokenAccountProps extends EVMTxProps {
418
+ borrowedAmount: bigint;
419
+ creditManagerName: string;
420
+ underlyingToken: Address;
421
+ assets: Array<Address>;
422
+ withdrawDebt: boolean;
423
+
424
+ tokensList: Record<Address, TokenData>;
425
+ }
426
+
427
+ export class TxOpenMultitokenAccount extends EVMTx {
428
+ readonly borrowedAmount: bigint;
429
+ readonly creditManagerName: string;
430
+ readonly underlyingToken: TokenData;
431
+ readonly assets: Array<TokenData>;
432
+ readonly withdrawDebt: boolean;
433
+
434
+ constructor(opts: TxOpenMultitokenAccountProps) {
435
+ super(opts);
436
+ this.borrowedAmount = opts.borrowedAmount;
437
+ this.underlyingToken = opts.tokensList[opts.underlyingToken];
438
+ this.creditManagerName = opts.creditManagerName;
439
+ this.assets = opts.assets.map(a => opts.tokensList[a]);
440
+ this.withdrawDebt = opts.withdrawDebt;
441
+ }
442
+
443
+ toString() {
444
+ const assetSymbols = this.assets.reduce<Array<string>>((acc, asset) => {
445
+ const { title: tokenSymbol } = asset;
446
+ const skip =
447
+ this.withdrawDebt && this.underlyingToken.address === asset.address;
448
+
449
+ if (!skip && tokenSymbol) acc.push(tokenSymbol);
450
+ return acc;
451
+ }, []);
452
+
453
+ const name = this.creditManagerName;
454
+
455
+ const { title: underlyingSymbol, decimals: underlyingDecimals } =
456
+ this.underlyingToken;
457
+ const borrowedAmount = `${formatBN(
458
+ this.borrowedAmount,
459
+ underlyingDecimals || 18,
460
+ )} ${underlyingSymbol}`;
461
+
462
+ const assets = assetSymbols.join(", ");
463
+
464
+ const withdraw = this.withdrawDebt ? [`Withdrawn: ${borrowedAmount}`] : [];
465
+
466
+ return [
467
+ `Credit Account ${name}: opening. Borrowed amount: ${borrowedAmount}; assets: ${assets}`,
468
+ ...withdraw,
469
+ ].join("; ");
470
+ }
471
+
472
+ serialize(): TxSerialized {
473
+ return {
474
+ type: "TxOpenMultitokenAccount",
475
+ content: JSON.stringify(this),
476
+ };
477
+ }
478
+ }
479
+
480
+ export class TxClaimNFT extends EVMTx {
481
+ toString() {
482
+ return `NFT claimed`;
483
+ }
484
+
485
+ serialize(): TxSerialized {
486
+ return {
487
+ type: "TxClaimNFT",
488
+ content: JSON.stringify(this),
489
+ };
490
+ }
491
+ }
492
+
493
+ interface TxClaimRewardsProps extends EVMTxProps {
494
+ rewards: Array<Asset>;
495
+
496
+ tokensList: Record<Address, TokenData>;
497
+ }
498
+
499
+ export class TxClaimRewards extends EVMTx {
500
+ readonly rewards: Array<Omit<Asset, "token"> & { token: TokenData }>;
501
+
502
+ constructor(opts: TxClaimRewardsProps) {
503
+ super(opts);
504
+
505
+ this.rewards = opts.rewards.map(({ token, balance }) => ({
506
+ token: opts.tokensList[token],
507
+ balance,
508
+ }));
509
+ }
510
+
511
+ toString() {
512
+ const rewardsString =
513
+ this.rewards.length <= 2
514
+ ? this.rewards
515
+ .map(({ token, balance }) => {
516
+ const { title, decimals = 18 } = token;
517
+ return `${formatBN(balance, decimals)} ${title}`;
518
+ })
519
+ .join(", ")
520
+ : this.rewards
521
+ .map(({ token }) => {
522
+ const { title } = token;
523
+ return title;
524
+ })
525
+ .join(", ");
526
+
527
+ return `Rewards claimed: ${rewardsString}`;
528
+ }
529
+
530
+ serialize(): TxSerialized {
531
+ return {
532
+ type: "TxClaimRewards",
533
+ content: JSON.stringify(this),
534
+ };
535
+ }
536
+ }
537
+
538
+ interface RepayAccountProps extends EVMTxProps {
539
+ creditManagerName: string;
540
+ }
541
+
542
+ export class TxRepayAccount extends EVMTx {
543
+ readonly creditManagerName: string;
544
+
545
+ constructor(opts: RepayAccountProps) {
546
+ super(opts);
547
+ this.creditManagerName = opts.creditManagerName;
548
+ }
549
+
550
+ toString() {
551
+ return `Credit Account ${this.creditManagerName}: Repaying account`;
552
+ }
553
+
554
+ serialize(): TxSerialized {
555
+ return {
556
+ type: "TxRepayAccount",
557
+ content: JSON.stringify(this),
558
+ };
559
+ }
560
+ }
561
+
562
+ interface LiquidateAccountProps extends EVMTxProps {
563
+ creditManagerName: string;
564
+ }
565
+
566
+ export class TxLiquidateAccount extends EVMTx {
567
+ readonly creditManagerName: string;
568
+
569
+ constructor(opts: LiquidateAccountProps) {
570
+ super(opts);
571
+ this.creditManagerName = opts.creditManagerName;
572
+ }
573
+
574
+ toString() {
575
+ return `Credit Account ${this.creditManagerName}: Liquidated`;
576
+ }
577
+
578
+ serialize(): TxSerialized {
579
+ return {
580
+ type: "TxLiquidateAccount",
581
+ content: JSON.stringify(this),
582
+ };
583
+ }
584
+ }
585
+
586
+ interface CloseAccountProps extends EVMTxProps {
587
+ creditManagerName: string;
588
+ }
589
+
590
+ export class TxCloseAccount extends EVMTx {
591
+ readonly creditManagerName: string;
592
+
593
+ constructor(opts: CloseAccountProps) {
594
+ super(opts);
595
+ this.creditManagerName = opts.creditManagerName;
596
+ }
597
+
598
+ toString() {
599
+ return `Credit Account ${this.creditManagerName}: Closing account`;
600
+ }
601
+
602
+ serialize(): TxSerialized {
603
+ return {
604
+ type: "TxCloseAccount",
605
+ content: JSON.stringify(this),
606
+ };
607
+ }
608
+ }
609
+
610
+ interface ApproveProps extends EVMTxProps {
611
+ token: Address;
612
+
613
+ tokensList: Record<Address, TokenData>;
614
+ }
615
+
616
+ export class TxApprove extends EVMTx {
617
+ readonly token: TokenData;
618
+
619
+ constructor(opts: ApproveProps) {
620
+ super(opts);
621
+ this.token = opts.tokensList[opts.token];
622
+ }
623
+
624
+ toString() {
625
+ const { title: symbol } = this.token;
626
+ return `Approve ${symbol}`;
627
+ }
628
+
629
+ serialize(): TxSerialized {
630
+ return {
631
+ type: "TxApprove",
632
+ content: JSON.stringify(this),
633
+ };
634
+ }
635
+ }
636
+
637
+ interface TxUpdateQuotaProps extends EVMTxProps {
638
+ updatedQuotas: Array<Asset>;
639
+ underlyingToken: Address;
640
+ creditManagerName: string;
641
+
642
+ tokensList: Record<Address, TokenData>;
643
+ }
644
+
645
+ export class TxUpdateQuota extends EVMTx {
646
+ readonly updatedQuotas: Array<Omit<Asset, "token"> & { token: TokenData }>;
647
+ readonly underlyingToken: TokenData;
648
+ readonly creditManagerName: string;
649
+
650
+ constructor(opts: TxUpdateQuotaProps) {
651
+ super(opts);
652
+ this.updatedQuotas = opts.updatedQuotas.map(({ token, balance }) => ({
653
+ token: opts.tokensList[token],
654
+ balance,
655
+ }));
656
+ this.creditManagerName = opts.creditManagerName;
657
+ this.underlyingToken = opts.tokensList[opts.underlyingToken];
658
+ }
659
+
660
+ toString() {
661
+ const { decimals: underlyingDecimals } = this.underlyingToken;
662
+
663
+ const quota = this.updatedQuotas.map(({ token, balance }) => {
664
+ const { title: tokenSymbol } = token;
665
+
666
+ const sign = balance < 0 ? "-" : "";
667
+ const amountString = formatBN(
668
+ BigIntMath.abs(balance),
669
+ underlyingDecimals || 18,
670
+ );
671
+
672
+ return `${tokenSymbol} by ${sign}${amountString}`;
673
+ });
674
+
675
+ return `Credit Account ${
676
+ this.creditManagerName
677
+ } quota updated: ${quota.join("; ")}`;
678
+ }
679
+
680
+ serialize(): TxSerialized {
681
+ return {
682
+ type: "TxUpdateQuota",
683
+ content: JSON.stringify(this),
684
+ };
685
+ }
686
+ }
687
+
688
+ interface TxGaugeStakeProps extends EVMTxProps {
689
+ amount: bigint;
690
+ }
691
+
692
+ export class TxGaugeStake extends EVMTx {
693
+ readonly amount: bigint;
694
+
695
+ constructor(opts: TxGaugeStakeProps) {
696
+ super(opts);
697
+ this.amount = opts.amount;
698
+ }
699
+
700
+ toString() {
701
+ const amountString = formatBN(BigIntMath.abs(this.amount), GEAR_DECIMALS);
702
+
703
+ return `Gauge: staked ${amountString} GEAR`;
704
+ }
705
+
706
+ serialize(): TxSerialized {
707
+ return {
708
+ type: "TxGaugeStake",
709
+ content: JSON.stringify(this),
710
+ };
711
+ }
712
+ }
713
+
714
+ interface TxGaugeUnstakeProps extends EVMTxProps {
715
+ amount: bigint;
716
+ }
717
+
718
+ export class TxGaugeUnstake extends EVMTx {
719
+ readonly amount: bigint;
720
+
721
+ constructor(opts: TxGaugeUnstakeProps) {
722
+ super(opts);
723
+ this.amount = opts.amount;
724
+ }
725
+
726
+ toString() {
727
+ const amountString = formatBN(BigIntMath.abs(this.amount), GEAR_DECIMALS);
728
+
729
+ return `Gauge: unstaked ${amountString} GEAR`;
730
+ }
731
+
732
+ serialize(): TxSerialized {
733
+ return {
734
+ type: "TxGaugeUnstake",
735
+ content: JSON.stringify(this),
736
+ };
737
+ }
738
+ }
739
+
740
+ export class TxGaugeClaim extends EVMTx {
741
+ toString() {
742
+ return `Gauge: withdrawals claimed`;
743
+ }
744
+
745
+ serialize(): TxSerialized {
746
+ return {
747
+ type: "TxGaugeClaim",
748
+ content: JSON.stringify(this),
749
+ };
750
+ }
751
+ }
752
+
753
+ interface TxGaugeVoteProps extends EVMTxProps {
754
+ tokens: Array<{ token: Address }>;
755
+
756
+ tokensList: Record<Address, TokenData>;
757
+ }
758
+
759
+ export class TxGaugeVote extends EVMTx {
760
+ readonly tokens: Array<TokenData>;
761
+
762
+ constructor(opts: TxGaugeVoteProps) {
763
+ super(opts);
764
+ this.tokens = opts.tokens.map(t => opts.tokensList[t.token]);
765
+ }
766
+
767
+ toString() {
768
+ const votes = this.tokens.map(({ title }) => {
769
+ return title;
770
+ });
771
+
772
+ return `Gauge: voted for ${votes.join(", ")}`;
773
+ }
774
+
775
+ serialize(): TxSerialized {
776
+ return {
777
+ type: "TxGaugeVote",
778
+ content: JSON.stringify(this),
779
+ };
780
+ }
781
+ }
782
+
783
+ interface WithdrawCollateralProps extends EVMTxProps {
784
+ amount: bigint;
785
+ token: Address;
786
+ to: Address;
787
+ creditManagerName: string;
788
+
789
+ tokensList: Record<Address, TokenData>;
790
+ }
791
+
792
+ export class TxWithdrawCollateral extends EVMTx {
793
+ readonly amount: bigint;
794
+ readonly token: TokenData;
795
+ readonly to: Address;
796
+ readonly creditManagerName: string;
797
+
798
+ constructor(opts: WithdrawCollateralProps) {
799
+ super(opts);
800
+ this.amount = opts.amount;
801
+ this.token = opts.tokensList[opts.token];
802
+ this.to = opts.to;
803
+ this.creditManagerName = opts.creditManagerName;
804
+ }
805
+
806
+ toString() {
807
+ const { title: symbol, decimals } = this.token;
808
+
809
+ return `Credit Account ${this.creditManagerName}: withdrawn ${formatBN(
810
+ this.amount,
811
+ decimals || 18,
812
+ )} ${symbol}`;
813
+ }
814
+
815
+ serialize(): TxSerialized {
816
+ return {
817
+ type: "TxWithdrawCollateral",
818
+ content: JSON.stringify(this),
819
+ };
820
+ }
821
+ }
822
+
823
+ interface TxAddBotProps extends EVMTxProps {
824
+ creditManagerName: string;
825
+ }
826
+
827
+ export class TxAddBot extends EVMTx {
828
+ readonly creditManagerName: string;
829
+
830
+ constructor(opts: TxAddBotProps) {
831
+ super(opts);
832
+ this.creditManagerName = opts.creditManagerName;
833
+ }
834
+
835
+ toString() {
836
+ return `Credit Account ${this.creditManagerName}: bot enabled`;
837
+ }
838
+
839
+ serialize(): TxSerialized {
840
+ return {
841
+ type: "TxAddBot",
842
+ content: JSON.stringify(this),
843
+ };
844
+ }
845
+ }
846
+
847
+ export class TxRemoveBot extends EVMTx {
848
+ readonly creditManagerName: string;
849
+
850
+ constructor(opts: TxAddBotProps) {
851
+ super(opts);
852
+ this.creditManagerName = opts.creditManagerName;
853
+ }
854
+
855
+ toString() {
856
+ return `Credit Account ${this.creditManagerName}: bot disabled`;
857
+ }
858
+
859
+ serialize(): TxSerialized {
860
+ return {
861
+ type: "TxAddBot",
862
+ content: JSON.stringify(this),
863
+ };
864
+ }
865
+ }