diff --git a/web3.js/src/index.ts b/web3.js/src/index.ts index 0d6c382a90..b0676f0f33 100644 --- a/web3.js/src/index.ts +++ b/web3.js/src/index.ts @@ -17,7 +17,6 @@ export * from './stake-program'; export * from './system-program'; export * from './secp256k1-program'; export * from './transaction'; -export * from './transaction-constants'; export * from './validator-info'; export * from './vote-account'; export * from './vote-program'; diff --git a/web3.js/src/loader.ts b/web3.js/src/loader.ts index 9412f0f6c4..6e3781a304 100644 --- a/web3.js/src/loader.ts +++ b/web3.js/src/loader.ts @@ -2,7 +2,7 @@ import {Buffer} from 'buffer'; import * as BufferLayout from '@solana/buffer-layout'; import {PublicKey} from './publickey'; -import {Transaction} from './transaction'; +import {Transaction, PACKET_DATA_SIZE} from './transaction'; import {SYSVAR_RENT_PUBKEY} from './sysvar'; import {sendAndConfirmTransaction} from './util/send-and-confirm-transaction'; import {sleep} from './util/sleep'; @@ -10,7 +10,6 @@ import type {Connection} from './connection'; import type {Signer} from './keypair'; import {SystemProgram} from './system-program'; import {IInstructionInputData} from './instruction'; -import {PACKET_DATA_SIZE} from './transaction-constants'; // Keep program chunks under PACKET_DATA_SIZE, leaving enough room for the // rest of the Transaction fields diff --git a/web3.js/src/message.ts b/web3.js/src/message.ts index 6e86867c70..c8d7ed1d2d 100644 --- a/web3.js/src/message.ts +++ b/web3.js/src/message.ts @@ -5,7 +5,7 @@ import * as BufferLayout from '@solana/buffer-layout'; import {PublicKey} from './publickey'; import type {Blockhash} from './blockhash'; import * as Layout from './layout'; -import {PACKET_DATA_SIZE} from './transaction-constants'; +import {PACKET_DATA_SIZE} from './transaction/constants'; import * as shortvec from './util/shortvec-encoding'; import {toBuffer} from './util/to-buffer'; diff --git a/web3.js/src/transaction-constants.ts b/web3.js/src/transaction/constants.ts similarity index 100% rename from web3.js/src/transaction-constants.ts rename to web3.js/src/transaction/constants.ts diff --git a/web3.js/src/transaction/index.ts b/web3.js/src/transaction/index.ts new file mode 100644 index 0000000000..bd0a78122e --- /dev/null +++ b/web3.js/src/transaction/index.ts @@ -0,0 +1,2 @@ +export * from './constants'; +export * from './legacy'; diff --git a/web3.js/src/transaction.ts b/web3.js/src/transaction/legacy.ts similarity index 97% rename from web3.js/src/transaction.ts rename to web3.js/src/transaction/legacy.ts index 686dd587a3..076263194e 100644 --- a/web3.js/src/transaction.ts +++ b/web3.js/src/transaction/legacy.ts @@ -2,19 +2,16 @@ import nacl from 'tweetnacl'; import bs58 from 'bs58'; import {Buffer} from 'buffer'; -import { - PACKET_DATA_SIZE, - SIGNATURE_LENGTH_IN_BYTES, -} from './transaction-constants'; -import {Connection} from './connection'; -import {Message} from './message'; -import {PublicKey} from './publickey'; -import * as shortvec from './util/shortvec-encoding'; -import {toBuffer} from './util/to-buffer'; -import invariant from './util/assert'; -import type {Signer} from './keypair'; -import type {Blockhash} from './blockhash'; -import type {CompiledInstruction} from './message'; +import {PACKET_DATA_SIZE, SIGNATURE_LENGTH_IN_BYTES} from './constants'; +import {Connection} from '../connection'; +import {Message} from '../message'; +import {PublicKey} from '../publickey'; +import * as shortvec from '../util/shortvec-encoding'; +import {toBuffer} from '../util/to-buffer'; +import invariant from '../util/assert'; +import type {Signer} from '../keypair'; +import type {Blockhash} from '../blockhash'; +import type {CompiledInstruction} from '../message'; /** * Transaction signature as base-58 encoded string