Skip to content

Commit 9ed92e2

Browse files
author
tilo-14
committed
Consolidate batch-send to single file using createTransferInterfaceInstructions
- Remove batch-send-action.ts and batch-send-instruction.ts - Single batch-send.ts using createTransferInterfaceInstructions - Update READMEs and package.json Entire-Checkpoint: 4afa49be1970
1 parent 1381378 commit 9ed92e2

5 files changed

Lines changed: 4 additions & 63 deletions

File tree

toolkits/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ See the [payments README](payments/README.md) for API comparison and setup.
1010
**Send payments**
1111
- **[basic-send-action](payments/send/basic-send-action.ts)** — Send tokens. One call handles loading and recipient account creation.
1212
- **[basic-send-instruction](payments/send/basic-send-instruction.ts)** — Same transfer, but returns raw instructions for custom transaction building.
13-
- **[batch-send-action](payments/send/batch-send-action.ts)** — Pay multiple recipients sequentially
14-
- **[batch-send-instruction](payments/send/batch-send-instruction.ts)** — Pay multiple recipients in one transaction
13+
- **[batch-send](payments/send/batch-send.ts)** — Pay multiple recipients in one transaction
1514
- **[payment-with-memo](payments/send/payment-with-memo.ts)** — Attach an invoice ID or payment reference to a transfer
1615
- **[sign-all-transactions](payments/send/sign-all-transactions.ts)** — Sign all transactions with one wallet approval. Shows parallel load optimization.
1716

toolkits/payments/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Light Token reduces account creation cost by 200x compared to SPL. Transfer cost
3030
| Example | Description | Action | Instruction |
3131
|:--------|:------------|:-------|:------------|
3232
| Basic send | Send tokens to a recipient. | [action](send/basic-send-action.ts) | [instruction](send/basic-send-instruction.ts) |
33-
| Batch send | Pay multiple recipients in one transaction. | [action](send/batch-send-action.ts) | [instruction](send/batch-send-instruction.ts) |
33+
| Batch send | Pay multiple recipients in one transaction. | | [instruction](send/batch-send.ts) |
3434
| Payment with memo | Attach an invoice ID or payment reference. | | [instruction](send/payment-with-memo.ts) |
3535
| Sign all transactions | Sign all transactions with one wallet approval. | | [instruction](send/sign-all-transactions.ts) |
3636
| [verify-address.ts](verify/verify-address.ts) | Confirm a recipient account exists before sending. | `getAssociatedTokenAddressInterface`, `getAtaInterface` |

toolkits/payments/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
"description": "Light Token Payments Toolkit Examples",
55
"type": "module",
66
"scripts": {
7-
"test:all": "tsx send/basic-send-action.ts && tsx send/basic-send-instruction.ts && tsx send/payment-with-memo.ts && tsx send/batch-send-action.ts && tsx send/batch-send-instruction.ts && tsx send/sign-all-transactions.ts && tsx receive/receive.ts && tsx spend-permissions/delegate-approve.ts && tsx spend-permissions/delegate-revoke.ts && tsx spend-permissions/delegate-check.ts && tsx spend-permissions/delegate-transfer.ts",
7+
"test:all": "tsx send/basic-send-action.ts && tsx send/basic-send-instruction.ts && tsx send/payment-with-memo.ts && tsx send/batch-send.ts && tsx send/sign-all-transactions.ts && tsx receive/receive.ts && tsx spend-permissions/delegate-approve.ts && tsx spend-permissions/delegate-revoke.ts && tsx spend-permissions/delegate-check.ts && tsx spend-permissions/delegate-transfer.ts",
88
"basic-send-action": "tsx send/basic-send-action.ts",
99
"basic-send-instruction": "tsx send/basic-send-instruction.ts",
1010
"payment-with-memo": "tsx send/payment-with-memo.ts",
11-
"batch-send-action": "tsx send/batch-send-action.ts",
12-
"batch-send-instruction": "tsx send/batch-send-instruction.ts",
11+
"batch-send": "tsx send/batch-send.ts",
1312
"sign-all-transactions": "tsx send/sign-all-transactions.ts",
1413
"receive": "tsx receive/receive.ts",
1514
"get-balance": "tsx verify/get-balance.ts",

toolkits/payments/send/batch-send-instruction.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

toolkits/payments/send/batch-send-action.ts renamed to toolkits/payments/send/batch-send.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { rpc, payer, setup } from "../setup.js";
3535
);
3636

3737
for (const ix of instructions[instructions.length - 1]) {
38-
// Deduplicate ComputeBudget instructions
3938
if (ix.programId.toBase58() === COMPUTE_BUDGET) {
4039
if (hasComputeBudget) continue;
4140
hasComputeBudget = true;

0 commit comments

Comments
 (0)