@lightprotocol/stateless.js 0.20.0 → 0.20.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.
- package/README.md +1 -1
- package/dist/cjs/browser/constants.d.ts +3 -0
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +1 -0
- package/dist/cjs/browser/logger.d.ts +1 -0
- package/dist/cjs/browser/programs/layout.d.ts +17 -1
- package/dist/cjs/browser/rpc-interface.d.ts +2 -2
- package/dist/cjs/browser/state/types.d.ts +15 -0
- package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +3 -1
- package/dist/cjs/node/constants.d.ts +3 -0
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +1 -0
- package/dist/cjs/node/logger.d.ts +1 -0
- package/dist/cjs/node/programs/layout.d.ts +17 -1
- package/dist/cjs/node/rpc-interface.d.ts +2 -2
- package/dist/cjs/node/state/types.d.ts +15 -0
- package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +3 -1
- package/dist/types/index.d.ts +42 -5
- package/package.json +7 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const logger: any;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
import { PublicKey, AccountMeta } from '@solana/web3.js';
|
|
3
3
|
import { Layout } from '@coral-xyz/borsh';
|
|
4
|
-
import { InstructionDataInvoke, PublicTransactionEvent } from '../state';
|
|
4
|
+
import { InstructionDataInvoke, InstructionDataInvokeCpi, PublicTransactionEvent } from '../state';
|
|
5
5
|
export declare const CompressedAccountLayout: import("buffer-layout").Layout<unknown>;
|
|
6
6
|
export declare const MerkleContextLayout: import("buffer-layout").Layout<unknown>;
|
|
7
7
|
export declare const NewAddressParamsLayout: import("buffer-layout").Layout<unknown>;
|
|
8
8
|
export declare const InstructionDataInvokeLayout: Layout<InstructionDataInvoke>;
|
|
9
9
|
export declare function encodeInstructionDataInvoke(data: InstructionDataInvoke): Buffer;
|
|
10
|
+
export declare const InstructionDataInvokeCpiLayout: Layout<InstructionDataInvokeCpi>;
|
|
10
11
|
export declare function decodeInstructionDataInvoke(buffer: Buffer): InstructionDataInvoke;
|
|
12
|
+
export declare function decodeInstructionDataInvokeCpi(buffer: Buffer): InstructionDataInvokeCpi;
|
|
11
13
|
export type invokeAccountsLayoutParams = {
|
|
12
14
|
feePayer: PublicKey;
|
|
13
15
|
authority: PublicKey;
|
|
@@ -23,3 +25,17 @@ export declare const invokeAccountsLayout: (accounts: invokeAccountsLayoutParams
|
|
|
23
25
|
export declare const PublicTransactionEventLayout: Layout<PublicTransactionEvent>;
|
|
24
26
|
export declare function encodePublicTransactionEvent(data: PublicTransactionEvent): Buffer;
|
|
25
27
|
export declare function decodePublicTransactionEvent(buffer: Buffer): PublicTransactionEvent;
|
|
28
|
+
export declare const AppendNullifyCreateAddressInputsMetaLayout: import("buffer-layout").Layout<unknown>;
|
|
29
|
+
export declare const AppendLeavesInputLayout: import("buffer-layout").Layout<unknown>;
|
|
30
|
+
export declare const InsertNullifierInputLayout: import("buffer-layout").Layout<unknown>;
|
|
31
|
+
export declare const InsertAddressInputLayout: import("buffer-layout").Layout<unknown>;
|
|
32
|
+
export declare const MerkleTreeSequenceNumberLayout: import("buffer-layout").Layout<unknown>;
|
|
33
|
+
export declare function deserializeAppendNullifyCreateAddressInputsIndexer(buffer: Buffer): {
|
|
34
|
+
meta: unknown;
|
|
35
|
+
leaves: unknown[];
|
|
36
|
+
nullifiers: unknown[];
|
|
37
|
+
addresses: unknown[];
|
|
38
|
+
sequence_numbers: unknown[];
|
|
39
|
+
output_leaf_indices: number[];
|
|
40
|
+
};
|
|
41
|
+
export declare function convertToPublicTransactionEvent(decoded: any, remainingAccounts: PublicKey[], invokeData: InstructionDataInvoke): PublicTransactionEvent;
|
|
@@ -656,8 +656,8 @@ export declare const NewAddressProofResult: Struct<{
|
|
|
656
656
|
export declare const ValidityProofResult: Struct<{
|
|
657
657
|
compressedProof: {
|
|
658
658
|
a: number[];
|
|
659
|
-
b: number[];
|
|
660
659
|
c: number[];
|
|
660
|
+
b: number[];
|
|
661
661
|
};
|
|
662
662
|
leafIndices: number[];
|
|
663
663
|
leaves: BN[];
|
|
@@ -667,8 +667,8 @@ export declare const ValidityProofResult: Struct<{
|
|
|
667
667
|
}, {
|
|
668
668
|
compressedProof: Struct<{
|
|
669
669
|
a: number[];
|
|
670
|
-
b: number[];
|
|
671
670
|
c: number[];
|
|
671
|
+
b: number[];
|
|
672
672
|
}, {
|
|
673
673
|
a: Struct<number[], Struct<number, null>>;
|
|
674
674
|
b: Struct<number[], Struct<number, null>>;
|
|
@@ -97,6 +97,21 @@ export interface InstructionDataInvoke {
|
|
|
97
97
|
compressOrDecompressLamports: BN | null;
|
|
98
98
|
isCompress: boolean;
|
|
99
99
|
}
|
|
100
|
+
export interface InstructionDataInvokeCpi {
|
|
101
|
+
proof: CompressedProof | null;
|
|
102
|
+
inputCompressedAccountsWithMerkleContext: PackedCompressedAccountWithMerkleContext[];
|
|
103
|
+
outputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
104
|
+
relayFee: BN | null;
|
|
105
|
+
newAddressParams: NewAddressParamsPacked[];
|
|
106
|
+
compressOrDecompressLamports: BN | null;
|
|
107
|
+
isCompress: boolean;
|
|
108
|
+
compressedCpiContext: CompressedCpiContext | null;
|
|
109
|
+
}
|
|
110
|
+
export interface CompressedCpiContext {
|
|
111
|
+
set_context: boolean;
|
|
112
|
+
first_set_context: boolean;
|
|
113
|
+
cpi_context_account_index: number;
|
|
114
|
+
}
|
|
100
115
|
export interface CompressedProof {
|
|
101
116
|
a: number[];
|
|
102
117
|
b: number[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ParsedTransactionWithMeta } from '@solana/web3.js';
|
|
1
|
+
import { ParsedTransactionWithMeta, PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { Rpc } from '../../rpc';
|
|
3
3
|
import { PublicTransactionEvent } from '../../state';
|
|
4
|
+
import { Buffer } from 'buffer';
|
|
4
5
|
type Deserializer<T> = (data: Buffer, tx: ParsedTransactionWithMeta) => T;
|
|
5
6
|
/**
|
|
6
7
|
* @internal
|
|
@@ -10,4 +11,5 @@ type Deserializer<T> = (data: Buffer, tx: ParsedTransactionWithMeta) => T;
|
|
|
10
11
|
export declare function getParsedEvents(rpc: Rpc): Promise<PublicTransactionEvent[]>;
|
|
11
12
|
export declare const parseEvents: <T>(indexerEventsTransactions: (ParsedTransactionWithMeta | null)[], deserializeFn: Deserializer<T>) => NonNullable<T>[];
|
|
12
13
|
export declare const parsePublicTransactionEventWithIdl: (data: Buffer) => PublicTransactionEvent | null;
|
|
14
|
+
export declare function parseLightTransaction(dataVec: Uint8Array[], accountKeys: PublicKey[][]): PublicTransactionEvent | null | undefined;
|
|
13
15
|
export {};
|
|
@@ -4,7 +4,10 @@ import { ConfirmOptions, PublicKey } from '@solana/web3.js';
|
|
|
4
4
|
import { ActiveTreeBundle } from './state/types';
|
|
5
5
|
export declare const FIELD_SIZE: BN;
|
|
6
6
|
export declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
|
|
7
|
+
export declare const COMPUTE_BUDGET_PATTERN: number[];
|
|
7
8
|
export declare const INVOKE_DISCRIMINATOR: Buffer;
|
|
9
|
+
export declare const INVOKE_CPI_DISCRIMINATOR: Buffer;
|
|
10
|
+
export declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Buffer;
|
|
8
11
|
export declare const noopProgram = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
|
|
9
12
|
export declare const lightProgram = "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7";
|
|
10
13
|
export declare const accountCompressionProgram = "compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq";
|