Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
610 changes: 0 additions & 610 deletions packages/wasm-solana/js/builder.ts

This file was deleted.

44 changes: 0 additions & 44 deletions packages/wasm-solana/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export * as keypair from "./keypair.js";
export * as pubkey from "./pubkey.js";
export * as transaction from "./transaction.js";
export * as parser from "./parser.js";
export * as builder from "./builder.js";

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

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

// Intent builder type exports
Expand Down Expand Up @@ -93,45 +91,3 @@ export type {
StakePoolWithdrawStakeParams,
UnknownInstructionParams,
} from "./parser.js";

// Builder type exports (prefixed to avoid conflict with parser/transaction types)
export type {
TransactionIntent,
NonceSource as BuilderNonceSource,
BlockhashNonceSource,
DurableNonceSource,
AddressLookupTable as BuilderAddressLookupTable,
Instruction as BuilderInstruction,
TransferInstruction,
CreateAccountInstruction,
NonceAdvanceInstruction,
NonceInitializeInstruction,
AllocateInstruction,
AssignInstruction,
MemoInstruction,
ComputeBudgetInstruction,
// Stake Program
StakeInitializeInstruction,
StakeDelegateInstruction,
StakeDeactivateInstruction,
StakeWithdrawInstruction,
StakeAuthorizeInstruction,
StakeSplitInstruction,
// SPL Token
TokenTransferInstruction,
CreateAssociatedTokenAccountInstruction,
CloseAssociatedTokenAccountInstruction,
MintToInstruction,
BurnInstruction,
ApproveInstruction,
// Jito Stake Pool
StakePoolDepositSolInstruction,
StakePoolWithdrawStakeInstruction,
// Custom Instruction
CustomInstruction as BuilderCustomInstruction,
CustomAccountMeta,
// Raw Versioned Transaction Data (for fromVersionedTransactionData path)
RawVersionedTransactionData,
VersionedInstruction as BuilderVersionedInstruction,
MessageHeader,
} from "./builder.js";
42 changes: 1 addition & 41 deletions packages/wasm-solana/js/versioned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
* transaction size by referencing accounts via lookup table indices.
*/

import {
WasmVersionedTransaction,
is_versioned_transaction,
BuilderNamespace,
} from "./wasm/wasm_solana.js";
import type { RawVersionedTransactionData } from "./builder.js";
import { WasmVersionedTransaction, is_versioned_transaction } from "./wasm/wasm_solana.js";

/**
* Address Lookup Table data extracted from versioned transactions.
Expand Down Expand Up @@ -98,41 +93,6 @@ export class VersionedTransaction {
return new VersionedTransaction(wasm);
}

/**
* Create a versioned transaction from raw MessageV0 data.
*
* This is used for the `fromVersionedTransactionData()` path where we have
* pre-compiled versioned data (indexes + ALT refs). No instruction compilation
* is needed - this just constructs the transaction from the raw structure.
*
* @param data - Raw versioned transaction data
* @returns A VersionedTransaction instance
*
* @example
* ```typescript
* const tx = VersionedTransaction.fromVersionedData({
* staticAccountKeys: ['pubkey1', 'pubkey2', ...],
* addressLookupTables: [
* { accountKey: 'altPubkey', writableIndexes: [0, 1], readonlyIndexes: [2] }
* ],
* versionedInstructions: [
* { programIdIndex: 0, accountKeyIndexes: [1, 2], data: 'base58EncodedData' }
* ],
* messageHeader: {
* numRequiredSignatures: 1,
* numReadonlySignedAccounts: 0,
* numReadonlyUnsignedAccounts: 3
* },
* recentBlockhash: 'blockhash'
* });
* ```
*/
static fromVersionedData(data: RawVersionedTransactionData): VersionedTransaction {
// Build the transaction using WASM and wrap in TypeScript class
const wasm = BuilderNamespace.build_from_versioned_data(data);
return VersionedTransaction.fromWasm(wasm);
}

/**
* Check if this is a versioned transaction (MessageV0).
*/
Expand Down
Loading
Loading