@provablehq/sdk 0.6.13 → 0.7.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/README.md +16 -16
- package/dist/{account.d.ts → mainnet/account.d.ts} +3 -3
- package/dist/{index.d.ts → mainnet/browser.d.ts} +5 -4
- package/dist/mainnet/browser.js +3127 -0
- package/dist/mainnet/browser.js.map +1 -0
- package/dist/{function-key-provider.d.ts → mainnet/function-key-provider.d.ts} +57 -57
- package/dist/{network-client.d.ts → mainnet/network-client.d.ts} +26 -26
- package/dist/{node-polyfill.d.ts → mainnet/node-polyfill.d.ts} +1 -0
- package/dist/{node-polyfill.js → mainnet/node-polyfill.js} +1 -0
- package/dist/mainnet/node-polyfill.js.map +1 -0
- package/dist/mainnet/node.d.ts +2 -0
- package/dist/{node.js → mainnet/node.js} +3 -2
- package/dist/{node.js.map → mainnet/node.js.map} +1 -1
- package/dist/{offline-key-provider.d.ts → mainnet/offline-key-provider.d.ts} +22 -22
- package/dist/mainnet/polyfill/shared.d.ts +1 -0
- package/dist/{program-manager.d.ts → mainnet/program-manager.d.ts} +59 -59
- package/dist/{record-provider.d.ts → mainnet/record-provider.d.ts} +22 -22
- package/dist/{utils.d.ts → mainnet/utils.d.ts} +1 -0
- package/dist/{worker.d.ts → mainnet/worker.d.ts} +2 -1
- package/dist/mainnet/worker.js +78 -0
- package/dist/mainnet/worker.js.map +1 -0
- package/dist/testnet/account.d.ts +137 -0
- package/dist/testnet/browser.d.ts +53 -0
- package/dist/{index.js → testnet/browser.js} +197 -186
- package/dist/testnet/browser.js.map +1 -0
- package/dist/testnet/function-key-provider.d.ts +348 -0
- package/dist/testnet/managed-worker.d.ts +3 -0
- package/dist/testnet/models/block.d.ts +21 -0
- package/dist/testnet/models/confirmed_transaction.d.ts +6 -0
- package/dist/testnet/models/execution.d.ts +5 -0
- package/dist/testnet/models/input.d.ts +10 -0
- package/dist/testnet/models/output.d.ts +6 -0
- package/dist/testnet/models/transactionModel.d.ts +6 -0
- package/dist/testnet/models/transition.d.ts +13 -0
- package/dist/testnet/network-client.d.ts +267 -0
- package/dist/testnet/node-polyfill.d.ts +5 -0
- package/dist/testnet/node-polyfill.js +303 -0
- package/dist/testnet/node-polyfill.js.map +1 -0
- package/dist/testnet/node.d.ts +2 -0
- package/dist/testnet/node.js +12 -0
- package/dist/testnet/node.js.map +1 -0
- package/dist/testnet/offline-key-provider.d.ts +347 -0
- package/dist/testnet/polyfill/crypto.d.ts +1 -0
- package/dist/testnet/polyfill/fetch.d.ts +1 -0
- package/dist/testnet/polyfill/shared.d.ts +1 -0
- package/dist/testnet/polyfill/worker.d.ts +1 -0
- package/dist/testnet/polyfill/xmlhttprequest.d.ts +1 -0
- package/dist/testnet/program-manager.d.ts +636 -0
- package/dist/testnet/record-provider.d.ts +236 -0
- package/dist/testnet/utils.d.ts +3 -0
- package/dist/testnet/worker.d.ts +9 -0
- package/dist/testnet/worker.js +78 -0
- package/dist/testnet/worker.js.map +1 -0
- package/package.json +23 -13
- package/dist/index.js.map +0 -1
- package/dist/node-polyfill.js.map +0 -1
- package/dist/node.d.ts +0 -2
- package/dist/worker.js +0 -74
- package/dist/worker.js.map +0 -1
- /package/dist/{managed-worker.d.ts → mainnet/managed-worker.d.ts} +0 -0
- /package/dist/{models → mainnet/models}/block.d.ts +0 -0
- /package/dist/{models → mainnet/models}/confirmed_transaction.d.ts +0 -0
- /package/dist/{models → mainnet/models}/execution.d.ts +0 -0
- /package/dist/{models → mainnet/models}/input.d.ts +0 -0
- /package/dist/{models → mainnet/models}/output.d.ts +0 -0
- /package/dist/{models → mainnet/models}/transactionModel.d.ts +0 -0
- /package/dist/{models → mainnet/models}/transition.d.ts +0 -0
- /package/dist/{polyfill → mainnet/polyfill}/crypto.d.ts +0 -0
- /package/dist/{polyfill → mainnet/polyfill}/fetch.d.ts +0 -0
- /package/dist/{polyfill → mainnet/polyfill}/worker.d.ts +0 -0
- /package/dist/{polyfill → mainnet/polyfill}/xmlhttprequest.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProvingKey, VerifyingKey, Key } from "./
|
|
1
|
+
import { ProvingKey, VerifyingKey, Key } from "./browser";
|
|
2
2
|
type FunctionKeyPair = [ProvingKey, VerifyingKey];
|
|
3
3
|
type CachedKeyPair = [Uint8Array, Uint8Array];
|
|
4
4
|
type AleoKeyProviderInitParams = {
|
|
@@ -44,15 +44,15 @@ interface FunctionKeyProvider {
|
|
|
44
44
|
/**
|
|
45
45
|
* Get bond_public function keys from the credits.aleo program
|
|
46
46
|
*
|
|
47
|
-
* @returns {Promise<FunctionKeyPair
|
|
47
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the bond_public function
|
|
48
48
|
*/
|
|
49
|
-
bondPublicKeys(): Promise<FunctionKeyPair
|
|
49
|
+
bondPublicKeys(): Promise<FunctionKeyPair>;
|
|
50
50
|
/**
|
|
51
51
|
* Get bond_validator function keys from the credits.aleo program
|
|
52
52
|
*
|
|
53
|
-
* @returns {Promise<FunctionKeyPair
|
|
53
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the bond_validator function
|
|
54
54
|
*/
|
|
55
|
-
bondValidatorKeys(): Promise<FunctionKeyPair
|
|
55
|
+
bondValidatorKeys(): Promise<FunctionKeyPair>;
|
|
56
56
|
/**
|
|
57
57
|
* Cache a set of keys. This will overwrite any existing keys with the same keyId. The user can check if a keyId
|
|
58
58
|
* exists in the cache using the containsKeys method prior to calling this method if overwriting is not desired.
|
|
@@ -64,14 +64,14 @@ interface FunctionKeyProvider {
|
|
|
64
64
|
/**
|
|
65
65
|
* Get unbond_public function keys from the credits.aleo program
|
|
66
66
|
*
|
|
67
|
-
* @returns {Promise<FunctionKeyPair
|
|
67
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the unbond_public function
|
|
68
68
|
*/
|
|
69
|
-
claimUnbondPublicKeys(): Promise<FunctionKeyPair
|
|
69
|
+
claimUnbondPublicKeys(): Promise<FunctionKeyPair>;
|
|
70
70
|
/**
|
|
71
71
|
* Get arbitrary function keys from a provider
|
|
72
72
|
*
|
|
73
73
|
* @param {KeySearchParams | undefined} params - Optional search parameters for the key provider
|
|
74
|
-
* @returns {Promise<FunctionKeyPair
|
|
74
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the specified program
|
|
75
75
|
*
|
|
76
76
|
* @example
|
|
77
77
|
* // Create a search object which implements the KeySearchParams interface
|
|
@@ -86,7 +86,7 @@ interface FunctionKeyProvider {
|
|
|
86
86
|
*
|
|
87
87
|
* // Create a new object which implements the KeyProvider interface
|
|
88
88
|
* class IndexDbKeyProvider implements FunctionKeyProvider {
|
|
89
|
-
* async functionKeys(params: KeySearchParams): Promise<FunctionKeyPair
|
|
89
|
+
* async functionKeys(params: KeySearchParams): Promise<FunctionKeyPair> {
|
|
90
90
|
* return new Promise((resolve, reject) => {
|
|
91
91
|
* const request = indexedDB.open(params.db, 1);
|
|
92
92
|
*
|
|
@@ -121,68 +121,68 @@ interface FunctionKeyProvider {
|
|
|
121
121
|
*
|
|
122
122
|
*
|
|
123
123
|
* const keyProvider = new AleoKeyProvider();
|
|
124
|
-
* const networkClient = new AleoNetworkClient("https://api.explorer.
|
|
124
|
+
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
|
|
125
125
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
126
126
|
*
|
|
127
127
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
128
|
-
* const programManager = new ProgramManager("https://api.explorer.
|
|
128
|
+
* const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
|
|
129
129
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
130
130
|
*
|
|
131
131
|
* // Keys can also be fetched manually
|
|
132
132
|
* const searchParams = new IndexDbSearch({db: "keys", keyId: "credits.aleo:transferPrivate"});
|
|
133
133
|
* const [transferPrivateProvingKey, transferPrivateVerifyingKey] = await keyProvider.functionKeys(searchParams);
|
|
134
134
|
*/
|
|
135
|
-
functionKeys(params?: KeySearchParams): Promise<FunctionKeyPair
|
|
135
|
+
functionKeys(params?: KeySearchParams): Promise<FunctionKeyPair>;
|
|
136
136
|
/**
|
|
137
137
|
* Get fee_private function keys from the credits.aleo program
|
|
138
138
|
*
|
|
139
|
-
* @returns {Promise<FunctionKeyPair
|
|
139
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
140
140
|
*/
|
|
141
|
-
feePrivateKeys(): Promise<FunctionKeyPair
|
|
141
|
+
feePrivateKeys(): Promise<FunctionKeyPair>;
|
|
142
142
|
/**
|
|
143
143
|
* Get fee_public function keys from the credits.aleo program
|
|
144
144
|
*
|
|
145
|
-
* @returns {Promise<FunctionKeyPair
|
|
145
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
146
146
|
*/
|
|
147
|
-
feePublicKeys(): Promise<FunctionKeyPair
|
|
147
|
+
feePublicKeys(): Promise<FunctionKeyPair>;
|
|
148
148
|
/**
|
|
149
149
|
* Get join function keys from the credits.aleo program
|
|
150
150
|
*
|
|
151
|
-
* @returns {Promise<FunctionKeyPair
|
|
151
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
152
152
|
*/
|
|
153
|
-
joinKeys(): Promise<FunctionKeyPair
|
|
153
|
+
joinKeys(): Promise<FunctionKeyPair>;
|
|
154
154
|
/**
|
|
155
155
|
* Get split function keys from the credits.aleo program
|
|
156
156
|
*
|
|
157
|
-
* @returns {Promise<FunctionKeyPair
|
|
157
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
158
158
|
*/
|
|
159
|
-
splitKeys(): Promise<FunctionKeyPair
|
|
159
|
+
splitKeys(): Promise<FunctionKeyPair>;
|
|
160
160
|
/**
|
|
161
161
|
* Get keys for a variant of the transfer function from the credits.aleo program
|
|
162
162
|
*
|
|
163
163
|
* @param {string} visibility Visibility of the transfer function (private, public, privateToPublic, publicToPrivate)
|
|
164
|
-
* @returns {Promise<FunctionKeyPair
|
|
164
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the specified transfer function
|
|
165
165
|
*
|
|
166
166
|
* @example
|
|
167
167
|
* // Create a new object which implements the KeyProvider interface
|
|
168
|
-
* const networkClient = new AleoNetworkClient("https://api.explorer.
|
|
168
|
+
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
|
|
169
169
|
* const keyProvider = new AleoKeyProvider();
|
|
170
170
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
171
171
|
*
|
|
172
172
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
173
|
-
* const programManager = new ProgramManager("https://api.explorer.
|
|
173
|
+
* const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
|
|
174
174
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
175
175
|
*
|
|
176
176
|
* // Keys can also be fetched manually
|
|
177
177
|
* const [transferPublicProvingKey, transferPublicVerifyingKey] = await keyProvider.transferKeys("public");
|
|
178
178
|
*/
|
|
179
|
-
transferKeys(visibility: string): Promise<FunctionKeyPair
|
|
179
|
+
transferKeys(visibility: string): Promise<FunctionKeyPair>;
|
|
180
180
|
/**
|
|
181
181
|
* Get unbond_public function keys from the credits.aleo program
|
|
182
182
|
*
|
|
183
|
-
* @returns {Promise<FunctionKeyPair
|
|
183
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
184
184
|
*/
|
|
185
|
-
unBondPublicKeys(): Promise<FunctionKeyPair
|
|
185
|
+
unBondPublicKeys(): Promise<FunctionKeyPair>;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
188
|
* AleoKeyProvider class. Implements the KeyProvider interface. Enables the retrieval of Aleo program proving and
|
|
@@ -231,30 +231,30 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
231
231
|
* Get a set of keys from the cache
|
|
232
232
|
* @param keyId keyId of a proving and verifying key pair
|
|
233
233
|
*
|
|
234
|
-
* @returns {FunctionKeyPair
|
|
234
|
+
* @returns {FunctionKeyPair} Proving and verifying keys for the specified program
|
|
235
235
|
*/
|
|
236
|
-
getKeys(keyId: string): FunctionKeyPair
|
|
236
|
+
getKeys(keyId: string): FunctionKeyPair;
|
|
237
237
|
/**
|
|
238
238
|
* Get arbitrary function keys from a provider
|
|
239
239
|
*
|
|
240
240
|
* @param {KeySearchParams} params parameters for the key search in form of: {proverUri: string, verifierUri: string, cacheKey: string}
|
|
241
|
-
* @returns {Promise<FunctionKeyPair
|
|
241
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the specified program
|
|
242
242
|
*
|
|
243
243
|
* @example
|
|
244
244
|
* // Create a new object which implements the KeyProvider interface
|
|
245
|
-
* const networkClient = new AleoNetworkClient("https://api.explorer.
|
|
245
|
+
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
|
|
246
246
|
* const keyProvider = new AleoKeyProvider();
|
|
247
247
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
248
248
|
*
|
|
249
249
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
250
|
-
* const programManager = new ProgramManager("https://api.explorer.
|
|
250
|
+
* const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
|
|
251
251
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
252
252
|
*
|
|
253
253
|
* // Keys can also be fetched manually using the key provider
|
|
254
254
|
* const keySearchParams = { "cacheKey": "myProgram:myFunction" };
|
|
255
255
|
* const [transferPrivateProvingKey, transferPrivateVerifyingKey] = await keyProvider.functionKeys(keySearchParams);
|
|
256
256
|
*/
|
|
257
|
-
functionKeys(params?: KeySearchParams): Promise<FunctionKeyPair
|
|
257
|
+
functionKeys(params?: KeySearchParams): Promise<FunctionKeyPair>;
|
|
258
258
|
/**
|
|
259
259
|
* Returns the proving and verifying keys for a specified program from a specified url.
|
|
260
260
|
*
|
|
@@ -262,16 +262,16 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
262
262
|
* @param {string} proverUrl Url the verifying key
|
|
263
263
|
* @param {string} cacheKey Key to store the keys in the cache
|
|
264
264
|
*
|
|
265
|
-
* @returns {Promise<FunctionKeyPair
|
|
265
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the specified program
|
|
266
266
|
*
|
|
267
267
|
* @example
|
|
268
268
|
* // Create a new AleoKeyProvider object
|
|
269
|
-
* const networkClient = new AleoNetworkClient("https://api.explorer.
|
|
269
|
+
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
|
|
270
270
|
* const keyProvider = new AleoKeyProvider();
|
|
271
271
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
272
272
|
*
|
|
273
273
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
274
|
-
* const programManager = new ProgramManager("https://api.explorer.
|
|
274
|
+
* const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
|
|
275
275
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
276
276
|
*
|
|
277
277
|
* // Keys can also be fetched manually
|
|
@@ -280,69 +280,69 @@ declare class AleoKeyProvider implements FunctionKeyProvider {
|
|
|
280
280
|
* CREDITS_PROGRAM_KEYS.transfer_private.verifier,
|
|
281
281
|
* );
|
|
282
282
|
*/
|
|
283
|
-
fetchRemoteKeys(proverUrl: string, verifierUrl: string, cacheKey?: string): Promise<FunctionKeyPair
|
|
283
|
+
fetchRemoteKeys(proverUrl: string, verifierUrl: string, cacheKey?: string): Promise<FunctionKeyPair>;
|
|
284
284
|
/***
|
|
285
285
|
* Fetches the proving key from a remote source.
|
|
286
286
|
*
|
|
287
287
|
* @param proverUrl
|
|
288
288
|
* @param cacheKey
|
|
289
289
|
*
|
|
290
|
-
* @returns {Promise<ProvingKey
|
|
290
|
+
* @returns {Promise<ProvingKey>} Proving key for the specified program
|
|
291
291
|
*/
|
|
292
|
-
fetchProvingKey(proverUrl: string, cacheKey?: string): Promise<ProvingKey
|
|
293
|
-
fetchCreditsKeys(key: Key): Promise<FunctionKeyPair
|
|
294
|
-
bondPublicKeys(): Promise<FunctionKeyPair
|
|
295
|
-
bondValidatorKeys(): Promise<FunctionKeyPair
|
|
296
|
-
claimUnbondPublicKeys(): Promise<FunctionKeyPair
|
|
292
|
+
fetchProvingKey(proverUrl: string, cacheKey?: string): Promise<ProvingKey>;
|
|
293
|
+
fetchCreditsKeys(key: Key): Promise<FunctionKeyPair>;
|
|
294
|
+
bondPublicKeys(): Promise<FunctionKeyPair>;
|
|
295
|
+
bondValidatorKeys(): Promise<FunctionKeyPair>;
|
|
296
|
+
claimUnbondPublicKeys(): Promise<FunctionKeyPair>;
|
|
297
297
|
/**
|
|
298
298
|
* Returns the proving and verifying keys for the transfer functions in the credits.aleo program
|
|
299
299
|
* @param {string} visibility Visibility of the transfer function
|
|
300
|
-
* @returns {Promise<FunctionKeyPair
|
|
300
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the transfer functions
|
|
301
301
|
*
|
|
302
302
|
* @example
|
|
303
303
|
* // Create a new AleoKeyProvider
|
|
304
|
-
* const networkClient = new AleoNetworkClient("https://api.explorer.
|
|
304
|
+
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
|
|
305
305
|
* const keyProvider = new AleoKeyProvider();
|
|
306
306
|
* const recordProvider = new NetworkRecordProvider(account, networkClient);
|
|
307
307
|
*
|
|
308
308
|
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
|
|
309
|
-
* const programManager = new ProgramManager("https://api.explorer.
|
|
309
|
+
* const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
|
|
310
310
|
* programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwnjvggqcad0at", "public", 0.5);
|
|
311
311
|
*
|
|
312
312
|
* // Keys can also be fetched manually
|
|
313
313
|
* const [transferPublicProvingKey, transferPublicVerifyingKey] = await keyProvider.transferKeys("public");
|
|
314
314
|
*/
|
|
315
|
-
transferKeys(visibility: string): Promise<FunctionKeyPair
|
|
315
|
+
transferKeys(visibility: string): Promise<FunctionKeyPair>;
|
|
316
316
|
/**
|
|
317
317
|
* Returns the proving and verifying keys for the join function in the credits.aleo program
|
|
318
318
|
*
|
|
319
|
-
* @returns {Promise<FunctionKeyPair
|
|
319
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the join function
|
|
320
320
|
*/
|
|
321
|
-
joinKeys(): Promise<FunctionKeyPair
|
|
321
|
+
joinKeys(): Promise<FunctionKeyPair>;
|
|
322
322
|
/**
|
|
323
323
|
* Returns the proving and verifying keys for the split function in the credits.aleo program
|
|
324
324
|
*
|
|
325
|
-
* @returns {Promise<FunctionKeyPair
|
|
325
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the split function
|
|
326
326
|
* */
|
|
327
|
-
splitKeys(): Promise<FunctionKeyPair
|
|
327
|
+
splitKeys(): Promise<FunctionKeyPair>;
|
|
328
328
|
/**
|
|
329
329
|
* Returns the proving and verifying keys for the fee_private function in the credits.aleo program
|
|
330
330
|
*
|
|
331
|
-
* @returns {Promise<FunctionKeyPair
|
|
331
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the fee function
|
|
332
332
|
*/
|
|
333
|
-
feePrivateKeys(): Promise<FunctionKeyPair
|
|
333
|
+
feePrivateKeys(): Promise<FunctionKeyPair>;
|
|
334
334
|
/**
|
|
335
335
|
* Returns the proving and verifying keys for the fee_public function in the credits.aleo program
|
|
336
336
|
*
|
|
337
|
-
* @returns {Promise<FunctionKeyPair
|
|
337
|
+
* @returns {Promise<FunctionKeyPair>} Proving and verifying keys for the fee function
|
|
338
338
|
*/
|
|
339
|
-
feePublicKeys(): Promise<FunctionKeyPair
|
|
339
|
+
feePublicKeys(): Promise<FunctionKeyPair>;
|
|
340
340
|
/**
|
|
341
341
|
* Gets a verifying key. If the verifying key is for a credits.aleo function, get it from the wasm cache otherwise
|
|
342
342
|
*
|
|
343
|
-
* @returns {Promise<VerifyingKey
|
|
343
|
+
* @returns {Promise<VerifyingKey>} Verifying key for the function
|
|
344
344
|
*/
|
|
345
|
-
getVerifyingKey(verifierUri: string): Promise<VerifyingKey
|
|
346
|
-
unBondPublicKeys(): Promise<FunctionKeyPair
|
|
345
|
+
getVerifyingKey(verifierUri: string): Promise<VerifyingKey>;
|
|
346
|
+
unBondPublicKeys(): Promise<FunctionKeyPair>;
|
|
347
347
|
}
|
|
348
348
|
export { AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, CachedKeyPair, FunctionKeyPair, FunctionKeyProvider, KeySearchParams };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, Block, Program, RecordPlaintext, PrivateKey, Transaction, TransactionModel } from "./
|
|
1
|
+
import { Account, Block, Program, RecordPlaintext, PrivateKey, Transaction, TransactionModel } from "./browser";
|
|
2
2
|
type ProgramImports = {
|
|
3
3
|
[key: string]: string | Program;
|
|
4
4
|
};
|
|
@@ -17,7 +17,7 @@ interface AleoNetworkClientOptions {
|
|
|
17
17
|
* const localNetworkClient = new AleoNetworkClient("http://localhost:3030");
|
|
18
18
|
*
|
|
19
19
|
* // Connection to a public beacon node
|
|
20
|
-
* const publicnetworkClient = new AleoNetworkClient("https://api.explorer.
|
|
20
|
+
* const publicnetworkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
|
|
21
21
|
*/
|
|
22
22
|
declare class AleoNetworkClient {
|
|
23
23
|
host: string;
|
|
@@ -73,7 +73,7 @@ declare class AleoNetworkClient {
|
|
|
73
73
|
* const maxMicrocredits = 100000;
|
|
74
74
|
* const records = networkClient.findUnspentRecords(startHeight, undefined, privateKey, undefined, maxMicrocredits);
|
|
75
75
|
*/
|
|
76
|
-
findUnspentRecords(startHeight: number, endHeight: number | undefined, privateKey: string | PrivateKey | undefined, amounts: number[] | undefined, maxMicrocredits?: number | undefined, nonces?: string[] | undefined): Promise<Array<RecordPlaintext
|
|
76
|
+
findUnspentRecords(startHeight: number, endHeight: number | undefined, privateKey: string | PrivateKey | undefined, amounts: number[] | undefined, maxMicrocredits?: number | undefined, nonces?: string[] | undefined): Promise<Array<RecordPlaintext>>;
|
|
77
77
|
/**
|
|
78
78
|
* Returns the contents of the block at the specified block height
|
|
79
79
|
*
|
|
@@ -81,7 +81,7 @@ declare class AleoNetworkClient {
|
|
|
81
81
|
* @example
|
|
82
82
|
* const block = networkClient.getBlock(1234);
|
|
83
83
|
*/
|
|
84
|
-
getBlock(height: number): Promise<Block
|
|
84
|
+
getBlock(height: number): Promise<Block>;
|
|
85
85
|
/**
|
|
86
86
|
* Returns a range of blocks between the specified block heights
|
|
87
87
|
*
|
|
@@ -90,41 +90,41 @@ declare class AleoNetworkClient {
|
|
|
90
90
|
* @example
|
|
91
91
|
* const blockRange = networkClient.getBlockRange(2050, 2100);
|
|
92
92
|
*/
|
|
93
|
-
getBlockRange(start: number, end: number): Promise<Array<Block
|
|
93
|
+
getBlockRange(start: number, end: number): Promise<Array<Block>>;
|
|
94
94
|
/**
|
|
95
95
|
* Returns the deployment transaction id associated with the specified program
|
|
96
96
|
*
|
|
97
97
|
* @param {Program | string} program
|
|
98
|
-
* @returns {TransactionModel
|
|
98
|
+
* @returns {TransactionModel}
|
|
99
99
|
*/
|
|
100
|
-
getDeploymentTransactionIDForProgram(program: Program | string): Promise<string
|
|
100
|
+
getDeploymentTransactionIDForProgram(program: Program | string): Promise<string>;
|
|
101
101
|
/**
|
|
102
102
|
* Returns the deployment transaction associated with a specified program
|
|
103
103
|
*
|
|
104
104
|
* @param {Program | string} program
|
|
105
|
-
* @returns {TransactionModel
|
|
105
|
+
* @returns {TransactionModel}
|
|
106
106
|
*/
|
|
107
|
-
getDeploymentTransactionForProgram(program: Program | string): Promise<TransactionModel
|
|
107
|
+
getDeploymentTransactionForProgram(program: Program | string): Promise<TransactionModel>;
|
|
108
108
|
/**
|
|
109
109
|
* Returns the contents of the latest block
|
|
110
110
|
*
|
|
111
111
|
* @example
|
|
112
112
|
* const latestHeight = networkClient.getLatestBlock();
|
|
113
113
|
*/
|
|
114
|
-
getLatestBlock(): Promise<Block
|
|
114
|
+
getLatestBlock(): Promise<Block>;
|
|
115
115
|
/**
|
|
116
116
|
* Returns the latest committee
|
|
117
117
|
*
|
|
118
118
|
* @returns {Promise<object>} A javascript object containing the latest committee
|
|
119
119
|
*/
|
|
120
|
-
getLatestCommittee(): Promise<object
|
|
120
|
+
getLatestCommittee(): Promise<object>;
|
|
121
121
|
/**
|
|
122
122
|
* Returns the latest block height
|
|
123
123
|
*
|
|
124
124
|
* @example
|
|
125
125
|
* const latestHeight = networkClient.getLatestHeight();
|
|
126
126
|
*/
|
|
127
|
-
getLatestHeight(): Promise<number
|
|
127
|
+
getLatestHeight(): Promise<number>;
|
|
128
128
|
/**
|
|
129
129
|
* Returns the source code of a program given a program ID
|
|
130
130
|
*
|
|
@@ -136,12 +136,12 @@ declare class AleoNetworkClient {
|
|
|
136
136
|
* const expectedSource = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u32.public;\n input r1 as u32.private;\n add r0 r1 into r2;\n output r2 as u32.private;\n"
|
|
137
137
|
* assert.equal(program, expectedSource);
|
|
138
138
|
*/
|
|
139
|
-
getProgram(programId: string): Promise<string
|
|
139
|
+
getProgram(programId: string): Promise<string>;
|
|
140
140
|
/**
|
|
141
141
|
* Returns a program object from a program ID or program source code
|
|
142
142
|
*
|
|
143
143
|
* @param {string} inputProgram The program ID or program source code of a program deployed to the Aleo Network
|
|
144
|
-
* @return {Promise<Program
|
|
144
|
+
* @return {Promise<Program>} Source code of the program
|
|
145
145
|
*
|
|
146
146
|
* @example
|
|
147
147
|
* const programID = "hello_hello.aleo";
|
|
@@ -154,7 +154,7 @@ declare class AleoNetworkClient {
|
|
|
154
154
|
* // Both program objects should be equal
|
|
155
155
|
* assert.equal(programObjectFromID.to_string(), programObjectFromSource.to_string());
|
|
156
156
|
*/
|
|
157
|
-
getProgramObject(inputProgram: string): Promise<Program
|
|
157
|
+
getProgramObject(inputProgram: string): Promise<Program>;
|
|
158
158
|
/**
|
|
159
159
|
* Returns an object containing the source code of a program and the source code of all programs it imports
|
|
160
160
|
*
|
|
@@ -180,7 +180,7 @@ declare class AleoNetworkClient {
|
|
|
180
180
|
* programImports = await networkClient.getProgramImports(double_test);
|
|
181
181
|
* assert.deepStrictEqual(programImports, expectedImports);
|
|
182
182
|
*/
|
|
183
|
-
getProgramImports(inputProgram: Program | string): Promise<ProgramImports
|
|
183
|
+
getProgramImports(inputProgram: Program | string): Promise<ProgramImports>;
|
|
184
184
|
/**
|
|
185
185
|
* Get a list of the program names that a program imports
|
|
186
186
|
*
|
|
@@ -192,7 +192,7 @@ declare class AleoNetworkClient {
|
|
|
192
192
|
* const expectedImportsNames = ["multiply_test.aleo"];
|
|
193
193
|
* assert.deepStrictEqual(programImportsNames, expectedImportsNames);
|
|
194
194
|
*/
|
|
195
|
-
getProgramImportNames(inputProgram: Program | string): Promise<string[]
|
|
195
|
+
getProgramImportNames(inputProgram: Program | string): Promise<string[]>;
|
|
196
196
|
/**
|
|
197
197
|
* Returns the names of the mappings of a program
|
|
198
198
|
*
|
|
@@ -202,7 +202,7 @@ declare class AleoNetworkClient {
|
|
|
202
202
|
* const expectedMappings = ["account"];
|
|
203
203
|
* assert.deepStrictEqual(mappings, expectedMappings);
|
|
204
204
|
*/
|
|
205
|
-
getProgramMappingNames(programId: string): Promise<Array<string
|
|
205
|
+
getProgramMappingNames(programId: string): Promise<Array<string>>;
|
|
206
206
|
/**
|
|
207
207
|
* Returns the value of a program's mapping for a specific key
|
|
208
208
|
*
|
|
@@ -217,14 +217,14 @@ declare class AleoNetworkClient {
|
|
|
217
217
|
* const expectedValue = "0u64";
|
|
218
218
|
* assert.equal(mappingValue, expectedValue);
|
|
219
219
|
*/
|
|
220
|
-
getProgramMappingValue(programId: string, mappingName: string, key: string): Promise<string
|
|
220
|
+
getProgramMappingValue(programId: string, mappingName: string, key: string): Promise<string>;
|
|
221
221
|
/**
|
|
222
222
|
* Returns the latest state/merkle root of the Aleo blockchain
|
|
223
223
|
*
|
|
224
224
|
* @example
|
|
225
225
|
* const stateRoot = networkClient.getStateRoot();
|
|
226
226
|
*/
|
|
227
|
-
getStateRoot(): Promise<string
|
|
227
|
+
getStateRoot(): Promise<string>;
|
|
228
228
|
/**
|
|
229
229
|
* Returns a transaction by its unique identifier
|
|
230
230
|
*
|
|
@@ -232,7 +232,7 @@ declare class AleoNetworkClient {
|
|
|
232
232
|
* @example
|
|
233
233
|
* const transaction = networkClient.getTransaction("at1handz9xjrqeynjrr0xay4pcsgtnczdksz3e584vfsgaz0dh0lyxq43a4wj");
|
|
234
234
|
*/
|
|
235
|
-
getTransaction(id: string): Promise<TransactionModel
|
|
235
|
+
getTransaction(id: string): Promise<TransactionModel>;
|
|
236
236
|
/**
|
|
237
237
|
* Returns the transactions present at the specified block height
|
|
238
238
|
*
|
|
@@ -240,14 +240,14 @@ declare class AleoNetworkClient {
|
|
|
240
240
|
* @example
|
|
241
241
|
* const transactions = networkClient.getTransactions(654);
|
|
242
242
|
*/
|
|
243
|
-
getTransactions(height: number): Promise<Array<TransactionModel
|
|
243
|
+
getTransactions(height: number): Promise<Array<TransactionModel>>;
|
|
244
244
|
/**
|
|
245
245
|
* Returns the transactions in the memory pool.
|
|
246
246
|
*
|
|
247
247
|
* @example
|
|
248
248
|
* const transactions = networkClient.getTransactionsInMempool();
|
|
249
249
|
*/
|
|
250
|
-
getTransactionsInMempool(): Promise<Array<TransactionModel
|
|
250
|
+
getTransactionsInMempool(): Promise<Array<TransactionModel>>;
|
|
251
251
|
/**
|
|
252
252
|
* Returns the transition ID of the transition corresponding to the ID of the input or output.
|
|
253
253
|
* @param {string} inputOrOutputID - ID of the input or output.
|
|
@@ -255,13 +255,13 @@ declare class AleoNetworkClient {
|
|
|
255
255
|
* @example
|
|
256
256
|
* const transitionId = networkClient.getTransitionId("2429232855236830926144356377868449890830704336664550203176918782554219952323field");
|
|
257
257
|
*/
|
|
258
|
-
getTransitionId(inputOrOutputID: string): Promise<string
|
|
258
|
+
getTransitionId(inputOrOutputID: string): Promise<string>;
|
|
259
259
|
/**
|
|
260
260
|
* Submit an execute or deployment transaction to the Aleo network
|
|
261
261
|
*
|
|
262
262
|
* @param {Transaction | string} transaction - The transaction to submit to the network
|
|
263
|
-
* @returns {string
|
|
263
|
+
* @returns {string} - The transaction id of the submitted transaction or the resulting error
|
|
264
264
|
*/
|
|
265
|
-
submitTransaction(transaction: Transaction | string): Promise<string
|
|
265
|
+
submitTransaction(transaction: Transaction | string): Promise<string>;
|
|
266
266
|
}
|
|
267
267
|
export { AleoNetworkClient, AleoNetworkClientOptions, ProgramImports };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-polyfill.js","sources":["../../src/polyfill/crypto.ts","../../src/polyfill/fetch.ts","../../src/polyfill/xmlhttprequest.ts","../../src/polyfill/worker.ts","../../src/node-polyfill.ts"],"sourcesContent":["import { webcrypto } from \"node:crypto\";\n\nif ((globalThis as any).crypto == null) {\n (globalThis as any).crypto = webcrypto;\n}\n","import * as $fs from \"node:fs\";\nimport $mime from \"mime/lite.js\";\n\n\nconst oldFetch = globalThis.fetch;\n\n// We always polyfill fetch because Node's fetch doesn't support file URLs.\n(globalThis.fetch as any) = async function (resource: URL | RequestInfo, options: RequestInit | undefined): Promise<Response> {\n const request = new Request(resource, options);\n\n const url = new URL(request.url);\n\n if (url.protocol === \"file:\") {\n const readStream = $fs.createReadStream(url);\n\n const headers: HeadersInit = {};\n\n const type = $mime.getType(url.pathname);\n\n if (type) {\n headers[\"Content-Type\"] = type;\n }\n\n return new Response(readStream as any, {\n status: 200,\n statusText: \"OK\",\n headers,\n });\n\n } else {\n return await oldFetch(request);\n }\n};\n","import $request from \"sync-request\";\n\n\nglobalThis.XMLHttpRequest = class extends EventTarget implements XMLHttpRequest {\n public static readonly UNSENT = 0;\n public static readonly OPENED = 1;\n public static readonly HEADERS_RECEIVED = 2;\n public static readonly LOADING = 3;\n public static readonly DONE = 4;\n\n public readonly UNSENT = XMLHttpRequest.UNSENT;\n public readonly OPENED = XMLHttpRequest.OPENED;\n public readonly HEADERS_RECEIVED = XMLHttpRequest.HEADERS_RECEIVED;\n public readonly LOADING = XMLHttpRequest.LOADING;\n public readonly DONE = XMLHttpRequest.DONE;\n\n public responseType!: XMLHttpRequestResponseType;\n public withCredentials!: boolean;\n public timeout!: number;\n\n public readonly readyState!: number;\n public readonly response!: ArrayBuffer | Blob | Document | string | null;\n public readonly responseText!: string;\n public readonly responseURL!: string;\n public readonly responseXML!: Document | null;\n public readonly status!: number;\n public readonly statusText!: string;\n public readonly upload!: XMLHttpRequestUpload;\n\n private _url!: string | URL | null;\n private _mime!: string;\n\n constructor() {\n super();\n\n this._reset();\n\n this._mime = \"text/xml\";\n }\n\n private _reset() {\n (this as any).readyState = XMLHttpRequest.UNSENT;\n (this as any).response = null;\n (this as any).responseText = \"\";\n (this as any).responseType = \"\";\n (this as any).responseURL = \"\";\n (this as any).responseXML = null;\n (this as any).status = 0;\n (this as any).statusText = \"\";\n (this as any).timeout = 0;\n (this as any).upload = null;\n (this as any).withCredentials = false;\n\n this._url = null;\n }\n\n private _success() {\n (this as any).readyState = XMLHttpRequest.DONE;\n (this as any).status = 200;\n (this as any).statusText = \"OK\";\n }\n\n public set onabort(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public set onerror(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public set onreadystatechange(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public set onloadstart(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public set onload(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public set onloadend(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public set onprogress(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public set ontimeout(value: () => void) {\n throw new Error(\"Not implemented\");\n }\n\n public abort() {\n throw new Error(\"Not implemented\");\n }\n\n public overrideMimeType(mime: string) {\n this._mime = mime;\n }\n\n public getResponseHeader(): string | null {\n throw new Error(\"Not implemented\");\n }\n\n public getAllResponseHeaders(): string {\n throw new Error(\"Not implemented\");\n }\n\n public setRequestHeader() {\n throw new Error(\"Not implemented\");\n }\n\n public open(method: string, url: string | URL, async: boolean = true, username?: string | null | undefined, password?: string | null | undefined): void {\n if (async) {\n throw new Error(\"Async XMLHttpRequest is not implemented yet\");\n }\n\n if (method !== \"GET\") {\n throw new Error(\"Non-GET requests are not implemented yet\");\n }\n\n this._reset();\n\n this._url = url;\n }\n\n public send(body: null = null) {\n if (body !== null) {\n throw new Error(\"XMLHttpRequest send body is not implemented yet\");\n }\n\n if (!this._url) {\n throw new Error(\"You must call open before you call send\");\n }\n\n const response = $request(\"GET\", this._url, {\n headers: {\n \"Content-Type\": this._mime,\n }\n });\n\n const buffer = (response.body as Buffer).buffer;\n\n const responseText = new TextDecoder(\"iso-8859-5\", { fatal: true }).decode(buffer);\n\n (this as any).response = (this as any).responseText = responseText;\n\n this._url = null;\n\n this._success();\n }\n};","import * as $worker from \"node:worker_threads\";\nimport * as $os from \"node:os\";\n\n// This is technically not a part of the Worker polyfill,\n// but Workers are used for multi-threading, so this is often\n// needed when writing Worker code.\nif (globalThis.navigator == null) {\n globalThis.navigator = {\n hardwareConcurrency: $os.cpus().length,\n } as Navigator;\n}\n\nglobalThis.Worker = class Worker extends EventTarget {\n private _worker: import(\"node:worker_threads\").Worker;\n\n constructor(url: string | URL, options?: WorkerOptions | undefined) {\n super();\n\n if (url instanceof URL) {\n if (url.protocol !== \"file:\") {\n throw new Error(\"Worker only supports file: URLs\");\n }\n\n url = url.href;\n\n } else {\n throw new Error(\"Filepaths are unreliable, use `new URL(\\\"...\\\", import.meta.url)` instead.\");\n }\n\n if (!options || options.type !== \"module\") {\n throw new Error(\"Workers must use \\`type: \\\"module\\\"\\`\");\n }\n\n const code = `\n const { workerData } = require(\"node:worker_threads\");\n\n import(workerData.polyfill)\n .then(() => import(workerData.url))\n .catch((e) => {\n // TODO maybe it should send a message to the parent?\n console.error(e.stack);\n });\n `;\n\n this._worker = new $worker.Worker(code, {\n eval: true,\n workerData: {\n url,\n polyfill: new URL(\"node-polyfill.js\", import.meta.url).href,\n },\n });\n\n this._worker.on(\"message\", (data) => {\n this.dispatchEvent(new MessageEvent(\"message\", { data }));\n });\n\n this._worker.on(\"messageerror\", (error) => {\n throw new Error(\"UNIMPLEMENTED\");\n });\n\n this._worker.on(\"error\", (error) => {\n // TODO attach the error to the event somehow\n const event = new Event(\"error\");\n this.dispatchEvent(event);\n });\n }\n\n set onmessage(f: () => void) {\n throw new Error(\"UNIMPLEMENTED\");\n }\n\n set onmessageerror(f: () => void) {\n throw new Error(\"UNIMPLEMENTED\");\n }\n\n set onerror(f: () => void) {\n throw new Error(\"UNIMPLEMENTED\");\n }\n\n postMessage(message: any, transfer: Array<Transferable>): void;\n postMessage(message: any, options?: StructuredSerializeOptions | undefined): void;\n postMessage(value: any, transfer: any) {\n this._worker.postMessage(value, transfer);\n }\n\n terminate() {\n this._worker.terminate();\n }\n\n // This is Node-specific, it allows the process to exit\n // even if the Worker is still running.\n unref() {\n this._worker.unref();\n }\n};\n\n\nif (!$worker.isMainThread) {\n const globals = globalThis as unknown as DedicatedWorkerGlobalScope;\n\n // This is used to create the onmessage, onmessageerror, and onerror setters\n const makeSetter = (prop: string, event: string) => {\n let oldvalue: () => void;\n\n Object.defineProperty(globals, prop, {\n get() {\n return oldvalue;\n },\n set(value) {\n if (oldvalue) {\n globals.removeEventListener(event, oldvalue);\n }\n\n oldvalue = value;\n\n if (oldvalue) {\n globals.addEventListener(event, oldvalue);\n }\n },\n });\n };\n\n // This makes sure that `f` is only run once\n const memoize = (f: () => void) => {\n let run = false;\n\n return () => {\n if (!run) {\n run = true;\n f();\n }\n };\n };\n\n\n // We only start listening for messages / errors when the worker calls addEventListener\n const startOnMessage = memoize(() => {\n $worker.parentPort!.on(\"message\", (data) => {\n workerEvents.dispatchEvent(new MessageEvent(\"message\", { data }));\n });\n });\n\n const startOnMessageError = memoize(() => {\n throw new Error(\"UNIMPLEMENTED\");\n });\n\n const startOnError = memoize(() => {\n $worker.parentPort!.on(\"error\", (data) => {\n workerEvents.dispatchEvent(new Event(\"error\"));\n });\n });\n\n\n // Node workers don't have top-level events, so we have to make our own\n const workerEvents = new EventTarget();\n\n globals.close = () => {\n process.exit();\n };\n\n globals.addEventListener = (type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined) => {\n workerEvents.addEventListener(type, callback, options);\n\n if (type === \"message\") {\n startOnMessage();\n } else if (type === \"messageerror\") {\n startOnMessageError();\n } else if (type === \"error\") {\n startOnError();\n }\n };\n\n globals.removeEventListener = (type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined) => {\n workerEvents.removeEventListener(type, callback, options);\n };\n\n function postMessage(message: any, transfer: Transferable[]): void;\n function postMessage(message: any, options?: StructuredSerializeOptions | undefined): void;\n function postMessage(value: any, transfer: any) {\n $worker.parentPort!.postMessage(value, transfer);\n }\n\n globals.postMessage = postMessage;\n\n makeSetter(\"onmessage\", \"message\");\n makeSetter(\"onmessageerror\", \"messageerror\");\n makeSetter(\"onerror\", \"error\");\n}\n","import \"./polyfill/shared\";\nimport \"./polyfill/crypto\";\nimport \"./polyfill/fetch\";\nimport \"./polyfill/xmlhttprequest\";\nimport \"./polyfill/worker\";\n\nif (!globalThis.self) {\n (globalThis as any).self = globalThis;\n}\n"],"names":[],"mappings":";;;;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c,CAAC,CAAC;AAC7C,IAAA,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACnC;;ACrLA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AACjB,IAAA,UAAkB,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './node-polyfill.js';
|
|
2
|
-
export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KEY_STORE, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TO_PRIVATE_TRANSFER, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, ProgramManager, VALID_TRANSFER_TYPES, createAleoWorker, initializeWasm, logAndThrow } from './
|
|
3
|
-
export { Address, ExecutionResponse, Field, Execution as FunctionExecution, OfflineQuery, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, Transaction, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution } from '@provablehq/wasm';
|
|
2
|
+
export { Account, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, CREDITS_PROGRAM_KEYS, KEY_STORE, NetworkRecordProvider, OfflineKeyProvider, OfflineSearchParams, PRIVATE_TO_PUBLIC_TRANSFER, PRIVATE_TRANSFER, PRIVATE_TRANSFER_TYPES, PUBLIC_TO_PRIVATE_TRANSFER, PUBLIC_TRANSFER, PUBLIC_TRANSFER_AS_SIGNER, ProgramManager, VALID_TRANSFER_TYPES, createAleoWorker, initializeWasm, logAndThrow } from './browser.js';
|
|
3
|
+
export { Address, ExecutionResponse, Field, Execution as FunctionExecution, OfflineQuery, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager as ProgramManagerBase, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, Transaction, VerifyingKey, ViewKey, initThreadPool, verifyFunctionExecution } from '@provablehq/wasm/mainnet.js';
|
|
4
|
+
import 'core-js/proposals/json-parse-with-source.js';
|
|
4
5
|
import 'node:crypto';
|
|
5
6
|
import 'node:fs';
|
|
6
7
|
import 'mime/lite.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|