@exponent-labs/meteora-idl 0.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [0.0.3](https://github.com/exponent-finance/exponent-core/compare/@exponent-labs/meteora-idl@0.0.2...@exponent-labs/meteora-idl@0.0.3) (2025-03-03)
7
+
8
+ **Note:** Version bump only for package @exponent-labs/meteora-idl
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.0.2](https://github.com/exponent-finance/exponent-core/compare/@exponent-labs/meteora-idl@0.0.1...@exponent-labs/meteora-idl@0.0.2) (2025-03-03)
15
+
16
+ **Note:** Version bump only for package @exponent-labs/meteora-idl
@@ -0,0 +1,477 @@
1
+ /// <reference types="bn.js" />
2
+ import { Amm } from "./meteora_amm";
3
+ import { Vault } from "./meteora_vault";
4
+ import { IdlAccounts, IdlTypes, web3 } from "@coral-xyz/anchor";
5
+ export declare const POOLS_IDL: {
6
+ version: string;
7
+ name: string;
8
+ docs: string[];
9
+ instructions: ({
10
+ name: string;
11
+ docs: string[];
12
+ accounts: ({
13
+ name: string;
14
+ isMut: boolean;
15
+ isSigner: boolean;
16
+ docs: string[];
17
+ } | {
18
+ name: string;
19
+ isMut: boolean;
20
+ isSigner: boolean;
21
+ docs?: undefined;
22
+ })[];
23
+ args: ({
24
+ name: string;
25
+ type: {
26
+ defined: string;
27
+ };
28
+ } | {
29
+ name: string;
30
+ type: string;
31
+ })[];
32
+ } | {
33
+ name: string;
34
+ docs: string[];
35
+ accounts: ({
36
+ name: string;
37
+ isMut: boolean;
38
+ isSigner: boolean;
39
+ docs: string[];
40
+ } | {
41
+ name: string;
42
+ isMut: boolean;
43
+ isSigner: boolean;
44
+ docs?: undefined;
45
+ })[];
46
+ args: ({
47
+ name: string;
48
+ type: string;
49
+ } | {
50
+ name: string;
51
+ type: {
52
+ option: string;
53
+ };
54
+ })[];
55
+ })[];
56
+ accounts: ({
57
+ name: string;
58
+ type: {
59
+ kind: string;
60
+ fields: ({
61
+ name: string;
62
+ type: {
63
+ defined: string;
64
+ array?: undefined;
65
+ };
66
+ docs?: undefined;
67
+ } | {
68
+ name: string;
69
+ type: string;
70
+ docs?: undefined;
71
+ } | {
72
+ name: string;
73
+ docs: string[];
74
+ type: string;
75
+ } | {
76
+ name: string;
77
+ type: {
78
+ array: (string | number)[];
79
+ defined?: undefined;
80
+ };
81
+ docs?: undefined;
82
+ })[];
83
+ };
84
+ docs?: undefined;
85
+ } | {
86
+ name: string;
87
+ docs: string[];
88
+ type: {
89
+ kind: string;
90
+ fields: ({
91
+ name: string;
92
+ docs: string[];
93
+ type: string;
94
+ } | {
95
+ name: string;
96
+ type: {
97
+ array: (string | number)[];
98
+ defined?: undefined;
99
+ };
100
+ docs?: undefined;
101
+ } | {
102
+ name: string;
103
+ docs: string[];
104
+ type: {
105
+ defined: string;
106
+ array?: undefined;
107
+ };
108
+ } | {
109
+ name: string;
110
+ type: {
111
+ defined: string;
112
+ array?: undefined;
113
+ };
114
+ docs?: undefined;
115
+ })[];
116
+ };
117
+ })[];
118
+ types: ({
119
+ name: string;
120
+ docs: string[];
121
+ type: {
122
+ kind: string;
123
+ fields: ({
124
+ name: string;
125
+ docs: string[];
126
+ type: string;
127
+ } | {
128
+ name: string;
129
+ docs: string[];
130
+ type: {
131
+ defined: string;
132
+ };
133
+ })[];
134
+ variants?: undefined;
135
+ };
136
+ } | {
137
+ name: string;
138
+ type: {
139
+ kind: string;
140
+ fields: {
141
+ name: string;
142
+ type: string;
143
+ }[];
144
+ variants?: undefined;
145
+ };
146
+ docs?: undefined;
147
+ } | {
148
+ name: string;
149
+ type: {
150
+ kind: string;
151
+ fields: ({
152
+ name: string;
153
+ docs: string[];
154
+ type: string;
155
+ } | {
156
+ name: string;
157
+ docs: string[];
158
+ type: {
159
+ option: string;
160
+ array?: undefined;
161
+ };
162
+ } | {
163
+ name: string;
164
+ docs: string[];
165
+ type: {
166
+ array: (string | number)[];
167
+ option?: undefined;
168
+ };
169
+ })[];
170
+ variants?: undefined;
171
+ };
172
+ docs?: undefined;
173
+ } | {
174
+ name: string;
175
+ docs: string[];
176
+ type: {
177
+ kind: string;
178
+ fields: {
179
+ name: string;
180
+ docs: string[];
181
+ type: {
182
+ array: (string | number)[];
183
+ };
184
+ }[];
185
+ variants?: undefined;
186
+ };
187
+ } | {
188
+ name: string;
189
+ docs: string[];
190
+ type: {
191
+ kind: string;
192
+ variants: ({
193
+ name: string;
194
+ fields?: undefined;
195
+ } | {
196
+ name: string;
197
+ fields: ({
198
+ name: string;
199
+ docs: string[];
200
+ type: string;
201
+ } | {
202
+ name: string;
203
+ docs: string[];
204
+ type: {
205
+ defined: string;
206
+ };
207
+ })[];
208
+ } | {
209
+ name: string;
210
+ fields: {
211
+ name: string;
212
+ type: string;
213
+ }[];
214
+ })[];
215
+ fields?: undefined;
216
+ };
217
+ })[];
218
+ events: {
219
+ name: string;
220
+ fields: ({
221
+ name: string;
222
+ type: string;
223
+ index: boolean;
224
+ } | {
225
+ name: string;
226
+ type: {
227
+ defined: string;
228
+ };
229
+ index: boolean;
230
+ })[];
231
+ }[];
232
+ errors: {
233
+ code: number;
234
+ name: string;
235
+ msg: string;
236
+ }[];
237
+ };
238
+ export declare const VAULT_IDL: {
239
+ version: string;
240
+ name: string;
241
+ docs: string[];
242
+ instructions: ({
243
+ name: string;
244
+ docs: string[];
245
+ accounts: ({
246
+ name: string;
247
+ isMut: boolean;
248
+ isSigner: boolean;
249
+ docs: string[];
250
+ } | {
251
+ name: string;
252
+ isMut: boolean;
253
+ isSigner: boolean;
254
+ docs?: undefined;
255
+ })[];
256
+ args: {
257
+ name: string;
258
+ type: {
259
+ defined: string;
260
+ };
261
+ }[];
262
+ } | {
263
+ name: string;
264
+ docs: string[];
265
+ accounts: ({
266
+ name: string;
267
+ isMut: boolean;
268
+ isSigner: boolean;
269
+ docs: string[];
270
+ } | {
271
+ name: string;
272
+ isMut: boolean;
273
+ isSigner: boolean;
274
+ docs?: undefined;
275
+ })[];
276
+ args: {
277
+ name: string;
278
+ type: string;
279
+ }[];
280
+ })[];
281
+ accounts: {
282
+ name: string;
283
+ docs: string[];
284
+ type: {
285
+ kind: string;
286
+ fields: ({
287
+ name: string;
288
+ docs: string[];
289
+ type: string;
290
+ } | {
291
+ name: string;
292
+ docs: string[];
293
+ type: {
294
+ defined: string;
295
+ array?: undefined;
296
+ };
297
+ } | {
298
+ name: string;
299
+ docs: string[];
300
+ type: {
301
+ array: (string | number)[];
302
+ defined?: undefined;
303
+ };
304
+ })[];
305
+ };
306
+ }[];
307
+ types: ({
308
+ name: string;
309
+ docs: string[];
310
+ type: {
311
+ kind: string;
312
+ fields: ({
313
+ name: string;
314
+ docs: string[];
315
+ type: string;
316
+ } | {
317
+ name: string;
318
+ docs: string[];
319
+ type: {
320
+ array: (string | number)[];
321
+ };
322
+ })[];
323
+ variants?: undefined;
324
+ };
325
+ } | {
326
+ name: string;
327
+ docs: string[];
328
+ type: {
329
+ kind: string;
330
+ variants: {
331
+ name: string;
332
+ }[];
333
+ fields?: undefined;
334
+ };
335
+ })[];
336
+ events: {
337
+ name: string;
338
+ fields: ({
339
+ name: string;
340
+ type: {
341
+ defined: string;
342
+ };
343
+ index: boolean;
344
+ } | {
345
+ name: string;
346
+ type: string;
347
+ index: boolean;
348
+ })[];
349
+ }[];
350
+ errors: {
351
+ code: number;
352
+ name: string;
353
+ msg: string;
354
+ }[];
355
+ };
356
+ export declare const POOLS_PROGRAM: string;
357
+ export declare const VAULT_PROGRAM: string;
358
+ export type PoolState = IdlAccounts<Amm>["pool"];
359
+ export type VaultState = IdlAccounts<Vault>["vault"];
360
+ export type CurveType = IdlTypes<Amm>["CurveType"];
361
+ export type LockedProfitTracker = IdlTypes<Vault>["LockedProfitTracker"];
362
+ export declare const decodePoolAccount: (connection: web3.Connection, accountPubkey: web3.PublicKey) => Promise<{
363
+ lpMint: web3.PublicKey;
364
+ tokenAMint: web3.PublicKey;
365
+ tokenBMint: web3.PublicKey;
366
+ aVault: web3.PublicKey;
367
+ bVault: web3.PublicKey;
368
+ aVaultLp: web3.PublicKey;
369
+ bVaultLp: web3.PublicKey;
370
+ aVaultLpBump: number;
371
+ enabled: boolean;
372
+ protocolTokenAFee: web3.PublicKey;
373
+ protocolTokenBFee: web3.PublicKey;
374
+ feeLastUpdatedAt: import("bn.js");
375
+ padding0: number[];
376
+ fees: {
377
+ tradeFeeNumerator: import("bn.js");
378
+ tradeFeeDenominator: import("bn.js");
379
+ protocolTradeFeeNumerator: import("bn.js");
380
+ protocolTradeFeeDenominator: import("bn.js");
381
+ };
382
+ poolType: ({
383
+ permissionless?: never;
384
+ } & {
385
+ permissioned: Record<string, never>;
386
+ }) | ({
387
+ permissioned?: never;
388
+ } & {
389
+ permissionless: Record<string, never>;
390
+ });
391
+ stake: web3.PublicKey;
392
+ totalLockedLp: import("bn.js");
393
+ bootstrapping: {
394
+ activationPoint: import("bn.js");
395
+ whitelistedVault: web3.PublicKey;
396
+ poolCreator: web3.PublicKey;
397
+ activationType: number;
398
+ };
399
+ partnerInfo: {
400
+ feeNumerator: import("bn.js");
401
+ partnerAuthority: web3.PublicKey;
402
+ pendingFeeA: import("bn.js");
403
+ pendingFeeB: import("bn.js");
404
+ };
405
+ padding: {
406
+ padding0: number[];
407
+ padding1: import("bn.js")[];
408
+ padding2: import("bn.js")[];
409
+ };
410
+ curveType: ({
411
+ stable?: never;
412
+ } & {
413
+ constantProduct: Record<string, never>;
414
+ }) | ({
415
+ constantProduct?: never;
416
+ } & {
417
+ stable: {
418
+ amp: import("bn.js");
419
+ tokenMultiplier: {
420
+ tokenAMultiplier: import("bn.js");
421
+ tokenBMultiplier: import("bn.js");
422
+ precisionFactor: number;
423
+ };
424
+ depeg: {
425
+ baseVirtualPrice: import("bn.js");
426
+ baseCacheUpdated: import("bn.js");
427
+ depegType: ({
428
+ marinade?: never;
429
+ lido?: never;
430
+ splStake?: never;
431
+ } & {
432
+ none: Record<string, never>;
433
+ }) | ({
434
+ none?: never;
435
+ lido?: never;
436
+ splStake?: never;
437
+ } & {
438
+ marinade: Record<string, never>;
439
+ }) | ({
440
+ none?: never;
441
+ marinade?: never;
442
+ splStake?: never;
443
+ } & {
444
+ lido: Record<string, never>;
445
+ }) | ({
446
+ none?: never;
447
+ marinade?: never;
448
+ lido?: never;
449
+ } & {
450
+ splStake: Record<string, never>;
451
+ });
452
+ };
453
+ lastAmpUpdatedTimestamp: import("bn.js");
454
+ };
455
+ });
456
+ }>;
457
+ export declare const decodeVaultAccount: (connection: web3.Connection, accountPubkey: web3.PublicKey) => Promise<{
458
+ enabled: number;
459
+ bumps: {
460
+ vaultBump: number;
461
+ tokenVaultBump: number;
462
+ };
463
+ totalAmount: import("bn.js");
464
+ tokenVault: web3.PublicKey;
465
+ feeVault: web3.PublicKey;
466
+ tokenMint: web3.PublicKey;
467
+ lpMint: web3.PublicKey;
468
+ strategies: web3.PublicKey[];
469
+ base: web3.PublicKey;
470
+ admin: web3.PublicKey;
471
+ operator: web3.PublicKey;
472
+ lockedProfitTracker: {
473
+ lastUpdatedLockedProfit: import("bn.js");
474
+ lastReport: import("bn.js");
475
+ lockedProfitDegradation: import("bn.js");
476
+ };
477
+ }>;
package/build/index.js ADDED
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.decodeVaultAccount = exports.decodePoolAccount = exports.VAULT_PROGRAM = exports.POOLS_PROGRAM = exports.VAULT_IDL = exports.POOLS_IDL = void 0;
27
+ const pools_idl = __importStar(require("./meteora_amm.json"));
28
+ const vault_idl = __importStar(require("./meteora_vault.json"));
29
+ const anchor_1 = require("@coral-xyz/anchor");
30
+ exports.POOLS_IDL = pools_idl;
31
+ exports.VAULT_IDL = vault_idl;
32
+ exports.POOLS_PROGRAM = "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB";
33
+ exports.VAULT_PROGRAM = "24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi";
34
+ const decodePoolAccount = async (connection, accountPubkey) => {
35
+ const account = await connection.getAccountInfo(accountPubkey);
36
+ const coder = new anchor_1.BorshCoder(exports.POOLS_IDL);
37
+ return coder.accounts.decode("pool", account.data);
38
+ };
39
+ exports.decodePoolAccount = decodePoolAccount;
40
+ const decodeVaultAccount = async (connection, accountPubkey) => {
41
+ const account = await connection.getAccountInfo(accountPubkey);
42
+ const coder = new anchor_1.BorshCoder(exports.VAULT_IDL);
43
+ return coder.accounts.decode("Vault", account.data);
44
+ };
45
+ exports.decodeVaultAccount = decodeVaultAccount;
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAC/C,gEAAiD;AAKjD,8CAAgF;AAEnE,QAAA,SAAS,GAAG,SAAS,CAAA;AACrB,QAAA,SAAS,GAAG,SAAS,CAAA;AACrB,QAAA,aAAa,GAAW,8CAA8C,CAAA;AACtE,QAAA,aAAa,GAAW,8CAA8C,CAAA;AAO5E,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAA2B,EAAE,aAA6B,EAAE,EAAE;IACpG,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAA;IAC9D,MAAM,KAAK,GAAG,IAAI,mBAAU,CAAC,iBAAgB,CAAC,CAAA;IAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAc,CAAA;AACjE,CAAC,CAAA;AAJY,QAAA,iBAAiB,qBAI7B;AAEM,MAAM,kBAAkB,GAAG,KAAK,EAAE,UAA2B,EAAE,aAA6B,EAAE,EAAE;IACrG,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAA;IAC9D,MAAM,KAAK,GAAG,IAAI,mBAAU,CAAC,iBAAgB,CAAC,CAAA;IAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAe,CAAA;AACnE,CAAC,CAAA;AAJY,QAAA,kBAAkB,sBAI9B"}