@pump-fun/pump-sdk 1.31.0 → 1.32.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/src/index.ts CHANGED
@@ -21,6 +21,7 @@ export {
21
21
  PumpSdk,
22
22
  PUMP_SDK,
23
23
  isCreatorUsingSharingConfig,
24
+ isSharingConfigEditable,
24
25
  } from "./sdk";
25
26
  export {
26
27
  OnlinePumpSdk,
package/src/sdk.ts CHANGED
@@ -854,7 +854,10 @@ export class PumpSdk {
854
854
  /**
855
855
  * Updates the fee shares for a token's creator fee distribution.
856
856
  *
857
- * @param params - Parameters for updating fee shares
857
+ * Important:
858
+ * - Reward split updates are effectively one-time. Treat this as a single allowed
859
+ * modification and verify the final split before submitting.
860
+ *
858
861
  * @param params.authority - The current authority that can modify the fee sharing config
859
862
  * @param params.mint - The mint address of the token
860
863
  * @param params.curShareholders - Array of current shareholders
@@ -1137,6 +1140,10 @@ export class PumpSdk {
1137
1140
  * Wrapper around `updateSharingConfig` that resolves social recipients and
1138
1141
  * initializes any missing social recipient PDAs before updating fee shares.
1139
1142
  *
1143
+ * Important:
1144
+ * - Reward split updates are effectively one-time. Treat this call as a single
1145
+ * allowed modification and verify the final split before submitting.
1146
+ *
1140
1147
  * Requirements:
1141
1148
  * - `authority` must sign the transaction.
1142
1149
  *
@@ -1294,3 +1301,30 @@ export function isCreatorUsingSharingConfig({
1294
1301
  }): boolean {
1295
1302
  return feeSharingConfigPda(mint).equals(creator);
1296
1303
  }
1304
+
1305
+ /**
1306
+ * Checks whether a sharing config reward split is editable.
1307
+ *
1308
+ * Reward split is NOT editable when:
1309
+ * - sharing config version is 1
1310
+ * - sharing config version is 2 but the admin authority has been revoked
1311
+ *
1312
+ * @param params - Parameters for editability check
1313
+ * @param params.sharingConfig - Sharing config account state
1314
+ * @returns true if reward split can be edited, false otherwise
1315
+ */
1316
+ export function isSharingConfigEditable({
1317
+ sharingConfig,
1318
+ }: {
1319
+ sharingConfig: SharingConfig;
1320
+ }): boolean {
1321
+ if (sharingConfig.version === 1) {
1322
+ return false;
1323
+ }
1324
+
1325
+ if (sharingConfig.version === 2 && sharingConfig.adminRevoked) {
1326
+ return false;
1327
+ }
1328
+
1329
+ return true;
1330
+ }