@morpho-dev/router 0.1.1 → 0.1.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.
- package/dist/index.browser.d.cts +11 -136
- package/dist/index.browser.d.ts +11 -136
- package/dist/index.browser.js +19 -238
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +21 -238
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.cts +12 -137
- package/dist/index.node.d.ts +12 -137
- package/dist/index.node.js +19 -238
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +21 -238
- package/dist/index.node.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.node.d.cts
CHANGED
|
@@ -1,52 +1,15 @@
|
|
|
1
1
|
import * as _morpho_dev_mempool from '@morpho-dev/mempool';
|
|
2
|
-
import {
|
|
2
|
+
import { Offer, Errors, Format, Maturity, LLTV, Compute, Chain } from '@morpho-dev/mempool';
|
|
3
3
|
export * from '@morpho-dev/mempool';
|
|
4
|
-
import * as viem from 'viem';
|
|
5
|
-
import { Address, Hex, PublicClient } from 'viem';
|
|
6
|
-
import { Chain as Chain$2 } from 'viem/chains';
|
|
7
4
|
import * as node_modules_zod_openapi_dist_components_DkyUTLcs_js from 'node_modules/zod-openapi/dist/components-DkyUTLcs.js';
|
|
8
5
|
import { z, ZodError } from 'zod/v4';
|
|
6
|
+
import * as viem from 'viem';
|
|
7
|
+
import { Address, Hex } from 'viem';
|
|
9
8
|
import * as hono_utils_types from 'hono/utils/types';
|
|
10
9
|
import * as hono from 'hono';
|
|
11
10
|
import { Context } from 'hono';
|
|
12
11
|
import * as hono_utils_http_status from 'hono/utils/http-status';
|
|
13
12
|
|
|
14
|
-
declare const chainNames: readonly ["ethereum", "base", "ethereum-virtual-testnet"];
|
|
15
|
-
type ChainName = (typeof chainNames)[number];
|
|
16
|
-
declare const ChainId: {
|
|
17
|
-
ETHEREUM: bigint;
|
|
18
|
-
BASE: bigint;
|
|
19
|
-
"ETHEREUM-VIRTUAL-TESTNET": bigint;
|
|
20
|
-
};
|
|
21
|
-
type ChainId = (typeof ChainId)[keyof typeof ChainId];
|
|
22
|
-
declare const chainIds: Set<bigint>;
|
|
23
|
-
type Chain = Compute<Omit<Chain$2, "id" | "name"> & {
|
|
24
|
-
id: ChainId;
|
|
25
|
-
name: ChainName;
|
|
26
|
-
whitelistedAssets: Set<Address>;
|
|
27
|
-
morpho: Address;
|
|
28
|
-
mempool?: {
|
|
29
|
-
address: Address;
|
|
30
|
-
deploymentBlock: number;
|
|
31
|
-
reindexBuffer: number;
|
|
32
|
-
};
|
|
33
|
-
}>;
|
|
34
|
-
declare function getChain(chainId: ChainId): Chain | undefined;
|
|
35
|
-
declare const getWhitelistedChains: () => Chain[];
|
|
36
|
-
declare const chains: Record<ChainName, Chain>;
|
|
37
|
-
|
|
38
|
-
type Chain$1_Chain = Chain;
|
|
39
|
-
type Chain$1_ChainId = ChainId;
|
|
40
|
-
type Chain$1_ChainName = ChainName;
|
|
41
|
-
declare const Chain$1_chainIds: typeof chainIds;
|
|
42
|
-
declare const Chain$1_chainNames: typeof chainNames;
|
|
43
|
-
declare const Chain$1_chains: typeof chains;
|
|
44
|
-
declare const Chain$1_getChain: typeof getChain;
|
|
45
|
-
declare const Chain$1_getWhitelistedChains: typeof getWhitelistedChains;
|
|
46
|
-
declare namespace Chain$1 {
|
|
47
|
-
export { type Chain$1_Chain as Chain, type Chain$1_ChainId as ChainId, type Chain$1_ChainName as ChainName, Chain$1_chainIds as chainIds, Chain$1_chainNames as chainNames, Chain$1_chains as chains, Chain$1_getChain as getChain, Chain$1_getWhitelistedChains as getWhitelistedChains };
|
|
48
|
-
}
|
|
49
|
-
|
|
50
13
|
declare const OpenApi: node_modules_zod_openapi_dist_components_DkyUTLcs_js.OpenAPIObject;
|
|
51
14
|
|
|
52
15
|
declare const schemas: {
|
|
@@ -199,8 +162,8 @@ declare const consumedEvent: {
|
|
|
199
162
|
* @param input - The router offer to create.
|
|
200
163
|
* @returns The created router offer with its hash.
|
|
201
164
|
*/
|
|
202
|
-
declare function from
|
|
203
|
-
declare namespace from
|
|
165
|
+
declare function from(input: Omit<RouterOffer, "hash">): RouterOffer;
|
|
166
|
+
declare namespace from {
|
|
204
167
|
type ErrorType = InvalidRouterOfferError;
|
|
205
168
|
}
|
|
206
169
|
/**
|
|
@@ -243,12 +206,13 @@ declare const RouterOffer$1_OfferStatusValues: typeof OfferStatusValues;
|
|
|
243
206
|
type RouterOffer$1_RouterOffer = RouterOffer;
|
|
244
207
|
declare const RouterOffer$1_RouterOfferSchema: typeof RouterOfferSchema;
|
|
245
208
|
declare const RouterOffer$1_consumedEvent: typeof consumedEvent;
|
|
209
|
+
declare const RouterOffer$1_from: typeof from;
|
|
246
210
|
declare const RouterOffer$1_fromConsumedLog: typeof fromConsumedLog;
|
|
247
211
|
declare const RouterOffer$1_fromSnakeCase: typeof fromSnakeCase;
|
|
248
212
|
declare const RouterOffer$1_random: typeof random;
|
|
249
213
|
declare const RouterOffer$1_toSnakeCase: typeof toSnakeCase;
|
|
250
214
|
declare namespace RouterOffer$1 {
|
|
251
|
-
export { RouterOffer$1_InvalidRouterOfferError as InvalidRouterOfferError, type RouterOffer$1_OfferConsumed as OfferConsumed, type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer, RouterOffer$1_RouterOfferSchema as RouterOfferSchema, RouterOffer$1_consumedEvent as consumedEvent,
|
|
215
|
+
export { RouterOffer$1_InvalidRouterOfferError as InvalidRouterOfferError, type RouterOffer$1_OfferConsumed as OfferConsumed, type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer, RouterOffer$1_RouterOfferSchema as RouterOfferSchema, RouterOffer$1_consumedEvent as consumedEvent, RouterOffer$1_from as from, RouterOffer$1_fromConsumedLog as fromConsumedLog, RouterOffer$1_fromSnakeCase as fromSnakeCase, RouterOffer$1_random as random, RouterOffer$1_toSnakeCase as toSnakeCase };
|
|
252
216
|
}
|
|
253
217
|
|
|
254
218
|
type OfferResponse = {
|
|
@@ -473,19 +437,6 @@ type OfferStore = {
|
|
|
473
437
|
nonce: Offer.Offer["nonce"];
|
|
474
438
|
consumed: bigint;
|
|
475
439
|
}) => Promise<void>;
|
|
476
|
-
/** Persist latest indexing progress for a chain and event type. */
|
|
477
|
-
saveLatestBlockNumberProcessed: (parameters: {
|
|
478
|
-
chainId: Offer.Offer["chainId"];
|
|
479
|
-
eventType: "offer_created" | "offer_consumed";
|
|
480
|
-
latestBlockNumber: number;
|
|
481
|
-
}) => Promise<void>;
|
|
482
|
-
/** Retrieve latest indexing progress for a chain and event type. */
|
|
483
|
-
getLatestBlockNumberProcessed: (parameters: {
|
|
484
|
-
chainId: Offer.Offer["chainId"];
|
|
485
|
-
eventType: "offer_created" | "offer_consumed";
|
|
486
|
-
}) => Promise<{
|
|
487
|
-
latestBlockNumber: number;
|
|
488
|
-
} | null>;
|
|
489
440
|
};
|
|
490
441
|
type GetOffersFilters = {
|
|
491
442
|
creators?: string[];
|
|
@@ -546,7 +497,7 @@ declare function memory(parameters: {
|
|
|
546
497
|
status: OfferStatus;
|
|
547
498
|
metadata?: OfferMetadata;
|
|
548
499
|
}>;
|
|
549
|
-
filled: Map<
|
|
500
|
+
filled: Map<Chain.Id, Map<Address, Map<bigint, bigint>>>;
|
|
550
501
|
}): OfferStore;
|
|
551
502
|
|
|
552
503
|
type index$2_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
@@ -721,32 +672,6 @@ declare namespace Logger$1 {
|
|
|
721
672
|
export { type Logger$1_LogFn as LogFn, type Logger$1_LogLevel as LogLevel, Logger$1_LogLevelValues as LogLevelValues, type Logger$1_Logger as Logger, Logger$1_defaultLogger as defaultLogger, Logger$1_getLogger as getLogger, Logger$1_runWithLogger as runWithLogger, Logger$1_silentLogger as silentLogger };
|
|
722
673
|
}
|
|
723
674
|
|
|
724
|
-
declare const types: readonly ["offer_created", "offer_consumed", "offer_validation"];
|
|
725
|
-
type Type = (typeof types)[number];
|
|
726
|
-
type BaseEvent<type extends Type = Type> = {
|
|
727
|
-
readonly id: string;
|
|
728
|
-
readonly type: type;
|
|
729
|
-
};
|
|
730
|
-
type RouterEvent<type extends Type = Type> = type extends "offer_consumed" ? Compute<BaseEvent<type> & {
|
|
731
|
-
readonly offerConsumed: OfferConsumed;
|
|
732
|
-
}> : type extends "offer_created" | "offer_validation" ? Compute<BaseEvent<type> & {
|
|
733
|
-
readonly offer: Offer.Offer;
|
|
734
|
-
}> : never;
|
|
735
|
-
/**
|
|
736
|
-
* Creates a RouterEvent with a deterministic id.
|
|
737
|
-
*/
|
|
738
|
-
declare function from<T extends Type = Type>(base: Omit<RouterEvent<T>, "id" | "type"> & {
|
|
739
|
-
type: T;
|
|
740
|
-
}): Compute<RouterEvent<T>>;
|
|
741
|
-
|
|
742
|
-
type RouterEvent$1_RouterEvent<type extends Type = Type> = RouterEvent<type>;
|
|
743
|
-
type RouterEvent$1_Type = Type;
|
|
744
|
-
declare const RouterEvent$1_from: typeof from;
|
|
745
|
-
declare const RouterEvent$1_types: typeof types;
|
|
746
|
-
declare namespace RouterEvent$1 {
|
|
747
|
-
export { type RouterEvent$1_RouterEvent as RouterEvent, type RouterEvent$1_Type as Type, RouterEvent$1_from as from, RouterEvent$1_types as types };
|
|
748
|
-
}
|
|
749
|
-
|
|
750
675
|
/**
|
|
751
676
|
* Splits an array into batches of a specified size.
|
|
752
677
|
* @param array The array to split.
|
|
@@ -848,11 +773,9 @@ declare function single<Name extends string, T, Ctx = void>(name: Name, run: Sin
|
|
|
848
773
|
*/
|
|
849
774
|
declare function batch<Name extends string, T, Ctx = void>(name: Name, run: Batch<T, Name, Ctx>): Rule<T, Name, Ctx>;
|
|
850
775
|
type MorphoContext = {
|
|
851
|
-
|
|
776
|
+
chain: Chain.Chain;
|
|
852
777
|
};
|
|
853
|
-
declare function morpho(
|
|
854
|
-
whitelistedChains: Chain[];
|
|
855
|
-
}): (Rule<{
|
|
778
|
+
declare function morpho(): (Rule<{
|
|
856
779
|
readonly offering: Address;
|
|
857
780
|
readonly assets: bigint;
|
|
858
781
|
readonly rate: bigint;
|
|
@@ -948,55 +871,7 @@ declare function morpho(parameters: {
|
|
|
948
871
|
readonly hash: viem.Hex;
|
|
949
872
|
signature?: viem.Hex;
|
|
950
873
|
createdAt?: number;
|
|
951
|
-
}, "empty_callback", MorphoContext>
|
|
952
|
-
readonly offering: Address;
|
|
953
|
-
readonly assets: bigint;
|
|
954
|
-
readonly rate: bigint;
|
|
955
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
956
|
-
readonly expiry: number;
|
|
957
|
-
readonly nonce: bigint;
|
|
958
|
-
readonly buy: boolean;
|
|
959
|
-
readonly chainId: bigint;
|
|
960
|
-
readonly loanToken: Address;
|
|
961
|
-
readonly start: number;
|
|
962
|
-
readonly collaterals: readonly {
|
|
963
|
-
asset: Address;
|
|
964
|
-
oracle: Address;
|
|
965
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
966
|
-
}[];
|
|
967
|
-
readonly callback: {
|
|
968
|
-
readonly address: Address;
|
|
969
|
-
readonly data: viem.Hex;
|
|
970
|
-
readonly gasLimit: bigint;
|
|
971
|
-
};
|
|
972
|
-
readonly hash: viem.Hex;
|
|
973
|
-
signature?: viem.Hex;
|
|
974
|
-
createdAt?: number;
|
|
975
|
-
}, "sell_offers_empty_callback", MorphoContext> | Rule<{
|
|
976
|
-
readonly offering: Address;
|
|
977
|
-
readonly assets: bigint;
|
|
978
|
-
readonly rate: bigint;
|
|
979
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
980
|
-
readonly expiry: number;
|
|
981
|
-
readonly nonce: bigint;
|
|
982
|
-
readonly buy: boolean;
|
|
983
|
-
readonly chainId: bigint;
|
|
984
|
-
readonly loanToken: Address;
|
|
985
|
-
readonly start: number;
|
|
986
|
-
readonly collaterals: readonly {
|
|
987
|
-
asset: Address;
|
|
988
|
-
oracle: Address;
|
|
989
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
990
|
-
}[];
|
|
991
|
-
readonly callback: {
|
|
992
|
-
readonly address: Address;
|
|
993
|
-
readonly data: viem.Hex;
|
|
994
|
-
readonly gasLimit: bigint;
|
|
995
|
-
};
|
|
996
|
-
readonly hash: viem.Hex;
|
|
997
|
-
signature?: viem.Hex;
|
|
998
|
-
createdAt?: number;
|
|
999
|
-
}, "buy_offers_empty_callback", MorphoContext>)[];
|
|
874
|
+
}, "empty_callback", MorphoContext>)[];
|
|
1000
875
|
|
|
1001
876
|
type ValidationRule_Batch<T, RuleName extends string, Ctx = void> = Batch<T, RuleName, Ctx>;
|
|
1002
877
|
type ValidationRule_MorphoContext = MorphoContext;
|
|
@@ -1051,4 +926,4 @@ declare namespace Validation {
|
|
|
1051
926
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
1052
927
|
}
|
|
1053
928
|
|
|
1054
|
-
export { index$3 as ApiSchema,
|
|
929
|
+
export { index$3 as ApiSchema, Logger$1 as Logger, index$2 as OfferStore, index$1 as Router, RouterOffer$1 as RouterOffer, index as Utils, Validation, ValidationRule };
|
package/dist/index.node.d.ts
CHANGED
|
@@ -1,52 +1,15 @@
|
|
|
1
1
|
import * as _morpho_dev_mempool from '@morpho-dev/mempool';
|
|
2
|
-
import {
|
|
2
|
+
import { Offer, Errors, Format, Maturity, LLTV, Compute, Chain } from '@morpho-dev/mempool';
|
|
3
3
|
export * from '@morpho-dev/mempool';
|
|
4
|
-
import * as viem from 'viem';
|
|
5
|
-
import { Address, Hex, PublicClient } from 'viem';
|
|
6
|
-
import { Chain as Chain$2 } from 'viem/chains';
|
|
7
4
|
import * as node_modules_zod_openapi_dist_components_DkyUTLcs_js from 'node_modules/zod-openapi/dist/components-DkyUTLcs.js';
|
|
8
5
|
import { z, ZodError } from 'zod/v4';
|
|
6
|
+
import * as viem from 'viem';
|
|
7
|
+
import { Address, Hex } from 'viem';
|
|
9
8
|
import * as hono_utils_types from 'hono/utils/types';
|
|
10
9
|
import * as hono from 'hono';
|
|
11
10
|
import { Context } from 'hono';
|
|
12
11
|
import * as hono_utils_http_status from 'hono/utils/http-status';
|
|
13
12
|
|
|
14
|
-
declare const chainNames: readonly ["ethereum", "base", "ethereum-virtual-testnet"];
|
|
15
|
-
type ChainName = (typeof chainNames)[number];
|
|
16
|
-
declare const ChainId: {
|
|
17
|
-
ETHEREUM: bigint;
|
|
18
|
-
BASE: bigint;
|
|
19
|
-
"ETHEREUM-VIRTUAL-TESTNET": bigint;
|
|
20
|
-
};
|
|
21
|
-
type ChainId = (typeof ChainId)[keyof typeof ChainId];
|
|
22
|
-
declare const chainIds: Set<bigint>;
|
|
23
|
-
type Chain = Compute<Omit<Chain$2, "id" | "name"> & {
|
|
24
|
-
id: ChainId;
|
|
25
|
-
name: ChainName;
|
|
26
|
-
whitelistedAssets: Set<Address>;
|
|
27
|
-
morpho: Address;
|
|
28
|
-
mempool?: {
|
|
29
|
-
address: Address;
|
|
30
|
-
deploymentBlock: number;
|
|
31
|
-
reindexBuffer: number;
|
|
32
|
-
};
|
|
33
|
-
}>;
|
|
34
|
-
declare function getChain(chainId: ChainId): Chain | undefined;
|
|
35
|
-
declare const getWhitelistedChains: () => Chain[];
|
|
36
|
-
declare const chains: Record<ChainName, Chain>;
|
|
37
|
-
|
|
38
|
-
type Chain$1_Chain = Chain;
|
|
39
|
-
type Chain$1_ChainId = ChainId;
|
|
40
|
-
type Chain$1_ChainName = ChainName;
|
|
41
|
-
declare const Chain$1_chainIds: typeof chainIds;
|
|
42
|
-
declare const Chain$1_chainNames: typeof chainNames;
|
|
43
|
-
declare const Chain$1_chains: typeof chains;
|
|
44
|
-
declare const Chain$1_getChain: typeof getChain;
|
|
45
|
-
declare const Chain$1_getWhitelistedChains: typeof getWhitelistedChains;
|
|
46
|
-
declare namespace Chain$1 {
|
|
47
|
-
export { type Chain$1_Chain as Chain, type Chain$1_ChainId as ChainId, type Chain$1_ChainName as ChainName, Chain$1_chainIds as chainIds, Chain$1_chainNames as chainNames, Chain$1_chains as chains, Chain$1_getChain as getChain, Chain$1_getWhitelistedChains as getWhitelistedChains };
|
|
48
|
-
}
|
|
49
|
-
|
|
50
13
|
declare const OpenApi: node_modules_zod_openapi_dist_components_DkyUTLcs_js.OpenAPIObject;
|
|
51
14
|
|
|
52
15
|
declare const schemas: {
|
|
@@ -199,8 +162,8 @@ declare const consumedEvent: {
|
|
|
199
162
|
* @param input - The router offer to create.
|
|
200
163
|
* @returns The created router offer with its hash.
|
|
201
164
|
*/
|
|
202
|
-
declare function from
|
|
203
|
-
declare namespace from
|
|
165
|
+
declare function from(input: Omit<RouterOffer, "hash">): RouterOffer;
|
|
166
|
+
declare namespace from {
|
|
204
167
|
type ErrorType = InvalidRouterOfferError;
|
|
205
168
|
}
|
|
206
169
|
/**
|
|
@@ -243,12 +206,13 @@ declare const RouterOffer$1_OfferStatusValues: typeof OfferStatusValues;
|
|
|
243
206
|
type RouterOffer$1_RouterOffer = RouterOffer;
|
|
244
207
|
declare const RouterOffer$1_RouterOfferSchema: typeof RouterOfferSchema;
|
|
245
208
|
declare const RouterOffer$1_consumedEvent: typeof consumedEvent;
|
|
209
|
+
declare const RouterOffer$1_from: typeof from;
|
|
246
210
|
declare const RouterOffer$1_fromConsumedLog: typeof fromConsumedLog;
|
|
247
211
|
declare const RouterOffer$1_fromSnakeCase: typeof fromSnakeCase;
|
|
248
212
|
declare const RouterOffer$1_random: typeof random;
|
|
249
213
|
declare const RouterOffer$1_toSnakeCase: typeof toSnakeCase;
|
|
250
214
|
declare namespace RouterOffer$1 {
|
|
251
|
-
export { RouterOffer$1_InvalidRouterOfferError as InvalidRouterOfferError, type RouterOffer$1_OfferConsumed as OfferConsumed, type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer, RouterOffer$1_RouterOfferSchema as RouterOfferSchema, RouterOffer$1_consumedEvent as consumedEvent,
|
|
215
|
+
export { RouterOffer$1_InvalidRouterOfferError as InvalidRouterOfferError, type RouterOffer$1_OfferConsumed as OfferConsumed, type RouterOffer$1_OfferMetadata as OfferMetadata, type RouterOffer$1_OfferStatus as OfferStatus, RouterOffer$1_OfferStatusValues as OfferStatusValues, type RouterOffer$1_RouterOffer as RouterOffer, RouterOffer$1_RouterOfferSchema as RouterOfferSchema, RouterOffer$1_consumedEvent as consumedEvent, RouterOffer$1_from as from, RouterOffer$1_fromConsumedLog as fromConsumedLog, RouterOffer$1_fromSnakeCase as fromSnakeCase, RouterOffer$1_random as random, RouterOffer$1_toSnakeCase as toSnakeCase };
|
|
252
216
|
}
|
|
253
217
|
|
|
254
218
|
type OfferResponse = {
|
|
@@ -473,19 +437,6 @@ type OfferStore = {
|
|
|
473
437
|
nonce: Offer.Offer["nonce"];
|
|
474
438
|
consumed: bigint;
|
|
475
439
|
}) => Promise<void>;
|
|
476
|
-
/** Persist latest indexing progress for a chain and event type. */
|
|
477
|
-
saveLatestBlockNumberProcessed: (parameters: {
|
|
478
|
-
chainId: Offer.Offer["chainId"];
|
|
479
|
-
eventType: "offer_created" | "offer_consumed";
|
|
480
|
-
latestBlockNumber: number;
|
|
481
|
-
}) => Promise<void>;
|
|
482
|
-
/** Retrieve latest indexing progress for a chain and event type. */
|
|
483
|
-
getLatestBlockNumberProcessed: (parameters: {
|
|
484
|
-
chainId: Offer.Offer["chainId"];
|
|
485
|
-
eventType: "offer_created" | "offer_consumed";
|
|
486
|
-
}) => Promise<{
|
|
487
|
-
latestBlockNumber: number;
|
|
488
|
-
} | null>;
|
|
489
440
|
};
|
|
490
441
|
type GetOffersFilters = {
|
|
491
442
|
creators?: string[];
|
|
@@ -546,7 +497,7 @@ declare function memory(parameters: {
|
|
|
546
497
|
status: OfferStatus;
|
|
547
498
|
metadata?: OfferMetadata;
|
|
548
499
|
}>;
|
|
549
|
-
filled: Map<
|
|
500
|
+
filled: Map<Chain.Id, Map<Address, Map<bigint, bigint>>>;
|
|
550
501
|
}): OfferStore;
|
|
551
502
|
|
|
552
503
|
type index$2_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
@@ -721,32 +672,6 @@ declare namespace Logger$1 {
|
|
|
721
672
|
export { type Logger$1_LogFn as LogFn, type Logger$1_LogLevel as LogLevel, Logger$1_LogLevelValues as LogLevelValues, type Logger$1_Logger as Logger, Logger$1_defaultLogger as defaultLogger, Logger$1_getLogger as getLogger, Logger$1_runWithLogger as runWithLogger, Logger$1_silentLogger as silentLogger };
|
|
722
673
|
}
|
|
723
674
|
|
|
724
|
-
declare const types: readonly ["offer_created", "offer_consumed", "offer_validation"];
|
|
725
|
-
type Type = (typeof types)[number];
|
|
726
|
-
type BaseEvent<type extends Type = Type> = {
|
|
727
|
-
readonly id: string;
|
|
728
|
-
readonly type: type;
|
|
729
|
-
};
|
|
730
|
-
type RouterEvent<type extends Type = Type> = type extends "offer_consumed" ? Compute<BaseEvent<type> & {
|
|
731
|
-
readonly offerConsumed: OfferConsumed;
|
|
732
|
-
}> : type extends "offer_created" | "offer_validation" ? Compute<BaseEvent<type> & {
|
|
733
|
-
readonly offer: Offer.Offer;
|
|
734
|
-
}> : never;
|
|
735
|
-
/**
|
|
736
|
-
* Creates a RouterEvent with a deterministic id.
|
|
737
|
-
*/
|
|
738
|
-
declare function from<T extends Type = Type>(base: Omit<RouterEvent<T>, "id" | "type"> & {
|
|
739
|
-
type: T;
|
|
740
|
-
}): Compute<RouterEvent<T>>;
|
|
741
|
-
|
|
742
|
-
type RouterEvent$1_RouterEvent<type extends Type = Type> = RouterEvent<type>;
|
|
743
|
-
type RouterEvent$1_Type = Type;
|
|
744
|
-
declare const RouterEvent$1_from: typeof from;
|
|
745
|
-
declare const RouterEvent$1_types: typeof types;
|
|
746
|
-
declare namespace RouterEvent$1 {
|
|
747
|
-
export { type RouterEvent$1_RouterEvent as RouterEvent, type RouterEvent$1_Type as Type, RouterEvent$1_from as from, RouterEvent$1_types as types };
|
|
748
|
-
}
|
|
749
|
-
|
|
750
675
|
/**
|
|
751
676
|
* Splits an array into batches of a specified size.
|
|
752
677
|
* @param array The array to split.
|
|
@@ -848,11 +773,9 @@ declare function single<Name extends string, T, Ctx = void>(name: Name, run: Sin
|
|
|
848
773
|
*/
|
|
849
774
|
declare function batch<Name extends string, T, Ctx = void>(name: Name, run: Batch<T, Name, Ctx>): Rule<T, Name, Ctx>;
|
|
850
775
|
type MorphoContext = {
|
|
851
|
-
|
|
776
|
+
chain: Chain.Chain;
|
|
852
777
|
};
|
|
853
|
-
declare function morpho(
|
|
854
|
-
whitelistedChains: Chain[];
|
|
855
|
-
}): (Rule<{
|
|
778
|
+
declare function morpho(): (Rule<{
|
|
856
779
|
readonly offering: Address;
|
|
857
780
|
readonly assets: bigint;
|
|
858
781
|
readonly rate: bigint;
|
|
@@ -948,55 +871,7 @@ declare function morpho(parameters: {
|
|
|
948
871
|
readonly hash: viem.Hex;
|
|
949
872
|
signature?: viem.Hex;
|
|
950
873
|
createdAt?: number;
|
|
951
|
-
}, "empty_callback", MorphoContext>
|
|
952
|
-
readonly offering: Address;
|
|
953
|
-
readonly assets: bigint;
|
|
954
|
-
readonly rate: bigint;
|
|
955
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
956
|
-
readonly expiry: number;
|
|
957
|
-
readonly nonce: bigint;
|
|
958
|
-
readonly buy: boolean;
|
|
959
|
-
readonly chainId: bigint;
|
|
960
|
-
readonly loanToken: Address;
|
|
961
|
-
readonly start: number;
|
|
962
|
-
readonly collaterals: readonly {
|
|
963
|
-
asset: Address;
|
|
964
|
-
oracle: Address;
|
|
965
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
966
|
-
}[];
|
|
967
|
-
readonly callback: {
|
|
968
|
-
readonly address: Address;
|
|
969
|
-
readonly data: viem.Hex;
|
|
970
|
-
readonly gasLimit: bigint;
|
|
971
|
-
};
|
|
972
|
-
readonly hash: viem.Hex;
|
|
973
|
-
signature?: viem.Hex;
|
|
974
|
-
createdAt?: number;
|
|
975
|
-
}, "sell_offers_empty_callback", MorphoContext> | Rule<{
|
|
976
|
-
readonly offering: Address;
|
|
977
|
-
readonly assets: bigint;
|
|
978
|
-
readonly rate: bigint;
|
|
979
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
980
|
-
readonly expiry: number;
|
|
981
|
-
readonly nonce: bigint;
|
|
982
|
-
readonly buy: boolean;
|
|
983
|
-
readonly chainId: bigint;
|
|
984
|
-
readonly loanToken: Address;
|
|
985
|
-
readonly start: number;
|
|
986
|
-
readonly collaterals: readonly {
|
|
987
|
-
asset: Address;
|
|
988
|
-
oracle: Address;
|
|
989
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
990
|
-
}[];
|
|
991
|
-
readonly callback: {
|
|
992
|
-
readonly address: Address;
|
|
993
|
-
readonly data: viem.Hex;
|
|
994
|
-
readonly gasLimit: bigint;
|
|
995
|
-
};
|
|
996
|
-
readonly hash: viem.Hex;
|
|
997
|
-
signature?: viem.Hex;
|
|
998
|
-
createdAt?: number;
|
|
999
|
-
}, "buy_offers_empty_callback", MorphoContext>)[];
|
|
874
|
+
}, "empty_callback", MorphoContext>)[];
|
|
1000
875
|
|
|
1001
876
|
type ValidationRule_Batch<T, RuleName extends string, Ctx = void> = Batch<T, RuleName, Ctx>;
|
|
1002
877
|
type ValidationRule_MorphoContext = MorphoContext;
|
|
@@ -1051,4 +926,4 @@ declare namespace Validation {
|
|
|
1051
926
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
1052
927
|
}
|
|
1053
928
|
|
|
1054
|
-
export { index$3 as ApiSchema,
|
|
929
|
+
export { index$3 as ApiSchema, Logger$1 as Logger, index$2 as OfferStore, index$1 as Router, RouterOffer$1 as RouterOffer, index as Utils, Validation, ValidationRule };
|