Skip to content

Commit

Permalink
fix: only require one resource slot for empty box refs (#282)
Browse files Browse the repository at this point in the history
* fix: only require one resource slot for empty box refs

* docs
  • Loading branch information
joe-p authored May 23, 2024
1 parent 927144e commit 5ce5b68
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions docs/code/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ the estimated rate.

#### Defined in

[src/transaction/transaction.ts:794](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L794)
[src/transaction/transaction.ts:796](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L796)

___

Expand Down Expand Up @@ -426,7 +426,7 @@ Allows for control of fees on a `Transaction` or `SuggestedParams` object

#### Defined in

[src/transaction/transaction.ts:817](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L817)
[src/transaction/transaction.ts:819](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L819)

___

Expand Down Expand Up @@ -1605,7 +1605,7 @@ The array of transactions with signers

#### Defined in

[src/transaction/transaction.ts:849](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L849)
[src/transaction/transaction.ts:851](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L851)

___

Expand Down Expand Up @@ -1938,7 +1938,7 @@ The suggested transaction parameters

#### Defined in

[src/transaction/transaction.ts:840](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L840)
[src/transaction/transaction.ts:842](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L842)

___

Expand Down Expand Up @@ -2300,7 +2300,7 @@ The dryrun result

#### Defined in

[src/transaction/transaction.ts:674](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L674)
[src/transaction/transaction.ts:676](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L676)

___

Expand Down Expand Up @@ -2591,7 +2591,7 @@ An object with transaction IDs, transactions, group transaction ID (`groupTransa

#### Defined in

[src/transaction/transaction.ts:539](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L539)
[src/transaction/transaction.ts:541](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L541)

___

Expand All @@ -2616,7 +2616,7 @@ An object with transaction IDs, transactions, group transaction ID (`groupTransa

#### Defined in

[src/transaction/transaction.ts:692](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L692)
[src/transaction/transaction.ts:694](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L694)

___

Expand Down Expand Up @@ -2895,4 +2895,4 @@ Throws an error if the transaction is not confirmed or rejected in the next `tim

#### Defined in

[src/transaction/transaction.ts:737](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L737)
[src/transaction/transaction.ts:739](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L739)
4 changes: 3 additions & 1 deletion src/transaction/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,9 @@ export async function populateAppCallResources(atc: algosdk.AtomicTransactionCom
}

// If we're adding a box, we need space for both the box ref and the app ref
if (type === 'box') return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES - 1
if (type === 'box' && BigInt((reference as algosdk.modelsv2.BoxReference).app) !== BigInt(0)) {
return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES - 1
}

return accounts + assets + apps + boxes < MAX_APP_CALL_FOREIGN_REFERENCES
})
Expand Down

0 comments on commit 5ce5b68

Please sign in to comment.