@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.browser.d.cts
CHANGED
|
@@ -1,47 +1,10 @@
|
|
|
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
4
|
import * as viem from 'viem';
|
|
5
|
-
import { Address, Hex
|
|
6
|
-
import { Chain as Chain$2 } from 'viem/chains';
|
|
5
|
+
import { Address, Hex } from 'viem';
|
|
7
6
|
import { z, ZodError } from 'zod/v4';
|
|
8
7
|
|
|
9
|
-
declare const chainNames: readonly ["ethereum", "base", "ethereum-virtual-testnet"];
|
|
10
|
-
type ChainName = (typeof chainNames)[number];
|
|
11
|
-
declare const ChainId: {
|
|
12
|
-
ETHEREUM: bigint;
|
|
13
|
-
BASE: bigint;
|
|
14
|
-
"ETHEREUM-VIRTUAL-TESTNET": bigint;
|
|
15
|
-
};
|
|
16
|
-
type ChainId = (typeof ChainId)[keyof typeof ChainId];
|
|
17
|
-
declare const chainIds: Set<bigint>;
|
|
18
|
-
type Chain = Compute<Omit<Chain$2, "id" | "name"> & {
|
|
19
|
-
id: ChainId;
|
|
20
|
-
name: ChainName;
|
|
21
|
-
whitelistedAssets: Set<Address>;
|
|
22
|
-
morpho: Address;
|
|
23
|
-
mempool?: {
|
|
24
|
-
address: Address;
|
|
25
|
-
deploymentBlock: number;
|
|
26
|
-
reindexBuffer: number;
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
declare function getChain(chainId: ChainId): Chain | undefined;
|
|
30
|
-
declare const getWhitelistedChains: () => Chain[];
|
|
31
|
-
declare const chains: Record<ChainName, Chain>;
|
|
32
|
-
|
|
33
|
-
type Chain$1_Chain = Chain;
|
|
34
|
-
type Chain$1_ChainId = ChainId;
|
|
35
|
-
type Chain$1_ChainName = ChainName;
|
|
36
|
-
declare const Chain$1_chainIds: typeof chainIds;
|
|
37
|
-
declare const Chain$1_chainNames: typeof chainNames;
|
|
38
|
-
declare const Chain$1_chains: typeof chains;
|
|
39
|
-
declare const Chain$1_getChain: typeof getChain;
|
|
40
|
-
declare const Chain$1_getWhitelistedChains: typeof getWhitelistedChains;
|
|
41
|
-
declare namespace Chain$1 {
|
|
42
|
-
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 };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
8
|
declare const OfferStatusValues: readonly ["valid", "callback_not_supported", "callback_error", "unverified"];
|
|
46
9
|
type OfferStatus = (typeof OfferStatusValues)[number];
|
|
47
10
|
type OfferMetadata = {
|
|
@@ -125,8 +88,8 @@ declare const consumedEvent: {
|
|
|
125
88
|
* @param input - The router offer to create.
|
|
126
89
|
* @returns The created router offer with its hash.
|
|
127
90
|
*/
|
|
128
|
-
declare function from
|
|
129
|
-
declare namespace from
|
|
91
|
+
declare function from(input: Omit<RouterOffer, "hash">): RouterOffer;
|
|
92
|
+
declare namespace from {
|
|
130
93
|
type ErrorType = InvalidRouterOfferError;
|
|
131
94
|
}
|
|
132
95
|
/**
|
|
@@ -169,12 +132,13 @@ declare const RouterOffer$1_OfferStatusValues: typeof OfferStatusValues;
|
|
|
169
132
|
type RouterOffer$1_RouterOffer = RouterOffer;
|
|
170
133
|
declare const RouterOffer$1_RouterOfferSchema: typeof RouterOfferSchema;
|
|
171
134
|
declare const RouterOffer$1_consumedEvent: typeof consumedEvent;
|
|
135
|
+
declare const RouterOffer$1_from: typeof from;
|
|
172
136
|
declare const RouterOffer$1_fromConsumedLog: typeof fromConsumedLog;
|
|
173
137
|
declare const RouterOffer$1_fromSnakeCase: typeof fromSnakeCase;
|
|
174
138
|
declare const RouterOffer$1_random: typeof random;
|
|
175
139
|
declare const RouterOffer$1_toSnakeCase: typeof toSnakeCase;
|
|
176
140
|
declare namespace RouterOffer$1 {
|
|
177
|
-
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,
|
|
141
|
+
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 };
|
|
178
142
|
}
|
|
179
143
|
|
|
180
144
|
type OfferResponse = {
|
|
@@ -398,19 +362,6 @@ type OfferStore = {
|
|
|
398
362
|
nonce: Offer.Offer["nonce"];
|
|
399
363
|
consumed: bigint;
|
|
400
364
|
}) => Promise<void>;
|
|
401
|
-
/** Persist latest indexing progress for a chain and event type. */
|
|
402
|
-
saveLatestBlockNumberProcessed: (parameters: {
|
|
403
|
-
chainId: Offer.Offer["chainId"];
|
|
404
|
-
eventType: "offer_created" | "offer_consumed";
|
|
405
|
-
latestBlockNumber: number;
|
|
406
|
-
}) => Promise<void>;
|
|
407
|
-
/** Retrieve latest indexing progress for a chain and event type. */
|
|
408
|
-
getLatestBlockNumberProcessed: (parameters: {
|
|
409
|
-
chainId: Offer.Offer["chainId"];
|
|
410
|
-
eventType: "offer_created" | "offer_consumed";
|
|
411
|
-
}) => Promise<{
|
|
412
|
-
latestBlockNumber: number;
|
|
413
|
-
} | null>;
|
|
414
365
|
};
|
|
415
366
|
type GetOffersFilters = {
|
|
416
367
|
creators?: string[];
|
|
@@ -471,7 +422,7 @@ declare function memory(parameters: {
|
|
|
471
422
|
status: OfferStatus;
|
|
472
423
|
metadata?: OfferMetadata;
|
|
473
424
|
}>;
|
|
474
|
-
filled: Map<
|
|
425
|
+
filled: Map<Chain.Id, Map<Address, Map<bigint, bigint>>>;
|
|
475
426
|
}): OfferStore;
|
|
476
427
|
|
|
477
428
|
type index$1_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
@@ -483,32 +434,6 @@ declare namespace index$1 {
|
|
|
483
434
|
export { type index$1_FindMatchingOffersParams as FindMatchingOffersParams, type index$1_GetAllParams as GetAllParams, type index$1_GetOffersFilters as GetOffersFilters, type index$1_OfferStore as OfferStore, index$1_memory as memory };
|
|
484
435
|
}
|
|
485
436
|
|
|
486
|
-
declare const types: readonly ["offer_created", "offer_consumed", "offer_validation"];
|
|
487
|
-
type Type = (typeof types)[number];
|
|
488
|
-
type BaseEvent<type extends Type = Type> = {
|
|
489
|
-
readonly id: string;
|
|
490
|
-
readonly type: type;
|
|
491
|
-
};
|
|
492
|
-
type RouterEvent<type extends Type = Type> = type extends "offer_consumed" ? Compute<BaseEvent<type> & {
|
|
493
|
-
readonly offerConsumed: OfferConsumed;
|
|
494
|
-
}> : type extends "offer_created" | "offer_validation" ? Compute<BaseEvent<type> & {
|
|
495
|
-
readonly offer: Offer.Offer;
|
|
496
|
-
}> : never;
|
|
497
|
-
/**
|
|
498
|
-
* Creates a RouterEvent with a deterministic id.
|
|
499
|
-
*/
|
|
500
|
-
declare function from<T extends Type = Type>(base: Omit<RouterEvent<T>, "id" | "type"> & {
|
|
501
|
-
type: T;
|
|
502
|
-
}): Compute<RouterEvent<T>>;
|
|
503
|
-
|
|
504
|
-
type RouterEvent$1_RouterEvent<type extends Type = Type> = RouterEvent<type>;
|
|
505
|
-
type RouterEvent$1_Type = Type;
|
|
506
|
-
declare const RouterEvent$1_from: typeof from;
|
|
507
|
-
declare const RouterEvent$1_types: typeof types;
|
|
508
|
-
declare namespace RouterEvent$1 {
|
|
509
|
-
export { type RouterEvent$1_RouterEvent as RouterEvent, type RouterEvent$1_Type as Type, RouterEvent$1_from as from, RouterEvent$1_types as types };
|
|
510
|
-
}
|
|
511
|
-
|
|
512
437
|
/**
|
|
513
438
|
* Splits an array into batches of a specified size.
|
|
514
439
|
* @param array The array to split.
|
|
@@ -610,11 +535,9 @@ declare function single<Name extends string, T, Ctx = void>(name: Name, run: Sin
|
|
|
610
535
|
*/
|
|
611
536
|
declare function batch<Name extends string, T, Ctx = void>(name: Name, run: Batch<T, Name, Ctx>): Rule<T, Name, Ctx>;
|
|
612
537
|
type MorphoContext = {
|
|
613
|
-
|
|
538
|
+
chain: Chain.Chain;
|
|
614
539
|
};
|
|
615
|
-
declare function morpho(
|
|
616
|
-
whitelistedChains: Chain[];
|
|
617
|
-
}): (Rule<{
|
|
540
|
+
declare function morpho(): (Rule<{
|
|
618
541
|
readonly offering: Address;
|
|
619
542
|
readonly assets: bigint;
|
|
620
543
|
readonly rate: bigint;
|
|
@@ -710,55 +633,7 @@ declare function morpho(parameters: {
|
|
|
710
633
|
readonly hash: viem.Hex;
|
|
711
634
|
signature?: viem.Hex;
|
|
712
635
|
createdAt?: number;
|
|
713
|
-
}, "empty_callback", MorphoContext>
|
|
714
|
-
readonly offering: Address;
|
|
715
|
-
readonly assets: bigint;
|
|
716
|
-
readonly rate: bigint;
|
|
717
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
718
|
-
readonly expiry: number;
|
|
719
|
-
readonly nonce: bigint;
|
|
720
|
-
readonly buy: boolean;
|
|
721
|
-
readonly chainId: bigint;
|
|
722
|
-
readonly loanToken: Address;
|
|
723
|
-
readonly start: number;
|
|
724
|
-
readonly collaterals: readonly {
|
|
725
|
-
asset: Address;
|
|
726
|
-
oracle: Address;
|
|
727
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
728
|
-
}[];
|
|
729
|
-
readonly callback: {
|
|
730
|
-
readonly address: Address;
|
|
731
|
-
readonly data: viem.Hex;
|
|
732
|
-
readonly gasLimit: bigint;
|
|
733
|
-
};
|
|
734
|
-
readonly hash: viem.Hex;
|
|
735
|
-
signature?: viem.Hex;
|
|
736
|
-
createdAt?: number;
|
|
737
|
-
}, "sell_offers_empty_callback", MorphoContext> | Rule<{
|
|
738
|
-
readonly offering: Address;
|
|
739
|
-
readonly assets: bigint;
|
|
740
|
-
readonly rate: bigint;
|
|
741
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
742
|
-
readonly expiry: number;
|
|
743
|
-
readonly nonce: bigint;
|
|
744
|
-
readonly buy: boolean;
|
|
745
|
-
readonly chainId: bigint;
|
|
746
|
-
readonly loanToken: Address;
|
|
747
|
-
readonly start: number;
|
|
748
|
-
readonly collaterals: readonly {
|
|
749
|
-
asset: Address;
|
|
750
|
-
oracle: Address;
|
|
751
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
752
|
-
}[];
|
|
753
|
-
readonly callback: {
|
|
754
|
-
readonly address: Address;
|
|
755
|
-
readonly data: viem.Hex;
|
|
756
|
-
readonly gasLimit: bigint;
|
|
757
|
-
};
|
|
758
|
-
readonly hash: viem.Hex;
|
|
759
|
-
signature?: viem.Hex;
|
|
760
|
-
createdAt?: number;
|
|
761
|
-
}, "buy_offers_empty_callback", MorphoContext>)[];
|
|
636
|
+
}, "empty_callback", MorphoContext>)[];
|
|
762
637
|
|
|
763
638
|
type ValidationRule_Batch<T, RuleName extends string, Ctx = void> = Batch<T, RuleName, Ctx>;
|
|
764
639
|
type ValidationRule_MorphoContext = MorphoContext;
|
|
@@ -813,4 +688,4 @@ declare namespace Validation {
|
|
|
813
688
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
814
689
|
}
|
|
815
690
|
|
|
816
|
-
export {
|
|
691
|
+
export { index$1 as OfferStore, Client$1 as Router, RouterOffer$1 as RouterOffer, index as Utils, Validation, ValidationRule };
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -1,47 +1,10 @@
|
|
|
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
4
|
import * as viem from 'viem';
|
|
5
|
-
import { Address, Hex
|
|
6
|
-
import { Chain as Chain$2 } from 'viem/chains';
|
|
5
|
+
import { Address, Hex } from 'viem';
|
|
7
6
|
import { z, ZodError } from 'zod/v4';
|
|
8
7
|
|
|
9
|
-
declare const chainNames: readonly ["ethereum", "base", "ethereum-virtual-testnet"];
|
|
10
|
-
type ChainName = (typeof chainNames)[number];
|
|
11
|
-
declare const ChainId: {
|
|
12
|
-
ETHEREUM: bigint;
|
|
13
|
-
BASE: bigint;
|
|
14
|
-
"ETHEREUM-VIRTUAL-TESTNET": bigint;
|
|
15
|
-
};
|
|
16
|
-
type ChainId = (typeof ChainId)[keyof typeof ChainId];
|
|
17
|
-
declare const chainIds: Set<bigint>;
|
|
18
|
-
type Chain = Compute<Omit<Chain$2, "id" | "name"> & {
|
|
19
|
-
id: ChainId;
|
|
20
|
-
name: ChainName;
|
|
21
|
-
whitelistedAssets: Set<Address>;
|
|
22
|
-
morpho: Address;
|
|
23
|
-
mempool?: {
|
|
24
|
-
address: Address;
|
|
25
|
-
deploymentBlock: number;
|
|
26
|
-
reindexBuffer: number;
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
declare function getChain(chainId: ChainId): Chain | undefined;
|
|
30
|
-
declare const getWhitelistedChains: () => Chain[];
|
|
31
|
-
declare const chains: Record<ChainName, Chain>;
|
|
32
|
-
|
|
33
|
-
type Chain$1_Chain = Chain;
|
|
34
|
-
type Chain$1_ChainId = ChainId;
|
|
35
|
-
type Chain$1_ChainName = ChainName;
|
|
36
|
-
declare const Chain$1_chainIds: typeof chainIds;
|
|
37
|
-
declare const Chain$1_chainNames: typeof chainNames;
|
|
38
|
-
declare const Chain$1_chains: typeof chains;
|
|
39
|
-
declare const Chain$1_getChain: typeof getChain;
|
|
40
|
-
declare const Chain$1_getWhitelistedChains: typeof getWhitelistedChains;
|
|
41
|
-
declare namespace Chain$1 {
|
|
42
|
-
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 };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
8
|
declare const OfferStatusValues: readonly ["valid", "callback_not_supported", "callback_error", "unverified"];
|
|
46
9
|
type OfferStatus = (typeof OfferStatusValues)[number];
|
|
47
10
|
type OfferMetadata = {
|
|
@@ -125,8 +88,8 @@ declare const consumedEvent: {
|
|
|
125
88
|
* @param input - The router offer to create.
|
|
126
89
|
* @returns The created router offer with its hash.
|
|
127
90
|
*/
|
|
128
|
-
declare function from
|
|
129
|
-
declare namespace from
|
|
91
|
+
declare function from(input: Omit<RouterOffer, "hash">): RouterOffer;
|
|
92
|
+
declare namespace from {
|
|
130
93
|
type ErrorType = InvalidRouterOfferError;
|
|
131
94
|
}
|
|
132
95
|
/**
|
|
@@ -169,12 +132,13 @@ declare const RouterOffer$1_OfferStatusValues: typeof OfferStatusValues;
|
|
|
169
132
|
type RouterOffer$1_RouterOffer = RouterOffer;
|
|
170
133
|
declare const RouterOffer$1_RouterOfferSchema: typeof RouterOfferSchema;
|
|
171
134
|
declare const RouterOffer$1_consumedEvent: typeof consumedEvent;
|
|
135
|
+
declare const RouterOffer$1_from: typeof from;
|
|
172
136
|
declare const RouterOffer$1_fromConsumedLog: typeof fromConsumedLog;
|
|
173
137
|
declare const RouterOffer$1_fromSnakeCase: typeof fromSnakeCase;
|
|
174
138
|
declare const RouterOffer$1_random: typeof random;
|
|
175
139
|
declare const RouterOffer$1_toSnakeCase: typeof toSnakeCase;
|
|
176
140
|
declare namespace RouterOffer$1 {
|
|
177
|
-
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,
|
|
141
|
+
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 };
|
|
178
142
|
}
|
|
179
143
|
|
|
180
144
|
type OfferResponse = {
|
|
@@ -398,19 +362,6 @@ type OfferStore = {
|
|
|
398
362
|
nonce: Offer.Offer["nonce"];
|
|
399
363
|
consumed: bigint;
|
|
400
364
|
}) => Promise<void>;
|
|
401
|
-
/** Persist latest indexing progress for a chain and event type. */
|
|
402
|
-
saveLatestBlockNumberProcessed: (parameters: {
|
|
403
|
-
chainId: Offer.Offer["chainId"];
|
|
404
|
-
eventType: "offer_created" | "offer_consumed";
|
|
405
|
-
latestBlockNumber: number;
|
|
406
|
-
}) => Promise<void>;
|
|
407
|
-
/** Retrieve latest indexing progress for a chain and event type. */
|
|
408
|
-
getLatestBlockNumberProcessed: (parameters: {
|
|
409
|
-
chainId: Offer.Offer["chainId"];
|
|
410
|
-
eventType: "offer_created" | "offer_consumed";
|
|
411
|
-
}) => Promise<{
|
|
412
|
-
latestBlockNumber: number;
|
|
413
|
-
} | null>;
|
|
414
365
|
};
|
|
415
366
|
type GetOffersFilters = {
|
|
416
367
|
creators?: string[];
|
|
@@ -471,7 +422,7 @@ declare function memory(parameters: {
|
|
|
471
422
|
status: OfferStatus;
|
|
472
423
|
metadata?: OfferMetadata;
|
|
473
424
|
}>;
|
|
474
|
-
filled: Map<
|
|
425
|
+
filled: Map<Chain.Id, Map<Address, Map<bigint, bigint>>>;
|
|
475
426
|
}): OfferStore;
|
|
476
427
|
|
|
477
428
|
type index$1_FindMatchingOffersParams = FindMatchingOffersParams;
|
|
@@ -483,32 +434,6 @@ declare namespace index$1 {
|
|
|
483
434
|
export { type index$1_FindMatchingOffersParams as FindMatchingOffersParams, type index$1_GetAllParams as GetAllParams, type index$1_GetOffersFilters as GetOffersFilters, type index$1_OfferStore as OfferStore, index$1_memory as memory };
|
|
484
435
|
}
|
|
485
436
|
|
|
486
|
-
declare const types: readonly ["offer_created", "offer_consumed", "offer_validation"];
|
|
487
|
-
type Type = (typeof types)[number];
|
|
488
|
-
type BaseEvent<type extends Type = Type> = {
|
|
489
|
-
readonly id: string;
|
|
490
|
-
readonly type: type;
|
|
491
|
-
};
|
|
492
|
-
type RouterEvent<type extends Type = Type> = type extends "offer_consumed" ? Compute<BaseEvent<type> & {
|
|
493
|
-
readonly offerConsumed: OfferConsumed;
|
|
494
|
-
}> : type extends "offer_created" | "offer_validation" ? Compute<BaseEvent<type> & {
|
|
495
|
-
readonly offer: Offer.Offer;
|
|
496
|
-
}> : never;
|
|
497
|
-
/**
|
|
498
|
-
* Creates a RouterEvent with a deterministic id.
|
|
499
|
-
*/
|
|
500
|
-
declare function from<T extends Type = Type>(base: Omit<RouterEvent<T>, "id" | "type"> & {
|
|
501
|
-
type: T;
|
|
502
|
-
}): Compute<RouterEvent<T>>;
|
|
503
|
-
|
|
504
|
-
type RouterEvent$1_RouterEvent<type extends Type = Type> = RouterEvent<type>;
|
|
505
|
-
type RouterEvent$1_Type = Type;
|
|
506
|
-
declare const RouterEvent$1_from: typeof from;
|
|
507
|
-
declare const RouterEvent$1_types: typeof types;
|
|
508
|
-
declare namespace RouterEvent$1 {
|
|
509
|
-
export { type RouterEvent$1_RouterEvent as RouterEvent, type RouterEvent$1_Type as Type, RouterEvent$1_from as from, RouterEvent$1_types as types };
|
|
510
|
-
}
|
|
511
|
-
|
|
512
437
|
/**
|
|
513
438
|
* Splits an array into batches of a specified size.
|
|
514
439
|
* @param array The array to split.
|
|
@@ -610,11 +535,9 @@ declare function single<Name extends string, T, Ctx = void>(name: Name, run: Sin
|
|
|
610
535
|
*/
|
|
611
536
|
declare function batch<Name extends string, T, Ctx = void>(name: Name, run: Batch<T, Name, Ctx>): Rule<T, Name, Ctx>;
|
|
612
537
|
type MorphoContext = {
|
|
613
|
-
|
|
538
|
+
chain: Chain.Chain;
|
|
614
539
|
};
|
|
615
|
-
declare function morpho(
|
|
616
|
-
whitelistedChains: Chain[];
|
|
617
|
-
}): (Rule<{
|
|
540
|
+
declare function morpho(): (Rule<{
|
|
618
541
|
readonly offering: Address;
|
|
619
542
|
readonly assets: bigint;
|
|
620
543
|
readonly rate: bigint;
|
|
@@ -710,55 +633,7 @@ declare function morpho(parameters: {
|
|
|
710
633
|
readonly hash: viem.Hex;
|
|
711
634
|
signature?: viem.Hex;
|
|
712
635
|
createdAt?: number;
|
|
713
|
-
}, "empty_callback", MorphoContext>
|
|
714
|
-
readonly offering: Address;
|
|
715
|
-
readonly assets: bigint;
|
|
716
|
-
readonly rate: bigint;
|
|
717
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
718
|
-
readonly expiry: number;
|
|
719
|
-
readonly nonce: bigint;
|
|
720
|
-
readonly buy: boolean;
|
|
721
|
-
readonly chainId: bigint;
|
|
722
|
-
readonly loanToken: Address;
|
|
723
|
-
readonly start: number;
|
|
724
|
-
readonly collaterals: readonly {
|
|
725
|
-
asset: Address;
|
|
726
|
-
oracle: Address;
|
|
727
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
728
|
-
}[];
|
|
729
|
-
readonly callback: {
|
|
730
|
-
readonly address: Address;
|
|
731
|
-
readonly data: viem.Hex;
|
|
732
|
-
readonly gasLimit: bigint;
|
|
733
|
-
};
|
|
734
|
-
readonly hash: viem.Hex;
|
|
735
|
-
signature?: viem.Hex;
|
|
736
|
-
createdAt?: number;
|
|
737
|
-
}, "sell_offers_empty_callback", MorphoContext> | Rule<{
|
|
738
|
-
readonly offering: Address;
|
|
739
|
-
readonly assets: bigint;
|
|
740
|
-
readonly rate: bigint;
|
|
741
|
-
readonly maturity: number & _morpho_dev_mempool.Brand<"Maturity">;
|
|
742
|
-
readonly expiry: number;
|
|
743
|
-
readonly nonce: bigint;
|
|
744
|
-
readonly buy: boolean;
|
|
745
|
-
readonly chainId: bigint;
|
|
746
|
-
readonly loanToken: Address;
|
|
747
|
-
readonly start: number;
|
|
748
|
-
readonly collaterals: readonly {
|
|
749
|
-
asset: Address;
|
|
750
|
-
oracle: Address;
|
|
751
|
-
lltv: bigint & _morpho_dev_mempool.Brand<"LLTV">;
|
|
752
|
-
}[];
|
|
753
|
-
readonly callback: {
|
|
754
|
-
readonly address: Address;
|
|
755
|
-
readonly data: viem.Hex;
|
|
756
|
-
readonly gasLimit: bigint;
|
|
757
|
-
};
|
|
758
|
-
readonly hash: viem.Hex;
|
|
759
|
-
signature?: viem.Hex;
|
|
760
|
-
createdAt?: number;
|
|
761
|
-
}, "buy_offers_empty_callback", MorphoContext>)[];
|
|
636
|
+
}, "empty_callback", MorphoContext>)[];
|
|
762
637
|
|
|
763
638
|
type ValidationRule_Batch<T, RuleName extends string, Ctx = void> = Batch<T, RuleName, Ctx>;
|
|
764
639
|
type ValidationRule_MorphoContext = MorphoContext;
|
|
@@ -813,4 +688,4 @@ declare namespace Validation {
|
|
|
813
688
|
export { type Validation_Issue as Issue, type Validation_Result as Result, Validation_run as run };
|
|
814
689
|
}
|
|
815
690
|
|
|
816
|
-
export {
|
|
691
|
+
export { index$1 as OfferStore, Client$1 as Router, RouterOffer$1 as RouterOffer, index as Utils, Validation, ValidationRule };
|