@underscore-finance/sdk 0.0.6 → 0.0.7
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/README.md +2 -2
- package/dist/contracts/LegoCommon.d.ts +162 -0
- package/dist/contracts/LegoCommon.d.ts.map +1 -0
- package/dist/contracts/LegoCommon.js +200 -0
- package/dist/contracts/LegoCredit.d.ts +138 -0
- package/dist/contracts/LegoCredit.d.ts.map +1 -0
- package/dist/contracts/LegoCredit.js +177 -0
- package/dist/contracts/LegoDex.d.ts +585 -0
- package/dist/contracts/LegoDex.d.ts.map +1 -0
- package/dist/contracts/LegoDex.js +772 -0
- package/dist/contracts/LegoYield.d.ts +388 -0
- package/dist/contracts/LegoYield.d.ts.map +1 -0
- package/dist/contracts/LegoYield.js +509 -0
- package/dist/contracts/OracleParser.d.ts +205 -0
- package/dist/contracts/OracleParser.d.ts.map +1 -0
- package/dist/contracts/OracleParser.js +262 -0
- package/dist/contracts/index.d.ts +5 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/sdk.d.ts +10 -0
- package/dist/contracts/sdk.d.ts.map +1 -1
- package/dist/contracts/sdk.js +10 -0
- package/dist/index.d.ts +64 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OracleParser.d.ts","sourceRoot":"","sources":["../../src/contracts/OracleParser.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAEjD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA;AACrE,KAAK,OAAO,GAAG,KAAK,MAAM,EAAE,CAAA;AAE5B,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;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AAC,CAAC,iBAAiB,CAAC,CAAC,KACvD,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAC3C,mBAAmB,EAAE,CACnB,GAAG,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,qBAAqB,CAAC,CAAC,KAC3D,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAA;IAC/C,kBAAkB,EAAE,CAAC,GAAG,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC5G,CAAA;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,GAAG,CAsBrG"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/* @ts-nocheck */
|
|
5
|
+
import { singleQuery, mutate } from '@dappql/async';
|
|
6
|
+
export const abi = [
|
|
7
|
+
{
|
|
8
|
+
stateMutability: 'view',
|
|
9
|
+
type: 'function',
|
|
10
|
+
name: 'getPrice',
|
|
11
|
+
inputs: [
|
|
12
|
+
{
|
|
13
|
+
name: '_asset',
|
|
14
|
+
type: 'address',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
outputs: [
|
|
18
|
+
{
|
|
19
|
+
name: '',
|
|
20
|
+
type: 'uint256',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
stateMutability: 'view',
|
|
26
|
+
type: 'function',
|
|
27
|
+
name: 'getPrice',
|
|
28
|
+
inputs: [
|
|
29
|
+
{
|
|
30
|
+
name: '_asset',
|
|
31
|
+
type: 'address',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: '_staleTime',
|
|
35
|
+
type: 'uint256',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
outputs: [
|
|
39
|
+
{
|
|
40
|
+
name: '',
|
|
41
|
+
type: 'uint256',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
stateMutability: 'view',
|
|
47
|
+
type: 'function',
|
|
48
|
+
name: 'getPrice',
|
|
49
|
+
inputs: [
|
|
50
|
+
{
|
|
51
|
+
name: '_asset',
|
|
52
|
+
type: 'address',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: '_staleTime',
|
|
56
|
+
type: 'uint256',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: '_oracleRegistry',
|
|
60
|
+
type: 'address',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
outputs: [
|
|
64
|
+
{
|
|
65
|
+
name: '',
|
|
66
|
+
type: 'uint256',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
stateMutability: 'view',
|
|
72
|
+
type: 'function',
|
|
73
|
+
name: 'getPriceAndHasFeed',
|
|
74
|
+
inputs: [
|
|
75
|
+
{
|
|
76
|
+
name: '_asset',
|
|
77
|
+
type: 'address',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
outputs: [
|
|
81
|
+
{
|
|
82
|
+
name: '',
|
|
83
|
+
type: 'uint256',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: '',
|
|
87
|
+
type: 'bool',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
stateMutability: 'view',
|
|
93
|
+
type: 'function',
|
|
94
|
+
name: 'getPriceAndHasFeed',
|
|
95
|
+
inputs: [
|
|
96
|
+
{
|
|
97
|
+
name: '_asset',
|
|
98
|
+
type: 'address',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: '_staleTime',
|
|
102
|
+
type: 'uint256',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
outputs: [
|
|
106
|
+
{
|
|
107
|
+
name: '',
|
|
108
|
+
type: 'uint256',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: '',
|
|
112
|
+
type: 'bool',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
stateMutability: 'view',
|
|
118
|
+
type: 'function',
|
|
119
|
+
name: 'getPriceAndHasFeed',
|
|
120
|
+
inputs: [
|
|
121
|
+
{
|
|
122
|
+
name: '_asset',
|
|
123
|
+
type: 'address',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: '_staleTime',
|
|
127
|
+
type: 'uint256',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: '_oracleRegistry',
|
|
131
|
+
type: 'address',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
outputs: [
|
|
135
|
+
{
|
|
136
|
+
name: '',
|
|
137
|
+
type: 'uint256',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: '',
|
|
141
|
+
type: 'bool',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
stateMutability: 'view',
|
|
147
|
+
type: 'function',
|
|
148
|
+
name: 'hasPriceFeed',
|
|
149
|
+
inputs: [
|
|
150
|
+
{
|
|
151
|
+
name: '_asset',
|
|
152
|
+
type: 'address',
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
outputs: [
|
|
156
|
+
{
|
|
157
|
+
name: '',
|
|
158
|
+
type: 'bool',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
stateMutability: 'view',
|
|
164
|
+
type: 'function',
|
|
165
|
+
name: 'oraclePartnerId',
|
|
166
|
+
inputs: [],
|
|
167
|
+
outputs: [
|
|
168
|
+
{
|
|
169
|
+
name: '',
|
|
170
|
+
type: 'uint256',
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
stateMutability: 'nonpayable',
|
|
176
|
+
type: 'function',
|
|
177
|
+
name: 'setOraclePartnerId',
|
|
178
|
+
inputs: [
|
|
179
|
+
{
|
|
180
|
+
name: '_oracleId',
|
|
181
|
+
type: 'uint256',
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
outputs: [
|
|
185
|
+
{
|
|
186
|
+
name: '',
|
|
187
|
+
type: 'bool',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
stateMutability: 'view',
|
|
193
|
+
type: 'function',
|
|
194
|
+
name: 'getConfiguredAssets',
|
|
195
|
+
inputs: [],
|
|
196
|
+
outputs: [
|
|
197
|
+
{
|
|
198
|
+
name: '',
|
|
199
|
+
type: 'address[]',
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
export const deployAddress = undefined;
|
|
205
|
+
function getRequest(method, args, contractAddressOrOptions) {
|
|
206
|
+
const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
|
|
207
|
+
const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
|
|
208
|
+
const call = {
|
|
209
|
+
contractName: 'OracleParser',
|
|
210
|
+
method,
|
|
211
|
+
args,
|
|
212
|
+
address,
|
|
213
|
+
deployAddress,
|
|
214
|
+
defaultValue,
|
|
215
|
+
getAbi: () => abi,
|
|
216
|
+
with: (options) => {
|
|
217
|
+
call.address = options.contractAddress;
|
|
218
|
+
call.defaultValue = options.defaultValue;
|
|
219
|
+
return call;
|
|
220
|
+
},
|
|
221
|
+
defaultTo: (defaultValue) => {
|
|
222
|
+
call.defaultValue = defaultValue;
|
|
223
|
+
return call;
|
|
224
|
+
},
|
|
225
|
+
at: (address) => {
|
|
226
|
+
call.address = address;
|
|
227
|
+
return call;
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
return call;
|
|
231
|
+
}
|
|
232
|
+
export const call = {
|
|
233
|
+
getPrice: (...args) => getRequest('getPrice', args),
|
|
234
|
+
getPriceAndHasFeed: (...args) => getRequest('getPriceAndHasFeed', args),
|
|
235
|
+
hasPriceFeed: (...args) => getRequest('hasPriceFeed', args),
|
|
236
|
+
oraclePartnerId: (...args) => getRequest('oraclePartnerId', args),
|
|
237
|
+
getConfiguredAssets: (...args) => getRequest('getConfiguredAssets', args),
|
|
238
|
+
};
|
|
239
|
+
function getMutation(functionName) {
|
|
240
|
+
return {
|
|
241
|
+
contractName: 'OracleParser',
|
|
242
|
+
functionName,
|
|
243
|
+
deployAddress,
|
|
244
|
+
argsType: undefined,
|
|
245
|
+
getAbi: () => abi,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
export const mutation = {
|
|
249
|
+
setOraclePartnerId: getMutation('setOraclePartnerId'),
|
|
250
|
+
};
|
|
251
|
+
export function toSdk(address, publicClient, walletClient) {
|
|
252
|
+
return {
|
|
253
|
+
// Queries
|
|
254
|
+
getPrice: (...args) => singleQuery(publicClient, call.getPrice(...args).at(address)),
|
|
255
|
+
getPriceAndHasFeed: (...args) => singleQuery(publicClient, call.getPriceAndHasFeed(...args).at(address)),
|
|
256
|
+
hasPriceFeed: (...args) => singleQuery(publicClient, call.hasPriceFeed(...args).at(address)),
|
|
257
|
+
oraclePartnerId: (...args) => singleQuery(publicClient, call.oraclePartnerId(...args).at(address)),
|
|
258
|
+
getConfiguredAssets: (...args) => singleQuery(publicClient, call.getConfiguredAssets(...args).at(address)),
|
|
259
|
+
// Mutations
|
|
260
|
+
setOraclePartnerId: (...args) => mutate(walletClient, mutation.setOraclePartnerId, { address })(...args),
|
|
261
|
+
};
|
|
262
|
+
}
|
|
@@ -6,8 +6,11 @@ export * as ERC20 from './ERC20.js';
|
|
|
6
6
|
export * as LegoAaveV3 from './LegoAaveV3.js';
|
|
7
7
|
export * as LegoAeroClassic from './LegoAeroClassic.js';
|
|
8
8
|
export * as LegoAeroSlipstream from './LegoAeroSlipstream.js';
|
|
9
|
+
export * as LegoCommon from './LegoCommon.js';
|
|
9
10
|
export * as LegoCompoundV3 from './LegoCompoundV3.js';
|
|
11
|
+
export * as LegoCredit from './LegoCredit.js';
|
|
10
12
|
export * as LegoCurve from './LegoCurve.js';
|
|
13
|
+
export * as LegoDex from './LegoDex.js';
|
|
11
14
|
export * as LegoEuler from './LegoEuler.js';
|
|
12
15
|
export * as LegoFluid from './LegoFluid.js';
|
|
13
16
|
export * as LegoHelper from './LegoHelper.js';
|
|
@@ -17,6 +20,8 @@ export * as LegoRegistry from './LegoRegistry.js';
|
|
|
17
20
|
export * as LegoSky from './LegoSky.js';
|
|
18
21
|
export * as LegoUniswapV2 from './LegoUniswapV2.js';
|
|
19
22
|
export * as LegoUniswapV3 from './LegoUniswapV3.js';
|
|
23
|
+
export * as LegoYield from './LegoYield.js';
|
|
24
|
+
export * as OracleParser from './OracleParser.js';
|
|
20
25
|
export * as OracleRegistry from './OracleRegistry.js';
|
|
21
26
|
export * as PriceSheets from './PriceSheets.js';
|
|
22
27
|
export * as PythFeeds from './PythFeeds.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;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,yBAAyB,CAAA;AAC7D,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA"}
|
package/dist/contracts/index.js
CHANGED
|
@@ -10,8 +10,11 @@ export * as ERC20 from './ERC20.js';
|
|
|
10
10
|
export * as LegoAaveV3 from './LegoAaveV3.js';
|
|
11
11
|
export * as LegoAeroClassic from './LegoAeroClassic.js';
|
|
12
12
|
export * as LegoAeroSlipstream from './LegoAeroSlipstream.js';
|
|
13
|
+
export * as LegoCommon from './LegoCommon.js';
|
|
13
14
|
export * as LegoCompoundV3 from './LegoCompoundV3.js';
|
|
15
|
+
export * as LegoCredit from './LegoCredit.js';
|
|
14
16
|
export * as LegoCurve from './LegoCurve.js';
|
|
17
|
+
export * as LegoDex from './LegoDex.js';
|
|
15
18
|
export * as LegoEuler from './LegoEuler.js';
|
|
16
19
|
export * as LegoFluid from './LegoFluid.js';
|
|
17
20
|
export * as LegoHelper from './LegoHelper.js';
|
|
@@ -21,6 +24,8 @@ export * as LegoRegistry from './LegoRegistry.js';
|
|
|
21
24
|
export * as LegoSky from './LegoSky.js';
|
|
22
25
|
export * as LegoUniswapV2 from './LegoUniswapV2.js';
|
|
23
26
|
export * as LegoUniswapV3 from './LegoUniswapV3.js';
|
|
27
|
+
export * as LegoYield from './LegoYield.js';
|
|
28
|
+
export * as OracleParser from './OracleParser.js';
|
|
24
29
|
export * as OracleRegistry from './OracleRegistry.js';
|
|
25
30
|
export * as PriceSheets from './PriceSheets.js';
|
|
26
31
|
export * as PythFeeds from './PythFeeds.js';
|
package/dist/contracts/sdk.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ import * as ERC20 from './ERC20.js';
|
|
|
7
7
|
import * as LegoAaveV3 from './LegoAaveV3.js';
|
|
8
8
|
import * as LegoAeroClassic from './LegoAeroClassic.js';
|
|
9
9
|
import * as LegoAeroSlipstream from './LegoAeroSlipstream.js';
|
|
10
|
+
import * as LegoCommon from './LegoCommon.js';
|
|
10
11
|
import * as LegoCompoundV3 from './LegoCompoundV3.js';
|
|
12
|
+
import * as LegoCredit from './LegoCredit.js';
|
|
11
13
|
import * as LegoCurve from './LegoCurve.js';
|
|
14
|
+
import * as LegoDex from './LegoDex.js';
|
|
12
15
|
import * as LegoEuler from './LegoEuler.js';
|
|
13
16
|
import * as LegoFluid from './LegoFluid.js';
|
|
14
17
|
import * as LegoHelper from './LegoHelper.js';
|
|
@@ -18,6 +21,8 @@ import * as LegoRegistry from './LegoRegistry.js';
|
|
|
18
21
|
import * as LegoSky from './LegoSky.js';
|
|
19
22
|
import * as LegoUniswapV2 from './LegoUniswapV2.js';
|
|
20
23
|
import * as LegoUniswapV3 from './LegoUniswapV3.js';
|
|
24
|
+
import * as LegoYield from './LegoYield.js';
|
|
25
|
+
import * as OracleParser from './OracleParser.js';
|
|
21
26
|
import * as OracleRegistry from './OracleRegistry.js';
|
|
22
27
|
import * as PriceSheets from './PriceSheets.js';
|
|
23
28
|
import * as PythFeeds from './PythFeeds.js';
|
|
@@ -33,8 +38,11 @@ export type SDK = {
|
|
|
33
38
|
LegoAaveV3: LegoAaveV3.SDK;
|
|
34
39
|
LegoAeroClassic: LegoAeroClassic.SDK;
|
|
35
40
|
LegoAeroSlipstream: LegoAeroSlipstream.SDK;
|
|
41
|
+
LegoCommon: (address: `0x${string}`) => LegoCommon.SDK;
|
|
36
42
|
LegoCompoundV3: LegoCompoundV3.SDK;
|
|
43
|
+
LegoCredit: (address: `0x${string}`) => LegoCredit.SDK;
|
|
37
44
|
LegoCurve: LegoCurve.SDK;
|
|
45
|
+
LegoDex: (address: `0x${string}`) => LegoDex.SDK;
|
|
38
46
|
LegoEuler: LegoEuler.SDK;
|
|
39
47
|
LegoFluid: LegoFluid.SDK;
|
|
40
48
|
LegoHelper: LegoHelper.SDK;
|
|
@@ -44,6 +52,8 @@ export type SDK = {
|
|
|
44
52
|
LegoSky: LegoSky.SDK;
|
|
45
53
|
LegoUniswapV2: LegoUniswapV2.SDK;
|
|
46
54
|
LegoUniswapV3: LegoUniswapV3.SDK;
|
|
55
|
+
LegoYield: (address: `0x${string}`) => LegoYield.SDK;
|
|
56
|
+
OracleParser: (address: `0x${string}`) => OracleParser.SDK;
|
|
47
57
|
OracleRegistry: OracleRegistry.SDK;
|
|
48
58
|
PriceSheets: PriceSheets.SDK;
|
|
49
59
|
PythFeeds: PythFeeds.SDK;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/contracts/s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IACxB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAA;IACxB,UAAU,EAAE,UAAU,CAAC,GAAG,CAAA;IAC1B,YAAY,EAAE,YAAY,CAAC,GAAG,CAAA;IAC9B,UAAU,EAAE,UAAU,CAAC,GAAG,CAAA;IAC1B,YAAY,EAAE,YAAY,CAAC,GAAG,CAAA;IAC9B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAA;IACpB,aAAa,EAAE,aAAa,CAAC,GAAG,CAAA;IAChC,aAAa,EAAE,aAAa,CAAC,GAAG,CAAA;IAChC,SAAS,EAAE,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,CAAC,GAAG,CAAA;IACpD,YAAY,EAAE,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,CAAC,GAAG,CAAA;IAC1D,cAAc,EAAE,cAAc,CAAC,GAAG,CAAA;IAClC,WAAW,EAAE,WAAW,CAAC,GAAG,CAAA;IAC5B,SAAS,EAAE,SAAS,CAAC,GAAG,CAAA;IACxB,UAAU,EAAE,UAAU,CAAC,GAAG,CAAA;IAC1B,YAAY,EAAE,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,CAAC,GAAG,CAAA;IAC1D,WAAW,EAAE,CAAC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,CAAC,GAAG,CAAA;CACzD,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,GAAG,CAiC/F"}
|
package/dist/contracts/sdk.js
CHANGED
|
@@ -10,8 +10,11 @@ import * as ERC20 from './ERC20.js';
|
|
|
10
10
|
import * as LegoAaveV3 from './LegoAaveV3.js';
|
|
11
11
|
import * as LegoAeroClassic from './LegoAeroClassic.js';
|
|
12
12
|
import * as LegoAeroSlipstream from './LegoAeroSlipstream.js';
|
|
13
|
+
import * as LegoCommon from './LegoCommon.js';
|
|
13
14
|
import * as LegoCompoundV3 from './LegoCompoundV3.js';
|
|
15
|
+
import * as LegoCredit from './LegoCredit.js';
|
|
14
16
|
import * as LegoCurve from './LegoCurve.js';
|
|
17
|
+
import * as LegoDex from './LegoDex.js';
|
|
15
18
|
import * as LegoEuler from './LegoEuler.js';
|
|
16
19
|
import * as LegoFluid from './LegoFluid.js';
|
|
17
20
|
import * as LegoHelper from './LegoHelper.js';
|
|
@@ -21,6 +24,8 @@ import * as LegoRegistry from './LegoRegistry.js';
|
|
|
21
24
|
import * as LegoSky from './LegoSky.js';
|
|
22
25
|
import * as LegoUniswapV2 from './LegoUniswapV2.js';
|
|
23
26
|
import * as LegoUniswapV3 from './LegoUniswapV3.js';
|
|
27
|
+
import * as LegoYield from './LegoYield.js';
|
|
28
|
+
import * as OracleParser from './OracleParser.js';
|
|
24
29
|
import * as OracleRegistry from './OracleRegistry.js';
|
|
25
30
|
import * as PriceSheets from './PriceSheets.js';
|
|
26
31
|
import * as PythFeeds from './PythFeeds.js';
|
|
@@ -37,8 +42,11 @@ export default function createSdk(publicClient, walletClient) {
|
|
|
37
42
|
LegoAaveV3: LegoAaveV3.toSdk(publicClient, walletClient),
|
|
38
43
|
LegoAeroClassic: LegoAeroClassic.toSdk(publicClient, walletClient),
|
|
39
44
|
LegoAeroSlipstream: LegoAeroSlipstream.toSdk(publicClient, walletClient),
|
|
45
|
+
LegoCommon: (address) => LegoCommon.toSdk(address, publicClient, walletClient),
|
|
40
46
|
LegoCompoundV3: LegoCompoundV3.toSdk(publicClient, walletClient),
|
|
47
|
+
LegoCredit: (address) => LegoCredit.toSdk(address, publicClient, walletClient),
|
|
41
48
|
LegoCurve: LegoCurve.toSdk(publicClient, walletClient),
|
|
49
|
+
LegoDex: (address) => LegoDex.toSdk(address, publicClient, walletClient),
|
|
42
50
|
LegoEuler: LegoEuler.toSdk(publicClient, walletClient),
|
|
43
51
|
LegoFluid: LegoFluid.toSdk(publicClient, walletClient),
|
|
44
52
|
LegoHelper: LegoHelper.toSdk(publicClient, walletClient),
|
|
@@ -48,6 +56,8 @@ export default function createSdk(publicClient, walletClient) {
|
|
|
48
56
|
LegoSky: LegoSky.toSdk(publicClient, walletClient),
|
|
49
57
|
LegoUniswapV2: LegoUniswapV2.toSdk(publicClient, walletClient),
|
|
50
58
|
LegoUniswapV3: LegoUniswapV3.toSdk(publicClient, walletClient),
|
|
59
|
+
LegoYield: (address) => LegoYield.toSdk(address, publicClient, walletClient),
|
|
60
|
+
OracleParser: (address) => OracleParser.toSdk(address, publicClient, walletClient),
|
|
51
61
|
OracleRegistry: OracleRegistry.toSdk(publicClient, walletClient),
|
|
52
62
|
PriceSheets: PriceSheets.toSdk(publicClient, walletClient),
|
|
53
63
|
PythFeeds: PythFeeds.toSdk(publicClient, walletClient),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { PublicClient, WalletClient } from 'viem';
|
|
1
|
+
import { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
import * as LegoHelper from './contracts/LegoHelper.js';
|
|
2
3
|
import { SDK } from './contracts/sdk.js';
|
|
3
4
|
export * from './contracts/index.js';
|
|
5
|
+
type DeepMutable<T> = {
|
|
6
|
+
-readonly [P in keyof T]: T[P] extends object ? DeepMutable<T[P]> : T[P];
|
|
7
|
+
};
|
|
4
8
|
interface UnderscoreConfig {
|
|
5
9
|
rpcUrl?: string;
|
|
6
10
|
publicClient?: PublicClient;
|
|
@@ -13,6 +17,65 @@ declare class Underscore {
|
|
|
13
17
|
constructor(config?: UnderscoreConfig);
|
|
14
18
|
setWalletClient(walletClient: WalletClient): void;
|
|
15
19
|
setPublicClient(publicClient: PublicClient): void;
|
|
20
|
+
getSwapInstructionsAmountOut(payload: {
|
|
21
|
+
tokenIn: Address;
|
|
22
|
+
tokenOut: Address;
|
|
23
|
+
amountIn: bigint;
|
|
24
|
+
slippage: bigint;
|
|
25
|
+
includeLegoIds?: bigint[];
|
|
26
|
+
}): Promise<DeepMutable<{
|
|
27
|
+
legoId: bigint;
|
|
28
|
+
amountIn: bigint;
|
|
29
|
+
minAmountOut: bigint;
|
|
30
|
+
tokenPath: readonly `0x${string}`[];
|
|
31
|
+
poolPath: readonly `0x${string}`[];
|
|
32
|
+
}>[]>;
|
|
33
|
+
getSwapInstructionsAmountIn(payload: {
|
|
34
|
+
tokenIn: Address;
|
|
35
|
+
tokenOut: Address;
|
|
36
|
+
amountOut: bigint;
|
|
37
|
+
amountInAvailable: bigint;
|
|
38
|
+
slippage: bigint;
|
|
39
|
+
includeLegoIds?: bigint[];
|
|
40
|
+
}): Promise<DeepMutable<{
|
|
41
|
+
legoId: bigint;
|
|
42
|
+
amountIn: bigint;
|
|
43
|
+
minAmountOut: bigint;
|
|
44
|
+
tokenPath: readonly `0x${string}`[];
|
|
45
|
+
poolPath: readonly `0x${string}`[];
|
|
46
|
+
}>[]>;
|
|
47
|
+
get Factory(): import("./contracts/AgentFactory.js").SDK;
|
|
48
|
+
get OracleRegistry(): import("./contracts/OracleRegistry.js").SDK;
|
|
49
|
+
get LegoRegistry(): import("./contracts/LegoRegistry.js").SDK;
|
|
50
|
+
get LegoHelper(): LegoHelper.SDK;
|
|
51
|
+
get PriceSheets(): import("./contracts/PriceSheets.js").SDK;
|
|
52
|
+
get Agent(): {
|
|
53
|
+
at: (address: Address) => import("./contracts/Agent.js").SDK;
|
|
54
|
+
};
|
|
55
|
+
get UserWallet(): {
|
|
56
|
+
at: (address: Address) => import("./contracts/WalletFunds.js").SDK;
|
|
57
|
+
};
|
|
58
|
+
get UserWalletConfig(): {
|
|
59
|
+
at: (address: Address) => import("./contracts/WalletConfig.js").SDK;
|
|
60
|
+
};
|
|
61
|
+
get ERC20(): {
|
|
62
|
+
at: (address: Address) => import("./contracts/ERC20.js").SDK;
|
|
63
|
+
};
|
|
64
|
+
get LegoCommon(): {
|
|
65
|
+
at: (address: Address) => import("./contracts/LegoCommon.js").SDK;
|
|
66
|
+
};
|
|
67
|
+
get LegoCredit(): {
|
|
68
|
+
at: (address: Address) => import("./contracts/LegoCredit.js").SDK;
|
|
69
|
+
};
|
|
70
|
+
get LegoDex(): {
|
|
71
|
+
at: (address: Address) => import("./contracts/LegoDex.js").SDK;
|
|
72
|
+
};
|
|
73
|
+
get LegoYield(): {
|
|
74
|
+
at: (address: Address) => import("./contracts/LegoYield.js").SDK;
|
|
75
|
+
};
|
|
76
|
+
get OracleParser(): {
|
|
77
|
+
at: (address: Address) => import("./contracts/OracleParser.js").SDK;
|
|
78
|
+
};
|
|
16
79
|
}
|
|
17
80
|
export default Underscore;
|
|
18
81
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4B,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGpF,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAA;AACvD,OAAkB,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAEnD,cAAc,sBAAsB,CAAA;AAEpC,KAAK,WAAW,CAAC,CAAC,IAAI;IACpB,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACzE,CAAA;AAED,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B;AAED,cAAM,UAAU;IACP,YAAY,EAAE,YAAY,C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';
|
|
3
|
+
import * as LegoHelper from './contracts/LegoHelper.js';
|
|
3
4
|
import createSdk from './contracts/sdk.js';
|
|
4
5
|
export * from './contracts/index.js';
|
|
5
6
|
class Underscore {
|
|
@@ -21,5 +22,67 @@ class Underscore {
|
|
|
21
22
|
this.publicClient = publicClient;
|
|
22
23
|
this.contracts = createSdk(this.publicClient, this.walletClient);
|
|
23
24
|
}
|
|
25
|
+
async getSwapInstructionsAmountOut(payload) {
|
|
26
|
+
const { tokenIn, tokenOut, amountIn, slippage, includeLegoIds } = payload;
|
|
27
|
+
const instructions = await this.publicClient.simulateContract({
|
|
28
|
+
address: LegoHelper.deployAddress,
|
|
29
|
+
abi: LegoHelper.abi,
|
|
30
|
+
functionName: 'getRoutesAndSwapInstructionsAmountOut',
|
|
31
|
+
args: [tokenIn, tokenOut, amountIn, slippage, includeLegoIds ?? []],
|
|
32
|
+
});
|
|
33
|
+
return instructions.result;
|
|
34
|
+
}
|
|
35
|
+
async getSwapInstructionsAmountIn(payload) {
|
|
36
|
+
const { tokenIn, tokenOut, amountOut, amountInAvailable, slippage, includeLegoIds } = payload;
|
|
37
|
+
const instructions = await this.publicClient.simulateContract({
|
|
38
|
+
address: LegoHelper.deployAddress,
|
|
39
|
+
abi: LegoHelper.abi,
|
|
40
|
+
functionName: 'getRoutesAndSwapInstructionsAmountIn',
|
|
41
|
+
args: [tokenIn, tokenOut, amountOut, amountInAvailable, slippage, includeLegoIds ?? []],
|
|
42
|
+
});
|
|
43
|
+
return instructions.result;
|
|
44
|
+
}
|
|
45
|
+
get Factory() {
|
|
46
|
+
return this.contracts.AgentFactory;
|
|
47
|
+
}
|
|
48
|
+
get OracleRegistry() {
|
|
49
|
+
return this.contracts.OracleRegistry;
|
|
50
|
+
}
|
|
51
|
+
get LegoRegistry() {
|
|
52
|
+
return this.contracts.LegoRegistry;
|
|
53
|
+
}
|
|
54
|
+
get LegoHelper() {
|
|
55
|
+
return this.contracts.LegoHelper;
|
|
56
|
+
}
|
|
57
|
+
get PriceSheets() {
|
|
58
|
+
return this.contracts.PriceSheets;
|
|
59
|
+
}
|
|
60
|
+
get Agent() {
|
|
61
|
+
return { at: (address) => this.contracts.Agent(address) };
|
|
62
|
+
}
|
|
63
|
+
get UserWallet() {
|
|
64
|
+
return { at: (address) => this.contracts.WalletFunds(address) };
|
|
65
|
+
}
|
|
66
|
+
get UserWalletConfig() {
|
|
67
|
+
return { at: (address) => this.contracts.WalletConfig(address) };
|
|
68
|
+
}
|
|
69
|
+
get ERC20() {
|
|
70
|
+
return { at: (address) => this.contracts.ERC20(address) };
|
|
71
|
+
}
|
|
72
|
+
get LegoCommon() {
|
|
73
|
+
return { at: (address) => this.contracts.LegoCommon(address) };
|
|
74
|
+
}
|
|
75
|
+
get LegoCredit() {
|
|
76
|
+
return { at: (address) => this.contracts.LegoCredit(address) };
|
|
77
|
+
}
|
|
78
|
+
get LegoDex() {
|
|
79
|
+
return { at: (address) => this.contracts.LegoDex(address) };
|
|
80
|
+
}
|
|
81
|
+
get LegoYield() {
|
|
82
|
+
return { at: (address) => this.contracts.LegoYield(address) };
|
|
83
|
+
}
|
|
84
|
+
get OracleParser() {
|
|
85
|
+
return { at: (address) => this.contracts.OracleParser(address) };
|
|
86
|
+
}
|
|
24
87
|
}
|
|
25
88
|
export default Underscore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@underscore-finance/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "SDK for interacting with Underscore Finance Smart Contracts with TypeScript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
12
|
"codegen": "dappql && prettier --write .",
|
|
13
|
-
"ship": "bump patch --commit --push &&
|
|
13
|
+
"ship": "npm run build && bump patch --commit --push && npm publish --access public",
|
|
14
14
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [],
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
"@dappql/async": "^1.0.2",
|
|
33
33
|
"viem": "^2.23.7"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|