@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.
- package/dist/cjs/preview/parse/parseOperationCalldata.js +1 -1
- package/dist/cjs/preview/parse/parseRWAFactoryOperationCalldata.js +24 -8
- package/dist/cjs/preview/parse/types-rwa.js +16 -0
- package/dist/cjs/preview/parse/types.js +9 -2
- package/dist/cjs/preview/prerequisites/AllowancePrerequisite.js +13 -13
- package/dist/cjs/preview/prerequisites/BalancePrerequisite.js +13 -13
- package/dist/cjs/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +66 -0
- package/dist/cjs/preview/prerequisites/buildPrerequisites.js +71 -12
- package/dist/cjs/preview/prerequisites/index.js +2 -0
- package/dist/cjs/preview/simulate/index.js +5 -2
- package/dist/cjs/preview/simulate/simulateOperation.js +4 -0
- package/dist/cjs/preview/simulate/simulateRWAOperation.js +30 -0
- package/dist/cjs/sdk/market/rwa/securitize/SecuritizeRWAFactory.js +14 -4
- package/dist/cjs/sdk/market/rwa/types.js +5 -2
- package/dist/esm/preview/parse/parseOperationCalldata.js +2 -2
- package/dist/esm/preview/parse/parseRWAFactoryOperationCalldata.js +27 -9
- package/dist/esm/preview/parse/types-rwa.js +0 -0
- package/dist/esm/preview/parse/types.js +6 -1
- package/dist/esm/preview/prerequisites/AllowancePrerequisite.js +13 -13
- package/dist/esm/preview/prerequisites/BalancePrerequisite.js +13 -13
- package/dist/esm/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +42 -0
- package/dist/esm/preview/prerequisites/buildPrerequisites.js +73 -12
- package/dist/esm/preview/prerequisites/index.js +1 -0
- package/dist/esm/preview/simulate/index.js +3 -1
- package/dist/esm/preview/simulate/simulateOperation.js +8 -1
- package/dist/esm/preview/simulate/simulateRWAOperation.js +6 -0
- package/dist/esm/sdk/market/rwa/securitize/SecuritizeRWAFactory.js +14 -4
- package/dist/esm/sdk/market/rwa/types.js +5 -2
- package/dist/types/preview/parse/parseRWAFactoryOperationCalldata.d.ts +10 -11
- package/dist/types/preview/parse/types-rwa.d.ts +60 -0
- package/dist/types/preview/parse/types.d.ts +11 -6
- package/dist/types/preview/prerequisites/AllowancePrerequisite.d.ts +1 -3
- package/dist/types/preview/prerequisites/BalancePrerequisite.d.ts +1 -3
- package/dist/types/preview/prerequisites/RWAOpenRequirementsPrerequisite.d.ts +36 -0
- package/dist/types/preview/prerequisites/index.d.ts +1 -0
- package/dist/types/preview/prerequisites/types.d.ts +10 -8
- package/dist/types/preview/simulate/index.d.ts +2 -0
- package/dist/types/preview/simulate/simulateRWAOperation.d.ts +25 -0
- package/dist/types/sdk/market/rwa/securitize/SecuritizeRWAFactory.d.ts +4 -0
- package/dist/types/sdk/market/rwa/types.d.ts +13 -5
- 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}
|
|
170
|
+
* Narrows any contract to an {@link IRWAFactory}.
|
|
165
171
|
*
|
|
166
|
-
* @param
|
|
167
|
-
* @param type - expected factory type literal
|
|
168
|
-
*
|
|
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>(
|
|
178
|
+
export declare function isRWAFactory<T extends RWAFactoryType = RWAFactoryType>(contract: IBaseContract, type?: T): contract is IRWAFactory<T>;
|
|
171
179
|
export {};
|