@epicentral/sos-sdk 0.2.2 → 0.2.4
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/generated/accounts/index.ts +0 -2
- package/generated/instructions/index.ts +0 -2
- package/generated/instructions/optionMint.ts +7 -32
- package/generated/programs/optionProgram.ts +0 -72
- package/generated/types/index.ts +0 -6
- package/omlp/service.ts +5 -0
- package/package.json +1 -1
- package/short/builders.ts +0 -4
|
@@ -8,10 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
export * from "./collateralPool";
|
|
10
10
|
export * from "./config";
|
|
11
|
-
export * from "./dualSourceContract";
|
|
12
11
|
export * from "./escrowState";
|
|
13
12
|
export * from "./lenderPosition";
|
|
14
|
-
export * from "./liquidityRouter";
|
|
15
13
|
export * from "./makerCollateralShare";
|
|
16
14
|
export * from "./marketDataAccount";
|
|
17
15
|
export * from "./optionAccount";
|
|
@@ -15,7 +15,6 @@ export * from "./claimTheta";
|
|
|
15
15
|
export * from "./closeLongToPool";
|
|
16
16
|
export * from "./closeOption";
|
|
17
17
|
export * from "./createEscrowV2";
|
|
18
|
-
export * from "./createLiquidityRouter";
|
|
19
18
|
export * from "./depositCollateral";
|
|
20
19
|
export * from "./depositToPosition";
|
|
21
20
|
export * from "./initCollateralPool";
|
|
@@ -24,7 +23,6 @@ export * from "./initializeMarketData";
|
|
|
24
23
|
export * from "./initOptionPool";
|
|
25
24
|
export * from "./liquidateWriterPosition";
|
|
26
25
|
export * from "./omlpCreateVault";
|
|
27
|
-
export * from "./omlpTakeOfferWithFailover";
|
|
28
26
|
export * from "./omlpUpdateMaxLeverage";
|
|
29
27
|
export * from "./omlpUpdateProtocolFee";
|
|
30
28
|
export * from "./omlpUpdateSupplyLimit";
|
|
@@ -92,7 +92,6 @@ export type OptionMintInstruction<
|
|
|
92
92
|
TAccountEscrowAuthority extends string | AccountMeta<string> = string,
|
|
93
93
|
TAccountEscrowTokenAccount extends string | AccountMeta<string> = string,
|
|
94
94
|
TAccountPoolLoan extends string | AccountMeta<string> = string,
|
|
95
|
-
TAccountLiquidityRouter extends string | AccountMeta<string> = string,
|
|
96
95
|
TAccountMaker extends string | AccountMeta<string> = string,
|
|
97
96
|
TAccountTokenProgram extends string | AccountMeta<string> =
|
|
98
97
|
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
|
|
@@ -178,9 +177,6 @@ export type OptionMintInstruction<
|
|
|
178
177
|
TAccountPoolLoan extends string
|
|
179
178
|
? WritableAccount<TAccountPoolLoan>
|
|
180
179
|
: TAccountPoolLoan,
|
|
181
|
-
TAccountLiquidityRouter extends string
|
|
182
|
-
? WritableAccount<TAccountLiquidityRouter>
|
|
183
|
-
: TAccountLiquidityRouter,
|
|
184
180
|
TAccountMaker extends string
|
|
185
181
|
? WritableSignerAccount<TAccountMaker> &
|
|
186
182
|
AccountSignerMeta<TAccountMaker>
|
|
@@ -298,7 +294,6 @@ export type OptionMintAsyncInput<
|
|
|
298
294
|
TAccountEscrowAuthority extends string = string,
|
|
299
295
|
TAccountEscrowTokenAccount extends string = string,
|
|
300
296
|
TAccountPoolLoan extends string = string,
|
|
301
|
-
TAccountLiquidityRouter extends string = string,
|
|
302
297
|
TAccountMaker extends string = string,
|
|
303
298
|
TAccountTokenProgram extends string = string,
|
|
304
299
|
TAccountAssociatedTokenProgram extends string = string,
|
|
@@ -358,8 +353,6 @@ export type OptionMintAsyncInput<
|
|
|
358
353
|
escrowTokenAccount?: Address<TAccountEscrowTokenAccount>;
|
|
359
354
|
/** Pool loan account (optional - only required if borrowing) */
|
|
360
355
|
poolLoan?: Address<TAccountPoolLoan>;
|
|
361
|
-
/** Liquidity router (optional - only required if borrowing with SAP1/SAP2 failover) */
|
|
362
|
-
liquidityRouter?: Address<TAccountLiquidityRouter>;
|
|
363
356
|
maker: TransactionSigner<TAccountMaker>;
|
|
364
357
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
365
358
|
associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;
|
|
@@ -400,7 +393,6 @@ export async function getOptionMintInstructionAsync<
|
|
|
400
393
|
TAccountEscrowAuthority extends string,
|
|
401
394
|
TAccountEscrowTokenAccount extends string,
|
|
402
395
|
TAccountPoolLoan extends string,
|
|
403
|
-
TAccountLiquidityRouter extends string,
|
|
404
396
|
TAccountMaker extends string,
|
|
405
397
|
TAccountTokenProgram extends string,
|
|
406
398
|
TAccountAssociatedTokenProgram extends string,
|
|
@@ -433,7 +425,6 @@ export async function getOptionMintInstructionAsync<
|
|
|
433
425
|
TAccountEscrowAuthority,
|
|
434
426
|
TAccountEscrowTokenAccount,
|
|
435
427
|
TAccountPoolLoan,
|
|
436
|
-
TAccountLiquidityRouter,
|
|
437
428
|
TAccountMaker,
|
|
438
429
|
TAccountTokenProgram,
|
|
439
430
|
TAccountAssociatedTokenProgram,
|
|
@@ -468,7 +459,6 @@ export async function getOptionMintInstructionAsync<
|
|
|
468
459
|
TAccountEscrowAuthority,
|
|
469
460
|
TAccountEscrowTokenAccount,
|
|
470
461
|
TAccountPoolLoan,
|
|
471
|
-
TAccountLiquidityRouter,
|
|
472
462
|
TAccountMaker,
|
|
473
463
|
TAccountTokenProgram,
|
|
474
464
|
TAccountAssociatedTokenProgram,
|
|
@@ -533,7 +523,6 @@ export async function getOptionMintInstructionAsync<
|
|
|
533
523
|
isWritable: true,
|
|
534
524
|
},
|
|
535
525
|
poolLoan: { value: input.poolLoan ?? null, isWritable: true },
|
|
536
|
-
liquidityRouter: { value: input.liquidityRouter ?? null, isWritable: true },
|
|
537
526
|
maker: { value: input.maker ?? null, isWritable: true },
|
|
538
527
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
539
528
|
associatedTokenProgram: {
|
|
@@ -795,7 +784,6 @@ export async function getOptionMintInstructionAsync<
|
|
|
795
784
|
getAccountMeta(accounts.escrowAuthority),
|
|
796
785
|
getAccountMeta(accounts.escrowTokenAccount),
|
|
797
786
|
getAccountMeta(accounts.poolLoan),
|
|
798
|
-
getAccountMeta(accounts.liquidityRouter),
|
|
799
787
|
getAccountMeta(accounts.maker),
|
|
800
788
|
getAccountMeta(accounts.tokenProgram),
|
|
801
789
|
getAccountMeta(accounts.associatedTokenProgram),
|
|
@@ -832,7 +820,6 @@ export async function getOptionMintInstructionAsync<
|
|
|
832
820
|
TAccountEscrowAuthority,
|
|
833
821
|
TAccountEscrowTokenAccount,
|
|
834
822
|
TAccountPoolLoan,
|
|
835
|
-
TAccountLiquidityRouter,
|
|
836
823
|
TAccountMaker,
|
|
837
824
|
TAccountTokenProgram,
|
|
838
825
|
TAccountAssociatedTokenProgram,
|
|
@@ -866,7 +853,6 @@ export type OptionMintInput<
|
|
|
866
853
|
TAccountEscrowAuthority extends string = string,
|
|
867
854
|
TAccountEscrowTokenAccount extends string = string,
|
|
868
855
|
TAccountPoolLoan extends string = string,
|
|
869
|
-
TAccountLiquidityRouter extends string = string,
|
|
870
856
|
TAccountMaker extends string = string,
|
|
871
857
|
TAccountTokenProgram extends string = string,
|
|
872
858
|
TAccountAssociatedTokenProgram extends string = string,
|
|
@@ -926,8 +912,6 @@ export type OptionMintInput<
|
|
|
926
912
|
escrowTokenAccount?: Address<TAccountEscrowTokenAccount>;
|
|
927
913
|
/** Pool loan account (optional - only required if borrowing) */
|
|
928
914
|
poolLoan?: Address<TAccountPoolLoan>;
|
|
929
|
-
/** Liquidity router (optional - only required if borrowing with SAP1/SAP2 failover) */
|
|
930
|
-
liquidityRouter?: Address<TAccountLiquidityRouter>;
|
|
931
915
|
maker: TransactionSigner<TAccountMaker>;
|
|
932
916
|
tokenProgram?: Address<TAccountTokenProgram>;
|
|
933
917
|
associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;
|
|
@@ -968,7 +952,6 @@ export function getOptionMintInstruction<
|
|
|
968
952
|
TAccountEscrowAuthority extends string,
|
|
969
953
|
TAccountEscrowTokenAccount extends string,
|
|
970
954
|
TAccountPoolLoan extends string,
|
|
971
|
-
TAccountLiquidityRouter extends string,
|
|
972
955
|
TAccountMaker extends string,
|
|
973
956
|
TAccountTokenProgram extends string,
|
|
974
957
|
TAccountAssociatedTokenProgram extends string,
|
|
@@ -1001,7 +984,6 @@ export function getOptionMintInstruction<
|
|
|
1001
984
|
TAccountEscrowAuthority,
|
|
1002
985
|
TAccountEscrowTokenAccount,
|
|
1003
986
|
TAccountPoolLoan,
|
|
1004
|
-
TAccountLiquidityRouter,
|
|
1005
987
|
TAccountMaker,
|
|
1006
988
|
TAccountTokenProgram,
|
|
1007
989
|
TAccountAssociatedTokenProgram,
|
|
@@ -1035,7 +1017,6 @@ export function getOptionMintInstruction<
|
|
|
1035
1017
|
TAccountEscrowAuthority,
|
|
1036
1018
|
TAccountEscrowTokenAccount,
|
|
1037
1019
|
TAccountPoolLoan,
|
|
1038
|
-
TAccountLiquidityRouter,
|
|
1039
1020
|
TAccountMaker,
|
|
1040
1021
|
TAccountTokenProgram,
|
|
1041
1022
|
TAccountAssociatedTokenProgram,
|
|
@@ -1099,7 +1080,6 @@ export function getOptionMintInstruction<
|
|
|
1099
1080
|
isWritable: true,
|
|
1100
1081
|
},
|
|
1101
1082
|
poolLoan: { value: input.poolLoan ?? null, isWritable: true },
|
|
1102
|
-
liquidityRouter: { value: input.liquidityRouter ?? null, isWritable: true },
|
|
1103
1083
|
maker: { value: input.maker ?? null, isWritable: true },
|
|
1104
1084
|
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1105
1085
|
associatedTokenProgram: {
|
|
@@ -1169,7 +1149,6 @@ export function getOptionMintInstruction<
|
|
|
1169
1149
|
getAccountMeta(accounts.escrowAuthority),
|
|
1170
1150
|
getAccountMeta(accounts.escrowTokenAccount),
|
|
1171
1151
|
getAccountMeta(accounts.poolLoan),
|
|
1172
|
-
getAccountMeta(accounts.liquidityRouter),
|
|
1173
1152
|
getAccountMeta(accounts.maker),
|
|
1174
1153
|
getAccountMeta(accounts.tokenProgram),
|
|
1175
1154
|
getAccountMeta(accounts.associatedTokenProgram),
|
|
@@ -1206,7 +1185,6 @@ export function getOptionMintInstruction<
|
|
|
1206
1185
|
TAccountEscrowAuthority,
|
|
1207
1186
|
TAccountEscrowTokenAccount,
|
|
1208
1187
|
TAccountPoolLoan,
|
|
1209
|
-
TAccountLiquidityRouter,
|
|
1210
1188
|
TAccountMaker,
|
|
1211
1189
|
TAccountTokenProgram,
|
|
1212
1190
|
TAccountAssociatedTokenProgram,
|
|
@@ -1274,14 +1252,12 @@ export type ParsedOptionMintInstruction<
|
|
|
1274
1252
|
escrowTokenAccount?: TAccountMetas[21] | undefined;
|
|
1275
1253
|
/** Pool loan account (optional - only required if borrowing) */
|
|
1276
1254
|
poolLoan?: TAccountMetas[22] | undefined;
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
systemProgram: TAccountMetas[28];
|
|
1284
|
-
rent: TAccountMetas[29];
|
|
1255
|
+
maker: TAccountMetas[23];
|
|
1256
|
+
tokenProgram: TAccountMetas[24];
|
|
1257
|
+
associatedTokenProgram: TAccountMetas[25];
|
|
1258
|
+
tokenMetadataProgram: TAccountMetas[26];
|
|
1259
|
+
systemProgram: TAccountMetas[27];
|
|
1260
|
+
rent: TAccountMetas[28];
|
|
1285
1261
|
};
|
|
1286
1262
|
data: OptionMintInstructionData;
|
|
1287
1263
|
};
|
|
@@ -1294,7 +1270,7 @@ export function parseOptionMintInstruction<
|
|
|
1294
1270
|
InstructionWithAccounts<TAccountMetas> &
|
|
1295
1271
|
InstructionWithData<ReadonlyUint8Array>,
|
|
1296
1272
|
): ParsedOptionMintInstruction<TProgram, TAccountMetas> {
|
|
1297
|
-
if (instruction.accounts.length <
|
|
1273
|
+
if (instruction.accounts.length < 29) {
|
|
1298
1274
|
// TODO: Coded error.
|
|
1299
1275
|
throw new Error("Not enough accounts");
|
|
1300
1276
|
}
|
|
@@ -1336,7 +1312,6 @@ export function parseOptionMintInstruction<
|
|
|
1336
1312
|
escrowAuthority: getNextOptionalAccount(),
|
|
1337
1313
|
escrowTokenAccount: getNextOptionalAccount(),
|
|
1338
1314
|
poolLoan: getNextOptionalAccount(),
|
|
1339
|
-
liquidityRouter: getNextOptionalAccount(),
|
|
1340
1315
|
maker: getNextAccount(),
|
|
1341
1316
|
tokenProgram: getNextAccount(),
|
|
1342
1317
|
associatedTokenProgram: getNextAccount(),
|
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
parseCloseLongToPoolInstruction,
|
|
27
27
|
parseCloseOptionInstruction,
|
|
28
28
|
parseCreateEscrowV2Instruction,
|
|
29
|
-
parseCreateLiquidityRouterInstruction,
|
|
30
29
|
parseDepositCollateralInstruction,
|
|
31
30
|
parseDepositToPositionInstruction,
|
|
32
31
|
parseInitCollateralPoolInstruction,
|
|
@@ -35,7 +34,6 @@ import {
|
|
|
35
34
|
parseInitOptionPoolInstruction,
|
|
36
35
|
parseLiquidateWriterPositionInstruction,
|
|
37
36
|
parseOmlpCreateVaultInstruction,
|
|
38
|
-
parseOmlpTakeOfferWithFailoverInstruction,
|
|
39
37
|
parseOmlpUpdateMaxLeverageInstruction,
|
|
40
38
|
parseOmlpUpdateProtocolFeeInstruction,
|
|
41
39
|
parseOmlpUpdateSupplyLimitInstruction,
|
|
@@ -61,7 +59,6 @@ import {
|
|
|
61
59
|
type ParsedCloseLongToPoolInstruction,
|
|
62
60
|
type ParsedCloseOptionInstruction,
|
|
63
61
|
type ParsedCreateEscrowV2Instruction,
|
|
64
|
-
type ParsedCreateLiquidityRouterInstruction,
|
|
65
62
|
type ParsedDepositCollateralInstruction,
|
|
66
63
|
type ParsedDepositToPositionInstruction,
|
|
67
64
|
type ParsedInitCollateralPoolInstruction,
|
|
@@ -70,7 +67,6 @@ import {
|
|
|
70
67
|
type ParsedInitOptionPoolInstruction,
|
|
71
68
|
type ParsedLiquidateWriterPositionInstruction,
|
|
72
69
|
type ParsedOmlpCreateVaultInstruction,
|
|
73
|
-
type ParsedOmlpTakeOfferWithFailoverInstruction,
|
|
74
70
|
type ParsedOmlpUpdateMaxLeverageInstruction,
|
|
75
71
|
type ParsedOmlpUpdateProtocolFeeInstruction,
|
|
76
72
|
type ParsedOmlpUpdateSupplyLimitInstruction,
|
|
@@ -95,10 +91,8 @@ export const OPTION_PROGRAM_PROGRAM_ADDRESS =
|
|
|
95
91
|
export enum OptionProgramAccount {
|
|
96
92
|
CollateralPool,
|
|
97
93
|
Config,
|
|
98
|
-
DualSourceContract,
|
|
99
94
|
EscrowState,
|
|
100
95
|
LenderPosition,
|
|
101
|
-
LiquidityRouter,
|
|
102
96
|
MakerCollateralShare,
|
|
103
97
|
MarketDataAccount,
|
|
104
98
|
OptionAccount,
|
|
@@ -136,17 +130,6 @@ export function identifyOptionProgramAccount(
|
|
|
136
130
|
) {
|
|
137
131
|
return OptionProgramAccount.Config;
|
|
138
132
|
}
|
|
139
|
-
if (
|
|
140
|
-
containsBytes(
|
|
141
|
-
data,
|
|
142
|
-
fixEncoderSize(getBytesEncoder(), 8).encode(
|
|
143
|
-
new Uint8Array([114, 105, 97, 181, 162, 170, 126, 215]),
|
|
144
|
-
),
|
|
145
|
-
0,
|
|
146
|
-
)
|
|
147
|
-
) {
|
|
148
|
-
return OptionProgramAccount.DualSourceContract;
|
|
149
|
-
}
|
|
150
133
|
if (
|
|
151
134
|
containsBytes(
|
|
152
135
|
data,
|
|
@@ -169,17 +152,6 @@ export function identifyOptionProgramAccount(
|
|
|
169
152
|
) {
|
|
170
153
|
return OptionProgramAccount.LenderPosition;
|
|
171
154
|
}
|
|
172
|
-
if (
|
|
173
|
-
containsBytes(
|
|
174
|
-
data,
|
|
175
|
-
fixEncoderSize(getBytesEncoder(), 8).encode(
|
|
176
|
-
new Uint8Array([151, 96, 76, 12, 200, 0, 147, 111]),
|
|
177
|
-
),
|
|
178
|
-
0,
|
|
179
|
-
)
|
|
180
|
-
) {
|
|
181
|
-
return OptionProgramAccount.LiquidityRouter;
|
|
182
|
-
}
|
|
183
155
|
if (
|
|
184
156
|
containsBytes(
|
|
185
157
|
data,
|
|
@@ -294,7 +266,6 @@ export enum OptionProgramInstruction {
|
|
|
294
266
|
CloseLongToPool,
|
|
295
267
|
CloseOption,
|
|
296
268
|
CreateEscrowV2,
|
|
297
|
-
CreateLiquidityRouter,
|
|
298
269
|
DepositCollateral,
|
|
299
270
|
DepositToPosition,
|
|
300
271
|
InitCollateralPool,
|
|
@@ -303,7 +274,6 @@ export enum OptionProgramInstruction {
|
|
|
303
274
|
InitializeMarketData,
|
|
304
275
|
LiquidateWriterPosition,
|
|
305
276
|
OmlpCreateVault,
|
|
306
|
-
OmlpTakeOfferWithFailover,
|
|
307
277
|
OmlpUpdateMaxLeverage,
|
|
308
278
|
OmlpUpdateProtocolFee,
|
|
309
279
|
OmlpUpdateSupplyLimit,
|
|
@@ -425,17 +395,6 @@ export function identifyOptionProgramInstruction(
|
|
|
425
395
|
) {
|
|
426
396
|
return OptionProgramInstruction.CreateEscrowV2;
|
|
427
397
|
}
|
|
428
|
-
if (
|
|
429
|
-
containsBytes(
|
|
430
|
-
data,
|
|
431
|
-
fixEncoderSize(getBytesEncoder(), 8).encode(
|
|
432
|
-
new Uint8Array([226, 122, 201, 80, 25, 49, 83, 84]),
|
|
433
|
-
),
|
|
434
|
-
0,
|
|
435
|
-
)
|
|
436
|
-
) {
|
|
437
|
-
return OptionProgramInstruction.CreateLiquidityRouter;
|
|
438
|
-
}
|
|
439
398
|
if (
|
|
440
399
|
containsBytes(
|
|
441
400
|
data,
|
|
@@ -524,17 +483,6 @@ export function identifyOptionProgramInstruction(
|
|
|
524
483
|
) {
|
|
525
484
|
return OptionProgramInstruction.OmlpCreateVault;
|
|
526
485
|
}
|
|
527
|
-
if (
|
|
528
|
-
containsBytes(
|
|
529
|
-
data,
|
|
530
|
-
fixEncoderSize(getBytesEncoder(), 8).encode(
|
|
531
|
-
new Uint8Array([39, 155, 118, 226, 84, 159, 5, 76]),
|
|
532
|
-
),
|
|
533
|
-
0,
|
|
534
|
-
)
|
|
535
|
-
) {
|
|
536
|
-
return OptionProgramInstruction.OmlpTakeOfferWithFailover;
|
|
537
|
-
}
|
|
538
486
|
if (
|
|
539
487
|
containsBytes(
|
|
540
488
|
data,
|
|
@@ -746,9 +694,6 @@ export type ParsedOptionProgramInstruction<
|
|
|
746
694
|
| ({
|
|
747
695
|
instructionType: OptionProgramInstruction.CreateEscrowV2;
|
|
748
696
|
} & ParsedCreateEscrowV2Instruction<TProgram>)
|
|
749
|
-
| ({
|
|
750
|
-
instructionType: OptionProgramInstruction.CreateLiquidityRouter;
|
|
751
|
-
} & ParsedCreateLiquidityRouterInstruction<TProgram>)
|
|
752
697
|
| ({
|
|
753
698
|
instructionType: OptionProgramInstruction.DepositCollateral;
|
|
754
699
|
} & ParsedDepositCollateralInstruction<TProgram>)
|
|
@@ -773,9 +718,6 @@ export type ParsedOptionProgramInstruction<
|
|
|
773
718
|
| ({
|
|
774
719
|
instructionType: OptionProgramInstruction.OmlpCreateVault;
|
|
775
720
|
} & ParsedOmlpCreateVaultInstruction<TProgram>)
|
|
776
|
-
| ({
|
|
777
|
-
instructionType: OptionProgramInstruction.OmlpTakeOfferWithFailover;
|
|
778
|
-
} & ParsedOmlpTakeOfferWithFailoverInstruction<TProgram>)
|
|
779
721
|
| ({
|
|
780
722
|
instructionType: OptionProgramInstruction.OmlpUpdateMaxLeverage;
|
|
781
723
|
} & ParsedOmlpUpdateMaxLeverageInstruction<TProgram>)
|
|
@@ -893,13 +835,6 @@ export function parseOptionProgramInstruction<TProgram extends string>(
|
|
|
893
835
|
...parseCreateEscrowV2Instruction(instruction),
|
|
894
836
|
};
|
|
895
837
|
}
|
|
896
|
-
case OptionProgramInstruction.CreateLiquidityRouter: {
|
|
897
|
-
assertIsInstructionWithAccounts(instruction);
|
|
898
|
-
return {
|
|
899
|
-
instructionType: OptionProgramInstruction.CreateLiquidityRouter,
|
|
900
|
-
...parseCreateLiquidityRouterInstruction(instruction),
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
838
|
case OptionProgramInstruction.DepositCollateral: {
|
|
904
839
|
assertIsInstructionWithAccounts(instruction);
|
|
905
840
|
return {
|
|
@@ -956,13 +891,6 @@ export function parseOptionProgramInstruction<TProgram extends string>(
|
|
|
956
891
|
...parseOmlpCreateVaultInstruction(instruction),
|
|
957
892
|
};
|
|
958
893
|
}
|
|
959
|
-
case OptionProgramInstruction.OmlpTakeOfferWithFailover: {
|
|
960
|
-
assertIsInstructionWithAccounts(instruction);
|
|
961
|
-
return {
|
|
962
|
-
instructionType: OptionProgramInstruction.OmlpTakeOfferWithFailover,
|
|
963
|
-
...parseOmlpTakeOfferWithFailoverInstruction(instruction),
|
|
964
|
-
};
|
|
965
|
-
}
|
|
966
894
|
case OptionProgramInstruction.OmlpUpdateMaxLeverage: {
|
|
967
895
|
assertIsInstructionWithAccounts(instruction);
|
|
968
896
|
return {
|
package/generated/types/index.ts
CHANGED
|
@@ -6,13 +6,8 @@
|
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export * from "./borrowedFromSAP1";
|
|
10
|
-
export * from "./borrowedFromSAP2";
|
|
11
|
-
export * from "./failoverTriggered";
|
|
12
9
|
export * from "./impliedVolatilityUpdated";
|
|
13
10
|
export * from "./liquidationExecuted";
|
|
14
|
-
export * from "./liquidityMetrics";
|
|
15
|
-
export * from "./liquidityRouterCreated";
|
|
16
11
|
export * from "./marketDataInitialized";
|
|
17
12
|
export * from "./marketDataUpdated";
|
|
18
13
|
export * from "./optionClosed";
|
|
@@ -27,6 +22,5 @@ export * from "./positionDeposited";
|
|
|
27
22
|
export * from "./positionWithdrawn";
|
|
28
23
|
export * from "./priceFeedMessage";
|
|
29
24
|
export * from "./protocolFeeUpdated";
|
|
30
|
-
export * from "./sap2Provider";
|
|
31
25
|
export * from "./vaultCreated";
|
|
32
26
|
export * from "./verificationLevel";
|
package/omlp/service.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OMLP (Option Maker Liquidity Pool) service – V2 pool-based API only.
|
|
3
|
+
* Exposes: depositToPosition, withdrawFromPosition, withdrawAllFromPosition, withdrawInterestFromPosition.
|
|
4
|
+
* Borrow/repay use short/pool (buildBorrowFromPool*, buildRepayPoolLoan*). Legacy offer-based instructions are not exposed.
|
|
5
|
+
*/
|
|
1
6
|
import { fetchLenderPosition, fetchVault } from "../accounts/fetchers";
|
|
2
7
|
import type { KitRpc } from "../client/types";
|
|
3
8
|
import {
|
package/package.json
CHANGED
package/short/builders.ts
CHANGED
|
@@ -55,7 +55,6 @@ export interface BuildOptionMintParams {
|
|
|
55
55
|
escrowAuthority?: AddressLike;
|
|
56
56
|
escrowTokenAccount?: AddressLike;
|
|
57
57
|
poolLoan?: AddressLike;
|
|
58
|
-
liquidityRouter?: AddressLike;
|
|
59
58
|
remainingAccounts?: RemainingAccountInput[];
|
|
60
59
|
}
|
|
61
60
|
|
|
@@ -168,7 +167,6 @@ export async function buildOptionMintInstruction(
|
|
|
168
167
|
? toAddress(params.escrowTokenAccount)
|
|
169
168
|
: undefined,
|
|
170
169
|
poolLoan: params.poolLoan ? toAddress(params.poolLoan) : undefined,
|
|
171
|
-
liquidityRouter: params.liquidityRouter ? toAddress(params.liquidityRouter) : undefined,
|
|
172
170
|
maker: toAddress(params.maker) as any,
|
|
173
171
|
optionType: params.optionType,
|
|
174
172
|
strikePrice: params.strikePrice,
|
|
@@ -210,7 +208,6 @@ export interface BuildOptionMintTransactionWithDerivationParams {
|
|
|
210
208
|
escrowAuthority?: AddressLike;
|
|
211
209
|
escrowTokenAccount?: AddressLike;
|
|
212
210
|
poolLoan?: AddressLike;
|
|
213
|
-
liquidityRouter?: AddressLike;
|
|
214
211
|
remainingAccounts?: RemainingAccountInput[];
|
|
215
212
|
}
|
|
216
213
|
|
|
@@ -278,7 +275,6 @@ export async function buildOptionMintTransactionWithDerivation(
|
|
|
278
275
|
escrowAuthority: params.escrowAuthority,
|
|
279
276
|
escrowTokenAccount: params.escrowTokenAccount,
|
|
280
277
|
poolLoan: params.poolLoan,
|
|
281
|
-
liquidityRouter: params.liquidityRouter,
|
|
282
278
|
remainingAccounts: params.remainingAccounts,
|
|
283
279
|
});
|
|
284
280
|
}
|