@solana/web3.js 1.52.1 → 1.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/lib/index.browser.cjs.js +2527 -2442
  2. package/lib/index.browser.cjs.js.map +1 -1
  3. package/lib/index.browser.esm.js +2527 -2443
  4. package/lib/index.browser.esm.js.map +1 -1
  5. package/lib/index.cjs.js +2527 -2442
  6. package/lib/index.cjs.js.map +1 -1
  7. package/lib/index.d.ts +862 -838
  8. package/lib/index.esm.js +2527 -2443
  9. package/lib/index.esm.js.map +1 -1
  10. package/lib/index.iife.js +3627 -3542
  11. package/lib/index.iife.js.map +1 -1
  12. package/lib/index.iife.min.js +3 -3
  13. package/lib/index.iife.min.js.map +1 -1
  14. package/lib/index.native.js +2525 -2440
  15. package/lib/index.native.js.map +1 -1
  16. package/package.json +1 -1
  17. package/src/account-data.ts +39 -0
  18. package/src/account.ts +1 -1
  19. package/src/connection.ts +30 -6
  20. package/src/index.ts +3 -14
  21. package/src/loader.ts +4 -5
  22. package/src/message/index.ts +32 -0
  23. package/src/{message.ts → message/legacy.ts} +8 -38
  24. package/src/nonce-account.ts +1 -1
  25. package/src/{address-lookup-table-program.ts → programs/address-lookup-table/index.ts} +8 -6
  26. package/src/programs/address-lookup-table/state.ts +84 -0
  27. package/src/{compute-budget.ts → programs/compute-budget.ts} +4 -4
  28. package/src/{ed25519-program.ts → programs/ed25519.ts} +4 -4
  29. package/src/programs/index.ts +7 -0
  30. package/src/{secp256k1-program.ts → programs/secp256k1.ts} +4 -4
  31. package/src/{stake-program.ts → programs/stake.ts} +7 -7
  32. package/src/{system-program.ts → programs/system.ts} +8 -8
  33. package/src/{vote-program.ts → programs/vote.ts} +7 -7
  34. package/src/publickey.ts +2 -2
  35. package/src/transaction/index.ts +3 -0
  36. package/src/{transaction.ts → transaction/legacy.ts} +11 -14
  37. package/src/utils/index.ts +4 -0
  38. package/src/validator-info.ts +2 -2
  39. package/src/vote-account.ts +1 -1
  40. /package/src/{transaction-constants.ts → transaction/constants.ts} +0 -0
  41. /package/src/{util/tx-expiry-custom-errors.ts → transaction/expiry-custom-errors.ts} +0 -0
  42. /package/src/{util → utils}/__forks__/react-native/url-impl.ts +0 -0
  43. /package/src/{util → utils}/assert.ts +0 -0
  44. /package/src/{util → utils}/bigint.ts +0 -0
  45. /package/src/{util → utils}/borsh-schema.ts +0 -0
  46. /package/src/{util → utils}/cluster.ts +0 -0
  47. /package/src/{util → utils}/guarded-array-utils.ts +0 -0
  48. /package/src/{util → utils}/makeWebsocketUrl.ts +0 -0
  49. /package/src/{util → utils}/promise-timeout.ts +0 -0
  50. /package/src/{util → utils}/send-and-confirm-raw-transaction.ts +0 -0
  51. /package/src/{util → utils}/send-and-confirm-transaction.ts +0 -0
  52. /package/src/{util → utils}/shortvec-encoding.ts +0 -0
  53. /package/src/{util → utils}/sleep.ts +0 -0
  54. /package/src/{util → utils}/to-buffer.ts +0 -0
  55. /package/src/{util → utils}/url-impl.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.52.1",
3
+ "version": "1.53.1",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -0,0 +1,39 @@
1
+ import * as BufferLayout from '@solana/buffer-layout';
2
+
3
+ export interface IAccountStateData {
4
+ readonly typeIndex: number;
5
+ }
6
+
7
+ /**
8
+ * @internal
9
+ */
10
+ export type AccountType<TInputData extends IAccountStateData> = {
11
+ /** The account type index (from solana upstream program) */
12
+ index: number;
13
+ /** The BufferLayout to use to build data */
14
+ layout: BufferLayout.Layout<TInputData>;
15
+ };
16
+
17
+ /**
18
+ * Decode account data buffer using an AccountType
19
+ * @internal
20
+ */
21
+ export function decodeData<TAccountStateData extends IAccountStateData>(
22
+ type: AccountType<TAccountStateData>,
23
+ data: Uint8Array,
24
+ ): TAccountStateData {
25
+ let decoded: TAccountStateData;
26
+ try {
27
+ decoded = type.layout.decode(data);
28
+ } catch (err) {
29
+ throw new Error('invalid instruction; ' + err);
30
+ }
31
+
32
+ if (decoded.typeIndex !== type.index) {
33
+ throw new Error(
34
+ `invalid account data; account type mismatch ${decoded.typeIndex} != ${type.index}`,
35
+ );
36
+ }
37
+
38
+ return decoded;
39
+ }
package/src/account.ts CHANGED
@@ -2,7 +2,7 @@ import nacl from 'tweetnacl';
2
2
  import type {SignKeyPair as KeyPair} from 'tweetnacl';
3
3
  import type {Buffer} from 'buffer';
4
4
 
5
- import {toBuffer} from './util/to-buffer';
5
+ import {toBuffer} from './utils/to-buffer';
6
6
  import {PublicKey} from './publickey';
7
7
 
8
8
  /**
package/src/connection.ts CHANGED
@@ -24,7 +24,6 @@ import type {Struct} from 'superstruct';
24
24
  import {Client as RpcWebSocketClient} from 'rpc-websockets';
25
25
  import RpcClient from 'jayson/lib/client/browser';
26
26
 
27
- import {URL} from './util/url-impl';
28
27
  import {AgentManager} from './agent-manager';
29
28
  import {EpochSchedule} from './epoch-schedule';
30
29
  import {SendTransactionError, SolanaJSONRPCError} from './errors';
@@ -35,14 +34,16 @@ import {Signer} from './keypair';
35
34
  import {MS_PER_SLOT} from './timing';
36
35
  import {Transaction, TransactionStatus} from './transaction';
37
36
  import {Message} from './message';
38
- import assert from './util/assert';
39
- import {sleep} from './util/sleep';
40
- import {toBuffer} from './util/to-buffer';
37
+ import {AddressLookupTableAccount} from './programs/address-lookup-table/state';
38
+ import assert from './utils/assert';
39
+ import {sleep} from './utils/sleep';
40
+ import {toBuffer} from './utils/to-buffer';
41
41
  import {
42
42
  TransactionExpiredBlockheightExceededError,
43
43
  TransactionExpiredTimeoutError,
44
- } from './util/tx-expiry-custom-errors';
45
- import {makeWebsocketUrl} from './util/makeWebsocketUrl';
44
+ } from './transaction/expiry-custom-errors';
45
+ import {makeWebsocketUrl} from './utils/makeWebsocketUrl';
46
+ import {URL} from './utils/url-impl';
46
47
  import type {Blockhash} from './blockhash';
47
48
  import type {FeeCalculator} from './fee-calculator';
48
49
  import type {TransactionSignature} from './transaction';
@@ -4218,6 +4219,29 @@ export class Connection {
4218
4219
  return res.result;
4219
4220
  }
4220
4221
 
4222
+ async getAddressLookupTable(
4223
+ accountKey: PublicKey,
4224
+ config?: GetAccountInfoConfig,
4225
+ ): Promise<RpcResponseAndContext<AddressLookupTableAccount | null>> {
4226
+ const {context, value: accountInfo} = await this.getAccountInfoAndContext(
4227
+ accountKey,
4228
+ config,
4229
+ );
4230
+
4231
+ let value = null;
4232
+ if (accountInfo !== null) {
4233
+ value = new AddressLookupTableAccount({
4234
+ key: accountKey,
4235
+ state: AddressLookupTableAccount.deserialize(accountInfo.data),
4236
+ });
4237
+ }
4238
+
4239
+ return {
4240
+ context,
4241
+ value,
4242
+ };
4243
+ }
4244
+
4221
4245
  /**
4222
4246
  * Fetch the contents of a Nonce account from the cluster, return with context
4223
4247
  */
package/src/index.ts CHANGED
@@ -1,33 +1,22 @@
1
1
  export * from './account';
2
- export * from './address-lookup-table-program';
3
2
  export * from './blockhash';
4
3
  export * from './bpf-loader-deprecated';
5
4
  export * from './bpf-loader';
6
- export * from './compute-budget';
7
5
  export * from './connection';
8
6
  export * from './epoch-schedule';
9
- export * from './ed25519-program';
7
+ export * from './errors';
10
8
  export * from './fee-calculator';
11
9
  export * from './keypair';
12
10
  export * from './loader';
13
11
  export * from './message';
14
12
  export * from './nonce-account';
13
+ export * from './programs';
15
14
  export * from './publickey';
16
- export * from './stake-program';
17
- export * from './system-program';
18
- export * from './secp256k1-program';
19
15
  export * from './transaction';
20
- export * from './transaction-constants';
21
16
  export * from './validator-info';
22
17
  export * from './vote-account';
23
- export * from './vote-program';
24
18
  export * from './sysvar';
25
- export * from './errors';
26
- export * from './util/borsh-schema';
27
- export * from './util/send-and-confirm-transaction';
28
- export * from './util/send-and-confirm-raw-transaction';
29
- export * from './util/tx-expiry-custom-errors';
30
- export * from './util/cluster';
19
+ export * from './utils';
31
20
 
32
21
  /**
33
22
  * There are 1-billion lamports in one SOL
package/src/loader.ts CHANGED
@@ -2,15 +2,14 @@ import {Buffer} from 'buffer';
2
2
  import * as BufferLayout from '@solana/buffer-layout';
3
3
 
4
4
  import {PublicKey} from './publickey';
5
- import {Transaction} from './transaction';
5
+ import {Transaction, PACKET_DATA_SIZE} from './transaction';
6
6
  import {SYSVAR_RENT_PUBKEY} from './sysvar';
7
- import {sendAndConfirmTransaction} from './util/send-and-confirm-transaction';
8
- import {sleep} from './util/sleep';
7
+ import {sendAndConfirmTransaction} from './utils/send-and-confirm-transaction';
8
+ import {sleep} from './utils/sleep';
9
9
  import type {Connection} from './connection';
10
10
  import type {Signer} from './keypair';
11
- import {SystemProgram} from './system-program';
11
+ import {SystemProgram} from './programs/system';
12
12
  import {IInstructionInputData} from './instruction';
13
- import {PACKET_DATA_SIZE} from './transaction-constants';
14
13
 
15
14
  // Keep program chunks under PACKET_DATA_SIZE, leaving enough room for the
16
15
  // rest of the Transaction fields
@@ -0,0 +1,32 @@
1
+ export * from './legacy';
2
+
3
+ /**
4
+ * The message header, identifying signed and read-only account
5
+ */
6
+ export type MessageHeader = {
7
+ /**
8
+ * The number of signatures required for this message to be considered valid. The
9
+ * signatures must match the first `numRequiredSignatures` of `accountKeys`.
10
+ */
11
+ numRequiredSignatures: number;
12
+ /** The last `numReadonlySignedAccounts` of the signed keys are read-only accounts */
13
+ numReadonlySignedAccounts: number;
14
+ /** The last `numReadonlySignedAccounts` of the unsigned keys are read-only accounts */
15
+ numReadonlyUnsignedAccounts: number;
16
+ };
17
+
18
+ /**
19
+ * An instruction to execute by a program
20
+ *
21
+ * @property {number} programIdIndex
22
+ * @property {number[]} accounts
23
+ * @property {string} data
24
+ */
25
+ export type CompiledInstruction = {
26
+ /** Index into the transaction keys array indicating the program account that executes this instruction */
27
+ programIdIndex: number;
28
+ /** Ordered indices into the transaction keys array indicating which accounts to pass to the program */
29
+ accounts: number[];
30
+ /** The program input data encoded as base 58 */
31
+ data: string;
32
+ };
@@ -2,44 +2,14 @@ import bs58 from 'bs58';
2
2
  import {Buffer} from 'buffer';
3
3
  import * as BufferLayout from '@solana/buffer-layout';
4
4
 
5
- import {PublicKey} from './publickey';
6
- import type {Blockhash} from './blockhash';
7
- import * as Layout from './layout';
8
- import {PACKET_DATA_SIZE} from './transaction-constants';
9
- import * as shortvec from './util/shortvec-encoding';
10
- import {toBuffer} from './util/to-buffer';
11
- import {guardedShift, guardedSplice} from './util/guarded-array-utils';
12
-
13
- /**
14
- * The message header, identifying signed and read-only account
15
- */
16
- export type MessageHeader = {
17
- /**
18
- * The number of signatures required for this message to be considered valid. The
19
- * signatures must match the first `numRequiredSignatures` of `accountKeys`.
20
- */
21
- numRequiredSignatures: number;
22
- /** The last `numReadonlySignedAccounts` of the signed keys are read-only accounts */
23
- numReadonlySignedAccounts: number;
24
- /** The last `numReadonlySignedAccounts` of the unsigned keys are read-only accounts */
25
- numReadonlyUnsignedAccounts: number;
26
- };
27
-
28
- /**
29
- * An instruction to execute by a program
30
- *
31
- * @property {number} programIdIndex
32
- * @property {number[]} accounts
33
- * @property {string} data
34
- */
35
- export type CompiledInstruction = {
36
- /** Index into the transaction keys array indicating the program account that executes this instruction */
37
- programIdIndex: number;
38
- /** Ordered indices into the transaction keys array indicating which accounts to pass to the program */
39
- accounts: number[];
40
- /** The program input data encoded as base 58 */
41
- data: string;
42
- };
5
+ import {PublicKey} from '../publickey';
6
+ import type {Blockhash} from '../blockhash';
7
+ import * as Layout from '../layout';
8
+ import {PACKET_DATA_SIZE} from '../transaction/constants';
9
+ import * as shortvec from '../utils/shortvec-encoding';
10
+ import {toBuffer} from '../utils/to-buffer';
11
+ import {CompiledInstruction, MessageHeader} from './index';
12
+ import {guardedShift, guardedSplice} from '../utils/guarded-array-utils';
43
13
 
44
14
  /**
45
15
  * Message constructor arguments
@@ -6,7 +6,7 @@ import * as Layout from './layout';
6
6
  import {PublicKey} from './publickey';
7
7
  import type {FeeCalculator} from './fee-calculator';
8
8
  import {FeeCalculatorLayout} from './fee-calculator';
9
- import {toBuffer} from './util/to-buffer';
9
+ import {toBuffer} from './utils/to-buffer';
10
10
 
11
11
  /**
12
12
  * See https://github.com/solana-labs/solana/blob/0ea2843ec9cdc517572b8e62c959f41b55cf4453/sdk/src/nonce_state.rs#L29-L32
@@ -1,12 +1,14 @@
1
1
  import {toBufferLE} from 'bigint-buffer';
2
2
  import * as BufferLayout from '@solana/buffer-layout';
3
3
 
4
- import * as Layout from './layout';
5
- import {PublicKey} from './publickey';
6
- import * as bigintLayout from './util/bigint';
7
- import {SystemProgram} from './system-program';
8
- import {TransactionInstruction} from './transaction';
9
- import {decodeData, encodeData, IInstructionInputData} from './instruction';
4
+ import * as Layout from '../../layout';
5
+ import {PublicKey} from '../../publickey';
6
+ import * as bigintLayout from '../../utils/bigint';
7
+ import {SystemProgram} from '../system';
8
+ import {TransactionInstruction} from '../../transaction';
9
+ import {decodeData, encodeData, IInstructionInputData} from '../../instruction';
10
+
11
+ export * from './state';
10
12
 
11
13
  export type CreateLookupTableParams = {
12
14
  /** Account used to derive and control the new address lookup table. */
@@ -0,0 +1,84 @@
1
+ import * as BufferLayout from '@solana/buffer-layout';
2
+
3
+ import assert from '../../utils/assert';
4
+ import * as Layout from '../../layout';
5
+ import {PublicKey} from '../../publickey';
6
+ import {u64} from '../../utils/bigint';
7
+ import {decodeData} from '../../account-data';
8
+
9
+ export type AddressLookupTableState = {
10
+ deactivationSlot: bigint;
11
+ lastExtendedSlot: number;
12
+ lastExtendedSlotStartIndex: number;
13
+ authority?: PublicKey;
14
+ addresses: Array<PublicKey>;
15
+ };
16
+
17
+ export type AddressLookupTableAccountArgs = {
18
+ key: PublicKey;
19
+ state: AddressLookupTableState;
20
+ };
21
+
22
+ /// The serialized size of lookup table metadata
23
+ const LOOKUP_TABLE_META_SIZE = 56;
24
+
25
+ export class AddressLookupTableAccount {
26
+ key: PublicKey;
27
+ state: AddressLookupTableState;
28
+
29
+ constructor(args: AddressLookupTableAccountArgs) {
30
+ this.key = args.key;
31
+ this.state = args.state;
32
+ }
33
+
34
+ isActive(): boolean {
35
+ const U64_MAX = 2n ** 64n - 1n;
36
+ return this.state.deactivationSlot === U64_MAX;
37
+ }
38
+
39
+ static deserialize(accountData: Uint8Array): AddressLookupTableState {
40
+ const meta = decodeData(LookupTableMetaLayout, accountData);
41
+
42
+ const serializedAddressesLen = accountData.length - LOOKUP_TABLE_META_SIZE;
43
+ assert(serializedAddressesLen >= 0, 'lookup table is invalid');
44
+ assert(serializedAddressesLen % 32 === 0, 'lookup table is invalid');
45
+
46
+ const numSerializedAddresses = serializedAddressesLen / 32;
47
+ const {addresses} = BufferLayout.struct<{addresses: Array<Uint8Array>}>([
48
+ BufferLayout.seq(Layout.publicKey(), numSerializedAddresses, 'addresses'),
49
+ ]).decode(accountData.slice(LOOKUP_TABLE_META_SIZE));
50
+
51
+ return {
52
+ deactivationSlot: meta.deactivationSlot,
53
+ lastExtendedSlot: meta.lastExtendedSlot,
54
+ lastExtendedSlotStartIndex: meta.lastExtendedStartIndex,
55
+ authority:
56
+ meta.authority.length !== 0
57
+ ? new PublicKey(meta.authority[0])
58
+ : undefined,
59
+ addresses: addresses.map(address => new PublicKey(address)),
60
+ };
61
+ }
62
+ }
63
+
64
+ const LookupTableMetaLayout = {
65
+ index: 1,
66
+ layout: BufferLayout.struct<{
67
+ typeIndex: number;
68
+ deactivationSlot: bigint;
69
+ lastExtendedSlot: number;
70
+ lastExtendedStartIndex: number;
71
+ authority: Array<Uint8Array>;
72
+ }>([
73
+ BufferLayout.u32('typeIndex'),
74
+ u64('deactivationSlot'),
75
+ BufferLayout.nu64('lastExtendedSlot'),
76
+ BufferLayout.u8('lastExtendedStartIndex'),
77
+ BufferLayout.u8(), // option
78
+ BufferLayout.seq(
79
+ Layout.publicKey(),
80
+ BufferLayout.offset(BufferLayout.u8(), -1),
81
+ 'authority',
82
+ ),
83
+ ]),
84
+ };
@@ -5,10 +5,10 @@ import {
5
5
  decodeData,
6
6
  InstructionType,
7
7
  IInstructionInputData,
8
- } from './instruction';
9
- import {PublicKey} from './publickey';
10
- import {TransactionInstruction} from './transaction';
11
- import {u64} from './util/bigint';
8
+ } from '../instruction';
9
+ import {PublicKey} from '../publickey';
10
+ import {TransactionInstruction} from '../transaction';
11
+ import {u64} from '../utils/bigint';
12
12
 
13
13
  /**
14
14
  * Compute Budget Instruction class
@@ -2,10 +2,10 @@ import {Buffer} from 'buffer';
2
2
  import * as BufferLayout from '@solana/buffer-layout';
3
3
  import nacl from 'tweetnacl';
4
4
 
5
- import {Keypair} from './keypair';
6
- import {PublicKey} from './publickey';
7
- import {TransactionInstruction} from './transaction';
8
- import assert from './util/assert';
5
+ import {Keypair} from '../keypair';
6
+ import {PublicKey} from '../publickey';
7
+ import {TransactionInstruction} from '../transaction';
8
+ import assert from '../utils/assert';
9
9
 
10
10
  const PRIVATE_KEY_BYTES = 64;
11
11
  const PUBLIC_KEY_BYTES = 32;
@@ -0,0 +1,7 @@
1
+ export * from './address-lookup-table';
2
+ export * from './compute-budget';
3
+ export * from './ed25519';
4
+ export * from './secp256k1';
5
+ export * from './stake';
6
+ export * from './system';
7
+ export * from './vote';
@@ -3,10 +3,10 @@ import * as BufferLayout from '@solana/buffer-layout';
3
3
  import secp256k1 from 'secp256k1';
4
4
  import sha3 from 'js-sha3';
5
5
 
6
- import {PublicKey} from './publickey';
7
- import {TransactionInstruction} from './transaction';
8
- import assert from './util/assert';
9
- import {toBuffer} from './util/to-buffer';
6
+ import {PublicKey} from '../publickey';
7
+ import {TransactionInstruction} from '../transaction';
8
+ import assert from '../utils/assert';
9
+ import {toBuffer} from '../utils/to-buffer';
10
10
 
11
11
  const {publicKeyCreate, ecdsaSign} = secp256k1;
12
12
 
@@ -5,17 +5,17 @@ import {
5
5
  decodeData,
6
6
  InstructionType,
7
7
  IInstructionInputData,
8
- } from './instruction';
9
- import * as Layout from './layout';
10
- import {PublicKey} from './publickey';
11
- import {SystemProgram} from './system-program';
8
+ } from '../instruction';
9
+ import * as Layout from '../layout';
10
+ import {PublicKey} from '../publickey';
11
+ import {SystemProgram} from './system';
12
12
  import {
13
13
  SYSVAR_CLOCK_PUBKEY,
14
14
  SYSVAR_RENT_PUBKEY,
15
15
  SYSVAR_STAKE_HISTORY_PUBKEY,
16
- } from './sysvar';
17
- import {Transaction, TransactionInstruction} from './transaction';
18
- import {toBuffer} from './util/to-buffer';
16
+ } from '../sysvar';
17
+ import {Transaction, TransactionInstruction} from '../transaction';
18
+ import {toBuffer} from '../utils/to-buffer';
19
19
 
20
20
  /**
21
21
  * Address of the stake config account which configures the rate
@@ -5,14 +5,14 @@ import {
5
5
  decodeData,
6
6
  InstructionType,
7
7
  IInstructionInputData,
8
- } from './instruction';
9
- import * as Layout from './layout';
10
- import {NONCE_ACCOUNT_LENGTH} from './nonce-account';
11
- import {PublicKey} from './publickey';
12
- import {SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY} from './sysvar';
13
- import {Transaction, TransactionInstruction} from './transaction';
14
- import {toBuffer} from './util/to-buffer';
15
- import {u64} from './util/bigint';
8
+ } from '../instruction';
9
+ import * as Layout from '../layout';
10
+ import {NONCE_ACCOUNT_LENGTH} from '../nonce-account';
11
+ import {PublicKey} from '../publickey';
12
+ import {SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY} from '../sysvar';
13
+ import {Transaction, TransactionInstruction} from '../transaction';
14
+ import {toBuffer} from '../utils/to-buffer';
15
+ import {u64} from '../utils/bigint';
16
16
 
17
17
  /**
18
18
  * Create account system transaction params
@@ -5,13 +5,13 @@ import {
5
5
  decodeData,
6
6
  InstructionType,
7
7
  IInstructionInputData,
8
- } from './instruction';
9
- import * as Layout from './layout';
10
- import {PublicKey} from './publickey';
11
- import {SystemProgram} from './system-program';
12
- import {SYSVAR_CLOCK_PUBKEY, SYSVAR_RENT_PUBKEY} from './sysvar';
13
- import {Transaction, TransactionInstruction} from './transaction';
14
- import {toBuffer} from './util/to-buffer';
8
+ } from '../instruction';
9
+ import * as Layout from '../layout';
10
+ import {PublicKey} from '../publickey';
11
+ import {SystemProgram} from './system';
12
+ import {SYSVAR_CLOCK_PUBKEY, SYSVAR_RENT_PUBKEY} from '../sysvar';
13
+ import {Transaction, TransactionInstruction} from '../transaction';
14
+ import {toBuffer} from '../utils/to-buffer';
15
15
 
16
16
  /**
17
17
  * Vote account info
package/src/publickey.ts CHANGED
@@ -4,8 +4,8 @@ import {Buffer} from 'buffer';
4
4
  import nacl from 'tweetnacl';
5
5
  import {sha256} from '@ethersproject/sha2';
6
6
 
7
- import {Struct, SOLANA_SCHEMA} from './util/borsh-schema';
8
- import {toBuffer} from './util/to-buffer';
7
+ import {Struct, SOLANA_SCHEMA} from './utils/borsh-schema';
8
+ import {toBuffer} from './utils/to-buffer';
9
9
 
10
10
  /**
11
11
  * Maximum length of derived pubkey seed
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './expiry-custom-errors';
3
+ export * from './legacy';
@@ -2,20 +2,17 @@ import nacl from 'tweetnacl';
2
2
  import bs58 from 'bs58';
3
3
  import {Buffer} from 'buffer';
4
4
 
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';
18
- import {guardedSplice} from './util/guarded-array-utils';
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 '../utils/shortvec-encoding';
10
+ import {toBuffer} from '../utils/to-buffer';
11
+ import invariant from '../utils/assert';
12
+ import type {Signer} from '../keypair';
13
+ import type {Blockhash} from '../blockhash';
14
+ import type {CompiledInstruction} from '../message';
15
+ import {guardedSplice} from '../utils/guarded-array-utils';
19
16
 
20
17
  /**
21
18
  * Transaction signature as base-58 encoded string
@@ -0,0 +1,4 @@
1
+ export * from './borsh-schema';
2
+ export * from './cluster';
3
+ export * from './send-and-confirm-raw-transaction';
4
+ export * from './send-and-confirm-transaction';
@@ -7,9 +7,9 @@ import {
7
7
  } from 'superstruct';
8
8
 
9
9
  import * as Layout from './layout';
10
- import * as shortvec from './util/shortvec-encoding';
10
+ import * as shortvec from './utils/shortvec-encoding';
11
11
  import {PublicKey} from './publickey';
12
- import {guardedShift, guardedSplice} from './util/guarded-array-utils';
12
+ import {guardedShift, guardedSplice} from './utils/guarded-array-utils';
13
13
 
14
14
  export const VALIDATOR_INFO_KEY = new PublicKey(
15
15
  'Va1idator1nfo111111111111111111111111111111',
@@ -3,7 +3,7 @@ import type {Buffer} from 'buffer';
3
3
 
4
4
  import * as Layout from './layout';
5
5
  import {PublicKey} from './publickey';
6
- import {toBuffer} from './util/to-buffer';
6
+ import {toBuffer} from './utils/to-buffer';
7
7
 
8
8
  export const VOTE_PROGRAM_ID = new PublicKey(
9
9
  'Vote111111111111111111111111111111111111111',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes