@unclaimedsol/spl-burn-close-sdk 1.0.4 → 1.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/dist/index.cjs CHANGED
@@ -8,14 +8,15 @@ const TOKEN_PROGRAM_ID = new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ
8
8
  * Build *unsigned* transactions that call the on-chain burn+close program.
9
9
  * You sign and send them yourself (frontend wallet or backend keypair).
10
10
  *
11
- * @param connection Solana RPC connection
12
- * @param programId Your deployed program ID
13
- * @param user The user whose ATAs will be burned/closed
14
- * @param pairs Array of { mint, ata } to process
15
- * @param options Chunking / blockhash / payer tweaks
16
- * @returns Array of *unsigned* Transaction objects
11
+ * @param connection Solana RPC connection
12
+ * @param programId Your deployed program ID
13
+ * @param user The user whose ATAs will be burned/closed
14
+ * @param pairs Array of { mint, ata } to process
15
+ * @param options Chunking / blockhash / payer tweaks
16
+ * @param tokenProgramId Support for multiple Token programs
17
+ * @returns Array of *unsigned* Transaction objects
17
18
  */
18
- export async function buildBurnAndCloseTransactions(connection, programId, user, pairs, options = {}) {
19
+ export async function buildBurnAndCloseTransactions(connection, programId, user, pairs, options = {}, tokenProgramId = TOKEN_PROGRAM_ID) {
19
20
  if (!pairs.length)
20
21
  return [];
21
22
  const chunkSize = Math.max(1, options.chunkSize ?? 12);
@@ -35,7 +36,7 @@ export async function buildBurnAndCloseTransactions(connection, programId, user,
35
36
  // the caller must actually sign the Transaction later.
36
37
  { pubkey: FEE_RECIPIENT, isSigner: false, isWritable: true },
37
38
  { pubkey: user, isSigner: true, isWritable: true },
38
- { pubkey: TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
39
+ { pubkey: tokenProgramId, isSigner: false, isWritable: false },
39
40
  { pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
40
41
  ];
41
42
  for (const { mint, ata } of chunk) {
package/dist/index.d.ts CHANGED
@@ -28,11 +28,12 @@ export type BuildOptions = {
28
28
  * Build *unsigned* transactions that call the on-chain burn+close program.
29
29
  * You sign and send them yourself (frontend wallet or backend keypair).
30
30
  *
31
- * @param connection Solana RPC connection
32
- * @param programId Your deployed program ID
33
- * @param user The user whose ATAs will be burned/closed
34
- * @param pairs Array of { mint, ata } to process
35
- * @param options Chunking / blockhash / payer tweaks
36
- * @returns Array of *unsigned* Transaction objects
31
+ * @param connection Solana RPC connection
32
+ * @param programId Your deployed program ID
33
+ * @param user The user whose ATAs will be burned/closed
34
+ * @param pairs Array of { mint, ata } to process
35
+ * @param options Chunking / blockhash / payer tweaks
36
+ * @param tokenProgramId Support for multiple Token programs
37
+ * @returns Array of *unsigned* Transaction objects
37
38
  */
38
- export declare function buildBurnAndCloseTransactions(connection: Connection, programId: PublicKey, user: PublicKey, pairs: Pair[], options?: BuildOptions): Promise<Transaction[]>;
39
+ export declare function buildBurnAndCloseTransactions(connection: Connection, programId: PublicKey, user: PublicKey, pairs: Pair[], options?: BuildOptions, tokenProgramId?: PublicKey): Promise<Transaction[]>;
package/dist/index.js CHANGED
@@ -8,14 +8,15 @@ export const TOKEN_PROGRAM_ID = new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9
8
8
  * Build *unsigned* transactions that call the on-chain burn+close program.
9
9
  * You sign and send them yourself (frontend wallet or backend keypair).
10
10
  *
11
- * @param connection Solana RPC connection
12
- * @param programId Your deployed program ID
13
- * @param user The user whose ATAs will be burned/closed
14
- * @param pairs Array of { mint, ata } to process
15
- * @param options Chunking / blockhash / payer tweaks
16
- * @returns Array of *unsigned* Transaction objects
11
+ * @param connection Solana RPC connection
12
+ * @param programId Your deployed program ID
13
+ * @param user The user whose ATAs will be burned/closed
14
+ * @param pairs Array of { mint, ata } to process
15
+ * @param options Chunking / blockhash / payer tweaks
16
+ * @param tokenProgramId Support for multiple Token programs
17
+ * @returns Array of *unsigned* Transaction objects
17
18
  */
18
- export async function buildBurnAndCloseTransactions(connection, programId, user, pairs, options = {}) {
19
+ export async function buildBurnAndCloseTransactions(connection, programId, user, pairs, options = {}, tokenProgramId = TOKEN_PROGRAM_ID) {
19
20
  if (!pairs.length)
20
21
  return [];
21
22
  const chunkSize = Math.max(1, options.chunkSize ?? 12);
@@ -35,7 +36,7 @@ export async function buildBurnAndCloseTransactions(connection, programId, user,
35
36
  // the caller must actually sign the Transaction later.
36
37
  { pubkey: FEE_RECIPIENT, isSigner: false, isWritable: true },
37
38
  { pubkey: user, isSigner: true, isWritable: true },
38
- { pubkey: TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
39
+ { pubkey: tokenProgramId, isSigner: false, isWritable: false },
39
40
  { pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
40
41
  ];
41
42
  for (const { mint, ata } of chunk) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unclaimedsol/spl-burn-close-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "SDK to burn and close SPL token accounts via the Unclaimed SOL program (with a built-in 5% fee).",
5
5
  "license": "MIT",
6
6
  "author": "Unclaimed SOL",