@epicentral/sos-sdk 0.1.0
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/LICENSE +21 -0
- package/README.md +239 -0
- package/accounts/fetchers.ts +140 -0
- package/accounts/list.ts +152 -0
- package/accounts/pdas.ts +308 -0
- package/client/lookup-table.ts +32 -0
- package/client/program.ts +13 -0
- package/client/types.ts +8 -0
- package/generated/accounts/collateralPool.ts +217 -0
- package/generated/accounts/config.ts +156 -0
- package/generated/accounts/dualSourceContract.ts +235 -0
- package/generated/accounts/escrowState.ts +183 -0
- package/generated/accounts/index.ts +24 -0
- package/generated/accounts/lenderPosition.ts +211 -0
- package/generated/accounts/liquidityRouter.ts +223 -0
- package/generated/accounts/makerCollateralShare.ts +229 -0
- package/generated/accounts/makerPoolShare.ts +203 -0
- package/generated/accounts/marketDataAccount.ts +176 -0
- package/generated/accounts/optionAccount.ts +247 -0
- package/generated/accounts/optionPool.ts +253 -0
- package/generated/accounts/poolLoan.ts +220 -0
- package/generated/accounts/positionAccount.ts +187 -0
- package/generated/accounts/priceUpdateV2.ts +163 -0
- package/generated/accounts/vault.ts +304 -0
- package/generated/accounts/writerPosition.ts +297 -0
- package/generated/errors/index.ts +9 -0
- package/generated/errors/optionProgram.ts +392 -0
- package/generated/index.ts +13 -0
- package/generated/instructions/acceptAdmin.ts +230 -0
- package/generated/instructions/autoExerciseAllExpired.ts +523 -0
- package/generated/instructions/autoExerciseExpired.ts +623 -0
- package/generated/instructions/borrowFromPool.ts +554 -0
- package/generated/instructions/buyFromPool.ts +684 -0
- package/generated/instructions/claimPremium.ts +377 -0
- package/generated/instructions/closeLongToPool.ts +716 -0
- package/generated/instructions/closeOption.ts +235 -0
- package/generated/instructions/createEscrowV2.ts +518 -0
- package/generated/instructions/createLiquidityRouter.ts +361 -0
- package/generated/instructions/depositCollateral.ts +624 -0
- package/generated/instructions/depositToPool.ts +497 -0
- package/generated/instructions/depositToPosition.ts +429 -0
- package/generated/instructions/index.ts +45 -0
- package/generated/instructions/initCollateralPool.ts +513 -0
- package/generated/instructions/initConfig.ts +279 -0
- package/generated/instructions/initOptionPool.ts +587 -0
- package/generated/instructions/initializeMarketData.ts +359 -0
- package/generated/instructions/liquidateWriterPosition.ts +592 -0
- package/generated/instructions/omlpCreateVault.ts +547 -0
- package/generated/instructions/omlpTakeOfferWithFailover.ts +606 -0
- package/generated/instructions/omlpUpdateMaxLeverage.ts +304 -0
- package/generated/instructions/omlpUpdateProtocolFee.ts +304 -0
- package/generated/instructions/omlpUpdateSupplyLimit.ts +304 -0
- package/generated/instructions/optionExercise.ts +540 -0
- package/generated/instructions/optionMint.ts +1349 -0
- package/generated/instructions/optionValidate.ts +255 -0
- package/generated/instructions/repayPoolLoan.ts +499 -0
- package/generated/instructions/repayPoolLoanFromCollateral.ts +514 -0
- package/generated/instructions/settleMakerCollateral.ts +472 -0
- package/generated/instructions/syncWriterPosition.ts +206 -0
- package/generated/instructions/transferAdmin.ts +245 -0
- package/generated/instructions/unwindWriterUnsold.ts +668 -0
- package/generated/instructions/updateImpliedVolatility.ts +226 -0
- package/generated/instructions/updateMarketData.ts +315 -0
- package/generated/instructions/withdrawFromPool.ts +429 -0
- package/generated/instructions/withdrawFromPosition.ts +405 -0
- package/generated/instructions/writeToPool.ts +594 -0
- package/generated/programs/index.ts +9 -0
- package/generated/programs/optionProgram.ts +832 -0
- package/generated/shared/index.ts +164 -0
- package/generated/types/borrowedFromSAP1.ts +75 -0
- package/generated/types/borrowedFromSAP2.ts +83 -0
- package/generated/types/failoverTriggered.ts +85 -0
- package/generated/types/impliedVolatilityUpdated.ts +73 -0
- package/generated/types/index.ts +32 -0
- package/generated/types/liquidationExecuted.ts +73 -0
- package/generated/types/liquidityMetrics.ts +69 -0
- package/generated/types/liquidityRouterCreated.ts +79 -0
- package/generated/types/marketDataInitialized.ts +61 -0
- package/generated/types/marketDataUpdated.ts +69 -0
- package/generated/types/optionClosed.ts +56 -0
- package/generated/types/optionExercised.ts +62 -0
- package/generated/types/optionExpired.ts +49 -0
- package/generated/types/optionMinted.ts +78 -0
- package/generated/types/optionType.ts +38 -0
- package/generated/types/optionValidated.ts +82 -0
- package/generated/types/poolLoanCreated.ts +74 -0
- package/generated/types/poolLoanRepaid.ts +74 -0
- package/generated/types/positionDeposited.ts +73 -0
- package/generated/types/positionWithdrawn.ts +81 -0
- package/generated/types/priceFeedMessage.ts +117 -0
- package/generated/types/protocolFeeUpdated.ts +69 -0
- package/generated/types/sap2Provider.ts +38 -0
- package/generated/types/vaultCreated.ts +60 -0
- package/generated/types/verificationLevel.ts +95 -0
- package/index.ts +25 -0
- package/long/builders.ts +126 -0
- package/long/exercise.ts +49 -0
- package/long/quotes.ts +48 -0
- package/omlp/builders.ts +74 -0
- package/omlp/service.ts +94 -0
- package/package.json +22 -0
- package/shared/amounts.ts +32 -0
- package/shared/errors.ts +12 -0
- package/shared/remaining-accounts.ts +41 -0
- package/shared/transactions.ts +49 -0
- package/short/builders.ts +268 -0
- package/short/claim-premium.ts +37 -0
- package/short/close-option.ts +34 -0
- package/short/pool.ts +224 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getI64Decoder,
|
|
14
|
+
getI64Encoder,
|
|
15
|
+
getStructDecoder,
|
|
16
|
+
getStructEncoder,
|
|
17
|
+
getU16Decoder,
|
|
18
|
+
getU16Encoder,
|
|
19
|
+
type Address,
|
|
20
|
+
type FixedSizeCodec,
|
|
21
|
+
type FixedSizeDecoder,
|
|
22
|
+
type FixedSizeEncoder,
|
|
23
|
+
} from "@solana/kit";
|
|
24
|
+
import {
|
|
25
|
+
getSap2ProviderDecoder,
|
|
26
|
+
getSap2ProviderEncoder,
|
|
27
|
+
type Sap2Provider,
|
|
28
|
+
type Sap2ProviderArgs,
|
|
29
|
+
} from ".";
|
|
30
|
+
|
|
31
|
+
export type LiquidityRouterCreated = {
|
|
32
|
+
router: Address;
|
|
33
|
+
sap1Vault: Address;
|
|
34
|
+
sap2Program: Address;
|
|
35
|
+
sap2Provider: Sap2Provider;
|
|
36
|
+
utilizationThreshold: number;
|
|
37
|
+
createdAt: bigint;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type LiquidityRouterCreatedArgs = {
|
|
41
|
+
router: Address;
|
|
42
|
+
sap1Vault: Address;
|
|
43
|
+
sap2Program: Address;
|
|
44
|
+
sap2Provider: Sap2ProviderArgs;
|
|
45
|
+
utilizationThreshold: number;
|
|
46
|
+
createdAt: number | bigint;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function getLiquidityRouterCreatedEncoder(): FixedSizeEncoder<LiquidityRouterCreatedArgs> {
|
|
50
|
+
return getStructEncoder([
|
|
51
|
+
["router", getAddressEncoder()],
|
|
52
|
+
["sap1Vault", getAddressEncoder()],
|
|
53
|
+
["sap2Program", getAddressEncoder()],
|
|
54
|
+
["sap2Provider", getSap2ProviderEncoder()],
|
|
55
|
+
["utilizationThreshold", getU16Encoder()],
|
|
56
|
+
["createdAt", getI64Encoder()],
|
|
57
|
+
]);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function getLiquidityRouterCreatedDecoder(): FixedSizeDecoder<LiquidityRouterCreated> {
|
|
61
|
+
return getStructDecoder([
|
|
62
|
+
["router", getAddressDecoder()],
|
|
63
|
+
["sap1Vault", getAddressDecoder()],
|
|
64
|
+
["sap2Program", getAddressDecoder()],
|
|
65
|
+
["sap2Provider", getSap2ProviderDecoder()],
|
|
66
|
+
["utilizationThreshold", getU16Decoder()],
|
|
67
|
+
["createdAt", getI64Decoder()],
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getLiquidityRouterCreatedCodec(): FixedSizeCodec<
|
|
72
|
+
LiquidityRouterCreatedArgs,
|
|
73
|
+
LiquidityRouterCreated
|
|
74
|
+
> {
|
|
75
|
+
return combineCodec(
|
|
76
|
+
getLiquidityRouterCreatedEncoder(),
|
|
77
|
+
getLiquidityRouterCreatedDecoder(),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getF64Decoder,
|
|
14
|
+
getF64Encoder,
|
|
15
|
+
getStructDecoder,
|
|
16
|
+
getStructEncoder,
|
|
17
|
+
type Address,
|
|
18
|
+
type FixedSizeCodec,
|
|
19
|
+
type FixedSizeDecoder,
|
|
20
|
+
type FixedSizeEncoder,
|
|
21
|
+
} from "@solana/kit";
|
|
22
|
+
|
|
23
|
+
export type MarketDataInitialized = {
|
|
24
|
+
marketData: Address;
|
|
25
|
+
underlyingAsset: Address;
|
|
26
|
+
authority: Address;
|
|
27
|
+
riskFreeRate: number;
|
|
28
|
+
historicalVolatility: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type MarketDataInitializedArgs = MarketDataInitialized;
|
|
32
|
+
|
|
33
|
+
export function getMarketDataInitializedEncoder(): FixedSizeEncoder<MarketDataInitializedArgs> {
|
|
34
|
+
return getStructEncoder([
|
|
35
|
+
["marketData", getAddressEncoder()],
|
|
36
|
+
["underlyingAsset", getAddressEncoder()],
|
|
37
|
+
["authority", getAddressEncoder()],
|
|
38
|
+
["riskFreeRate", getF64Encoder()],
|
|
39
|
+
["historicalVolatility", getF64Encoder()],
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function getMarketDataInitializedDecoder(): FixedSizeDecoder<MarketDataInitialized> {
|
|
44
|
+
return getStructDecoder([
|
|
45
|
+
["marketData", getAddressDecoder()],
|
|
46
|
+
["underlyingAsset", getAddressDecoder()],
|
|
47
|
+
["authority", getAddressDecoder()],
|
|
48
|
+
["riskFreeRate", getF64Decoder()],
|
|
49
|
+
["historicalVolatility", getF64Decoder()],
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function getMarketDataInitializedCodec(): FixedSizeCodec<
|
|
54
|
+
MarketDataInitializedArgs,
|
|
55
|
+
MarketDataInitialized
|
|
56
|
+
> {
|
|
57
|
+
return combineCodec(
|
|
58
|
+
getMarketDataInitializedEncoder(),
|
|
59
|
+
getMarketDataInitializedDecoder(),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getF64Decoder,
|
|
14
|
+
getF64Encoder,
|
|
15
|
+
getI64Decoder,
|
|
16
|
+
getI64Encoder,
|
|
17
|
+
getStructDecoder,
|
|
18
|
+
getStructEncoder,
|
|
19
|
+
type Address,
|
|
20
|
+
type FixedSizeCodec,
|
|
21
|
+
type FixedSizeDecoder,
|
|
22
|
+
type FixedSizeEncoder,
|
|
23
|
+
} from "@solana/kit";
|
|
24
|
+
|
|
25
|
+
export type MarketDataUpdated = {
|
|
26
|
+
marketData: Address;
|
|
27
|
+
underlyingAsset: Address;
|
|
28
|
+
riskFreeRate: number;
|
|
29
|
+
historicalVolatility: number;
|
|
30
|
+
updatedAt: bigint;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type MarketDataUpdatedArgs = {
|
|
34
|
+
marketData: Address;
|
|
35
|
+
underlyingAsset: Address;
|
|
36
|
+
riskFreeRate: number;
|
|
37
|
+
historicalVolatility: number;
|
|
38
|
+
updatedAt: number | bigint;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function getMarketDataUpdatedEncoder(): FixedSizeEncoder<MarketDataUpdatedArgs> {
|
|
42
|
+
return getStructEncoder([
|
|
43
|
+
["marketData", getAddressEncoder()],
|
|
44
|
+
["underlyingAsset", getAddressEncoder()],
|
|
45
|
+
["riskFreeRate", getF64Encoder()],
|
|
46
|
+
["historicalVolatility", getF64Encoder()],
|
|
47
|
+
["updatedAt", getI64Encoder()],
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getMarketDataUpdatedDecoder(): FixedSizeDecoder<MarketDataUpdated> {
|
|
52
|
+
return getStructDecoder([
|
|
53
|
+
["marketData", getAddressDecoder()],
|
|
54
|
+
["underlyingAsset", getAddressDecoder()],
|
|
55
|
+
["riskFreeRate", getF64Decoder()],
|
|
56
|
+
["historicalVolatility", getF64Decoder()],
|
|
57
|
+
["updatedAt", getI64Decoder()],
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function getMarketDataUpdatedCodec(): FixedSizeCodec<
|
|
62
|
+
MarketDataUpdatedArgs,
|
|
63
|
+
MarketDataUpdated
|
|
64
|
+
> {
|
|
65
|
+
return combineCodec(
|
|
66
|
+
getMarketDataUpdatedEncoder(),
|
|
67
|
+
getMarketDataUpdatedDecoder(),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getStructDecoder,
|
|
14
|
+
getStructEncoder,
|
|
15
|
+
getU64Decoder,
|
|
16
|
+
getU64Encoder,
|
|
17
|
+
type Address,
|
|
18
|
+
type FixedSizeCodec,
|
|
19
|
+
type FixedSizeDecoder,
|
|
20
|
+
type FixedSizeEncoder,
|
|
21
|
+
} from "@solana/kit";
|
|
22
|
+
|
|
23
|
+
export type OptionClosed = {
|
|
24
|
+
optionAccount: Address;
|
|
25
|
+
maker: Address;
|
|
26
|
+
tokensBurned: bigint;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type OptionClosedArgs = {
|
|
30
|
+
optionAccount: Address;
|
|
31
|
+
maker: Address;
|
|
32
|
+
tokensBurned: number | bigint;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export function getOptionClosedEncoder(): FixedSizeEncoder<OptionClosedArgs> {
|
|
36
|
+
return getStructEncoder([
|
|
37
|
+
["optionAccount", getAddressEncoder()],
|
|
38
|
+
["maker", getAddressEncoder()],
|
|
39
|
+
["tokensBurned", getU64Encoder()],
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function getOptionClosedDecoder(): FixedSizeDecoder<OptionClosed> {
|
|
44
|
+
return getStructDecoder([
|
|
45
|
+
["optionAccount", getAddressDecoder()],
|
|
46
|
+
["maker", getAddressDecoder()],
|
|
47
|
+
["tokensBurned", getU64Decoder()],
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getOptionClosedCodec(): FixedSizeCodec<
|
|
52
|
+
OptionClosedArgs,
|
|
53
|
+
OptionClosed
|
|
54
|
+
> {
|
|
55
|
+
return combineCodec(getOptionClosedEncoder(), getOptionClosedDecoder());
|
|
56
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getI64Decoder,
|
|
14
|
+
getI64Encoder,
|
|
15
|
+
getStructDecoder,
|
|
16
|
+
getStructEncoder,
|
|
17
|
+
getU64Decoder,
|
|
18
|
+
getU64Encoder,
|
|
19
|
+
type Address,
|
|
20
|
+
type FixedSizeCodec,
|
|
21
|
+
type FixedSizeDecoder,
|
|
22
|
+
type FixedSizeEncoder,
|
|
23
|
+
} from "@solana/kit";
|
|
24
|
+
|
|
25
|
+
export type OptionExercised = {
|
|
26
|
+
buyer: Address;
|
|
27
|
+
optionAccount: Address;
|
|
28
|
+
exerciseValue: bigint;
|
|
29
|
+
exercisedAt: bigint;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type OptionExercisedArgs = {
|
|
33
|
+
buyer: Address;
|
|
34
|
+
optionAccount: Address;
|
|
35
|
+
exerciseValue: number | bigint;
|
|
36
|
+
exercisedAt: number | bigint;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export function getOptionExercisedEncoder(): FixedSizeEncoder<OptionExercisedArgs> {
|
|
40
|
+
return getStructEncoder([
|
|
41
|
+
["buyer", getAddressEncoder()],
|
|
42
|
+
["optionAccount", getAddressEncoder()],
|
|
43
|
+
["exerciseValue", getU64Encoder()],
|
|
44
|
+
["exercisedAt", getI64Encoder()],
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function getOptionExercisedDecoder(): FixedSizeDecoder<OptionExercised> {
|
|
49
|
+
return getStructDecoder([
|
|
50
|
+
["buyer", getAddressDecoder()],
|
|
51
|
+
["optionAccount", getAddressDecoder()],
|
|
52
|
+
["exerciseValue", getU64Decoder()],
|
|
53
|
+
["exercisedAt", getI64Decoder()],
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function getOptionExercisedCodec(): FixedSizeCodec<
|
|
58
|
+
OptionExercisedArgs,
|
|
59
|
+
OptionExercised
|
|
60
|
+
> {
|
|
61
|
+
return combineCodec(getOptionExercisedEncoder(), getOptionExercisedDecoder());
|
|
62
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getI64Decoder,
|
|
14
|
+
getI64Encoder,
|
|
15
|
+
getStructDecoder,
|
|
16
|
+
getStructEncoder,
|
|
17
|
+
type Address,
|
|
18
|
+
type FixedSizeCodec,
|
|
19
|
+
type FixedSizeDecoder,
|
|
20
|
+
type FixedSizeEncoder,
|
|
21
|
+
} from "@solana/kit";
|
|
22
|
+
|
|
23
|
+
export type OptionExpired = { optionAccount: Address; expiredAt: bigint };
|
|
24
|
+
|
|
25
|
+
export type OptionExpiredArgs = {
|
|
26
|
+
optionAccount: Address;
|
|
27
|
+
expiredAt: number | bigint;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export function getOptionExpiredEncoder(): FixedSizeEncoder<OptionExpiredArgs> {
|
|
31
|
+
return getStructEncoder([
|
|
32
|
+
["optionAccount", getAddressEncoder()],
|
|
33
|
+
["expiredAt", getI64Encoder()],
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function getOptionExpiredDecoder(): FixedSizeDecoder<OptionExpired> {
|
|
38
|
+
return getStructDecoder([
|
|
39
|
+
["optionAccount", getAddressDecoder()],
|
|
40
|
+
["expiredAt", getI64Decoder()],
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function getOptionExpiredCodec(): FixedSizeCodec<
|
|
45
|
+
OptionExpiredArgs,
|
|
46
|
+
OptionExpired
|
|
47
|
+
> {
|
|
48
|
+
return combineCodec(getOptionExpiredEncoder(), getOptionExpiredDecoder());
|
|
49
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getF64Decoder,
|
|
14
|
+
getF64Encoder,
|
|
15
|
+
getI64Decoder,
|
|
16
|
+
getI64Encoder,
|
|
17
|
+
getStructDecoder,
|
|
18
|
+
getStructEncoder,
|
|
19
|
+
getU64Decoder,
|
|
20
|
+
getU64Encoder,
|
|
21
|
+
type Address,
|
|
22
|
+
type FixedSizeCodec,
|
|
23
|
+
type FixedSizeDecoder,
|
|
24
|
+
type FixedSizeEncoder,
|
|
25
|
+
} from "@solana/kit";
|
|
26
|
+
import {
|
|
27
|
+
getOptionTypeDecoder,
|
|
28
|
+
getOptionTypeEncoder,
|
|
29
|
+
type OptionType,
|
|
30
|
+
type OptionTypeArgs,
|
|
31
|
+
} from ".";
|
|
32
|
+
|
|
33
|
+
export type OptionMinted = {
|
|
34
|
+
optionAccount: Address;
|
|
35
|
+
maker: Address;
|
|
36
|
+
optionType: OptionType;
|
|
37
|
+
strikePrice: number;
|
|
38
|
+
expirationDate: bigint;
|
|
39
|
+
quantity: bigint;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type OptionMintedArgs = {
|
|
43
|
+
optionAccount: Address;
|
|
44
|
+
maker: Address;
|
|
45
|
+
optionType: OptionTypeArgs;
|
|
46
|
+
strikePrice: number;
|
|
47
|
+
expirationDate: number | bigint;
|
|
48
|
+
quantity: number | bigint;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export function getOptionMintedEncoder(): FixedSizeEncoder<OptionMintedArgs> {
|
|
52
|
+
return getStructEncoder([
|
|
53
|
+
["optionAccount", getAddressEncoder()],
|
|
54
|
+
["maker", getAddressEncoder()],
|
|
55
|
+
["optionType", getOptionTypeEncoder()],
|
|
56
|
+
["strikePrice", getF64Encoder()],
|
|
57
|
+
["expirationDate", getI64Encoder()],
|
|
58
|
+
["quantity", getU64Encoder()],
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function getOptionMintedDecoder(): FixedSizeDecoder<OptionMinted> {
|
|
63
|
+
return getStructDecoder([
|
|
64
|
+
["optionAccount", getAddressDecoder()],
|
|
65
|
+
["maker", getAddressDecoder()],
|
|
66
|
+
["optionType", getOptionTypeDecoder()],
|
|
67
|
+
["strikePrice", getF64Decoder()],
|
|
68
|
+
["expirationDate", getI64Decoder()],
|
|
69
|
+
["quantity", getU64Decoder()],
|
|
70
|
+
]);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function getOptionMintedCodec(): FixedSizeCodec<
|
|
74
|
+
OptionMintedArgs,
|
|
75
|
+
OptionMinted
|
|
76
|
+
> {
|
|
77
|
+
return combineCodec(getOptionMintedEncoder(), getOptionMintedDecoder());
|
|
78
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getEnumDecoder,
|
|
12
|
+
getEnumEncoder,
|
|
13
|
+
type FixedSizeCodec,
|
|
14
|
+
type FixedSizeDecoder,
|
|
15
|
+
type FixedSizeEncoder,
|
|
16
|
+
} from "@solana/kit";
|
|
17
|
+
|
|
18
|
+
export enum OptionType {
|
|
19
|
+
Call,
|
|
20
|
+
Put,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type OptionTypeArgs = OptionType;
|
|
24
|
+
|
|
25
|
+
export function getOptionTypeEncoder(): FixedSizeEncoder<OptionTypeArgs> {
|
|
26
|
+
return getEnumEncoder(OptionType);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getOptionTypeDecoder(): FixedSizeDecoder<OptionType> {
|
|
30
|
+
return getEnumDecoder(OptionType);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getOptionTypeCodec(): FixedSizeCodec<
|
|
34
|
+
OptionTypeArgs,
|
|
35
|
+
OptionType
|
|
36
|
+
> {
|
|
37
|
+
return combineCodec(getOptionTypeEncoder(), getOptionTypeDecoder());
|
|
38
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getF64Decoder,
|
|
14
|
+
getF64Encoder,
|
|
15
|
+
getI64Decoder,
|
|
16
|
+
getI64Encoder,
|
|
17
|
+
getStructDecoder,
|
|
18
|
+
getStructEncoder,
|
|
19
|
+
type Address,
|
|
20
|
+
type FixedSizeCodec,
|
|
21
|
+
type FixedSizeDecoder,
|
|
22
|
+
type FixedSizeEncoder,
|
|
23
|
+
} from "@solana/kit";
|
|
24
|
+
|
|
25
|
+
export type OptionValidated = {
|
|
26
|
+
optionAccount: Address;
|
|
27
|
+
premium: number;
|
|
28
|
+
delta: number;
|
|
29
|
+
gamma: number;
|
|
30
|
+
theta: number;
|
|
31
|
+
vega: number;
|
|
32
|
+
rho: number;
|
|
33
|
+
underlyingPrice: number;
|
|
34
|
+
validatedAt: bigint;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type OptionValidatedArgs = {
|
|
38
|
+
optionAccount: Address;
|
|
39
|
+
premium: number;
|
|
40
|
+
delta: number;
|
|
41
|
+
gamma: number;
|
|
42
|
+
theta: number;
|
|
43
|
+
vega: number;
|
|
44
|
+
rho: number;
|
|
45
|
+
underlyingPrice: number;
|
|
46
|
+
validatedAt: number | bigint;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function getOptionValidatedEncoder(): FixedSizeEncoder<OptionValidatedArgs> {
|
|
50
|
+
return getStructEncoder([
|
|
51
|
+
["optionAccount", getAddressEncoder()],
|
|
52
|
+
["premium", getF64Encoder()],
|
|
53
|
+
["delta", getF64Encoder()],
|
|
54
|
+
["gamma", getF64Encoder()],
|
|
55
|
+
["theta", getF64Encoder()],
|
|
56
|
+
["vega", getF64Encoder()],
|
|
57
|
+
["rho", getF64Encoder()],
|
|
58
|
+
["underlyingPrice", getF64Encoder()],
|
|
59
|
+
["validatedAt", getI64Encoder()],
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function getOptionValidatedDecoder(): FixedSizeDecoder<OptionValidated> {
|
|
64
|
+
return getStructDecoder([
|
|
65
|
+
["optionAccount", getAddressDecoder()],
|
|
66
|
+
["premium", getF64Decoder()],
|
|
67
|
+
["delta", getF64Decoder()],
|
|
68
|
+
["gamma", getF64Decoder()],
|
|
69
|
+
["theta", getF64Decoder()],
|
|
70
|
+
["vega", getF64Decoder()],
|
|
71
|
+
["rho", getF64Decoder()],
|
|
72
|
+
["underlyingPrice", getF64Decoder()],
|
|
73
|
+
["validatedAt", getI64Decoder()],
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function getOptionValidatedCodec(): FixedSizeCodec<
|
|
78
|
+
OptionValidatedArgs,
|
|
79
|
+
OptionValidated
|
|
80
|
+
> {
|
|
81
|
+
return combineCodec(getOptionValidatedEncoder(), getOptionValidatedDecoder());
|
|
82
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
combineCodec,
|
|
11
|
+
getAddressDecoder,
|
|
12
|
+
getAddressEncoder,
|
|
13
|
+
getStructDecoder,
|
|
14
|
+
getStructEncoder,
|
|
15
|
+
getU16Decoder,
|
|
16
|
+
getU16Encoder,
|
|
17
|
+
getU64Decoder,
|
|
18
|
+
getU64Encoder,
|
|
19
|
+
type Address,
|
|
20
|
+
type FixedSizeCodec,
|
|
21
|
+
type FixedSizeDecoder,
|
|
22
|
+
type FixedSizeEncoder,
|
|
23
|
+
} from "@solana/kit";
|
|
24
|
+
|
|
25
|
+
export type PoolLoanCreated = {
|
|
26
|
+
poolLoan: Address;
|
|
27
|
+
maker: Address;
|
|
28
|
+
vault: Address;
|
|
29
|
+
principal: bigint;
|
|
30
|
+
rateBps: number;
|
|
31
|
+
collateral: bigint;
|
|
32
|
+
startSlot: bigint;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type PoolLoanCreatedArgs = {
|
|
36
|
+
poolLoan: Address;
|
|
37
|
+
maker: Address;
|
|
38
|
+
vault: Address;
|
|
39
|
+
principal: number | bigint;
|
|
40
|
+
rateBps: number;
|
|
41
|
+
collateral: number | bigint;
|
|
42
|
+
startSlot: number | bigint;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export function getPoolLoanCreatedEncoder(): FixedSizeEncoder<PoolLoanCreatedArgs> {
|
|
46
|
+
return getStructEncoder([
|
|
47
|
+
["poolLoan", getAddressEncoder()],
|
|
48
|
+
["maker", getAddressEncoder()],
|
|
49
|
+
["vault", getAddressEncoder()],
|
|
50
|
+
["principal", getU64Encoder()],
|
|
51
|
+
["rateBps", getU16Encoder()],
|
|
52
|
+
["collateral", getU64Encoder()],
|
|
53
|
+
["startSlot", getU64Encoder()],
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function getPoolLoanCreatedDecoder(): FixedSizeDecoder<PoolLoanCreated> {
|
|
58
|
+
return getStructDecoder([
|
|
59
|
+
["poolLoan", getAddressDecoder()],
|
|
60
|
+
["maker", getAddressDecoder()],
|
|
61
|
+
["vault", getAddressDecoder()],
|
|
62
|
+
["principal", getU64Decoder()],
|
|
63
|
+
["rateBps", getU16Decoder()],
|
|
64
|
+
["collateral", getU64Decoder()],
|
|
65
|
+
["startSlot", getU64Decoder()],
|
|
66
|
+
]);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function getPoolLoanCreatedCodec(): FixedSizeCodec<
|
|
70
|
+
PoolLoanCreatedArgs,
|
|
71
|
+
PoolLoanCreated
|
|
72
|
+
> {
|
|
73
|
+
return combineCodec(getPoolLoanCreatedEncoder(), getPoolLoanCreatedDecoder());
|
|
74
|
+
}
|