@gearbox-protocol/sdk 14.7.0 → 14.8.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abi/compressors/{kycCompressor.js → rwaCompressor.js} +13 -13
- package/dist/cjs/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.js → rwa/onDemandRWAUnderlyingSubcompressor.js} +6 -6
- package/dist/cjs/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.js → rwa/securitizeRWAFactorySubcompressor.js} +6 -6
- package/dist/cjs/abi/{kyc/iKYCCompressor.js → rwa/iRWACompressor.js} +13 -13
- package/dist/cjs/abi/{kyc/iKYCFactory.js → rwa/iRWAFactory.js} +6 -6
- package/dist/cjs/abi/{kyc/iKYCUnderlying.js → rwa/iRWAUnderlying.js} +7 -7
- package/dist/cjs/abi/{kyc/iSecuritizeKYCFactory.js → rwa/iSecuritizeRWAFactory.js} +7 -7
- package/dist/cjs/dev/claimDSToken.js +4 -4
- package/dist/cjs/plugins/adapters/abi/index.js +2 -0
- package/dist/cjs/plugins/adapters/abi/securitize/index.js +30 -0
- package/dist/cjs/sdk/OnchainSDK.js +12 -12
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +59 -59
- package/dist/cjs/sdk/base/TokensMeta.js +6 -6
- package/dist/cjs/sdk/base/token-types.js +11 -11
- package/dist/cjs/sdk/chain/chains.js +16 -16
- package/dist/cjs/sdk/constants/address-provider.js +3 -3
- package/dist/cjs/sdk/market/MarketSuite.js +2 -2
- package/dist/cjs/sdk/market/index.js +2 -2
- package/dist/cjs/sdk/market/pool/PoolSuite.js +2 -2
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +3 -3
- package/dist/cjs/sdk/market/{kyc/KYCRegistry.js → rwa/RWARegistry.js} +48 -48
- package/dist/cjs/sdk/market/{kyc → rwa}/index.js +6 -6
- package/dist/cjs/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.js +1 -1
- package/dist/cjs/sdk/market/{kyc/securitize/SecuritizeKYCFactory.js → rwa/securitize/SecuritizeRWAFactory.js} +20 -20
- package/dist/cjs/sdk/market/{kyc → rwa}/securitize/constants.js +3 -3
- package/dist/cjs/sdk/market/{kyc → rwa}/securitize/index.js +2 -2
- package/dist/cjs/sdk/market/{kyc → rwa}/types.js +6 -6
- package/dist/cjs/sdk/options.js +4 -4
- package/dist/cjs/sdk/pools/PoolService.js +26 -26
- package/dist/esm/abi/compressors/{kycCompressor.js → rwaCompressor.js} +9 -9
- package/dist/esm/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.js → rwa/onDemandRWAUnderlyingSubcompressor.js} +2 -2
- package/dist/esm/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.js → rwa/securitizeRWAFactorySubcompressor.js} +2 -2
- package/dist/esm/abi/{kyc/iKYCCompressor.js → rwa/iRWACompressor.js} +9 -9
- package/dist/esm/abi/{kyc/iKYCFactory.js → rwa/iRWAFactory.js} +2 -2
- package/dist/esm/abi/{kyc/iKYCUnderlying.js → rwa/iRWAUnderlying.js} +3 -3
- package/dist/esm/abi/{kyc/iSecuritizeKYCFactory.js → rwa/iSecuritizeRWAFactory.js} +3 -3
- package/dist/esm/dev/claimDSToken.js +4 -4
- package/dist/esm/plugins/adapters/abi/index.js +1 -0
- package/dist/esm/plugins/adapters/abi/securitize/index.js +5 -0
- package/dist/esm/sdk/OnchainSDK.js +13 -13
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +59 -59
- package/dist/esm/sdk/base/TokensMeta.js +6 -6
- package/dist/esm/sdk/base/token-types.js +7 -7
- package/dist/esm/sdk/chain/chains.js +16 -16
- package/dist/esm/sdk/constants/address-provider.js +2 -2
- package/dist/esm/sdk/market/MarketSuite.js +2 -2
- package/dist/esm/sdk/market/index.js +1 -1
- package/dist/esm/sdk/market/pool/PoolSuite.js +2 -2
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +3 -3
- package/dist/esm/sdk/market/{kyc/KYCRegistry.js → rwa/RWARegistry.js} +50 -50
- package/dist/esm/sdk/market/{kyc → rwa}/index.js +1 -1
- package/dist/esm/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.js +1 -1
- package/dist/esm/sdk/market/{kyc/securitize/SecuritizeKYCFactory.js → rwa/securitize/SecuritizeRWAFactory.js} +17 -17
- package/dist/esm/sdk/market/rwa/securitize/constants.js +4 -0
- package/dist/esm/sdk/market/{kyc → rwa}/securitize/index.js +1 -1
- package/dist/esm/sdk/market/rwa/types.js +9 -0
- package/dist/esm/sdk/options.js +4 -4
- package/dist/esm/sdk/pools/PoolService.js +28 -28
- package/dist/types/abi/compressors/{kycCompressor.d.ts → rwaCompressor.d.ts} +8 -8
- package/dist/types/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.d.ts → rwa/onDemandRWAUnderlyingSubcompressor.d.ts} +1 -1
- package/dist/types/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.d.ts → rwa/securitizeRWAFactorySubcompressor.d.ts} +1 -1
- package/dist/types/abi/{kyc/iKYCCompressor.d.ts → rwa/iRWACompressor.d.ts} +8 -8
- package/dist/types/abi/{kyc/iKYCFactory.d.ts → rwa/iRWAFactory.d.ts} +1 -1
- package/dist/types/abi/{kyc/iKYCUnderlying.d.ts → rwa/iRWAUnderlying.d.ts} +2 -2
- package/dist/types/abi/{kyc/iSecuritizeKYCFactory.d.ts → rwa/iSecuritizeRWAFactory.d.ts} +2 -2
- package/dist/types/dev/claimDSToken.d.ts +1 -1
- package/dist/types/plugins/adapters/abi/index.d.ts +1 -0
- package/dist/types/plugins/adapters/abi/securitize/index.d.ts +5 -0
- package/dist/types/sdk/OnchainSDK.d.ts +5 -5
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +19 -19
- package/dist/types/sdk/accounts/types.d.ts +26 -26
- package/dist/types/sdk/base/TokensMeta.d.ts +5 -5
- package/dist/types/sdk/base/token-types.d.ts +17 -17
- package/dist/types/sdk/base/types.d.ts +2 -2
- package/dist/types/sdk/chain/chains.d.ts +2 -2
- package/dist/types/sdk/constants/address-provider.d.ts +1 -1
- package/dist/types/sdk/market/MarketSuite.d.ts +2 -2
- package/dist/types/sdk/market/index.d.ts +1 -1
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -2
- package/dist/types/sdk/market/rwa/RWARegistry.d.ts +52 -0
- package/dist/types/sdk/market/{kyc → rwa}/index.d.ts +1 -1
- package/dist/types/sdk/market/{kyc/securitize/SecuritizeKYCFactory.d.ts → rwa/securitize/SecuritizeRWAFactory.d.ts} +16 -16
- package/dist/types/sdk/market/rwa/securitize/constants.d.ts +1 -0
- package/dist/types/sdk/market/{kyc → rwa}/securitize/index.d.ts +1 -1
- package/dist/types/sdk/market/{kyc → rwa}/securitize/types.d.ts +12 -12
- package/dist/types/sdk/market/{kyc → rwa}/types.d.ts +48 -48
- package/dist/types/sdk/market/types.d.ts +1 -1
- package/dist/types/sdk/options.d.ts +1 -1
- package/dist/types/sdk/pools/types.d.ts +4 -4
- package/dist/types/sdk/types/state-human.d.ts +2 -2
- package/dist/types/sdk/types/state.d.ts +3 -3
- package/package.json +1 -1
- package/dist/esm/sdk/market/kyc/securitize/constants.js +0 -4
- package/dist/esm/sdk/market/kyc/types.js +0 -9
- package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +0 -52
- package/dist/types/sdk/market/kyc/securitize/constants.d.ts +0 -1
- /package/dist/cjs/abi/{kyc → rwa}/iDSRegistryService.js +0 -0
- /package/dist/cjs/abi/{kyc → rwa}/iDSToken.js +0 -0
- /package/dist/cjs/abi/{kyc → rwa}/iSecuritizeDegenNFT.js +0 -0
- /package/dist/cjs/sdk/market/{kyc → rwa}/securitize/types.js +0 -0
- /package/dist/esm/abi/{kyc → rwa}/iDSRegistryService.js +0 -0
- /package/dist/esm/abi/{kyc → rwa}/iDSToken.js +0 -0
- /package/dist/esm/abi/{kyc → rwa}/iSecuritizeDegenNFT.js +0 -0
- /package/dist/esm/sdk/market/{kyc → rwa}/securitize/types.js +0 -0
- /package/dist/types/abi/{kyc → rwa}/iDSRegistryService.d.ts +0 -0
- /package/dist/types/abi/{kyc → rwa}/iDSToken.d.ts +0 -0
- /package/dist/types/abi/{kyc → rwa}/iSecuritizeDegenNFT.d.ts +0 -0
- /package/dist/types/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.d.ts +0 -0
|
@@ -3,10 +3,10 @@ import type { GetOpenAccountRequirementsProps } from "../../../accounts/types.js
|
|
|
3
3
|
import { BaseContract } from "../../../base/index.js";
|
|
4
4
|
import type { OnchainSDK } from "../../../OnchainSDK.js";
|
|
5
5
|
import type { MultiCall, RawTx } from "../../../types/index.js";
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
6
|
+
import type { IRWAFactory, RWACompressorInvestorData, RWAFactoryData } from "../types.js";
|
|
7
|
+
import { RWA_FACTORY_SECURITIZE } from "./constants.js";
|
|
8
8
|
import { SecuritizeDegenNFT } from "./SecuritizeDegenNFT.js";
|
|
9
|
-
import { type DStokenData, type SecuritizeInvestorData, type
|
|
9
|
+
import { type DStokenData, type SecuritizeInvestorData, type SecuritizeOpenAccountRequirements, type SecuritizeOperationParams, type SecuritizeRWAFactoryStateHuman } from "./types.js";
|
|
10
10
|
declare const abi: readonly [{
|
|
11
11
|
readonly type: "function";
|
|
12
12
|
readonly name: "contractType";
|
|
@@ -345,7 +345,7 @@ declare const abi: readonly [{
|
|
|
345
345
|
readonly stateMutability: "view";
|
|
346
346
|
}, {
|
|
347
347
|
readonly type: "event";
|
|
348
|
-
readonly name: "
|
|
348
|
+
readonly name: "OpenRWACreditAccount";
|
|
349
349
|
readonly inputs: readonly [{
|
|
350
350
|
readonly name: "creditAccount";
|
|
351
351
|
readonly type: "address";
|
|
@@ -456,23 +456,23 @@ declare const abi: readonly [{
|
|
|
456
456
|
readonly inputs: readonly [];
|
|
457
457
|
}];
|
|
458
458
|
type abi = typeof abi;
|
|
459
|
-
export declare class
|
|
459
|
+
export declare class SecuritizeRWAFactory extends BaseContract<abi> implements IRWAFactory<typeof RWA_FACTORY_SECURITIZE> {
|
|
460
460
|
#private;
|
|
461
461
|
readonly degenNFT: SecuritizeDegenNFT;
|
|
462
462
|
readonly owner: Address;
|
|
463
463
|
readonly dsTokens: DStokenData[];
|
|
464
|
-
readonly contractType = "
|
|
465
|
-
constructor(sdk: OnchainSDK, data:
|
|
464
|
+
readonly contractType = "RWA_FACTORY::SECURITIZE";
|
|
465
|
+
constructor(sdk: OnchainSDK, data: RWAFactoryData);
|
|
466
466
|
/**
|
|
467
|
-
* {@inheritDoc
|
|
467
|
+
* {@inheritDoc IRWAFactory.decodeInvestorData}
|
|
468
468
|
*/
|
|
469
|
-
decodeInvestorData(data:
|
|
469
|
+
decodeInvestorData(data: RWACompressorInvestorData): SecuritizeInvestorData;
|
|
470
470
|
/**
|
|
471
|
-
* {@inheritDoc
|
|
471
|
+
* {@inheritDoc IRWAFactory.getInvestor}
|
|
472
472
|
*/
|
|
473
473
|
getInvestor(creditAccount: Address, fromCache?: boolean): Promise<Address>;
|
|
474
474
|
/**
|
|
475
|
-
* {@inheritDoc
|
|
475
|
+
* {@inheritDoc IRWAFactory.getApprovalAddress}
|
|
476
476
|
*/
|
|
477
477
|
getApprovalAddress(options: {
|
|
478
478
|
creditManager: Address;
|
|
@@ -482,21 +482,21 @@ export declare class SecuritizeKYCFactory extends BaseContract<abi> implements I
|
|
|
482
482
|
creditAccount: Address;
|
|
483
483
|
}): Promise<Address>;
|
|
484
484
|
/**
|
|
485
|
-
* {@inheritDoc
|
|
485
|
+
* {@inheritDoc IRWAFactory.getWallet}
|
|
486
486
|
*/
|
|
487
487
|
getWallet(creditAccount: Address): Promise<Address>;
|
|
488
488
|
/**
|
|
489
|
-
* {@inheritDoc
|
|
489
|
+
* {@inheritDoc IRWAFactory.multicall}
|
|
490
490
|
*/
|
|
491
491
|
multicall(creditAccount: Address, calls: MultiCall[], options?: SecuritizeOperationParams): RawTx;
|
|
492
492
|
/**
|
|
493
|
-
* {@inheritDoc
|
|
493
|
+
* {@inheritDoc IRWAFactory.getOpenAccountRequirements}
|
|
494
494
|
*/
|
|
495
495
|
getOpenAccountRequirements(investor: Address, props: GetOpenAccountRequirementsProps): Promise<SecuritizeOpenAccountRequirements | undefined>;
|
|
496
496
|
/**
|
|
497
|
-
* {@inheritDoc
|
|
497
|
+
* {@inheritDoc IRWAFactory.openCreditAccount}
|
|
498
498
|
*/
|
|
499
499
|
openCreditAccount(creditManager: Address, calls: MultiCall[], options?: SecuritizeOperationParams): RawTx;
|
|
500
|
-
stateHuman(_raw?: boolean):
|
|
500
|
+
stateHuman(_raw?: boolean): SecuritizeRWAFactoryStateHuman;
|
|
501
501
|
}
|
|
502
502
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RWA_FACTORY_SECURITIZE = "RWA_FACTORY::SECURITIZE";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address, Hex, TypedDataDefinition } from "viem";
|
|
2
2
|
import type { BaseContractStateHuman } from "../../../types/index.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { RWA_FACTORY_SECURITIZE } from "./constants.js";
|
|
4
4
|
/**
|
|
5
5
|
* On-chain data about Securitize DSTokens
|
|
6
6
|
**/
|
|
@@ -57,7 +57,7 @@ export declare const SECURITIZE_REGISTER_VAULT_TYPES: {
|
|
|
57
57
|
};
|
|
58
58
|
/**
|
|
59
59
|
* EIP-712 typed-data message that must be signed by the investor to allow the
|
|
60
|
-
*
|
|
60
|
+
* RWA factory to register a credit account as a vault in Securitize's VaultRegistrar.
|
|
61
61
|
*
|
|
62
62
|
* Shaped as a viem {@link TypedDataDefinition} so it can be spread directly into
|
|
63
63
|
* `walletClient.signTypedData({ account, ...message })`. The caller only has to
|
|
@@ -74,7 +74,7 @@ export declare const SECURITIZE_REGISTER_VAULT_TYPES: {
|
|
|
74
74
|
**/
|
|
75
75
|
export type SecuritizeRegisterVaultMessage = TypedDataDefinition<typeof SECURITIZE_REGISTER_VAULT_TYPES, "RegisterVault">;
|
|
76
76
|
/**
|
|
77
|
-
* Per-credit-account data decoded from the
|
|
77
|
+
* Per-credit-account data decoded from the RWA compressor's
|
|
78
78
|
* `getCreditAccountData` extra details for a Securitize factory.
|
|
79
79
|
**/
|
|
80
80
|
export interface SecuritizeCreditAccountData {
|
|
@@ -88,12 +88,12 @@ export interface SecuritizeCreditAccountData {
|
|
|
88
88
|
registeredTokens: Address[];
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
* Investor-level data decoded from the
|
|
91
|
+
* Investor-level data decoded from the RWA compressor's `getRWAInvestorData`
|
|
92
92
|
* extra details for a Securitize factory.
|
|
93
93
|
**/
|
|
94
94
|
export interface SecuritizeInvestorData {
|
|
95
|
-
type: typeof
|
|
96
|
-
/** Securitize
|
|
95
|
+
type: typeof RWA_FACTORY_SECURITIZE;
|
|
96
|
+
/** Securitize RWA factory address that produced this data. */
|
|
97
97
|
factory: Address;
|
|
98
98
|
/** Credit accounts owned by the investor through this factory. */
|
|
99
99
|
creditAccounts: SecuritizeCreditAccountData[];
|
|
@@ -105,9 +105,9 @@ export interface SecuritizeInvestorData {
|
|
|
105
105
|
registerVaultMessages: SecuritizeRegisterVaultMessage[];
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
|
-
* Human-readable serialisation of {@link
|
|
108
|
+
* Human-readable serialisation of {@link SecuritizeRWAFactory} state.
|
|
109
109
|
**/
|
|
110
|
-
export interface
|
|
110
|
+
export interface SecuritizeRWAFactoryStateHuman extends BaseContractStateHuman {
|
|
111
111
|
owner: string;
|
|
112
112
|
degenNFT: string;
|
|
113
113
|
dsTokens: {
|
|
@@ -120,18 +120,18 @@ export interface SecuritizeKYCFactoryStateHuman extends BaseContractStateHuman {
|
|
|
120
120
|
}[];
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
* Factory-specific parameters for {@link
|
|
124
|
-
* and {@link
|
|
123
|
+
* Factory-specific parameters for {@link SecuritizeRWAFactory.multicall}
|
|
124
|
+
* and {@link SecuritizeRWAFactory.openCreditAccount}.
|
|
125
125
|
**/
|
|
126
126
|
export interface SecuritizeOperationParams {
|
|
127
|
-
type: typeof
|
|
127
|
+
type: typeof RWA_FACTORY_SECURITIZE;
|
|
128
128
|
/** DSToken addresses to register for this operation. */
|
|
129
129
|
tokensToRegister: Address[];
|
|
130
130
|
/** Cached EIP-712 registration signatures to store on-chain. */
|
|
131
131
|
signaturesToCache: SecuritizeRegisterMessage[];
|
|
132
132
|
}
|
|
133
133
|
export interface SecuritizeOpenAccountRequirements {
|
|
134
|
-
type: typeof
|
|
134
|
+
type: typeof RWA_FACTORY_SECURITIZE;
|
|
135
135
|
/**
|
|
136
136
|
* User must visit securitize website to register these tokens
|
|
137
137
|
* May be empty if user already registered all required tokens
|
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
|
|
2
2
|
import type { Address, ContractFunctionParameters } from "viem";
|
|
3
|
-
import type {
|
|
3
|
+
import type { iRWACompressorAbi } from "../../../abi/rwa/iRWACompressor.js";
|
|
4
4
|
import type { GetOpenAccountRequirementsProps } from "../../accounts/types.js";
|
|
5
5
|
import type { IBaseContract, Unarray } from "../../base/index.js";
|
|
6
6
|
import type { MultiCall, RawTx } from "../../types/index.js";
|
|
7
|
-
import type { SecuritizeInvestorData,
|
|
8
|
-
import {
|
|
7
|
+
import type { SecuritizeInvestorData, SecuritizeOpenAccountRequirements, SecuritizeOperationParams, SecuritizeRWAFactoryStateHuman } from "./securitize/index.js";
|
|
8
|
+
import { RWA_FACTORY_SECURITIZE } from "./securitize/index.js";
|
|
9
9
|
/**
|
|
10
|
-
* Discriminated union of all known
|
|
10
|
+
* Discriminated union of all known RWA factory contract type strings.
|
|
11
11
|
**/
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const RWA_FACTORY_TYPES: readonly ["RWA_FACTORY::SECURITIZE"];
|
|
13
13
|
/**
|
|
14
|
-
* String literal union of known
|
|
14
|
+
* String literal union of known RWA factory types.
|
|
15
15
|
**/
|
|
16
|
-
export type
|
|
16
|
+
export type RWAFactoryType = (typeof RWA_FACTORY_TYPES)[number];
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
19
19
|
*
|
|
20
|
-
* Type-level registry mapping each {@link
|
|
21
|
-
* data types. Adding a new
|
|
20
|
+
* Type-level registry mapping each {@link RWAFactoryType} to its associated
|
|
21
|
+
* data types. Adding a new RWA factory requires a single new entry here;
|
|
22
22
|
* all derived types update automatically.
|
|
23
23
|
**/
|
|
24
|
-
interface
|
|
25
|
-
[
|
|
24
|
+
interface RWAFactoryTypeMap {
|
|
25
|
+
[RWA_FACTORY_SECURITIZE]: {
|
|
26
26
|
investorData: SecuritizeInvestorData;
|
|
27
27
|
openAccountRequirements: SecuritizeOpenAccountRequirements;
|
|
28
|
-
stateHuman:
|
|
28
|
+
stateHuman: SecuritizeRWAFactoryStateHuman;
|
|
29
29
|
operationParams: SecuritizeOperationParams;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* Investor data decoded from the
|
|
33
|
+
* Investor data decoded from the RWA compressor, defaults to union of all factory types
|
|
34
34
|
* Can be discriminated by type
|
|
35
35
|
**/
|
|
36
|
-
export type
|
|
36
|
+
export type RWAInvestorData<T extends RWAFactoryType = RWAFactoryType> = RWAFactoryTypeMap[T]["investorData"];
|
|
37
37
|
/**
|
|
38
|
-
* Open-account requirements for a
|
|
38
|
+
* Open-account requirements for a RWA factory, defaults to union of all factory types
|
|
39
39
|
* Can be discriminated by type
|
|
40
40
|
**/
|
|
41
|
-
export type
|
|
41
|
+
export type RWAOpenAccountRequirements<T extends RWAFactoryType = RWAFactoryType> = RWAFactoryTypeMap[T]["openAccountRequirements"];
|
|
42
42
|
/**
|
|
43
|
-
* Open credit account/Multicall extra params type for a
|
|
43
|
+
* Open credit account/Multicall extra params type for a RWA factory, defaults to union of all factory types
|
|
44
44
|
* Can be discriminated by type
|
|
45
45
|
**/
|
|
46
|
-
export type
|
|
46
|
+
export type RWAOperationParams<T extends RWAFactoryType = RWAFactoryType> = RWAFactoryTypeMap[T]["operationParams"];
|
|
47
47
|
/**
|
|
48
|
-
* Raw return type of `
|
|
48
|
+
* Raw return type of `RWACompressor.getRWAMarketsData`.
|
|
49
49
|
**/
|
|
50
|
-
export type
|
|
50
|
+
export type RWACompressorResponse = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iRWACompressorAbi, "getRWAMarketsData">["outputs"]>;
|
|
51
51
|
/**
|
|
52
|
-
* On-chain state of a
|
|
52
|
+
* On-chain state of a RWA underlying token.
|
|
53
53
|
**/
|
|
54
|
-
export type
|
|
54
|
+
export type RWAUnderlyingData = Unarray<RWACompressorResponse[0]>;
|
|
55
55
|
/**
|
|
56
|
-
* On-chain state of a
|
|
56
|
+
* On-chain state of a RWA factory.
|
|
57
57
|
**/
|
|
58
|
-
export type
|
|
58
|
+
export type RWAFactoryData = Unarray<RWACompressorResponse[1]>;
|
|
59
59
|
/**
|
|
60
|
-
* Typed contract call parameters for `
|
|
60
|
+
* Typed contract call parameters for `RWACompressor.getRWAMarketsData`.
|
|
61
61
|
**/
|
|
62
|
-
export type
|
|
62
|
+
export type RWACompressorCall = ContractFunctionParameters<typeof iRWACompressorAbi, "view", "getRWAMarketsData">;
|
|
63
63
|
/**
|
|
64
|
-
* Single element of the `
|
|
64
|
+
* Single element of the `RWACompressor.getRWAInvestorData` return array.
|
|
65
65
|
* Contains per-factory credit accounts and factory-specific extra details.
|
|
66
66
|
**/
|
|
67
|
-
export type
|
|
67
|
+
export type RWACompressorInvestorData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iRWACompressorAbi, "getRWAInvestorData">["outputs"]>[0]>;
|
|
68
68
|
/**
|
|
69
|
-
* Full
|
|
69
|
+
* Full RWA compressor response, used as the persisted/hydrated state.
|
|
70
70
|
**/
|
|
71
|
-
export type
|
|
71
|
+
export type RWAState = RWACompressorResponse;
|
|
72
72
|
/**
|
|
73
|
-
* Human-readable
|
|
73
|
+
* Human-readable RWA factory state, union of all factory types.
|
|
74
74
|
**/
|
|
75
|
-
export type
|
|
75
|
+
export type RWAFactoryStateHuman = RWAFactoryTypeMap[RWAFactoryType]["stateHuman"];
|
|
76
76
|
/**
|
|
77
|
-
* Human-readable snapshot of the full
|
|
77
|
+
* Human-readable snapshot of the full RWA registry state.
|
|
78
78
|
**/
|
|
79
|
-
export interface
|
|
80
|
-
/** State of each loaded
|
|
81
|
-
factories:
|
|
79
|
+
export interface RWAStateHuman {
|
|
80
|
+
/** State of each loaded RWA factory. */
|
|
81
|
+
factories: RWAFactoryStateHuman[];
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Shared interface for all
|
|
84
|
+
* Shared interface for all RWA factory contracts.
|
|
85
85
|
*
|
|
86
86
|
* Parameterised by a single factory type literal `T` which indexes into
|
|
87
|
-
* {@link
|
|
87
|
+
* {@link RWAFactoryTypeMap} to derive all associated data types.
|
|
88
88
|
*
|
|
89
89
|
* @typeParam T - factory type
|
|
90
90
|
**/
|
|
91
|
-
export interface
|
|
91
|
+
export interface IRWAFactory<T extends RWAFactoryType = RWAFactoryType> extends IBaseContract {
|
|
92
92
|
/**
|
|
93
93
|
* Narrowed factory type discriminant
|
|
94
94
|
**/
|
|
@@ -99,9 +99,9 @@ export interface IKYCFactory<T extends KYCFactoryType = KYCFactoryType> extends
|
|
|
99
99
|
* Decodes factory-specific extra details from the compressor's investor data.
|
|
100
100
|
* Each factory knows how to decode its own extra details.
|
|
101
101
|
*
|
|
102
|
-
* @param data - raw
|
|
102
|
+
* @param data - raw RWACompressor InvestorData
|
|
103
103
|
**/
|
|
104
|
-
decodeInvestorData(data:
|
|
104
|
+
decodeInvestorData(data: RWACompressorInvestorData): RWAInvestorData<T>;
|
|
105
105
|
/**
|
|
106
106
|
* Returns the investor address for a credit account.
|
|
107
107
|
* @param creditAccount - credit account address
|
|
@@ -137,9 +137,9 @@ export interface IKYCFactory<T extends KYCFactoryType = KYCFactoryType> extends
|
|
|
137
137
|
* @param creditAccount - credit account address
|
|
138
138
|
* @param calls - calls to perform
|
|
139
139
|
* @param options - factory-specific parameters (e.g. tokens to
|
|
140
|
-
* register, signatures to cache). Undefined value means that no
|
|
140
|
+
* register, signatures to cache). Undefined value means that no RWA actions are required
|
|
141
141
|
**/
|
|
142
|
-
multicall(creditAccount: Address, calls: MultiCall[], options?:
|
|
142
|
+
multicall(creditAccount: Address, calls: MultiCall[], options?: RWAOperationParams<T>): RawTx;
|
|
143
143
|
/**
|
|
144
144
|
* Checks if the user can open a credit account with this factory.
|
|
145
145
|
* @param investor - investor address
|
|
@@ -147,7 +147,7 @@ export interface IKYCFactory<T extends KYCFactoryType = KYCFactoryType> extends
|
|
|
147
147
|
* @returns open account requirements for the investor, or `undefined` if the
|
|
148
148
|
* user can open a credit account without any further actions
|
|
149
149
|
**/
|
|
150
|
-
getOpenAccountRequirements(investor: Address, props: GetOpenAccountRequirementsProps): Promise<
|
|
150
|
+
getOpenAccountRequirements(investor: Address, props: GetOpenAccountRequirementsProps): Promise<RWAOpenAccountRequirements<T> | undefined>;
|
|
151
151
|
/**
|
|
152
152
|
* Creates a raw transaction to open a credit account.
|
|
153
153
|
* Similar to {@link CreditFacadeV310Contract.openCreditAccount}.
|
|
@@ -156,16 +156,16 @@ export interface IKYCFactory<T extends KYCFactoryType = KYCFactoryType> extends
|
|
|
156
156
|
* @param calls - initial calls to perform
|
|
157
157
|
* @param options - factory-specific parameters (e.g. tokens to
|
|
158
158
|
* register, signatures to cache).
|
|
159
|
-
* Undefined value means that no
|
|
159
|
+
* Undefined value means that no RWA actions are required (e.g. when we open second credit account)
|
|
160
160
|
**/
|
|
161
|
-
openCreditAccount(creditManager: Address, calls: MultiCall[], options?:
|
|
161
|
+
openCreditAccount(creditManager: Address, calls: MultiCall[], options?: RWAOperationParams<T>): RawTx;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
* Narrows an {@link
|
|
164
|
+
* Narrows an {@link IRWAFactory} to a specific factory type.
|
|
165
165
|
*
|
|
166
166
|
* @param factory - factory instance to check
|
|
167
167
|
* @param type - expected factory type literal
|
|
168
168
|
* @returns `true` if `factory.factoryType === type`
|
|
169
169
|
**/
|
|
170
|
-
export declare function
|
|
170
|
+
export declare function isRWAFactory<T extends RWAFactoryType>(factory: IRWAFactory, type: T): factory is IRWAFactory<T>;
|
|
171
171
|
export {};
|
|
@@ -5,6 +5,6 @@ import type { Unarray } from "../base/index.js";
|
|
|
5
5
|
type CompressorZapperData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof peripheryCompressorAbi, "getZappers">["outputs"]>>;
|
|
6
6
|
export interface ZapperData extends CompressorZapperData {
|
|
7
7
|
pool: Address;
|
|
8
|
-
type: "migration" | "
|
|
8
|
+
type: "migration" | "rwa" | "base";
|
|
9
9
|
}
|
|
10
10
|
export {};
|
|
@@ -16,7 +16,7 @@ export declare const OnchainSDKOptionsSchema: z.ZodObject<{
|
|
|
16
16
|
export declare const AttachOptionsSchema: z.ZodObject<{
|
|
17
17
|
addressProvider: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
18
18
|
marketConfigurators: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
19
|
-
|
|
19
|
+
rwaFactories: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
20
20
|
blockNumber: z.ZodOptional<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber]>>;
|
|
21
21
|
ignoreUpdateablePrices: z.ZodOptional<z.ZodBoolean>;
|
|
22
22
|
ignoreMarkets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
@@ -52,7 +52,7 @@ export interface RemoveLiquidityProps {
|
|
|
52
52
|
permit: PermitResult | undefined;
|
|
53
53
|
meta: WithdrawalMetadata;
|
|
54
54
|
}
|
|
55
|
-
export type MarketType = "
|
|
55
|
+
export type MarketType = "rwa-on-demand" | "rwa-default" | "classic";
|
|
56
56
|
export interface DepositMetadata {
|
|
57
57
|
/**
|
|
58
58
|
* Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
|
|
@@ -106,7 +106,7 @@ export interface IPoolsService {
|
|
|
106
106
|
* Returns list of tokens that user can receive after depositing to a pool,
|
|
107
107
|
* depends on the pool type and the token being deposited (one of returned by {@link getDepositTokensIn}).
|
|
108
108
|
*
|
|
109
|
-
* Can return empty array if no tokens can be received (e.g. for
|
|
109
|
+
* Can return empty array if no tokens can be received (e.g. for RWA underlying on demand)
|
|
110
110
|
*
|
|
111
111
|
* @param pool
|
|
112
112
|
* @param tokenIn
|
|
@@ -118,7 +118,7 @@ export interface IPoolsService {
|
|
|
118
118
|
*
|
|
119
119
|
* @param pool
|
|
120
120
|
* @param tokenIn
|
|
121
|
-
* @param tokenOut can be undefined if deposit is not resulting in a token out (e.g. for
|
|
121
|
+
* @param tokenOut can be undefined if deposit is not resulting in a token out (e.g. for RWA underlying on demand)
|
|
122
122
|
*/
|
|
123
123
|
getDepositMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): DepositMetadata;
|
|
124
124
|
/**
|
|
@@ -142,7 +142,7 @@ export interface IPoolsService {
|
|
|
142
142
|
getWithdrawalMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): WithdrawalMetadata;
|
|
143
143
|
/**
|
|
144
144
|
* Returns contract call parameters for adding liquidity to a pool
|
|
145
|
-
* Or undefined if no deposit action is required (e.g. for
|
|
145
|
+
* Or undefined if no deposit action is required (e.g. for RWA underlying on demand)
|
|
146
146
|
* @param props - {@link AddLiquidityProps}
|
|
147
147
|
* @returns - {@link AddLiquidityCall}
|
|
148
148
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { TokenMetaData } from "../base/index.js";
|
|
3
3
|
import type { PriceFeedContractType } from "../market/index.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { RWAStateHuman } from "../market/rwa/index.js";
|
|
5
5
|
export interface BaseContractStateHuman {
|
|
6
6
|
address: string;
|
|
7
7
|
version: number;
|
|
@@ -201,7 +201,7 @@ export interface GearboxStateHuman {
|
|
|
201
201
|
markets: MarketStateHuman[];
|
|
202
202
|
plugins: Record<string, unknown>;
|
|
203
203
|
tokens: TokenMetaData[];
|
|
204
|
-
|
|
204
|
+
rwa: RWAStateHuman;
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
207
|
* Human-readable state for all chains managed by {@link MultichainSDK}.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MarketData } from "../base/index.js";
|
|
2
2
|
import type { NetworkType } from "../chain/chains.js";
|
|
3
3
|
import type { AddressProviderState } from "../core/index.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { RWAState } from "../market/rwa/index.js";
|
|
5
5
|
import type { PluginStatesMap, PluginsMap } from "../plugins/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Complete serialisable snapshot of the SDK state for a single chain.
|
|
@@ -42,9 +42,9 @@ export interface GearboxState<Plugins extends PluginsMap = {}> {
|
|
|
42
42
|
**/
|
|
43
43
|
markets: MarketData[];
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* RWA compressor state snapshot, if RWA factories were loaded.
|
|
46
46
|
**/
|
|
47
|
-
|
|
47
|
+
rwa?: RWAState;
|
|
48
48
|
/**
|
|
49
49
|
* Per-plugin serialised state.
|
|
50
50
|
**/
|
package/package.json
CHANGED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Address } from "abitype";
|
|
2
|
-
import { SDKConstruct } from "../../base/index.js";
|
|
3
|
-
import type { DelegatedMulticall } from "../../utils/viem/index.js";
|
|
4
|
-
import { SecuritizeKYCFactory } from "./securitize/index.js";
|
|
5
|
-
import type { KYCCompressorResponse, KYCInvestorData, KYCState, KYCStateHuman } from "./types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Registry of KYC underlying tokens and KYC factory contracts.
|
|
8
|
-
*
|
|
9
|
-
* Populated from the on-chain {@link https://github.com/Gearbox-protocol/periphery-v3 KYCCompressor}
|
|
10
|
-
* during SDK attach/hydrate. Provides methods to query investor-level data and
|
|
11
|
-
* to resolve KYC factory instances by address.
|
|
12
|
-
**/
|
|
13
|
-
export declare class KYCRegistry extends SDKConstruct {
|
|
14
|
-
#private;
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*
|
|
18
|
-
* Returns delegated multicalls for loading all KYC underlying tokens from the on-chain KYC compressor.
|
|
19
|
-
* Used by the SDK to compose batched RPC calls.
|
|
20
|
-
*
|
|
21
|
-
* @param configurators - Market configurators to query.
|
|
22
|
-
* @param kycFactories - KYC factory contracts to query.
|
|
23
|
-
*/
|
|
24
|
-
getLoadMulticalls(configurators: Address[], kycFactories?: Address[]): DelegatedMulticall[];
|
|
25
|
-
/**
|
|
26
|
-
* Fetches decoded investor data from the on-chain KYC compressor.
|
|
27
|
-
*
|
|
28
|
-
* Each factory produces its own investor data (e.g. registered tokens,
|
|
29
|
-
* cached signatures, EIP-712 messages to sign).
|
|
30
|
-
*
|
|
31
|
-
* @param investor - Investor EOA address.
|
|
32
|
-
* @param factories_ - Optional subset of factory addresses to query.
|
|
33
|
-
* When omitted, all loaded factories are used.
|
|
34
|
-
*/
|
|
35
|
-
getInvestorData(investor: Address, factories_?: Address[]): Promise<KYCInvestorData[]>;
|
|
36
|
-
/** All loaded KYC factory instances. */
|
|
37
|
-
get factories(): SecuritizeKYCFactory[];
|
|
38
|
-
/** Raw KYC compressor response, or `undefined` before attach/hydrate. */
|
|
39
|
-
get state(): KYCState | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Returns a human-readable snapshot of the KYC state.
|
|
42
|
-
*/
|
|
43
|
-
stateHuman(raw?: boolean): KYCStateHuman;
|
|
44
|
-
/**
|
|
45
|
-
* @internal
|
|
46
|
-
*
|
|
47
|
-
* Replaces the internal state with a new KYC compressor response.
|
|
48
|
-
* Rebuilds token metadata for KYC underlyings and re-instantiates factory
|
|
49
|
-
* wrappers.
|
|
50
|
-
*/
|
|
51
|
-
setState(resp?: KYCCompressorResponse): void;
|
|
52
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const KYC_FACTORY_SECURITIZE = "KYC_FACTORY::SECURITIZE";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|