@liquid-af/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/README.md +776 -0
- package/dist/accounts/index.d.ts +5 -0
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/accounts/index.js +5 -0
- package/dist/accounts/index.js.map +1 -0
- package/dist/accounts/liquid-fees.d.ts +63 -0
- package/dist/accounts/liquid-fees.d.ts.map +1 -0
- package/dist/accounts/liquid-fees.js +27 -0
- package/dist/accounts/liquid-fees.js.map +1 -0
- package/dist/accounts/liquid-state.d.ts +112 -0
- package/dist/accounts/liquid-state.d.ts.map +1 -0
- package/dist/accounts/liquid-state.js +92 -0
- package/dist/accounts/liquid-state.js.map +1 -0
- package/dist/accounts/liquid-swap.d.ts +97 -0
- package/dist/accounts/liquid-swap.d.ts.map +1 -0
- package/dist/accounts/liquid-swap.js +54 -0
- package/dist/accounts/liquid-swap.js.map +1 -0
- package/dist/accounts/liquid.d.ts +175 -0
- package/dist/accounts/liquid.d.ts.map +1 -0
- package/dist/accounts/liquid.js +66 -0
- package/dist/accounts/liquid.js.map +1 -0
- package/dist/client.d.ts +621 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +511 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +56 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +44 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +39 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +63 -0
- package/dist/errors.js.map +1 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +2 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/parser.d.ts +40 -0
- package/dist/events/parser.d.ts.map +1 -0
- package/dist/events/parser.js +67 -0
- package/dist/events/parser.js.map +1 -0
- package/dist/events/types.d.ts +286 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/events/types.js +2 -0
- package/dist/events/types.js.map +1 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/preview.d.ts +259 -0
- package/dist/helpers/preview.d.ts.map +1 -0
- package/dist/helpers/preview.js +458 -0
- package/dist/helpers/preview.js.map +1 -0
- package/dist/helpers/user.d.ts +11 -0
- package/dist/helpers/user.d.ts.map +1 -0
- package/dist/helpers/user.js +20 -0
- package/dist/helpers/user.js.map +1 -0
- package/dist/idl/index.d.ts +53 -0
- package/dist/idl/index.d.ts.map +1 -0
- package/dist/idl/index.js +64 -0
- package/dist/idl/index.js.map +1 -0
- package/dist/idl/liquid.d.ts +10523 -0
- package/dist/idl/liquid.d.ts.map +1 -0
- package/dist/idl/liquid.js +2 -0
- package/dist/idl/liquid.js.map +1 -0
- package/dist/idl/liquid.json +10516 -0
- package/dist/idl/liquid_fees.d.ts +1520 -0
- package/dist/idl/liquid_fees.d.ts.map +1 -0
- package/dist/idl/liquid_fees.js +2 -0
- package/dist/idl/liquid_fees.js.map +1 -0
- package/dist/idl/liquid_fees.json +1513 -0
- package/dist/idl/liquid_state.d.ts +2936 -0
- package/dist/idl/liquid_state.d.ts.map +1 -0
- package/dist/idl/liquid_state.js +2 -0
- package/dist/idl/liquid_state.js.map +1 -0
- package/dist/idl/liquid_state.json +2929 -0
- package/dist/idl/liquid_swap.d.ts +5849 -0
- package/dist/idl/liquid_swap.d.ts.map +1 -0
- package/dist/idl/liquid_swap.js +2 -0
- package/dist/idl/liquid_swap.js.map +1 -0
- package/dist/idl/liquid_swap.json +5842 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/instructions/index.d.ts +9 -0
- package/dist/instructions/index.d.ts.map +1 -0
- package/dist/instructions/index.js +9 -0
- package/dist/instructions/index.js.map +1 -0
- package/dist/instructions/liquid-fees.d.ts +111 -0
- package/dist/instructions/liquid-fees.d.ts.map +1 -0
- package/dist/instructions/liquid-fees.js +169 -0
- package/dist/instructions/liquid-fees.js.map +1 -0
- package/dist/instructions/liquid-state.d.ts +173 -0
- package/dist/instructions/liquid-state.d.ts.map +1 -0
- package/dist/instructions/liquid-state.js +194 -0
- package/dist/instructions/liquid-state.js.map +1 -0
- package/dist/instructions/liquid-swap.d.ts +122 -0
- package/dist/instructions/liquid-swap.d.ts.map +1 -0
- package/dist/instructions/liquid-swap.js +167 -0
- package/dist/instructions/liquid-swap.js.map +1 -0
- package/dist/instructions/liquid.d.ts +297 -0
- package/dist/instructions/liquid.d.ts.map +1 -0
- package/dist/instructions/liquid.js +483 -0
- package/dist/instructions/liquid.js.map +1 -0
- package/dist/instructions/program-cache.d.ts +35 -0
- package/dist/instructions/program-cache.d.ts.map +1 -0
- package/dist/instructions/program-cache.js +68 -0
- package/dist/instructions/program-cache.js.map +1 -0
- package/dist/math/amm.d.ts +42 -0
- package/dist/math/amm.d.ts.map +1 -0
- package/dist/math/amm.js +109 -0
- package/dist/math/amm.js.map +1 -0
- package/dist/math/bonding-curve.d.ts +34 -0
- package/dist/math/bonding-curve.d.ts.map +1 -0
- package/dist/math/bonding-curve.js +80 -0
- package/dist/math/bonding-curve.js.map +1 -0
- package/dist/math/constants.d.ts +14 -0
- package/dist/math/constants.d.ts.map +1 -0
- package/dist/math/constants.js +14 -0
- package/dist/math/constants.js.map +1 -0
- package/dist/math/fees.d.ts +88 -0
- package/dist/math/fees.d.ts.map +1 -0
- package/dist/math/fees.js +135 -0
- package/dist/math/fees.js.map +1 -0
- package/dist/math/index.d.ts +8 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/math/index.js +6 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/tiered-fees.d.ts +80 -0
- package/dist/math/tiered-fees.d.ts.map +1 -0
- package/dist/math/tiered-fees.js +129 -0
- package/dist/math/tiered-fees.js.map +1 -0
- package/dist/oracle.d.ts +53 -0
- package/dist/oracle.d.ts.map +1 -0
- package/dist/oracle.js +70 -0
- package/dist/oracle.js.map +1 -0
- package/dist/pda/index.d.ts +89 -0
- package/dist/pda/index.d.ts.map +1 -0
- package/dist/pda/index.js +127 -0
- package/dist/pda/index.js.map +1 -0
- package/dist/pda/liquid-fees.d.ts +27 -0
- package/dist/pda/liquid-fees.d.ts.map +1 -0
- package/dist/pda/liquid-fees.js +36 -0
- package/dist/pda/liquid-fees.js.map +1 -0
- package/dist/pda/liquid-state.d.ts +56 -0
- package/dist/pda/liquid-state.d.ts.map +1 -0
- package/dist/pda/liquid-state.js +79 -0
- package/dist/pda/liquid-state.js.map +1 -0
- package/dist/pda/liquid-swap.d.ts +76 -0
- package/dist/pda/liquid-swap.d.ts.map +1 -0
- package/dist/pda/liquid-swap.js +103 -0
- package/dist/pda/liquid-swap.js.map +1 -0
- package/dist/pda/liquid.d.ts +67 -0
- package/dist/pda/liquid.d.ts.map +1 -0
- package/dist/pda/liquid.js +91 -0
- package/dist/pda/liquid.js.map +1 -0
- package/dist/provider.d.ts +26 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +47 -0
- package/dist/provider.js.map +1 -0
- package/dist/transaction/builder.d.ts +30 -0
- package/dist/transaction/builder.d.ts.map +1 -0
- package/dist/transaction/builder.js +48 -0
- package/dist/transaction/builder.js.map +1 -0
- package/dist/transaction/index.d.ts +3 -0
- package/dist/transaction/index.d.ts.map +1 -0
- package/dist/transaction/index.js +3 -0
- package/dist/transaction/index.js.map +1 -0
- package/dist/transaction/send.d.ts +25 -0
- package/dist/transaction/send.d.ts.map +1 -0
- package/dist/transaction/send.js +52 -0
- package/dist/transaction/send.js.map +1 -0
- package/dist/types.d.ts +311 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +46 -0
- package/dist/types.js.map +1 -0
- package/package.json +112 -0
- package/src/accounts/index.ts +26 -0
- package/src/accounts/liquid-fees.ts +38 -0
- package/src/accounts/liquid-state.ts +134 -0
- package/src/accounts/liquid-swap.ts +79 -0
- package/src/accounts/liquid.ts +100 -0
- package/src/client.ts +1001 -0
- package/src/config.ts +91 -0
- package/src/errors.ts +94 -0
- package/src/events/index.ts +42 -0
- package/src/events/parser.ts +90 -0
- package/src/events/types.ts +310 -0
- package/src/helpers/index.ts +23 -0
- package/src/helpers/preview.ts +798 -0
- package/src/helpers/user.ts +24 -0
- package/src/idl/index.ts +94 -0
- package/src/idl/liquid.json +10516 -0
- package/src/idl/liquid.ts +10522 -0
- package/src/idl/liquid_fees.json +1513 -0
- package/src/idl/liquid_fees.ts +1519 -0
- package/src/idl/liquid_state.json +2929 -0
- package/src/idl/liquid_state.ts +2935 -0
- package/src/idl/liquid_swap.json +5842 -0
- package/src/idl/liquid_swap.ts +5848 -0
- package/src/index.ts +98 -0
- package/src/instructions/index.ts +109 -0
- package/src/instructions/liquid-fees.ts +289 -0
- package/src/instructions/liquid-state.ts +336 -0
- package/src/instructions/liquid-swap.ts +414 -0
- package/src/instructions/liquid.ts +884 -0
- package/src/instructions/program-cache.ts +106 -0
- package/src/math/amm.ts +146 -0
- package/src/math/bonding-curve.ts +122 -0
- package/src/math/constants.ts +19 -0
- package/src/math/fees.ts +191 -0
- package/src/math/index.ts +40 -0
- package/src/math/tiered-fees.ts +165 -0
- package/src/oracle.ts +97 -0
- package/src/pda/index.ts +331 -0
- package/src/pda/liquid-fees.ts +58 -0
- package/src/pda/liquid-state.ts +123 -0
- package/src/pda/liquid-swap.ts +162 -0
- package/src/pda/liquid.ts +152 -0
- package/src/provider.ts +60 -0
- package/src/transaction/builder.ts +80 -0
- package/src/transaction/index.ts +6 -0
- package/src/transaction/send.ts +72 -0
- package/src/types.ts +354 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import type { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import { type LiquidConfig } from "../config.js";
|
|
4
|
+
export interface BuildCreateNativeCurveParams {
|
|
5
|
+
creator: PublicKey;
|
|
6
|
+
mint: PublicKey;
|
|
7
|
+
pythPriceFeed: PublicKey;
|
|
8
|
+
name: string;
|
|
9
|
+
symbol: string;
|
|
10
|
+
uri: string;
|
|
11
|
+
config: LiquidConfig;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Builds a createNativeCurve instruction.
|
|
15
|
+
* The mint Keypair must be passed as a signer when sending the transaction.
|
|
16
|
+
* Atomically initializes the fee configuration via CPI to liquid-fees
|
|
17
|
+
* with the creator as the sole recipient (100%). Use `buildUpdateFeeConfig`
|
|
18
|
+
* to set custom recipients afterward.
|
|
19
|
+
*
|
|
20
|
+
* @param params - {@link BuildCreateNativeCurveParams}
|
|
21
|
+
* @returns Transaction instruction
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildCreateNativeCurve(params: BuildCreateNativeCurveParams): Promise<TransactionInstruction>;
|
|
24
|
+
export interface BuildBumpNativeParams {
|
|
25
|
+
mint: PublicKey;
|
|
26
|
+
pythPriceFeed: PublicKey;
|
|
27
|
+
config: LiquidConfig;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Builds a bumpNative instruction.
|
|
31
|
+
* Re-evaluates a native bonding curve's market cap against the current oracle price
|
|
32
|
+
* and marks it as complete if the threshold is exceeded. Permissionless.
|
|
33
|
+
*
|
|
34
|
+
* @param params - {@link BuildBumpNativeParams}
|
|
35
|
+
* @returns Transaction instruction
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildBumpNative(params: BuildBumpNativeParams): Promise<TransactionInstruction>;
|
|
38
|
+
export interface BuildBuyNativeParams {
|
|
39
|
+
user: PublicKey;
|
|
40
|
+
mint: PublicKey;
|
|
41
|
+
creator: PublicKey;
|
|
42
|
+
pythPriceFeed: PublicKey;
|
|
43
|
+
amountIn: BN;
|
|
44
|
+
minAmountOut: BN;
|
|
45
|
+
feeRecipient: PublicKey;
|
|
46
|
+
creatorReferralVault?: PublicKey | null;
|
|
47
|
+
traderReferralVault?: PublicKey | null;
|
|
48
|
+
config: LiquidConfig;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Builds a buyNative instruction.
|
|
52
|
+
* Requires the bonding curve creator and Pyth price feed to be known.
|
|
53
|
+
*
|
|
54
|
+
* @param params - {@link BuildBuyNativeParams}
|
|
55
|
+
* @returns Transaction instruction
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildBuyNative(params: BuildBuyNativeParams): Promise<TransactionInstruction>;
|
|
58
|
+
/**
|
|
59
|
+
* Builds a buyNative instruction, automatically fetching the bonding curve
|
|
60
|
+
* creator from chain. Convenience wrapper around `buildBuyNative`.
|
|
61
|
+
*
|
|
62
|
+
* @param connection - Solana RPC connection
|
|
63
|
+
* @param params - {@link BuildBuyNativeParams} without `creator`
|
|
64
|
+
* @returns Transaction instruction
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildBuyNativeAutoResolve(connection: Connection, params: Omit<BuildBuyNativeParams, "creator">): Promise<TransactionInstruction>;
|
|
67
|
+
export interface BuildSellNativeParams {
|
|
68
|
+
user: PublicKey;
|
|
69
|
+
mint: PublicKey;
|
|
70
|
+
creator: PublicKey;
|
|
71
|
+
pythPriceFeed: PublicKey;
|
|
72
|
+
amountIn: BN;
|
|
73
|
+
minAmountOut: BN;
|
|
74
|
+
feeRecipient: PublicKey;
|
|
75
|
+
creatorReferralVault?: PublicKey | null;
|
|
76
|
+
traderReferralVault?: PublicKey | null;
|
|
77
|
+
config: LiquidConfig;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Builds a sellNative instruction.
|
|
81
|
+
* Requires the bonding curve creator and Pyth price feed to be known.
|
|
82
|
+
*
|
|
83
|
+
* @param params - {@link BuildSellNativeParams}
|
|
84
|
+
* @returns Transaction instruction
|
|
85
|
+
*/
|
|
86
|
+
export declare function buildSellNative(params: BuildSellNativeParams): Promise<TransactionInstruction>;
|
|
87
|
+
/**
|
|
88
|
+
* Builds a sellNative instruction, automatically fetching the bonding curve
|
|
89
|
+
* creator from chain. Convenience wrapper around `buildSellNative`.
|
|
90
|
+
*
|
|
91
|
+
* @param connection - Solana RPC connection
|
|
92
|
+
* @param params - {@link BuildSellNativeParams} without `creator`
|
|
93
|
+
* @returns Transaction instruction
|
|
94
|
+
*/
|
|
95
|
+
export declare function buildSellNativeAutoResolve(connection: Connection, params: Omit<BuildSellNativeParams, "creator">): Promise<TransactionInstruction>;
|
|
96
|
+
export interface BuildMigrateNativeParams {
|
|
97
|
+
migrator: PublicKey;
|
|
98
|
+
mint: PublicKey;
|
|
99
|
+
config: LiquidConfig;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Builds a migrate instruction (bonding curve -> AMM pool).
|
|
103
|
+
* Permissionless — anyone can trigger migration once the curve is complete.
|
|
104
|
+
*
|
|
105
|
+
* @param params - {@link BuildMigrateNativeParams}
|
|
106
|
+
* @returns Transaction instruction
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildMigrateNative(params: BuildMigrateNativeParams): Promise<TransactionInstruction>;
|
|
109
|
+
export interface BuildInitializeNativeReferralVaultParams {
|
|
110
|
+
user: PublicKey;
|
|
111
|
+
config: LiquidConfig;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Builds an initializeNativeReferralVault instruction (creates native SOL referral vault).
|
|
115
|
+
*
|
|
116
|
+
* @param params - {@link BuildInitializeNativeReferralVaultParams}
|
|
117
|
+
* @returns Transaction instruction
|
|
118
|
+
*/
|
|
119
|
+
export declare function buildInitializeNativeReferralVault(params: BuildInitializeNativeReferralVaultParams): Promise<TransactionInstruction>;
|
|
120
|
+
export interface BuildWithdrawReferralRewardsParams {
|
|
121
|
+
user: PublicKey;
|
|
122
|
+
config: LiquidConfig;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Builds a withdrawReferralRewards instruction.
|
|
126
|
+
*
|
|
127
|
+
* @param params - {@link BuildWithdrawReferralRewardsParams}
|
|
128
|
+
* @returns Transaction instruction
|
|
129
|
+
*/
|
|
130
|
+
export declare function buildWithdrawReferralRewards(params: BuildWithdrawReferralRewardsParams): Promise<TransactionInstruction>;
|
|
131
|
+
export interface BuildExecuteBuybackNativeParams {
|
|
132
|
+
payer: PublicKey;
|
|
133
|
+
mint: PublicKey;
|
|
134
|
+
pythPriceFeed: PublicKey;
|
|
135
|
+
config: LiquidConfig;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Builds an executeBuybackNative instruction for a native SOL bonding curve.
|
|
139
|
+
* Permissionless — anyone can trigger. Only works when fee config is Revoked.
|
|
140
|
+
*
|
|
141
|
+
* @param params - {@link BuildExecuteBuybackNativeParams}
|
|
142
|
+
* @returns Transaction instruction
|
|
143
|
+
*/
|
|
144
|
+
export declare function buildExecuteBuybackNative(params: BuildExecuteBuybackNativeParams): Promise<TransactionInstruction>;
|
|
145
|
+
export interface BuildExecuteBuybackTokenParams {
|
|
146
|
+
payer: PublicKey;
|
|
147
|
+
mint: PublicKey;
|
|
148
|
+
quoteMint: PublicKey;
|
|
149
|
+
config: LiquidConfig;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Builds an executeBuybackToken instruction for a token-based bonding curve.
|
|
153
|
+
* Permissionless — anyone can trigger. Only works when fee config is Revoked.
|
|
154
|
+
*
|
|
155
|
+
* @param params - {@link BuildExecuteBuybackTokenParams}
|
|
156
|
+
* @returns Transaction instruction
|
|
157
|
+
*/
|
|
158
|
+
export declare function buildExecuteBuybackToken(params: BuildExecuteBuybackTokenParams): Promise<TransactionInstruction>;
|
|
159
|
+
export interface BuildCreateStableCurveParams {
|
|
160
|
+
creator: PublicKey;
|
|
161
|
+
mint: PublicKey;
|
|
162
|
+
quoteMint: PublicKey;
|
|
163
|
+
name: string;
|
|
164
|
+
symbol: string;
|
|
165
|
+
uri: string;
|
|
166
|
+
config: LiquidConfig;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Builds a createStableCurve instruction.
|
|
170
|
+
* Creates a token-based bonding curve (e.g., using USDC as quote).
|
|
171
|
+
* The mint Keypair must be passed as a signer when sending the transaction.
|
|
172
|
+
* Atomically initializes the fee configuration via CPI to liquid-fees
|
|
173
|
+
* with the creator as the sole recipient (100%). Use `buildUpdateFeeConfig`
|
|
174
|
+
* to set custom recipients afterward.
|
|
175
|
+
*
|
|
176
|
+
* @param params - {@link BuildCreateStableCurveParams}
|
|
177
|
+
* @returns Transaction instruction
|
|
178
|
+
*/
|
|
179
|
+
export declare function buildCreateStableCurve(params: BuildCreateStableCurveParams): Promise<TransactionInstruction>;
|
|
180
|
+
export interface BuildBuyStableParams {
|
|
181
|
+
user: PublicKey;
|
|
182
|
+
mint: PublicKey;
|
|
183
|
+
quoteMint: PublicKey;
|
|
184
|
+
creator: PublicKey;
|
|
185
|
+
amountIn: BN;
|
|
186
|
+
minAmountOut: BN;
|
|
187
|
+
feeRecipient: PublicKey;
|
|
188
|
+
creatorReferralVault?: PublicKey | null;
|
|
189
|
+
traderReferralVault?: PublicKey | null;
|
|
190
|
+
config: LiquidConfig;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Builds a buyStable instruction.
|
|
194
|
+
* Buys tokens from a token-based bonding curve using quote tokens (e.g., USDC).
|
|
195
|
+
*
|
|
196
|
+
* @param params - {@link BuildBuyStableParams}
|
|
197
|
+
* @returns Transaction instruction
|
|
198
|
+
*/
|
|
199
|
+
export declare function buildBuyStable(params: BuildBuyStableParams): Promise<TransactionInstruction>;
|
|
200
|
+
/**
|
|
201
|
+
* Builds a buyStable instruction, automatically fetching the bonding curve
|
|
202
|
+
* creator from chain. Convenience wrapper around `buildBuyStable`.
|
|
203
|
+
*
|
|
204
|
+
* @param connection - Solana RPC connection
|
|
205
|
+
* @param params - {@link BuildBuyStableParams} without `creator`
|
|
206
|
+
* @returns Transaction instruction
|
|
207
|
+
*/
|
|
208
|
+
export declare function buildBuyStableAutoResolve(connection: Connection, params: Omit<BuildBuyStableParams, "creator">): Promise<TransactionInstruction>;
|
|
209
|
+
export interface BuildSellStableParams {
|
|
210
|
+
user: PublicKey;
|
|
211
|
+
mint: PublicKey;
|
|
212
|
+
quoteMint: PublicKey;
|
|
213
|
+
creator: PublicKey;
|
|
214
|
+
amountIn: BN;
|
|
215
|
+
minAmountOut: BN;
|
|
216
|
+
feeRecipient: PublicKey;
|
|
217
|
+
creatorReferralVault?: PublicKey | null;
|
|
218
|
+
traderReferralVault?: PublicKey | null;
|
|
219
|
+
config: LiquidConfig;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Builds a sellStable instruction.
|
|
223
|
+
* Sells tokens to a token-based bonding curve for quote tokens (e.g., USDC).
|
|
224
|
+
*
|
|
225
|
+
* @param params - {@link BuildSellStableParams}
|
|
226
|
+
* @returns Transaction instruction
|
|
227
|
+
*/
|
|
228
|
+
export declare function buildSellStable(params: BuildSellStableParams): Promise<TransactionInstruction>;
|
|
229
|
+
/**
|
|
230
|
+
* Builds a sellStable instruction, automatically fetching the bonding curve
|
|
231
|
+
* creator from chain. Convenience wrapper around `buildSellStable`.
|
|
232
|
+
*
|
|
233
|
+
* @param connection - Solana RPC connection
|
|
234
|
+
* @param params - {@link BuildSellStableParams} without `creator`
|
|
235
|
+
* @returns Transaction instruction
|
|
236
|
+
*/
|
|
237
|
+
export declare function buildSellStableAutoResolve(connection: Connection, params: Omit<BuildSellStableParams, "creator">): Promise<TransactionInstruction>;
|
|
238
|
+
export interface BuildMigrateStableParams {
|
|
239
|
+
migrator: PublicKey;
|
|
240
|
+
mint: PublicKey;
|
|
241
|
+
quoteMint: PublicKey;
|
|
242
|
+
config: LiquidConfig;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Builds a migrateStable instruction (token bonding curve -> AMM pool).
|
|
246
|
+
* Permissionless — anyone can trigger migration once the curve is complete.
|
|
247
|
+
*
|
|
248
|
+
* @param params - {@link BuildMigrateStableParams}
|
|
249
|
+
* @returns Transaction instruction
|
|
250
|
+
*/
|
|
251
|
+
export declare function buildMigrateStable(params: BuildMigrateStableParams): Promise<TransactionInstruction>;
|
|
252
|
+
export interface BuildSetFeeRecipientsParams {
|
|
253
|
+
admin: PublicKey;
|
|
254
|
+
/** Array of 8 fee recipient pubkeys */
|
|
255
|
+
feeRecipients: PublicKey[];
|
|
256
|
+
config: LiquidConfig;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Builds a setFeeRecipients instruction.
|
|
260
|
+
* Admin-only instruction to set/update the protocol fee recipients.
|
|
261
|
+
*
|
|
262
|
+
* @param params - {@link BuildSetFeeRecipientsParams}
|
|
263
|
+
* @returns Transaction instruction
|
|
264
|
+
*/
|
|
265
|
+
export declare function buildSetFeeRecipients(params: BuildSetFeeRecipientsParams): Promise<TransactionInstruction>;
|
|
266
|
+
export interface BuildInitializeFeeRecipientVaultsParams {
|
|
267
|
+
payer: PublicKey;
|
|
268
|
+
quoteMint: PublicKey;
|
|
269
|
+
/** Array of 8 fee recipient pubkeys (must match config) */
|
|
270
|
+
feeRecipients: PublicKey[];
|
|
271
|
+
config: LiquidConfig;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Builds an initializeFeeRecipientVaults instruction.
|
|
275
|
+
* Permissionless instruction to create token accounts for all fee recipients
|
|
276
|
+
* for a given quote mint. Call this before trading stable curves.
|
|
277
|
+
*
|
|
278
|
+
* @param params - {@link BuildInitializeFeeRecipientVaultsParams}
|
|
279
|
+
* @returns Transaction instruction
|
|
280
|
+
*/
|
|
281
|
+
export declare function buildInitializeFeeRecipientVaults(params: BuildInitializeFeeRecipientVaultsParams): Promise<TransactionInstruction>;
|
|
282
|
+
export interface BuildInitializeReferralTokenVaultParams {
|
|
283
|
+
user: PublicKey;
|
|
284
|
+
quoteMint: PublicKey;
|
|
285
|
+
config: LiquidConfig;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Builds an initializeReferralTokenVault instruction.
|
|
289
|
+
* Creates a referral token vault (ATA) for the user for a specific quote mint.
|
|
290
|
+
* Users must call this for each quote mint they want to receive referral rewards for.
|
|
291
|
+
* If not initialized, referral fees will be redirected to protocol fees.
|
|
292
|
+
*
|
|
293
|
+
* @param params - {@link BuildInitializeReferralTokenVaultParams}
|
|
294
|
+
* @returns Transaction instruction
|
|
295
|
+
*/
|
|
296
|
+
export declare function buildInitializeReferralTokenVault(params: BuildInitializeReferralTokenVaultParams): Promise<TransactionInstruction>;
|
|
297
|
+
//# sourceMappingURL=liquid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid.d.ts","sourceRoot":"","sources":["../../src/instructions/liquid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,SAAS,EACT,sBAAsB,EACtB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,KAAK,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAqB5D,MAAM,WAAW,4BAA4B;IAC5C,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,aAAa,EAAE,SAAS,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,4BAA4B,GAClC,OAAO,CAAC,sBAAsB,CAAC,CAqBjC;AAED,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,SAAS,CAAC;IAChB,aAAa,EAAE,SAAS,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAWjC;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,IAA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