@avaprotocol/sdk-js 4.0.0-dev.2 → 4.0.0-dev.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.js +2 -773
- package/dist/index.mjs +1 -772
- package/dist/v4/protocols/index.d.ts +1 -131
- package/dist/v4/protocols/index.d.ts.map +1 -1
- package/dist/v4/protocols/index.js +11 -85
- package/package.json +2 -1
- package/dist/v4/protocols/aave-v3.d.ts +0 -21
- package/dist/v4/protocols/aave-v3.d.ts.map +0 -1
- package/dist/v4/protocols/aave-v3.js +0 -238
- package/dist/v4/protocols/aerodrome.d.ts +0 -4
- package/dist/v4/protocols/aerodrome.d.ts.map +0 -1
- package/dist/v4/protocols/aerodrome.js +0 -9
- package/dist/v4/protocols/chainlink.d.ts +0 -7
- package/dist/v4/protocols/chainlink.d.ts.map +0 -1
- package/dist/v4/protocols/chainlink.js +0 -25
- package/dist/v4/protocols/common.d.ts +0 -16
- package/dist/v4/protocols/common.d.ts.map +0 -1
- package/dist/v4/protocols/common.js +0 -76
- package/dist/v4/protocols/compound-v3.d.ts +0 -4
- package/dist/v4/protocols/compound-v3.d.ts.map +0 -1
- package/dist/v4/protocols/compound-v3.js +0 -15
- package/dist/v4/protocols/erc20.d.ts +0 -5
- package/dist/v4/protocols/erc20.d.ts.map +0 -1
- package/dist/v4/protocols/erc20.js +0 -18
- package/dist/v4/protocols/ethena.d.ts +0 -7
- package/dist/v4/protocols/ethena.d.ts.map +0 -1
- package/dist/v4/protocols/ethena.js +0 -58
- package/dist/v4/protocols/frax-ether.d.ts +0 -7
- package/dist/v4/protocols/frax-ether.d.ts.map +0 -1
- package/dist/v4/protocols/frax-ether.js +0 -20
- package/dist/v4/protocols/lido.d.ts +0 -7
- package/dist/v4/protocols/lido.d.ts.map +0 -1
- package/dist/v4/protocols/lido.js +0 -44
- package/dist/v4/protocols/morpho.d.ts +0 -6
- package/dist/v4/protocols/morpho.d.ts.map +0 -1
- package/dist/v4/protocols/morpho.js +0 -89
- package/dist/v4/protocols/rocket-pool.d.ts +0 -6
- package/dist/v4/protocols/rocket-pool.d.ts.map +0 -1
- package/dist/v4/protocols/rocket-pool.js +0 -36
- package/dist/v4/protocols/sky.d.ts +0 -6
- package/dist/v4/protocols/sky.d.ts.map +0 -1
- package/dist/v4/protocols/sky.js +0 -13
- package/dist/v4/protocols/spark.d.ts +0 -4
- package/dist/v4/protocols/spark.d.ts.map +0 -1
- package/dist/v4/protocols/spark.js +0 -15
- package/dist/v4/protocols/superfluid.d.ts +0 -6
- package/dist/v4/protocols/superfluid.d.ts.map +0 -1
- package/dist/v4/protocols/superfluid.js +0 -39
- package/dist/v4/protocols/types.d.ts +0 -17
- package/dist/v4/protocols/types.d.ts.map +0 -1
- package/dist/v4/protocols/types.js +0 -1
- package/dist/v4/protocols/uniswap-v3.d.ts +0 -27
- package/dist/v4/protocols/uniswap-v3.d.ts.map +0 -1
- package/dist/v4/protocols/uniswap-v3.js +0 -197
- package/dist/v4/protocols/wrapped.d.ts +0 -6
- package/dist/v4/protocols/wrapped.d.ts.map +0 -1
- package/dist/v4/protocols/wrapped.js +0 -55
|
@@ -1,132 +1,2 @@
|
|
|
1
|
-
export {
|
|
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
|
-
}>;
|
|
1
|
+
export { Protocols, type AbiFragment, type AddressByChain } from "@avaprotocol/protocols";
|
|
132
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,87 +1,13 @@
|
|
|
1
|
-
//
|
|
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.
|
|
1
|
+
// Protocol catalog re-export.
|
|
5
2
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
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.
|
|
3
|
+
// As of 4.0.0-dev.3 the actual address/ABI/topic data lives in the
|
|
4
|
+
// standalone `@avaprotocol/protocols` package — the SDK ships a thin
|
|
5
|
+
// re-export so consumers don't have to install a second package and
|
|
6
|
+
// the existing `import { Protocols } from "@avaprotocol/sdk-js"`
|
|
7
|
+
// surface keeps working.
|
|
19
8
|
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
export {
|
|
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
|
-
});
|
|
9
|
+
// Update `@avaprotocol/protocols` (https://github.com/AvaProtocol/protocols)
|
|
10
|
+
// when a new protocol address lands or a new chain comes online;
|
|
11
|
+
// bumping `@avaprotocol/protocols` minor version + republishing this
|
|
12
|
+
// SDK package picks it up automatically.
|
|
13
|
+
export { Protocols } from "@avaprotocol/protocols";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.3",
|
|
4
4
|
"description": "TypeScript SDK for Ava Protocol's AVS REST API (v4). Resource-grouped sub-clients, fetch transport, EIP-191 auth.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"prepare": "node ../../scripts/prepare-package.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@avaprotocol/protocols": "^0.1.0",
|
|
35
36
|
"@avaprotocol/types": "4.0.0-dev.0",
|
|
36
37
|
"dotenv": "^16.4.5",
|
|
37
38
|
"ethers": "^6.13.2"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type AbiFragment } from "./types";
|
|
2
|
-
export declare const aaveV3: Readonly<{
|
|
3
|
-
pool: Partial<Record<number, `0x${string}`>>;
|
|
4
|
-
oracle: Partial<Record<number, `0x${string}`>>;
|
|
5
|
-
wethGateway: Partial<Record<number, `0x${string}`>>;
|
|
6
|
-
eventTopics: Readonly<{
|
|
7
|
-
readonly Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61";
|
|
8
|
-
readonly Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7";
|
|
9
|
-
readonly Borrow: "0xb3d084820fb1a9decffb176436bd02558d15fac9b0ddfed8c465bc7359d7dce0";
|
|
10
|
-
readonly Repay: "0xa534c8dbe71f871f9f3530e97a74601fea17b426cae02e1c5aee42c96c784051";
|
|
11
|
-
readonly LiquidationCall: "0xe413a321e8681d831f4dbccbca790d2952b56f977908e45be37335533e005286";
|
|
12
|
-
}>;
|
|
13
|
-
poolEventsAbi: readonly AbiFragment[];
|
|
14
|
-
poolMethodsAbi: readonly AbiFragment[];
|
|
15
|
-
tokens: Readonly<{
|
|
16
|
-
LINK: {
|
|
17
|
-
11155111: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5";
|
|
18
|
-
};
|
|
19
|
-
}>;
|
|
20
|
-
}>;
|
|
21
|
-
//# sourceMappingURL=aave-v3.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aave-v3.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/aave-v3.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AA4NhE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;EAQjB,CAAC"}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
// AAVE V3 whitelist context — Pool/Oracle/wethGateway addresses per
|
|
2
|
-
// supported chain, the Pool ABI fragments (events + the read/write
|
|
3
|
-
// methods the canonical templates target), and event-topic hashes.
|
|
4
|
-
//
|
|
5
|
-
// Mirrors studio/app/lib/contracts/protocols/aave-v3.ts but in a flat,
|
|
6
|
-
// data-only shape — no UI metadata (no `slug`, `label`, `description`
|
|
7
|
-
// fields, no `KnownProtocol`/`KnownEvent` envelopes). The SDK only needs
|
|
8
|
-
// the raw whitelist context so template tests can stop hard-coding it.
|
|
9
|
-
// Studio's UI layer keeps its richer shape; both will eventually consume
|
|
10
|
-
// from the same canonical data once studio's request-builder moves over.
|
|
11
|
-
//
|
|
12
|
-
// Address parity with studio's per-chain data files:
|
|
13
|
-
// sepolia → app/lib/aave/v3/data/sepolia.json
|
|
14
|
-
// ethereum → app/lib/aave/v3/data/ethereum.json
|
|
15
|
-
// base → app/lib/aave/v3/data/base.json
|
|
16
|
-
// base-sepolia → app/lib/aave/v3/data/base-sepolia.json
|
|
17
|
-
// If those drift, update here too.
|
|
18
|
-
import { Chains } from "../chains";
|
|
19
|
-
/**
|
|
20
|
-
* AAVE V3 Pool addresses per chain. The Pool is the single entry point
|
|
21
|
-
* for supply / borrow / repay / withdraw / liquidationCall and is the
|
|
22
|
-
* contract whose events templates filter on (`Supply`, `Borrow`, etc.).
|
|
23
|
-
*/
|
|
24
|
-
const pool = {
|
|
25
|
-
[Chains.EthereumMainnet]: "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
|
|
26
|
-
[Chains.Sepolia]: "0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951",
|
|
27
|
-
[Chains.BaseMainnet]: "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
|
|
28
|
-
[Chains.BaseSepolia]: "0x8bAB6d1b75f19e9eD9fCe8b9BD338844fF79aE27",
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Aave Oracle — the price feed used by Pool to value collateral and
|
|
32
|
-
* debt. Templates that derive health-factor-equivalent metrics off
|
|
33
|
-
* chain can hit this directly to avoid a Pool round-trip.
|
|
34
|
-
*/
|
|
35
|
-
const oracle = {
|
|
36
|
-
[Chains.EthereumMainnet]: "0x54586bE62E3c3580375aE3723C145253060Ca0C2",
|
|
37
|
-
[Chains.Sepolia]: "0x2da88497588bf89281816106C7259e31AF45a663",
|
|
38
|
-
[Chains.BaseMainnet]: "0x2Cc0Fc26eD4563A5ce5e8bdcfe1A2878676Ae156",
|
|
39
|
-
[Chains.BaseSepolia]: "0x943b0dE18d4abf4eF02A85912F8fc07684C141dF",
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* WETH gateway — wraps native ETH supplies so Pool can hold WETH as
|
|
43
|
-
* the reserve. Templates that supply native ETH (rather than an
|
|
44
|
-
* already-wrapped token) go through here instead of Pool directly.
|
|
45
|
-
*/
|
|
46
|
-
const wethGateway = {
|
|
47
|
-
[Chains.EthereumMainnet]: "0xd01607c3C5eCABa394D8be377a08590149325722",
|
|
48
|
-
[Chains.Sepolia]: "0x387d311e47e80b498169e6fb51d3193167d89F7D",
|
|
49
|
-
[Chains.BaseMainnet]: "0xa0d9C1E9E48Ca30c8d8C3B5D69FF5dc1f6DFfC24",
|
|
50
|
-
[Chains.BaseSepolia]: "0x0568130e794429D2eEBC4dafE18f25Ff1a1ed8b6",
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Pre-computed keccak256 of the canonical event signatures. Cheaper
|
|
54
|
-
* than recomputing per-call and stable across deployments. Match
|
|
55
|
-
* topics[0] on `eventTrigger` queries against these.
|
|
56
|
-
*/
|
|
57
|
-
const eventTopics = Object.freeze({
|
|
58
|
-
Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61",
|
|
59
|
-
Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7",
|
|
60
|
-
Borrow: "0xb3d084820fb1a9decffb176436bd02558d15fac9b0ddfed8c465bc7359d7dce0",
|
|
61
|
-
Repay: "0xa534c8dbe71f871f9f3530e97a74601fea17b426cae02e1c5aee42c96c784051",
|
|
62
|
-
LiquidationCall: "0xe413a321e8681d831f4dbccbca790d2952b56f977908e45be37335533e005286",
|
|
63
|
-
});
|
|
64
|
-
/**
|
|
65
|
-
* Pool event ABI — Supply / Withdraw / Borrow / Repay / LiquidationCall.
|
|
66
|
-
* Used by `eventTrigger` queries to decode topic data so downstream
|
|
67
|
-
* nodes can reference `reserve`, `amount`, `onBehalfOf`, etc. by name.
|
|
68
|
-
*/
|
|
69
|
-
const poolEventsAbi = Object.freeze([
|
|
70
|
-
{
|
|
71
|
-
anonymous: false,
|
|
72
|
-
inputs: [
|
|
73
|
-
{ indexed: true, internalType: "address", name: "reserve", type: "address" },
|
|
74
|
-
{ indexed: false, internalType: "address", name: "user", type: "address" },
|
|
75
|
-
{ indexed: true, internalType: "address", name: "onBehalfOf", type: "address" },
|
|
76
|
-
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
77
|
-
{ indexed: true, internalType: "uint16", name: "referralCode", type: "uint16" },
|
|
78
|
-
],
|
|
79
|
-
name: "Supply",
|
|
80
|
-
type: "event",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
anonymous: false,
|
|
84
|
-
inputs: [
|
|
85
|
-
{ indexed: true, internalType: "address", name: "reserve", type: "address" },
|
|
86
|
-
{ indexed: true, internalType: "address", name: "user", type: "address" },
|
|
87
|
-
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
88
|
-
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
89
|
-
],
|
|
90
|
-
name: "Withdraw",
|
|
91
|
-
type: "event",
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
anonymous: false,
|
|
95
|
-
inputs: [
|
|
96
|
-
{ indexed: true, internalType: "address", name: "reserve", type: "address" },
|
|
97
|
-
{ indexed: false, internalType: "address", name: "user", type: "address" },
|
|
98
|
-
{ indexed: true, internalType: "address", name: "onBehalfOf", type: "address" },
|
|
99
|
-
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
100
|
-
{ indexed: false, internalType: "uint8", name: "interestRateMode", type: "uint8" },
|
|
101
|
-
{ indexed: false, internalType: "uint256", name: "borrowRate", type: "uint256" },
|
|
102
|
-
{ indexed: true, internalType: "uint16", name: "referralCode", type: "uint16" },
|
|
103
|
-
],
|
|
104
|
-
name: "Borrow",
|
|
105
|
-
type: "event",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
anonymous: false,
|
|
109
|
-
inputs: [
|
|
110
|
-
{ indexed: true, internalType: "address", name: "reserve", type: "address" },
|
|
111
|
-
{ indexed: true, internalType: "address", name: "user", type: "address" },
|
|
112
|
-
{ indexed: true, internalType: "address", name: "repayer", type: "address" },
|
|
113
|
-
{ indexed: false, internalType: "uint256", name: "amount", type: "uint256" },
|
|
114
|
-
{ indexed: false, internalType: "bool", name: "useATokens", type: "bool" },
|
|
115
|
-
],
|
|
116
|
-
name: "Repay",
|
|
117
|
-
type: "event",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
anonymous: false,
|
|
121
|
-
inputs: [
|
|
122
|
-
{ indexed: true, internalType: "address", name: "collateralAsset", type: "address" },
|
|
123
|
-
{ indexed: true, internalType: "address", name: "debtAsset", type: "address" },
|
|
124
|
-
{ indexed: true, internalType: "address", name: "user", type: "address" },
|
|
125
|
-
{ indexed: false, internalType: "uint256", name: "debtToCover", type: "uint256" },
|
|
126
|
-
{ indexed: false, internalType: "uint256", name: "liquidatedCollateralAmount", type: "uint256" },
|
|
127
|
-
{ indexed: false, internalType: "address", name: "liquidator", type: "address" },
|
|
128
|
-
{ indexed: false, internalType: "bool", name: "receiveAToken", type: "bool" },
|
|
129
|
-
],
|
|
130
|
-
name: "LiquidationCall",
|
|
131
|
-
type: "event",
|
|
132
|
-
},
|
|
133
|
-
]);
|
|
134
|
-
/**
|
|
135
|
-
* Pool method ABI — the read + write surface templates routinely call:
|
|
136
|
-
* `getUserAccountData` (account health), `supply`, `borrow`, `repay`,
|
|
137
|
-
* `withdraw`, and `setUserUseReserveAsCollateral`. Mirrors the
|
|
138
|
-
* `actions[]` block in studio's `aave-v3.ts` but as raw ABI so
|
|
139
|
-
* `Nodes.contractRead`/`contractWrite` can consume it directly.
|
|
140
|
-
*/
|
|
141
|
-
const poolMethodsAbi = Object.freeze([
|
|
142
|
-
{
|
|
143
|
-
inputs: [{ internalType: "address", name: "user", type: "address" }],
|
|
144
|
-
name: "getUserAccountData",
|
|
145
|
-
outputs: [
|
|
146
|
-
{ internalType: "uint256", name: "totalCollateralBase", type: "uint256" },
|
|
147
|
-
{ internalType: "uint256", name: "totalDebtBase", type: "uint256" },
|
|
148
|
-
{ internalType: "uint256", name: "availableBorrowsBase", type: "uint256" },
|
|
149
|
-
{ internalType: "uint256", name: "currentLiquidationThreshold", type: "uint256" },
|
|
150
|
-
{ internalType: "uint256", name: "ltv", type: "uint256" },
|
|
151
|
-
{ internalType: "uint256", name: "healthFactor", type: "uint256" },
|
|
152
|
-
],
|
|
153
|
-
stateMutability: "view",
|
|
154
|
-
type: "function",
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
inputs: [
|
|
158
|
-
{ internalType: "address", name: "asset", type: "address" },
|
|
159
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
160
|
-
{ internalType: "address", name: "onBehalfOf", type: "address" },
|
|
161
|
-
{ internalType: "uint16", name: "referralCode", type: "uint16" },
|
|
162
|
-
],
|
|
163
|
-
name: "supply",
|
|
164
|
-
outputs: [],
|
|
165
|
-
stateMutability: "nonpayable",
|
|
166
|
-
type: "function",
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
inputs: [
|
|
170
|
-
{ internalType: "address", name: "asset", type: "address" },
|
|
171
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
172
|
-
{ internalType: "uint256", name: "interestRateMode", type: "uint256" },
|
|
173
|
-
{ internalType: "uint16", name: "referralCode", type: "uint16" },
|
|
174
|
-
{ internalType: "address", name: "onBehalfOf", type: "address" },
|
|
175
|
-
],
|
|
176
|
-
name: "borrow",
|
|
177
|
-
outputs: [],
|
|
178
|
-
stateMutability: "nonpayable",
|
|
179
|
-
type: "function",
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
inputs: [
|
|
183
|
-
{ internalType: "address", name: "asset", type: "address" },
|
|
184
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
185
|
-
{ internalType: "uint256", name: "interestRateMode", type: "uint256" },
|
|
186
|
-
{ internalType: "address", name: "onBehalfOf", type: "address" },
|
|
187
|
-
],
|
|
188
|
-
name: "repay",
|
|
189
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
190
|
-
stateMutability: "nonpayable",
|
|
191
|
-
type: "function",
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
inputs: [
|
|
195
|
-
{ internalType: "address", name: "asset", type: "address" },
|
|
196
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
197
|
-
{ internalType: "address", name: "to", type: "address" },
|
|
198
|
-
],
|
|
199
|
-
name: "withdraw",
|
|
200
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
201
|
-
stateMutability: "nonpayable",
|
|
202
|
-
type: "function",
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
inputs: [
|
|
206
|
-
{ internalType: "address", name: "asset", type: "address" },
|
|
207
|
-
{ internalType: "bool", name: "useAsCollateral", type: "bool" },
|
|
208
|
-
],
|
|
209
|
-
name: "setUserUseReserveAsCollateral",
|
|
210
|
-
outputs: [],
|
|
211
|
-
stateMutability: "nonpayable",
|
|
212
|
-
type: "function",
|
|
213
|
-
},
|
|
214
|
-
]);
|
|
215
|
-
/**
|
|
216
|
-
* Per-chain reserve token addresses for the assets AAVE V3 markets
|
|
217
|
-
* keep available across chains. Mainly used by template tests that
|
|
218
|
-
* need a known faucet-mintable token to drive supply/borrow flows
|
|
219
|
-
* against the live testnet markets. Extend per chain as more reserves
|
|
220
|
-
* become test-relevant.
|
|
221
|
-
*
|
|
222
|
-
* NOTE: the Sepolia LINK here is AAVE's *faucet-mintable test token*
|
|
223
|
-
* wired into the Sepolia market, not mainnet ChainLink LINK.
|
|
224
|
-
*/
|
|
225
|
-
const tokens = Object.freeze({
|
|
226
|
-
LINK: {
|
|
227
|
-
[Chains.Sepolia]: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5",
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
export const aaveV3 = Object.freeze({
|
|
231
|
-
pool,
|
|
232
|
-
oracle,
|
|
233
|
-
wethGateway,
|
|
234
|
-
eventTopics,
|
|
235
|
-
poolEventsAbi,
|
|
236
|
-
poolMethodsAbi,
|
|
237
|
-
tokens,
|
|
238
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aerodrome.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/aerodrome.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;EAEpB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Aerodrome — Base-native AMM (Velodrome V2 fork). Base-only.
|
|
2
|
-
// Swaps route through `Route` hops (from, to, stable, factory).
|
|
3
|
-
import { Chains } from "../chains";
|
|
4
|
-
const router = {
|
|
5
|
-
[Chains.BaseMainnet]: "0xcF77a3Ba9A5CA399B7c97c74d54e5b1Beb874E43",
|
|
6
|
-
};
|
|
7
|
-
export const aerodrome = Object.freeze({
|
|
8
|
-
router,
|
|
9
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const chainlink: Readonly<{
|
|
2
|
-
ethUsdFeed: Partial<Record<number, `0x${string}`>>;
|
|
3
|
-
btcUsdFeed: Partial<Record<number, `0x${string}`>>;
|
|
4
|
-
/** Shared AggregatorV3 ABI — works for any Chainlink feed. */
|
|
5
|
-
aggregatorV3Abi: readonly import("./types").AbiFragment[];
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=chainlink.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chainlink.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/chainlink.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,SAAS;;;IAGpB,8DAA8D;;EAE9D,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Chainlink Data Feeds — AggregatorV3Interface price oracles.
|
|
2
|
-
//
|
|
3
|
-
// The ABI for every Chainlink Data Feed is the same (AggregatorV3
|
|
4
|
-
// Interface), so it lives in `./common.ts` as `aggregatorV3Abi` and
|
|
5
|
-
// every feed entry below reuses it. The catalog ships the ETH/USD +
|
|
6
|
-
// BTC/USD feeds Studio surfaces by default plus the Sepolia ETH/USD
|
|
7
|
-
// feed the v4 stoploss template test uses.
|
|
8
|
-
//
|
|
9
|
-
// Address verification dates: same as studio's chainlink.ts (May 2026).
|
|
10
|
-
// Extend with more feeds (LINK/USD, EUR/USD, etc.) as templates land.
|
|
11
|
-
import { Chains } from "../chains";
|
|
12
|
-
import { aggregatorV3Abi } from "./common";
|
|
13
|
-
const ethUsdFeed = {
|
|
14
|
-
[Chains.EthereumMainnet]: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
|
|
15
|
-
[Chains.Sepolia]: "0x694AA1769357215DE4FAC081bf1f309aDC325306",
|
|
16
|
-
};
|
|
17
|
-
const btcUsdFeed = {
|
|
18
|
-
[Chains.EthereumMainnet]: "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c",
|
|
19
|
-
};
|
|
20
|
-
export const chainlink = Object.freeze({
|
|
21
|
-
ethUsdFeed,
|
|
22
|
-
btcUsdFeed,
|
|
23
|
-
/** Shared AggregatorV3 ABI — works for any Chainlink feed. */
|
|
24
|
-
aggregatorV3Abi,
|
|
25
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type AbiFragment } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Chainlink AggregatorV3Interface — `latestRoundData` and `decimals`.
|
|
4
|
-
* Every Chainlink Data Feed contract implements this, so the same ABI
|
|
5
|
-
* works for ETH/USD, BTC/USD, LINK/USD, etc.
|
|
6
|
-
*/
|
|
7
|
-
export declare const aggregatorV3Abi: readonly AbiFragment[];
|
|
8
|
-
/**
|
|
9
|
-
* Minimal ERC-4626 vault ABI — `deposit`, `redeem`, `previewRedeem`,
|
|
10
|
-
* `convertToAssets`. Sufficient for staking vault templates that wrap
|
|
11
|
-
* an underlying into a yield-bearing share token (sfrxETH, sDAI, etc.).
|
|
12
|
-
* Vaults with non-standard write paths (e.g. sUSDe's cooldown +
|
|
13
|
-
* unstake) ship their own ABI in their own protocol module.
|
|
14
|
-
*/
|
|
15
|
-
export declare const erc4626VaultAbi: readonly AbiFragment[];
|
|
16
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/common.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EAqBhD,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,WAAW,EAoChD,CAAC"}
|