@pump-fun/pump-sdk 1.4.4 → 1.5.0-devnet.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.
package/dist/esm/index.js CHANGED
@@ -3246,7 +3246,7 @@ function canonicalPumpPoolPda(pumpProgramId, pumpAmmProgramId, mint) {
3246
3246
 
3247
3247
  // src/sdk.ts
3248
3248
  import { AnchorProvider, Program } from "@coral-xyz/anchor";
3249
- import { PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
3249
+ import { PumpAmmAdminSdk, PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
3250
3250
  import {
3251
3251
  createAssociatedTokenAccountIdempotentInstruction,
3252
3252
  getAssociatedTokenAddressSync,
@@ -3281,6 +3281,10 @@ var PumpSdk = class {
3281
3281
  pumpProgramId
3282
3282
  );
3283
3283
  this.pumpAmmSdk = new PumpAmmSdk(connection, pumpAmmProgramId.toBase58());
3284
+ this.pumpAmmAdminSdk = new PumpAmmAdminSdk(
3285
+ connection,
3286
+ pumpAmmProgramId.toBase58()
3287
+ );
3284
3288
  }
3285
3289
  programId() {
3286
3290
  return this.offlinePumpProgram.programId;
@@ -3563,6 +3567,16 @@ var PumpSdk = class {
3563
3567
  })
3564
3568
  ];
3565
3569
  }
3570
+ async adminSetCoinCreatorInstructions(newCoinCreator, mint) {
3571
+ const global = await this.fetchGlobal();
3572
+ return [
3573
+ await this.offlinePumpProgram.methods.adminSetCreator(newCoinCreator).accountsPartial({
3574
+ adminSetCreatorAuthority: global.adminSetCreatorAuthority,
3575
+ mint
3576
+ }).instruction(),
3577
+ await this.pumpAmmAdminSdk.adminSetCoinCreator(mint, newCoinCreator)
3578
+ ];
3579
+ }
3566
3580
  async getCreatorVaultBalance(creator) {
3567
3581
  const creatorVault = this.creatorVaultPda(creator);
3568
3582
  const accountInfo = await this.connection.getAccountInfo(creatorVault);
package/dist/index.d.mts CHANGED
@@ -6331,6 +6331,7 @@ declare class PumpSdk {
6331
6331
  private readonly pumpProgram;
6332
6332
  private readonly offlinePumpProgram;
6333
6333
  private readonly pumpAmmSdk;
6334
+ private readonly pumpAmmAdminSdk;
6334
6335
  constructor(connection: Connection, pumpProgramId?: PublicKey, pumpAmmProgramId?: PublicKey);
6335
6336
  programId(): PublicKey;
6336
6337
  globalPda(): PublicKey;
@@ -6402,6 +6403,7 @@ declare class PumpSdk {
6402
6403
  user: PublicKey;
6403
6404
  }): Promise<TransactionInstruction>;
6404
6405
  collectCoinCreatorFeeInstructions(coinCreator: PublicKey): Promise<TransactionInstruction[]>;
6406
+ adminSetCoinCreatorInstructions(newCoinCreator: PublicKey, mint: PublicKey): Promise<TransactionInstruction[]>;
6405
6407
  getCreatorVaultBalance(creator: PublicKey): Promise<BN>;
6406
6408
  }
6407
6409
 
package/dist/index.d.ts CHANGED
@@ -6331,6 +6331,7 @@ declare class PumpSdk {
6331
6331
  private readonly pumpProgram;
6332
6332
  private readonly offlinePumpProgram;
6333
6333
  private readonly pumpAmmSdk;
6334
+ private readonly pumpAmmAdminSdk;
6334
6335
  constructor(connection: Connection, pumpProgramId?: PublicKey, pumpAmmProgramId?: PublicKey);
6335
6336
  programId(): PublicKey;
6336
6337
  globalPda(): PublicKey;
@@ -6402,6 +6403,7 @@ declare class PumpSdk {
6402
6403
  user: PublicKey;
6403
6404
  }): Promise<TransactionInstruction>;
6404
6405
  collectCoinCreatorFeeInstructions(coinCreator: PublicKey): Promise<TransactionInstruction[]>;
6406
+ adminSetCoinCreatorInstructions(newCoinCreator: PublicKey, mint: PublicKey): Promise<TransactionInstruction[]>;
6405
6407
  getCreatorVaultBalance(creator: PublicKey): Promise<BN>;
6406
6408
  }
6407
6409
 
package/dist/index.js CHANGED
@@ -3325,6 +3325,10 @@ var PumpSdk = class {
3325
3325
  pumpProgramId
3326
3326
  );
3327
3327
  this.pumpAmmSdk = new import_pump_swap_sdk2.PumpAmmSdk(connection, pumpAmmProgramId.toBase58());
3328
+ this.pumpAmmAdminSdk = new import_pump_swap_sdk2.PumpAmmAdminSdk(
3329
+ connection,
3330
+ pumpAmmProgramId.toBase58()
3331
+ );
3328
3332
  }
3329
3333
  programId() {
3330
3334
  return this.offlinePumpProgram.programId;
@@ -3607,6 +3611,16 @@ var PumpSdk = class {
3607
3611
  })
3608
3612
  ];
3609
3613
  }
3614
+ async adminSetCoinCreatorInstructions(newCoinCreator, mint) {
3615
+ const global = await this.fetchGlobal();
3616
+ return [
3617
+ await this.offlinePumpProgram.methods.adminSetCreator(newCoinCreator).accountsPartial({
3618
+ adminSetCreatorAuthority: global.adminSetCreatorAuthority,
3619
+ mint
3620
+ }).instruction(),
3621
+ await this.pumpAmmAdminSdk.adminSetCoinCreator(mint, newCoinCreator)
3622
+ ];
3623
+ }
3610
3624
  async getCreatorVaultBalance(creator) {
3611
3625
  const creatorVault = this.creatorVaultPda(creator);
3612
3626
  const accountInfo = await this.connection.getAccountInfo(creatorVault);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pump-fun/pump-sdk",
3
- "version": "1.4.4",
3
+ "version": "1.5.0-devnet.1",
4
4
  "description": "Pump Bonding Curve SDK",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/pump-fun/pump-sdk#readme",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@coral-xyz/anchor": "^0.31.1",
42
- "@pump-fun/pump-swap-sdk": "^0.0.1-beta.53",
42
+ "@pump-fun/pump-swap-sdk": "^0.0.1-beta.54",
43
43
  "@solana/spl-token": "^0.4.13",
44
44
  "@solana/web3.js": "^1.98.2",
45
45
  "bn.js": "^5.2.2",
package/src/sdk.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AnchorProvider, Program } from "@coral-xyz/anchor";
2
- import { PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
2
+ import { PumpAmmAdminSdk, PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
3
3
  import {
4
4
  createAssociatedTokenAccountIdempotentInstruction,
5
5
  getAssociatedTokenAddressSync,
@@ -54,6 +54,7 @@ export class PumpSdk {
54
54
  private readonly pumpProgram: Program<Pump>;
55
55
  private readonly offlinePumpProgram: Program<Pump>;
56
56
  private readonly pumpAmmSdk: PumpAmmSdk;
57
+ private readonly pumpAmmAdminSdk: PumpAmmAdminSdk;
57
58
 
58
59
  constructor(
59
60
  connection: Connection,
@@ -69,6 +70,10 @@ export class PumpSdk {
69
70
  );
70
71
 
71
72
  this.pumpAmmSdk = new PumpAmmSdk(connection, pumpAmmProgramId.toBase58());
73
+ this.pumpAmmAdminSdk = new PumpAmmAdminSdk(
74
+ connection,
75
+ pumpAmmProgramId.toBase58(),
76
+ );
72
77
  }
73
78
 
74
79
  programId(): PublicKey {
@@ -464,6 +469,24 @@ export class PumpSdk {
464
469
  ];
465
470
  }
466
471
 
472
+ async adminSetCoinCreatorInstructions(
473
+ newCoinCreator: PublicKey,
474
+ mint: PublicKey,
475
+ ): Promise<TransactionInstruction[]> {
476
+ const global = await this.fetchGlobal();
477
+
478
+ return [
479
+ await this.offlinePumpProgram.methods
480
+ .adminSetCreator(newCoinCreator)
481
+ .accountsPartial({
482
+ adminSetCreatorAuthority: global.adminSetCreatorAuthority,
483
+ mint,
484
+ })
485
+ .instruction(),
486
+ await this.pumpAmmAdminSdk.adminSetCoinCreator(mint, newCoinCreator),
487
+ ];
488
+ }
489
+
467
490
  async getCreatorVaultBalance(creator: PublicKey): Promise<BN> {
468
491
  const creatorVault = this.creatorVaultPda(creator);
469
492
  const accountInfo = await this.connection.getAccountInfo(creatorVault);