@avaprotocol/sdk-js 4.0.0-dev.0 → 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.
Files changed (90) hide show
  1. package/dist/index.js +874 -14
  2. package/dist/index.mjs +873 -14
  3. package/dist/v4/builders/nodes.d.ts +5 -2
  4. package/dist/v4/builders/nodes.d.ts.map +1 -1
  5. package/dist/v4/builders/nodes.js +1 -0
  6. package/dist/v4/index.d.ts +1 -0
  7. package/dist/v4/index.d.ts.map +1 -1
  8. package/dist/v4/index.js +1 -0
  9. package/dist/v4/protocols/aave-v3.d.ts +21 -0
  10. package/dist/v4/protocols/aave-v3.d.ts.map +1 -0
  11. package/dist/v4/protocols/aave-v3.js +238 -0
  12. package/dist/v4/protocols/aerodrome.d.ts +4 -0
  13. package/dist/v4/protocols/aerodrome.d.ts.map +1 -0
  14. package/dist/v4/protocols/aerodrome.js +9 -0
  15. package/dist/v4/protocols/chainlink.d.ts +7 -0
  16. package/dist/v4/protocols/chainlink.d.ts.map +1 -0
  17. package/dist/v4/protocols/chainlink.js +25 -0
  18. package/dist/v4/protocols/common.d.ts +16 -0
  19. package/dist/v4/protocols/common.d.ts.map +1 -0
  20. package/dist/v4/protocols/common.js +76 -0
  21. package/dist/v4/protocols/compound-v3.d.ts +4 -0
  22. package/dist/v4/protocols/compound-v3.d.ts.map +1 -0
  23. package/dist/v4/protocols/compound-v3.js +15 -0
  24. package/dist/v4/protocols/erc20.d.ts +5 -0
  25. package/dist/v4/protocols/erc20.d.ts.map +1 -0
  26. package/dist/v4/protocols/erc20.js +18 -0
  27. package/dist/v4/protocols/ethena.d.ts +7 -0
  28. package/dist/v4/protocols/ethena.d.ts.map +1 -0
  29. package/dist/v4/protocols/ethena.js +58 -0
  30. package/dist/v4/protocols/frax-ether.d.ts +7 -0
  31. package/dist/v4/protocols/frax-ether.d.ts.map +1 -0
  32. package/dist/v4/protocols/frax-ether.js +20 -0
  33. package/dist/v4/protocols/index.d.ts +132 -0
  34. package/dist/v4/protocols/index.d.ts.map +1 -0
  35. package/dist/v4/protocols/index.js +87 -0
  36. package/dist/v4/protocols/lido.d.ts +7 -0
  37. package/dist/v4/protocols/lido.d.ts.map +1 -0
  38. package/dist/v4/protocols/lido.js +44 -0
  39. package/dist/v4/protocols/morpho.d.ts +6 -0
  40. package/dist/v4/protocols/morpho.d.ts.map +1 -0
  41. package/dist/v4/protocols/morpho.js +89 -0
  42. package/dist/v4/protocols/rocket-pool.d.ts +6 -0
  43. package/dist/v4/protocols/rocket-pool.d.ts.map +1 -0
  44. package/dist/v4/protocols/rocket-pool.js +36 -0
  45. package/dist/v4/protocols/sky.d.ts +6 -0
  46. package/dist/v4/protocols/sky.d.ts.map +1 -0
  47. package/dist/v4/protocols/sky.js +13 -0
  48. package/dist/v4/protocols/spark.d.ts +4 -0
  49. package/dist/v4/protocols/spark.d.ts.map +1 -0
  50. package/dist/v4/protocols/spark.js +15 -0
  51. package/dist/v4/protocols/superfluid.d.ts +6 -0
  52. package/dist/v4/protocols/superfluid.d.ts.map +1 -0
  53. package/dist/v4/protocols/superfluid.js +39 -0
  54. package/dist/v4/protocols/types.d.ts +17 -0
  55. package/dist/v4/protocols/types.d.ts.map +1 -0
  56. package/dist/v4/protocols/types.js +1 -0
  57. package/dist/v4/protocols/uniswap-v3.d.ts +27 -0
  58. package/dist/v4/protocols/uniswap-v3.d.ts.map +1 -0
  59. package/dist/v4/protocols/uniswap-v3.js +197 -0
  60. package/dist/v4/protocols/wrapped.d.ts +6 -0
  61. package/dist/v4/protocols/wrapped.d.ts.map +1 -0
  62. package/dist/v4/protocols/wrapped.js +55 -0
  63. package/dist/v4/resources/executions.d.ts +6 -0
  64. package/dist/v4/resources/executions.d.ts.map +1 -1
  65. package/dist/v4/resources/executions.js +6 -0
  66. package/dist/v4/resources/health.d.ts +11 -1
  67. package/dist/v4/resources/health.d.ts.map +1 -1
  68. package/dist/v4/resources/health.js +11 -1
  69. package/dist/v4/resources/nodes.d.ts +21 -1
  70. package/dist/v4/resources/nodes.d.ts.map +1 -1
  71. package/dist/v4/resources/nodes.js +21 -1
  72. package/dist/v4/resources/operators.d.ts +15 -1
  73. package/dist/v4/resources/operators.d.ts.map +1 -1
  74. package/dist/v4/resources/operators.js +15 -1
  75. package/dist/v4/resources/secrets.d.ts +10 -0
  76. package/dist/v4/resources/secrets.d.ts.map +1 -1
  77. package/dist/v4/resources/secrets.js +10 -0
  78. package/dist/v4/resources/tokens.d.ts +16 -4
  79. package/dist/v4/resources/tokens.d.ts.map +1 -1
  80. package/dist/v4/resources/tokens.js +16 -4
  81. package/dist/v4/resources/triggers.d.ts +21 -1
  82. package/dist/v4/resources/triggers.d.ts.map +1 -1
  83. package/dist/v4/resources/triggers.js +21 -1
  84. package/dist/v4/resources/wallets.d.ts +53 -6
  85. package/dist/v4/resources/wallets.d.ts.map +1 -1
  86. package/dist/v4/resources/wallets.js +53 -6
  87. package/dist/v4/resources/workflows.d.ts +10 -0
  88. package/dist/v4/resources/workflows.d.ts.map +1 -1
  89. package/dist/v4/resources/workflows.js +10 -0
  90. package/package.json +7 -2
@@ -21,7 +21,7 @@ export declare const Nodes: Readonly<{
21
21
  id: string;
22
22
  name: string;
23
23
  contractAddress: string;
24
- contractAbi?: Array<Record<string, unknown>>;
24
+ contractAbi?: ReadonlyArray<Record<string, unknown>>;
25
25
  methodCalls?: Array<{
26
26
  methodName: string;
27
27
  methodParams?: string[];
@@ -38,7 +38,7 @@ export declare const Nodes: Readonly<{
38
38
  id: string;
39
39
  name: string;
40
40
  contractAddress: string;
41
- contractAbi?: Array<Record<string, unknown>>;
41
+ contractAbi?: ReadonlyArray<Record<string, unknown>>;
42
42
  methodCalls?: Array<{
43
43
  methodName: string;
44
44
  methodParams?: string[];
@@ -61,6 +61,9 @@ export declare const Nodes: Readonly<{
61
61
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
62
62
  body?: string;
63
63
  headers?: Record<string, string>;
64
+ options?: {
65
+ summarize?: boolean;
66
+ };
64
67
  }): v4.Node;
65
68
  branch(opts: {
66
69
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/v4/builders/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK;sBACE;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,EAAE,CAAC,IAAI;wBAaS;QAClB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,WAAW,CAAC,EAAE,KAAK,CAAC;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;YACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;SAC1B,CAAC,CAAC;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,EAAE,CAAC,IAAI;uBAkBQ;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;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KAC3B,GAAG,EAAE,CAAC,IAAI;EAcX,CAAC"}
@@ -73,6 +73,7 @@ export const Nodes = Object.freeze({
73
73
  method: opts.method,
74
74
  ...(opts.body ? { body: opts.body } : {}),
75
75
  ...(opts.headers ? { headers: opts.headers } : {}),
76
+ ...(opts.options ? { options: opts.options } : {}),
76
77
  },
77
78
  };
78
79
  },
@@ -2,6 +2,7 @@ export { Client, type ClientOptions } from "./client";
2
2
  export { Chains, type ChainId } from "./chains";
3
3
  export { Triggers } from "./builders/triggers";
4
4
  export { Nodes } from "./builders/nodes";
5
+ export { Protocols, type AbiFragment, type AddressByChain } from "./protocols";
5
6
  export { buildAuthMessage, signAuthMessage, AUTH_TEMPLATE, type BuildAuthMessageInput, type BuiltAuthMessage, } from "./auth";
6
7
  export { APIError, NetworkError, AuthRequiredError } from "./internal/errors";
7
8
  export { AuthResource } from "./resources/auth";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v4/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK9E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE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AuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI1D,YAAY,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/v4/index.js CHANGED
@@ -6,6 +6,7 @@ export { Client } from "./client";
6
6
  export { Chains } from "./chains";
7
7
  export { Triggers } from "./builders/triggers";
8
8
  export { Nodes } from "./builders/nodes";
9
+ export { Protocols } from "./protocols";
9
10
  export { buildAuthMessage, signAuthMessage, AUTH_TEMPLATE, } from "./auth";
10
11
  export { APIError, NetworkError, AuthRequiredError } from "./internal/errors";
11
12
  // Resource classes are exported in case advanced consumers want to
@@ -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/v4/protocols/aave-v3.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AA4NhE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;EAQjB,CAAC"}
@@ -0,0 +1,238 @@
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
+ });
@@ -0,0 +1,4 @@
1
+ export declare const aerodrome: Readonly<{
2
+ router: Partial<Record<number, `0x${string}`>>;
3
+ }>;
4
+ //# sourceMappingURL=aerodrome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aerodrome.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/aerodrome.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;EAEpB,CAAC"}
@@ -0,0 +1,9 @@
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
+ });
@@ -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/v4/protocols/chainlink.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,SAAS;;;IAGpB,8DAA8D;;EAE9D,CAAC"}
@@ -0,0 +1,25 @@
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
+ });
@@ -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/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"}
@@ -0,0 +1,76 @@
1
+ // Shared ABI fragments that more than one protocol routinely reuses:
2
+ // - AggregatorV3Interface for any Chainlink-compatible price feed
3
+ // - ERC-4626 deposit/redeem for staking vaults (sUSDe, sfrxETH, sDAI, ...)
4
+ // - ERC-20 approve already lives in `./erc20.ts` — keep that import path
5
+ // stable since it's the most-touched fragment in the catalog.
6
+ /**
7
+ * Chainlink AggregatorV3Interface — `latestRoundData` and `decimals`.
8
+ * Every Chainlink Data Feed contract implements this, so the same ABI
9
+ * works for ETH/USD, BTC/USD, LINK/USD, etc.
10
+ */
11
+ export const aggregatorV3Abi = Object.freeze([
12
+ {
13
+ inputs: [],
14
+ name: "latestRoundData",
15
+ outputs: [
16
+ { internalType: "uint80", name: "roundId", type: "uint80" },
17
+ { internalType: "int256", name: "answer", type: "int256" },
18
+ { internalType: "uint256", name: "startedAt", type: "uint256" },
19
+ { internalType: "uint256", name: "updatedAt", type: "uint256" },
20
+ { internalType: "uint80", name: "answeredInRound", type: "uint80" },
21
+ ],
22
+ stateMutability: "view",
23
+ type: "function",
24
+ },
25
+ {
26
+ inputs: [],
27
+ name: "decimals",
28
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
29
+ stateMutability: "view",
30
+ type: "function",
31
+ },
32
+ ]);
33
+ /**
34
+ * Minimal ERC-4626 vault ABI — `deposit`, `redeem`, `previewRedeem`,
35
+ * `convertToAssets`. Sufficient for staking vault templates that wrap
36
+ * an underlying into a yield-bearing share token (sfrxETH, sDAI, etc.).
37
+ * Vaults with non-standard write paths (e.g. sUSDe's cooldown +
38
+ * unstake) ship their own ABI in their own protocol module.
39
+ */
40
+ export const erc4626VaultAbi = Object.freeze([
41
+ {
42
+ inputs: [
43
+ { internalType: "uint256", name: "assets", type: "uint256" },
44
+ { internalType: "address", name: "receiver", type: "address" },
45
+ ],
46
+ name: "deposit",
47
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
48
+ stateMutability: "nonpayable",
49
+ type: "function",
50
+ },
51
+ {
52
+ inputs: [
53
+ { internalType: "uint256", name: "shares", type: "uint256" },
54
+ { internalType: "address", name: "receiver", type: "address" },
55
+ { internalType: "address", name: "owner", type: "address" },
56
+ ],
57
+ name: "redeem",
58
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
59
+ stateMutability: "nonpayable",
60
+ type: "function",
61
+ },
62
+ {
63
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
64
+ name: "previewRedeem",
65
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
66
+ stateMutability: "view",
67
+ type: "function",
68
+ },
69
+ {
70
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
71
+ name: "convertToAssets",
72
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
73
+ stateMutability: "view",
74
+ type: "function",
75
+ },
76
+ ]);
@@ -0,0 +1,4 @@
1
+ export declare const compoundV3: Readonly<{
2
+ cometUsdc: Partial<Record<number, `0x${string}`>>;
3
+ }>;
4
+ //# sourceMappingURL=compound-v3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compound-v3.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/compound-v3.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU;;EAErB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Compound V3 (Comet) — USDC base market.
2
+ //
3
+ // Comet bundles supply/borrow on a single contract: `supply` /
4
+ // `withdraw` move the base asset (USDC, 6 decimals) or collateral;
5
+ // `withdraw` past zero opens a borrow.
6
+ //
7
+ // Address parity with studio/app/lib/contracts/protocols/compound-v3.ts.
8
+ import { Chains } from "../chains";
9
+ const cometUsdc = {
10
+ [Chains.EthereumMainnet]: "0xc3d688B66703497DAA19211EEdff47f25384cdc3",
11
+ [Chains.BaseMainnet]: "0xb125E6687d4313864e53df431d5425969c15Eb2F",
12
+ };
13
+ export const compoundV3 = Object.freeze({
14
+ cometUsdc,
15
+ });
@@ -0,0 +1,5 @@
1
+ import { type AbiFragment } from "./types";
2
+ export declare const erc20: Readonly<{
3
+ approveAbi: readonly AbiFragment[];
4
+ }>;
5
+ //# sourceMappingURL=erc20.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../../src/v4/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,18 @@
1
+ // Minimal ERC-20 ABI fragments that templates routinely need but don't
2
+ // belong to any one protocol. `approveAbi` is the standard 2-arg ERC-20
3
+ // approve — used by any DeFi flow that funnels tokens through a protocol's
4
+ // pool/router (AAVE.supply, Uniswap.swap, etc.).
5
+ export const erc20 = Object.freeze({
6
+ approveAbi: Object.freeze([
7
+ {
8
+ inputs: [
9
+ { internalType: "address", name: "spender", type: "address" },
10
+ { internalType: "uint256", name: "amount", type: "uint256" },
11
+ ],
12
+ name: "approve",
13
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
14
+ stateMutability: "nonpayable",
15
+ type: "function",
16
+ },
17
+ ]),
18
+ });
@@ -0,0 +1,7 @@
1
+ import { type AbiFragment } from "./types";
2
+ export declare const ethena: Readonly<{
3
+ susde: Partial<Record<number, `0x${string}`>>;
4
+ usde: Partial<Record<number, `0x${string}`>>;
5
+ susdeAbi: readonly AbiFragment[];
6
+ }>;
7
+ //# sourceMappingURL=ethena.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ethena.d.ts","sourceRoot":"","sources":["../../../src/v4/protocols/ethena.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,SAAS,CAAC;AAmDhE,eAAO,MAAM,MAAM;;;;EAIjB,CAAC"}
@@ -0,0 +1,58 @@
1
+ // Ethena — USDe synthetic dollar + sUSDe staking vault.
2
+ //
3
+ // sUSDe (StakedUSDeV2) is ERC-4626-shaped on the deposit side but
4
+ // gates withdrawals behind a cooldown: redemption is a two-step
5
+ // `cooldownShares` → `unstake` flow, NOT a direct ERC-4626 redeem.
6
+ // So we ship a custom ABI rather than reusing `common.erc4626VaultAbi`.
7
+ import { Chains } from "../chains";
8
+ const susde = {
9
+ [Chains.EthereumMainnet]: "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497",
10
+ };
11
+ const usde = {
12
+ [Chains.EthereumMainnet]: "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3",
13
+ };
14
+ const susdeAbi = Object.freeze([
15
+ {
16
+ inputs: [
17
+ { internalType: "uint256", name: "assets", type: "uint256" },
18
+ { internalType: "address", name: "receiver", type: "address" },
19
+ ],
20
+ name: "deposit",
21
+ outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
22
+ stateMutability: "nonpayable",
23
+ type: "function",
24
+ },
25
+ {
26
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
27
+ name: "cooldownShares",
28
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
29
+ stateMutability: "nonpayable",
30
+ type: "function",
31
+ },
32
+ {
33
+ inputs: [{ internalType: "address", name: "receiver", type: "address" }],
34
+ name: "unstake",
35
+ outputs: [],
36
+ stateMutability: "nonpayable",
37
+ type: "function",
38
+ },
39
+ {
40
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
41
+ name: "previewRedeem",
42
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
43
+ stateMutability: "view",
44
+ type: "function",
45
+ },
46
+ {
47
+ inputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
48
+ name: "convertToAssets",
49
+ outputs: [{ internalType: "uint256", name: "assets", type: "uint256" }],
50
+ stateMutability: "view",
51
+ type: "function",
52
+ },
53
+ ]);
54
+ export const ethena = Object.freeze({
55
+ susde,
56
+ usde,
57
+ susdeAbi,
58
+ });
@@ -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/v4/protocols/frax-ether.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,SAAS;;;IAGpB,4DAA4D;;EAE5D,CAAC"}