@@ -21,23 +21,21 @@ Set the account used to search for records
2121
2222Parameters | Type | Description
2323--- | --- | ---
24- __ account__ | [ Account] ( sdk-src_account.md ) | * The account to use for searching for records*
24+ __ account__ | [ Account] ( sdk-src_account.md ) | * The account used to use for searching for records. *
2525
2626---
2727
28- ### ` findCreditsRecords(microcredits, unspent, nonces, searchParameters) ► Promise.<RecordPlaintext > `
28+ ### ` findCreditsRecords(microcredits, searchParameters) ► Promise.<Array.<OwnedRecord> > `
2929
3030![ modifier: public] ( images/badges/modifier-public.svg )
3131
3232Find a list of credit records with a given number of microcredits by via the official Aleo API
3333
3434Parameters | Type | Description
3535--- | --- | ---
36- __ microcredits__ | ` Array.<number> ` | * The number of microcredits to search for*
37- __ unspent__ | ` boolean ` | * Whether or not the record is unspent*
38- __ nonces__ | ` Array.<string> ` | * Nonces of records already found so that they are not found again*
39- __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for*
40- __ * return* __ | ` Promise.<RecordPlaintext> ` | * The record if found, otherwise an error*
36+ __ microcredits__ | ` Array.<number> ` | * The number of microcredits to search for.*
37+ __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for.*
38+ __ * return* __ | ` Promise.<Array.<OwnedRecord>> ` | * The records if found, otherwise an error.*
4139
4240#### Examples
4341
@@ -48,11 +46,11 @@ const keyProvider = new AleoKeyProvider();
4846const recordProvider = new NetworkRecordProvider (account, networkClient);
4947
5048// The record provider can be used to find records with a given number of microcredits
51- const record = await recordProvider .findCreditsRecord (5000 , true , [] );
49+ const record = await recordProvider .findCreditsRecord (5000 , { unspent : true , nonces : [] } );
5250
5351// When a record is found but not yet used, it's nonce should be added to the nonces parameter so that it is not
5452// found again if a subsequent search is performed
55- const records = await recordProvider .findCreditsRecords (5000 , true , [record .nonce ()]);
53+ const records = await recordProvider .findCreditsRecords (5000 , { unspent : true , nonces : [record .nonce ()] } );
5654
5755// When the program manager is initialized with the record provider it will be used to find automatically find
5856// fee records and amount records for value transfers so that they do not need to be specified manually
@@ -62,19 +60,17 @@ programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwn
6260
6361---
6462
65- ### ` findCreditsRecord(microcredits, unspent, nonces, searchParameters) ► Promise.<RecordPlaintext > `
63+ ### ` findCreditsRecord(microcredits, searchParameters) ► Promise.<OwnedRecord > `
6664
6765![ modifier: public] ( images/badges/modifier-public.svg )
6866
6967Find a credit record with a given number of microcredits by via the official Aleo API
7068
7169Parameters | Type | Description
7270--- | --- | ---
73- __ microcredits__ | ` number ` | * The number of microcredits to search for*
74- __ unspent__ | ` boolean ` | * Whether or not the record is unspent*
75- __ nonces__ | ` Array.<string> ` | * Nonces of records already found so that they are not found again*
76- __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for*
77- __ * return* __ | ` Promise.<RecordPlaintext> ` | * The record if found, otherwise an error*
71+ __ microcredits__ | ` number ` | * The number of microcredits to search for.*
72+ __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for.*
73+ __ * return* __ | ` Promise.<OwnedRecord> ` | * The record if found, otherwise an error.*
7874
7975#### Examples
8076
@@ -85,11 +81,11 @@ const keyProvider = new AleoKeyProvider();
8581const recordProvider = new NetworkRecordProvider (account, networkClient);
8682
8783// The record provider can be used to find records with a given number of microcredits
88- const record = await recordProvider .findCreditsRecord (5000 , true , [] );
84+ const record = await recordProvider .findCreditsRecord (5000 , { unspent : true , nonces : [] } );
8985
9086// When a record is found but not yet used, it's nonce should be added to the nonces parameter so that it is not
9187// found again if a subsequent search is performed
92- const records = await recordProvider .findCreditsRecords (5000 , true , [record .nonce ()]);
88+ const records = await recordProvider .findCreditsRecords (5000 , { unspent : true , nonces : [record .nonce ()] } );
9389
9490// When the program manager is initialized with the record provider it will be used to find automatically find
9591// fee records and amount records for value transfers so that they do not need to be specified manually
@@ -123,23 +119,21 @@ Set the account used to search for records
123119
124120Parameters | Type | Description
125121--- | --- | ---
126- __ account__ | [ Account] ( sdk-src_account.md ) | * The account to use for searching for records*
122+ __ account__ | [ Account] ( sdk-src_account.md ) | * The account used to use for searching for records. *
127123
128124---
129125
130- ### ` findCreditsRecords(microcredits, unspent, nonces, searchParameters) ► Promise.<RecordPlaintext > `
126+ ### ` findCreditsRecords(microcredits, searchParameters) ► Promise.<Array.<OwnedRecord> > `
131127
132128![ modifier: public] ( images/badges/modifier-public.svg )
133129
134130Find a list of credit records with a given number of microcredits by via the official Aleo API
135131
136132Parameters | Type | Description
137133--- | --- | ---
138- __ microcredits__ | ` Array.<number> ` | * The number of microcredits to search for*
139- __ unspent__ | ` boolean ` | * Whether or not the record is unspent*
140- __ nonces__ | ` Array.<string> ` | * Nonces of records already found so that they are not found again*
141- __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for*
142- __ * return* __ | ` Promise.<RecordPlaintext> ` | * The record if found, otherwise an error*
134+ __ microcredits__ | ` Array.<number> ` | * The number of microcredits to search for.*
135+ __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for.*
136+ __ * return* __ | ` Promise.<Array.<OwnedRecord>> ` | * The records if found, otherwise an error.*
143137
144138#### Examples
145139
@@ -150,11 +144,11 @@ const keyProvider = new AleoKeyProvider();
150144const recordProvider = new NetworkRecordProvider (account, networkClient);
151145
152146// The record provider can be used to find records with a given number of microcredits
153- const record = await recordProvider .findCreditsRecord (5000 , true , [] );
147+ const record = await recordProvider .findCreditsRecord (5000 , { unspent : true , nonces : [] } );
154148
155149// When a record is found but not yet used, it's nonce should be added to the nonces parameter so that it is not
156150// found again if a subsequent search is performed
157- const records = await recordProvider .findCreditsRecords (5000 , true , [record .nonce ()]);
151+ const records = await recordProvider .findCreditsRecords (5000 , { unspent : true , nonces : [record .nonce ()] } );
158152
159153// When the program manager is initialized with the record provider it will be used to find automatically find
160154// fee records and amount records for value transfers so that they do not need to be specified manually
@@ -164,19 +158,17 @@ programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwn
164158
165159---
166160
167- ### ` findCreditsRecord(microcredits, unspent, nonces, searchParameters) ► Promise.<RecordPlaintext > `
161+ ### ` findCreditsRecord(microcredits, searchParameters) ► Promise.<OwnedRecord > `
168162
169163![ modifier: public] ( images/badges/modifier-public.svg )
170164
171165Find a credit record with a given number of microcredits by via the official Aleo API
172166
173167Parameters | Type | Description
174168--- | --- | ---
175- __ microcredits__ | ` number ` | * The number of microcredits to search for*
176- __ unspent__ | ` boolean ` | * Whether or not the record is unspent*
177- __ nonces__ | ` Array.<string> ` | * Nonces of records already found so that they are not found again*
178- __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for*
179- __ * return* __ | ` Promise.<RecordPlaintext> ` | * The record if found, otherwise an error*
169+ __ microcredits__ | ` number ` | * The number of microcredits to search for.*
170+ __ searchParameters__ | ` RecordSearchParams ` | * Additional parameters to search for.*
171+ __ * return* __ | ` Promise.<OwnedRecord> ` | * The record if found, otherwise an error.*
180172
181173#### Examples
182174
@@ -187,11 +179,11 @@ const keyProvider = new AleoKeyProvider();
187179const recordProvider = new NetworkRecordProvider (account, networkClient);
188180
189181// The record provider can be used to find records with a given number of microcredits
190- const record = await recordProvider .findCreditsRecord (5000 , true , [] );
182+ const record = await recordProvider .findCreditsRecord (5000 , { unspent : true , nonces : [] } );
191183
192184// When a record is found but not yet used, it's nonce should be added to the nonces parameter so that it is not
193185// found again if a subsequent search is performed
194- const records = await recordProvider .findCreditsRecords (5000 , true , [record .nonce ()]);
186+ const records = await recordProvider .findCreditsRecords (5000 , { unspent : true , nonces : [record .nonce ()] } );
195187
196188// When the program manager is initialized with the record provider it will be used to find automatically find
197189// fee records and amount records for value transfers so that they do not need to be specified manually
@@ -201,31 +193,27 @@ programManager.transfer(1, "aleo166q6ww6688cug7qxwe7nhctjpymydwzy2h7rscfmatqmfwn
201193
202194---
203195
204- ### ` findRecord(unspent, nonces, searchParameters) ► Promise.<RecordPlaintext > `
196+ ### ` findRecord(searchParameters) ► Promise.<OwnedRecord > `
205197
206198![ modifier: public] ( images/badges/modifier-public.svg )
207199
208200Find an arbitrary record. WARNING: This function is not implemented yet and will throw an error.
209201
210202Parameters | Type | Description
211203--- | --- | ---
212- __ unspent__ | ` boolean ` | **
213- __ nonces__ | ` Array ` | **
214204__ searchParameters__ | ` RecordSearchParams ` | **
215- __ * return* __ | ` Promise.<RecordPlaintext > ` | **
205+ __ * return* __ | ` Promise.<OwnedRecord > ` | **
216206
217207---
218208
219- ### ` findRecords(unspent, nonces, searchParameters) ► Promise.<Array> `
209+ ### ` findRecords(searchParameters) ► Promise.<Array> `
220210
221211![ modifier: public] ( images/badges/modifier-public.svg )
222212
223213Find multiple records from a specified program.
224214
225215Parameters | Type | Description
226216--- | --- | ---
227- __ unspent__ | ` boolean ` | **
228- __ nonces__ | ` Array ` | **
229217__ searchParameters__ | ` RecordSearchParams ` | **
230218__ * return* __ | ` Promise.<Array> ` | **
231219
@@ -249,5 +237,5 @@ const recordProvider = new NetworkRecordProvider(account, networkClient);
249237
250238// The record provider can be used to find records with a given number of microcredits and the block height search
251239// can be used to find records within a given block height range
252- const record = await recordProvider .findCreditsRecord (5000 , true , [], params);
240+ const record = await recordProvider .findCreditsRecord (5000 , { unspent : true , nonces : [], ... params } );
253241```
0 commit comments