@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,79 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
const SEED_USER_PROPERTIES = Buffer.from("user_properties");
|
|
3
|
+
const SEED_GLOBAL_CURVE_VOLUME = Buffer.from("global_curve_volume");
|
|
4
|
+
const SEED_GLOBAL_AMM_VOLUME = Buffer.from("global_amm_volume");
|
|
5
|
+
const SEED_TOKEN_VOLUME = Buffer.from("token_volume");
|
|
6
|
+
const SEED_CASHBACK_CONFIG = Buffer.from("cashback_config");
|
|
7
|
+
const SEED_USER_SNAPSHOT = Buffer.from("user_snapshot");
|
|
8
|
+
const SEED_DEAL = Buffer.from("deal");
|
|
9
|
+
/**
|
|
10
|
+
* Derives the user properties PDA.
|
|
11
|
+
*
|
|
12
|
+
* @param user - User's public key
|
|
13
|
+
* @param programId - Liquid State program ID
|
|
14
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
15
|
+
*/
|
|
16
|
+
export const getUserPropertiesPDA = (user, programId) => {
|
|
17
|
+
return PublicKey.findProgramAddressSync([SEED_USER_PROPERTIES, user.toBuffer()], programId);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Derives the global curve volume accumulator PDA.
|
|
21
|
+
*
|
|
22
|
+
* @param programId - Liquid State program ID
|
|
23
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
24
|
+
*/
|
|
25
|
+
export const getGlobalCurveVolumePDA = (programId) => {
|
|
26
|
+
return PublicKey.findProgramAddressSync([SEED_GLOBAL_CURVE_VOLUME], programId);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Derives the global AMM volume accumulator PDA.
|
|
30
|
+
*
|
|
31
|
+
* @param programId - Liquid State program ID
|
|
32
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
33
|
+
*/
|
|
34
|
+
export const getGlobalAmmVolumePDA = (programId) => {
|
|
35
|
+
return PublicKey.findProgramAddressSync([SEED_GLOBAL_AMM_VOLUME], programId);
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Derives the token volume accumulator PDA for a mint.
|
|
39
|
+
*
|
|
40
|
+
* @param mint - Token mint address
|
|
41
|
+
* @param programId - Liquid State program ID
|
|
42
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
43
|
+
*/
|
|
44
|
+
export const getTokenVolumePDA = (mint, programId) => {
|
|
45
|
+
return PublicKey.findProgramAddressSync([SEED_TOKEN_VOLUME, mint.toBuffer()], programId);
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Derives the cashback config PDA.
|
|
49
|
+
*
|
|
50
|
+
* @param programId - Liquid State program ID
|
|
51
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
52
|
+
*/
|
|
53
|
+
export const getCashbackConfigPDA = (programId) => {
|
|
54
|
+
return PublicKey.findProgramAddressSync([SEED_CASHBACK_CONFIG], programId);
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Derives the user snapshot PDA for a given user and index.
|
|
58
|
+
*
|
|
59
|
+
* @param user - User's public key
|
|
60
|
+
* @param index - Snapshot index (0-based)
|
|
61
|
+
* @param programId - Liquid State program ID
|
|
62
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
63
|
+
*/
|
|
64
|
+
export const getUserSnapshotPDA = (user, index, programId) => {
|
|
65
|
+
const indexBuffer = Buffer.alloc(4);
|
|
66
|
+
indexBuffer.writeUInt32LE(index);
|
|
67
|
+
return PublicKey.findProgramAddressSync([SEED_USER_SNAPSHOT, user.toBuffer(), indexBuffer], programId);
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Derives the deal PDA for a given owner.
|
|
71
|
+
*
|
|
72
|
+
* @param owner - Deal owner's public key
|
|
73
|
+
* @param programId - Liquid State program ID
|
|
74
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
75
|
+
*/
|
|
76
|
+
export const getDealPDA = (owner, programId) => {
|
|
77
|
+
return PublicKey.findProgramAddressSync([SEED_DEAL, owner.toBuffer()], programId);
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=liquid-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid-state.js","sourceRoot":"","sources":["../../src/pda/liquid-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,E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iB,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,EACpC,SAAS,CACT,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CACnC,SAAoB,EACE,EAAE;IACxB,OAAO,SAAS,CAAC,sBAAsB,CAAC,CAAC,oBAAoB,CAAC,EAAE,SAAS,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CACjC,IAAe,EACf,KAAa,EACb,SAAoB,EACE,EAAE;IACxB,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,SAAS,CAAC,sBAAsB,CACtC,CAAC,kBAAkB,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,WAAW,CAAC,EAClD,SAAS,CACT,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACzB,KAAgB,EAChB,SAAoB,EACE,EAAE;IACxB,OAAO,SAAS,CAAC,sBAAsB,CACtC,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,EAC7B,SAAS,CACT,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
/**
|
|
3
|
+
* Derives the swap global configuration PDA.
|
|
4
|
+
*
|
|
5
|
+
* @param programId - Liquid Swap program ID
|
|
6
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
7
|
+
*/
|
|
8
|
+
export declare const getSwapGlobalConfigPDA: (programId: PublicKey) => [PublicKey, number];
|
|
9
|
+
/**
|
|
10
|
+
* Derives the swap authority PDA (for vaults and LP mint).
|
|
11
|
+
*
|
|
12
|
+
* @param programId - Liquid Swap program ID
|
|
13
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
14
|
+
*/
|
|
15
|
+
export declare const getSwapAuthorityPDA: (programId: PublicKey) => [PublicKey, number];
|
|
16
|
+
/**
|
|
17
|
+
* Derives the pool state PDA.
|
|
18
|
+
*
|
|
19
|
+
* @param baseMint - Base token mint address
|
|
20
|
+
* @param quoteMint - Quote token mint address
|
|
21
|
+
* @param programId - Liquid Swap program ID
|
|
22
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
23
|
+
*/
|
|
24
|
+
export declare const getPoolPDA: (baseMint: PublicKey, quoteMint: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
25
|
+
/**
|
|
26
|
+
* Derives the LP mint PDA for a pool.
|
|
27
|
+
*
|
|
28
|
+
* @param poolState - Pool state PDA address
|
|
29
|
+
* @param programId - Liquid Swap program ID
|
|
30
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
31
|
+
*/
|
|
32
|
+
export declare const getPoolLpMintPDA: (poolState: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
33
|
+
/**
|
|
34
|
+
* Derives the pool vault PDA for a specific token.
|
|
35
|
+
*
|
|
36
|
+
* @param poolState - Pool state PDA address
|
|
37
|
+
* @param mint - Token mint address for this vault
|
|
38
|
+
* @param programId - Liquid Swap program ID
|
|
39
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
40
|
+
*/
|
|
41
|
+
export declare const getPoolVaultPDA: (poolState: PublicKey, mint: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
42
|
+
/**
|
|
43
|
+
* Derives the observation state PDA (oracle data).
|
|
44
|
+
*
|
|
45
|
+
* @param poolState - Pool state PDA address
|
|
46
|
+
* @param programId - Liquid Swap program ID
|
|
47
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
48
|
+
*/
|
|
49
|
+
export declare const getObservationPDA: (poolState: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
50
|
+
/**
|
|
51
|
+
* Derives the protocol fee vault PDA.
|
|
52
|
+
*
|
|
53
|
+
* @param feeRecipient - Fee recipient's public key
|
|
54
|
+
* @param quoteMint - Quote token mint address
|
|
55
|
+
* @param programId - Liquid Swap program ID
|
|
56
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
57
|
+
*/
|
|
58
|
+
export declare const getProtocolFeeVaultPDA: (feeRecipient: PublicKey, quoteMint: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
59
|
+
/**
|
|
60
|
+
* Derives the temporary WSOL PDA (for unwrapping during swaps).
|
|
61
|
+
*
|
|
62
|
+
* @param poolState - Pool state PDA address
|
|
63
|
+
* @param programId - Liquid Swap program ID
|
|
64
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
65
|
+
*/
|
|
66
|
+
export declare const getTempWsolPDA: (poolState: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
67
|
+
/**
|
|
68
|
+
* Derives the buyback vault PDA for a pool.
|
|
69
|
+
*
|
|
70
|
+
* @param poolState - Pool state PDA address
|
|
71
|
+
* @param quoteMint - Quote token mint address
|
|
72
|
+
* @param programId - Liquid Swap program ID
|
|
73
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
74
|
+
*/
|
|
75
|
+
export declare const getSwapBuybackVaultPDA: (poolState: PublicKey, quoteMint: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
76
|
+
//# sourceMappingURL=liquid-swap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid-swap.d.ts","sourceRoot":"","sources":["../../src/pda/liquid-swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAClC,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAEpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC/B,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAEpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACtB,UAAU,SAAS,EACnB,WAAW,SAAS,EACpB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC5B,WAAW,SAAS,EACpB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC3B,WAAW,SAAS,EACpB,MAAM,SAAS,EACf,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC7B,WAAW,SAAS,EACpB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAClC,cAAc,SAAS,EACvB,WAAW,SAAS,EACpB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAC1B,WAAW,SAAS,EACpB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAClC,WAAW,SAAS,EACpB,WAAW,SAAS,EACpB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
const SEED_GLOBAL_CONFIG = Buffer.from("global_config");
|
|
3
|
+
const AUTH_SEED = Buffer.from("vault_and_lp_mint_auth_seed");
|
|
4
|
+
const POOL_SEED = Buffer.from("pool");
|
|
5
|
+
const POOL_LP_MINT_SEED = Buffer.from("pool_lp_mint");
|
|
6
|
+
const POOL_VAULT_SEED = Buffer.from("pool_vault");
|
|
7
|
+
const OBSERVATION_SEED = Buffer.from("observation");
|
|
8
|
+
const GLOBAL_FEE_SEED = Buffer.from("global_fee");
|
|
9
|
+
const SEED_TEMP_WSOL = Buffer.from("temp_wsol");
|
|
10
|
+
const SEED_BUYBACK_VAULT = Buffer.from("buyback_vault");
|
|
11
|
+
/**
|
|
12
|
+
* Derives the swap global configuration PDA.
|
|
13
|
+
*
|
|
14
|
+
* @param programId - Liquid Swap program ID
|
|
15
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
16
|
+
*/
|
|
17
|
+
export const getSwapGlobalConfigPDA = (programId) => {
|
|
18
|
+
return PublicKey.findProgramAddressSync([SEED_GLOBAL_CONFIG], programId);
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Derives the swap authority PDA (for vaults and LP mint).
|
|
22
|
+
*
|
|
23
|
+
* @param programId - Liquid Swap program ID
|
|
24
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
25
|
+
*/
|
|
26
|
+
export const getSwapAuthorityPDA = (programId) => {
|
|
27
|
+
return PublicKey.findProgramAddressSync([AUTH_SEED], programId);
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Derives the pool state PDA.
|
|
31
|
+
*
|
|
32
|
+
* @param baseMint - Base token mint address
|
|
33
|
+
* @param quoteMint - Quote token mint address
|
|
34
|
+
* @param programId - Liquid Swap program ID
|
|
35
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
36
|
+
*/
|
|
37
|
+
export const getPoolPDA = (baseMint, quoteMint, programId) => {
|
|
38
|
+
return PublicKey.findProgramAddressSync([POOL_SEED, baseMint.toBuffer(), quoteMint.toBuffer()], programId);
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Derives the LP mint PDA for a pool.
|
|
42
|
+
*
|
|
43
|
+
* @param poolState - Pool state PDA address
|
|
44
|
+
* @param programId - Liquid Swap program ID
|
|
45
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
46
|
+
*/
|
|
47
|
+
export const getPoolLpMintPDA = (poolState, programId) => {
|
|
48
|
+
return PublicKey.findProgramAddressSync([POOL_LP_MINT_SEED, poolState.toBuffer()], programId);
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Derives the pool vault PDA for a specific token.
|
|
52
|
+
*
|
|
53
|
+
* @param poolState - Pool state PDA address
|
|
54
|
+
* @param mint - Token mint address for this vault
|
|
55
|
+
* @param programId - Liquid Swap program ID
|
|
56
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
57
|
+
*/
|
|
58
|
+
export const getPoolVaultPDA = (poolState, mint, programId) => {
|
|
59
|
+
return PublicKey.findProgramAddressSync([POOL_VAULT_SEED, poolState.toBuffer(), mint.toBuffer()], programId);
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Derives the observation state PDA (oracle data).
|
|
63
|
+
*
|
|
64
|
+
* @param poolState - Pool state PDA address
|
|
65
|
+
* @param programId - Liquid Swap program ID
|
|
66
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
67
|
+
*/
|
|
68
|
+
export const getObservationPDA = (poolState, programId) => {
|
|
69
|
+
return PublicKey.findProgramAddressSync([OBSERVATION_SEED, poolState.toBuffer()], programId);
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Derives the protocol fee vault PDA.
|
|
73
|
+
*
|
|
74
|
+
* @param feeRecipient - Fee recipient's public key
|
|
75
|
+
* @param quoteMint - Quote token mint address
|
|
76
|
+
* @param programId - Liquid Swap program ID
|
|
77
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
78
|
+
*/
|
|
79
|
+
export const getProtocolFeeVaultPDA = (feeRecipient, quoteMint, programId) => {
|
|
80
|
+
return PublicKey.findProgramAddressSync([GLOBAL_FEE_SEED, feeRecipient.toBuffer(), quoteMint.toBuffer()], programId);
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Derives the temporary WSOL PDA (for unwrapping during swaps).
|
|
84
|
+
*
|
|
85
|
+
* @param poolState - Pool state PDA address
|
|
86
|
+
* @param programId - Liquid Swap program ID
|
|
87
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
88
|
+
*/
|
|
89
|
+
export const getTempWsolPDA = (poolState, programId) => {
|
|
90
|
+
return PublicKey.findProgramAddressSync([SEED_TEMP_WSOL, poolState.toBuffer()], programId);
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Derives the buyback vault PDA for a pool.
|
|
94
|
+
*
|
|
95
|
+
* @param poolState - Pool state PDA address
|
|
96
|
+
* @param quoteMint - Quote token mint address
|
|
97
|
+
* @param programId - Liquid Swap program ID
|
|
98
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
99
|
+
*/
|
|
100
|
+
export const getSwapBuybackVaultPDA = (poolState, quoteMint, programId) => {
|
|
101
|
+
return PublicKey.findProgramAddressSync([SEED_BUYBACK_VAULT, poolState.toBuffer(), quoteMint.toBuffer()], programId);
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=liquid-swap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid-swap.js","sourceRoot":"","sources":["../../src/pda/liquid-swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACxD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACtD,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAClD,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACpD,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,YAA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T,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAChC,SAAoB,EACpB,SAAoB,EACE,EAAE;IACxB,OAAO,SAAS,CAAC,sBAAsB,CACtC,CAAC,gBAAgB,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,EACxC,SAAS,CACT,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACrC,YAAuB,EACvB,SAAoB,EACpB,SAAoB,EACE,EAAE;IACxB,OAAO,SAAS,CAAC,sBAAsB,CACtC,CAAC,eAAe,EAAE,YAAY,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,EAChE,SAAS,CACT,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC7B,SAAoB,EACpB,SAAoB,EACE,EAAE;IACxB,OAAO,SAAS,CAAC,sBAAsB,CACtC,CAAC,cAAc,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,EACtC,SAAS,CACT,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACrC,SAAoB,EACpB,SAAoB,EACpB,SAAoB,EACE,EAAE;IACxB,OAAO,SAAS,CAAC,sBAAsB,CACtC,CAAC,kBAAkB,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,EAChE,SAAS,CACT,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
/**
|
|
3
|
+
* Derives the global configuration PDA for the liquid program.
|
|
4
|
+
*
|
|
5
|
+
* @param programId - Liquid program ID
|
|
6
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
7
|
+
*/
|
|
8
|
+
export declare const getLiquidGlobalConfigPDA: (programId: PublicKey) => [PublicKey, number];
|
|
9
|
+
/**
|
|
10
|
+
* Derives the bonding curve PDA for a token mint.
|
|
11
|
+
*
|
|
12
|
+
* @param mint - Token mint address
|
|
13
|
+
* @param programId - Liquid program ID
|
|
14
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
15
|
+
*/
|
|
16
|
+
export declare const getBondingCurvePDA: (mint: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
17
|
+
/**
|
|
18
|
+
* Derives the bonding curve SOL vault PDA.
|
|
19
|
+
*
|
|
20
|
+
* @param bondingCurve - Bonding curve PDA address
|
|
21
|
+
* @param programId - Liquid program ID
|
|
22
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
23
|
+
*/
|
|
24
|
+
export declare const getBondingCurveSolVaultPDA: (bondingCurve: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
25
|
+
/**
|
|
26
|
+
* Derives the referral vault PDA for referral rewards.
|
|
27
|
+
*
|
|
28
|
+
* @param referrer - Referrer's public key
|
|
29
|
+
* @param programId - Liquid program ID
|
|
30
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
31
|
+
*/
|
|
32
|
+
export declare const getReferralVaultPDA: (referrer: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
33
|
+
/**
|
|
34
|
+
* Derives the referral token vault (ATA) for stable curve referral rewards.
|
|
35
|
+
*
|
|
36
|
+
* @param referrer - Referrer's public key
|
|
37
|
+
* @param quoteMint - Quote token mint address
|
|
38
|
+
* @returns Associated token account address
|
|
39
|
+
*/
|
|
40
|
+
export declare const getReferralTokenVault: (referrer: PublicKey, quoteMint: PublicKey) => PublicKey;
|
|
41
|
+
/**
|
|
42
|
+
* Derives the buyback vault PDA for a bonding curve.
|
|
43
|
+
*
|
|
44
|
+
* @param bondingCurve - Bonding curve PDA address
|
|
45
|
+
* @param programId - Liquid program ID
|
|
46
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
47
|
+
*/
|
|
48
|
+
export declare const getBuybackVaultPDA: (bondingCurve: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
49
|
+
/**
|
|
50
|
+
* Derives the token-based bonding curve PDA for a token mint and quote mint.
|
|
51
|
+
*
|
|
52
|
+
* @param mint - Token mint address
|
|
53
|
+
* @param quoteMint - Quote token mint address
|
|
54
|
+
* @param programId - Liquid program ID
|
|
55
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
56
|
+
*/
|
|
57
|
+
export declare const getStableBondingCurvePDA: (mint: PublicKey, quoteMint: PublicKey, programId: PublicKey) => [PublicKey, number];
|
|
58
|
+
/**
|
|
59
|
+
* Derives the bonding curve's token account (ATA) for holding minted tokens.
|
|
60
|
+
* Uses Token-2022 since bonding curve mints use the Token-2022 program.
|
|
61
|
+
*
|
|
62
|
+
* @param mint - Token mint address
|
|
63
|
+
* @param programId - Liquid program ID
|
|
64
|
+
* @returns Associated token account address
|
|
65
|
+
*/
|
|
66
|
+
export declare const getBondingCurveTokenAccount: (mint: PublicKey, programId: PublicKey) => PublicKey;
|
|
67
|
+
//# sourceMappingURL=liquid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid.d.ts","sourceRoot":"","sources":["../../src/pda/liquid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAc5C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACpC,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAEpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC9B,MAAM,SAAS,EACf,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACtC,cAAc,SAAS,EACvB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC/B,UAAU,SAAS,EACnB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GACjC,UAAU,SAAS,EACnB,WAAW,SAAS,KAClB,SAOF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC9B,cAAc,SAAS,EACvB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACpC,MAAM,SAAS,EACf,WAAW,SAAS,EACpB,WAAW,SAAS,KAClB,CAAC,SAAS,EAAE,MAAM,CAKpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,GACvC,MAAM,SAAS,EACf,WAAW,SAAS,KAClB,SAQF,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
import { getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, } from "@solana/spl-token";
|
|
3
|
+
const SEED_GLOBAL_CONFIG = Buffer.from("global_config");
|
|
4
|
+
const SEED_BONDING_CURVE = Buffer.from("bonding_curve");
|
|
5
|
+
const SEED_BONDING_CURVE_SOL_VAULT = Buffer.from("bonding_curve_sol_vault");
|
|
6
|
+
const SEED_REFERRAL_VAULT = Buffer.from("referral_vault");
|
|
7
|
+
const SEED_BUYBACK_VAULT = Buffer.from("buyback_vault");
|
|
8
|
+
const SEED_TOKEN_BONDING_CURVE = Buffer.from("token_bonding_curve");
|
|
9
|
+
/**
|
|
10
|
+
* Derives the global configuration PDA for the liquid program.
|
|
11
|
+
*
|
|
12
|
+
* @param programId - Liquid program ID
|
|
13
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
14
|
+
*/
|
|
15
|
+
export const getLiquidGlobalConfigPDA = (programId) => {
|
|
16
|
+
return PublicKey.findProgramAddressSync([SEED_GLOBAL_CONFIG], programId);
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Derives the bonding curve PDA for a token mint.
|
|
20
|
+
*
|
|
21
|
+
* @param mint - Token mint address
|
|
22
|
+
* @param programId - Liquid program ID
|
|
23
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
24
|
+
*/
|
|
25
|
+
export const getBondingCurvePDA = (mint, programId) => {
|
|
26
|
+
return PublicKey.findProgramAddressSync([SEED_BONDING_CURVE, mint.toBuffer()], programId);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Derives the bonding curve SOL vault PDA.
|
|
30
|
+
*
|
|
31
|
+
* @param bondingCurve - Bonding curve PDA address
|
|
32
|
+
* @param programId - Liquid program ID
|
|
33
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
34
|
+
*/
|
|
35
|
+
export const getBondingCurveSolVaultPDA = (bondingCurve, programId) => {
|
|
36
|
+
return PublicKey.findProgramAddressSync([SEED_BONDING_CURVE_SOL_VAULT, bondingCurve.toBuffer()], programId);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Derives the referral vault PDA for referral rewards.
|
|
40
|
+
*
|
|
41
|
+
* @param referrer - Referrer's public key
|
|
42
|
+
* @param programId - Liquid program ID
|
|
43
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
44
|
+
*/
|
|
45
|
+
export const getReferralVaultPDA = (referrer, programId) => {
|
|
46
|
+
return PublicKey.findProgramAddressSync([SEED_REFERRAL_VAULT, referrer.toBuffer()], programId);
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Derives the referral token vault (ATA) for stable curve referral rewards.
|
|
50
|
+
*
|
|
51
|
+
* @param referrer - Referrer's public key
|
|
52
|
+
* @param quoteMint - Quote token mint address
|
|
53
|
+
* @returns Associated token account address
|
|
54
|
+
*/
|
|
55
|
+
export const getReferralTokenVault = (referrer, quoteMint) => {
|
|
56
|
+
return getAssociatedTokenAddressSync(quoteMint, referrer, false, TOKEN_PROGRAM_ID);
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Derives the buyback vault PDA for a bonding curve.
|
|
60
|
+
*
|
|
61
|
+
* @param bondingCurve - Bonding curve PDA address
|
|
62
|
+
* @param programId - Liquid program ID
|
|
63
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
64
|
+
*/
|
|
65
|
+
export const getBuybackVaultPDA = (bondingCurve, programId) => {
|
|
66
|
+
return PublicKey.findProgramAddressSync([SEED_BUYBACK_VAULT, bondingCurve.toBuffer()], programId);
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Derives the token-based bonding curve PDA for a token mint and quote mint.
|
|
70
|
+
*
|
|
71
|
+
* @param mint - Token mint address
|
|
72
|
+
* @param quoteMint - Quote token mint address
|
|
73
|
+
* @param programId - Liquid program ID
|
|
74
|
+
* @returns Tuple of [PDA address, bump seed]
|
|
75
|
+
*/
|
|
76
|
+
export const getStableBondingCurvePDA = (mint, quoteMint, programId) => {
|
|
77
|
+
return PublicKey.findProgramAddressSync([SEED_TOKEN_BONDING_CURVE, mint.toBuffer(), quoteMint.toBuffer()], programId);
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Derives the bonding curve's token account (ATA) for holding minted tokens.
|
|
81
|
+
* Uses Token-2022 since bonding curve mints use the Token-2022 program.
|
|
82
|
+
*
|
|
83
|
+
* @param mint - Token mint address
|
|
84
|
+
* @param programId - Liquid program ID
|
|
85
|
+
* @returns Associated token account address
|
|
86
|
+
*/
|
|
87
|
+
export const getBondingCurveTokenAccount = (mint, programId) => {
|
|
88
|
+
const [bondingCurve] = getBondingCurvePDA(mint, programId);
|
|
89
|
+
return getAssociatedTokenAddressSync(mint, bondingCurve, true, TOKEN_2022_PROGRAM_ID);
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=liquid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquid.js","sourceRoot":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";
|
|
2
|
+
import { Connection, PublicKey, type Transaction, type VersionedTransaction } from "@solana/web3.js";
|
|
3
|
+
/**
|
|
4
|
+
* A wallet that satisfies Anchor's Wallet interface via structural typing,
|
|
5
|
+
* without requiring a Keypair. Used for read-only operations (account fetching)
|
|
6
|
+
* and instruction building where no actual signing is needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ReadonlyWallet {
|
|
9
|
+
readonly publicKey: PublicKey;
|
|
10
|
+
/** @throws Always throws — signing is not supported on a read-only wallet. */
|
|
11
|
+
signTransaction<T extends Transaction | VersionedTransaction>(_tx: T): Promise<T>;
|
|
12
|
+
/** @throws Always throws — signing is not supported on a read-only wallet. */
|
|
13
|
+
signAllTransactions<T extends Transaction | VersionedTransaction>(_txs: T[]): Promise<T[]>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates an AnchorProvider for read-only operations (account fetching).
|
|
17
|
+
* Uses a real Connection but a dummy wallet that throws on sign attempts.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createReadonlyProvider(connection: Connection): AnchorProvider;
|
|
20
|
+
/**
|
|
21
|
+
* Returns a cached stub AnchorProvider for instruction building.
|
|
22
|
+
* Instruction building via `.instruction()` never hits the network,
|
|
23
|
+
* so no real Connection is needed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createStubProvider(): AnchorProvider;
|
|
26
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACN,UAAU,EACV,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,qBAAa,cAAc;IAC1B,QAAQ,CAAC,SAAS,YAAqB;IAEvC,8EAA8E;IACxE,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,oBAAoB,EACjE,GAAG,EAAE,CAAC,GACJ,OAAO,CAAC,CAAC,CAAC;IAIb,8EAA8E;IACxE,mBAAmB,CAAC,CAAC,SAAS,WAAW,GAAG,oBAAoB,EACrE,IAAI,EAAE,CAAC,EAAE,GACP,OAAO,CAAC,CAAC,EAAE,CAAC;CAGf;AAID;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,CAK7E;AAID;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,CAQnD"}
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AnchorProvider } from "@coral-xyz/anchor";
|
|
2
|
+
import { Connection, PublicKey, } from "@solana/web3.js";
|
|
3
|
+
/**
|
|
4
|
+
* A wallet that satisfies Anchor's Wallet interface via structural typing,
|
|
5
|
+
* without requiring a Keypair. Used for read-only operations (account fetching)
|
|
6
|
+
* and instruction building where no actual signing is needed.
|
|
7
|
+
*/
|
|
8
|
+
export class ReadonlyWallet {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.publicKey = PublicKey.default;
|
|
11
|
+
}
|
|
12
|
+
/** @throws Always throws — signing is not supported on a read-only wallet. */
|
|
13
|
+
async signTransaction(_tx) {
|
|
14
|
+
throw new Error("Cannot sign with a readonly provider");
|
|
15
|
+
}
|
|
16
|
+
/** @throws Always throws — signing is not supported on a read-only wallet. */
|
|
17
|
+
async signAllTransactions(_txs) {
|
|
18
|
+
throw new Error("Cannot sign with a readonly provider");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const readonlyWallet = new ReadonlyWallet();
|
|
22
|
+
/**
|
|
23
|
+
* Creates an AnchorProvider for read-only operations (account fetching).
|
|
24
|
+
* Uses a real Connection but a dummy wallet that throws on sign attempts.
|
|
25
|
+
*/
|
|
26
|
+
export function createReadonlyProvider(connection) {
|
|
27
|
+
return new AnchorProvider(connection, readonlyWallet, {
|
|
28
|
+
commitment: "confirmed",
|
|
29
|
+
preflightCommitment: "confirmed",
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
let stubProvider = null;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a cached stub AnchorProvider for instruction building.
|
|
35
|
+
* Instruction building via `.instruction()` never hits the network,
|
|
36
|
+
* so no real Connection is needed.
|
|
37
|
+
*/
|
|
38
|
+
export function createStubProvider() {
|
|
39
|
+
if (!stubProvider) {
|
|
40
|
+
const stubConnection = new Connection("http://stub.invalid");
|
|
41
|
+
stubProvider = new AnchorProvider(stubConnection, readonlyWallet, {
|
|
42
|
+
commitment: "confirmed",
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return stubProvider;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACN,UAAU,EACV,SAAS,GAGT,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAA3B;QACU,cAAS,GAAG,SAAS,CAAC,OAAO,CAAC;IAexC,CAAC;IAbA,8EAA8E;IAC9E,KAAK,CAAC,eAAe,CACpB,GAAM;QAEN,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACzD,CAAC;IAED,8EAA8E;IAC9E,KAAK,CAAC,mBAAmB,CACxB,IAAS;QAET,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACzD,CAAC;CACD;AAED,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC5D,OAAO,IAAI,cAAc,CAAC,UAAU,EAAE,cAAc,EAAE;QACrD,UAAU,EAAE,WAAW;QACvB,mBAAmB,EAAE,WAAW;KAChC,CAAC,CAAC;AACJ,CAAC;AAED,IAAI,YAAY,GAA0B,IAAI,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IACjC,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC,qBAAqB,CAAC,CAAC;QAC7D,YAAY,GAAG,IAAI,cAAc,CAAC,cAAc,EAAE,cAAc,EAAE;YACjE,UAAU,EAAE,WAAW;SACvB,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Transaction, type Connection, type PublicKey, type TransactionInstruction } from "@solana/web3.js";
|
|
2
|
+
export interface BuildTransactionOptions {
|
|
3
|
+
/** The public key of the fee payer */
|
|
4
|
+
feePayer: PublicKey;
|
|
5
|
+
/** Compute unit limit (omit to let the runtime decide) */
|
|
6
|
+
computeUnits?: number;
|
|
7
|
+
/** Priority fee in micro-lamports per compute unit */
|
|
8
|
+
priorityFee?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Prepends compute budget instructions to an instruction list.
|
|
12
|
+
* Returns a new array; does not mutate the input.
|
|
13
|
+
*
|
|
14
|
+
* @param instructions - Transaction instructions to prepend budget to
|
|
15
|
+
* @param options - Compute unit limit and/or priority fee
|
|
16
|
+
* @returns New instruction array with budget instructions prepended
|
|
17
|
+
*/
|
|
18
|
+
export declare function withComputeBudget(instructions: TransactionInstruction[], options: Pick<BuildTransactionOptions, "computeUnits" | "priorityFee">): TransactionInstruction[];
|
|
19
|
+
/**
|
|
20
|
+
* Builds an unsigned Transaction from one or more instructions.
|
|
21
|
+
* Fetches a recent blockhash and sets the fee payer. The caller is
|
|
22
|
+
* responsible for signing.
|
|
23
|
+
*
|
|
24
|
+
* @param connection - Solana RPC connection
|
|
25
|
+
* @param instructions - Transaction instructions to include
|
|
26
|
+
* @param options - Fee payer and optional compute budget settings
|
|
27
|
+
* @returns Unsigned transaction ready for signing
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildTransaction(connection: Connection, instructions: TransactionInstruction[], options: BuildTransactionOptions): Promise<Transaction>;
|
|
30
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/transaction/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,WAAW,EACX,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,uBAAuB;IACvC,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAChC,YAAY,EAAE,sBAAsB,EAAE,EACtC,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,cAAc,GAAG,aAAa,CAAC,GACpE,sBAAsB,EAAE,CAiB1B;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACrC,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,sBAAsB,EAAE,EACtC,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC,WAAW,CAAC,CAkBtB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComputeBudgetProgram, Transaction, } from "@solana/web3.js";
|
|
2
|
+
/**
|
|
3
|
+
* Prepends compute budget instructions to an instruction list.
|
|
4
|
+
* Returns a new array; does not mutate the input.
|
|
5
|
+
*
|
|
6
|
+
* @param instructions - Transaction instructions to prepend budget to
|
|
7
|
+
* @param options - Compute unit limit and/or priority fee
|
|
8
|
+
* @returns New instruction array with budget instructions prepended
|
|
9
|
+
*/
|
|
10
|
+
export function withComputeBudget(instructions, options) {
|
|
11
|
+
const budget = [];
|
|
12
|
+
if (options.computeUnits !== undefined) {
|
|
13
|
+
budget.push(ComputeBudgetProgram.setComputeUnitLimit({
|
|
14
|
+
units: options.computeUnits,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
if (options.priorityFee !== undefined) {
|
|
18
|
+
budget.push(ComputeBudgetProgram.setComputeUnitPrice({
|
|
19
|
+
microLamports: options.priorityFee,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
return [...budget, ...instructions];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Builds an unsigned Transaction from one or more instructions.
|
|
26
|
+
* Fetches a recent blockhash and sets the fee payer. The caller is
|
|
27
|
+
* responsible for signing.
|
|
28
|
+
*
|
|
29
|
+
* @param connection - Solana RPC connection
|
|
30
|
+
* @param instructions - Transaction instructions to include
|
|
31
|
+
* @param options - Fee payer and optional compute budget settings
|
|
32
|
+
* @returns Unsigned transaction ready for signing
|
|
33
|
+
*/
|
|
34
|
+
export async function buildTransaction(connection, instructions, options) {
|
|
35
|
+
const { feePayer, ...budgetOptions } = options;
|
|
36
|
+
const allIxs = budgetOptions.computeUnits !== undefined ||
|
|
37
|
+
budgetOptions.priorityFee !== undefined
|
|
38
|
+
? withComputeBudget(instructions, budgetOptions)
|
|
39
|
+
: instructions;
|
|
40
|
+
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();
|
|
41
|
+
const tx = new Transaction();
|
|
42
|
+
tx.add(...allIxs);
|
|
43
|
+
tx.recentBlockhash = blockhash;
|
|
44
|
+
tx.lastValidBlockHeight = lastValidBlockHeight;
|
|
45
|
+
tx.feePayer = feePayer;
|
|
46
|
+
return tx;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/transaction/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,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GAAG,QAAQ,CAAC;IAEvB,OAAO,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,uBAAuB,GAC5B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACN,iBAAiB,EACjB,gBAAgB,GAEhB,MAAM,cAAc,CAAC"}
|