@glamsystems/glam-sdk 1.1.0 → 1.1.1-alpha.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/index.cjs.d.ts +0 -1
- package/index.cjs.js +120789 -1
- package/index.esm.d.ts +0 -1
- package/index.esm.js +120308 -1
- package/package.json +15 -27
- package/target/idl/glam_mint-staging.json +480 -1
- package/target/idl/glam_mint.json +247 -1
- package/target/types/glam_mint-staging.ts +480 -1
- package/target/types/glam_mint.ts +247 -1
- package/LICENSE +0 -201
- package/buffer-layout.d.ts +0 -88
- package/src/assets.d.ts +0 -39
- package/src/client/access.d.ts +0 -57
- package/src/client/base.d.ts +0 -234
- package/src/client/bridge.d.ts +0 -205
- package/src/client/bridgeRegistry.d.ts +0 -32
- package/src/client/cctp.d.ts +0 -164
- package/src/client/epi.d.ts +0 -228
- package/src/client/fees.d.ts +0 -33
- package/src/client/invest.d.ts +0 -37
- package/src/client/jupiter-lend/borrow.d.ts +0 -92
- package/src/client/jupiter-lend/earn.d.ts +0 -64
- package/src/client/jupiter-lend/index.d.ts +0 -3
- package/src/client/jupiter-lend/shared.d.ts +0 -129
- package/src/client/jupiter.d.ts +0 -53
- package/src/client/kamino/farm.d.ts +0 -39
- package/src/client/kamino/index.d.ts +0 -4
- package/src/client/kamino/lending.d.ts +0 -94
- package/src/client/kamino/types.d.ts +0 -56
- package/src/client/kamino/vaults.d.ts +0 -39
- package/src/client/loopscale/borrow.d.ts +0 -118
- package/src/client/loopscale/core.d.ts +0 -604
- package/src/client/loopscale/index.d.ts +0 -5
- package/src/client/loopscale/lend.d.ts +0 -123
- package/src/client/loopscale/vault.d.ts +0 -43
- package/src/client/marinade.d.ts +0 -42
- package/src/client/mint.d.ts +0 -143
- package/src/client/orca.d.ts +0 -255
- package/src/client/phoenix.d.ts +0 -214
- package/src/client/price.d.ts +0 -182
- package/src/client/stake-pool.d.ts +0 -39
- package/src/client/stake.d.ts +0 -34
- package/src/client/state.d.ts +0 -56
- package/src/client/timelock.d.ts +0 -31
- package/src/client/vault.d.ts +0 -98
- package/src/client.d.ts +0 -82
- package/src/clientConfig.d.ts +0 -32
- package/src/constants.d.ts +0 -111
- package/src/deser/base.d.ts +0 -18
- package/src/deser/index.d.ts +0 -4
- package/src/deser/integrationPolicies.d.ts +0 -195
- package/src/deser/kaminoLayouts.d.ts +0 -264
- package/src/deser/loopscaleLayouts.d.ts +0 -157
- package/src/deser/tokenAclLayouts.d.ts +0 -67
- package/src/error.d.ts +0 -29
- package/src/glamExports.d.ts +0 -6260
- package/src/globalConfig.d.ts +0 -27
- package/src/index.d.ts +0 -24
- package/src/models/acl.d.ts +0 -43
- package/src/models/index.d.ts +0 -8
- package/src/models/mint.d.ts +0 -57
- package/src/models/state.d.ts +0 -94
- package/src/models/types.d.ts +0 -28
- package/src/protocols.d.ts +0 -29
- package/src/utils/accounts.d.ts +0 -71
- package/src/utils/bitmask.d.ts +0 -53
- package/src/utils/blockhash.d.ts +0 -11
- package/src/utils/common.d.ts +0 -73
- package/src/utils/computeBudget.d.ts +0 -15
- package/src/utils/evm.d.ts +0 -10
- package/src/utils/fraction.d.ts +0 -29
- package/src/utils/glamPDAs.d.ts +0 -15
- package/src/utils/helius.d.ts +0 -66
- package/src/utils/index.d.ts +0 -17
- package/src/utils/jupiterApi.d.ts +0 -95
- package/src/utils/lookupTables.d.ts +0 -83
- package/src/utils/phoenixApi.d.ts +0 -146
- package/src/utils/pkmap.d.ts +0 -87
- package/src/utils/pkset.d.ts +0 -73
- package/src/utils/positionCategorizer.d.ts +0 -38
- package/src/utils/rpc.d.ts +0 -18
- package/src/utils/timelock.d.ts +0 -52
- package/src/utils/transaction.d.ts +0 -13
- package/target/idl/ext_bridge-staging.json +0 -2379
- package/target/idl/ext_bridge.json +0 -2379
- package/target/idl/ext_drift.json +0 -5464
- package/target/idl/ext_epi-staging.json +0 -2862
- package/target/idl/ext_epi.json +0 -2862
- package/target/idl/ext_loopscale-staging.json +0 -4708
- package/target/idl/ext_loopscale.json +0 -4708
- package/target/idl/ext_marinade-staging.json +0 -1587
- package/target/idl/ext_phoenix-staging.json +0 -3525
- package/target/idl/ext_phoenix.json +0 -3525
- package/target/idl/mock_layerzero_endpoint.json +0 -144
- package/target/idl/mock_layerzero_oft.json +0 -155
- package/target/idl/mock_wormhole_verify_vaa_shim.json +0 -58
- package/target/types/ext_bridge-staging.d.ts +0 -2385
- package/target/types/ext_bridge-staging.ts +0 -2385
- package/target/types/ext_bridge.d.ts +0 -2385
- package/target/types/ext_bridge.ts +0 -2385
- package/target/types/ext_cctp-staging.d.ts +0 -1268
- package/target/types/ext_cctp.d.ts +0 -1268
- package/target/types/ext_drift.d.ts +0 -5470
- package/target/types/ext_drift.ts +0 -5470
- package/target/types/ext_epi-staging.d.ts +0 -2868
- package/target/types/ext_epi-staging.ts +0 -2868
- package/target/types/ext_epi.d.ts +0 -2868
- package/target/types/ext_epi.ts +0 -2868
- package/target/types/ext_jupiter-staging.d.ts +0 -1966
- package/target/types/ext_jupiter.d.ts +0 -1966
- package/target/types/ext_kamino-staging.d.ts +0 -3433
- package/target/types/ext_kamino.d.ts +0 -3433
- package/target/types/ext_loopscale-staging.d.ts +0 -4714
- package/target/types/ext_loopscale-staging.ts +0 -4714
- package/target/types/ext_loopscale.d.ts +0 -4714
- package/target/types/ext_loopscale.ts +0 -4714
- package/target/types/ext_marinade-staging.d.ts +0 -1593
- package/target/types/ext_marinade-staging.ts +0 -1593
- package/target/types/ext_marinade.d.ts +0 -1593
- package/target/types/ext_orca-staging.d.ts +0 -2829
- package/target/types/ext_orca.d.ts +0 -2829
- package/target/types/ext_phoenix-staging.d.ts +0 -3531
- package/target/types/ext_phoenix-staging.ts +0 -3531
- package/target/types/ext_phoenix.d.ts +0 -3531
- package/target/types/ext_phoenix.ts +0 -3531
- package/target/types/ext_spl-staging.d.ts +0 -1274
- package/target/types/ext_spl.d.ts +0 -1274
- package/target/types/ext_stake_pool-staging.d.ts +0 -1622
- package/target/types/ext_stake_pool.d.ts +0 -1622
- package/target/types/glam_config.d.ts +0 -755
- package/target/types/glam_mint-staging.d.ts +0 -8802
- package/target/types/glam_mint.d.ts +0 -6349
- package/target/types/glam_policies.d.ts +0 -477
- package/target/types/glam_protocol-staging.d.ts +0 -3362
- package/target/types/glam_protocol.d.ts +0 -2783
- package/target/types/mock_layerzero_endpoint.d.ts +0 -150
- package/target/types/mock_layerzero_endpoint.ts +0 -150
- package/target/types/mock_layerzero_oft.d.ts +0 -161
- package/target/types/mock_layerzero_oft.ts +0 -161
- package/target/types/mock_wormhole_verify_vaa_shim.d.ts +0 -64
- package/target/types/mock_wormhole_verify_vaa_shim.ts +0 -64
package/src/client/epi.d.ts
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, AccountMeta, Keypair, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
|
|
4
|
-
type BufferLike = Uint8Array | number[] | Buffer;
|
|
5
|
-
type BufferLike32 = BufferLike;
|
|
6
|
-
type BufferLike20 = BufferLike;
|
|
7
|
-
export type EpiDenominationKindInput = {
|
|
8
|
-
usd: Record<string, never>;
|
|
9
|
-
} | {
|
|
10
|
-
mint: Record<string, never>;
|
|
11
|
-
};
|
|
12
|
-
export type EpiDenominationSpecInput = {
|
|
13
|
-
denom: EpiDenominationKindInput;
|
|
14
|
-
mint: PublicKey;
|
|
15
|
-
};
|
|
16
|
-
export type EpiExternalPositionTypeInput = {
|
|
17
|
-
valued: Record<string, never>;
|
|
18
|
-
} | {
|
|
19
|
-
tokenized: Record<string, never>;
|
|
20
|
-
};
|
|
21
|
-
export type EpiExternalSourceTypeInput = {
|
|
22
|
-
trusted: Record<string, never>;
|
|
23
|
-
} | {
|
|
24
|
-
native: Record<string, never>;
|
|
25
|
-
} | {
|
|
26
|
-
wormhole: Record<string, never>;
|
|
27
|
-
};
|
|
28
|
-
export type EpiNativeCustodyKindInput = {
|
|
29
|
-
splToken: Record<string, never>;
|
|
30
|
-
} | {
|
|
31
|
-
nativeSol: Record<string, never>;
|
|
32
|
-
};
|
|
33
|
-
export type UpsertExternalPositionParams = {
|
|
34
|
-
positionId: BufferLike32;
|
|
35
|
-
positionType: EpiExternalPositionTypeInput;
|
|
36
|
-
sourceType: EpiExternalSourceTypeInput;
|
|
37
|
-
denomination: EpiDenominationSpecInput;
|
|
38
|
-
nativeCustodyAccount?: PublicKey;
|
|
39
|
-
nativeCustodyKind?: EpiNativeCustodyKindInput;
|
|
40
|
-
enabled?: boolean;
|
|
41
|
-
freshnessOverrideSecs?: number;
|
|
42
|
-
submitAllowlist?: PublicKey[];
|
|
43
|
-
validateAllowlist?: PublicKey[];
|
|
44
|
-
configureAllowlist?: PublicKey[];
|
|
45
|
-
};
|
|
46
|
-
export type SubmitExternalObservationParams = {
|
|
47
|
-
positionId: BufferLike32;
|
|
48
|
-
amount: BN;
|
|
49
|
-
denomination: EpiDenominationSpecInput;
|
|
50
|
-
observationTimestamp: BN;
|
|
51
|
-
externalShares?: BN;
|
|
52
|
-
reserved?: Uint8Array | number[] | Buffer;
|
|
53
|
-
};
|
|
54
|
-
export type ValidateExternalObservationOracleAccounts = {
|
|
55
|
-
glamConfig?: PublicKey | null;
|
|
56
|
-
solUsdOracle?: PublicKey | null;
|
|
57
|
-
baseAssetOracle?: PublicKey | null;
|
|
58
|
-
observedMintOracle?: PublicKey | null;
|
|
59
|
-
};
|
|
60
|
-
export type ValidateExternalObservationParams = {
|
|
61
|
-
positionId: BufferLike32;
|
|
62
|
-
} & ValidateExternalObservationOracleAccounts;
|
|
63
|
-
export type WormholeObservationConfigInput = {
|
|
64
|
-
positionId: BufferLike32;
|
|
65
|
-
emitterChain: number;
|
|
66
|
-
emitterAddress: BufferLike32;
|
|
67
|
-
payloadVersion: number;
|
|
68
|
-
payloadType: number;
|
|
69
|
-
maxAgeSeconds: number;
|
|
70
|
-
};
|
|
71
|
-
export type WormholeHyperliquidObservationConfigInput = {
|
|
72
|
-
positionId: BufferLike32;
|
|
73
|
-
hyperliquidAccount: BufferLike20;
|
|
74
|
-
accountMarginSummaryPrecompile: BufferLike20;
|
|
75
|
-
spotBalancePrecompile: BufferLike20;
|
|
76
|
-
perpDexIndex: number;
|
|
77
|
-
usdcSpotToken: BN;
|
|
78
|
-
};
|
|
79
|
-
export type SubmitExternalObservationWormholeParams = {
|
|
80
|
-
positionId: BufferLike32;
|
|
81
|
-
signedVaa: BufferLike;
|
|
82
|
-
payloadConfigAccounts?: AccountMeta[];
|
|
83
|
-
guardianSignatures?: Keypair;
|
|
84
|
-
guardianSet?: PublicKey;
|
|
85
|
-
wormholeCoreBridgeProgram?: PublicKey;
|
|
86
|
-
wormholeVerifyVaaShimProgram?: PublicKey;
|
|
87
|
-
maxSignaturesPerPost?: number;
|
|
88
|
-
};
|
|
89
|
-
export type SubmitExternalObservationWormholeResult = {
|
|
90
|
-
postSignatureTxs: TransactionSignature[];
|
|
91
|
-
submitTx: TransactionSignature;
|
|
92
|
-
guardianSignatures: PublicKey;
|
|
93
|
-
};
|
|
94
|
-
export type ParsedWormholeSignedVaa = {
|
|
95
|
-
version: number;
|
|
96
|
-
guardianSetIndex: number;
|
|
97
|
-
signatures: Buffer[];
|
|
98
|
-
vaaBody: Buffer;
|
|
99
|
-
};
|
|
100
|
-
export declare function evmAddressToBytes20(address: string): number[];
|
|
101
|
-
export declare function evmAddressToWormholeEmitterAddress(address: string): number[];
|
|
102
|
-
export declare function parseWormholeSignedVaa(signedVaa: BufferLike): ParsedWormholeSignedVaa;
|
|
103
|
-
export declare function getWormholeGuardianSetPda(guardianSetIndex: number, wormholeCoreBridgeProgram?: PublicKey): [PublicKey, number];
|
|
104
|
-
declare class TxBuilder extends BaseTxBuilder<EpiClient> {
|
|
105
|
-
upsertExternalPositionIx(params: UpsertExternalPositionParams, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
106
|
-
upsertExternalPositionWormholeConfigIx(params: WormholeObservationConfigInput, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
107
|
-
upsertExternalPositionWormholeHyperliquidConfigIx(params: WormholeHyperliquidObservationConfigInput, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
108
|
-
submitExternalObservationIx(params: SubmitExternalObservationParams, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
109
|
-
wormholePostSignaturesIx(parsedVaa: ParsedWormholeSignedVaa, guardianSignatures: PublicKey, payer?: PublicKey, signatures?: Buffer[], wormholeVerifyVaaShimProgram?: PublicKey): TransactionInstruction;
|
|
110
|
-
wormholeCloseSignaturesIx(guardianSignatures: PublicKey, refundRecipient?: PublicKey, wormholeVerifyVaaShimProgram?: PublicKey): TransactionInstruction;
|
|
111
|
-
submitExternalObservationWormholeIx(params: SubmitExternalObservationWormholeParams, guardianSignatures: PublicKey, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
112
|
-
validateExternalObservationIx(paramsOrPositionId: BufferLike32 | ValidateExternalObservationParams, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
113
|
-
refreshPricedProtocolIx(signer?: PublicKey): Promise<TransactionInstruction>;
|
|
114
|
-
submitExternalObservationTx(params: SubmitExternalObservationParams, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
115
|
-
upsertExternalPositionTx(params: UpsertExternalPositionParams, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
116
|
-
removeExternalPositionTx(positionId: BufferLike32, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
117
|
-
upsertExternalPositionWormholeConfigTx(params: WormholeObservationConfigInput, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
118
|
-
upsertExternalPositionWormholeHyperliquidConfigTx(params: WormholeHyperliquidObservationConfigInput, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
119
|
-
submitExternalObservationWormholeTx(params: SubmitExternalObservationWormholeParams, guardianSignatures: PublicKey, txOptions?: TxOptions, closeSignatures?: boolean): Promise<VersionedTransaction>;
|
|
120
|
-
validateExternalObservationTx(paramsOrPositionId: BufferLike32 | ValidateExternalObservationParams, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
121
|
-
refreshPricedProtocolTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
122
|
-
}
|
|
123
|
-
export declare class EpiClient {
|
|
124
|
-
readonly base: BaseClient;
|
|
125
|
-
readonly txBuilder: TxBuilder;
|
|
126
|
-
constructor(base: BaseClient);
|
|
127
|
-
getObservationStatePda(): PublicKey;
|
|
128
|
-
getWormholeObservationConfigPda(positionId: BufferLike32): PublicKey;
|
|
129
|
-
getWormholeHyperliquidObservationConfigPda(positionId: BufferLike32): PublicKey;
|
|
130
|
-
getIntegrationAuthorityPda(): PublicKey;
|
|
131
|
-
fetchObservationState(): Promise<{
|
|
132
|
-
glamState: PublicKey;
|
|
133
|
-
bump: number;
|
|
134
|
-
positionsLen: number;
|
|
135
|
-
reserved: number[];
|
|
136
|
-
positions: {
|
|
137
|
-
positionId: number[];
|
|
138
|
-
hasPending: boolean;
|
|
139
|
-
padPending: number[];
|
|
140
|
-
pendingObservation: {
|
|
141
|
-
amount: {
|
|
142
|
-
bytes: number[];
|
|
143
|
-
};
|
|
144
|
-
denomination: {
|
|
145
|
-
denom: ({
|
|
146
|
-
usd?: undefined;
|
|
147
|
-
} & {
|
|
148
|
-
mint: Record<string, never>;
|
|
149
|
-
}) | ({
|
|
150
|
-
mint?: undefined;
|
|
151
|
-
} & {
|
|
152
|
-
usd: Record<string, never>;
|
|
153
|
-
});
|
|
154
|
-
mint: PublicKey;
|
|
155
|
-
};
|
|
156
|
-
padDenom: number[];
|
|
157
|
-
observationTimestamp: BN;
|
|
158
|
-
externalShares: BN;
|
|
159
|
-
submittedBy: PublicKey;
|
|
160
|
-
submittedAtSlot: BN;
|
|
161
|
-
};
|
|
162
|
-
hasValidated: boolean;
|
|
163
|
-
padValidated: number[];
|
|
164
|
-
lastValidatedObservation: {
|
|
165
|
-
amount: {
|
|
166
|
-
bytes: number[];
|
|
167
|
-
};
|
|
168
|
-
denomination: {
|
|
169
|
-
denom: ({
|
|
170
|
-
usd?: undefined;
|
|
171
|
-
} & {
|
|
172
|
-
mint: Record<string, never>;
|
|
173
|
-
}) | ({
|
|
174
|
-
mint?: undefined;
|
|
175
|
-
} & {
|
|
176
|
-
usd: Record<string, never>;
|
|
177
|
-
});
|
|
178
|
-
mint: PublicKey;
|
|
179
|
-
};
|
|
180
|
-
padDenom: number[];
|
|
181
|
-
observationTimestamp: BN;
|
|
182
|
-
externalShares: BN;
|
|
183
|
-
submittedBy: PublicKey;
|
|
184
|
-
submittedAtSlot: BN;
|
|
185
|
-
};
|
|
186
|
-
validatedBy: PublicKey;
|
|
187
|
-
validatedAtSlot: BN;
|
|
188
|
-
validatedBaseAssetAmount: {
|
|
189
|
-
bytes: number[];
|
|
190
|
-
};
|
|
191
|
-
}[];
|
|
192
|
-
} | null>;
|
|
193
|
-
fetchWormholeObservationConfig(positionId: BufferLike32): Promise<{
|
|
194
|
-
glamState: PublicKey;
|
|
195
|
-
positionId: number[];
|
|
196
|
-
emitterChain: number;
|
|
197
|
-
emitterAddress: number[];
|
|
198
|
-
payloadVersion: number;
|
|
199
|
-
payloadType: number;
|
|
200
|
-
maxAgeSeconds: number;
|
|
201
|
-
hasLastSequence: boolean;
|
|
202
|
-
lastSequence: BN;
|
|
203
|
-
lastVaaHash: number[];
|
|
204
|
-
bump: number;
|
|
205
|
-
} | null>;
|
|
206
|
-
fetchWormholeHyperliquidObservationConfig(positionId: BufferLike32): Promise<{
|
|
207
|
-
glamState: PublicKey;
|
|
208
|
-
positionId: number[];
|
|
209
|
-
hyperliquidAccount: number[];
|
|
210
|
-
accountMarginSummaryPrecompile: number[];
|
|
211
|
-
spotBalancePrecompile: number[];
|
|
212
|
-
perpDexIndex: number;
|
|
213
|
-
usdcSpotToken: BN;
|
|
214
|
-
bump: number;
|
|
215
|
-
} | null>;
|
|
216
|
-
submitExternalObservation(params: SubmitExternalObservationParams, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
217
|
-
upsertExternalPosition(params: UpsertExternalPositionParams, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
218
|
-
removeExternalPosition(positionId: BufferLike32, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
219
|
-
upsertExternalPositionWormholeConfig(params: WormholeObservationConfigInput, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
220
|
-
upsertExternalPositionWormholeHyperliquidConfig(params: WormholeHyperliquidObservationConfigInput, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
221
|
-
submitExternalObservationWormhole(params: SubmitExternalObservationWormholeParams, txOptions?: TxOptions): Promise<SubmitExternalObservationWormholeResult>;
|
|
222
|
-
validateExternalObservation(paramsOrPositionId: BufferLike32 | ValidateExternalObservationParams, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
223
|
-
resolveValidateExternalObservationAccounts(params: ValidateExternalObservationParams): Promise<Required<Omit<ValidateExternalObservationOracleAccounts, "observedMintOracle">> & {
|
|
224
|
-
remainingAccounts: AccountMeta[];
|
|
225
|
-
}>;
|
|
226
|
-
refreshPricedProtocol(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
227
|
-
}
|
|
228
|
-
export {};
|
package/src/client/fees.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
2
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
|
|
3
|
-
import { PriceClient } from "./price";
|
|
4
|
-
declare class TxBuilder extends BaseTxBuilder<FeesClient> {
|
|
5
|
-
crystallizeFeesIxs(glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
6
|
-
crystallizeFeesTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
7
|
-
claimFeesIxs(glamSigner: PublicKey): Promise<TransactionInstruction[]>;
|
|
8
|
-
claimFeesTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
9
|
-
chargeProtocolFeeIxs(glamSigner: PublicKey, protocolFeeAuthority: PublicKey): Promise<TransactionInstruction[]>;
|
|
10
|
-
chargeProtocolFeeTx(protocolFeeAuthority: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
11
|
-
setProtocolFeesIx(baseFeeBps: number, flowFeeBps: number, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
12
|
-
setProtocolFeesTx(baseFeeBps: number, flowFeeBps: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
13
|
-
}
|
|
14
|
-
export declare class FeesClient {
|
|
15
|
-
readonly base: BaseClient;
|
|
16
|
-
readonly price: PriceClient;
|
|
17
|
-
readonly txBuilder: TxBuilder;
|
|
18
|
-
constructor(base: BaseClient, price: PriceClient);
|
|
19
|
-
/**
|
|
20
|
-
* Returns claimable fees object
|
|
21
|
-
*/
|
|
22
|
-
getClaimableFees(): Promise<any>;
|
|
23
|
-
/**
|
|
24
|
-
* Returns claimed fees object
|
|
25
|
-
*/
|
|
26
|
-
getClaimedFees(): Promise<any>;
|
|
27
|
-
crystallizeFees(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
28
|
-
claimFees(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
29
|
-
chargeProtocolFee(protocolFeeAuthority: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
30
|
-
setProtocolFeesIx(baseFeeBps: number, flowFeeBps: number, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
31
|
-
setProtocolFees(baseFeeBps: number, flowFeeBps: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
package/src/client/invest.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, TxOptions } from "./base";
|
|
4
|
-
import { PendingRequest } from "../models";
|
|
5
|
-
declare class TxBuilder extends BaseTxBuilder<InvestClient> {
|
|
6
|
-
subscribeIxs(amount: BN, signer: PublicKey): Promise<TransactionInstruction[]>;
|
|
7
|
-
subscribeTx(amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
8
|
-
queuedSubscribeIxs(amount: BN, signer: PublicKey): Promise<TransactionInstruction[]>;
|
|
9
|
-
queuedSubscribeTx(amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
10
|
-
queuedRedeemIx(amount: BN, signer: PublicKey): Promise<TransactionInstruction>;
|
|
11
|
-
queuedRedeemTx(amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
12
|
-
cancelIx(pubkey: PublicKey | null, signer: PublicKey): Promise<TransactionInstruction>;
|
|
13
|
-
cancelTx(pubkey: PublicKey | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
14
|
-
fulfillIx(limit: number | null, signer: PublicKey): Promise<TransactionInstruction>;
|
|
15
|
-
fulfillTx(limit: number | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
16
|
-
claimIxs(user: PublicKey | null, signer: PublicKey): Promise<TransactionInstruction[]>;
|
|
17
|
-
claimTx(user: PublicKey | null, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
18
|
-
}
|
|
19
|
-
export declare class InvestClient {
|
|
20
|
-
readonly base: BaseClient;
|
|
21
|
-
readonly txBuilder: TxBuilder;
|
|
22
|
-
constructor(base: BaseClient);
|
|
23
|
-
subscribe(amount: BN, queued?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
24
|
-
queuedRedeem(amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
25
|
-
cancel(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
26
|
-
cancelForUser(user: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
27
|
-
fulfill(limit: number | null, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
28
|
-
/**
|
|
29
|
-
* Claims the pending request for the signer.
|
|
30
|
-
* @param txOptions
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
claim(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
34
|
-
claimForUser(user: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
35
|
-
fetchPendingRequest(user?: PublicKey): Promise<PendingRequest | null>;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { AccountMeta, PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, type ProtocolPolicyClient, type ProtocolPolicyTxBuilder, type TxOptions } from "../base";
|
|
4
|
-
import { VaultClient } from "../vault";
|
|
5
|
-
import { JupiterBorrowPolicy } from "../../deser/integrationPolicies";
|
|
6
|
-
import { JupiterPosition, JupiterTransferType, JupiterVault } from "./shared";
|
|
7
|
-
export type JupiterBorrowInitPositionAccounts = {
|
|
8
|
-
vaultAdmin: PublicKey;
|
|
9
|
-
vaultState: PublicKey;
|
|
10
|
-
position: PublicKey;
|
|
11
|
-
positionMint: PublicKey;
|
|
12
|
-
positionTokenAccount: PublicKey;
|
|
13
|
-
metadataAccount?: PublicKey;
|
|
14
|
-
tokenProgram?: PublicKey;
|
|
15
|
-
associatedTokenProgram?: PublicKey;
|
|
16
|
-
sysvarInstruction?: PublicKey;
|
|
17
|
-
metadataProgram?: PublicKey;
|
|
18
|
-
};
|
|
19
|
-
export type JupiterBorrowOperateAccounts = {
|
|
20
|
-
signerSupplyTokenAccount?: PublicKey;
|
|
21
|
-
signerBorrowTokenAccount?: PublicKey;
|
|
22
|
-
recipient?: PublicKey | null;
|
|
23
|
-
recipientBorrowTokenAccount?: PublicKey | null;
|
|
24
|
-
recipientSupplyTokenAccount?: PublicKey | null;
|
|
25
|
-
vaultConfig: PublicKey;
|
|
26
|
-
vaultState: PublicKey;
|
|
27
|
-
supplyToken: PublicKey;
|
|
28
|
-
borrowToken: PublicKey;
|
|
29
|
-
oracle: PublicKey;
|
|
30
|
-
position: PublicKey;
|
|
31
|
-
positionTokenAccount: PublicKey;
|
|
32
|
-
currentPositionTick: PublicKey;
|
|
33
|
-
finalPositionTick: PublicKey;
|
|
34
|
-
currentPositionTickId: PublicKey;
|
|
35
|
-
finalPositionTickId: PublicKey;
|
|
36
|
-
newBranch: PublicKey;
|
|
37
|
-
supplyTokenReservesLiquidity: PublicKey;
|
|
38
|
-
borrowTokenReservesLiquidity: PublicKey;
|
|
39
|
-
vaultSupplyPositionOnLiquidity: PublicKey;
|
|
40
|
-
vaultBorrowPositionOnLiquidity: PublicKey;
|
|
41
|
-
supplyRateModel: PublicKey;
|
|
42
|
-
borrowRateModel: PublicKey;
|
|
43
|
-
vaultSupplyTokenAccount: PublicKey;
|
|
44
|
-
vaultBorrowTokenAccount: PublicKey;
|
|
45
|
-
supplyTokenClaimAccount?: PublicKey | null;
|
|
46
|
-
borrowTokenClaimAccount?: PublicKey | null;
|
|
47
|
-
liquidity: PublicKey;
|
|
48
|
-
liquidityProgram?: PublicKey;
|
|
49
|
-
oracleProgram?: PublicKey;
|
|
50
|
-
supplyTokenProgram?: PublicKey;
|
|
51
|
-
borrowTokenProgram?: PublicKey;
|
|
52
|
-
associatedTokenProgram?: PublicKey;
|
|
53
|
-
remainingAccounts?: AccountMeta[];
|
|
54
|
-
};
|
|
55
|
-
export type JupiterBorrowPosition = JupiterPosition & {
|
|
56
|
-
positionTokenAccount: PublicKey;
|
|
57
|
-
tokenAmount: string;
|
|
58
|
-
tokenProgram: PublicKey;
|
|
59
|
-
};
|
|
60
|
-
declare class TxBuilder extends BaseTxBuilder<JupiterBorrowClient> implements ProtocolPolicyTxBuilder<JupiterBorrowPolicy> {
|
|
61
|
-
initPositionIx(vaultId: number, nextPositionId: number, accounts: JupiterBorrowInitPositionAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
62
|
-
initPositionTx(vaultId: number, nextPositionId: number, accounts: JupiterBorrowInitPositionAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
63
|
-
operateIx(newCol: BN | bigint | number, newDebt: BN | bigint | number, transferType: JupiterTransferType | null, remainingAccountsIndices: Buffer | Uint8Array | number[], accounts: JupiterBorrowOperateAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
64
|
-
operateTx(newCol: BN | bigint | number, newDebt: BN | bigint | number, transferType: JupiterTransferType | null, remainingAccountsIndices: Buffer | Uint8Array | number[], accounts: JupiterBorrowOperateAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
65
|
-
setPolicyIx(policy: JupiterBorrowPolicy, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
66
|
-
setPolicyTx(policy: JupiterBorrowPolicy, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
67
|
-
clearPolicyIx(signer?: PublicKey): Promise<TransactionInstruction>;
|
|
68
|
-
clearPolicyTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
69
|
-
}
|
|
70
|
-
export declare class JupiterBorrowClient implements ProtocolPolicyClient<JupiterBorrowPolicy> {
|
|
71
|
-
readonly base: BaseClient;
|
|
72
|
-
readonly vault: VaultClient;
|
|
73
|
-
readonly txBuilder: TxBuilder;
|
|
74
|
-
constructor(base: BaseClient, vault: VaultClient);
|
|
75
|
-
getIntegrationAuthorityPda(): PublicKey;
|
|
76
|
-
getPosition(position: PublicKey): Promise<JupiterPosition>;
|
|
77
|
-
listPositions(vaultId?: number): Promise<JupiterBorrowPosition[]>;
|
|
78
|
-
getVault(vaultId: number): Promise<JupiterVault>;
|
|
79
|
-
listVaults(): Promise<JupiterVault[]>;
|
|
80
|
-
initPosition(vaultId: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
81
|
-
deposit(position: PublicKey, amount: BN | bigint | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
82
|
-
withdraw(position: PublicKey, amount: BN | bigint | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
83
|
-
borrow(position: PublicKey, amount: BN | bigint | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
84
|
-
repay(position: PublicKey, amount: BN | bigint | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
85
|
-
operate(newCol: BN | bigint | number, newDebt: BN | bigint | number, transferType: JupiterTransferType | null, remainingAccountsIndices: Buffer | Uint8Array | number[], accounts: JupiterBorrowOperateAccounts, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
86
|
-
fetchPolicy(): Promise<JupiterBorrowPolicy | null>;
|
|
87
|
-
setPolicy(policy: JupiterBorrowPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
88
|
-
clearPolicy(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
89
|
-
private simulateExpectedFinalTick;
|
|
90
|
-
private runBorrowOperate;
|
|
91
|
-
}
|
|
92
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, type ProtocolPolicyClient, type ProtocolPolicyTxBuilder, type TxOptions } from "../base";
|
|
4
|
-
import { JupiterEarnPolicy } from "../../deser/integrationPolicies";
|
|
5
|
-
export type JupiterEarnDepositAccounts = {
|
|
6
|
-
depositorTokenAccount?: PublicKey;
|
|
7
|
-
recipientTokenAccount?: PublicKey;
|
|
8
|
-
mint: PublicKey;
|
|
9
|
-
lendingAdmin: PublicKey;
|
|
10
|
-
lending: PublicKey;
|
|
11
|
-
fTokenMint: PublicKey;
|
|
12
|
-
supplyTokenReservesLiquidity: PublicKey;
|
|
13
|
-
lendingSupplyPositionOnLiquidity: PublicKey;
|
|
14
|
-
rateModel: PublicKey;
|
|
15
|
-
vault: PublicKey;
|
|
16
|
-
liquidity: PublicKey;
|
|
17
|
-
liquidityProgram?: PublicKey;
|
|
18
|
-
rewardsRateModel: PublicKey;
|
|
19
|
-
tokenProgram?: PublicKey;
|
|
20
|
-
fTokenProgram?: PublicKey;
|
|
21
|
-
associatedTokenProgram?: PublicKey;
|
|
22
|
-
};
|
|
23
|
-
export type JupiterEarnWithdrawAccounts = {
|
|
24
|
-
ownerTokenAccount?: PublicKey;
|
|
25
|
-
recipientTokenAccount?: PublicKey;
|
|
26
|
-
lendingAdmin: PublicKey;
|
|
27
|
-
lending: PublicKey;
|
|
28
|
-
mint: PublicKey;
|
|
29
|
-
fTokenMint: PublicKey;
|
|
30
|
-
supplyTokenReservesLiquidity: PublicKey;
|
|
31
|
-
lendingSupplyPositionOnLiquidity: PublicKey;
|
|
32
|
-
rateModel: PublicKey;
|
|
33
|
-
vault: PublicKey;
|
|
34
|
-
claimAccount: PublicKey;
|
|
35
|
-
liquidity: PublicKey;
|
|
36
|
-
liquidityProgram?: PublicKey;
|
|
37
|
-
rewardsRateModel: PublicKey;
|
|
38
|
-
tokenProgram?: PublicKey;
|
|
39
|
-
fTokenProgram?: PublicKey;
|
|
40
|
-
associatedTokenProgram?: PublicKey;
|
|
41
|
-
};
|
|
42
|
-
declare class TxBuilder extends BaseTxBuilder<JupiterEarnClient> implements ProtocolPolicyTxBuilder<JupiterEarnPolicy> {
|
|
43
|
-
depositIx(amount: BN | bigint | number, minAmountOut: BN | bigint | number, accounts: JupiterEarnDepositAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
44
|
-
depositTx(amount: BN | bigint | number, minAmountOut: BN | bigint | number, accounts: JupiterEarnDepositAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
45
|
-
withdrawIx(amount: BN | bigint | number, maxSharesBurn: BN | bigint | number, accounts: JupiterEarnWithdrawAccounts, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
46
|
-
withdrawTx(amount: BN | bigint | number, maxSharesBurn: BN | bigint | number, accounts: JupiterEarnWithdrawAccounts, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
47
|
-
setPolicyIx(policy: JupiterEarnPolicy, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
48
|
-
setPolicyTx(policy: JupiterEarnPolicy, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
49
|
-
clearPolicyIx(signer?: PublicKey): Promise<TransactionInstruction>;
|
|
50
|
-
clearPolicyTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
51
|
-
}
|
|
52
|
-
export declare class JupiterEarnClient implements ProtocolPolicyClient<JupiterEarnPolicy> {
|
|
53
|
-
readonly base: BaseClient;
|
|
54
|
-
readonly txBuilder: TxBuilder;
|
|
55
|
-
constructor(base: BaseClient);
|
|
56
|
-
getIntegrationAuthorityPda(): PublicKey;
|
|
57
|
-
deposit(mint: PublicKey, amount: BN | bigint | number, minAmountOut?: BN | bigint | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
58
|
-
withdraw(mint: PublicKey, amount: BN | bigint | number, maxSharesBurn?: BN | bigint | number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
59
|
-
fetchPolicy(): Promise<JupiterEarnPolicy | null>;
|
|
60
|
-
setPolicy(policy: JupiterEarnPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
61
|
-
clearPolicy(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
62
|
-
private resolveAccounts;
|
|
63
|
-
}
|
|
64
|
-
export {};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { AccountMeta, AddressLookupTableAccount, Connection, PublicKey } from "@solana/web3.js";
|
|
2
|
-
import { U64_MAX_BN as U64_MAX } from "../../utils/common";
|
|
3
|
-
export { JUPITER_BORROW_PROTOCOL, JUPITER_EARN_PROTOCOL, } from "../../protocols";
|
|
4
|
-
export type JupiterTransferType = {
|
|
5
|
-
skip: Record<string, never>;
|
|
6
|
-
} | {
|
|
7
|
-
direct: Record<string, never>;
|
|
8
|
-
} | {
|
|
9
|
-
claim: Record<string, never>;
|
|
10
|
-
};
|
|
11
|
-
export declare const PUBKEY_BYTES = 32;
|
|
12
|
-
export { U64_MAX };
|
|
13
|
-
export declare const LENDING_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
14
|
-
export declare const TOKEN_RESERVE_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
15
|
-
export declare const VAULT_STATE_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
16
|
-
export declare const VAULT_CONFIG_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
17
|
-
export declare const VAULT_METADATA_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
18
|
-
export declare const POSITION_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
19
|
-
export declare const ORACLE_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
20
|
-
export declare const TICK_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
21
|
-
export declare const TICK_ID_LIQUIDATION_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
22
|
-
export declare const LIQUIDITY_SUPPLY_POSITION_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
23
|
-
export declare const LIQUIDITY_BORROW_POSITION_DISCRIMINATOR: Buffer<ArrayBuffer>;
|
|
24
|
-
export declare const LENDING_REWARDS_RATE_MODEL_OFFSET: number;
|
|
25
|
-
export declare const LENDING_TOKEN_RESERVES_LIQUIDITY_OFFSET: number;
|
|
26
|
-
export declare const LENDING_SUPPLY_POSITION_OFFSET: number;
|
|
27
|
-
export declare const TOKEN_RESERVE_VAULT_OFFSET: number;
|
|
28
|
-
export declare const VAULT_CONFIG_ORACLE_OFFSET: number;
|
|
29
|
-
export declare const VAULT_CONFIG_SUPPLY_TOKEN_OFFSET: number;
|
|
30
|
-
export declare const VAULT_CONFIG_BORROW_TOKEN_OFFSET: number;
|
|
31
|
-
export declare const VAULT_METADATA_LOOKUP_TABLE_OFFSET: number;
|
|
32
|
-
export declare const VAULT_STATE_VAULT_ID_OFFSET = 8;
|
|
33
|
-
export declare const VAULT_STATE_CURRENT_BRANCH_ID_OFFSET: number;
|
|
34
|
-
export declare const VAULT_STATE_NEXT_POSITION_ID_OFFSET: number;
|
|
35
|
-
export declare const POSITION_VAULT_ID_OFFSET = 8;
|
|
36
|
-
export declare const POSITION_MINT_OFFSET: number;
|
|
37
|
-
export declare const POSITION_IS_SUPPLY_ONLY_OFFSET: number;
|
|
38
|
-
export declare const POSITION_TICK_OFFSET: number;
|
|
39
|
-
export declare const POSITION_TICK_ID_OFFSET: number;
|
|
40
|
-
export declare const ORACLE_SOURCE_BYTES: number;
|
|
41
|
-
export declare const TICK_VALUE_OFFSET: number;
|
|
42
|
-
export declare const TICK_TOTAL_IDS_OFFSET: number;
|
|
43
|
-
export declare const TICK_ID_VALUE_OFFSET: number;
|
|
44
|
-
export declare const TICK_ID_MAP_OFFSET: number;
|
|
45
|
-
export declare const MIN_TICK = -16383;
|
|
46
|
-
export declare const TICKS_PER_TICK_HAS_DEBT_ARRAY = 2048;
|
|
47
|
-
export declare const LIQUIDITY_POSITION_VAULT_CONFIG_OFFSET = 8;
|
|
48
|
-
export declare const LIQUIDITY_POSITION_MINT_OFFSET: number;
|
|
49
|
-
export declare const LIQUIDITY_SUPPLY_POSITION_SIZE = 124;
|
|
50
|
-
export declare const LIQUIDITY_BORROW_POSITION_SIZE = 120;
|
|
51
|
-
export declare const BORROW_OPERATE_EXPECTED_TICK_RE: RegExp;
|
|
52
|
-
export type JupiterPosition = {
|
|
53
|
-
pubkey: PublicKey;
|
|
54
|
-
vaultId: number;
|
|
55
|
-
positionMint: PublicKey;
|
|
56
|
-
isSupplyOnlyPosition: boolean;
|
|
57
|
-
tick: number;
|
|
58
|
-
tickId: number;
|
|
59
|
-
};
|
|
60
|
-
export type JupiterVault = {
|
|
61
|
-
vaultId: number;
|
|
62
|
-
vaultConfig: PublicKey;
|
|
63
|
-
vaultState: PublicKey;
|
|
64
|
-
oracle: PublicKey;
|
|
65
|
-
supplyToken: PublicKey;
|
|
66
|
-
borrowToken: PublicKey;
|
|
67
|
-
};
|
|
68
|
-
export type VaultStateInfo = {
|
|
69
|
-
vaultId: number;
|
|
70
|
-
currentBranchId: number;
|
|
71
|
-
nextPositionId: number;
|
|
72
|
-
};
|
|
73
|
-
export type TickInfo = {
|
|
74
|
-
pubkey: PublicKey;
|
|
75
|
-
tick: number;
|
|
76
|
-
totalIds: number;
|
|
77
|
-
};
|
|
78
|
-
export type BorrowOperateRemainingAccounts = {
|
|
79
|
-
indices: Buffer;
|
|
80
|
-
accounts: AccountMeta[];
|
|
81
|
-
};
|
|
82
|
-
export declare function decodePositionInfo(pubkey: PublicKey, data: Buffer): JupiterPosition;
|
|
83
|
-
export declare function u16LeBytes(value: number): Buffer;
|
|
84
|
-
export declare function u32LeBytes(value: number): Buffer;
|
|
85
|
-
export declare function i32LeBytes(value: number): Buffer;
|
|
86
|
-
export declare function memcmpFilter(offset: number, data: Buffer): {
|
|
87
|
-
memcmp: {
|
|
88
|
-
offset: number;
|
|
89
|
-
bytes: string;
|
|
90
|
-
encoding: "base64";
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
export declare function toU8Buffer(value: Buffer | Uint8Array | number[]): Buffer;
|
|
94
|
-
export declare function getTokenMetadataPda(mint: PublicKey): PublicKey;
|
|
95
|
-
export declare function getLendingAdminPda(): PublicKey;
|
|
96
|
-
export declare function getFTokenMintPda(mint: PublicKey): PublicKey;
|
|
97
|
-
export declare function getLendingPda(mint: PublicKey, fTokenMint: PublicKey): PublicKey;
|
|
98
|
-
export declare function getClaimAccountPda(mint: PublicKey, lendingAdmin: PublicKey): PublicKey;
|
|
99
|
-
export declare function getRateModelPda(mint: PublicKey): PublicKey;
|
|
100
|
-
export declare function getLiquidityPda(): PublicKey;
|
|
101
|
-
export declare function getVaultAdminPda(): PublicKey;
|
|
102
|
-
export declare function getVaultConfigPda(vaultId: number): PublicKey;
|
|
103
|
-
export declare function getVaultMetadataPda(vaultId: number): PublicKey;
|
|
104
|
-
export declare function getVaultStatePda(vaultId: number): PublicKey;
|
|
105
|
-
export declare function getPositionPda(vaultId: number, positionId: number): PublicKey;
|
|
106
|
-
export declare function getPositionMintPda(vaultId: number, positionId: number): PublicKey;
|
|
107
|
-
export declare function getBranchPda(vaultId: number, branchId: number): PublicKey;
|
|
108
|
-
export declare function getTickHasDebtPda(vaultId: number, index: number): PublicKey;
|
|
109
|
-
export declare function getTickHasDebtIndex(tick: number): number;
|
|
110
|
-
export declare function fetchAndValidate(connection: Connection, pubkey: PublicKey, expectedOwner: PublicKey, expectedDiscriminator: Buffer, label: string): Promise<Buffer>;
|
|
111
|
-
export declare function resolveLookupTableAccounts(connection: Connection, statePda: PublicKey, vaultPda: PublicKey, lookupTable?: PublicKey): Promise<AddressLookupTableAccount[]>;
|
|
112
|
-
export declare function fetchPositionInfo(connection: Connection, position: PublicKey): Promise<JupiterPosition>;
|
|
113
|
-
export declare function fetchVaultStateInfo(connection: Connection, vaultState: PublicKey): Promise<VaultStateInfo>;
|
|
114
|
-
export declare function fetchVaultConfigInfo(connection: Connection, vaultConfig: PublicKey): Promise<{
|
|
115
|
-
oracle: PublicKey;
|
|
116
|
-
supplyToken: PublicKey;
|
|
117
|
-
borrowToken: PublicKey;
|
|
118
|
-
}>;
|
|
119
|
-
export declare function fetchVaultMetadataLookupTable(connection: Connection, vaultMetadata: PublicKey): Promise<PublicKey | null>;
|
|
120
|
-
export declare function fetchReserveVault(connection: Connection, reserve: PublicKey, expectedMint: PublicKey): Promise<PublicKey>;
|
|
121
|
-
export declare function fetchLendingReserveAndVault(connection: Connection, mint: PublicKey): Promise<{
|
|
122
|
-
reserve: PublicKey;
|
|
123
|
-
vault: PublicKey;
|
|
124
|
-
}>;
|
|
125
|
-
export declare function fetchLiquidityPosition(connection: Connection, discriminator: Buffer, dataSize: number, vaultConfig: PublicKey, mint: PublicKey, label: string): Promise<PublicKey>;
|
|
126
|
-
export declare function fetchTickByValue(connection: Connection, vaultId: number, tick: number): Promise<TickInfo>;
|
|
127
|
-
export declare function fetchTickIdLiquidationByTick(connection: Connection, vaultId: number, tick: number, tickMap: number): Promise<PublicKey>;
|
|
128
|
-
export declare function resolveOracleRemainingAccounts(connection: Connection, oracle: PublicKey): Promise<AccountMeta[]>;
|
|
129
|
-
export declare function buildBorrowOperateRemainingAccounts(vaultId: number, oracleAccounts: AccountMeta[], currentTickValue: number, finalTickValue: number): BorrowOperateRemainingAccounts;
|
package/src/client/jupiter.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
-
import { BaseClient, BaseTxBuilder, type ProtocolPolicyClient, type ProtocolPolicyTxBuilder, type TxOptions } from "./base";
|
|
4
|
-
import { JupiterSwapPolicy } from "../deser/integrationPolicies";
|
|
5
|
-
import { VaultClient } from "./vault";
|
|
6
|
-
import { JupiterApiClient, JupiterInstruction, QuoteParams, QuoteResponse, SwapInstructions } from "../utils/jupiterApi";
|
|
7
|
-
import { KaminoLendingClient } from "./kamino";
|
|
8
|
-
export type JupiterSwapOptions = {
|
|
9
|
-
quoteParams?: QuoteParams;
|
|
10
|
-
quoteResponse?: QuoteResponse;
|
|
11
|
-
swapInstructions?: SwapInstructions;
|
|
12
|
-
trackingAccount?: PublicKey;
|
|
13
|
-
};
|
|
14
|
-
export type JupiterSwapV2OracleAccounts = {
|
|
15
|
-
solUsdOracle?: PublicKey;
|
|
16
|
-
inputTokenOracle?: PublicKey;
|
|
17
|
-
outputTokenOracle?: PublicKey;
|
|
18
|
-
kaminoReservesToRefresh: PublicKey[];
|
|
19
|
-
};
|
|
20
|
-
export type JupiterSwapV2Options = JupiterSwapOptions & {
|
|
21
|
-
skipQuotePriceCheck?: boolean;
|
|
22
|
-
};
|
|
23
|
-
declare class TxBuilder extends BaseTxBuilder<JupiterSwapClient> implements ProtocolPolicyTxBuilder<JupiterSwapPolicy> {
|
|
24
|
-
private resolveSwapInstructionContext;
|
|
25
|
-
getSwapV2OracleAccounts(inputMint: PublicKey, outputMint: PublicKey, skipQuotePriceCheck: boolean): Promise<JupiterSwapV2OracleAccounts>;
|
|
26
|
-
/**
|
|
27
|
-
* Returns the instructions for a Jupiter swap and the lookup tables
|
|
28
|
-
*/
|
|
29
|
-
swapIxs(options: JupiterSwapOptions, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey[]]>;
|
|
30
|
-
swapV2Ixs(options: JupiterSwapV2Options, glamSigner: PublicKey): Promise<[TransactionInstruction[], PublicKey[]]>;
|
|
31
|
-
swapTx(options: JupiterSwapOptions, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
32
|
-
swapV2Tx(options: JupiterSwapV2Options, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
33
|
-
setPolicyIx(policy: JupiterSwapPolicy, signer?: PublicKey): Promise<TransactionInstruction>;
|
|
34
|
-
setPolicyTx(policy: JupiterSwapPolicy, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
35
|
-
clearPolicyIx(signer?: PublicKey): Promise<TransactionInstruction>;
|
|
36
|
-
clearPolicyTx(txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
37
|
-
getPreInstructions(signer: PublicKey, inputMint: PublicKey, outputMint: PublicKey, amount: BN, outputTokenProgram?: PublicKey): Promise<TransactionInstruction[]>;
|
|
38
|
-
toTransactionInstruction: (ix: JupiterInstruction) => TransactionInstruction;
|
|
39
|
-
}
|
|
40
|
-
export declare class JupiterSwapClient implements ProtocolPolicyClient<JupiterSwapPolicy> {
|
|
41
|
-
readonly base: BaseClient;
|
|
42
|
-
readonly vault: VaultClient;
|
|
43
|
-
readonly klend: KaminoLendingClient;
|
|
44
|
-
readonly txBuilder: TxBuilder;
|
|
45
|
-
readonly jupApi: JupiterApiClient;
|
|
46
|
-
constructor(base: BaseClient, vault: VaultClient, klend: KaminoLendingClient);
|
|
47
|
-
swap(options: JupiterSwapOptions, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
48
|
-
swapV2(options: JupiterSwapV2Options, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
49
|
-
fetchPolicy(): Promise<JupiterSwapPolicy | null>;
|
|
50
|
-
setPolicy(policy: JupiterSwapPolicy, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
51
|
-
clearPolicy(txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
52
|
-
}
|
|
53
|
-
export {};
|