Skip to content

Commit 4492263

Browse files
committed
ran cargo fmt and updated docs
1 parent dbd400d commit 4492263

File tree

3 files changed

+10203
-14773
lines changed

3 files changed

+10203
-14773
lines changed

docs/api_reference/sdk-src_wasm.md

Lines changed: 191 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,203 @@ __*return*__ | `boolean` | *Boolean representing whether or not the signature is
202202

203203
---
204204

205+
# Class `Authorization`
206+
207+
Authorization object containing the authorization for a transaction.
208+
209+
## Methods
210+
211+
### `new(request) ► Authorization`
212+
213+
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
214+
215+
Create a new authorization from a request object.
216+
217+
Parameters | Type | Description
218+
--- | --- | ---
219+
__request__ | `ExecutionRequest` | *The ExecutionRequest to build the authorization from.*
220+
__*return*__ | [Authorization](sdk-src_wasm.md) | **
221+
222+
---
223+
224+
### `replicate() ► Authorization`
225+
226+
![modifier: public](images/badges/modifier-public.svg)
227+
228+
Returns a new and independent replica of the Authorization.
229+
230+
Parameters | Type | Description
231+
--- | --- | ---
232+
__*return*__ | [Authorization](sdk-src_wasm.md) | **
233+
234+
---
235+
236+
### `toString() ► string`
237+
238+
![modifier: public](images/badges/modifier-public.svg)
239+
240+
Returns the string representation of the Authorization.
241+
242+
Parameters | Type | Description
243+
--- | --- | ---
244+
__*return*__ | `string` | **
245+
246+
---
247+
248+
### `fromString(authorization) ► Authorization`
249+
250+
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
251+
252+
Reconstructs an Authorization object from its string representation.
253+
254+
Parameters | Type | Description
255+
--- | --- | ---
256+
__authorization__ | `String` | *The string representation of the Authorization.*
257+
__*return*__ | [Authorization](sdk-src_wasm.md) | **
258+
259+
---
260+
261+
### `toBytesLe() ► Uint8Array`
262+
263+
![modifier: public](images/badges/modifier-public.svg)
264+
265+
Returns the left-endian byte representation of the Authorization.
266+
267+
Parameters | Type | Description
268+
--- | --- | ---
269+
__*return*__ | `Uint8Array` | **
270+
271+
---
272+
273+
### `fromBytesLe(bytes) ► Authorization`
274+
275+
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
276+
277+
Creates an authorization object from a left-endian byte representation of an Authorization.
278+
279+
Parameters | Type | Description
280+
--- | --- | ---
281+
__bytes__ | `Uint8Array` | *Left-endian bytes representing the Authorization.*
282+
__*return*__ | [Authorization](sdk-src_wasm.md) | **
283+
284+
---
285+
286+
### `equals(other) ► boolean`
287+
288+
![modifier: public](images/badges/modifier-public.svg)
289+
290+
Check if an Authorization object is the same as another.
291+
292+
Parameters | Type | Description
293+
--- | --- | ---
294+
__other__ | [Authorization](sdk-src_wasm.md) | *The Authorization object to determine equality with.*
295+
__*return*__ | `boolean` | **
296+
297+
---
298+
299+
### `len() ► number`
300+
301+
![modifier: public](images/badges/modifier-public.svg)
302+
303+
Returns the number of `Request`s in the Authorization.
304+
305+
Parameters | Type | Description
306+
--- | --- | ---
307+
__*return*__ | `number` | **
308+
309+
---
310+
311+
### `isEmpty() ► boolean`
312+
313+
![modifier: public](images/badges/modifier-public.svg)
314+
315+
Return `true` if the Authorization is empty.
316+
317+
Parameters | Type | Description
318+
--- | --- | ---
319+
__*return*__ | `boolean` | **
320+
321+
---
322+
323+
### `isFeePrivate() ► boolean`
324+
325+
![modifier: public](images/badges/modifier-public.svg)
326+
327+
Returns `true` if the Authorization is for `credits.aleo/fee_private`.
328+
329+
Parameters | Type | Description
330+
--- | --- | ---
331+
__*return*__ | `boolean` | **
332+
333+
---
334+
335+
### `isFeePublic() ► boolean`
336+
337+
![modifier: public](images/badges/modifier-public.svg)
338+
339+
Returns `true` if the Authorization is for `credits.aleo/fee_public`.
340+
341+
Parameters | Type | Description
342+
--- | --- | ---
343+
__*return*__ | `boolean` | **
344+
345+
---
346+
347+
### `isSplit() ► boolean`
348+
349+
![modifier: public](images/badges/modifier-public.svg)
350+
351+
Returns `true` if the Authorization is for `credits.aleo/split`.
352+
353+
Parameters | Type | Description
354+
--- | --- | ---
355+
__*return*__ | `boolean` | **
356+
357+
---
358+
359+
### `insertTransition(transition) ► void`
360+
361+
![modifier: public](images/badges/modifier-public.svg)
362+
363+
Insert a transition into the Authorization.
364+
365+
Parameters | Type | Description
366+
--- | --- | ---
367+
__transition__ | `Transition` | *The transition object to insert into the Authorization.*
368+
__*return*__ | `void` | **
369+
370+
---
371+
372+
### `transitions() ► Array.<Transition>`
373+
374+
![modifier: public](images/badges/modifier-public.svg)
375+
376+
Get the transitions in an Authorization.
377+
378+
Parameters | Type | Description
379+
--- | --- | ---
380+
__*return*__ | `Array.<Transition>` | *Array of transition objects*
381+
382+
---
383+
384+
### `toExecutionId() ► Field`
385+
386+
![modifier: public](images/badges/modifier-public.svg)
387+
388+
Returns the execution ID for the Authorization.
389+
390+
Parameters | Type | Description
391+
--- | --- | ---
392+
__*return*__ | [Field](sdk-src_wasm.md) | *The execution ID for the Authorization, call toString() after this result to get the string representation.*
393+
394+
---
395+
205396
# Class `Ciphertext`
206397

207398
SnarkVM Ciphertext object. A Ciphertext represents an symmetrically encrypted plaintext. This
208399
object provides decryption methods to recover the plaintext from the ciphertext (given the
209400
api consumer has the proper decryption materials).
210401

211-
## Examples
212-
213-
```javascript
214-
215-
```
216-
217402
## Methods
218403

219404
### `decrypt(viewKey, nonce) ► Plaintext`
@@ -3278,7 +3463,6 @@ __*return*__ | `string` | *TransactionId*
32783463
32793464
![modifier: public](images/badges/modifier-public.svg)
32803465
3281-
Get the
32823466
Get the type of the transaction (will return &quot;deploy&quot; or &quot;execute&quot;)
32833467
32843468
Parameters | Type | Description

wasm/src/programs/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,4 @@ macro_rules! calculate_minimum_fee {
266266

267267
minimum_execution_cost
268268
}};
269-
}
269+
}

0 commit comments

Comments
 (0)