@gearbox-protocol/sdk 14.12.0-next.3 → 14.12.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/cjs/preview/parse/parseOperationCalldata.js +1 -1
  2. package/dist/cjs/preview/parse/parseRWAFactoryOperationCalldata.js +24 -8
  3. package/dist/cjs/preview/parse/types-rwa.js +16 -0
  4. package/dist/cjs/preview/parse/types.js +9 -2
  5. package/dist/cjs/preview/prerequisites/AllowancePrerequisite.js +13 -13
  6. package/dist/cjs/preview/prerequisites/BalancePrerequisite.js +13 -13
  7. package/dist/cjs/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +66 -0
  8. package/dist/cjs/preview/prerequisites/buildPrerequisites.js +71 -12
  9. package/dist/cjs/preview/prerequisites/index.js +2 -0
  10. package/dist/cjs/preview/simulate/index.js +5 -2
  11. package/dist/cjs/preview/simulate/simulateOperation.js +4 -0
  12. package/dist/cjs/preview/simulate/simulateRWAOperation.js +30 -0
  13. package/dist/cjs/sdk/market/rwa/securitize/SecuritizeRWAFactory.js +14 -4
  14. package/dist/cjs/sdk/market/rwa/types.js +5 -2
  15. package/dist/esm/preview/parse/parseOperationCalldata.js +2 -2
  16. package/dist/esm/preview/parse/parseRWAFactoryOperationCalldata.js +27 -9
  17. package/dist/esm/preview/parse/types-rwa.js +0 -0
  18. package/dist/esm/preview/parse/types.js +6 -1
  19. package/dist/esm/preview/prerequisites/AllowancePrerequisite.js +13 -13
  20. package/dist/esm/preview/prerequisites/BalancePrerequisite.js +13 -13
  21. package/dist/esm/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +42 -0
  22. package/dist/esm/preview/prerequisites/buildPrerequisites.js +73 -12
  23. package/dist/esm/preview/prerequisites/index.js +1 -0
  24. package/dist/esm/preview/simulate/index.js +3 -1
  25. package/dist/esm/preview/simulate/simulateOperation.js +8 -1
  26. package/dist/esm/preview/simulate/simulateRWAOperation.js +6 -0
  27. package/dist/esm/sdk/market/rwa/securitize/SecuritizeRWAFactory.js +14 -4
  28. package/dist/esm/sdk/market/rwa/types.js +5 -2
  29. package/dist/types/preview/parse/parseRWAFactoryOperationCalldata.d.ts +10 -11
  30. package/dist/types/preview/parse/types-rwa.d.ts +60 -0
  31. package/dist/types/preview/parse/types.d.ts +11 -6
  32. package/dist/types/preview/prerequisites/AllowancePrerequisite.d.ts +1 -3
  33. package/dist/types/preview/prerequisites/BalancePrerequisite.d.ts +1 -3
  34. package/dist/types/preview/prerequisites/RWAOpenRequirementsPrerequisite.d.ts +36 -0
  35. package/dist/types/preview/prerequisites/index.d.ts +1 -0
  36. package/dist/types/preview/prerequisites/types.d.ts +10 -8
  37. package/dist/types/preview/simulate/index.d.ts +2 -0
  38. package/dist/types/preview/simulate/simulateRWAOperation.d.ts +25 -0
  39. package/dist/types/sdk/market/rwa/securitize/SecuritizeRWAFactory.d.ts +4 -0
  40. package/dist/types/sdk/market/rwa/types.d.ts +13 -5
  41. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ import type { Address, Hex } from "viem";
2
+ import type { OnchainSDK } from "../../sdk/index.js";
3
+ import type { RWAOperation } from "../parse/index.js";
4
+ import type { OperationSimulationOptions, PoolOperationSimulation } from "./types.js";
5
+ export interface SimulateRWAOperationInput {
6
+ /** Only `client`/`networkType` are used, so any OnchainSDK works. */
7
+ sdk: OnchainSDK;
8
+ /** Parsed RWA-factory operation to simulate. */
9
+ operation: RWAOperation;
10
+ /** Target contract the calldata is sent to (the RWA factory). */
11
+ to: Address;
12
+ /** Raw RWA-factory calldata to simulate. */
13
+ calldata: Hex;
14
+ /** Wallet whose balance changes and transfers we track. */
15
+ wallet: Address;
16
+ }
17
+ /**
18
+ * Simulates an RWA-factory operation.
19
+ *
20
+ * Not yet implemented: like credit-facade simulation, it requires
21
+ * multicall-aware balance/transfer accounting that the pool simulation does
22
+ * not cover. The signature mirrors {@link simulatePoolOperation} so the
23
+ * {@link simulateOperation} wrapper can delegate uniformly once implemented.
24
+ */
25
+ export declare function simulateRWAOperation(_input: SimulateRWAOperationInput, _options?: OperationSimulationOptions): Promise<PoolOperationSimulation>;
@@ -468,6 +468,10 @@ export declare class SecuritizeRWAFactory extends BaseContract<abi> implements I
468
468
  * {@inheritDoc IRWAFactory.decodeInvestorData}
469
469
  */
470
470
  decodeInvestorData(data: RWACompressorInvestorData): SecuritizeInvestorData;
471
+ /**
472
+ * {@inheritDoc IRWAFactory.getTokens}
473
+ */
474
+ getTokens(): Address[];
471
475
  /**
472
476
  * {@inheritDoc IRWAFactory.getInvestor}
473
477
  */
@@ -102,6 +102,12 @@ export interface IRWAFactory<T extends RWAFactoryType = RWAFactoryType> extends
102
102
  * @param data - raw RWACompressor InvestorData
103
103
  **/
104
104
  decodeInvestorData(data: RWACompressorInvestorData): RWAInvestorData<T>;
105
+ /**
106
+ * Returns the RWA token addresses this factory can register/gate
107
+ * (e.g. Securitize DSTokens). Named for parity with the Solidity
108
+ * `IRWAFactory` contract.
109
+ **/
110
+ getTokens(): Address[];
105
111
  /**
106
112
  * Returns the investor address for a credit account.
107
113
  * @param creditAccount - credit account address
@@ -161,11 +167,13 @@ export interface IRWAFactory<T extends RWAFactoryType = RWAFactoryType> extends
161
167
  openCreditAccount(creditManager: Address, calls: MultiCall[], options?: RWAOperationParams<T>): RawTx;
162
168
  }
163
169
  /**
164
- * Narrows an {@link IRWAFactory} to a specific factory type.
170
+ * Narrows any contract to an {@link IRWAFactory}.
165
171
  *
166
- * @param factory - factory instance to check
167
- * @param type - expected factory type literal
168
- * @returns `true` if `factory.factoryType === type`
172
+ * @param contract - contract instance to check
173
+ * @param type - optional expected factory type literal. When provided, narrows
174
+ * to the concrete `IRWAFactory<T>`; when omitted, narrows to the
175
+ * generalized {@link IRWAFactory}
176
+ * @returns `true` if the contract is an RWA factory (of the given type, if provided)
169
177
  **/
170
- export declare function isRWAFactory<T extends RWAFactoryType>(factory: IRWAFactory, type: T): factory is IRWAFactory<T>;
178
+ export declare function isRWAFactory<T extends RWAFactoryType = RWAFactoryType>(contract: IBaseContract, type?: T): contract is IRWAFactory<T>;
171
179
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "14.12.0-next.3",
3
+ "version": "14.12.0-next.4",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {