@morpho-dev/router 0.1.15 → 0.1.16
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/cli.js +1 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.browser.d.cts +2 -2
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.node.d.cts +4 -181
- package/dist/index.node.d.ts +4 -181
- package/dist/index.node.js +13 -601
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +14 -600
- package/dist/index.node.mjs.map +1 -1
- package/package.json +10 -12
package/dist/index.browser.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { z as z$1 } from 'zod/v4';
|
|
|
2
2
|
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions } from 'viem';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
5
|
-
import * as
|
|
5
|
+
import * as node_modules_zod_openapi_dist_components_CXzxKPFp_js from 'node_modules/zod-openapi/dist/components-CXzxKPFp.js';
|
|
6
6
|
|
|
7
7
|
declare const CollectorHealth: z$1.ZodObject<{
|
|
8
8
|
name: z$1.ZodString;
|
|
@@ -1109,7 +1109,7 @@ declare namespace OfferResponse$1 {
|
|
|
1109
1109
|
export { type OfferResponse$1_OfferResponse as OfferResponse, from$1 as from };
|
|
1110
1110
|
}
|
|
1111
1111
|
|
|
1112
|
-
declare const OpenApi:
|
|
1112
|
+
declare const OpenApi: node_modules_zod_openapi_dist_components_CXzxKPFp_js.OpenAPIObject;
|
|
1113
1113
|
|
|
1114
1114
|
declare const schemas: {
|
|
1115
1115
|
readonly get_offers: z.ZodObject<{
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z as z$1 } from 'zod/v4';
|
|
|
2
2
|
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions } from 'viem';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
5
|
-
import * as
|
|
5
|
+
import * as node_modules_zod_openapi_dist_components_CXzxKPFp_js from 'node_modules/zod-openapi/dist/components-CXzxKPFp.js';
|
|
6
6
|
|
|
7
7
|
declare const CollectorHealth: z$1.ZodObject<{
|
|
8
8
|
name: z$1.ZodString;
|
|
@@ -1109,7 +1109,7 @@ declare namespace OfferResponse$1 {
|
|
|
1109
1109
|
export { type OfferResponse$1_OfferResponse as OfferResponse, from$1 as from };
|
|
1110
1110
|
}
|
|
1111
1111
|
|
|
1112
|
-
declare const OpenApi:
|
|
1112
|
+
declare const OpenApi: node_modules_zod_openapi_dist_components_CXzxKPFp_js.OpenAPIObject;
|
|
1113
1113
|
|
|
1114
1114
|
declare const schemas: {
|
|
1115
1115
|
readonly get_offers: z.ZodObject<{
|
package/dist/index.node.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions
|
|
1
|
+
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions } from 'viem';
|
|
2
2
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
3
3
|
import { PGlite } from '@electric-sql/pglite';
|
|
4
4
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
@@ -6,7 +6,7 @@ import { drizzle as drizzle$1 } from 'drizzle-orm/pglite';
|
|
|
6
6
|
import { Pool } from 'pg';
|
|
7
7
|
import * as z from 'zod';
|
|
8
8
|
import { z as z$1 } from 'zod/v4';
|
|
9
|
-
import * as
|
|
9
|
+
import * as node_modules_zod_openapi_dist_components_CXzxKPFp_js from 'node_modules/zod-openapi/dist/components-CXzxKPFp.js';
|
|
10
10
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
11
11
|
|
|
12
12
|
declare const Oracle: readonly [{
|
|
@@ -1921,7 +1921,7 @@ declare namespace OfferResponse$1 {
|
|
|
1921
1921
|
export { type OfferResponse$1_OfferResponse as OfferResponse, from$1 as from };
|
|
1922
1922
|
}
|
|
1923
1923
|
|
|
1924
|
-
declare const OpenApi:
|
|
1924
|
+
declare const OpenApi: node_modules_zod_openapi_dist_components_CXzxKPFp_js.OpenAPIObject;
|
|
1925
1925
|
|
|
1926
1926
|
declare const schemas: {
|
|
1927
1927
|
readonly get_offers: z.ZodObject<{
|
|
@@ -2092,183 +2092,6 @@ declare namespace Client$2 {
|
|
|
2092
2092
|
export { type Client$1 as Client, type Client$2_ConnectOptions as ConnectOptions, Client$2_HttpForbiddenError as HttpForbiddenError, Client$2_HttpGetApiFailedError as HttpGetApiFailedError, Client$2_HttpRateLimitError as HttpRateLimitError, Client$2_HttpUnauthorizedError as HttpUnauthorizedError, Client$2_InvalidUrlError as InvalidUrlError, connect$1 as connect, Client$2_getObligations as getObligations, Client$2_getOffers as getOffers };
|
|
2093
2093
|
}
|
|
2094
2094
|
|
|
2095
|
-
declare const users: Account[];
|
|
2096
|
-
declare const assetList: readonly ["USDC", "DAI"];
|
|
2097
|
-
declare const mockAddress: (asset: (typeof assetList)[number]) => `0x${string}`;
|
|
2098
|
-
declare const mockOracleAddress: `0x${string}`;
|
|
2099
|
-
declare const mockMorphoAddress: `0x${string}`;
|
|
2100
|
-
declare const mockFactoryAddress: `0x${string}`;
|
|
2101
|
-
declare const encodeConsumedEvent: (parameters: {
|
|
2102
|
-
user: Address;
|
|
2103
|
-
nonce: bigint;
|
|
2104
|
-
amount: bigint;
|
|
2105
|
-
}) => `0x${string}`;
|
|
2106
|
-
declare const assetMethods: readonly ["balanceOf", "allowance"];
|
|
2107
|
-
declare const oracleMethods: readonly ["price"];
|
|
2108
|
-
declare const morphoMethods: readonly ["debtOf", "collateralOf", "market", "position"];
|
|
2109
|
-
declare const vaultMethods: readonly ["asset", "balanceOf", "totalSupply", "totalAssets", "withdrawQueue"];
|
|
2110
|
-
declare const factoryMethods: readonly ["isMetaMorpho", "morpho"];
|
|
2111
|
-
type AssetMethod = (typeof assetMethods)[number];
|
|
2112
|
-
type OracleMethod = (typeof oracleMethods)[number];
|
|
2113
|
-
type MorphoMethod = (typeof morphoMethods)[number];
|
|
2114
|
-
type VaultMethod = (typeof vaultMethods)[number];
|
|
2115
|
-
type FactoryMethod = (typeof factoryMethods)[number];
|
|
2116
|
-
type MethodParameters = {
|
|
2117
|
-
balanceOf: {
|
|
2118
|
-
address: Address;
|
|
2119
|
-
value: bigint;
|
|
2120
|
-
};
|
|
2121
|
-
allowance: {
|
|
2122
|
-
owner: Address;
|
|
2123
|
-
spender: Address;
|
|
2124
|
-
value: bigint;
|
|
2125
|
-
};
|
|
2126
|
-
};
|
|
2127
|
-
type OracleMethodParameters = {
|
|
2128
|
-
price: {
|
|
2129
|
-
value: bigint;
|
|
2130
|
-
};
|
|
2131
|
-
};
|
|
2132
|
-
type MorphoMethodParameters = {
|
|
2133
|
-
debtOf: {
|
|
2134
|
-
user: Address;
|
|
2135
|
-
obligationId: Hex;
|
|
2136
|
-
value: bigint;
|
|
2137
|
-
};
|
|
2138
|
-
collateralOf: {
|
|
2139
|
-
user: Address;
|
|
2140
|
-
obligationId: Hex;
|
|
2141
|
-
collateralAsset: Address;
|
|
2142
|
-
value: bigint;
|
|
2143
|
-
};
|
|
2144
|
-
market: {
|
|
2145
|
-
marketId: Hex;
|
|
2146
|
-
totalSupplyAssets: bigint;
|
|
2147
|
-
totalSupplyShares: bigint;
|
|
2148
|
-
totalBorrowAssets: bigint;
|
|
2149
|
-
totalBorrowShares: bigint;
|
|
2150
|
-
lastUpdate: bigint;
|
|
2151
|
-
fee: bigint;
|
|
2152
|
-
};
|
|
2153
|
-
position: {
|
|
2154
|
-
marketId: Hex;
|
|
2155
|
-
user: Address;
|
|
2156
|
-
supplyShares: bigint;
|
|
2157
|
-
borrowShares: bigint;
|
|
2158
|
-
collateral: bigint;
|
|
2159
|
-
};
|
|
2160
|
-
};
|
|
2161
|
-
type VaultMethodParameters = {
|
|
2162
|
-
asset: {
|
|
2163
|
-
value: Address;
|
|
2164
|
-
};
|
|
2165
|
-
balanceOf: {
|
|
2166
|
-
user: Address;
|
|
2167
|
-
value: bigint;
|
|
2168
|
-
};
|
|
2169
|
-
totalSupply: {
|
|
2170
|
-
value: bigint;
|
|
2171
|
-
};
|
|
2172
|
-
totalAssets: {
|
|
2173
|
-
value: bigint;
|
|
2174
|
-
};
|
|
2175
|
-
withdrawQueue: {
|
|
2176
|
-
value: Hex[];
|
|
2177
|
-
};
|
|
2178
|
-
};
|
|
2179
|
-
type FactoryMethodParameters = {
|
|
2180
|
-
isMetaMorpho: {
|
|
2181
|
-
vault: Address;
|
|
2182
|
-
value: boolean;
|
|
2183
|
-
};
|
|
2184
|
-
morpho: {
|
|
2185
|
-
value: Address;
|
|
2186
|
-
};
|
|
2187
|
-
};
|
|
2188
|
-
type MockedAsset = {
|
|
2189
|
-
address: Address;
|
|
2190
|
-
set: (slot: Hex | AssetMethod, parameters: Hex | bigint | MethodParameters[AssetMethod]) => Promise<void>;
|
|
2191
|
-
};
|
|
2192
|
-
type MockedOracle = {
|
|
2193
|
-
address: Address;
|
|
2194
|
-
set: (method: OracleMethod, parameters: OracleMethodParameters[OracleMethod]) => Promise<void>;
|
|
2195
|
-
};
|
|
2196
|
-
type MockedMorpho = {
|
|
2197
|
-
address: Address;
|
|
2198
|
-
set: (method: MorphoMethod, parameters: MorphoMethodParameters[MorphoMethod]) => Promise<void>;
|
|
2199
|
-
};
|
|
2200
|
-
type MockedVault = {
|
|
2201
|
-
address: Address;
|
|
2202
|
-
set: (method: VaultMethod, parameters: VaultMethodParameters[VaultMethod]) => Promise<void>;
|
|
2203
|
-
};
|
|
2204
|
-
type MockedFactory = {
|
|
2205
|
-
address: Address;
|
|
2206
|
-
set: (method: FactoryMethod, parameters: FactoryMethodParameters[FactoryMethod]) => Promise<void>;
|
|
2207
|
-
};
|
|
2208
|
-
type Mocked = {
|
|
2209
|
-
name: string;
|
|
2210
|
-
client: WalletClient;
|
|
2211
|
-
mempoolAddress: Address;
|
|
2212
|
-
termsAddress: Address;
|
|
2213
|
-
mine: () => Promise<void>;
|
|
2214
|
-
reset: () => Promise<void>;
|
|
2215
|
-
deployVault: () => Promise<MockedVault>;
|
|
2216
|
-
oracle: MockedOracle;
|
|
2217
|
-
morpho: MockedMorpho;
|
|
2218
|
-
factory: MockedFactory;
|
|
2219
|
-
} & Record<(typeof assetList)[number], MockedAsset>;
|
|
2220
|
-
declare function mock(name: string): Promise<Mocked>;
|
|
2221
|
-
/**
|
|
2222
|
-
* Start a local anvil chain.
|
|
2223
|
-
* @example
|
|
2224
|
-
* ```ts
|
|
2225
|
-
* import { EVM } from "@morpho-dev/router";
|
|
2226
|
-
* EVM.serve(); // local chain rpc url running on http://localhost:8545
|
|
2227
|
-
* ```
|
|
2228
|
-
*/
|
|
2229
|
-
declare function serve(parameters: {
|
|
2230
|
-
port: number;
|
|
2231
|
-
forkUrl: string;
|
|
2232
|
-
blockNumber?: number;
|
|
2233
|
-
}): Promise<{
|
|
2234
|
-
rpcUrl: `http://localhost:${number}`;
|
|
2235
|
-
stop: () => boolean;
|
|
2236
|
-
}>;
|
|
2237
|
-
|
|
2238
|
-
type EVM_AssetMethod = AssetMethod;
|
|
2239
|
-
type EVM_FactoryMethod = FactoryMethod;
|
|
2240
|
-
type EVM_FactoryMethodParameters = FactoryMethodParameters;
|
|
2241
|
-
type EVM_MethodParameters = MethodParameters;
|
|
2242
|
-
type EVM_Mocked = Mocked;
|
|
2243
|
-
type EVM_MockedAsset = MockedAsset;
|
|
2244
|
-
type EVM_MockedFactory = MockedFactory;
|
|
2245
|
-
type EVM_MockedMorpho = MockedMorpho;
|
|
2246
|
-
type EVM_MockedOracle = MockedOracle;
|
|
2247
|
-
type EVM_MockedVault = MockedVault;
|
|
2248
|
-
type EVM_MorphoMethod = MorphoMethod;
|
|
2249
|
-
type EVM_MorphoMethodParameters = MorphoMethodParameters;
|
|
2250
|
-
type EVM_OracleMethod = OracleMethod;
|
|
2251
|
-
type EVM_OracleMethodParameters = OracleMethodParameters;
|
|
2252
|
-
type EVM_VaultMethod = VaultMethod;
|
|
2253
|
-
type EVM_VaultMethodParameters = VaultMethodParameters;
|
|
2254
|
-
declare const EVM_assetList: typeof assetList;
|
|
2255
|
-
declare const EVM_assetMethods: typeof assetMethods;
|
|
2256
|
-
declare const EVM_encodeConsumedEvent: typeof encodeConsumedEvent;
|
|
2257
|
-
declare const EVM_factoryMethods: typeof factoryMethods;
|
|
2258
|
-
declare const EVM_mock: typeof mock;
|
|
2259
|
-
declare const EVM_mockAddress: typeof mockAddress;
|
|
2260
|
-
declare const EVM_mockFactoryAddress: typeof mockFactoryAddress;
|
|
2261
|
-
declare const EVM_mockMorphoAddress: typeof mockMorphoAddress;
|
|
2262
|
-
declare const EVM_mockOracleAddress: typeof mockOracleAddress;
|
|
2263
|
-
declare const EVM_morphoMethods: typeof morphoMethods;
|
|
2264
|
-
declare const EVM_oracleMethods: typeof oracleMethods;
|
|
2265
|
-
declare const EVM_serve: typeof serve;
|
|
2266
|
-
declare const EVM_users: typeof users;
|
|
2267
|
-
declare const EVM_vaultMethods: typeof vaultMethods;
|
|
2268
|
-
declare namespace EVM {
|
|
2269
|
-
export { type EVM_AssetMethod as AssetMethod, type EVM_FactoryMethod as FactoryMethod, type EVM_FactoryMethodParameters as FactoryMethodParameters, type EVM_MethodParameters as MethodParameters, type EVM_Mocked as Mocked, type EVM_MockedAsset as MockedAsset, type EVM_MockedFactory as MockedFactory, type EVM_MockedMorpho as MockedMorpho, type EVM_MockedOracle as MockedOracle, type EVM_MockedVault as MockedVault, type EVM_MorphoMethod as MorphoMethod, type EVM_MorphoMethodParameters as MorphoMethodParameters, type EVM_OracleMethod as OracleMethod, type EVM_OracleMethodParameters as OracleMethodParameters, type EVM_VaultMethod as VaultMethod, type EVM_VaultMethodParameters as VaultMethodParameters, EVM_assetList as assetList, EVM_assetMethods as assetMethods, EVM_encodeConsumedEvent as encodeConsumedEvent, EVM_factoryMethods as factoryMethods, EVM_mock as mock, EVM_mockAddress as mockAddress, EVM_mockFactoryAddress as mockFactoryAddress, EVM_mockMorphoAddress as mockMorphoAddress, EVM_mockOracleAddress as mockOracleAddress, EVM_morphoMethods as morphoMethods, EVM_oracleMethods as oracleMethods, EVM_serve as serve, EVM_users as users, EVM_vaultMethods as vaultMethods };
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
2095
|
type MempoolEVMClientConfig = {
|
|
2273
2096
|
readonly client: WalletClient;
|
|
2274
2097
|
readonly mempoolAddress: Address;
|
|
@@ -3534,4 +3357,4 @@ declare namespace index {
|
|
|
3534
3357
|
export { index_BaseError as BaseError, type index_GlobalErrorType as GlobalErrorType, type index_Snake as Snake, time as Time, index_batch as batch, index_batchMulticall as batchMulticall, fromSnakeCase$2 as fromSnakeCase, index_lazy as lazy, max$1 as max, index_min as min, index_poll as poll, index_retry as retry, toSnakeCase$1 as toSnakeCase, index_wait as wait };
|
|
3535
3358
|
}
|
|
3536
3359
|
|
|
3537
|
-
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, ChainHealth, ChainStore$1 as ChainStore, ChainsHealthResponse, Collateral$1 as Collateral, index$4 as Collector, CollectorHealth, CollectorStore$1 as CollectorStore, CollectorsHealthResponse, type Compute, Cursor$1 as Cursor,
|
|
3360
|
+
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, ChainHealth, ChainStore$1 as ChainStore, ChainsHealthResponse, Collateral$1 as Collateral, index$4 as Collector, CollectorHealth, CollectorStore$1 as CollectorStore, CollectorsHealthResponse, type Compute, Cursor$1 as Cursor, Errors, Format, Health, LLTV$1 as LLTV, Liquidity, LiquidityStore$1 as LiquidityStore, Logger$1 as Logger, Maturity$1 as Maturity, index$1 as Mempool, Obligation$1 as Obligation, ObligationResponse$1 as ObligationResponse, Offer$1 as Offer, OfferResponse$1 as OfferResponse, OfferStore$1 as OfferStore, schema as OffersSchema, OpenApi, PG$1 as PG, index$2 as RouterApi, Client$2 as RouterClient, RouterIndexer, RouterStatusResponse, Services$1 as Services, time as Time, index as Utils, Validation, ValidationRule, parse, safeParse };
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions
|
|
1
|
+
import { Hex, Address, AbiEvent, PublicClient, GetLogsReturnType, WalletClient, PublicActions } from 'viem';
|
|
2
2
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
3
3
|
import { PGlite } from '@electric-sql/pglite';
|
|
4
4
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
@@ -6,7 +6,7 @@ import { drizzle as drizzle$1 } from 'drizzle-orm/pglite';
|
|
|
6
6
|
import { Pool } from 'pg';
|
|
7
7
|
import * as z from 'zod';
|
|
8
8
|
import { z as z$1 } from 'zod/v4';
|
|
9
|
-
import * as
|
|
9
|
+
import * as node_modules_zod_openapi_dist_components_CXzxKPFp_js from 'node_modules/zod-openapi/dist/components-CXzxKPFp.js';
|
|
10
10
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
11
11
|
|
|
12
12
|
declare const Oracle: readonly [{
|
|
@@ -1921,7 +1921,7 @@ declare namespace OfferResponse$1 {
|
|
|
1921
1921
|
export { type OfferResponse$1_OfferResponse as OfferResponse, from$1 as from };
|
|
1922
1922
|
}
|
|
1923
1923
|
|
|
1924
|
-
declare const OpenApi:
|
|
1924
|
+
declare const OpenApi: node_modules_zod_openapi_dist_components_CXzxKPFp_js.OpenAPIObject;
|
|
1925
1925
|
|
|
1926
1926
|
declare const schemas: {
|
|
1927
1927
|
readonly get_offers: z.ZodObject<{
|
|
@@ -2092,183 +2092,6 @@ declare namespace Client$2 {
|
|
|
2092
2092
|
export { type Client$1 as Client, type Client$2_ConnectOptions as ConnectOptions, Client$2_HttpForbiddenError as HttpForbiddenError, Client$2_HttpGetApiFailedError as HttpGetApiFailedError, Client$2_HttpRateLimitError as HttpRateLimitError, Client$2_HttpUnauthorizedError as HttpUnauthorizedError, Client$2_InvalidUrlError as InvalidUrlError, connect$1 as connect, Client$2_getObligations as getObligations, Client$2_getOffers as getOffers };
|
|
2093
2093
|
}
|
|
2094
2094
|
|
|
2095
|
-
declare const users: Account[];
|
|
2096
|
-
declare const assetList: readonly ["USDC", "DAI"];
|
|
2097
|
-
declare const mockAddress: (asset: (typeof assetList)[number]) => `0x${string}`;
|
|
2098
|
-
declare const mockOracleAddress: `0x${string}`;
|
|
2099
|
-
declare const mockMorphoAddress: `0x${string}`;
|
|
2100
|
-
declare const mockFactoryAddress: `0x${string}`;
|
|
2101
|
-
declare const encodeConsumedEvent: (parameters: {
|
|
2102
|
-
user: Address;
|
|
2103
|
-
nonce: bigint;
|
|
2104
|
-
amount: bigint;
|
|
2105
|
-
}) => `0x${string}`;
|
|
2106
|
-
declare const assetMethods: readonly ["balanceOf", "allowance"];
|
|
2107
|
-
declare const oracleMethods: readonly ["price"];
|
|
2108
|
-
declare const morphoMethods: readonly ["debtOf", "collateralOf", "market", "position"];
|
|
2109
|
-
declare const vaultMethods: readonly ["asset", "balanceOf", "totalSupply", "totalAssets", "withdrawQueue"];
|
|
2110
|
-
declare const factoryMethods: readonly ["isMetaMorpho", "morpho"];
|
|
2111
|
-
type AssetMethod = (typeof assetMethods)[number];
|
|
2112
|
-
type OracleMethod = (typeof oracleMethods)[number];
|
|
2113
|
-
type MorphoMethod = (typeof morphoMethods)[number];
|
|
2114
|
-
type VaultMethod = (typeof vaultMethods)[number];
|
|
2115
|
-
type FactoryMethod = (typeof factoryMethods)[number];
|
|
2116
|
-
type MethodParameters = {
|
|
2117
|
-
balanceOf: {
|
|
2118
|
-
address: Address;
|
|
2119
|
-
value: bigint;
|
|
2120
|
-
};
|
|
2121
|
-
allowance: {
|
|
2122
|
-
owner: Address;
|
|
2123
|
-
spender: Address;
|
|
2124
|
-
value: bigint;
|
|
2125
|
-
};
|
|
2126
|
-
};
|
|
2127
|
-
type OracleMethodParameters = {
|
|
2128
|
-
price: {
|
|
2129
|
-
value: bigint;
|
|
2130
|
-
};
|
|
2131
|
-
};
|
|
2132
|
-
type MorphoMethodParameters = {
|
|
2133
|
-
debtOf: {
|
|
2134
|
-
user: Address;
|
|
2135
|
-
obligationId: Hex;
|
|
2136
|
-
value: bigint;
|
|
2137
|
-
};
|
|
2138
|
-
collateralOf: {
|
|
2139
|
-
user: Address;
|
|
2140
|
-
obligationId: Hex;
|
|
2141
|
-
collateralAsset: Address;
|
|
2142
|
-
value: bigint;
|
|
2143
|
-
};
|
|
2144
|
-
market: {
|
|
2145
|
-
marketId: Hex;
|
|
2146
|
-
totalSupplyAssets: bigint;
|
|
2147
|
-
totalSupplyShares: bigint;
|
|
2148
|
-
totalBorrowAssets: bigint;
|
|
2149
|
-
totalBorrowShares: bigint;
|
|
2150
|
-
lastUpdate: bigint;
|
|
2151
|
-
fee: bigint;
|
|
2152
|
-
};
|
|
2153
|
-
position: {
|
|
2154
|
-
marketId: Hex;
|
|
2155
|
-
user: Address;
|
|
2156
|
-
supplyShares: bigint;
|
|
2157
|
-
borrowShares: bigint;
|
|
2158
|
-
collateral: bigint;
|
|
2159
|
-
};
|
|
2160
|
-
};
|
|
2161
|
-
type VaultMethodParameters = {
|
|
2162
|
-
asset: {
|
|
2163
|
-
value: Address;
|
|
2164
|
-
};
|
|
2165
|
-
balanceOf: {
|
|
2166
|
-
user: Address;
|
|
2167
|
-
value: bigint;
|
|
2168
|
-
};
|
|
2169
|
-
totalSupply: {
|
|
2170
|
-
value: bigint;
|
|
2171
|
-
};
|
|
2172
|
-
totalAssets: {
|
|
2173
|
-
value: bigint;
|
|
2174
|
-
};
|
|
2175
|
-
withdrawQueue: {
|
|
2176
|
-
value: Hex[];
|
|
2177
|
-
};
|
|
2178
|
-
};
|
|
2179
|
-
type FactoryMethodParameters = {
|
|
2180
|
-
isMetaMorpho: {
|
|
2181
|
-
vault: Address;
|
|
2182
|
-
value: boolean;
|
|
2183
|
-
};
|
|
2184
|
-
morpho: {
|
|
2185
|
-
value: Address;
|
|
2186
|
-
};
|
|
2187
|
-
};
|
|
2188
|
-
type MockedAsset = {
|
|
2189
|
-
address: Address;
|
|
2190
|
-
set: (slot: Hex | AssetMethod, parameters: Hex | bigint | MethodParameters[AssetMethod]) => Promise<void>;
|
|
2191
|
-
};
|
|
2192
|
-
type MockedOracle = {
|
|
2193
|
-
address: Address;
|
|
2194
|
-
set: (method: OracleMethod, parameters: OracleMethodParameters[OracleMethod]) => Promise<void>;
|
|
2195
|
-
};
|
|
2196
|
-
type MockedMorpho = {
|
|
2197
|
-
address: Address;
|
|
2198
|
-
set: (method: MorphoMethod, parameters: MorphoMethodParameters[MorphoMethod]) => Promise<void>;
|
|
2199
|
-
};
|
|
2200
|
-
type MockedVault = {
|
|
2201
|
-
address: Address;
|
|
2202
|
-
set: (method: VaultMethod, parameters: VaultMethodParameters[VaultMethod]) => Promise<void>;
|
|
2203
|
-
};
|
|
2204
|
-
type MockedFactory = {
|
|
2205
|
-
address: Address;
|
|
2206
|
-
set: (method: FactoryMethod, parameters: FactoryMethodParameters[FactoryMethod]) => Promise<void>;
|
|
2207
|
-
};
|
|
2208
|
-
type Mocked = {
|
|
2209
|
-
name: string;
|
|
2210
|
-
client: WalletClient;
|
|
2211
|
-
mempoolAddress: Address;
|
|
2212
|
-
termsAddress: Address;
|
|
2213
|
-
mine: () => Promise<void>;
|
|
2214
|
-
reset: () => Promise<void>;
|
|
2215
|
-
deployVault: () => Promise<MockedVault>;
|
|
2216
|
-
oracle: MockedOracle;
|
|
2217
|
-
morpho: MockedMorpho;
|
|
2218
|
-
factory: MockedFactory;
|
|
2219
|
-
} & Record<(typeof assetList)[number], MockedAsset>;
|
|
2220
|
-
declare function mock(name: string): Promise<Mocked>;
|
|
2221
|
-
/**
|
|
2222
|
-
* Start a local anvil chain.
|
|
2223
|
-
* @example
|
|
2224
|
-
* ```ts
|
|
2225
|
-
* import { EVM } from "@morpho-dev/router";
|
|
2226
|
-
* EVM.serve(); // local chain rpc url running on http://localhost:8545
|
|
2227
|
-
* ```
|
|
2228
|
-
*/
|
|
2229
|
-
declare function serve(parameters: {
|
|
2230
|
-
port: number;
|
|
2231
|
-
forkUrl: string;
|
|
2232
|
-
blockNumber?: number;
|
|
2233
|
-
}): Promise<{
|
|
2234
|
-
rpcUrl: `http://localhost:${number}`;
|
|
2235
|
-
stop: () => boolean;
|
|
2236
|
-
}>;
|
|
2237
|
-
|
|
2238
|
-
type EVM_AssetMethod = AssetMethod;
|
|
2239
|
-
type EVM_FactoryMethod = FactoryMethod;
|
|
2240
|
-
type EVM_FactoryMethodParameters = FactoryMethodParameters;
|
|
2241
|
-
type EVM_MethodParameters = MethodParameters;
|
|
2242
|
-
type EVM_Mocked = Mocked;
|
|
2243
|
-
type EVM_MockedAsset = MockedAsset;
|
|
2244
|
-
type EVM_MockedFactory = MockedFactory;
|
|
2245
|
-
type EVM_MockedMorpho = MockedMorpho;
|
|
2246
|
-
type EVM_MockedOracle = MockedOracle;
|
|
2247
|
-
type EVM_MockedVault = MockedVault;
|
|
2248
|
-
type EVM_MorphoMethod = MorphoMethod;
|
|
2249
|
-
type EVM_MorphoMethodParameters = MorphoMethodParameters;
|
|
2250
|
-
type EVM_OracleMethod = OracleMethod;
|
|
2251
|
-
type EVM_OracleMethodParameters = OracleMethodParameters;
|
|
2252
|
-
type EVM_VaultMethod = VaultMethod;
|
|
2253
|
-
type EVM_VaultMethodParameters = VaultMethodParameters;
|
|
2254
|
-
declare const EVM_assetList: typeof assetList;
|
|
2255
|
-
declare const EVM_assetMethods: typeof assetMethods;
|
|
2256
|
-
declare const EVM_encodeConsumedEvent: typeof encodeConsumedEvent;
|
|
2257
|
-
declare const EVM_factoryMethods: typeof factoryMethods;
|
|
2258
|
-
declare const EVM_mock: typeof mock;
|
|
2259
|
-
declare const EVM_mockAddress: typeof mockAddress;
|
|
2260
|
-
declare const EVM_mockFactoryAddress: typeof mockFactoryAddress;
|
|
2261
|
-
declare const EVM_mockMorphoAddress: typeof mockMorphoAddress;
|
|
2262
|
-
declare const EVM_mockOracleAddress: typeof mockOracleAddress;
|
|
2263
|
-
declare const EVM_morphoMethods: typeof morphoMethods;
|
|
2264
|
-
declare const EVM_oracleMethods: typeof oracleMethods;
|
|
2265
|
-
declare const EVM_serve: typeof serve;
|
|
2266
|
-
declare const EVM_users: typeof users;
|
|
2267
|
-
declare const EVM_vaultMethods: typeof vaultMethods;
|
|
2268
|
-
declare namespace EVM {
|
|
2269
|
-
export { type EVM_AssetMethod as AssetMethod, type EVM_FactoryMethod as FactoryMethod, type EVM_FactoryMethodParameters as FactoryMethodParameters, type EVM_MethodParameters as MethodParameters, type EVM_Mocked as Mocked, type EVM_MockedAsset as MockedAsset, type EVM_MockedFactory as MockedFactory, type EVM_MockedMorpho as MockedMorpho, type EVM_MockedOracle as MockedOracle, type EVM_MockedVault as MockedVault, type EVM_MorphoMethod as MorphoMethod, type EVM_MorphoMethodParameters as MorphoMethodParameters, type EVM_OracleMethod as OracleMethod, type EVM_OracleMethodParameters as OracleMethodParameters, type EVM_VaultMethod as VaultMethod, type EVM_VaultMethodParameters as VaultMethodParameters, EVM_assetList as assetList, EVM_assetMethods as assetMethods, EVM_encodeConsumedEvent as encodeConsumedEvent, EVM_factoryMethods as factoryMethods, EVM_mock as mock, EVM_mockAddress as mockAddress, EVM_mockFactoryAddress as mockFactoryAddress, EVM_mockMorphoAddress as mockMorphoAddress, EVM_mockOracleAddress as mockOracleAddress, EVM_morphoMethods as morphoMethods, EVM_oracleMethods as oracleMethods, EVM_serve as serve, EVM_users as users, EVM_vaultMethods as vaultMethods };
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
2095
|
type MempoolEVMClientConfig = {
|
|
2273
2096
|
readonly client: WalletClient;
|
|
2274
2097
|
readonly mempoolAddress: Address;
|
|
@@ -3534,4 +3357,4 @@ declare namespace index {
|
|
|
3534
3357
|
export { index_BaseError as BaseError, type index_GlobalErrorType as GlobalErrorType, type index_Snake as Snake, time as Time, index_batch as batch, index_batchMulticall as batchMulticall, fromSnakeCase$2 as fromSnakeCase, index_lazy as lazy, max$1 as max, index_min as min, index_poll as poll, index_retry as retry, toSnakeCase$1 as toSnakeCase, index_wait as wait };
|
|
3535
3358
|
}
|
|
3536
3359
|
|
|
3537
|
-
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, ChainHealth, ChainStore$1 as ChainStore, ChainsHealthResponse, Collateral$1 as Collateral, index$4 as Collector, CollectorHealth, CollectorStore$1 as CollectorStore, CollectorsHealthResponse, type Compute, Cursor$1 as Cursor,
|
|
3360
|
+
export { Abi, type Brand, BrandTypeId, Callback, Chain$1 as Chain, ChainHealth, ChainStore$1 as ChainStore, ChainsHealthResponse, Collateral$1 as Collateral, index$4 as Collector, CollectorHealth, CollectorStore$1 as CollectorStore, CollectorsHealthResponse, type Compute, Cursor$1 as Cursor, Errors, Format, Health, LLTV$1 as LLTV, Liquidity, LiquidityStore$1 as LiquidityStore, Logger$1 as Logger, Maturity$1 as Maturity, index$1 as Mempool, Obligation$1 as Obligation, ObligationResponse$1 as ObligationResponse, Offer$1 as Offer, OfferResponse$1 as OfferResponse, OfferStore$1 as OfferStore, schema as OffersSchema, OpenApi, PG$1 as PG, index$2 as RouterApi, Client$2 as RouterClient, RouterIndexer, RouterStatusResponse, Services$1 as Services, time as Time, index as Utils, Validation, ValidationRule, parse, safeParse };
|