Skip to content

Commit a1682ce

Browse files
committed
refactor(wasm-solana): remove unused instruction-level builder
Remove the instruction-level `buildTransaction` API that was replaced by `buildFromIntent`. The intent-based API is now used in production by wallet-platform for all transaction building. Removed: - src/builder/ module (build.rs, types.rs, versioned.rs) - src/wasm/builder.rs WASM bindings - js/builder.ts TypeScript wrapper - test/builder.ts tests - All builder type exports from index.ts The `buildFromIntent` API remains as the primary transaction building interface.
1 parent c1b45e4 commit a1682ce

12 files changed

Lines changed: 2 additions & 3977 deletions

File tree

packages/wasm-solana/js/builder.ts

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

packages/wasm-solana/js/index.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export * as keypair from "./keypair.js";
88
export * as pubkey from "./pubkey.js";
99
export * as transaction from "./transaction.js";
1010
export * as parser from "./parser.js";
11-
export * as builder from "./builder.js";
1211

1312
// Top-level class exports for convenience
1413
export { Keypair } from "./keypair.js";
@@ -21,7 +20,6 @@ export type { AddressLookupTableData } from "./versioned.js";
2120

2221
// Top-level function exports
2322
export { parseTransaction } from "./parser.js";
24-
export { buildTransaction, buildFromVersionedData } from "./builder.js";
2523
export { buildFromIntent } from "./intentBuilder.js";
2624

2725
// Intent builder type exports
@@ -93,45 +91,3 @@ export type {
9391
StakePoolWithdrawStakeParams,
9492
UnknownInstructionParams,
9593
} from "./parser.js";
96-
97-
// Builder type exports (prefixed to avoid conflict with parser/transaction types)
98-
export type {
99-
TransactionIntent,
100-
NonceSource as BuilderNonceSource,
101-
BlockhashNonceSource,
102-
DurableNonceSource,
103-
AddressLookupTable as BuilderAddressLookupTable,
104-
Instruction as BuilderInstruction,
105-
TransferInstruction,
106-
CreateAccountInstruction,
107-
NonceAdvanceInstruction,
108-
NonceInitializeInstruction,
109-
AllocateInstruction,
110-
AssignInstruction,
111-
MemoInstruction,
112-
ComputeBudgetInstruction,
113-
// Stake Program
114-
StakeInitializeInstruction,
115-
StakeDelegateInstruction,
116-
StakeDeactivateInstruction,
117-
StakeWithdrawInstruction,
118-
StakeAuthorizeInstruction,
119-
StakeSplitInstruction,
120-
// SPL Token
121-
TokenTransferInstruction,
122-
CreateAssociatedTokenAccountInstruction,
123-
CloseAssociatedTokenAccountInstruction,
124-
MintToInstruction,
125-
BurnInstruction,
126-
ApproveInstruction,
127-
// Jito Stake Pool
128-
StakePoolDepositSolInstruction,
129-
StakePoolWithdrawStakeInstruction,
130-
// Custom Instruction
131-
CustomInstruction as BuilderCustomInstruction,
132-
CustomAccountMeta,
133-
// Raw Versioned Transaction Data (for fromVersionedTransactionData path)
134-
RawVersionedTransactionData,
135-
VersionedInstruction as BuilderVersionedInstruction,
136-
MessageHeader,
137-
} from "./builder.js";

packages/wasm-solana/js/versioned.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
import {
1010
WasmVersionedTransaction,
1111
is_versioned_transaction,
12-
BuilderNamespace,
1312
} from "./wasm/wasm_solana.js";
14-
import type { RawVersionedTransactionData } from "./builder.js";
1513

1614
/**
1715
* Address Lookup Table data extracted from versioned transactions.
@@ -98,41 +96,6 @@ export class VersionedTransaction {
9896
return new VersionedTransaction(wasm);
9997
}
10098

101-
/**
102-
* Create a versioned transaction from raw MessageV0 data.
103-
*
104-
* This is used for the `fromVersionedTransactionData()` path where we have
105-
* pre-compiled versioned data (indexes + ALT refs). No instruction compilation
106-
* is needed - this just constructs the transaction from the raw structure.
107-
*
108-
* @param data - Raw versioned transaction data
109-
* @returns A VersionedTransaction instance
110-
*
111-
* @example
112-
* ```typescript
113-
* const tx = VersionedTransaction.fromVersionedData({
114-
* staticAccountKeys: ['pubkey1', 'pubkey2', ...],
115-
* addressLookupTables: [
116-
* { accountKey: 'altPubkey', writableIndexes: [0, 1], readonlyIndexes: [2] }
117-
* ],
118-
* versionedInstructions: [
119-
* { programIdIndex: 0, accountKeyIndexes: [1, 2], data: 'base58EncodedData' }
120-
* ],
121-
* messageHeader: {
122-
* numRequiredSignatures: 1,
123-
* numReadonlySignedAccounts: 0,
124-
* numReadonlyUnsignedAccounts: 3
125-
* },
126-
* recentBlockhash: 'blockhash'
127-
* });
128-
* ```
129-
*/
130-
static fromVersionedData(data: RawVersionedTransactionData): VersionedTransaction {
131-
// Build the transaction using WASM and wrap in TypeScript class
132-
const wasm = BuilderNamespace.build_from_versioned_data(data);
133-
return VersionedTransaction.fromWasm(wasm);
134-
}
135-
13699
/**
137100
* Check if this is a versioned transaction (MessageV0).
138101
*/

0 commit comments

Comments
 (0)