Skip to content

Commit 7ab9d57

Browse files
fix: optional
test: ensure vals defined
1 parent e7efcd6 commit 7ab9d57

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

lib/algorand.transaction.axfer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class AssetTransferTransaction extends TransactionHeader {
2121
* The amount of the asset to be transferred.
2222
* A zero amount transferred to self allocates that asset in the account's Asset map.
2323
*/
24-
aamt: number | bigint
24+
aamt?: number | bigint
2525
/**
2626
* Asset Sender
2727
*
@@ -36,7 +36,7 @@ export class AssetTransferTransaction extends TransactionHeader {
3636
*
3737
* The recipient of the asset transfer.
3838
*/
39-
arcv: Uint8Array
39+
arcv?: Uint8Array
4040
/**
4141
* Specify this field to remove the asset holding from the sender account and reduce the account's
4242
* minimum balance (i.e. opt-out of the asset).

lib/algorand.transaction.crafter.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ describe("Algorand Transaction Crafter", () => {
5656
) {
5757
const { snd, note, grp, lx, fee, fv, lv } = transactionHeader
5858
return builder
59-
.addSender(algoEncoder.encodeAddress(Buffer.from(snd)))
60-
.addFirstValidRound(fv)
61-
.addLastValidRound(lv)
59+
.addSender(algoEncoder.encodeAddress(Buffer.from(snd!)))
60+
.addFirstValidRound(fv!)
61+
.addLastValidRound(lv!)
6262
.addNote(Buffer.from(note!).toString("base64"), "base64")
6363
.addFee(fee!)
6464
.addGroup(grp!)
65-
.addRekey(algoEncoder.encodeAddress(Buffer.from(snd)))
65+
.addRekey(algoEncoder.encodeAddress(Buffer.from(snd!)))
6666
.addLease(lx!)
6767
}
6868

lib/algorand.transaction.header.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export abstract class TransactionHeader {
3232
*
3333
* The address of the account that pays the fee and amount.
3434
*/
35-
snd: Uint8Array
35+
snd?: Uint8Array
3636
/**
3737
* Fee
3838
*
@@ -44,13 +44,13 @@ export abstract class TransactionHeader {
4444
*
4545
* The first round for when the transaction is valid. If the transaction is sent prior to this round it will be rejected by the network.
4646
*/
47-
fv: bigint
47+
fv?: bigint
4848
/**
4949
* Last Valid
5050
*
5151
* The ending round for which the transaction is valid. After this round, the transaction will be rejected by the network.
5252
*/
53-
lv: bigint
53+
lv?: bigint
5454
/**
5555
* Genesis Hash
5656
*

lib/algorand.transaction.pay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ export class PayTransaction extends TransactionHeader {
1515
*
1616
* The address of the account that receives the amount.
1717
*/
18-
rcv: Uint8Array
18+
rcv?: Uint8Array
1919
/**
2020
* Amount
2121
*
2222
* The total amount to be sent in microAlgos.
2323
*/
24-
amt: bigint
24+
amt?: bigint
2525

2626
/**
2727
* Close Remainder To

0 commit comments

Comments
 (0)