@avaprotocol/protocols 0.1.0
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/LICENSE +21 -0
- package/README.md +164 -0
- package/dist/chains.d.ts +9 -0
- package/dist/chains.d.ts.map +1 -0
- package/dist/index.cjs +848 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +803 -0
- package/dist/protocols/aave-v3.d.ts +21 -0
- package/dist/protocols/aave-v3.d.ts.map +1 -0
- package/dist/protocols/aerodrome.d.ts +4 -0
- package/dist/protocols/aerodrome.d.ts.map +1 -0
- package/dist/protocols/chainlink.d.ts +7 -0
- package/dist/protocols/chainlink.d.ts.map +1 -0
- package/dist/protocols/common.d.ts +16 -0
- package/dist/protocols/common.d.ts.map +1 -0
- package/dist/protocols/compound-v3.d.ts +4 -0
- package/dist/protocols/compound-v3.d.ts.map +1 -0
- package/dist/protocols/erc20.d.ts +5 -0
- package/dist/protocols/erc20.d.ts.map +1 -0
- package/dist/protocols/ethena.d.ts +7 -0
- package/dist/protocols/ethena.d.ts.map +1 -0
- package/dist/protocols/frax-ether.d.ts +7 -0
- package/dist/protocols/frax-ether.d.ts.map +1 -0
- package/dist/protocols/index.d.ts +133 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/lido.d.ts +7 -0
- package/dist/protocols/lido.d.ts.map +1 -0
- package/dist/protocols/morpho.d.ts +6 -0
- package/dist/protocols/morpho.d.ts.map +1 -0
- package/dist/protocols/rocket-pool.d.ts +6 -0
- package/dist/protocols/rocket-pool.d.ts.map +1 -0
- package/dist/protocols/sky.d.ts +6 -0
- package/dist/protocols/sky.d.ts.map +1 -0
- package/dist/protocols/spark.d.ts +4 -0
- package/dist/protocols/spark.d.ts.map +1 -0
- package/dist/protocols/superfluid.d.ts +6 -0
- package/dist/protocols/superfluid.d.ts.map +1 -0
- package/dist/protocols/types.d.ts +17 -0
- package/dist/protocols/types.d.ts.map +1 -0
- package/dist/protocols/uniswap-v3.d.ts +27 -0
- package/dist/protocols/uniswap-v3.d.ts.map +1 -0
- package/dist/protocols/wrapped.d.ts +6 -0
- package/dist/protocols/wrapped.d.ts.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aave-v3.d.ts","sourceRoot":"","sources":["../../src/protocols/aave-v3.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AA2NhE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;EAQjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aerodrome.d.ts","sourceRoot":"","sources":["../../src/protocols/aerodrome.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;EAEpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainlink.d.ts","sourceRoot":"","sources":["../../src/protocols/chainlink.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,SAAS;;;IAGpB,8DAA8D;;EAE9D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compound-v3.d.ts","sourceRoot":"","sources":["../../src/protocols/compound-v3.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU;;EAErB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../src/protocols/erc20.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,KAAK;gBAYV,SAAS,WAAW,EAAE;EAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ethena.d.ts","sourceRoot":"","sources":["../../src/protocols/ethena.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAmDhE,eAAO,MAAM,MAAM;;;;EAIjB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const fraxEther: Readonly<{
|
|
2
|
+
sfrxeth: Partial<Record<number, `0x${string}`>>;
|
|
3
|
+
frxeth: Partial<Record<number, `0x${string}`>>;
|
|
4
|
+
/** Standard ERC-4626 surface — sfrxETH conforms exactly. */
|
|
5
|
+
vaultAbi: readonly import("./types").AbiFragment[];
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=frax-ether.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frax-ether.d.ts","sourceRoot":"","sources":["../../src/protocols/frax-ether.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,SAAS;;;IAGpB,4DAA4D;;EAE5D,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
* Namespaced catalog handle:
|
|
20
|
+
*
|
|
21
|
+
* import { Protocols, Chains } from "@avaprotocol/protocols";
|
|
22
|
+
* const pool = Protocols.aaveV3.pool[Chains.Sepolia];
|
|
23
|
+
* const abi = Protocols.uniswapV3.swapRouter02Abi;
|
|
24
|
+
*
|
|
25
|
+
* Protocol property naming maps each protocol's canonical slug to a
|
|
26
|
+
* lowerCamelCase property:
|
|
27
|
+
* aave-v3 → aaveV3
|
|
28
|
+
* compound-v3 → compoundV3
|
|
29
|
+
* frax-ether → fraxEther
|
|
30
|
+
* morpho → morphoBlue (the singleton's product name)
|
|
31
|
+
* rocket-pool → rocketPool
|
|
32
|
+
* uniswap-v3 → uniswapV3
|
|
33
|
+
* (others) → same as slug, hyphen → camelCase
|
|
34
|
+
*/
|
|
35
|
+
export declare const Protocols: Readonly<{
|
|
36
|
+
aaveV3: Readonly<{
|
|
37
|
+
pool: Partial<Record<number, `0x${string}`>>;
|
|
38
|
+
oracle: Partial<Record<number, `0x${string}`>>;
|
|
39
|
+
wethGateway: Partial<Record<number, `0x${string}`>>;
|
|
40
|
+
eventTopics: Readonly<{
|
|
41
|
+
readonly Supply: "0x2b627736bca15cd5381dcf80b0bf11fd197d01a037c52b927a881a10fb73ba61";
|
|
42
|
+
readonly Withdraw: "0x3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7";
|
|
43
|
+
readonly Borrow: "0xb3d084820fb1a9decffb176436bd02558d15fac9b0ddfed8c465bc7359d7dce0";
|
|
44
|
+
readonly Repay: "0xa534c8dbe71f871f9f3530e97a74601fea17b426cae02e1c5aee42c96c784051";
|
|
45
|
+
readonly LiquidationCall: "0xe413a321e8681d831f4dbccbca790d2952b56f977908e45be37335533e005286";
|
|
46
|
+
}>;
|
|
47
|
+
poolEventsAbi: readonly import("./types").AbiFragment[];
|
|
48
|
+
poolMethodsAbi: readonly import("./types").AbiFragment[];
|
|
49
|
+
tokens: Readonly<{
|
|
50
|
+
LINK: {
|
|
51
|
+
11155111: "0xf8Fb3713D459D7C1018BD0A49D19b4C44290EBE5";
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
54
|
+
}>;
|
|
55
|
+
aerodrome: Readonly<{
|
|
56
|
+
router: Partial<Record<number, `0x${string}`>>;
|
|
57
|
+
}>;
|
|
58
|
+
chainlink: Readonly<{
|
|
59
|
+
ethUsdFeed: Partial<Record<number, `0x${string}`>>;
|
|
60
|
+
btcUsdFeed: Partial<Record<number, `0x${string}`>>;
|
|
61
|
+
aggregatorV3Abi: readonly import("./types").AbiFragment[];
|
|
62
|
+
}>;
|
|
63
|
+
compoundV3: Readonly<{
|
|
64
|
+
cometUsdc: Partial<Record<number, `0x${string}`>>;
|
|
65
|
+
}>;
|
|
66
|
+
erc20: Readonly<{
|
|
67
|
+
approveAbi: readonly import("./types").AbiFragment[];
|
|
68
|
+
}>;
|
|
69
|
+
ethena: Readonly<{
|
|
70
|
+
susde: Partial<Record<number, `0x${string}`>>;
|
|
71
|
+
usde: Partial<Record<number, `0x${string}`>>;
|
|
72
|
+
susdeAbi: readonly import("./types").AbiFragment[];
|
|
73
|
+
}>;
|
|
74
|
+
fraxEther: Readonly<{
|
|
75
|
+
sfrxeth: Partial<Record<number, `0x${string}`>>;
|
|
76
|
+
frxeth: Partial<Record<number, `0x${string}`>>;
|
|
77
|
+
vaultAbi: readonly import("./types").AbiFragment[];
|
|
78
|
+
}>;
|
|
79
|
+
lido: Readonly<{
|
|
80
|
+
wsteth: Partial<Record<number, `0x${string}`>>;
|
|
81
|
+
steth: Partial<Record<number, `0x${string}`>>;
|
|
82
|
+
wstethAbi: readonly import("./types").AbiFragment[];
|
|
83
|
+
}>;
|
|
84
|
+
morphoBlue: Readonly<{
|
|
85
|
+
morpho: Partial<Record<number, `0x${string}`>>;
|
|
86
|
+
morphoAbi: readonly import("./types").AbiFragment[];
|
|
87
|
+
}>;
|
|
88
|
+
rocketPool: Readonly<{
|
|
89
|
+
reth: Partial<Record<number, `0x${string}`>>;
|
|
90
|
+
rethAbi: readonly import("./types").AbiFragment[];
|
|
91
|
+
}>;
|
|
92
|
+
sky: Readonly<{
|
|
93
|
+
sdai: Partial<Record<number, `0x${string}`>>;
|
|
94
|
+
vaultAbi: readonly import("./types").AbiFragment[];
|
|
95
|
+
}>;
|
|
96
|
+
spark: Readonly<{
|
|
97
|
+
pool: Partial<Record<number, `0x${string}`>>;
|
|
98
|
+
}>;
|
|
99
|
+
superfluid: Readonly<{
|
|
100
|
+
cfaForwarder: Partial<Record<number, `0x${string}`>>;
|
|
101
|
+
cfaForwarderAbi: readonly import("./types").AbiFragment[];
|
|
102
|
+
}>;
|
|
103
|
+
uniswapV3: Readonly<{
|
|
104
|
+
swapRouter02: Partial<Record<number, `0x${string}`>>;
|
|
105
|
+
quoterV2: Partial<Record<number, `0x${string}`>>;
|
|
106
|
+
permit2: Partial<Record<number, `0x${string}`>>;
|
|
107
|
+
factory: Partial<Record<number, `0x${string}`>>;
|
|
108
|
+
nonfungiblePositionManager: Partial<Record<number, `0x${string}`>>;
|
|
109
|
+
universalRouter: Partial<Record<number, `0x${string}`>>;
|
|
110
|
+
swapRouter02Abi: readonly import("./types").AbiFragment[];
|
|
111
|
+
quoterV2Abi: readonly import("./types").AbiFragment[];
|
|
112
|
+
factoryAbi: readonly import("./types").AbiFragment[];
|
|
113
|
+
tokens: Readonly<{
|
|
114
|
+
WETH: {
|
|
115
|
+
11155111: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14";
|
|
116
|
+
1: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
|
|
117
|
+
8453: "0x4200000000000000000000000000000000000006";
|
|
118
|
+
84532: "0x4200000000000000000000000000000000000006";
|
|
119
|
+
};
|
|
120
|
+
USDC: {
|
|
121
|
+
11155111: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
|
|
122
|
+
1: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
123
|
+
8453: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
124
|
+
84532: "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
|
|
125
|
+
};
|
|
126
|
+
}>;
|
|
127
|
+
}>;
|
|
128
|
+
wrapped: Readonly<{
|
|
129
|
+
weth: Partial<Record<number, `0x${string}`>>;
|
|
130
|
+
wethAbi: readonly import("./types").AbiFragment[];
|
|
131
|
+
}>;
|
|
132
|
+
}>;
|
|
133
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":"AAkBA,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;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lido.d.ts","sourceRoot":"","sources":["../../src/protocols/lido.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAuChE,eAAO,MAAM,IAAI;;;;EAIf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../../src/protocols/morpho.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAmFhE,eAAO,MAAM,UAAU;;;EAGrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rocket-pool.d.ts","sourceRoot":"","sources":["../../src/protocols/rocket-pool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAgChE,eAAO,MAAM,UAAU;;;EAGrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sky.d.ts","sourceRoot":"","sources":["../../src/protocols/sky.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,GAAG;;IAEd,yDAAyD;;EAEzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spark.d.ts","sourceRoot":"","sources":["../../src/protocols/spark.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,KAAK;;EAEhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superfluid.d.ts","sourceRoot":"","sources":["../../src/protocols/superfluid.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAmChE,eAAO,MAAM,UAAU;;;EAGrB,CAAC"}
|
|
@@ -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/protocols/types.ts"],"names":[],"mappings":"AAOA,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;IAKtC,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,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/protocols/uniswap-v3.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAsLhE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapped.d.ts","sourceRoot":"","sources":["../../src/protocols/wrapped.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAkDhE,eAAO,MAAM,OAAO;;;EAGlB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@avaprotocol/protocols",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Multi-chain catalog of DeFi protocol contract addresses, ABI fragments, and event topic hashes — covers AAVE V3, Uniswap V3, Chainlink, Lido, Morpho, and more.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"defi",
|
|
7
|
+
"ethereum",
|
|
8
|
+
"smart-contracts",
|
|
9
|
+
"abi",
|
|
10
|
+
"addresses",
|
|
11
|
+
"aave",
|
|
12
|
+
"uniswap",
|
|
13
|
+
"chainlink",
|
|
14
|
+
"lido",
|
|
15
|
+
"morpho",
|
|
16
|
+
"multi-chain",
|
|
17
|
+
"typescript"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/AvaProtocol/protocols#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/AvaProtocol/protocols/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/AvaProtocol/protocols.git"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"author": "Ava Protocol",
|
|
29
|
+
"type": "module",
|
|
30
|
+
"main": "./dist/index.cjs",
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js",
|
|
37
|
+
"require": "./dist/index.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"README.md",
|
|
44
|
+
"CHANGELOG.md",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build:declarations": "tsc -p tsconfig.build.json",
|
|
52
|
+
"build:js": "tsup src/index.ts --format cjs,esm --target es2020",
|
|
53
|
+
"build": "yarn clean:dist && yarn build:declarations && yarn build:js",
|
|
54
|
+
"clean": "rm -rf node_modules dist tsconfig.tsbuildinfo",
|
|
55
|
+
"clean:dist": "rm -rf dist tsconfig.tsbuildinfo",
|
|
56
|
+
"test": "vitest",
|
|
57
|
+
"test:run": "vitest run",
|
|
58
|
+
"typecheck": "tsc --noEmit",
|
|
59
|
+
"lint": "tsc --noEmit",
|
|
60
|
+
"prepublishOnly": "yarn build"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"tsup": "^8.5.0",
|
|
64
|
+
"typescript": "^5.5.4",
|
|
65
|
+
"vitest": "^1.6.0"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=18"
|
|
69
|
+
},
|
|
70
|
+
"packageManager": "yarn@1.22.19"
|
|
71
|
+
}
|