Skip to content

Commit 96c8789

Browse files
committed
Changing AleoNetworkClient to use object params
1 parent 33fcae6 commit 96c8789

File tree

13 files changed

+64
-62
lines changed

13 files changed

+64
-62
lines changed

create-leo-app/template-react-leo/src/workers/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function deployProgram(program) {
3737
keyProvider.useCache(true);
3838

3939
// Create a record provider that will be used to find records and transaction data for Aleo programs
40-
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
40+
const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
4141

4242
// Use existing account with funds
4343
const account = new Account({

create-leo-app/template-react-ts/src/workers/worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function deployProgram(program) {
3838
keyProvider.useCache(true);
3939

4040
// Create a record provider that will be used to find records and transaction data for Aleo programs
41-
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
41+
const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
4242

4343
// Use existing account with funds
4444
const account = new Account({

create-leo-app/template-vanilla/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function deployProgram(program) {
4545
keyProvider.useCache(true);
4646

4747
// Create a record provider that will be used to find records and transaction data for Aleo programs
48-
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
48+
const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
4949

5050
// Use existing account with funds
5151
const account = new Account({

sdk/src/account.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export class Account {
210210
* import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
211211
*
212212
* // Create a connection to the Aleo network and an account
213-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
213+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
214214
* const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
215215
*
216216
* // Get the record ciphertexts from a transaction.
@@ -240,7 +240,7 @@ export class Account {
240240
* import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
241241
*
242242
* // Create a connection to the Aleo network and an account
243-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
243+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
244244
* const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
245245
*
246246
* // Get the record ciphertexts from a transaction.
@@ -314,7 +314,7 @@ export class Account {
314314
* import { AleoNetworkClient, Account } from "@provablehq/sdk/testnet.js";
315315
*
316316
* // Create a connection to the Aleo network and an account
317-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
317+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
318318
* const account = Account.fromCiphertext(process.env.ciphertext!, process.env.password!);
319319
*
320320
* // Get the record ciphertexts from a transaction and check ownership of them.

sdk/src/function-key-provider.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ interface FunctionKeyProvider {
146146
*
147147
*
148148
* const keyProvider = new AleoKeyProvider();
149-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
149+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
150150
* const recordProvider = new NetworkRecordProvider({ account, networkClient });
151151
*
152152
* // Initialize a program manager with the key provider to automatically fetch keys for value transfers
@@ -200,7 +200,7 @@ interface FunctionKeyProvider {
200200
*
201201
* @example
202202
* // Create a new object which implements the KeyProvider interface
203-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
203+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
204204
* const keyProvider = new AleoKeyProvider();
205205
* const recordProvider = new NetworkRecordProvider({ account, networkClient });
206206
*
@@ -328,7 +328,7 @@ class AleoKeyProvider implements FunctionKeyProvider {
328328
*
329329
* @example
330330
* // Create a new object which implements the KeyProvider interface
331-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
331+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
332332
* const keyProvider = new AleoKeyProvider();
333333
* const recordProvider = new NetworkRecordProvider({ account, networkClient });
334334
*
@@ -390,7 +390,7 @@ class AleoKeyProvider implements FunctionKeyProvider {
390390
*
391391
* @example
392392
* // Create a new AleoKeyProvider object
393-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
393+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
394394
* const keyProvider = new AleoKeyProvider();
395395
* const recordProvider = new NetworkRecordProvider({ account, networkClient });
396396
*
@@ -521,7 +521,7 @@ class AleoKeyProvider implements FunctionKeyProvider {
521521
*
522522
* @example
523523
* // Create a new AleoKeyProvider
524-
* const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
524+
* const networkClient = new AleoNetworkClient({ host: "https://api.explorer.provable.com/v1" });
525525
* const keyProvider = new AleoKeyProvider();
526526
* const recordProvider = new NetworkRecordProvider({ account, networkClient });
527527
*

0 commit comments

Comments
 (0)