chore: restucture message files
This commit is contained in:
parent
7ffcde7330
commit
1a1a7ce1cf
|
@ -0,0 +1,32 @@
|
||||||
|
export * from './legacy';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The message header, identifying signed and read-only account
|
||||||
|
*/
|
||||||
|
export type MessageHeader = {
|
||||||
|
/**
|
||||||
|
* The number of signatures required for this message to be considered valid. The
|
||||||
|
* signatures must match the first `numRequiredSignatures` of `accountKeys`.
|
||||||
|
*/
|
||||||
|
numRequiredSignatures: number;
|
||||||
|
/** The last `numReadonlySignedAccounts` of the signed keys are read-only accounts */
|
||||||
|
numReadonlySignedAccounts: number;
|
||||||
|
/** The last `numReadonlySignedAccounts` of the unsigned keys are read-only accounts */
|
||||||
|
numReadonlyUnsignedAccounts: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An instruction to execute by a program
|
||||||
|
*
|
||||||
|
* @property {number} programIdIndex
|
||||||
|
* @property {number[]} accounts
|
||||||
|
* @property {string} data
|
||||||
|
*/
|
||||||
|
export type CompiledInstruction = {
|
||||||
|
/** Index into the transaction keys array indicating the program account that executes this instruction */
|
||||||
|
programIdIndex: number;
|
||||||
|
/** Ordered indices into the transaction keys array indicating which accounts to pass to the program */
|
||||||
|
accounts: number[];
|
||||||
|
/** The program input data encoded as base 58 */
|
||||||
|
data: string;
|
||||||
|
};
|
|
@ -2,43 +2,13 @@ import bs58 from 'bs58';
|
||||||
import {Buffer} from 'buffer';
|
import {Buffer} from 'buffer';
|
||||||
import * as BufferLayout from '@solana/buffer-layout';
|
import * as BufferLayout from '@solana/buffer-layout';
|
||||||
|
|
||||||
import {PublicKey} from './publickey';
|
import {PublicKey} from '../publickey';
|
||||||
import type {Blockhash} from './blockhash';
|
import type {Blockhash} from '../blockhash';
|
||||||
import * as Layout from './layout';
|
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 * as shortvec from '../util/shortvec-encoding';
|
||||||
import {toBuffer} from './util/to-buffer';
|
import {toBuffer} from '../util/to-buffer';
|
||||||
|
import {CompiledInstruction, MessageHeader} from './index';
|
||||||
/**
|
|
||||||
* The message header, identifying signed and read-only account
|
|
||||||
*/
|
|
||||||
export type MessageHeader = {
|
|
||||||
/**
|
|
||||||
* The number of signatures required for this message to be considered valid. The
|
|
||||||
* signatures must match the first `numRequiredSignatures` of `accountKeys`.
|
|
||||||
*/
|
|
||||||
numRequiredSignatures: number;
|
|
||||||
/** The last `numReadonlySignedAccounts` of the signed keys are read-only accounts */
|
|
||||||
numReadonlySignedAccounts: number;
|
|
||||||
/** The last `numReadonlySignedAccounts` of the unsigned keys are read-only accounts */
|
|
||||||
numReadonlyUnsignedAccounts: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An instruction to execute by a program
|
|
||||||
*
|
|
||||||
* @property {number} programIdIndex
|
|
||||||
* @property {number[]} accounts
|
|
||||||
* @property {string} data
|
|
||||||
*/
|
|
||||||
export type CompiledInstruction = {
|
|
||||||
/** Index into the transaction keys array indicating the program account that executes this instruction */
|
|
||||||
programIdIndex: number;
|
|
||||||
/** Ordered indices into the transaction keys array indicating which accounts to pass to the program */
|
|
||||||
accounts: number[];
|
|
||||||
/** The program input data encoded as base 58 */
|
|
||||||
data: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message constructor arguments
|
* Message constructor arguments
|
Loading…
Reference in New Issue