Skip to content

Commit 5aacde4

Browse files
Fix small errors in documentation
1 parent 2fe0f51 commit 5aacde4

File tree

2 files changed

+33
-45
lines changed

2 files changed

+33
-45
lines changed

docs/api_reference/sdk-src_program-manager.md

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ __recordProvider__ | `RecordProvider` | *A record provider that implements {@lin
2727

2828
## Methods
2929

30+
### `checkFee()`
31+
32+
![modifier: public](images/badges/modifier-public.svg)
33+
34+
Check if the fee is sufficient to pay for the transaction
35+
36+
---
37+
3038
### `setAccount(account)`
3139

3240
![modifier: public](images/badges/modifier-public.svg)
@@ -108,7 +116,7 @@ const programManager = new ProgramManager("https://api.explorer.provable.com/v1"
108116
programManager.setAccount(Account);
109117

110118
// Define a fee in credits
111-
const fee = 1.2;
119+
const priorityFee = 0.0;
112120

113121
// Create the deployment transaction.
114122
const tx = await programManager.buildDeploymentTransaction(program, fee, false);
@@ -155,7 +163,7 @@ const program = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u
155163
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
156164

157165
// Define a fee in credits
158-
const fee = 1.2;
166+
const priorityFee = 0.0;
159167

160168
// Deploy the program
161169
const tx_id = await programManager.deploy(program, fee, false);
@@ -198,7 +206,7 @@ const programManager = new ProgramManager("https://api.explorer.provable.com/v1"
198206
const tx = await programManager.buildExecutionTransaction({
199207
programName: "hello_hello.aleo",
200208
functionName: "hello_hello",
201-
fee: 0.020,
209+
priorityFee: 0.0,
202210
privateFee: false,
203211
inputs: ["5u32", "5u32"],
204212
keySearchParams: { "cacheKey": "hello_hello:hello" }
@@ -245,7 +253,7 @@ const programManager = new ProgramManager("https://api.explorer.provable.com/v1"
245253
const tx_id = await programManager.execute({
246254
programName: "hello_hello.aleo",
247255
functionName: "hello_hello",
248-
fee: 0.020,
256+
priorityFee: 0.0,
249257
privateFee: false,
250258
inputs: ["5u32", "5u32"],
251259
keySearchParams: { "cacheKey": "hello_hello:hello" }
@@ -446,7 +454,7 @@ setTimeout(async () => {
446454

447455
---
448456

449-
### `buildTransferPublicTransaction(amount, recipient, transferType, priorityFee, privateFee, recordSearchParams, amountRecord, feeRecord, privateKey, offlineQuery) ► Promise.<Transaction>`
457+
### `buildTransferPublicTransaction(amount, recipient, priorityFee, privateKey, offlineQuery) ► Promise.<Transaction>`
450458

451459
![modifier: public](images/badges/modifier-public.svg)
452460

@@ -456,13 +464,7 @@ Parameters | Type | Description
456464
--- | --- | ---
457465
__amount__ | `number` | *The amount of credits to transfer*
458466
__recipient__ | `string` | *The recipient of the transfer*
459-
__transferType__ | `string` | *The type of transfer to perform - options: &#x27;private&#x27;, &#x27;privateToPublic&#x27;, &#x27;public&#x27;, &#x27;publicToPrivate&#x27;*
460467
__priorityFee__ | `number` | *The optional priority fee to be paid for the transfer*
461-
__privateFee__ | `boolean` | *Use a private record to pay the fee. If false this will use the account&#x27;s public credit balance*
462-
__recordSearchParams__ | `RecordSearchParams` | *Optional parameters for finding the amount and fee
463-
records for the transfer transaction*
464-
__amountRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional amount record to use for the transfer*
465-
__feeRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional fee record to use for the transfer*
466468
__privateKey__ | [PrivateKey](sdk-src_wasm.md) | *Optional private key to use for the transfer transaction*
467469
__offlineQuery__ | [OfflineQuery](sdk-src_wasm.md) | *Optional offline query if creating transactions in an offline environment*
468470
__*return*__ | `Promise.<Transaction>` | *The transaction object*
@@ -492,7 +494,7 @@ setTimeout(async () => {
492494

493495
---
494496

495-
### `buildTransferPublicAsSignerTransaction(amount, recipient, transferType, priorityFee, privateFee, recordSearchParams, amountRecord, feeRecord, privateKey, offlineQuery) ► Promise.<Transaction>`
497+
### `buildTransferPublicAsSignerTransaction(amount, recipient, priorityFee, privateKey, offlineQuery) ► Promise.<Transaction>`
496498

497499
![modifier: public](images/badges/modifier-public.svg)
498500

@@ -502,12 +504,7 @@ Parameters | Type | Description
502504
--- | --- | ---
503505
__amount__ | `number` | *The amount of credits to transfer*
504506
__recipient__ | `string` | *The recipient of the transfer*
505-
__transferType__ | `string` | *The type of transfer to perform - options: &#x27;private&#x27;, &#x27;privateToPublic&#x27;, &#x27;public&#x27;, &#x27;publicToPrivate&#x27;*
506507
__priorityFee__ | `number` | *The optional priority fee to be paid for the transfer*
507-
__privateFee__ | `boolean` | *Use a private record to pay the fee. If false this will use the account&#x27;s public credit balance*
508-
__recordSearchParams__ | `RecordSearchParams` | *Optional parameters for finding the amount and fee records for the transfer transaction*
509-
__amountRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional amount record to use for the transfer*
510-
__feeRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional fee record to use for the transfer*
511508
__privateKey__ | [PrivateKey](sdk-src_wasm.md) | *Optional private key to use for the transfer transaction*
512509
__offlineQuery__ | [OfflineQuery](sdk-src_wasm.md) | *Optional offline query if creating transactions in an offline environment*
513510
__*return*__ | `Promise.<Transaction>` | *The transaction object*
@@ -1053,6 +1050,19 @@ __program__ | `string` | *The program source code*
10531050

10541051
---
10551052

1053+
### `checkFee(address, feeAmount)`
1054+
1055+
![modifier: public](images/badges/modifier-public.svg)
1056+
1057+
Check if the fee is sufficient to pay for the transaction
1058+
1059+
Parameters | Type | Description
1060+
--- | --- | ---
1061+
__address__ | `string` | **
1062+
__feeAmount__ | `bigint` | **
1063+
1064+
---
1065+
10561066
### `setAccount(account)`
10571067

10581068
![modifier: public](images/badges/modifier-public.svg)
@@ -1134,7 +1144,7 @@ const programManager = new ProgramManager("https://api.explorer.provable.com/v1"
11341144
programManager.setAccount(Account);
11351145

11361146
// Define a fee in credits
1137-
const fee = 1.2;
1147+
const priorityFee = 0.0;
11381148

11391149
// Create the deployment transaction.
11401150
const tx = await programManager.buildDeploymentTransaction(program, fee, false);
@@ -1181,7 +1191,7 @@ const program = "program hello_hello.aleo;\n\nfunction hello:\n input r0 as u
11811191
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
11821192

11831193
// Define a fee in credits
1184-
const fee = 1.2;
1194+
const priorityFee = 0.0;
11851195

11861196
// Deploy the program
11871197
const tx_id = await programManager.deploy(program, fee, false);
@@ -1224,7 +1234,7 @@ const programManager = new ProgramManager("https://api.explorer.provable.com/v1"
12241234
const tx = await programManager.buildExecutionTransaction({
12251235
programName: "hello_hello.aleo",
12261236
functionName: "hello_hello",
1227-
fee: 0.020,
1237+
priorityFee: 0.0,
12281238
privateFee: false,
12291239
inputs: ["5u32", "5u32"],
12301240
keySearchParams: { "cacheKey": "hello_hello:hello" }
@@ -1271,7 +1281,7 @@ const programManager = new ProgramManager("https://api.explorer.provable.com/v1"
12711281
const tx_id = await programManager.execute({
12721282
programName: "hello_hello.aleo",
12731283
functionName: "hello_hello",
1274-
fee: 0.020,
1284+
priorityFee: 0.0,
12751285
privateFee: false,
12761286
inputs: ["5u32", "5u32"],
12771287
keySearchParams: { "cacheKey": "hello_hello:hello" }
@@ -1472,7 +1482,7 @@ setTimeout(async () => {
14721482

14731483
---
14741484

1475-
### `buildTransferPublicTransaction(amount, recipient, transferType, priorityFee, privateFee, recordSearchParams, amountRecord, feeRecord, privateKey, offlineQuery) ► Promise.<Transaction>`
1485+
### `buildTransferPublicTransaction(amount, recipient, priorityFee, privateKey, offlineQuery) ► Promise.<Transaction>`
14761486

14771487
![modifier: public](images/badges/modifier-public.svg)
14781488

@@ -1482,13 +1492,7 @@ Parameters | Type | Description
14821492
--- | --- | ---
14831493
__amount__ | `number` | *The amount of credits to transfer*
14841494
__recipient__ | `string` | *The recipient of the transfer*
1485-
__transferType__ | `string` | *The type of transfer to perform - options: &#x27;private&#x27;, &#x27;privateToPublic&#x27;, &#x27;public&#x27;, &#x27;publicToPrivate&#x27;*
14861495
__priorityFee__ | `number` | *The optional priority fee to be paid for the transfer*
1487-
__privateFee__ | `boolean` | *Use a private record to pay the fee. If false this will use the account&#x27;s public credit balance*
1488-
__recordSearchParams__ | `RecordSearchParams` | *Optional parameters for finding the amount and fee
1489-
records for the transfer transaction*
1490-
__amountRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional amount record to use for the transfer*
1491-
__feeRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional fee record to use for the transfer*
14921496
__privateKey__ | [PrivateKey](sdk-src_wasm.md) | *Optional private key to use for the transfer transaction*
14931497
__offlineQuery__ | [OfflineQuery](sdk-src_wasm.md) | *Optional offline query if creating transactions in an offline environment*
14941498
__*return*__ | `Promise.<Transaction>` | *The transaction object*
@@ -1518,7 +1522,7 @@ setTimeout(async () => {
15181522

15191523
---
15201524

1521-
### `buildTransferPublicAsSignerTransaction(amount, recipient, transferType, priorityFee, privateFee, recordSearchParams, amountRecord, feeRecord, privateKey, offlineQuery) ► Promise.<Transaction>`
1525+
### `buildTransferPublicAsSignerTransaction(amount, recipient, priorityFee, privateKey, offlineQuery) ► Promise.<Transaction>`
15221526

15231527
![modifier: public](images/badges/modifier-public.svg)
15241528

@@ -1528,12 +1532,7 @@ Parameters | Type | Description
15281532
--- | --- | ---
15291533
__amount__ | `number` | *The amount of credits to transfer*
15301534
__recipient__ | `string` | *The recipient of the transfer*
1531-
__transferType__ | `string` | *The type of transfer to perform - options: &#x27;private&#x27;, &#x27;privateToPublic&#x27;, &#x27;public&#x27;, &#x27;publicToPrivate&#x27;*
15321535
__priorityFee__ | `number` | *The optional priority fee to be paid for the transfer*
1533-
__privateFee__ | `boolean` | *Use a private record to pay the fee. If false this will use the account&#x27;s public credit balance*
1534-
__recordSearchParams__ | `RecordSearchParams` | *Optional parameters for finding the amount and fee records for the transfer transaction*
1535-
__amountRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional amount record to use for the transfer*
1536-
__feeRecord__ | [RecordPlaintext](sdk-src_wasm.md) | *Optional fee record to use for the transfer*
15371536
__privateKey__ | [PrivateKey](sdk-src_wasm.md) | *Optional private key to use for the transfer transaction*
15381537
__offlineQuery__ | [OfflineQuery](sdk-src_wasm.md) | *Optional offline query if creating transactions in an offline environment*
15391538
__*return*__ | `Promise.<Transaction>` | *The transaction object*

sdk/src/program-manager.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,13 +1070,7 @@ class ProgramManager {
10701070
*
10711071
* @param {number} amount The amount of credits to transfer
10721072
* @param {string} recipient The recipient of the transfer
1073-
* @param {string} transferType The type of transfer to perform - options: 'private', 'privateToPublic', 'public', 'publicToPrivate'
10741073
* @param {number} priorityFee The optional priority fee to be paid for the transfer
1075-
* @param {boolean} privateFee Use a private record to pay the fee. If false this will use the account's public credit balance
1076-
* @param {RecordSearchParams | undefined} recordSearchParams Optional parameters for finding the amount and fee
1077-
* records for the transfer transaction
1078-
* @param {RecordPlaintext | string} amountRecord Optional amount record to use for the transfer
1079-
* @param {RecordPlaintext | string} feeRecord Optional fee record to use for the transfer
10801074
* @param {PrivateKey | undefined} privateKey Optional private key to use for the transfer transaction
10811075
* @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
10821076
* @returns {Promise<Transaction>} The transaction object
@@ -1127,12 +1121,7 @@ class ProgramManager {
11271121
*
11281122
* @param {number} amount The amount of credits to transfer
11291123
* @param {string} recipient The recipient of the transfer
1130-
* @param {string} transferType The type of transfer to perform - options: 'private', 'privateToPublic', 'public', 'publicToPrivate'
11311124
* @param {number} priorityFee The optional priority fee to be paid for the transfer
1132-
* @param {boolean} privateFee Use a private record to pay the fee. If false this will use the account's public credit balance
1133-
* @param {RecordSearchParams | undefined} recordSearchParams Optional parameters for finding the amount and fee records for the transfer transaction
1134-
* @param {RecordPlaintext | string} amountRecord Optional amount record to use for the transfer
1135-
* @param {RecordPlaintext | string} feeRecord Optional fee record to use for the transfer
11361125
* @param {PrivateKey | undefined} privateKey Optional private key to use for the transfer transaction
11371126
* @param {OfflineQuery | undefined} offlineQuery Optional offline query if creating transactions in an offline environment
11381127
* @returns {Promise<Transaction>} The transaction object

0 commit comments

Comments
 (0)