@avaprotocol/sdk-js 4.0.0-dev.1 → 4.0.0-dev.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/index.js +776 -0
- package/dist/index.mjs +775 -0
- package/dist/v4/builders/nodes.d.ts +2 -2
- package/dist/v4/builders/nodes.d.ts.map +1 -1
- package/dist/v4/index.d.ts +1 -0
- package/dist/v4/index.d.ts.map +1 -1
- package/dist/v4/index.js +1 -0
- package/dist/v4/protocols/aave-v3.d.ts +21 -0
- package/dist/v4/protocols/aave-v3.d.ts.map +1 -0
- package/dist/v4/protocols/aave-v3.js +238 -0
- package/dist/v4/protocols/aerodrome.d.ts +4 -0
- package/dist/v4/protocols/aerodrome.d.ts.map +1 -0
- package/dist/v4/protocols/aerodrome.js +9 -0
- package/dist/v4/protocols/chainlink.d.ts +7 -0
- package/dist/v4/protocols/chainlink.d.ts.map +1 -0
- package/dist/v4/protocols/chainlink.js +25 -0
- package/dist/v4/protocols/common.d.ts +16 -0
- package/dist/v4/protocols/common.d.ts.map +1 -0
- package/dist/v4/protocols/common.js +76 -0
- package/dist/v4/protocols/compound-v3.d.ts +4 -0
- package/dist/v4/protocols/compound-v3.d.ts.map +1 -0
- package/dist/v4/protocols/compound-v3.js +15 -0
- package/dist/v4/protocols/erc20.d.ts +5 -0
- package/dist/v4/protocols/erc20.d.ts.map +1 -0
- package/dist/v4/protocols/erc20.js +18 -0
- package/dist/v4/protocols/ethena.d.ts +7 -0
- package/dist/v4/protocols/ethena.d.ts.map +1 -0
- package/dist/v4/protocols/ethena.js +58 -0
- package/dist/v4/protocols/frax-ether.d.ts +7 -0
- package/dist/v4/protocols/frax-ether.d.ts.map +1 -0
- package/dist/v4/protocols/frax-ether.js +20 -0
- package/dist/v4/protocols/index.d.ts +132 -0
- package/dist/v4/protocols/index.d.ts.map +1 -0
- package/dist/v4/protocols/index.js +87 -0
- package/dist/v4/protocols/lido.d.ts +7 -0
- package/dist/v4/protocols/lido.d.ts.map +1 -0
- package/dist/v4/protocols/lido.js +44 -0
- package/dist/v4/protocols/morpho.d.ts +6 -0
- package/dist/v4/protocols/morpho.d.ts.map +1 -0
- package/dist/v4/protocols/morpho.js +89 -0
- package/dist/v4/protocols/rocket-pool.d.ts +6 -0
- package/dist/v4/protocols/rocket-pool.d.ts.map +1 -0
- package/dist/v4/protocols/rocket-pool.js +36 -0
- package/dist/v4/protocols/sky.d.ts +6 -0
- package/dist/v4/protocols/sky.d.ts.map +1 -0
- package/dist/v4/protocols/sky.js +13 -0
- package/dist/v4/protocols/spark.d.ts +4 -0
- package/dist/v4/protocols/spark.d.ts.map +1 -0
- package/dist/v4/protocols/spark.js +15 -0
- package/dist/v4/protocols/superfluid.d.ts +6 -0
- package/dist/v4/protocols/superfluid.d.ts.map +1 -0
- package/dist/v4/protocols/superfluid.js +39 -0
- package/dist/v4/protocols/types.d.ts +17 -0
- package/dist/v4/protocols/types.d.ts.map +1 -0
- package/dist/v4/protocols/types.js +1 -0
- package/dist/v4/protocols/uniswap-v3.d.ts +27 -0
- package/dist/v4/protocols/uniswap-v3.d.ts.map +1 -0
- package/dist/v4/protocols/uniswap-v3.js +197 -0
- package/dist/v4/protocols/wrapped.d.ts +6 -0
- package/dist/v4/protocols/wrapped.d.ts.map +1 -0
- package/dist/v4/protocols/wrapped.js +55 -0
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export { aaveV3 } from "./aave-v3";
|
|
2
|
+
export { aerodrome } from "./aerodrome";
|
|
3
|
+
export { chainlink } from "./chainlink";
|
|
4
|
+
export { compoundV3 } from "./compound-v3";
|
|
5
|
+
export { erc20 } from "./erc20";
|
|
6
|
+
export { ethena } from "./ethena";
|
|
7
|
+
export { fraxEther } from "./frax-ether";
|
|
8
|
+
export { lido } from "./lido";
|
|
9
|
+
export { morphoBlue } from "./morpho";
|
|
10
|
+
export { rocketPool } from "./rocket-pool";
|
|
11
|
+
export { sky } from "./sky";
|
|
12
|
+
export { spark } from "./spark";
|
|
13
|
+
export { superfluid } from "./superfluid";
|
|
14
|
+
export { uniswapV3 } from "./uniswap-v3";
|
|
15
|
+
export { wrapped } from "./wrapped";
|
|
16
|
+
export { aggregatorV3Abi, erc4626VaultAbi } from "./common";
|
|
17
|
+
export type { AbiFragment, AddressByChain } from "./types";
|
|
18
|
+
/**
|
|
19
|
+
* Namespace export so callers can do
|
|
20
|
+
* `Protocols.aaveV3.pool[Chains.Sepolia]`
|
|
21
|
+
* `Protocols.uniswapV3.swapRouter02Abi`
|
|
22
|
+
* the same way `Nodes.contractRead(...)` is namespaced.
|
|
23
|
+
*
|
|
24
|
+
* Protocol naming maps from studio's `protocolId` slug to a
|
|
25
|
+
* lowerCamelCase property:
|
|
26
|
+
* aave-v3 → aaveV3
|
|
27
|
+
* compound-v3 → compoundV3
|
|
28
|
+
* frax-ether → fraxEther
|
|
29
|
+
* morpho → morphoBlue (the singleton's product name)
|
|
30
|
+
* rocket-pool → rocketPool
|
|
31
|
+
* uniswap-v3 → uniswapV3
|
|
32
|
+
* (others) → same as slug, hyphen → camelCase
|
|
33
|
+
*/
|
|
34
|
+
export declare const Protocols: Readonly<{
|
|
35
|
+
aaveV3: Readonly<{
|
|
36
|
+
pool: Partial<Record<number, `0x${string}`>>;
|
|
37
|
+
oracle: Partial<Record<number, `0x${string}`>>;
|
|
38
|
+
wethGateway: Partial<Record<number, `0x${string}`>>;
|
|
39
|
+
eventTopics: Readonly<{
|
|
40
|
+
readonly Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61";
|
|
41
|
+
readonly Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7";
|
|
42
|
+
readonly Borrow: "0xb3d084820fb1a9decffb176436bd02558d15fac9b0ddfed8c465bc7359d7dce0";
|
|
43
|
+
readonly Repay: "0xa534c8dbe71f871f9f3530e97a74601fea17b426cae02e1c5aee42c96c784051";
|
|
44
|
+
readonly LiquidationCall: "0xe413a321e8681d831f4dbccbca790d2952b56f977908e45be37335533e005286";
|
|
45
|
+
}>;
|
|
46
|
+
poolEventsAbi: readonly import("./types").AbiFragment[];
|
|
47
|
+
poolMethodsAbi: readonly import("./types").AbiFragment[];
|
|
48
|
+
tokens: Readonly<{
|
|
49
|
+
LINK: {
|
|
50
|
+
11155111: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5";
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
54
|
+
aerodrome: Readonly<{
|
|
55
|
+
router: Partial<Record<number, `0x${string}`>>;
|
|
56
|
+
}>;
|
|
57
|
+
chainlink: Readonly<{
|
|
58
|
+
ethUsdFeed: Partial<Record<number, `0x${string}`>>;
|
|
59
|
+
btcUsdFeed: Partial<Record<number, `0x${string}`>>;
|
|
60
|
+
aggregatorV3Abi: readonly import("./types").AbiFragment[];
|
|
61
|
+
}>;
|
|
62
|
+
compoundV3: Readonly<{
|
|
63
|
+
cometUsdc: Partial<Record<number, `0x${string}`>>;
|
|
64
|
+
}>;
|
|
65
|
+
erc20: Readonly<{
|
|
66
|
+
approveAbi: readonly import("./types").AbiFragment[];
|
|
67
|
+
}>;
|
|
68
|
+
ethena: Readonly<{
|
|
69
|
+
susde: Partial<Record<number, `0x${string}`>>;
|
|
70
|
+
usde: Partial<Record<number, `0x${string}`>>;
|
|
71
|
+
susdeAbi: readonly import("./types").AbiFragment[];
|
|
72
|
+
}>;
|
|
73
|
+
fraxEther: Readonly<{
|
|
74
|
+
sfrxeth: Partial<Record<number, `0x${string}`>>;
|
|
75
|
+
frxeth: Partial<Record<number, `0x${string}`>>;
|
|
76
|
+
vaultAbi: readonly import("./types").AbiFragment[];
|
|
77
|
+
}>;
|
|
78
|
+
lido: Readonly<{
|
|
79
|
+
wsteth: Partial<Record<number, `0x${string}`>>;
|
|
80
|
+
steth: Partial<Record<number, `0x${string}`>>;
|
|
81
|
+
wstethAbi: readonly import("./types").AbiFragment[];
|
|
82
|
+
}>;
|
|
83
|
+
morphoBlue: Readonly<{
|
|
84
|
+
morpho: Partial<Record<number, `0x${string}`>>;
|
|
85
|
+
morphoAbi: readonly import("./types").AbiFragment[];
|
|
86
|
+
}>;
|
|
87
|
+
rocketPool: Readonly<{
|
|
88
|
+
reth: Partial<Record<number, `0x${string}`>>;
|
|
89
|
+
rethAbi: readonly import("./types").AbiFragment[];
|
|
90
|
+
}>;
|
|
91
|
+
sky: Readonly<{
|
|
92
|
+
sdai: Partial<Record<number, `0x${string}`>>;
|
|
93
|
+
vaultAbi: readonly import("./types").AbiFragment[];
|
|
94
|
+
}>;
|
|
95
|
+
spark: Readonly<{
|
|
96
|
+
pool: Partial<Record<number, `0x${string}`>>;
|
|
97
|
+
}>;
|
|
98
|
+
superfluid: Readonly<{
|
|
99
|
+
cfaForwarder: Partial<Record<number, `0x${string}`>>;
|
|
100
|
+
cfaForwarderAbi: readonly import("./types").AbiFragment[];
|
|
101
|
+
}>;
|
|
102
|
+
uniswapV3: Readonly<{
|
|
103
|
+
swapRouter02: Partial<Record<number, `0x${string}`>>;
|
|
104
|
+
quoterV2: Partial<Record<number, `0x${string}`>>;
|
|
105
|
+
permit2: Partial<Record<number, `0x${string}`>>;
|
|
106
|
+
factory: Partial<Record<number, `0x${string}`>>;
|
|
107
|
+
nonfungiblePositionManager: Partial<Record<number, `0x${string}`>>;
|
|
108
|
+
universalRouter: Partial<Record<number, `0x${string}`>>;
|
|
109
|
+
swapRouter02Abi: readonly import("./types").AbiFragment[];
|
|
110
|
+
quoterV2Abi: readonly import("./types").AbiFragment[];
|
|
111
|
+
factoryAbi: readonly import("./types").AbiFragment[];
|
|
112
|
+
tokens: Readonly<{
|
|
113
|
+
WETH: {
|
|
114
|
+
11155111: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14";
|
|
115
|
+
1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
|
|
116
|
+
8453: "0x4200000000000000000000000000000000000006";
|
|
117
|
+
84532: "0x4200000000000000000000000000000000000006";
|
|
118
|
+
};
|
|
119
|
+
USDC: {
|
|
120
|
+
11155111: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
|
|
121
|
+
1: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
122
|
+
8453: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
123
|
+
84532: "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
|
|
124
|
+
};
|
|
125
|
+
}>;
|
|
126
|
+
}>;
|
|
127
|
+
wrapped: Readonly<{
|
|
128
|
+
weth: Partial<Record<number, `0x${string}`>>;
|
|
129
|
+
wethAbi: readonly import("./types").AbiFragment[];
|
|
130
|
+
}>;
|
|
131
|
+
}>;
|
|
132
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkB3D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// Protocols — the data-only DeFi catalog. Per-protocol per-chain
|
|
2
|
+
// contract addresses, ABI fragments, and event-topic hashes that
|
|
3
|
+
// template authors and tests need without re-deriving or duplicating
|
|
4
|
+
// the same constants across consumers.
|
|
5
|
+
//
|
|
6
|
+
// Why this lives in the SDK:
|
|
7
|
+
// - Template e2e tests (tests/v4/templates/*.test.ts) used to
|
|
8
|
+
// hard-code the same pool / reserve / router addresses + ABIs
|
|
9
|
+
// that Studio already maintained. As more v3 templates port over,
|
|
10
|
+
// the duplication compounds.
|
|
11
|
+
// - Studio's catalog (studio/app/lib/contracts/protocols/) is
|
|
12
|
+
// currently the canonical source for richer UI metadata, but it
|
|
13
|
+
// carries UX shape (slug / label / description / KnownProtocol
|
|
14
|
+
// envelopes / ProtocolActionInput components) that pure data
|
|
15
|
+
// consumers don't need. This module ships only the static data
|
|
16
|
+
// — addresses, ABIs, topics — leaving studio's UX layer in place.
|
|
17
|
+
// - Other partner SDKs, server-side indexers, and devtools can read
|
|
18
|
+
// the same whitelist without taking a Studio dependency.
|
|
19
|
+
//
|
|
20
|
+
// Roadmap: studio's `buildWorkflowFromAction` request-builder and
|
|
21
|
+
// the UI `KnownProtocol` envelopes stay in studio for now — they
|
|
22
|
+
// ride on shapes still iterating with the v4 cutover. Studio
|
|
23
|
+
// migrates over to consume from this catalog once that lands.
|
|
24
|
+
export { aaveV3 } from "./aave-v3";
|
|
25
|
+
export { aerodrome } from "./aerodrome";
|
|
26
|
+
export { chainlink } from "./chainlink";
|
|
27
|
+
export { compoundV3 } from "./compound-v3";
|
|
28
|
+
export { erc20 } from "./erc20";
|
|
29
|
+
export { ethena } from "./ethena";
|
|
30
|
+
export { fraxEther } from "./frax-ether";
|
|
31
|
+
export { lido } from "./lido";
|
|
32
|
+
export { morphoBlue } from "./morpho";
|
|
33
|
+
export { rocketPool } from "./rocket-pool";
|
|
34
|
+
export { sky } from "./sky";
|
|
35
|
+
export { spark } from "./spark";
|
|
36
|
+
export { superfluid } from "./superfluid";
|
|
37
|
+
export { uniswapV3 } from "./uniswap-v3";
|
|
38
|
+
export { wrapped } from "./wrapped";
|
|
39
|
+
export { aggregatorV3Abi, erc4626VaultAbi } from "./common";
|
|
40
|
+
import { aaveV3 } from "./aave-v3";
|
|
41
|
+
import { aerodrome } from "./aerodrome";
|
|
42
|
+
import { chainlink } from "./chainlink";
|
|
43
|
+
import { compoundV3 } from "./compound-v3";
|
|
44
|
+
import { erc20 } from "./erc20";
|
|
45
|
+
import { ethena } from "./ethena";
|
|
46
|
+
import { fraxEther } from "./frax-ether";
|
|
47
|
+
import { lido } from "./lido";
|
|
48
|
+
import { morphoBlue } from "./morpho";
|
|
49
|
+
import { rocketPool } from "./rocket-pool";
|
|
50
|
+
import { sky } from "./sky";
|
|
51
|
+
import { spark } from "./spark";
|
|
52
|
+
import { superfluid } from "./superfluid";
|
|
53
|
+
import { uniswapV3 } from "./uniswap-v3";
|
|
54
|
+
import { wrapped } from "./wrapped";
|
|
55
|
+
/**
|
|
56
|
+
* Namespace export so callers can do
|
|
57
|
+
* `Protocols.aaveV3.pool[Chains.Sepolia]`
|
|
58
|
+
* `Protocols.uniswapV3.swapRouter02Abi`
|
|
59
|
+
* the same way `Nodes.contractRead(...)` is namespaced.
|
|
60
|
+
*
|
|
61
|
+
* Protocol naming maps from studio's `protocolId` slug to a
|
|
62
|
+
* lowerCamelCase property:
|
|
63
|
+
* aave-v3 → aaveV3
|
|
64
|
+
* compound-v3 → compoundV3
|
|
65
|
+
* frax-ether → fraxEther
|
|
66
|
+
* morpho → morphoBlue (the singleton's product name)
|
|
67
|
+
* rocket-pool → rocketPool
|
|
68
|
+
* uniswap-v3 → uniswapV3
|
|
69
|
+
* (others) → same as slug, hyphen → camelCase
|
|
70
|
+
*/
|
|
71
|
+
export const Protocols = Object.freeze({
|
|
72
|
+
aaveV3,
|
|
73
|
+
aerodrome,
|
|
74
|
+
chainlink,
|
|
75
|
+
compoundV3,
|
|
76
|
+
erc20,
|
|
77
|
+
ethena,
|
|
78
|
+
fraxEther,
|
|
79
|
+
lido,
|
|
80
|
+
morphoBlue,
|
|
81
|
+
rocketPool,
|
|
82
|
+
sky,
|
|
83
|
+
spark,
|
|
84
|
+
superfluid,
|
|
85
|
+
uniswapV3,
|
|
86
|
+
wrapped,
|
|
87
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lido.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/lido.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAuChE,eAAO,MAAM,IAAI;;;;EAIf,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Lido — stETH (L1 rebasing) + wstETH (wrapped). Wrap/unwrap only
|
|
2
|
+
// exist on the L1 wstETH contract; the Base wstETH entry is a
|
|
3
|
+
// bridged ERC-20 and supports standard ERC-20 transfers / approvals
|
|
4
|
+
// only. stETH is not bridged to Base.
|
|
5
|
+
import { Chains } from "../chains";
|
|
6
|
+
const wsteth = {
|
|
7
|
+
[Chains.EthereumMainnet]: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
|
|
8
|
+
[Chains.BaseMainnet]: "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452",
|
|
9
|
+
};
|
|
10
|
+
const steth = {
|
|
11
|
+
[Chains.EthereumMainnet]: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* wstETH wrap/unwrap + getStETHByWstETH read. L1-only — calls against
|
|
15
|
+
* the Base bridged token revert.
|
|
16
|
+
*/
|
|
17
|
+
const wstethAbi = Object.freeze([
|
|
18
|
+
{
|
|
19
|
+
inputs: [{ internalType: "uint256", name: "_stETHAmount", type: "uint256" }],
|
|
20
|
+
name: "wrap",
|
|
21
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
22
|
+
stateMutability: "nonpayable",
|
|
23
|
+
type: "function",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
inputs: [{ internalType: "uint256", name: "_wstETHAmount", type: "uint256" }],
|
|
27
|
+
name: "unwrap",
|
|
28
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
29
|
+
stateMutability: "nonpayable",
|
|
30
|
+
type: "function",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
inputs: [{ internalType: "uint256", name: "_wstETHAmount", type: "uint256" }],
|
|
34
|
+
name: "getStETHByWstETH",
|
|
35
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
36
|
+
stateMutability: "view",
|
|
37
|
+
type: "function",
|
|
38
|
+
},
|
|
39
|
+
]);
|
|
40
|
+
export const lido = Object.freeze({
|
|
41
|
+
wsteth,
|
|
42
|
+
steth,
|
|
43
|
+
wstethAbi,
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/morpho.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAmFhE,eAAO,MAAM,UAAU;;;EAGrB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Morpho Blue — permissionless lending singleton. Same address on
|
|
2
|
+
// every supported chain. Every market is addressed by a `MarketParams`
|
|
3
|
+
// tuple (loanToken, collateralToken, oracle, irm, lltv); lending calls
|
|
4
|
+
// pass that struct plus an amount in either `assets` or `shares`
|
|
5
|
+
// (one is zero).
|
|
6
|
+
import { Chains } from "../chains";
|
|
7
|
+
const morpho = {
|
|
8
|
+
[Chains.EthereumMainnet]: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
|
|
9
|
+
[Chains.BaseMainnet]: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Morpho Blue minimal write+read surface. Each write takes the full
|
|
13
|
+
* `MarketParams` tuple as the first argument; the `data` callback
|
|
14
|
+
* bytes default to `0x` in template usage.
|
|
15
|
+
*/
|
|
16
|
+
const morphoAbi = Object.freeze([
|
|
17
|
+
{
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
components: [
|
|
21
|
+
{ internalType: "address", name: "loanToken", type: "address" },
|
|
22
|
+
{ internalType: "address", name: "collateralToken", type: "address" },
|
|
23
|
+
{ internalType: "address", name: "oracle", type: "address" },
|
|
24
|
+
{ internalType: "address", name: "irm", type: "address" },
|
|
25
|
+
{ internalType: "uint256", name: "lltv", type: "uint256" },
|
|
26
|
+
],
|
|
27
|
+
internalType: "struct MarketParams",
|
|
28
|
+
name: "marketParams",
|
|
29
|
+
type: "tuple",
|
|
30
|
+
},
|
|
31
|
+
{ internalType: "uint256", name: "assets", type: "uint256" },
|
|
32
|
+
{ internalType: "uint256", name: "shares", type: "uint256" },
|
|
33
|
+
{ internalType: "address", name: "onBehalf", type: "address" },
|
|
34
|
+
{ internalType: "bytes", name: "data", type: "bytes" },
|
|
35
|
+
],
|
|
36
|
+
name: "supply",
|
|
37
|
+
outputs: [
|
|
38
|
+
{ internalType: "uint256", name: "assetsSupplied", type: "uint256" },
|
|
39
|
+
{ internalType: "uint256", name: "sharesSupplied", type: "uint256" },
|
|
40
|
+
],
|
|
41
|
+
stateMutability: "nonpayable",
|
|
42
|
+
type: "function",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
inputs: [
|
|
46
|
+
{
|
|
47
|
+
components: [
|
|
48
|
+
{ internalType: "address", name: "loanToken", type: "address" },
|
|
49
|
+
{ internalType: "address", name: "collateralToken", type: "address" },
|
|
50
|
+
{ internalType: "address", name: "oracle", type: "address" },
|
|
51
|
+
{ internalType: "address", name: "irm", type: "address" },
|
|
52
|
+
{ internalType: "uint256", name: "lltv", type: "uint256" },
|
|
53
|
+
],
|
|
54
|
+
internalType: "struct MarketParams",
|
|
55
|
+
name: "marketParams",
|
|
56
|
+
type: "tuple",
|
|
57
|
+
},
|
|
58
|
+
{ internalType: "uint256", name: "assets", type: "uint256" },
|
|
59
|
+
{ internalType: "uint256", name: "shares", type: "uint256" },
|
|
60
|
+
{ internalType: "address", name: "onBehalf", type: "address" },
|
|
61
|
+
{ internalType: "address", name: "receiver", type: "address" },
|
|
62
|
+
],
|
|
63
|
+
name: "borrow",
|
|
64
|
+
outputs: [
|
|
65
|
+
{ internalType: "uint256", name: "assetsBorrowed", type: "uint256" },
|
|
66
|
+
{ internalType: "uint256", name: "sharesBorrowed", type: "uint256" },
|
|
67
|
+
],
|
|
68
|
+
stateMutability: "nonpayable",
|
|
69
|
+
type: "function",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
inputs: [
|
|
73
|
+
{ internalType: "bytes32", name: "id", type: "bytes32" },
|
|
74
|
+
{ internalType: "address", name: "user", type: "address" },
|
|
75
|
+
],
|
|
76
|
+
name: "position",
|
|
77
|
+
outputs: [
|
|
78
|
+
{ internalType: "uint256", name: "supplyShares", type: "uint256" },
|
|
79
|
+
{ internalType: "uint128", name: "borrowShares", type: "uint128" },
|
|
80
|
+
{ internalType: "uint128", name: "collateral", type: "uint128" },
|
|
81
|
+
],
|
|
82
|
+
stateMutability: "view",
|
|
83
|
+
type: "function",
|
|
84
|
+
},
|
|
85
|
+
]);
|
|
86
|
+
export const morphoBlue = Object.freeze({
|
|
87
|
+
morpho,
|
|
88
|
+
morphoAbi,
|
|
89
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rocket-pool.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/rocket-pool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAgChE,eAAO,MAAM,UAAU;;;EAGrB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Rocket Pool — rETH liquid-staking token. L1 rETH supports burn /
|
|
2
|
+
// getExchangeRate / getEthValue; Base rETH is a bridged ERC-20 and
|
|
3
|
+
// only exposes the standard ERC-20 surface.
|
|
4
|
+
import { Chains } from "../chains";
|
|
5
|
+
const reth = {
|
|
6
|
+
[Chains.EthereumMainnet]: "0xae78736Cd615f374D3085123A210448E74Fc6393",
|
|
7
|
+
[Chains.BaseMainnet]: "0xB6fe221Fe9EeF5aBa221c348bA20A1Bf5e73624c",
|
|
8
|
+
};
|
|
9
|
+
/** L1-only `burn` + rate/value reads. */
|
|
10
|
+
const rethAbi = Object.freeze([
|
|
11
|
+
{
|
|
12
|
+
inputs: [{ internalType: "uint256", name: "_rethAmount", type: "uint256" }],
|
|
13
|
+
name: "burn",
|
|
14
|
+
outputs: [],
|
|
15
|
+
stateMutability: "nonpayable",
|
|
16
|
+
type: "function",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
inputs: [],
|
|
20
|
+
name: "getExchangeRate",
|
|
21
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
22
|
+
stateMutability: "view",
|
|
23
|
+
type: "function",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
inputs: [{ internalType: "uint256", name: "_rethAmount", type: "uint256" }],
|
|
27
|
+
name: "getEthValue",
|
|
28
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
29
|
+
stateMutability: "view",
|
|
30
|
+
type: "function",
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
export const rocketPool = Object.freeze({
|
|
34
|
+
reth,
|
|
35
|
+
rethAbi,
|
|
36
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sky.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/sky.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,GAAG;;IAEd,yDAAyD;;EAEzD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Sky Protocol (formerly MakerDAO) — sDAI savings vault. Standard
|
|
2
|
+
// ERC-4626 wrapper over the Dai Savings Rate (no cooldown), so the
|
|
3
|
+
// shared vault ABI applies cleanly.
|
|
4
|
+
import { Chains } from "../chains";
|
|
5
|
+
import { erc4626VaultAbi } from "./common";
|
|
6
|
+
const sdai = {
|
|
7
|
+
[Chains.EthereumMainnet]: "0x83F20F44975D03b1b09e64809B757c47f942BEeA",
|
|
8
|
+
};
|
|
9
|
+
export const sky = Object.freeze({
|
|
10
|
+
sdai,
|
|
11
|
+
/** Standard ERC-4626 surface — sDAI conforms exactly. */
|
|
12
|
+
vaultAbi: erc4626VaultAbi,
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spark.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/spark.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,KAAK;;EAEhB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Spark Protocol — SparkLend money market, an AAVE V3 fork.
|
|
2
|
+
//
|
|
3
|
+
// Because Spark forked AAVE V3 unchanged, the Pool contract surface
|
|
4
|
+
// is identical: `supply`, `withdraw`, `borrow`, `repay`,
|
|
5
|
+
// `setUserUseReserveAsCollateral`, `getUserAccountData` — same
|
|
6
|
+
// signatures as `Protocols.aaveV3.poolMethodsAbi`. Templates that
|
|
7
|
+
// target Spark can pass `aaveV3.poolMethodsAbi` directly; we don't
|
|
8
|
+
// re-vendor a copy. Only the addresses differ.
|
|
9
|
+
import { Chains } from "../chains";
|
|
10
|
+
const pool = {
|
|
11
|
+
[Chains.EthereumMainnet]: "0xC13e21B648A5Ee794902342038FF3aDAB66BE987",
|
|
12
|
+
};
|
|
13
|
+
export const spark = Object.freeze({
|
|
14
|
+
pool,
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superfluid.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/superfluid.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAmChE,eAAO,MAAM,UAAU;;;EAGrB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Superfluid — money streaming via the CFAv1Forwarder. Deployed at
|
|
2
|
+
// the same address on every Superfluid network (Ethereum, Base,
|
|
3
|
+
// Polygon, Optimism, ...). Flow rates are tokens-per-second as int96.
|
|
4
|
+
import { Chains } from "../chains";
|
|
5
|
+
const cfaForwarder = {
|
|
6
|
+
[Chains.EthereumMainnet]: "0xcfA132E353cB4E398080B9700609bb008eceB125",
|
|
7
|
+
[Chains.BaseMainnet]: "0xcfA132E353cB4E398080B9700609bb008eceB125",
|
|
8
|
+
};
|
|
9
|
+
/** CFAv1Forwarder minimal write surface — `setFlowrate` + `createFlow`. */
|
|
10
|
+
const cfaForwarderAbi = Object.freeze([
|
|
11
|
+
{
|
|
12
|
+
inputs: [
|
|
13
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
14
|
+
{ internalType: "address", name: "receiver", type: "address" },
|
|
15
|
+
{ internalType: "int96", name: "flowrate", type: "int96" },
|
|
16
|
+
],
|
|
17
|
+
name: "setFlowrate",
|
|
18
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
19
|
+
stateMutability: "nonpayable",
|
|
20
|
+
type: "function",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
inputs: [
|
|
24
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
25
|
+
{ internalType: "address", name: "sender", type: "address" },
|
|
26
|
+
{ internalType: "address", name: "receiver", type: "address" },
|
|
27
|
+
{ internalType: "int96", name: "flowrate", type: "int96" },
|
|
28
|
+
{ internalType: "bytes", name: "userData", type: "bytes" },
|
|
29
|
+
],
|
|
30
|
+
name: "createFlow",
|
|
31
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
32
|
+
stateMutability: "nonpayable",
|
|
33
|
+
type: "function",
|
|
34
|
+
},
|
|
35
|
+
]);
|
|
36
|
+
export const superfluid = Object.freeze({
|
|
37
|
+
cfaForwarder,
|
|
38
|
+
cfaForwarderAbi,
|
|
39
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface AbiFragment {
|
|
2
|
+
readonly name?: string;
|
|
3
|
+
readonly type: string;
|
|
4
|
+
readonly stateMutability?: string;
|
|
5
|
+
readonly anonymous?: boolean;
|
|
6
|
+
readonly inputs?: readonly unknown[];
|
|
7
|
+
readonly outputs?: readonly unknown[];
|
|
8
|
+
readonly [key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
import { type ChainId } from "../chains";
|
|
11
|
+
/**
|
|
12
|
+
* Per-chain address map. Use `ChainId` constants from `Chains.*` for
|
|
13
|
+
* the keys at the call site; `Partial` because not every protocol
|
|
14
|
+
* ships on every chain.
|
|
15
|
+
*/
|
|
16
|
+
export type AddressByChain = Partial<Record<ChainId, `0x${string}`>>;
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/types.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAMtC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AbiFragment } from "./types";
|
|
2
|
+
export declare const uniswapV3: Readonly<{
|
|
3
|
+
swapRouter02: Partial<Record<number, `0x${string}`>>;
|
|
4
|
+
quoterV2: Partial<Record<number, `0x${string}`>>;
|
|
5
|
+
permit2: Partial<Record<number, `0x${string}`>>;
|
|
6
|
+
factory: Partial<Record<number, `0x${string}`>>;
|
|
7
|
+
nonfungiblePositionManager: Partial<Record<number, `0x${string}`>>;
|
|
8
|
+
universalRouter: Partial<Record<number, `0x${string}`>>;
|
|
9
|
+
swapRouter02Abi: readonly AbiFragment[];
|
|
10
|
+
quoterV2Abi: readonly AbiFragment[];
|
|
11
|
+
factoryAbi: readonly AbiFragment[];
|
|
12
|
+
tokens: Readonly<{
|
|
13
|
+
WETH: {
|
|
14
|
+
11155111: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14";
|
|
15
|
+
1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
|
|
16
|
+
8453: "0x4200000000000000000000000000000000000006";
|
|
17
|
+
84532: "0x4200000000000000000000000000000000000006";
|
|
18
|
+
};
|
|
19
|
+
USDC: {
|
|
20
|
+
11155111: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
|
|
21
|
+
1: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
22
|
+
8453: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
23
|
+
84532: "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=uniswap-v3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniswap-v3.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/uniswap-v3.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAqLhE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC"}
|