@1delta/margin-fetcher 0.0.250 → 0.0.251
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.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +370 -7
- package/dist/index.js.map +1 -1
- package/dist/lending/index.d.ts +1 -1
- package/dist/lending/index.d.ts.map +1 -1
- package/dist/lending/user-data/morpho/fetchUserPositionsFromSubgraph.d.ts +44 -0
- package/dist/lending/user-data/morpho/fetchUserPositionsFromSubgraph.d.ts.map +1 -0
- package/dist/lending/user-data/morpho/index.d.ts +1 -0
- package/dist/lending/user-data/morpho/index.d.ts.map +1 -1
- package/dist/lending/user-data/with-permissions/types.d.ts +6 -0
- package/dist/lending/user-data/with-permissions/types.d.ts.map +1 -1
- package/dist/vaults/fetchVaultsAll.d.ts +56 -0
- package/dist/vaults/fetchVaultsAll.d.ts.map +1 -0
- package/dist/vaults/index.d.ts +1 -0
- package/dist/vaults/index.d.ts.map +1 -1
- package/package.json +4 -3
package/dist/lending/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { getLenderPublicData, getMorphoTypeMarketConverter, } from './public-data/fetchLender';
|
|
2
2
|
export { getLenderPublicDataViaApi } from './public-data/fetchLenderExt';
|
|
3
3
|
export { getLenderPublicDataAll } from './public-data/fetchLenderAll';
|
|
4
|
-
export { getLenderUserDataResult, convertLenderUserDataResult, prepareLenderUserDataRpcCalls, type PreparedUserDataRpcCalls, prepareMergedRpcCalls, parseMergedResult, type PreparedMergedRpcCalls, type MergedUserData, type PermissionParams, prepareMergedMulticallParams, type PreparedMergedMulticallParams, getMergedUserData, needsLenderApproval, needsTokenApproval, type TokenApprovalParams, type TokenApprovalMeta, getLenderUserDataMulti, type ChainQuery, type ProviderOptions, type BaseLendingPosition, type BasicReserveResponse, type AprData, type BalanceData, type UserConfig, type UserData, MORPHO_LENS, buildMorphoTypeUserCallWithLens, decodePackedMorphoUserDataset, decodePackedListaUserDataset, buildSummaries, buildPortfolioTotals, fuseLenderData, filterActiveLenders, type PortfolioTotals, type PortfolioSummary, type LenderSummary, type LenderDataEntry, type ChainSummary, type SubAccountSummary, type SummaryBalanceData, type SummaryAprData, type UserDataResult, calculateWeightedAverage, calculateNetApr, calculateLeverage, calculateOverallNetApr, getBalanceForMarketUid, } from './user-data';
|
|
4
|
+
export { getLenderUserDataResult, convertLenderUserDataResult, prepareLenderUserDataRpcCalls, type PreparedUserDataRpcCalls, prepareMergedRpcCalls, parseMergedResult, type PreparedMergedRpcCalls, type MergedUserData, type PermissionParams, prepareMergedMulticallParams, type PreparedMergedMulticallParams, getMergedUserData, needsLenderApproval, needsTokenApproval, type TokenApprovalParams, type TokenApprovalMeta, getLenderUserDataMulti, type ChainQuery, type ProviderOptions, type BaseLendingPosition, type BasicReserveResponse, type AprData, type BalanceData, type UserConfig, type UserData, MORPHO_LENS, buildMorphoTypeUserCallWithLens, decodePackedMorphoUserDataset, decodePackedListaUserDataset, fetchMorphoUserPositionMarkets, fetchMorphoUserBalances, hasMorphoUserSubgraph, hasMorphoUserApi, hasMorphoPositionIndex, type MorphoSubgraphProxyConfig, type MorphoUserMarketBalance, buildSummaries, buildPortfolioTotals, fuseLenderData, filterActiveLenders, type PortfolioTotals, type PortfolioSummary, type LenderSummary, type LenderDataEntry, type ChainSummary, type SubAccountSummary, type SummaryBalanceData, type SummaryAprData, type UserDataResult, calculateWeightedAverage, calculateNetApr, calculateLeverage, calculateOverallNetApr, getBalanceForMarketUid, } from './user-data';
|
|
5
5
|
export { decodeMarkets, decodeListaMarkets, normalizeToBytes, buildMorphoTypeCall, } from './public-data/morpho';
|
|
6
6
|
export * from './margin/base';
|
|
7
7
|
export * from './margin/loop';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lending/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,KAAK,6BAA6B,EAClC,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,WAAW,EACX,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAE5B,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EAEnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EAEnB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,sBAAsB,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lending/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,2BAA2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
+
import { type RelayProxyConfig } from '@1delta/proxy-fetch';
|
|
2
|
+
/**
|
|
3
|
+
* Back-compat alias. New callers should use `RelayProxyConfig` directly from
|
|
4
|
+
* `@1delta/proxy-fetch`.
|
|
5
|
+
*/
|
|
6
|
+
export type MorphoSubgraphProxyConfig = RelayProxyConfig;
|
|
7
|
+
export interface MorphoUserMarketBalance {
|
|
8
|
+
/** 0x-prefixed lowercase 66-char market key */
|
|
9
|
+
marketId: string;
|
|
10
|
+
/** Raw supply shares as decimal string */
|
|
11
|
+
supplyShares: string;
|
|
12
|
+
/** Raw borrow shares as decimal string */
|
|
13
|
+
borrowShares: string;
|
|
14
|
+
/** Raw collateral amount as decimal string */
|
|
15
|
+
collateral: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function hasMorphoUserSubgraph(chainId: string): boolean;
|
|
18
|
+
export declare function hasMorphoUserApi(chainId: string): boolean;
|
|
19
|
+
export declare function hasMorphoPositionIndex(chainId: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Fetches per-market balance data (supply shares, borrow shares, collateral)
|
|
22
|
+
* for all markets where the account has active positions. Queries the Goldsky
|
|
23
|
+
* subgraph or the Morpho Blue API depending on the chain.
|
|
24
|
+
*
|
|
25
|
+
* Returns undefined when the chain has no index OR the request fails (timeout,
|
|
26
|
+
* non-2xx, etc.) — caller should fall back to querying all markets on-chain.
|
|
27
|
+
* Returns an empty array when the account has no positions on that chain.
|
|
28
|
+
*
|
|
29
|
+
* Concurrent callers for the same (chainId, account) share a single upstream
|
|
30
|
+
* request, and results are memoized for a short window (see `CACHE_TTL_MS`).
|
|
31
|
+
*/
|
|
32
|
+
export declare function fetchMorphoUserBalances(chainId: string, account: string, proxyConfig?: RelayProxyConfig): Promise<MorphoUserMarketBalance[] | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* Convenience wrapper — returns only the set of market IDs where the account
|
|
35
|
+
* has active positions. Use `fetchMorphoUserBalances` when you also need the
|
|
36
|
+
* shares/collateral amounts.
|
|
37
|
+
*/
|
|
38
|
+
export declare function fetchMorphoUserPositionMarkets(chainId: string, account: string, proxyConfig?: RelayProxyConfig): Promise<Set<string> | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Test-only helper: drops the in-memory cache so assertions don't interact
|
|
41
|
+
* across tests. Safe to call at runtime, just wastes the next upstream call.
|
|
42
|
+
*/
|
|
43
|
+
export declare function __clearMorphoPositionCacheForTests(): void;
|
|
44
|
+
//# sourceMappingURL=fetchUserPositionsFromSubgraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchUserPositionsFromSubgraph.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/morpho/fetchUserPositionsFromSubgraph.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAA;AAE5B;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,CAAA;AAExD,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAA;CACnB;AA4ND,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,gBAAgB,GAC7B,OAAO,CAAC,uBAAuB,EAAE,GAAG,SAAS,CAAC,CAYhD;AAED;;;;GAIG;AACH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,gBAAgB,GAC7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAIlC;AA4FD;;;GAGG;AACH,wBAAgB,kCAAkC,IAAI,IAAI,CAGzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/morpho/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/morpho/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kCAAkC,CAAA"}
|
|
@@ -17,6 +17,12 @@ export interface PermissionParams {
|
|
|
17
17
|
};
|
|
18
18
|
/** Silo: withdraw from protected (non-borrowable) collateral share token */
|
|
19
19
|
siloIsProtected?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Gearbox V3: BotListV3 contract address (resolved from
|
|
22
|
+
* `AddressProviderV310`). Required when any lender is GEARBOX_V3 — passed
|
|
23
|
+
* through to `prepareLenderDebitMulticall`.
|
|
24
|
+
*/
|
|
25
|
+
gearboxBotList?: string;
|
|
20
26
|
}
|
|
21
27
|
export interface PermissionMeta {
|
|
22
28
|
chainId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lending/user-data/with-permissions/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ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C3B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,cAAc,EAAE,cAAc,CAAA;IAC9B,cAAc,EAAE,eAAe,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,6BAA6B;IAC5C,qFAAqF;IACrF,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,+CAA+C;IAC/C,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,yDAAyD;IACzD,sBAAsB,EAAE,MAAM,CAAA;IAC9B,6DAA6D;IAC7D,mBAAmB,EAAE,MAAM,CAAA;IAC3B,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,cAAc,EAAE,cAAc,CAAA;IAC9B,cAAc,EAAE,eAAe,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACzC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC5C,QAAQ,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAA;CACzC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MulticallRetryFunction } from '../types';
|
|
2
|
+
import { GenericTokenList } from '../types/general';
|
|
3
|
+
import type { FluidFTokens } from './fluid/types';
|
|
4
|
+
import type { GearboxV3Pools } from './gearbox/types';
|
|
5
|
+
import type { MorphoVaults } from './morpho/types';
|
|
6
|
+
import type { SiloVaults } from './silo/types';
|
|
7
|
+
/** Supported ERC-4626 vault providers. */
|
|
8
|
+
export type VaultProvider = 'fluid' | 'gearbox' | 'morpho' | 'silo';
|
|
9
|
+
/**
|
|
10
|
+
* Per-provider payload returned by `getVaultPublicDataAll`. Each entry is
|
|
11
|
+
* present only when the matching provider was requested AND its fetch
|
|
12
|
+
* resolved (not when the chain has no deployment — those return an empty
|
|
13
|
+
* map, which is still recorded here).
|
|
14
|
+
*/
|
|
15
|
+
export interface VaultPublicDataAll {
|
|
16
|
+
fluid?: FluidFTokens;
|
|
17
|
+
gearbox?: GearboxV3Pools;
|
|
18
|
+
morpho?: MorphoVaults;
|
|
19
|
+
silo?: SiloVaults;
|
|
20
|
+
}
|
|
21
|
+
export interface GetVaultPublicDataAllOptions {
|
|
22
|
+
/** Narrow Silo to a single protocol version (`v2` or `v3`). */
|
|
23
|
+
siloProtocolVersion?: 'v2' | 'v3';
|
|
24
|
+
/** Page size hint for Silo's GraphQL query. */
|
|
25
|
+
siloLimit?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Universal vault fetcher — the vaults-side analogue of
|
|
29
|
+
* `getLenderPublicDataAll`.
|
|
30
|
+
*
|
|
31
|
+
* Dispatches each requested provider to its dedicated fetcher and runs
|
|
32
|
+
* them concurrently. Sources are mixed (Fluid + Gearbox use multicall;
|
|
33
|
+
* Morpho + Silo are HTTP GraphQL), so there's no API-vs-on-chain split
|
|
34
|
+
* like the lender path — every provider runs in parallel and a single
|
|
35
|
+
* provider's failure does not sink the others.
|
|
36
|
+
*
|
|
37
|
+
* @param chainId target chain
|
|
38
|
+
* @param providers which providers to fetch (any subset of
|
|
39
|
+
* `'fluid' | 'gearbox' | 'morpho' | 'silo'`)
|
|
40
|
+
* @param multicallRetry provider-level multicall executor — used by
|
|
41
|
+
* Fluid and Gearbox; ignored when only HTTP
|
|
42
|
+
* providers are requested
|
|
43
|
+
* @param prices optional price map keyed by oracle key /
|
|
44
|
+
* underlying address
|
|
45
|
+
* @param tokenList optional token list for hydrating `asset`
|
|
46
|
+
* metadata on each parsed vault
|
|
47
|
+
* @param options provider-specific knobs (Silo version filter, …)
|
|
48
|
+
*
|
|
49
|
+
* @returns `VaultPublicDataAll` — one key per requested provider that
|
|
50
|
+
* resolved successfully; failed providers are omitted (and
|
|
51
|
+
* logged when `VAULTS_DEBUG` is on).
|
|
52
|
+
*/
|
|
53
|
+
export declare const getVaultPublicDataAll: (chainId: string, providers: VaultProvider[], multicallRetry: MulticallRetryFunction, prices?: {
|
|
54
|
+
[asset: string]: number;
|
|
55
|
+
}, tokenList?: GenericTokenList, options?: GetVaultPublicDataAllOptions) => Promise<VaultPublicDataAll>;
|
|
56
|
+
//# sourceMappingURL=fetchVaultsAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchVaultsAll.d.ts","sourceRoot":"","sources":["../../src/vaults/fetchVaultsAll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAKnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAS9C,0CAA0C;AAC1C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,MAAM,WAAW,4BAA4B;IAC3C,+DAA+D;IAC/D,mBAAmB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACjC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAS,MAAM,EACf,WAAW,aAAa,EAAE,EAC1B,gBAAgB,sBAAsB,EACtC,SAAQ;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAAO,EACxC,YAAW,gBAAqB,EAChC,UAAU,4BAA4B,KACrC,OAAO,CAAC,kBAAkB,CAwE5B,CAAA"}
|
package/dist/vaults/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export * from './fluid';
|
|
|
2
2
|
export * from './gearbox';
|
|
3
3
|
export * from './morpho';
|
|
4
4
|
export * from './silo';
|
|
5
|
+
export { getVaultPublicDataAll, type VaultProvider, type VaultPublicDataAll, type GetVaultPublicDataAllOptions, } from './fetchVaultsAll';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vaults/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vaults/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,OAAO,EACL,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,GAClC,MAAM,kBAAkB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1delta/margin-fetcher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.251",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,10 +23,11 @@
|
|
|
23
23
|
"async-retry": "^1.3.3",
|
|
24
24
|
"lodash": "^4.17.23",
|
|
25
25
|
"@1delta/abis": "0.0.15",
|
|
26
|
+
"@1delta/lender-registry": "0.0.26",
|
|
26
27
|
"@1delta/dex-registry": "0.0.99",
|
|
27
28
|
"@1delta/calldata-sdk": "0.0.146",
|
|
28
|
-
"@1delta/
|
|
29
|
-
"@1delta/
|
|
29
|
+
"@1delta/proxy-fetch": "0.0.1",
|
|
30
|
+
"@1delta/providers": "0.0.58"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/async-retry": "^1.4.9",
|