Skip to content

Commit 9823da7

Browse files
committed
chore: restructure transaction files
1 parent 7d05857 commit 9823da7

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export * from './stake-program';
1717
export * from './system-program';
1818
export * from './secp256k1-program';
1919
export * from './transaction';
20-
export * from './transaction-constants';
2120
export * from './validator-info';
2221
export * from './vote-account';
2322
export * from './vote-program';

src/loader.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import {Buffer} from 'buffer';
22
import * as BufferLayout from '@solana/buffer-layout';
33

44
import {PublicKey} from './publickey';
5-
import {Transaction} from './transaction';
5+
import {Transaction, PACKET_DATA_SIZE} from './transaction';
66
import {SYSVAR_RENT_PUBKEY} from './sysvar';
77
import {sendAndConfirmTransaction} from './util/send-and-confirm-transaction';
88
import {sleep} from './util/sleep';
99
import type {Connection} from './connection';
1010
import type {Signer} from './keypair';
1111
import {SystemProgram} from './system-program';
1212
import {IInstructionInputData} from './instruction';
13-
import {PACKET_DATA_SIZE} from './transaction-constants';
1413

1514
// Keep program chunks under PACKET_DATA_SIZE, leaving enough room for the
1615
// rest of the Transaction fields

src/message.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as BufferLayout from '@solana/buffer-layout';
55
import {PublicKey} from './publickey';
66
import type {Blockhash} from './blockhash';
77
import * as Layout from './layout';
8-
import {PACKET_DATA_SIZE} from './transaction-constants';
8+
import {PACKET_DATA_SIZE} from './transaction/constants';
99
import * as shortvec from './util/shortvec-encoding';
1010
import {toBuffer} from './util/to-buffer';
1111

File renamed without changes.

src/transaction/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './constants';
2+
export * from './legacy';

src/transaction.ts renamed to src/transaction/legacy.ts

+10-13
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@ import nacl from 'tweetnacl';
22
import bs58 from 'bs58';
33
import {Buffer} from 'buffer';
44

5-
import {
6-
PACKET_DATA_SIZE,
7-
SIGNATURE_LENGTH_IN_BYTES,
8-
} from './transaction-constants';
9-
import {Connection} from './connection';
10-
import {Message} from './message';
11-
import {PublicKey} from './publickey';
12-
import * as shortvec from './util/shortvec-encoding';
13-
import {toBuffer} from './util/to-buffer';
14-
import invariant from './util/assert';
15-
import type {Signer} from './keypair';
16-
import type {Blockhash} from './blockhash';
17-
import type {CompiledInstruction} from './message';
5+
import {PACKET_DATA_SIZE, SIGNATURE_LENGTH_IN_BYTES} from './constants';
6+
import {Connection} from '../connection';
7+
import {Message} from '../message';
8+
import {PublicKey} from '../publickey';
9+
import * as shortvec from '../util/shortvec-encoding';
10+
import {toBuffer} from '../util/to-buffer';
11+
import invariant from '../util/assert';
12+
import type {Signer} from '../keypair';
13+
import type {Blockhash} from '../blockhash';
14+
import type {CompiledInstruction} from '../message';
1815

1916
/**
2017
* Transaction signature as base-58 encoded string

0 commit comments

Comments
 (0)