@triton-one/yellowstone-grpc 3.0.0 → 4.0.0
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/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm.d.ts +607 -57
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm.js +3930 -667
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm.js.map +1 -1
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm +0 -0
- package/dist/cjs/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm.d.ts +299 -63
- package/dist/encoding/yellowstone_grpc_solana_encoding_wasm.d.ts +607 -57
- package/dist/encoding/yellowstone_grpc_solana_encoding_wasm.js +3930 -667
- package/dist/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm +0 -0
- package/dist/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm.d.ts +299 -63
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm.d.ts +607 -57
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm.js +3930 -667
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm +0 -0
- package/dist/esm/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm.d.ts +299 -63
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm.d.ts +607 -57
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm.js +3930 -667
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm +0 -0
- package/dist/types/encoding/yellowstone_grpc_solana_encoding_wasm_bg.wasm.d.ts +299 -63
- package/package.json +1 -1
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
* @param {Uint8Array} data
|
|
5
|
-
* @param {WasmUiTransactionEncoding} encoding
|
|
6
|
-
* @param {number | undefined} max_supported_transaction_version
|
|
7
|
-
* @param {boolean} show_rewards
|
|
8
|
-
* @returns {string}
|
|
9
|
-
*/
|
|
10
|
-
export function encode_tx(data: Uint8Array, encoding: WasmUiTransactionEncoding, max_supported_transaction_version: number | undefined, show_rewards: boolean): string;
|
|
11
|
-
/**
|
|
12
|
-
* @param {Uint8Array} err
|
|
13
|
-
* @returns {string}
|
|
14
|
-
*/
|
|
3
|
+
export function encode_tx(data: Uint8Array, encoding: WasmUiTransactionEncoding, max_supported_transaction_version: number | null | undefined, show_rewards: boolean): string;
|
|
15
4
|
export function decode_tx_error(err: Uint8Array): string;
|
|
16
5
|
/**
|
|
17
6
|
* Initialize Javascript logging and panic handler
|
|
@@ -24,6 +13,309 @@ export enum WasmUiTransactionEncoding {
|
|
|
24
13
|
Json = 3,
|
|
25
14
|
JsonParsed = 4,
|
|
26
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Authenticated encryption nonce and ciphertext
|
|
18
|
+
*/
|
|
19
|
+
export class AeCiphertext {
|
|
20
|
+
private constructor();
|
|
21
|
+
free(): void;
|
|
22
|
+
}
|
|
23
|
+
export class AeKey {
|
|
24
|
+
private constructor();
|
|
25
|
+
free(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Generates a random authenticated encryption key.
|
|
28
|
+
*
|
|
29
|
+
* This function is randomized. It internally samples a scalar element using `OsRng`.
|
|
30
|
+
*/
|
|
31
|
+
static newRand(): AeKey;
|
|
32
|
+
/**
|
|
33
|
+
* Encrypts an amount under the authenticated encryption key.
|
|
34
|
+
*/
|
|
35
|
+
encrypt(amount: bigint): AeCiphertext;
|
|
36
|
+
decrypt(ciphertext: AeCiphertext): bigint | undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Batched grouped ciphertext validity proof with two handles.
|
|
40
|
+
*
|
|
41
|
+
* A batched grouped ciphertext validity proof certifies the validity of two instances of a
|
|
42
|
+
* standard ciphertext validity proof. An instance of a standard validity proof consists of one
|
|
43
|
+
* ciphertext and two decryption handles: `(commitment, first_handle, second_handle)`. An
|
|
44
|
+
* instance of a batched ciphertext validity proof is a pair `(commitment_0,
|
|
45
|
+
* first_handle_0, second_handle_0)` and `(commitment_1, first_handle_1,
|
|
46
|
+
* second_handle_1)`. The proof certifies the analogous decryptable properties for each one of
|
|
47
|
+
* these pairs of commitment and decryption handles.
|
|
48
|
+
*/
|
|
49
|
+
export class BatchedGroupedCiphertext2HandlesValidityProof {
|
|
50
|
+
private constructor();
|
|
51
|
+
free(): void;
|
|
52
|
+
}
|
|
53
|
+
export class BatchedGroupedCiphertext2HandlesValidityProofContext {
|
|
54
|
+
private constructor();
|
|
55
|
+
free(): void;
|
|
56
|
+
toBytes(): Uint8Array;
|
|
57
|
+
static fromBytes(bytes: Uint8Array): BatchedGroupedCiphertext2HandlesValidityProofContext;
|
|
58
|
+
first_pubkey: PodElGamalPubkey;
|
|
59
|
+
second_pubkey: PodElGamalPubkey;
|
|
60
|
+
grouped_ciphertext_lo: PodGroupedElGamalCiphertext2Handles;
|
|
61
|
+
grouped_ciphertext_hi: PodGroupedElGamalCiphertext2Handles;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The instruction data that is needed for the
|
|
65
|
+
* `ProofInstruction::VerifyBatchedGroupedCiphertextValidity` instruction.
|
|
66
|
+
*
|
|
67
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
68
|
+
* the proof.
|
|
69
|
+
*/
|
|
70
|
+
export class BatchedGroupedCiphertext2HandlesValidityProofData {
|
|
71
|
+
private constructor();
|
|
72
|
+
free(): void;
|
|
73
|
+
static new(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, grouped_ciphertext_lo: GroupedElGamalCiphertext2Handles, grouped_ciphertext_hi: GroupedElGamalCiphertext2Handles, amount_lo: bigint, amount_hi: bigint, opening_lo: PedersenOpening, opening_hi: PedersenOpening): BatchedGroupedCiphertext2HandlesValidityProofData;
|
|
74
|
+
toBytes(): Uint8Array;
|
|
75
|
+
static fromBytes(bytes: Uint8Array): BatchedGroupedCiphertext2HandlesValidityProofData;
|
|
76
|
+
context: BatchedGroupedCiphertext2HandlesValidityProofContext;
|
|
77
|
+
proof: PodBatchedGroupedCiphertext2HandlesValidityProof;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Batched grouped ciphertext validity proof with two handles.
|
|
81
|
+
*/
|
|
82
|
+
export class BatchedGroupedCiphertext3HandlesValidityProof {
|
|
83
|
+
private constructor();
|
|
84
|
+
free(): void;
|
|
85
|
+
}
|
|
86
|
+
export class BatchedGroupedCiphertext3HandlesValidityProofContext {
|
|
87
|
+
private constructor();
|
|
88
|
+
free(): void;
|
|
89
|
+
toBytes(): Uint8Array;
|
|
90
|
+
static fromBytes(bytes: Uint8Array): BatchedGroupedCiphertext3HandlesValidityProofContext;
|
|
91
|
+
first_pubkey: PodElGamalPubkey;
|
|
92
|
+
second_pubkey: PodElGamalPubkey;
|
|
93
|
+
third_pubkey: PodElGamalPubkey;
|
|
94
|
+
grouped_ciphertext_lo: PodGroupedElGamalCiphertext3Handles;
|
|
95
|
+
grouped_ciphertext_hi: PodGroupedElGamalCiphertext3Handles;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The instruction data that is needed for the
|
|
99
|
+
* `ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity` instruction.
|
|
100
|
+
*
|
|
101
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
102
|
+
* the proof.
|
|
103
|
+
*/
|
|
104
|
+
export class BatchedGroupedCiphertext3HandlesValidityProofData {
|
|
105
|
+
private constructor();
|
|
106
|
+
free(): void;
|
|
107
|
+
static new(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, third_pubkey: ElGamalPubkey, grouped_ciphertext_lo: GroupedElGamalCiphertext3Handles, grouped_ciphertext_hi: GroupedElGamalCiphertext3Handles, amount_lo: bigint, amount_hi: bigint, opening_lo: PedersenOpening, opening_hi: PedersenOpening): BatchedGroupedCiphertext3HandlesValidityProofData;
|
|
108
|
+
toBytes(): Uint8Array;
|
|
109
|
+
static fromBytes(bytes: Uint8Array): BatchedGroupedCiphertext3HandlesValidityProofData;
|
|
110
|
+
context: BatchedGroupedCiphertext3HandlesValidityProofContext;
|
|
111
|
+
proof: PodBatchedGroupedCiphertext3HandlesValidityProof;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The ciphertext-ciphertext equality proof.
|
|
115
|
+
*
|
|
116
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
117
|
+
*/
|
|
118
|
+
export class CiphertextCiphertextEqualityProof {
|
|
119
|
+
private constructor();
|
|
120
|
+
free(): void;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The context data needed to verify a ciphertext-ciphertext equality proof.
|
|
124
|
+
*/
|
|
125
|
+
export class CiphertextCiphertextEqualityProofContext {
|
|
126
|
+
private constructor();
|
|
127
|
+
free(): void;
|
|
128
|
+
toBytes(): Uint8Array;
|
|
129
|
+
static fromBytes(bytes: Uint8Array): CiphertextCiphertextEqualityProofContext;
|
|
130
|
+
first_pubkey: PodElGamalPubkey;
|
|
131
|
+
second_pubkey: PodElGamalPubkey;
|
|
132
|
+
first_ciphertext: PodElGamalCiphertext;
|
|
133
|
+
second_ciphertext: PodElGamalCiphertext;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The instruction data that is needed for the
|
|
137
|
+
* `ProofInstruction::VerifyCiphertextCiphertextEquality` instruction.
|
|
138
|
+
*
|
|
139
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
140
|
+
* the proof.
|
|
141
|
+
*/
|
|
142
|
+
export class CiphertextCiphertextEqualityProofData {
|
|
143
|
+
private constructor();
|
|
144
|
+
free(): void;
|
|
145
|
+
static new(first_keypair: ElGamalKeypair, second_pubkey: ElGamalPubkey, first_ciphertext: ElGamalCiphertext, second_ciphertext: ElGamalCiphertext, second_opening: PedersenOpening, amount: bigint): CiphertextCiphertextEqualityProofData;
|
|
146
|
+
toBytes(): Uint8Array;
|
|
147
|
+
static fromBytes(bytes: Uint8Array): CiphertextCiphertextEqualityProofData;
|
|
148
|
+
context: CiphertextCiphertextEqualityProofContext;
|
|
149
|
+
proof: PodCiphertextCiphertextEqualityProof;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Equality proof.
|
|
153
|
+
*
|
|
154
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
155
|
+
*/
|
|
156
|
+
export class CiphertextCommitmentEqualityProof {
|
|
157
|
+
private constructor();
|
|
158
|
+
free(): void;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The context data needed to verify a ciphertext-commitment equality proof.
|
|
162
|
+
*/
|
|
163
|
+
export class CiphertextCommitmentEqualityProofContext {
|
|
164
|
+
private constructor();
|
|
165
|
+
free(): void;
|
|
166
|
+
toBytes(): Uint8Array;
|
|
167
|
+
static fromBytes(bytes: Uint8Array): CiphertextCommitmentEqualityProofContext;
|
|
168
|
+
/**
|
|
169
|
+
* The ElGamal pubkey
|
|
170
|
+
*/
|
|
171
|
+
pubkey: PodElGamalPubkey;
|
|
172
|
+
/**
|
|
173
|
+
* The ciphertext encrypted under the ElGamal pubkey
|
|
174
|
+
*/
|
|
175
|
+
ciphertext: PodElGamalCiphertext;
|
|
176
|
+
/**
|
|
177
|
+
* The Pedersen commitment
|
|
178
|
+
*/
|
|
179
|
+
commitment: PodPedersenCommitment;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The instruction data that is needed for the
|
|
183
|
+
* `ProofInstruction::VerifyCiphertextCommitmentEquality` instruction.
|
|
184
|
+
*
|
|
185
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
186
|
+
* the proof.
|
|
187
|
+
*/
|
|
188
|
+
export class CiphertextCommitmentEqualityProofData {
|
|
189
|
+
private constructor();
|
|
190
|
+
free(): void;
|
|
191
|
+
static new(keypair: ElGamalKeypair, ciphertext: ElGamalCiphertext, commitment: PedersenCommitment, opening: PedersenOpening, amount: bigint): CiphertextCommitmentEqualityProofData;
|
|
192
|
+
toBytes(): Uint8Array;
|
|
193
|
+
static fromBytes(bytes: Uint8Array): CiphertextCommitmentEqualityProofData;
|
|
194
|
+
context: CiphertextCommitmentEqualityProofContext;
|
|
195
|
+
proof: PodCiphertextCommitmentEqualityProof;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Decryption handle for Pedersen commitment.
|
|
199
|
+
*/
|
|
200
|
+
export class DecryptHandle {
|
|
201
|
+
private constructor();
|
|
202
|
+
free(): void;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Ciphertext for the ElGamal encryption scheme.
|
|
206
|
+
*/
|
|
207
|
+
export class ElGamalCiphertext {
|
|
208
|
+
private constructor();
|
|
209
|
+
free(): void;
|
|
210
|
+
commitment: PedersenCommitment;
|
|
211
|
+
handle: DecryptHandle;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* A (twisted) ElGamal encryption keypair.
|
|
215
|
+
*
|
|
216
|
+
* The instances of the secret key are zeroized on drop.
|
|
217
|
+
*/
|
|
218
|
+
export class ElGamalKeypair {
|
|
219
|
+
private constructor();
|
|
220
|
+
free(): void;
|
|
221
|
+
/**
|
|
222
|
+
* Generates the public and secret keys for ElGamal encryption.
|
|
223
|
+
*
|
|
224
|
+
* This function is randomized. It internally samples a scalar element using `OsRng`.
|
|
225
|
+
*/
|
|
226
|
+
static newRand(): ElGamalKeypair;
|
|
227
|
+
pubkeyOwned(): ElGamalPubkey;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Public key for the ElGamal encryption scheme.
|
|
231
|
+
*/
|
|
232
|
+
export class ElGamalPubkey {
|
|
233
|
+
private constructor();
|
|
234
|
+
free(): void;
|
|
235
|
+
encryptU64(amount: bigint): ElGamalCiphertext;
|
|
236
|
+
encryptWithU64(amount: bigint, opening: PedersenOpening): ElGamalCiphertext;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The grouped ciphertext validity proof for 2 handles.
|
|
240
|
+
*
|
|
241
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
242
|
+
*/
|
|
243
|
+
export class GroupedCiphertext2HandlesValidityProof {
|
|
244
|
+
private constructor();
|
|
245
|
+
free(): void;
|
|
246
|
+
}
|
|
247
|
+
export class GroupedCiphertext2HandlesValidityProofContext {
|
|
248
|
+
private constructor();
|
|
249
|
+
free(): void;
|
|
250
|
+
toBytes(): Uint8Array;
|
|
251
|
+
static fromBytes(bytes: Uint8Array): GroupedCiphertext2HandlesValidityProofContext;
|
|
252
|
+
first_pubkey: PodElGamalPubkey;
|
|
253
|
+
second_pubkey: PodElGamalPubkey;
|
|
254
|
+
grouped_ciphertext: PodGroupedElGamalCiphertext2Handles;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The instruction data that is needed for the `ProofInstruction::VerifyGroupedCiphertextValidity`
|
|
258
|
+
* instruction.
|
|
259
|
+
*
|
|
260
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
261
|
+
* the proof.
|
|
262
|
+
*/
|
|
263
|
+
export class GroupedCiphertext2HandlesValidityProofData {
|
|
264
|
+
private constructor();
|
|
265
|
+
free(): void;
|
|
266
|
+
static new(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, grouped_ciphertext: GroupedElGamalCiphertext2Handles, amount: bigint, opening: PedersenOpening): GroupedCiphertext2HandlesValidityProofData;
|
|
267
|
+
toBytes(): Uint8Array;
|
|
268
|
+
static fromBytes(bytes: Uint8Array): GroupedCiphertext2HandlesValidityProofData;
|
|
269
|
+
context: GroupedCiphertext2HandlesValidityProofContext;
|
|
270
|
+
proof: PodGroupedCiphertext2HandlesValidityProof;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* The grouped ciphertext validity proof for 3 handles.
|
|
274
|
+
*
|
|
275
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
276
|
+
*/
|
|
277
|
+
export class GroupedCiphertext3HandlesValidityProof {
|
|
278
|
+
private constructor();
|
|
279
|
+
free(): void;
|
|
280
|
+
}
|
|
281
|
+
export class GroupedCiphertext3HandlesValidityProofContext {
|
|
282
|
+
private constructor();
|
|
283
|
+
free(): void;
|
|
284
|
+
toBytes(): Uint8Array;
|
|
285
|
+
static fromBytes(bytes: Uint8Array): GroupedCiphertext3HandlesValidityProofContext;
|
|
286
|
+
first_pubkey: PodElGamalPubkey;
|
|
287
|
+
second_pubkey: PodElGamalPubkey;
|
|
288
|
+
third_pubkey: PodElGamalPubkey;
|
|
289
|
+
grouped_ciphertext: PodGroupedElGamalCiphertext3Handles;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The instruction data that is needed for the
|
|
293
|
+
* `ProofInstruction::VerifyGroupedCiphertext3HandlesValidity` instruction.
|
|
294
|
+
*
|
|
295
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
296
|
+
* the proof.
|
|
297
|
+
*/
|
|
298
|
+
export class GroupedCiphertext3HandlesValidityProofData {
|
|
299
|
+
private constructor();
|
|
300
|
+
free(): void;
|
|
301
|
+
static new(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, third_pubkey: ElGamalPubkey, grouped_ciphertext: GroupedElGamalCiphertext3Handles, amount: bigint, opening: PedersenOpening): GroupedCiphertext3HandlesValidityProofData;
|
|
302
|
+
toBytes(): Uint8Array;
|
|
303
|
+
static fromBytes(bytes: Uint8Array): GroupedCiphertext3HandlesValidityProofData;
|
|
304
|
+
context: GroupedCiphertext3HandlesValidityProofContext;
|
|
305
|
+
proof: PodGroupedCiphertext3HandlesValidityProof;
|
|
306
|
+
}
|
|
307
|
+
export class GroupedElGamalCiphertext2Handles {
|
|
308
|
+
private constructor();
|
|
309
|
+
free(): void;
|
|
310
|
+
static encryptU64(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, amount: bigint): GroupedElGamalCiphertext2Handles;
|
|
311
|
+
static encryptionWithU64(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, amount: bigint, opening: PedersenOpening): GroupedElGamalCiphertext2Handles;
|
|
312
|
+
}
|
|
313
|
+
export class GroupedElGamalCiphertext3Handles {
|
|
314
|
+
private constructor();
|
|
315
|
+
free(): void;
|
|
316
|
+
static encryptU64(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, third_pubkey: ElGamalPubkey, amount: bigint): GroupedElGamalCiphertext3Handles;
|
|
317
|
+
static encryptionWithU64(first_pubkey: ElGamalPubkey, second_pubkey: ElGamalPubkey, third_pubkey: ElGamalPubkey, amount: bigint, opening: PedersenOpening): GroupedElGamalCiphertext3Handles;
|
|
318
|
+
}
|
|
27
319
|
/**
|
|
28
320
|
* A hash; the 32-byte output of a hashing algorithm.
|
|
29
321
|
*
|
|
@@ -39,23 +331,18 @@ export class Hash {
|
|
|
39
331
|
* Create a new Hash object
|
|
40
332
|
*
|
|
41
333
|
* * `value` - optional hash as a base58 encoded string, `Uint8Array`, `[number]`
|
|
42
|
-
* @param {any} value
|
|
43
334
|
*/
|
|
44
335
|
constructor(value: any);
|
|
45
336
|
/**
|
|
46
337
|
* Return the base58 string representation of the hash
|
|
47
|
-
* @returns {string}
|
|
48
338
|
*/
|
|
49
339
|
toString(): string;
|
|
50
340
|
/**
|
|
51
341
|
* Checks if two `Hash`s are equal
|
|
52
|
-
* @param {Hash} other
|
|
53
|
-
* @returns {boolean}
|
|
54
342
|
*/
|
|
55
343
|
equals(other: Hash): boolean;
|
|
56
344
|
/**
|
|
57
345
|
* Return the `Uint8Array` representation of the hash
|
|
58
|
-
* @returns {Uint8Array}
|
|
59
346
|
*/
|
|
60
347
|
toBytes(): Uint8Array;
|
|
61
348
|
}
|
|
@@ -65,14 +352,12 @@ export class Hash {
|
|
|
65
352
|
* is fixed. This must not diverge from the regular non-wasm Instruction struct.
|
|
66
353
|
*/
|
|
67
354
|
export class Instruction {
|
|
355
|
+
private constructor();
|
|
68
356
|
free(): void;
|
|
69
357
|
}
|
|
70
358
|
export class Instructions {
|
|
71
359
|
free(): void;
|
|
72
360
|
constructor();
|
|
73
|
-
/**
|
|
74
|
-
* @param {Instruction} instruction
|
|
75
|
-
*/
|
|
76
361
|
push(instruction: Instruction): void;
|
|
77
362
|
}
|
|
78
363
|
/**
|
|
@@ -86,18 +371,14 @@ export class Keypair {
|
|
|
86
371
|
constructor();
|
|
87
372
|
/**
|
|
88
373
|
* Convert a `Keypair` to a `Uint8Array`
|
|
89
|
-
* @returns {Uint8Array}
|
|
90
374
|
*/
|
|
91
375
|
toBytes(): Uint8Array;
|
|
92
376
|
/**
|
|
93
377
|
* Recover a `Keypair` from a `Uint8Array`
|
|
94
|
-
* @param {Uint8Array} bytes
|
|
95
|
-
* @returns {Keypair}
|
|
96
378
|
*/
|
|
97
379
|
static fromBytes(bytes: Uint8Array): Keypair;
|
|
98
380
|
/**
|
|
99
381
|
* Return the `Pubkey` for this `Keypair`
|
|
100
|
-
* @returns {Pubkey}
|
|
101
382
|
*/
|
|
102
383
|
pubkey(): Pubkey;
|
|
103
384
|
}
|
|
@@ -107,11 +388,223 @@ export class Keypair {
|
|
|
107
388
|
* is fixed. This must not diverge from the regular non-wasm Message struct.
|
|
108
389
|
*/
|
|
109
390
|
export class Message {
|
|
391
|
+
private constructor();
|
|
392
|
+
free(): void;
|
|
393
|
+
/**
|
|
394
|
+
* The id of a recent ledger entry.
|
|
395
|
+
*/
|
|
396
|
+
recent_blockhash: Hash;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Algorithm handle for the Pedersen commitment scheme.
|
|
400
|
+
*/
|
|
401
|
+
export class Pedersen {
|
|
402
|
+
private constructor();
|
|
110
403
|
free(): void;
|
|
404
|
+
static withU64(amount: bigint, opening: PedersenOpening): PedersenCommitment;
|
|
405
|
+
}
|
|
111
406
|
/**
|
|
112
|
-
*
|
|
407
|
+
* Pedersen commitment type.
|
|
113
408
|
*/
|
|
114
|
-
|
|
409
|
+
export class PedersenCommitment {
|
|
410
|
+
private constructor();
|
|
411
|
+
free(): void;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Pedersen opening type.
|
|
415
|
+
*
|
|
416
|
+
* Instances of Pedersen openings are zeroized on drop.
|
|
417
|
+
*/
|
|
418
|
+
export class PedersenOpening {
|
|
419
|
+
private constructor();
|
|
420
|
+
free(): void;
|
|
421
|
+
static newRand(): PedersenOpening;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Percentage-with-cap proof.
|
|
425
|
+
*
|
|
426
|
+
* The proof consists of two main components: `percentage_max_proof` and
|
|
427
|
+
* `percentage_equality_proof`. If the committed amount is greater than the maximum cap value,
|
|
428
|
+
* then the `percentage_max_proof` is properly generated and `percentage_equality_proof` is
|
|
429
|
+
* simulated. If the encrypted amount is smaller than the maximum cap bound, the
|
|
430
|
+
* `percentage_equality_proof` is properly generated and `percentage_max_proof` is simulated.
|
|
431
|
+
*/
|
|
432
|
+
export class PercentageWithCapProof {
|
|
433
|
+
private constructor();
|
|
434
|
+
free(): void;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* The context data needed to verify a percentage-with-cap proof.
|
|
438
|
+
*
|
|
439
|
+
* We refer to [`ZK ElGamal proof`] for the formal details on how the percentage-with-cap proof is
|
|
440
|
+
* computed.
|
|
441
|
+
*
|
|
442
|
+
* [`ZK ElGamal proof`]: https://docs.solanalabs.com/runtime/zk-token-proof
|
|
443
|
+
*/
|
|
444
|
+
export class PercentageWithCapProofContext {
|
|
445
|
+
private constructor();
|
|
446
|
+
free(): void;
|
|
447
|
+
toBytes(): Uint8Array;
|
|
448
|
+
static fromBytes(bytes: Uint8Array): PercentageWithCapProofContext;
|
|
449
|
+
/**
|
|
450
|
+
* The Pedersen commitment to the percentage amount.
|
|
451
|
+
*/
|
|
452
|
+
percentage_commitment: PodPedersenCommitment;
|
|
453
|
+
/**
|
|
454
|
+
* The Pedersen commitment to the delta amount.
|
|
455
|
+
*/
|
|
456
|
+
delta_commitment: PodPedersenCommitment;
|
|
457
|
+
/**
|
|
458
|
+
* The Pedersen commitment to the claimed amount.
|
|
459
|
+
*/
|
|
460
|
+
claimed_commitment: PodPedersenCommitment;
|
|
461
|
+
/**
|
|
462
|
+
* The maximum cap bound.
|
|
463
|
+
*/
|
|
464
|
+
max_value: PodU64;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* The instruction data that is needed for the `ProofInstruction::VerifyPercentageWithCap`
|
|
468
|
+
* instruction.
|
|
469
|
+
*
|
|
470
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
471
|
+
* the proof.
|
|
472
|
+
*/
|
|
473
|
+
export class PercentageWithCapProofData {
|
|
474
|
+
private constructor();
|
|
475
|
+
free(): void;
|
|
476
|
+
static new(percentage_commitment: PedersenCommitment, percentage_opening: PedersenOpening, percentage_amount: bigint, delta_commitment: PedersenCommitment, delta_opening: PedersenOpening, delta_amount: bigint, claimed_commitment: PedersenCommitment, claimed_opening: PedersenOpening, max_value: bigint): PercentageWithCapProofData;
|
|
477
|
+
toBytes(): Uint8Array;
|
|
478
|
+
static fromBytes(bytes: Uint8Array): PercentageWithCapProofData;
|
|
479
|
+
context: PercentageWithCapProofContext;
|
|
480
|
+
proof: PodPercentageWithCapProof;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* The `AeCiphertext` type as a `Pod`.
|
|
484
|
+
*/
|
|
485
|
+
export class PodAeCiphertext {
|
|
486
|
+
free(): void;
|
|
487
|
+
constructor(value: any);
|
|
488
|
+
toString(): string;
|
|
489
|
+
equals(other: PodAeCiphertext): boolean;
|
|
490
|
+
toBytes(): Uint8Array;
|
|
491
|
+
static zeroed(): PodAeCiphertext;
|
|
492
|
+
static encode(decoded: AeCiphertext): PodAeCiphertext;
|
|
493
|
+
decode(): AeCiphertext;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The `BatchedGroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
497
|
+
*/
|
|
498
|
+
export class PodBatchedGroupedCiphertext2HandlesValidityProof {
|
|
499
|
+
private constructor();
|
|
500
|
+
free(): void;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* The `BatchedGroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
504
|
+
*/
|
|
505
|
+
export class PodBatchedGroupedCiphertext3HandlesValidityProof {
|
|
506
|
+
private constructor();
|
|
507
|
+
free(): void;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* The `CiphertextCiphertextEqualityProof` type as a `Pod`.
|
|
511
|
+
*/
|
|
512
|
+
export class PodCiphertextCiphertextEqualityProof {
|
|
513
|
+
private constructor();
|
|
514
|
+
free(): void;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* The `CiphertextCommitmentEqualityProof` type as a `Pod`.
|
|
518
|
+
*/
|
|
519
|
+
export class PodCiphertextCommitmentEqualityProof {
|
|
520
|
+
private constructor();
|
|
521
|
+
free(): void;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* The `ElGamalCiphertext` type as a `Pod`.
|
|
525
|
+
*/
|
|
526
|
+
export class PodElGamalCiphertext {
|
|
527
|
+
free(): void;
|
|
528
|
+
constructor(value: any);
|
|
529
|
+
toString(): string;
|
|
530
|
+
equals(other: PodElGamalCiphertext): boolean;
|
|
531
|
+
toBytes(): Uint8Array;
|
|
532
|
+
static zeroed(): PodElGamalCiphertext;
|
|
533
|
+
static encode(decoded: ElGamalCiphertext): PodElGamalCiphertext;
|
|
534
|
+
decode(): ElGamalCiphertext;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* The `ElGamalPubkey` type as a `Pod`.
|
|
538
|
+
*/
|
|
539
|
+
export class PodElGamalPubkey {
|
|
540
|
+
free(): void;
|
|
541
|
+
constructor(value: any);
|
|
542
|
+
toString(): string;
|
|
543
|
+
equals(other: PodElGamalPubkey): boolean;
|
|
544
|
+
toBytes(): Uint8Array;
|
|
545
|
+
static zeroed(): PodElGamalPubkey;
|
|
546
|
+
static encode(decoded: ElGamalPubkey): PodElGamalPubkey;
|
|
547
|
+
decode(): ElGamalPubkey;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* The `GroupedCiphertext2HandlesValidityProof` type as a `Pod`.
|
|
551
|
+
*/
|
|
552
|
+
export class PodGroupedCiphertext2HandlesValidityProof {
|
|
553
|
+
private constructor();
|
|
554
|
+
free(): void;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* The `GroupedCiphertext3HandlesValidityProof` type as a `Pod`.
|
|
558
|
+
*/
|
|
559
|
+
export class PodGroupedCiphertext3HandlesValidityProof {
|
|
560
|
+
private constructor();
|
|
561
|
+
free(): void;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* The `GroupedElGamalCiphertext` type with two decryption handles as a `Pod`
|
|
565
|
+
*/
|
|
566
|
+
export class PodGroupedElGamalCiphertext2Handles {
|
|
567
|
+
private constructor();
|
|
568
|
+
free(): void;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* The `GroupedElGamalCiphertext` type with three decryption handles as a `Pod`
|
|
572
|
+
*/
|
|
573
|
+
export class PodGroupedElGamalCiphertext3Handles {
|
|
574
|
+
private constructor();
|
|
575
|
+
free(): void;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* The `PedersenCommitment` type as a `Pod`.
|
|
579
|
+
*/
|
|
580
|
+
export class PodPedersenCommitment {
|
|
581
|
+
private constructor();
|
|
582
|
+
free(): void;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* The `PercentageWithCapProof` type as a `Pod`.
|
|
586
|
+
*/
|
|
587
|
+
export class PodPercentageWithCapProof {
|
|
588
|
+
private constructor();
|
|
589
|
+
free(): void;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* The `PubkeyValidityProof` type as a `Pod`.
|
|
593
|
+
*/
|
|
594
|
+
export class PodPubkeyValidityProof {
|
|
595
|
+
private constructor();
|
|
596
|
+
free(): void;
|
|
597
|
+
}
|
|
598
|
+
export class PodU64 {
|
|
599
|
+
private constructor();
|
|
600
|
+
free(): void;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* The `ZeroCiphertextProof` type as a `Pod`.
|
|
604
|
+
*/
|
|
605
|
+
export class PodZeroCiphertextProof {
|
|
606
|
+
private constructor();
|
|
607
|
+
free(): void;
|
|
115
608
|
}
|
|
116
609
|
/**
|
|
117
610
|
* The address of a [Solana account][acc].
|
|
@@ -135,43 +628,30 @@ export class Pubkey {
|
|
|
135
628
|
* Create a new Pubkey object
|
|
136
629
|
*
|
|
137
630
|
* * `value` - optional public key as a base58 encoded string, `Uint8Array`, `[number]`
|
|
138
|
-
* @param {any} value
|
|
139
631
|
*/
|
|
140
632
|
constructor(value: any);
|
|
141
633
|
/**
|
|
142
634
|
* Return the base58 string representation of the public key
|
|
143
|
-
* @returns {string}
|
|
144
635
|
*/
|
|
145
636
|
toString(): string;
|
|
146
637
|
/**
|
|
147
638
|
* Check if a `Pubkey` is on the ed25519 curve.
|
|
148
|
-
* @returns {boolean}
|
|
149
639
|
*/
|
|
150
640
|
isOnCurve(): boolean;
|
|
151
641
|
/**
|
|
152
642
|
* Checks if two `Pubkey`s are equal
|
|
153
|
-
* @param {Pubkey} other
|
|
154
|
-
* @returns {boolean}
|
|
155
643
|
*/
|
|
156
644
|
equals(other: Pubkey): boolean;
|
|
157
645
|
/**
|
|
158
646
|
* Return the `Uint8Array` representation of the public key
|
|
159
|
-
* @returns {Uint8Array}
|
|
160
647
|
*/
|
|
161
648
|
toBytes(): Uint8Array;
|
|
162
649
|
/**
|
|
163
650
|
* Derive a Pubkey from another Pubkey, string seed, and a program id
|
|
164
|
-
* @param {Pubkey} base
|
|
165
|
-
* @param {string} seed
|
|
166
|
-
* @param {Pubkey} owner
|
|
167
|
-
* @returns {Pubkey}
|
|
168
651
|
*/
|
|
169
652
|
static createWithSeed(base: Pubkey, seed: string, owner: Pubkey): Pubkey;
|
|
170
653
|
/**
|
|
171
654
|
* Derive a program address from seeds and a program id
|
|
172
|
-
* @param {any[]} seeds
|
|
173
|
-
* @param {Pubkey} program_id
|
|
174
|
-
* @returns {Pubkey}
|
|
175
655
|
*/
|
|
176
656
|
static createProgramAddress(seeds: any[], program_id: Pubkey): Pubkey;
|
|
177
657
|
/**
|
|
@@ -179,12 +659,53 @@ export class Pubkey {
|
|
|
179
659
|
*
|
|
180
660
|
* Returns:
|
|
181
661
|
* * `[PubKey, number]` - the program address and bump seed
|
|
182
|
-
* @param {any[]} seeds
|
|
183
|
-
* @param {Pubkey} program_id
|
|
184
|
-
* @returns {any}
|
|
185
662
|
*/
|
|
186
663
|
static findProgramAddress(seeds: any[], program_id: Pubkey): any;
|
|
187
664
|
}
|
|
665
|
+
/**
|
|
666
|
+
* Public-key proof.
|
|
667
|
+
*
|
|
668
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
669
|
+
*/
|
|
670
|
+
export class PubkeyValidityProof {
|
|
671
|
+
private constructor();
|
|
672
|
+
free(): void;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* The context data needed to verify a pubkey validity proof.
|
|
676
|
+
*/
|
|
677
|
+
export class PubkeyValidityProofContext {
|
|
678
|
+
private constructor();
|
|
679
|
+
free(): void;
|
|
680
|
+
toBytes(): Uint8Array;
|
|
681
|
+
static fromBytes(bytes: Uint8Array): PubkeyValidityProofContext;
|
|
682
|
+
/**
|
|
683
|
+
* The public key to be proved
|
|
684
|
+
*/
|
|
685
|
+
pubkey: PodElGamalPubkey;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* The instruction data that is needed for the `ProofInstruction::VerifyPubkeyValidity`
|
|
689
|
+
* instruction.
|
|
690
|
+
*
|
|
691
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
692
|
+
* the proof.
|
|
693
|
+
*/
|
|
694
|
+
export class PubkeyValidityProofData {
|
|
695
|
+
private constructor();
|
|
696
|
+
free(): void;
|
|
697
|
+
static new(keypair: ElGamalKeypair): PubkeyValidityProofData;
|
|
698
|
+
toBytes(): Uint8Array;
|
|
699
|
+
static fromBytes(bytes: Uint8Array): PubkeyValidityProofData;
|
|
700
|
+
/**
|
|
701
|
+
* The context data for the public key validity proof
|
|
702
|
+
*/
|
|
703
|
+
context: PubkeyValidityProofContext;
|
|
704
|
+
/**
|
|
705
|
+
* Proof that the public key is well-formed
|
|
706
|
+
*/
|
|
707
|
+
proof: PodPubkeyValidityProof;
|
|
708
|
+
}
|
|
188
709
|
/**
|
|
189
710
|
* wasm-bindgen version of the Transaction struct.
|
|
190
711
|
* This duplication is required until https://github.com/rustwasm/wasm-bindgen/issues/3671
|
|
@@ -194,40 +715,69 @@ export class Transaction {
|
|
|
194
715
|
free(): void;
|
|
195
716
|
/**
|
|
196
717
|
* Create a new `Transaction`
|
|
197
|
-
* @param {Instructions} instructions
|
|
198
|
-
* @param {Pubkey | undefined} [payer]
|
|
199
718
|
*/
|
|
200
|
-
constructor(instructions: Instructions, payer?: Pubkey);
|
|
719
|
+
constructor(instructions: Instructions, payer?: Pubkey | null);
|
|
201
720
|
/**
|
|
202
721
|
* Return a message containing all data that should be signed.
|
|
203
|
-
* @returns {Message}
|
|
204
722
|
*/
|
|
205
723
|
message(): Message;
|
|
206
724
|
/**
|
|
207
725
|
* Return the serialized message data to sign.
|
|
208
|
-
* @returns {Uint8Array}
|
|
209
726
|
*/
|
|
210
727
|
messageData(): Uint8Array;
|
|
211
728
|
/**
|
|
212
729
|
* Verify the transaction
|
|
213
730
|
*/
|
|
214
731
|
verify(): void;
|
|
215
|
-
/**
|
|
216
|
-
* @param {Keypair} keypair
|
|
217
|
-
* @param {Hash} recent_blockhash
|
|
218
|
-
*/
|
|
219
732
|
partialSign(keypair: Keypair, recent_blockhash: Hash): void;
|
|
733
|
+
isSigned(): boolean;
|
|
734
|
+
toBytes(): Uint8Array;
|
|
735
|
+
static fromBytes(bytes: Uint8Array): Transaction;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Zero-ciphertext proof.
|
|
739
|
+
*
|
|
740
|
+
* Contains all the elliptic curve and scalar components that make up the sigma protocol.
|
|
741
|
+
*/
|
|
742
|
+
export class ZeroCiphertextProof {
|
|
743
|
+
private constructor();
|
|
744
|
+
free(): void;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* The context data needed to verify a zero-ciphertext proof.
|
|
748
|
+
*/
|
|
749
|
+
export class ZeroCiphertextProofContext {
|
|
750
|
+
private constructor();
|
|
751
|
+
free(): void;
|
|
752
|
+
toBytes(): Uint8Array;
|
|
753
|
+
static fromBytes(bytes: Uint8Array): ZeroCiphertextProofContext;
|
|
220
754
|
/**
|
|
221
|
-
*
|
|
755
|
+
* The ElGamal pubkey associated with the ElGamal ciphertext
|
|
222
756
|
*/
|
|
223
|
-
|
|
757
|
+
pubkey: PodElGamalPubkey;
|
|
224
758
|
/**
|
|
225
|
-
*
|
|
759
|
+
* The ElGamal ciphertext that encrypts zero
|
|
226
760
|
*/
|
|
761
|
+
ciphertext: PodElGamalCiphertext;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* The instruction data that is needed for the `ProofInstruction::ZeroCiphertext` instruction.
|
|
765
|
+
*
|
|
766
|
+
* It includes the cryptographic proof as well as the context data information needed to verify
|
|
767
|
+
* the proof.
|
|
768
|
+
*/
|
|
769
|
+
export class ZeroCiphertextProofData {
|
|
770
|
+
private constructor();
|
|
771
|
+
free(): void;
|
|
772
|
+
static new(keypair: ElGamalKeypair, ciphertext: ElGamalCiphertext): ZeroCiphertextProofData;
|
|
227
773
|
toBytes(): Uint8Array;
|
|
774
|
+
static fromBytes(bytes: Uint8Array): ZeroCiphertextProofData;
|
|
228
775
|
/**
|
|
229
|
-
*
|
|
230
|
-
* @returns {Transaction}
|
|
776
|
+
* The context data for the zero-ciphertext proof
|
|
231
777
|
*/
|
|
232
|
-
|
|
778
|
+
context: ZeroCiphertextProofContext;
|
|
779
|
+
/**
|
|
780
|
+
* Proof that the ciphertext is zero
|
|
781
|
+
*/
|
|
782
|
+
proof: PodZeroCiphertextProof;
|
|
233
783
|
}
|