@pump-fun/pump-sdk 1.4.0 → 1.4.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 +31 -2
- package/dist/index.js +28 -1
- package/package.json +2 -2
- package/src/sdk.ts +35 -1
package/dist/esm/index.js
CHANGED
|
@@ -2750,7 +2750,9 @@ import { AnchorProvider, Program } from "@coral-xyz/anchor";
|
|
|
2750
2750
|
import { PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
|
|
2751
2751
|
import {
|
|
2752
2752
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
2753
|
-
getAssociatedTokenAddressSync
|
|
2753
|
+
getAssociatedTokenAddressSync,
|
|
2754
|
+
NATIVE_MINT as NATIVE_MINT2,
|
|
2755
|
+
TOKEN_PROGRAM_ID
|
|
2754
2756
|
} from "@solana/spl-token";
|
|
2755
2757
|
import {
|
|
2756
2758
|
PublicKey as PublicKey3
|
|
@@ -3024,11 +3026,38 @@ var PumpSdk = class {
|
|
|
3024
3026
|
}).instruction();
|
|
3025
3027
|
}
|
|
3026
3028
|
async collectCoinCreatorFeeInstructions(coinCreator) {
|
|
3029
|
+
let quoteMint = NATIVE_MINT2;
|
|
3030
|
+
let quoteTokenProgram = TOKEN_PROGRAM_ID;
|
|
3031
|
+
let coinCreatorVaultAuthority = this.pumpAmmSdk.coinCreatorVaultAuthorityPda(coinCreator);
|
|
3032
|
+
let coinCreatorVaultAta = this.pumpAmmSdk.coinCreatorVaultAta(
|
|
3033
|
+
coinCreatorVaultAuthority,
|
|
3034
|
+
quoteMint,
|
|
3035
|
+
quoteTokenProgram
|
|
3036
|
+
);
|
|
3037
|
+
let coinCreatorTokenAccount = getAssociatedTokenAddressSync(
|
|
3038
|
+
quoteMint,
|
|
3039
|
+
coinCreator,
|
|
3040
|
+
true,
|
|
3041
|
+
quoteTokenProgram
|
|
3042
|
+
);
|
|
3043
|
+
const [coinCreatorVaultAtaAccountInfo, coinCreatorTokenAccountInfo] = await this.connection.getMultipleAccountsInfo([
|
|
3044
|
+
coinCreatorVaultAta,
|
|
3045
|
+
coinCreatorTokenAccount
|
|
3046
|
+
]);
|
|
3027
3047
|
return [
|
|
3028
3048
|
await this.pumpProgram.methods.collectCreatorFee().accountsPartial({
|
|
3029
3049
|
creator: coinCreator
|
|
3030
3050
|
}).instruction(),
|
|
3031
|
-
...await this.pumpAmmSdk.collectCoinCreatorFee(
|
|
3051
|
+
...await this.pumpAmmSdk.collectCoinCreatorFee({
|
|
3052
|
+
coinCreator,
|
|
3053
|
+
quoteMint,
|
|
3054
|
+
quoteTokenProgram,
|
|
3055
|
+
coinCreatorVaultAuthority,
|
|
3056
|
+
coinCreatorVaultAta,
|
|
3057
|
+
coinCreatorTokenAccount,
|
|
3058
|
+
coinCreatorVaultAtaAccountInfo,
|
|
3059
|
+
coinCreatorTokenAccountInfo
|
|
3060
|
+
})
|
|
3032
3061
|
];
|
|
3033
3062
|
}
|
|
3034
3063
|
async getCreatorVaultBalance(creator) {
|
package/dist/index.js
CHANGED
|
@@ -3070,11 +3070,38 @@ var PumpSdk = class {
|
|
|
3070
3070
|
}).instruction();
|
|
3071
3071
|
}
|
|
3072
3072
|
async collectCoinCreatorFeeInstructions(coinCreator) {
|
|
3073
|
+
let quoteMint = import_spl_token2.NATIVE_MINT;
|
|
3074
|
+
let quoteTokenProgram = import_spl_token2.TOKEN_PROGRAM_ID;
|
|
3075
|
+
let coinCreatorVaultAuthority = this.pumpAmmSdk.coinCreatorVaultAuthorityPda(coinCreator);
|
|
3076
|
+
let coinCreatorVaultAta = this.pumpAmmSdk.coinCreatorVaultAta(
|
|
3077
|
+
coinCreatorVaultAuthority,
|
|
3078
|
+
quoteMint,
|
|
3079
|
+
quoteTokenProgram
|
|
3080
|
+
);
|
|
3081
|
+
let coinCreatorTokenAccount = (0, import_spl_token2.getAssociatedTokenAddressSync)(
|
|
3082
|
+
quoteMint,
|
|
3083
|
+
coinCreator,
|
|
3084
|
+
true,
|
|
3085
|
+
quoteTokenProgram
|
|
3086
|
+
);
|
|
3087
|
+
const [coinCreatorVaultAtaAccountInfo, coinCreatorTokenAccountInfo] = await this.connection.getMultipleAccountsInfo([
|
|
3088
|
+
coinCreatorVaultAta,
|
|
3089
|
+
coinCreatorTokenAccount
|
|
3090
|
+
]);
|
|
3073
3091
|
return [
|
|
3074
3092
|
await this.pumpProgram.methods.collectCreatorFee().accountsPartial({
|
|
3075
3093
|
creator: coinCreator
|
|
3076
3094
|
}).instruction(),
|
|
3077
|
-
...await this.pumpAmmSdk.collectCoinCreatorFee(
|
|
3095
|
+
...await this.pumpAmmSdk.collectCoinCreatorFee({
|
|
3096
|
+
coinCreator,
|
|
3097
|
+
quoteMint,
|
|
3098
|
+
quoteTokenProgram,
|
|
3099
|
+
coinCreatorVaultAuthority,
|
|
3100
|
+
coinCreatorVaultAta,
|
|
3101
|
+
coinCreatorTokenAccount,
|
|
3102
|
+
coinCreatorVaultAtaAccountInfo,
|
|
3103
|
+
coinCreatorTokenAccountInfo
|
|
3104
|
+
})
|
|
3078
3105
|
];
|
|
3079
3106
|
}
|
|
3080
3107
|
async getCreatorVaultBalance(creator) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pump-fun/pump-sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.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.
|
|
42
|
+
"@pump-fun/pump-swap-sdk": "^0.0.1-beta.50",
|
|
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
|
@@ -3,6 +3,8 @@ import { PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
|
|
|
3
3
|
import {
|
|
4
4
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
5
5
|
getAssociatedTokenAddressSync,
|
|
6
|
+
NATIVE_MINT,
|
|
7
|
+
TOKEN_PROGRAM_ID,
|
|
6
8
|
} from "@solana/spl-token";
|
|
7
9
|
import {
|
|
8
10
|
AccountInfo,
|
|
@@ -412,6 +414,29 @@ export class PumpSdk {
|
|
|
412
414
|
async collectCoinCreatorFeeInstructions(
|
|
413
415
|
coinCreator: PublicKey,
|
|
414
416
|
): Promise<TransactionInstruction[]> {
|
|
417
|
+
let quoteMint = NATIVE_MINT;
|
|
418
|
+
let quoteTokenProgram = TOKEN_PROGRAM_ID;
|
|
419
|
+
|
|
420
|
+
let coinCreatorVaultAuthority =
|
|
421
|
+
this.pumpAmmSdk.coinCreatorVaultAuthorityPda(coinCreator);
|
|
422
|
+
let coinCreatorVaultAta = this.pumpAmmSdk.coinCreatorVaultAta(
|
|
423
|
+
coinCreatorVaultAuthority,
|
|
424
|
+
quoteMint,
|
|
425
|
+
quoteTokenProgram,
|
|
426
|
+
);
|
|
427
|
+
|
|
428
|
+
let coinCreatorTokenAccount = getAssociatedTokenAddressSync(
|
|
429
|
+
quoteMint,
|
|
430
|
+
coinCreator,
|
|
431
|
+
true,
|
|
432
|
+
quoteTokenProgram,
|
|
433
|
+
);
|
|
434
|
+
const [coinCreatorVaultAtaAccountInfo, coinCreatorTokenAccountInfo] =
|
|
435
|
+
await this.connection.getMultipleAccountsInfo([
|
|
436
|
+
coinCreatorVaultAta,
|
|
437
|
+
coinCreatorTokenAccount,
|
|
438
|
+
]);
|
|
439
|
+
|
|
415
440
|
return [
|
|
416
441
|
await this.pumpProgram.methods
|
|
417
442
|
.collectCreatorFee()
|
|
@@ -419,7 +444,16 @@ export class PumpSdk {
|
|
|
419
444
|
creator: coinCreator,
|
|
420
445
|
})
|
|
421
446
|
.instruction(),
|
|
422
|
-
...(await this.pumpAmmSdk.collectCoinCreatorFee(
|
|
447
|
+
...(await this.pumpAmmSdk.collectCoinCreatorFee({
|
|
448
|
+
coinCreator,
|
|
449
|
+
quoteMint,
|
|
450
|
+
quoteTokenProgram,
|
|
451
|
+
coinCreatorVaultAuthority,
|
|
452
|
+
coinCreatorVaultAta,
|
|
453
|
+
coinCreatorTokenAccount,
|
|
454
|
+
coinCreatorVaultAtaAccountInfo,
|
|
455
|
+
coinCreatorTokenAccountInfo,
|
|
456
|
+
})),
|
|
423
457
|
];
|
|
424
458
|
}
|
|
425
459
|
|