pump-kit 0.0.1

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.
Files changed (142) hide show
  1. package/@pump-kit.png +0 -0
  2. package/README.md +133 -0
  3. package/dist/index.js +25 -0
  4. package/dist/index.js.map +173 -0
  5. package/dist/types/ammsdk/bondingCurveMath.d.ts +41 -0
  6. package/dist/types/ammsdk/generated/accounts/bondingCurve.d.ts +39 -0
  7. package/dist/types/ammsdk/generated/accounts/feeConfig.d.ts +33 -0
  8. package/dist/types/ammsdk/generated/accounts/globalConfig.d.ts +61 -0
  9. package/dist/types/ammsdk/generated/accounts/globalVolumeAccumulator.d.ts +37 -0
  10. package/dist/types/ammsdk/generated/accounts/index.d.ts +13 -0
  11. package/dist/types/ammsdk/generated/accounts/pool.d.ts +47 -0
  12. package/dist/types/ammsdk/generated/accounts/userVolumeAccumulator.d.ts +39 -0
  13. package/dist/types/ammsdk/generated/errors/index.d.ts +8 -0
  14. package/dist/types/ammsdk/generated/errors/pumpAmm.d.ts +101 -0
  15. package/dist/types/ammsdk/generated/index.d.ts +12 -0
  16. package/dist/types/ammsdk/generated/instructions/adminSetCoinCreator.d.ts +63 -0
  17. package/dist/types/ammsdk/generated/instructions/adminUpdateTokenIncentives.d.ts +99 -0
  18. package/dist/types/ammsdk/generated/instructions/buy.d.ts +144 -0
  19. package/dist/types/ammsdk/generated/instructions/buyExactQuoteIn.d.ts +144 -0
  20. package/dist/types/ammsdk/generated/instructions/claimTokenIncentives.d.ts +86 -0
  21. package/dist/types/ammsdk/generated/instructions/closeUserVolumeAccumulator.d.ts +54 -0
  22. package/dist/types/ammsdk/generated/instructions/collectCoinCreatorFee.d.ts +70 -0
  23. package/dist/types/ammsdk/generated/instructions/createConfig.d.ts +79 -0
  24. package/dist/types/ammsdk/generated/instructions/createPool.d.ts +127 -0
  25. package/dist/types/ammsdk/generated/instructions/deposit.d.ts +111 -0
  26. package/dist/types/ammsdk/generated/instructions/disable.d.ts +75 -0
  27. package/dist/types/ammsdk/generated/instructions/extendAccount.d.ts +58 -0
  28. package/dist/types/ammsdk/generated/instructions/index.d.ts +26 -0
  29. package/dist/types/ammsdk/generated/instructions/initUserVolumeAccumulator.d.ts +62 -0
  30. package/dist/types/ammsdk/generated/instructions/sell.d.ts +131 -0
  31. package/dist/types/ammsdk/generated/instructions/setCoinCreator.d.ts +58 -0
  32. package/dist/types/ammsdk/generated/instructions/syncUserVolumeAccumulator.d.ts +58 -0
  33. package/dist/types/ammsdk/generated/instructions/updateAdmin.d.ts +58 -0
  34. package/dist/types/ammsdk/generated/instructions/updateFeeConfig.d.ts +75 -0
  35. package/dist/types/ammsdk/generated/instructions/withdraw.d.ts +111 -0
  36. package/dist/types/ammsdk/generated/programs/index.d.ts +8 -0
  37. package/dist/types/ammsdk/generated/programs/pumpAmm.d.ts +84 -0
  38. package/dist/types/ammsdk/generated/shared/index.d.ts +49 -0
  39. package/dist/types/ammsdk/generated/types/adminSetCoinCreatorEvent.d.ts +27 -0
  40. package/dist/types/ammsdk/generated/types/adminUpdateTokenIncentivesEvent.d.ts +29 -0
  41. package/dist/types/ammsdk/generated/types/buyEvent.d.ts +76 -0
  42. package/dist/types/ammsdk/generated/types/claimTokenIncentivesEvent.d.ts +27 -0
  43. package/dist/types/ammsdk/generated/types/closeUserVolumeAccumulatorEvent.d.ts +27 -0
  44. package/dist/types/ammsdk/generated/types/collectCoinCreatorFeeEvent.d.ts +25 -0
  45. package/dist/types/ammsdk/generated/types/createConfigEvent.d.ts +29 -0
  46. package/dist/types/ammsdk/generated/types/createPoolEvent.d.ts +55 -0
  47. package/dist/types/ammsdk/generated/types/depositEvent.d.ts +47 -0
  48. package/dist/types/ammsdk/generated/types/disableEvent.d.ts +29 -0
  49. package/dist/types/ammsdk/generated/types/extendAccountEvent.d.ts +25 -0
  50. package/dist/types/ammsdk/generated/types/feeTier.d.ts +20 -0
  51. package/dist/types/ammsdk/generated/types/fees.d.ts +21 -0
  52. package/dist/types/ammsdk/generated/types/index.d.ts +29 -0
  53. package/dist/types/ammsdk/generated/types/initUserVolumeAccumulatorEvent.d.ts +21 -0
  54. package/dist/types/ammsdk/generated/types/optionBool.d.ts +13 -0
  55. package/dist/types/ammsdk/generated/types/sellEvent.d.ts +61 -0
  56. package/dist/types/ammsdk/generated/types/setBondingCurveCoinCreatorEvent.d.ts +25 -0
  57. package/dist/types/ammsdk/generated/types/setMetaplexCoinCreatorEvent.d.ts +25 -0
  58. package/dist/types/ammsdk/generated/types/syncUserVolumeAccumulatorEvent.d.ts +23 -0
  59. package/dist/types/ammsdk/generated/types/updateAdminEvent.d.ts +21 -0
  60. package/dist/types/ammsdk/generated/types/updateFeeConfigEvent.d.ts +29 -0
  61. package/dist/types/ammsdk/generated/types/withdrawEvent.d.ts +47 -0
  62. package/dist/types/clients/amm.d.ts +109 -0
  63. package/dist/types/clients/pump.d.ts +76 -0
  64. package/dist/types/config/addresses.d.ts +12 -0
  65. package/dist/types/config/commitment.d.ts +4 -0
  66. package/dist/types/config/connection.d.ts +10 -0
  67. package/dist/types/config/constants.d.ts +4 -0
  68. package/dist/types/config/polyfills.d.ts +1 -0
  69. package/dist/types/events/pumpEvents.d.ts +30 -0
  70. package/dist/types/helpers/createAndBuy.d.ts +34 -0
  71. package/dist/types/index.d.ts +20 -0
  72. package/dist/types/liquidity.d.ts +47 -0
  73. package/dist/types/pda/ata.d.ts +29 -0
  74. package/dist/types/pda/pump.d.ts +46 -0
  75. package/dist/types/pda/pumpAmm.d.ts +55 -0
  76. package/dist/types/pumpsdk/generated/accounts/bondingCurve.d.ts +39 -0
  77. package/dist/types/pumpsdk/generated/accounts/feeConfig.d.ts +33 -0
  78. package/dist/types/pumpsdk/generated/accounts/global.d.ts +59 -0
  79. package/dist/types/pumpsdk/generated/accounts/globalVolumeAccumulator.d.ts +37 -0
  80. package/dist/types/pumpsdk/generated/accounts/index.d.ts +12 -0
  81. package/dist/types/pumpsdk/generated/accounts/userVolumeAccumulator.d.ts +39 -0
  82. package/dist/types/pumpsdk/generated/errors/index.d.ts +8 -0
  83. package/dist/types/pumpsdk/generated/errors/pump.d.ts +105 -0
  84. package/dist/types/pumpsdk/generated/index.d.ts +12 -0
  85. package/dist/types/pumpsdk/generated/instructions/adminSetCreator.d.ts +67 -0
  86. package/dist/types/pumpsdk/generated/instructions/adminSetIdlAuthority.d.ts +71 -0
  87. package/dist/types/pumpsdk/generated/instructions/adminUpdateTokenIncentives.d.ts +99 -0
  88. package/dist/types/pumpsdk/generated/instructions/buy.d.ts +116 -0
  89. package/dist/types/pumpsdk/generated/instructions/buyExactSolIn.d.ts +116 -0
  90. package/dist/types/pumpsdk/generated/instructions/claimTokenIncentives.d.ts +86 -0
  91. package/dist/types/pumpsdk/generated/instructions/closeUserVolumeAccumulator.d.ts +54 -0
  92. package/dist/types/pumpsdk/generated/instructions/collectCreatorFee.d.ts +58 -0
  93. package/dist/types/pumpsdk/generated/instructions/create.d.ts +111 -0
  94. package/dist/types/pumpsdk/generated/instructions/extendAccount.d.ts +58 -0
  95. package/dist/types/pumpsdk/generated/instructions/index.d.ts +26 -0
  96. package/dist/types/pumpsdk/generated/instructions/initUserVolumeAccumulator.d.ts +62 -0
  97. package/dist/types/pumpsdk/generated/instructions/initialize.d.ts +50 -0
  98. package/dist/types/pumpsdk/generated/instructions/migrate.d.ts +134 -0
  99. package/dist/types/pumpsdk/generated/instructions/sell.d.ts +103 -0
  100. package/dist/types/pumpsdk/generated/instructions/setCreator.d.ts +71 -0
  101. package/dist/types/pumpsdk/generated/instructions/setMetaplexCreator.d.ts +58 -0
  102. package/dist/types/pumpsdk/generated/instructions/setParams.d.ts +99 -0
  103. package/dist/types/pumpsdk/generated/instructions/syncUserVolumeAccumulator.d.ts +58 -0
  104. package/dist/types/pumpsdk/generated/instructions/updateGlobalAuthority.d.ts +58 -0
  105. package/dist/types/pumpsdk/generated/programs/index.d.ts +8 -0
  106. package/dist/types/pumpsdk/generated/programs/pump.d.ts +83 -0
  107. package/dist/types/pumpsdk/generated/shared/index.d.ts +49 -0
  108. package/dist/types/pumpsdk/generated/types/adminSetCreatorEvent.d.ts +27 -0
  109. package/dist/types/pumpsdk/generated/types/adminSetIdlAuthorityEvent.d.ts +15 -0
  110. package/dist/types/pumpsdk/generated/types/adminUpdateTokenIncentivesEvent.d.ts +29 -0
  111. package/dist/types/pumpsdk/generated/types/claimTokenIncentivesEvent.d.ts +27 -0
  112. package/dist/types/pumpsdk/generated/types/closeUserVolumeAccumulatorEvent.d.ts +27 -0
  113. package/dist/types/pumpsdk/generated/types/collectCreatorFeeEvent.d.ts +21 -0
  114. package/dist/types/pumpsdk/generated/types/completeEvent.d.ts +23 -0
  115. package/dist/types/pumpsdk/generated/types/completePumpAmmMigrationEvent.d.ts +31 -0
  116. package/dist/types/pumpsdk/generated/types/createEvent.d.ts +39 -0
  117. package/dist/types/pumpsdk/generated/types/extendAccountEvent.d.ts +25 -0
  118. package/dist/types/pumpsdk/generated/types/feeTier.d.ts +20 -0
  119. package/dist/types/pumpsdk/generated/types/fees.d.ts +21 -0
  120. package/dist/types/pumpsdk/generated/types/index.d.ts +27 -0
  121. package/dist/types/pumpsdk/generated/types/initUserVolumeAccumulatorEvent.d.ts +21 -0
  122. package/dist/types/pumpsdk/generated/types/optionBool.d.ts +13 -0
  123. package/dist/types/pumpsdk/generated/types/setCreatorEvent.d.ts +23 -0
  124. package/dist/types/pumpsdk/generated/types/setMetaplexCreatorEvent.d.ts +25 -0
  125. package/dist/types/pumpsdk/generated/types/setParamsEvent.d.ts +43 -0
  126. package/dist/types/pumpsdk/generated/types/syncUserVolumeAccumulatorEvent.d.ts +23 -0
  127. package/dist/types/pumpsdk/generated/types/tradeEvent.d.ts +60 -0
  128. package/dist/types/pumpsdk/generated/types/updateGlobalAuthorityEvent.d.ts +23 -0
  129. package/dist/types/recipes/buy.d.ts +51 -0
  130. package/dist/types/recipes/mintFirstBuy.d.ts +51 -0
  131. package/dist/types/recipes/provideLiquidity.d.ts +42 -0
  132. package/dist/types/recipes/removeLiquidity.d.ts +40 -0
  133. package/dist/types/recipes/sell.d.ts +39 -0
  134. package/dist/types/simple.d.ts +10 -0
  135. package/dist/types/swap.d.ts +49 -0
  136. package/dist/types/utils/amounts.d.ts +4 -0
  137. package/dist/types/utils/ata.d.ts +15 -0
  138. package/dist/types/utils/slippage.d.ts +37 -0
  139. package/dist/types/utils/transaction.d.ts +101 -0
  140. package/dist/types/utils/wsol.d.ts +18 -0
  141. package/metadata/social.json +8 -0
  142. package/package.json +56 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ import { type Fees, type FeesArgs } from '.';
10
+ export type FeeTier = {
11
+ marketCapLamportsThreshold: bigint;
12
+ fees: Fees;
13
+ };
14
+ export type FeeTierArgs = {
15
+ marketCapLamportsThreshold: number | bigint;
16
+ fees: FeesArgs;
17
+ };
18
+ export declare function getFeeTierEncoder(): FixedSizeEncoder<FeeTierArgs>;
19
+ export declare function getFeeTierDecoder(): FixedSizeDecoder<FeeTier>;
20
+ export declare function getFeeTierCodec(): FixedSizeCodec<FeeTierArgs, FeeTier>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type Fees = {
10
+ lpFeeBps: bigint;
11
+ protocolFeeBps: bigint;
12
+ creatorFeeBps: bigint;
13
+ };
14
+ export type FeesArgs = {
15
+ lpFeeBps: number | bigint;
16
+ protocolFeeBps: number | bigint;
17
+ creatorFeeBps: number | bigint;
18
+ };
19
+ export declare function getFeesEncoder(): FixedSizeEncoder<FeesArgs>;
20
+ export declare function getFeesDecoder(): FixedSizeDecoder<Fees>;
21
+ export declare function getFeesCodec(): FixedSizeCodec<FeesArgs, Fees>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ export * from './adminSetCreatorEvent';
9
+ export * from './adminSetIdlAuthorityEvent';
10
+ export * from './adminUpdateTokenIncentivesEvent';
11
+ export * from './claimTokenIncentivesEvent';
12
+ export * from './closeUserVolumeAccumulatorEvent';
13
+ export * from './collectCreatorFeeEvent';
14
+ export * from './completeEvent';
15
+ export * from './completePumpAmmMigrationEvent';
16
+ export * from './createEvent';
17
+ export * from './extendAccountEvent';
18
+ export * from './fees';
19
+ export * from './feeTier';
20
+ export * from './initUserVolumeAccumulatorEvent';
21
+ export * from './optionBool';
22
+ export * from './setCreatorEvent';
23
+ export * from './setMetaplexCreatorEvent';
24
+ export * from './setParamsEvent';
25
+ export * from './syncUserVolumeAccumulatorEvent';
26
+ export * from './tradeEvent';
27
+ export * from './updateGlobalAuthorityEvent';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type InitUserVolumeAccumulatorEvent = {
10
+ payer: Address;
11
+ user: Address;
12
+ timestamp: bigint;
13
+ };
14
+ export type InitUserVolumeAccumulatorEventArgs = {
15
+ payer: Address;
16
+ user: Address;
17
+ timestamp: number | bigint;
18
+ };
19
+ export declare function getInitUserVolumeAccumulatorEventEncoder(): FixedSizeEncoder<InitUserVolumeAccumulatorEventArgs>;
20
+ export declare function getInitUserVolumeAccumulatorEventDecoder(): FixedSizeDecoder<InitUserVolumeAccumulatorEvent>;
21
+ export declare function getInitUserVolumeAccumulatorEventCodec(): FixedSizeCodec<InitUserVolumeAccumulatorEventArgs, InitUserVolumeAccumulatorEvent>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type OptionBool = readonly [boolean];
10
+ export type OptionBoolArgs = OptionBool;
11
+ export declare function getOptionBoolEncoder(): FixedSizeEncoder<OptionBoolArgs>;
12
+ export declare function getOptionBoolDecoder(): FixedSizeDecoder<OptionBool>;
13
+ export declare function getOptionBoolCodec(): FixedSizeCodec<OptionBoolArgs, OptionBool>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type SetCreatorEvent = {
10
+ timestamp: bigint;
11
+ mint: Address;
12
+ bondingCurve: Address;
13
+ creator: Address;
14
+ };
15
+ export type SetCreatorEventArgs = {
16
+ timestamp: number | bigint;
17
+ mint: Address;
18
+ bondingCurve: Address;
19
+ creator: Address;
20
+ };
21
+ export declare function getSetCreatorEventEncoder(): FixedSizeEncoder<SetCreatorEventArgs>;
22
+ export declare function getSetCreatorEventDecoder(): FixedSizeDecoder<SetCreatorEvent>;
23
+ export declare function getSetCreatorEventCodec(): FixedSizeCodec<SetCreatorEventArgs, SetCreatorEvent>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type SetMetaplexCreatorEvent = {
10
+ timestamp: bigint;
11
+ mint: Address;
12
+ bondingCurve: Address;
13
+ metadata: Address;
14
+ creator: Address;
15
+ };
16
+ export type SetMetaplexCreatorEventArgs = {
17
+ timestamp: number | bigint;
18
+ mint: Address;
19
+ bondingCurve: Address;
20
+ metadata: Address;
21
+ creator: Address;
22
+ };
23
+ export declare function getSetMetaplexCreatorEventEncoder(): FixedSizeEncoder<SetMetaplexCreatorEventArgs>;
24
+ export declare function getSetMetaplexCreatorEventDecoder(): FixedSizeDecoder<SetMetaplexCreatorEvent>;
25
+ export declare function getSetMetaplexCreatorEventCodec(): FixedSizeCodec<SetMetaplexCreatorEventArgs, SetMetaplexCreatorEvent>;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type SetParamsEvent = {
10
+ initialVirtualTokenReserves: bigint;
11
+ initialVirtualSolReserves: bigint;
12
+ initialRealTokenReserves: bigint;
13
+ finalRealSolReserves: bigint;
14
+ tokenTotalSupply: bigint;
15
+ feeBasisPoints: bigint;
16
+ withdrawAuthority: Address;
17
+ enableMigrate: boolean;
18
+ poolMigrationFee: bigint;
19
+ creatorFeeBasisPoints: bigint;
20
+ feeRecipients: Array<Address>;
21
+ timestamp: bigint;
22
+ setCreatorAuthority: Address;
23
+ adminSetCreatorAuthority: Address;
24
+ };
25
+ export type SetParamsEventArgs = {
26
+ initialVirtualTokenReserves: number | bigint;
27
+ initialVirtualSolReserves: number | bigint;
28
+ initialRealTokenReserves: number | bigint;
29
+ finalRealSolReserves: number | bigint;
30
+ tokenTotalSupply: number | bigint;
31
+ feeBasisPoints: number | bigint;
32
+ withdrawAuthority: Address;
33
+ enableMigrate: boolean;
34
+ poolMigrationFee: number | bigint;
35
+ creatorFeeBasisPoints: number | bigint;
36
+ feeRecipients: Array<Address>;
37
+ timestamp: number | bigint;
38
+ setCreatorAuthority: Address;
39
+ adminSetCreatorAuthority: Address;
40
+ };
41
+ export declare function getSetParamsEventEncoder(): FixedSizeEncoder<SetParamsEventArgs>;
42
+ export declare function getSetParamsEventDecoder(): FixedSizeDecoder<SetParamsEvent>;
43
+ export declare function getSetParamsEventCodec(): FixedSizeCodec<SetParamsEventArgs, SetParamsEvent>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type SyncUserVolumeAccumulatorEvent = {
10
+ user: Address;
11
+ totalClaimedTokensBefore: bigint;
12
+ totalClaimedTokensAfter: bigint;
13
+ timestamp: bigint;
14
+ };
15
+ export type SyncUserVolumeAccumulatorEventArgs = {
16
+ user: Address;
17
+ totalClaimedTokensBefore: number | bigint;
18
+ totalClaimedTokensAfter: number | bigint;
19
+ timestamp: number | bigint;
20
+ };
21
+ export declare function getSyncUserVolumeAccumulatorEventEncoder(): FixedSizeEncoder<SyncUserVolumeAccumulatorEventArgs>;
22
+ export declare function getSyncUserVolumeAccumulatorEventDecoder(): FixedSizeDecoder<SyncUserVolumeAccumulatorEvent>;
23
+ export declare function getSyncUserVolumeAccumulatorEventCodec(): FixedSizeCodec<SyncUserVolumeAccumulatorEventArgs, SyncUserVolumeAccumulatorEvent>;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type Codec, type Decoder, type Encoder } from '@solana/kit';
9
+ /** ix_name: "buy" | "sell" | "buy_exact_sol_in" */
10
+ export type TradeEvent = {
11
+ mint: Address;
12
+ solAmount: bigint;
13
+ tokenAmount: bigint;
14
+ isBuy: boolean;
15
+ user: Address;
16
+ timestamp: bigint;
17
+ virtualSolReserves: bigint;
18
+ virtualTokenReserves: bigint;
19
+ realSolReserves: bigint;
20
+ realTokenReserves: bigint;
21
+ feeRecipient: Address;
22
+ feeBasisPoints: bigint;
23
+ fee: bigint;
24
+ creator: Address;
25
+ creatorFeeBasisPoints: bigint;
26
+ creatorFee: bigint;
27
+ trackVolume: boolean;
28
+ totalUnclaimedTokens: bigint;
29
+ totalClaimedTokens: bigint;
30
+ currentSolVolume: bigint;
31
+ lastUpdateTimestamp: bigint;
32
+ ixName: string;
33
+ };
34
+ export type TradeEventArgs = {
35
+ mint: Address;
36
+ solAmount: number | bigint;
37
+ tokenAmount: number | bigint;
38
+ isBuy: boolean;
39
+ user: Address;
40
+ timestamp: number | bigint;
41
+ virtualSolReserves: number | bigint;
42
+ virtualTokenReserves: number | bigint;
43
+ realSolReserves: number | bigint;
44
+ realTokenReserves: number | bigint;
45
+ feeRecipient: Address;
46
+ feeBasisPoints: number | bigint;
47
+ fee: number | bigint;
48
+ creator: Address;
49
+ creatorFeeBasisPoints: number | bigint;
50
+ creatorFee: number | bigint;
51
+ trackVolume: boolean;
52
+ totalUnclaimedTokens: number | bigint;
53
+ totalClaimedTokens: number | bigint;
54
+ currentSolVolume: number | bigint;
55
+ lastUpdateTimestamp: number | bigint;
56
+ ixName: string;
57
+ };
58
+ export declare function getTradeEventEncoder(): Encoder<TradeEventArgs>;
59
+ export declare function getTradeEventDecoder(): Decoder<TradeEvent>;
60
+ export declare function getTradeEventCodec(): Codec<TradeEventArgs, TradeEvent>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the Codama library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun Codama to update it.
5
+ *
6
+ * @see https://github.com/codama-idl/codama
7
+ */
8
+ import { type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from '@solana/kit';
9
+ export type UpdateGlobalAuthorityEvent = {
10
+ global: Address;
11
+ authority: Address;
12
+ newAuthority: Address;
13
+ timestamp: bigint;
14
+ };
15
+ export type UpdateGlobalAuthorityEventArgs = {
16
+ global: Address;
17
+ authority: Address;
18
+ newAuthority: Address;
19
+ timestamp: number | bigint;
20
+ };
21
+ export declare function getUpdateGlobalAuthorityEventEncoder(): FixedSizeEncoder<UpdateGlobalAuthorityEventArgs>;
22
+ export declare function getUpdateGlobalAuthorityEventDecoder(): FixedSizeDecoder<UpdateGlobalAuthorityEvent>;
23
+ export declare function getUpdateGlobalAuthorityEventCodec(): FixedSizeCodec<UpdateGlobalAuthorityEventArgs, UpdateGlobalAuthorityEvent>;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Buy recipe - purchase tokens from the bonding curve with slippage protection.
3
+ */
4
+ import type { Address, Instruction, TransactionSigner } from "@solana/kit";
5
+ import { buy as buildBuyInstruction } from "../clients/pump";
6
+ type RpcClient = Parameters<typeof buildBuyInstruction>[0]["rpc"];
7
+ type CommitmentLevel = Parameters<typeof buildBuyInstruction>[0]["commitment"];
8
+ export interface BuyWithSlippageParams {
9
+ user: TransactionSigner;
10
+ mint: Address | string;
11
+ /** Token amount to buy (raw bigint). */
12
+ tokenAmount: bigint;
13
+ /** Estimated SOL cost in SOL units. */
14
+ estimatedSolCostSol: number;
15
+ /** Slippage tolerance in basis points (default: 50 = 0.5%) */
16
+ slippageBps?: number;
17
+ /** Fee recipient address */
18
+ feeRecipient?: Address | string;
19
+ /** Optional override to skip fetching the bonding curve account */
20
+ bondingCurveCreator?: Address | string;
21
+ /** Whether to track user volume (default true) */
22
+ trackVolume?: boolean;
23
+ /** RPC client used to fetch Pump accounts */
24
+ rpc: RpcClient;
25
+ /** Optional commitment override */
26
+ commitment?: CommitmentLevel;
27
+ }
28
+ /**
29
+ * Build a buy instruction with automatic slippage calculation.
30
+ * Takes an estimated SOL cost and adds slippage to create the max SOL cost.
31
+ */
32
+ export declare function buyWithSlippage(params: BuyWithSlippageParams): Promise<Instruction>;
33
+ /**
34
+ * Simple buy wrapper that takes max SOL cost directly.
35
+ */
36
+ export interface SimpleBuyParams {
37
+ user: TransactionSigner;
38
+ mint: Address | string;
39
+ tokenAmount: bigint;
40
+ /** Maximum SOL budget expressed in SOL units. */
41
+ maxSolCostSol?: number;
42
+ /** Optional lamport-denominated SOL budget. Takes precedence when provided. */
43
+ maxSolCostLamports?: bigint;
44
+ feeRecipient?: Address | string;
45
+ trackVolume?: boolean;
46
+ bondingCurveCreator?: Address | string;
47
+ rpc: RpcClient;
48
+ commitment?: CommitmentLevel;
49
+ }
50
+ export declare function buySimple(params: SimpleBuyParams): Promise<Instruction>;
51
+ export {};
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Mint + First Buy recipe - create a new token and make the initial purchase in one transaction.
3
+ */
4
+ import type { TransactionSigner, Instruction, Address } from "@solana/kit";
5
+ import { buy as buildBuyInstruction } from "../clients/pump";
6
+ export interface MintWithFirstBuyParams {
7
+ /** User's wallet/signer (will be the creator) */
8
+ user: TransactionSigner;
9
+ /** Pre-generated mint keypair/signer */
10
+ mint: TransactionSigner;
11
+ /** Mint authority address (usually same as user) */
12
+ mintAuthority: Address | string;
13
+ /** Token name */
14
+ name: string;
15
+ /** Token symbol */
16
+ symbol: string;
17
+ /** Metadata URI (JSON) */
18
+ uri: string;
19
+ /** Amount of tokens to buy in the first purchase */
20
+ firstBuyTokenAmount: bigint;
21
+ /** Estimated SOL cost for the first buy */
22
+ estimatedFirstBuyCost: bigint;
23
+ /** Slippage tolerance in basis points (default: 50 = 0.5%) */
24
+ slippageBps?: number;
25
+ /** Fee recipient address */
26
+ feeRecipient?: Address | string;
27
+ /** Optional override to skip fetching the bonding curve account */
28
+ bondingCurveCreator?: Address | string;
29
+ /** Whether to track user volume for the initial buy (default true) */
30
+ trackVolume?: boolean;
31
+ /** RPC client used to fetch Pump accounts */
32
+ rpc: Parameters<typeof buildBuyInstruction>[0]["rpc"];
33
+ /** Optional commitment */
34
+ commitment?: Parameters<typeof buildBuyInstruction>[0]["commitment"];
35
+ }
36
+ /**
37
+ * Build instructions for minting a new token and making the first purchase.
38
+ * Returns both create and buy instructions to be included in a single transaction.
39
+ */
40
+ export declare function mintWithFirstBuy(params: MintWithFirstBuyParams): Promise<{
41
+ createInstruction: Instruction;
42
+ buyInstruction: Instruction;
43
+ }>;
44
+ /**
45
+ * Validate mint creation parameters.
46
+ */
47
+ export declare function validateMintParams(params: {
48
+ name: string;
49
+ symbol: string;
50
+ uri: string;
51
+ }): void;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Provide Liquidity recipe - add liquidity to a Pump AMM pool.
3
+ */
4
+ import type { TransactionSigner, Instruction } from "@solana/kit";
5
+ export interface ProvideLiquidityParams {
6
+ /** User's wallet/signer */
7
+ user: TransactionSigner;
8
+ /** Base token mint address */
9
+ baseMint: string;
10
+ /** Quote token mint address (e.g., SOL, USDC) */
11
+ quoteMint: string;
12
+ /** Amount of base tokens to deposit */
13
+ baseIn: bigint;
14
+ /** Amount of quote tokens to deposit */
15
+ quoteIn: bigint;
16
+ /** Expected LP tokens to receive */
17
+ estimatedLpOut: bigint;
18
+ /** Slippage tolerance in basis points (default: 50 = 0.5%) */
19
+ slippageBps?: number;
20
+ /** Pool index (for multi-pool support, default: 0) */
21
+ poolIndex?: number;
22
+ }
23
+ /**
24
+ * Build a provide liquidity instruction with slippage protection.
25
+ *
26
+ * TODO: This needs to be implemented once the AMM client is complete.
27
+ * The AMM client needs deposit/withdraw instruction builders similar to the pump client.
28
+ */
29
+ export declare function provideLiquidity(params: ProvideLiquidityParams): Promise<Instruction>;
30
+ /**
31
+ * Calculate optimal deposit amounts for balanced liquidity provision.
32
+ * This helps prevent losing value to impermanent loss or price impact.
33
+ */
34
+ export declare function calculateOptimalDeposit(params: {
35
+ baseReserve: bigint;
36
+ quoteReserve: bigint;
37
+ desiredBase: bigint;
38
+ desiredQuote: bigint;
39
+ }): {
40
+ optimalBase: bigint;
41
+ optimalQuote: bigint;
42
+ };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Remove Liquidity recipe - withdraw liquidity from a Pump AMM pool.
3
+ */
4
+ import type { TransactionSigner, Instruction } from "@solana/kit";
5
+ export interface RemoveLiquidityParams {
6
+ /** User's wallet/signer */
7
+ user: TransactionSigner;
8
+ /** Base token mint address */
9
+ baseMint: string;
10
+ /** Quote token mint address */
11
+ quoteMint: string;
12
+ /** Amount of LP tokens to burn */
13
+ lpAmount: bigint;
14
+ /** Expected base tokens to receive */
15
+ estimatedBaseOut: bigint;
16
+ /** Expected quote tokens to receive */
17
+ estimatedQuoteOut: bigint;
18
+ /** Slippage tolerance in basis points (default: 50 = 0.5%) */
19
+ slippageBps?: number;
20
+ /** Pool index (for multi-pool support, default: 0) */
21
+ poolIndex?: number;
22
+ }
23
+ /**
24
+ * Build a remove liquidity instruction with slippage protection.
25
+ *
26
+ * TODO: This needs to be implemented once the AMM client is complete.
27
+ */
28
+ export declare function removeLiquidity(params: RemoveLiquidityParams): Promise<Instruction>;
29
+ /**
30
+ * Calculate expected withdrawal amounts based on LP share.
31
+ */
32
+ export declare function calculateWithdrawal(params: {
33
+ lpAmount: bigint;
34
+ totalLpSupply: bigint;
35
+ baseReserve: bigint;
36
+ quoteReserve: bigint;
37
+ }): {
38
+ baseOut: bigint;
39
+ quoteOut: bigint;
40
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Sell recipe - sell tokens back to the bonding curve with slippage protection.
3
+ */
4
+ import type { Address, Instruction, TransactionSigner } from "@solana/kit";
5
+ import { sell as buildSellInstruction } from "../clients/pump";
6
+ type RpcClient = Parameters<typeof buildSellInstruction>[0]["rpc"];
7
+ type CommitmentLevel = Parameters<typeof buildSellInstruction>[0]["commitment"];
8
+ export interface SellWithSlippageParams {
9
+ user: TransactionSigner;
10
+ mint: Address | string;
11
+ /** Amount of tokens to sell (human-readable). */
12
+ tokenAmount: number;
13
+ /** Estimated SOL output in SOL units. */
14
+ estimatedSolOutSol: number;
15
+ slippageBps?: number;
16
+ feeRecipient?: Address | string;
17
+ bondingCurveCreator?: Address | string;
18
+ rpc: RpcClient;
19
+ commitment?: CommitmentLevel;
20
+ }
21
+ export declare function sellWithSlippage(params: SellWithSlippageParams): Promise<Instruction>;
22
+ export interface SimpleSellParams {
23
+ user: TransactionSigner;
24
+ mint: Address | string;
25
+ /** Human-readable token amount to sell (defaults to 6 decimals). */
26
+ tokenAmount?: number;
27
+ /** Raw token amount expressed in the mint's base units. */
28
+ tokenAmountRaw?: bigint;
29
+ /** Minimum SOL output expressed in SOL units. */
30
+ minSolOutputSol?: number;
31
+ /** Optional lamport-denominated minimum SOL output. */
32
+ minSolOutputLamports?: bigint;
33
+ feeRecipient?: Address | string;
34
+ bondingCurveCreator?: Address | string;
35
+ rpc: RpcClient;
36
+ commitment?: CommitmentLevel;
37
+ }
38
+ export declare function sellSimple(params: SimpleSellParams): Promise<Instruction>;
39
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The absolute simplest API for Pump.fun
3
+ * Everything you need, nothing you don't.
4
+ */
5
+ import "./config/polyfills";
6
+ export { buy, sell, quickBuy, quickSell } from "./swap";
7
+ export type { BuyParams, SellParams } from "./swap";
8
+ export { mintWithFirstBuy, validateMintParams } from "./recipes/mintFirstBuy";
9
+ export type { MintWithFirstBuyParams } from "./recipes/mintFirstBuy";
10
+ export type { TransactionSigner, Instruction, Address } from "@solana/kit";
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Ultra-simple swap API - the cleanest way to trade on Pump.fun.
3
+ * Users now provide input-side amounts (SOL for buys, tokens for sells) plus optional slippage.
4
+ */
5
+ import type { Address, Instruction, TransactionSigner } from "@solana/kit";
6
+ import type { RpcClient } from "./config/connection";
7
+ import { type FeeStructure, type BondingCurveState } from "./ammsdk/bondingCurveMath";
8
+ export type CommitmentLevel = "processed" | "confirmed" | "finalized";
9
+ type WithRpcOptions = {
10
+ rpc: RpcClient;
11
+ commitment?: CommitmentLevel;
12
+ };
13
+ export type BuyParams = WithRpcOptions & {
14
+ user: TransactionSigner;
15
+ mint: Address | string;
16
+ /** SOL budget (before slippage), expressed in SOL. */
17
+ solAmount: number;
18
+ /** Optional slippage tolerance applied to the SOL budget (default 0.5%). */
19
+ slippageBps?: number;
20
+ feeRecipient?: Address | string;
21
+ bondingCurveCreator?: Address | string;
22
+ trackVolume?: boolean;
23
+ curveStateOverride?: BondingCurveState;
24
+ feeStructureOverride?: FeeStructure;
25
+ };
26
+ export type SellParams = WithRpcOptions & {
27
+ user: TransactionSigner;
28
+ mint: Address | string;
29
+ /** Human-readable token amount to sell. */
30
+ tokenAmount?: number;
31
+ /** Use a percentage of the wallet balance instead of fixed token amount. */
32
+ useWalletPercentage?: boolean;
33
+ /** Percentage of the wallet balance to sell (0-100]. */
34
+ walletPercentage?: number;
35
+ /** Token decimals (defaults to 6). */
36
+ tokenDecimals?: number;
37
+ slippageBps?: number;
38
+ feeRecipient?: Address | string;
39
+ bondingCurveCreator?: Address | string;
40
+ curveStateOverride?: BondingCurveState;
41
+ feeStructureOverride?: FeeStructure;
42
+ };
43
+ export declare function buy(params: BuyParams): Promise<Instruction>;
44
+ export declare function sell(params: SellParams): Promise<Instruction>;
45
+ type QuickBuyOptions = Omit<BuyParams, "user" | "mint" | "solAmount">;
46
+ type QuickSellOptions = Omit<SellParams, "user" | "mint" | "tokenAmount">;
47
+ export declare function quickBuy(user: TransactionSigner, mint: Address | string, solAmount: number, options?: QuickBuyOptions): Promise<Instruction>;
48
+ export declare function quickSell(user: TransactionSigner, mint: Address | string, tokenAmount: number, options?: QuickSellOptions): Promise<Instruction>;
49
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare function solToLamports(sol: number): bigint;
2
+ export declare function lamportsToSol(lamports: bigint): number;
3
+ export declare function tokensToRaw(amount: number, decimals: number): bigint;
4
+ export declare function rawToTokens(raw: bigint, decimals: number): number;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Helper to create Associated Token Account instructions
3
+ */
4
+ import type { Address, Instruction, TransactionSigner } from "@solana/kit";
5
+ export interface CreateAtaParams {
6
+ payer: TransactionSigner | Address | string;
7
+ owner: TransactionSigner | Address | string;
8
+ mint: Address | string;
9
+ tokenProgram?: Address | string;
10
+ associatedTokenProgram?: Address | string;
11
+ }
12
+ /**
13
+ * Build an instruction to create an Associated Token Account if it doesn't exist.
14
+ */
15
+ export declare function buildCreateAtaInstruction(params: CreateAtaParams): Instruction;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Slippage calculation utilities.
3
+ * All calculations use basis points (bps) where 100 bps = 1%.
4
+ */
5
+ export declare const DEFAULT_SLIPPAGE_BPS = 50;
6
+ /**
7
+ * Add slippage to an amount (for max input scenarios).
8
+ * @param x Base amount
9
+ * @param bps Slippage in basis points (default: 50 = 0.5%)
10
+ * @returns Amount increased by slippage
11
+ */
12
+ export declare const addSlippage: (x: bigint, bps?: number) => bigint;
13
+ /**
14
+ * Subtract slippage from an amount (for min output scenarios).
15
+ * @param x Base amount
16
+ * @param bps Slippage in basis points (default: 50 = 0.5%)
17
+ * @returns Amount decreased by slippage
18
+ */
19
+ export declare const subSlippage: (x: bigint, bps?: number) => bigint;
20
+ /**
21
+ * Validate slippage basis points.
22
+ * @param bps Basis points to validate
23
+ * @throws Error if bps is negative or > 10000 (100%)
24
+ */
25
+ export declare function validateSlippage(bps: number): void;
26
+ /**
27
+ * Convert percentage to basis points.
28
+ * @param percent Percentage (0-100)
29
+ * @returns Basis points (0-10000)
30
+ */
31
+ export declare function percentToBps(percent: number): number;
32
+ /**
33
+ * Convert basis points to percentage.
34
+ * @param bps Basis points (0-10000)
35
+ * @returns Percentage (0-100)
36
+ */
37
+ export declare function bpsToPercent(bps: number): number;