@epicentral/sos-sdk 0.10.3-beta → 0.10.5-beta

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/short/builders.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import {
2
+ getClaimBuyerSettlementInstructionAsync,
3
+ getClaimMakerSettlementInstructionAsync,
2
4
  getLiquidateWriterPositionRescueInstructionAsync,
3
5
  getOptionMintInstructionAsync,
6
+ getPrepareBuyerSettlementInstructionAsync,
7
+ getPrepareMakerSettlementInstructionAsync,
4
8
  getSettleMakerCollateralInstructionAsync,
5
9
  getSyncWriterPositionInstruction,
6
10
  getUnwindWriterUnsoldInstructionAsync,
@@ -139,6 +143,52 @@ export interface BuildSettleMakerCollateralParams {
139
143
  collateralPool?: AddressLike;
140
144
  }
141
145
 
146
+ export interface BuildPrepareBuyerSettlementParams {
147
+ optionPool: AddressLike;
148
+ optionAccount: AddressLike;
149
+ underlyingMint: AddressLike;
150
+ collateralMint: AddressLike;
151
+ positionAccount: AddressLike;
152
+ switchboardQueue: AddressLike;
153
+ marketData: AddressLike;
154
+ keeper: TransactionSigner;
155
+ collateralPool?: AddressLike;
156
+ buyerSettlementClaim?: AddressLike;
157
+ }
158
+
159
+ export interface BuildClaimBuyerSettlementParams {
160
+ optionPool: AddressLike;
161
+ optionAccount: AddressLike;
162
+ collateralMint: AddressLike;
163
+ positionAccount: AddressLike;
164
+ collateralVault: AddressLike;
165
+ buyer: TransactionSigner;
166
+ collateralPool?: AddressLike;
167
+ buyerSettlementClaim?: AddressLike;
168
+ buyerPaymentAccount?: AddressLike;
169
+ }
170
+
171
+ export interface BuildPrepareMakerSettlementParams {
172
+ optionAccount: AddressLike;
173
+ makerCollateralShare: AddressLike;
174
+ writerPosition: AddressLike;
175
+ keeper: TransactionSigner;
176
+ collateralPool?: AddressLike;
177
+ makerSettlementClaim?: AddressLike;
178
+ }
179
+
180
+ export interface BuildClaimMakerSettlementParams {
181
+ optionAccount: AddressLike;
182
+ makerCollateralShare: AddressLike;
183
+ writerPosition: AddressLike;
184
+ collateralVault: AddressLike;
185
+ collateralMint: AddressLike;
186
+ maker: TransactionSigner;
187
+ collateralPool?: AddressLike;
188
+ makerSettlementClaim?: AddressLike;
189
+ makerCollateralAccount?: AddressLike;
190
+ }
191
+
142
192
  export async function buildOptionMintInstruction(
143
193
  params: BuildOptionMintParams
144
194
  ): Promise<Instruction<string>> {
@@ -820,6 +870,80 @@ export async function buildSettleMakerCollateralTransaction(
820
870
  return { instructions: [instruction] };
821
871
  }
822
872
 
873
+ export async function buildPrepareBuyerSettlementInstruction(
874
+ params: BuildPrepareBuyerSettlementParams
875
+ ): Promise<Instruction<string>> {
876
+ return getPrepareBuyerSettlementInstructionAsync({
877
+ optionPool: toAddress(params.optionPool),
878
+ optionAccount: toAddress(params.optionAccount),
879
+ underlyingMint: toAddress(params.underlyingMint),
880
+ collateralMint: toAddress(params.collateralMint),
881
+ positionAccount: toAddress(params.positionAccount),
882
+ buyerSettlementClaim: params.buyerSettlementClaim
883
+ ? toAddress(params.buyerSettlementClaim)
884
+ : undefined,
885
+ switchboardQueue: toAddress(params.switchboardQueue),
886
+ marketData: toAddress(params.marketData),
887
+ keeper: params.keeper,
888
+ collateralPool: params.collateralPool ? toAddress(params.collateralPool) : undefined,
889
+ });
890
+ }
891
+
892
+ export async function buildClaimBuyerSettlementInstruction(
893
+ params: BuildClaimBuyerSettlementParams
894
+ ): Promise<Instruction<string>> {
895
+ return getClaimBuyerSettlementInstructionAsync({
896
+ optionPool: toAddress(params.optionPool),
897
+ optionAccount: toAddress(params.optionAccount),
898
+ collateralMint: toAddress(params.collateralMint),
899
+ positionAccount: toAddress(params.positionAccount),
900
+ buyerSettlementClaim: params.buyerSettlementClaim
901
+ ? toAddress(params.buyerSettlementClaim)
902
+ : undefined,
903
+ collateralVault: toAddress(params.collateralVault),
904
+ buyerPaymentAccount: params.buyerPaymentAccount
905
+ ? toAddress(params.buyerPaymentAccount)
906
+ : undefined,
907
+ buyer: params.buyer,
908
+ collateralPool: params.collateralPool ? toAddress(params.collateralPool) : undefined,
909
+ });
910
+ }
911
+
912
+ export async function buildPrepareMakerSettlementInstruction(
913
+ params: BuildPrepareMakerSettlementParams
914
+ ): Promise<Instruction<string>> {
915
+ return getPrepareMakerSettlementInstructionAsync({
916
+ optionAccount: toAddress(params.optionAccount),
917
+ makerCollateralShare: toAddress(params.makerCollateralShare),
918
+ writerPosition: toAddress(params.writerPosition),
919
+ makerSettlementClaim: params.makerSettlementClaim
920
+ ? toAddress(params.makerSettlementClaim)
921
+ : undefined,
922
+ keeper: params.keeper,
923
+ collateralPool: params.collateralPool ? toAddress(params.collateralPool) : undefined,
924
+ });
925
+ }
926
+
927
+ export async function buildClaimMakerSettlementInstruction(
928
+ params: BuildClaimMakerSettlementParams
929
+ ): Promise<Instruction<string>> {
930
+ return getClaimMakerSettlementInstructionAsync({
931
+ optionAccount: toAddress(params.optionAccount),
932
+ makerCollateralShare: toAddress(params.makerCollateralShare),
933
+ writerPosition: toAddress(params.writerPosition),
934
+ makerSettlementClaim: params.makerSettlementClaim
935
+ ? toAddress(params.makerSettlementClaim)
936
+ : undefined,
937
+ collateralVault: toAddress(params.collateralVault),
938
+ makerCollateralAccount: params.makerCollateralAccount
939
+ ? toAddress(params.makerCollateralAccount)
940
+ : undefined,
941
+ collateralMint: toAddress(params.collateralMint),
942
+ maker: params.maker,
943
+ collateralPool: params.collateralPool ? toAddress(params.collateralPool) : undefined,
944
+ });
945
+ }
946
+
823
947
  /**
824
948
  * Parameters for the permissioned rescue liquidation path. Gated on-chain
825
949
  * to `Vault::keeper`; the SDK does not re-verify keeper identity, but the