algosdk 2.8.0 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.LICENSE.txt +0 -9
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/abi/abi_type.js +34 -27
- package/dist/cjs/abi/abi_type.js.map +1 -1
- package/dist/cjs/abi/contract.js +5 -3
- package/dist/cjs/abi/contract.js.map +1 -1
- package/dist/cjs/{types/transactions/asset.js → abi/event.js} +1 -1
- package/dist/cjs/abi/event.js.map +1 -0
- package/dist/cjs/abi/index.js +6 -6
- package/dist/cjs/abi/index.js.map +1 -1
- package/dist/cjs/abi/interface.js +3 -3
- package/dist/cjs/abi/interface.js.map +1 -1
- package/dist/cjs/abi/method.js +14 -10
- package/dist/cjs/abi/method.js.map +1 -1
- package/dist/cjs/abi/reference.js +1 -1
- package/dist/cjs/abi/reference.js.map +1 -1
- package/dist/cjs/abi/transaction.js +2 -2
- package/dist/cjs/abi/transaction.js.map +1 -1
- package/dist/cjs/account.js +4 -4
- package/dist/cjs/account.js.map +1 -1
- package/dist/cjs/boxStorage.js +17 -17
- package/dist/cjs/boxStorage.js.map +1 -1
- package/dist/cjs/client/client.js +77 -41
- package/dist/cjs/client/client.js.map +1 -1
- package/dist/cjs/client/index.js +29 -0
- package/dist/cjs/client/index.js.map +1 -0
- package/dist/cjs/client/kmd.js +69 -86
- package/dist/cjs/client/kmd.js.map +1 -1
- package/dist/cjs/client/urlTokenBaseHTTPClient.js +16 -11
- package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountApplicationInformation.js +11 -7
- package/dist/cjs/client/v2/algod/accountApplicationInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountAssetInformation.js +11 -7
- package/dist/cjs/client/v2/algod/accountAssetInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountInformation.js +11 -6
- package/dist/cjs/client/v2/algod/accountInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +85 -83
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/block.js +6 -33
- package/dist/cjs/client/v2/algod/block.js.map +1 -1
- package/dist/cjs/client/v2/algod/compile.js +17 -11
- package/dist/cjs/client/v2/algod/compile.js.map +1 -1
- package/dist/cjs/client/v2/algod/disassemble.js +17 -11
- package/dist/cjs/client/v2/algod/disassemble.js.map +1 -1
- package/dist/cjs/client/v2/algod/dryrun.js +18 -37
- package/dist/cjs/client/v2/algod/dryrun.js.map +1 -1
- package/dist/cjs/client/v2/algod/genesis.js +6 -2
- package/dist/cjs/client/v2/algod/genesis.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +10 -10
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js +8 -8
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationByID.js +10 -5
- package/dist/cjs/client/v2/algod/getApplicationByID.js.map +1 -1
- package/dist/cjs/client/v2/algod/getAssetByID.js +10 -5
- package/dist/cjs/client/v2/algod/getAssetByID.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockHash.js +10 -6
- package/dist/cjs/client/v2/algod/getBlockHash.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +6 -5
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockTxids.js +10 -4
- package/dist/cjs/client/v2/algod/getBlockTxids.js.map +1 -1
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +11 -6
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -1
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +11 -6
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
- package/dist/cjs/client/v2/algod/getSyncRound.js +6 -5
- package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +9 -9
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/getTransactionProof.js +10 -6
- package/dist/cjs/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/cjs/client/v2/algod/healthCheck.js +4 -9
- package/dist/cjs/client/v2/algod/healthCheck.js.map +1 -1
- package/dist/cjs/{types → client/v2/algod}/index.js +5 -3
- package/dist/cjs/client/v2/algod/index.js.map +1 -0
- package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js +10 -5
- package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +3712 -1824
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactionInformation.js +6 -32
- package/dist/cjs/client/v2/algod/pendingTransactionInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactions.js +6 -31
- package/dist/cjs/client/v2/algod/pendingTransactions.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js +7 -33
- package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
- package/dist/cjs/client/v2/algod/ready.js +4 -2
- package/dist/cjs/client/v2/algod/ready.js.map +1 -1
- package/dist/cjs/client/v2/algod/sendRawTransaction.js +17 -8
- package/dist/cjs/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +13 -8
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
- package/dist/cjs/client/v2/algod/setSyncRound.js +13 -8
- package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/simulateTransaction.js +15 -35
- package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/cjs/client/v2/algod/stateproof.js +10 -5
- package/dist/cjs/client/v2/algod/stateproof.js.map +1 -1
- package/dist/cjs/client/v2/algod/status.js +8 -2
- package/dist/cjs/client/v2/algod/status.js.map +1 -1
- package/dist/cjs/client/v2/algod/statusAfterBlock.js +10 -5
- package/dist/cjs/client/v2/algod/statusAfterBlock.js.map +1 -1
- package/dist/cjs/client/v2/algod/suggestedParams.js +13 -9
- package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/cjs/client/v2/algod/supply.js +8 -2
- package/dist/cjs/client/v2/algod/supply.js.map +1 -1
- package/dist/cjs/client/v2/algod/unsetSyncRound.js +11 -5
- package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/versions.js +8 -2
- package/dist/cjs/client/v2/algod/versions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/index.js +22 -0
- package/dist/cjs/client/v2/indexer/index.js.map +1 -0
- package/dist/cjs/client/v2/indexer/indexer.js +44 -43
- package/dist/cjs/client/v2/indexer/indexer.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountAssets.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountByID.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +19 -12
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js +10 -10
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplications.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetByID.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +19 -12
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupBlock.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupBlock.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupTransactionByID.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupTransactionByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/makeHealthCheck.js +8 -2
- package/dist/cjs/client/v2/indexer/makeHealthCheck.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +3591 -1651
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchAccounts.js +9 -3
- package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js +8 -8
- package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForApplications.js +9 -3
- package/dist/cjs/client/v2/indexer/searchForApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForAssets.js +9 -3
- package/dist/cjs/client/v2/indexer/searchForAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForTransactions.js +17 -9
- package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/cjs/client/v2/jsonrequest.js +22 -54
- package/dist/cjs/client/v2/jsonrequest.js.map +1 -1
- package/dist/cjs/client/v2/serviceClient.js +5 -25
- package/dist/cjs/client/v2/serviceClient.js.map +1 -1
- package/dist/cjs/client/v2/untypedmodel.js +22 -0
- package/dist/cjs/client/v2/untypedmodel.js.map +1 -0
- package/dist/cjs/composer.js +64 -58
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/convert.js.map +1 -1
- package/dist/cjs/dryrun.js +107 -203
- package/dist/cjs/dryrun.js.map +1 -1
- package/dist/cjs/encoding/address.js +88 -104
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/encoding/bigint.js +2 -3
- package/dist/cjs/encoding/bigint.js.map +1 -1
- package/dist/cjs/encoding/binarydata.js +82 -0
- package/dist/cjs/encoding/binarydata.js.map +1 -0
- package/dist/cjs/encoding/encoding.js +353 -38
- package/dist/cjs/encoding/encoding.js.map +1 -1
- package/dist/cjs/encoding/schema/address.js +41 -0
- package/dist/cjs/encoding/schema/address.js.map +1 -0
- package/dist/cjs/encoding/schema/array.js +43 -0
- package/dist/cjs/encoding/schema/array.js.map +1 -0
- package/dist/cjs/encoding/schema/binarystring.js +55 -0
- package/dist/cjs/encoding/schema/binarystring.js.map +1 -0
- package/dist/cjs/encoding/schema/blockhash.js +67 -0
- package/dist/cjs/encoding/schema/blockhash.js.map +1 -0
- package/dist/cjs/encoding/schema/boolean.js +42 -0
- package/dist/cjs/encoding/schema/boolean.js.map +1 -0
- package/dist/cjs/encoding/schema/bytearray.js +98 -0
- package/dist/cjs/encoding/schema/bytearray.js.map +1 -0
- package/dist/cjs/encoding/schema/index.js +34 -0
- package/dist/cjs/encoding/schema/index.js.map +1 -0
- package/dist/cjs/encoding/schema/map.js +528 -0
- package/dist/cjs/encoding/schema/map.js.map +1 -0
- package/dist/cjs/encoding/schema/optional.js +58 -0
- package/dist/cjs/encoding/schema/optional.js.map +1 -0
- package/dist/cjs/encoding/schema/string.js +43 -0
- package/dist/cjs/encoding/schema/string.js.map +1 -0
- package/dist/cjs/encoding/schema/uint64.js +36 -0
- package/dist/cjs/encoding/schema/uint64.js.map +1 -0
- package/dist/cjs/encoding/schema/untyped.js +33 -0
- package/dist/cjs/encoding/schema/untyped.js.map +1 -0
- package/dist/cjs/encoding/uint64.js +2 -2
- package/dist/cjs/encoding/uint64.js.map +1 -1
- package/dist/cjs/group.js +23 -60
- package/dist/cjs/group.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logic/sourcemap.js +56 -25
- package/dist/cjs/logic/sourcemap.js.map +1 -1
- package/dist/cjs/logicsig.js +113 -146
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/main.js +113 -122
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/makeTxn.js +320 -554
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/mnemonic/mnemonic.js +8 -8
- package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
- package/dist/cjs/multisig.js +60 -312
- package/dist/cjs/multisig.js.map +1 -1
- package/dist/cjs/multisigSigning.js +285 -0
- package/dist/cjs/multisigSigning.js.map +1 -0
- package/dist/cjs/nacl/naclWrappers.js +2 -2
- package/dist/cjs/nacl/naclWrappers.js.map +1 -1
- package/dist/cjs/signedTransaction.js +106 -0
- package/dist/cjs/signedTransaction.js.map +1 -0
- package/dist/cjs/signer.js +7 -7
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/signing.js +105 -0
- package/dist/cjs/signing.js.map +1 -0
- package/dist/cjs/stateproof.js +421 -0
- package/dist/cjs/stateproof.js.map +1 -0
- package/dist/cjs/transaction.js +724 -1009
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/block.js +813 -0
- package/dist/cjs/types/block.js.map +1 -0
- package/dist/cjs/types/intDecoding.js +1 -1
- package/dist/cjs/types/intDecoding.js.map +1 -1
- package/dist/cjs/types/statedelta.js +1155 -0
- package/dist/cjs/types/statedelta.js.map +1 -0
- package/dist/cjs/types/transactions/base.js +22 -5
- package/dist/cjs/types/transactions/base.js.map +1 -1
- package/dist/cjs/types/transactions/encoded.js +67 -0
- package/dist/cjs/types/transactions/encoded.js.map +1 -1
- package/dist/cjs/types/transactions/index.js +2 -5
- package/dist/cjs/types/transactions/index.js.map +1 -1
- package/dist/cjs/utils/utils.js +86 -22
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/cjs/wait.js +4 -4
- package/dist/cjs/wait.js.map +1 -1
- package/dist/esm/abi/abi_type.js +22 -15
- package/dist/esm/abi/abi_type.js.map +1 -1
- package/dist/esm/abi/contract.js +3 -1
- package/dist/esm/abi/contract.js.map +1 -1
- package/dist/esm/abi/event.js +2 -0
- package/dist/esm/abi/event.js.map +1 -0
- package/dist/esm/abi/index.js +6 -6
- package/dist/esm/abi/index.js.map +1 -1
- package/dist/esm/abi/interface.js +1 -1
- package/dist/esm/abi/interface.js.map +1 -1
- package/dist/esm/abi/method.js +8 -4
- package/dist/esm/abi/method.js.map +1 -1
- package/dist/esm/abi/transaction.js +1 -1
- package/dist/esm/abi/transaction.js.map +1 -1
- package/dist/esm/account.js +4 -4
- package/dist/esm/account.js.map +1 -1
- package/dist/esm/boxStorage.js +15 -15
- package/dist/esm/boxStorage.js.map +1 -1
- package/dist/esm/client/client.js +74 -40
- package/dist/esm/client/client.js.map +1 -1
- package/dist/esm/client/index.js +7 -0
- package/dist/esm/client/index.js.map +1 -0
- package/dist/esm/client/kmd.js +67 -62
- package/dist/esm/client/kmd.js.map +1 -1
- package/dist/esm/client/urlTokenBaseHTTPClient.js +16 -11
- package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/esm/client/v2/algod/accountApplicationInformation.js +10 -6
- package/dist/esm/client/v2/algod/accountApplicationInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/accountAssetInformation.js +10 -6
- package/dist/esm/client/v2/algod/accountAssetInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/accountInformation.js +10 -5
- package/dist/esm/client/v2/algod/accountInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +71 -70
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/block.js +5 -9
- package/dist/esm/client/v2/algod/block.js.map +1 -1
- package/dist/esm/client/v2/algod/compile.js +16 -10
- package/dist/esm/client/v2/algod/compile.js.map +1 -1
- package/dist/esm/client/v2/algod/disassemble.js +16 -10
- package/dist/esm/client/v2/algod/disassemble.js.map +1 -1
- package/dist/esm/client/v2/algod/dryrun.js +16 -12
- package/dist/esm/client/v2/algod/dryrun.js.map +1 -1
- package/dist/esm/client/v2/algod/genesis.js +5 -1
- package/dist/esm/client/v2/algod/genesis.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js +9 -9
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxes.js +7 -7
- package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationByID.js +9 -4
- package/dist/esm/client/v2/algod/getApplicationByID.js.map +1 -1
- package/dist/esm/client/v2/algod/getAssetByID.js +9 -4
- package/dist/esm/client/v2/algod/getAssetByID.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockHash.js +9 -5
- package/dist/esm/client/v2/algod/getBlockHash.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +5 -4
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockTxids.js +9 -3
- package/dist/esm/client/v2/algod/getBlockTxids.js.map +1 -1
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js +10 -5
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -1
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +10 -5
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
- package/dist/esm/client/v2/algod/getSyncRound.js +5 -4
- package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +8 -8
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
- package/dist/esm/client/v2/algod/getTransactionProof.js +9 -5
- package/dist/esm/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/esm/client/v2/algod/healthCheck.js +3 -8
- package/dist/esm/client/v2/algod/healthCheck.js.map +1 -1
- package/dist/esm/client/v2/algod/index.js +4 -0
- package/dist/esm/client/v2/algod/index.js.map +1 -0
- package/dist/esm/client/v2/algod/lightBlockHeaderProof.js +9 -4
- package/dist/esm/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +3712 -1821
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactionInformation.js +5 -8
- package/dist/esm/client/v2/algod/pendingTransactionInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactions.js +5 -7
- package/dist/esm/client/v2/algod/pendingTransactions.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js +6 -9
- package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
- package/dist/esm/client/v2/algod/ready.js +3 -1
- package/dist/esm/client/v2/algod/ready.js.map +1 -1
- package/dist/esm/client/v2/algod/sendRawTransaction.js +15 -6
- package/dist/esm/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +12 -7
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
- package/dist/esm/client/v2/algod/setSyncRound.js +12 -7
- package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/simulateTransaction.js +14 -11
- package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/esm/client/v2/algod/stateproof.js +9 -4
- package/dist/esm/client/v2/algod/stateproof.js.map +1 -1
- package/dist/esm/client/v2/algod/status.js +7 -1
- package/dist/esm/client/v2/algod/status.js.map +1 -1
- package/dist/esm/client/v2/algod/statusAfterBlock.js +9 -4
- package/dist/esm/client/v2/algod/statusAfterBlock.js.map +1 -1
- package/dist/esm/client/v2/algod/suggestedParams.js +12 -8
- package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/esm/client/v2/algod/supply.js +7 -1
- package/dist/esm/client/v2/algod/supply.js.map +1 -1
- package/dist/esm/client/v2/algod/unsetSyncRound.js +10 -4
- package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/versions.js +7 -1
- package/dist/esm/client/v2/algod/versions.js.map +1 -1
- package/dist/esm/client/v2/indexer/index.js +4 -0
- package/dist/esm/client/v2/indexer/index.js.map +1 -0
- package/dist/esm/client/v2/indexer/indexer.js +42 -42
- package/dist/esm/client/v2/indexer/indexer.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountAssets.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountByID.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +18 -11
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js +9 -9
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplicationLogs.js +9 -4
- package/dist/esm/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplications.js +9 -4
- package/dist/esm/client/v2/indexer/lookupApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js +9 -4
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetByID.js +9 -4
- package/dist/esm/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +17 -10
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupBlock.js +9 -4
- package/dist/esm/client/v2/indexer/lookupBlock.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupTransactionByID.js +9 -4
- package/dist/esm/client/v2/indexer/lookupTransactionByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/makeHealthCheck.js +7 -1
- package/dist/esm/client/v2/indexer/makeHealthCheck.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +3591 -1648
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchAccounts.js +8 -2
- package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js +7 -7
- package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForApplications.js +8 -2
- package/dist/esm/client/v2/indexer/searchForApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForAssets.js +8 -2
- package/dist/esm/client/v2/indexer/searchForAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForTransactions.js +15 -7
- package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/esm/client/v2/jsonrequest.js +22 -51
- package/dist/esm/client/v2/jsonrequest.js.map +1 -1
- package/dist/esm/client/v2/serviceClient.js +3 -20
- package/dist/esm/client/v2/serviceClient.js.map +1 -1
- package/dist/esm/client/v2/untypedmodel.js +18 -0
- package/dist/esm/client/v2/untypedmodel.js.map +1 -0
- package/dist/esm/composer.js +43 -37
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/convert.js.map +1 -1
- package/dist/esm/dryrun.js +98 -195
- package/dist/esm/dryrun.js.map +1 -1
- package/dist/esm/encoding/address.js +85 -100
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/encoding/bigint.js +2 -3
- package/dist/esm/encoding/bigint.js.map +1 -1
- package/dist/esm/encoding/binarydata.js +73 -0
- package/dist/esm/encoding/binarydata.js.map +1 -0
- package/dist/esm/encoding/encoding.js +337 -12
- package/dist/esm/encoding/encoding.js.map +1 -1
- package/dist/esm/encoding/schema/address.js +37 -0
- package/dist/esm/encoding/schema/address.js.map +1 -0
- package/dist/esm/encoding/schema/array.js +39 -0
- package/dist/esm/encoding/schema/array.js.map +1 -0
- package/dist/esm/encoding/schema/binarystring.js +51 -0
- package/dist/esm/encoding/schema/binarystring.js.map +1 -0
- package/dist/esm/encoding/schema/blockhash.js +60 -0
- package/dist/esm/encoding/schema/blockhash.js.map +1 -0
- package/dist/esm/encoding/schema/boolean.js +38 -0
- package/dist/esm/encoding/schema/boolean.js.map +1 -0
- package/dist/esm/encoding/schema/bytearray.js +93 -0
- package/dist/esm/encoding/schema/bytearray.js.map +1 -0
- package/dist/esm/encoding/schema/index.js +12 -0
- package/dist/esm/encoding/schema/index.js.map +1 -0
- package/dist/esm/encoding/schema/map.js +517 -0
- package/dist/esm/encoding/schema/map.js.map +1 -0
- package/dist/esm/encoding/schema/optional.js +54 -0
- package/dist/esm/encoding/schema/optional.js.map +1 -0
- package/dist/esm/encoding/schema/string.js +39 -0
- package/dist/esm/encoding/schema/string.js.map +1 -0
- package/dist/esm/encoding/schema/uint64.js +32 -0
- package/dist/esm/encoding/schema/uint64.js.map +1 -0
- package/dist/esm/encoding/schema/untyped.js +29 -0
- package/dist/esm/encoding/schema/untyped.js.map +1 -0
- package/dist/esm/encoding/uint64.js +1 -1
- package/dist/esm/encoding/uint64.js.map +1 -1
- package/dist/esm/group.js +22 -58
- package/dist/esm/group.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logic/sourcemap.js +54 -23
- package/dist/esm/logic/sourcemap.js.map +1 -1
- package/dist/esm/logicsig.js +110 -141
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/main.js +47 -76
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/makeTxn.js +314 -513
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/mnemonic/mnemonic.js +5 -5
- package/dist/esm/mnemonic/mnemonic.js.map +1 -1
- package/dist/esm/multisig.js +56 -305
- package/dist/esm/multisig.js.map +1 -1
- package/dist/esm/multisigSigning.js +254 -0
- package/dist/esm/multisigSigning.js.map +1 -0
- package/dist/esm/nacl/naclWrappers.js +1 -1
- package/dist/esm/nacl/naclWrappers.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/dist/esm/signedTransaction.js +100 -0
- package/dist/esm/signedTransaction.js.map +1 -0
- package/dist/esm/signer.js +3 -3
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/signing.js +77 -0
- package/dist/esm/signing.js.map +1 -0
- package/dist/esm/stateproof.js +408 -0
- package/dist/esm/stateproof.js.map +1 -0
- package/dist/esm/transaction.js +723 -1005
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/block.js +797 -0
- package/dist/esm/types/block.js.map +1 -0
- package/dist/esm/types/intDecoding.js +1 -1
- package/dist/esm/types/intDecoding.js.map +1 -1
- package/dist/esm/types/statedelta.js +1129 -0
- package/dist/esm/types/statedelta.js.map +1 -0
- package/dist/esm/types/transactions/base.js +18 -2
- package/dist/esm/types/transactions/base.js.map +1 -1
- package/dist/esm/types/transactions/encoded.js +62 -1
- package/dist/esm/types/transactions/encoded.js.map +1 -1
- package/dist/esm/types/transactions/index.js +2 -3
- package/dist/esm/types/transactions/index.js.map +1 -1
- package/dist/esm/utils/utils.js +80 -21
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/esm/wait.js +4 -4
- package/dist/esm/wait.js.map +1 -1
- package/dist/types/abi/abi_type.d.ts +1 -1
- package/dist/types/abi/contract.d.ts +5 -1
- package/dist/types/abi/event.d.ts +16 -0
- package/dist/types/abi/index.d.ts +6 -6
- package/dist/types/abi/interface.d.ts +1 -1
- package/dist/types/abi/method.d.ts +12 -5
- package/dist/types/abi/transaction.d.ts +1 -1
- package/dist/types/account.d.ts +1 -1
- package/dist/types/boxStorage.d.ts +4 -5
- package/dist/types/client/baseHTTPClient.d.ts +9 -6
- package/dist/types/client/client.d.ts +59 -18
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/kmd.d.ts +12 -10
- package/dist/types/client/urlTokenBaseHTTPClient.d.ts +8 -5
- package/dist/types/client/v2/algod/accountApplicationInformation.d.ts +8 -6
- package/dist/types/client/v2/algod/accountAssetInformation.d.ts +8 -6
- package/dist/types/client/v2/algod/accountInformation.d.ts +7 -5
- package/dist/types/client/v2/algod/algod.d.ts +53 -52
- package/dist/types/client/v2/algod/block.d.ts +5 -4
- package/dist/types/client/v2/algod/compile.d.ts +7 -9
- package/dist/types/client/v2/algod/disassemble.d.ts +7 -9
- package/dist/types/client/v2/algod/dryrun.d.ts +7 -9
- package/dist/types/client/v2/algod/genesis.d.ts +4 -2
- package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +6 -7
- package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +6 -7
- package/dist/types/client/v2/algod/getApplicationByID.d.ts +6 -5
- package/dist/types/client/v2/algod/getAssetByID.d.ts +6 -5
- package/dist/types/client/v2/algod/getBlockHash.d.ts +7 -6
- package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +5 -4
- package/dist/types/client/v2/algod/getBlockTxids.d.ts +6 -5
- package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +6 -5
- package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +6 -5
- package/dist/types/client/v2/algod/getSyncRound.d.ts +5 -4
- package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +6 -7
- package/dist/types/client/v2/algod/getTransactionProof.d.ts +6 -5
- package/dist/types/client/v2/algod/healthCheck.d.ts +4 -3
- package/dist/types/client/v2/algod/index.d.ts +2 -0
- package/dist/types/client/v2/algod/lightBlockHeaderProof.d.ts +6 -5
- package/dist/types/client/v2/algod/models/types.d.ts +629 -318
- package/dist/types/client/v2/algod/pendingTransactionInformation.d.ts +5 -4
- package/dist/types/client/v2/algod/pendingTransactions.d.ts +5 -4
- package/dist/types/client/v2/algod/pendingTransactionsByAddress.d.ts +7 -5
- package/dist/types/client/v2/algod/ready.d.ts +4 -2
- package/dist/types/client/v2/algod/sendRawTransaction.d.ts +7 -5
- package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +6 -6
- package/dist/types/client/v2/algod/setSyncRound.d.ts +6 -6
- package/dist/types/client/v2/algod/simulateTransaction.d.ts +7 -7
- package/dist/types/client/v2/algod/stateproof.d.ts +6 -5
- package/dist/types/client/v2/algod/status.d.ts +5 -2
- package/dist/types/client/v2/algod/statusAfterBlock.d.ts +6 -5
- package/dist/types/client/v2/algod/suggestedParams.d.ts +25 -4
- package/dist/types/client/v2/algod/supply.d.ts +5 -2
- package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -3
- package/dist/types/client/v2/algod/versions.d.ts +5 -2
- package/dist/types/client/v2/indexer/index.d.ts +2 -0
- package/dist/types/client/v2/indexer/indexer.d.ts +31 -30
- package/dist/types/client/v2/indexer/lookupAccountAppLocalStates.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountAssets.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountByID.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountCreatedApplications.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountCreatedAssets.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +11 -9
- package/dist/types/client/v2/indexer/lookupApplicationBoxByIDandName.d.ts +6 -7
- package/dist/types/client/v2/indexer/lookupApplicationLogs.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupApplications.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetBalances.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetByID.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +12 -10
- package/dist/types/client/v2/indexer/lookupBlock.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupTransactionByID.d.ts +6 -5
- package/dist/types/client/v2/indexer/makeHealthCheck.d.ts +5 -2
- package/dist/types/client/v2/indexer/models/types.d.ts +513 -267
- package/dist/types/client/v2/indexer/searchAccounts.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForApplicationBoxes.d.ts +6 -7
- package/dist/types/client/v2/indexer/searchForApplications.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForAssets.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForTransactions.d.ts +11 -7
- package/dist/types/client/v2/jsonrequest.d.ts +20 -33
- package/dist/types/client/v2/serviceClient.d.ts +4 -18
- package/dist/types/client/v2/untypedmodel.d.ts +10 -0
- package/dist/types/composer.d.ts +18 -17
- package/dist/types/dryrun.d.ts +8 -80
- package/dist/types/encoding/address.d.ts +40 -31
- package/dist/types/encoding/binarydata.d.ts +30 -0
- package/dist/types/encoding/encoding.d.ts +219 -7
- package/dist/types/encoding/schema/address.d.ts +10 -0
- package/dist/types/encoding/schema/array.d.ts +11 -0
- package/dist/types/encoding/schema/binarystring.d.ts +18 -0
- package/dist/types/encoding/schema/blockhash.d.ts +16 -0
- package/dist/types/encoding/schema/boolean.d.ts +10 -0
- package/dist/types/encoding/schema/bytearray.d.ts +19 -0
- package/dist/types/encoding/schema/index.d.ts +11 -0
- package/dist/types/encoding/schema/map.d.ts +125 -0
- package/dist/types/encoding/schema/optional.d.ts +24 -0
- package/dist/types/encoding/schema/string.d.ts +9 -0
- package/dist/types/encoding/schema/uint64.d.ts +9 -0
- package/dist/types/encoding/schema/untyped.d.ts +9 -0
- package/dist/types/encoding/uint64.d.ts +1 -0
- package/dist/types/group.d.ts +6 -25
- package/dist/types/index.d.ts +2 -2
- package/dist/types/logic/sourcemap.d.ts +39 -13
- package/dist/types/logicsig.d.ts +27 -57
- package/dist/types/main.d.ts +43 -54
- package/dist/types/makeTxn.d.ts +129 -388
- package/dist/types/mnemonic/mnemonic.d.ts +1 -1
- package/dist/types/multisig.d.ts +28 -99
- package/dist/types/multisigSigning.d.ts +72 -0
- package/dist/types/signedTransaction.d.ts +55 -0
- package/dist/types/signer.d.ts +5 -5
- package/dist/types/signing.d.ts +29 -0
- package/dist/types/stateproof.d.ts +194 -0
- package/dist/types/transaction.d.ts +103 -182
- package/dist/types/types/account.d.ts +2 -1
- package/dist/types/types/block.d.ts +407 -0
- package/dist/types/types/intDecoding.d.ts +1 -1
- package/dist/types/types/statedelta.d.ts +575 -0
- package/dist/types/types/transactions/base.d.ts +206 -118
- package/dist/types/types/transactions/encoded.d.ts +7 -301
- package/dist/types/types/transactions/index.d.ts +2 -15
- package/dist/types/types/utils.d.ts +7 -7
- package/dist/types/utils/utils.d.ts +21 -16
- package/dist/types/wait.d.ts +3 -2
- package/package.json +48 -20
- package/src/abi/abi_type.ts +28 -18
- package/src/abi/contract.ts +7 -1
- package/src/abi/event.ts +16 -0
- package/src/abi/index.ts +6 -6
- package/src/abi/interface.ts +1 -1
- package/src/abi/method.ts +22 -8
- package/src/abi/transaction.ts +2 -2
- package/src/account.ts +5 -5
- package/src/boxStorage.ts +25 -23
- package/src/client/baseHTTPClient.ts +12 -6
- package/src/client/client.ts +147 -75
- package/src/client/index.ts +6 -0
- package/src/client/kmd.ts +79 -72
- package/src/client/urlTokenBaseHTTPClient.ts +25 -14
- package/src/client/v2/algod/accountApplicationInformation.ts +16 -9
- package/src/client/v2/algod/accountAssetInformation.ts +16 -9
- package/src/client/v2/algod/accountInformation.ts +16 -11
- package/src/client/v2/algod/algod.ts +83 -105
- package/src/client/v2/algod/block.ts +7 -11
- package/src/client/v2/algod/compile.ts +27 -19
- package/src/client/v2/algod/disassemble.ts +27 -19
- package/src/client/v2/algod/dryrun.ts +23 -19
- package/src/client/v2/algod/genesis.ts +8 -2
- package/src/client/v2/algod/getApplicationBoxByName.ts +10 -15
- package/src/client/v2/algod/getApplicationBoxes.ts +12 -13
- package/src/client/v2/algod/getApplicationByID.ts +15 -7
- package/src/client/v2/algod/getAssetByID.ts +15 -7
- package/src/client/v2/algod/getBlockHash.ts +13 -9
- package/src/client/v2/algod/getBlockOffsetTimestamp.ts +7 -8
- package/src/client/v2/algod/getBlockTxids.ts +12 -6
- package/src/client/v2/algod/getLedgerStateDelta.ts +16 -8
- package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -8
- package/src/client/v2/algod/getSyncRound.ts +7 -8
- package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +15 -15
- package/src/client/v2/algod/getTransactionProof.ts +11 -9
- package/src/client/v2/algod/healthCheck.ts +5 -9
- package/src/client/v2/algod/index.ts +3 -0
- package/src/client/v2/algod/lightBlockHeaderProof.ts +15 -8
- package/src/client/v2/algod/models/types.ts +4729 -2254
- package/src/client/v2/algod/pendingTransactionInformation.ts +11 -11
- package/src/client/v2/algod/pendingTransactions.ts +7 -9
- package/src/client/v2/algod/pendingTransactionsByAddress.ts +12 -11
- package/src/client/v2/algod/ready.ts +6 -2
- package/src/client/v2/algod/sendRawTransaction.ts +24 -13
- package/src/client/v2/algod/setBlockOffsetTimestamp.ts +21 -11
- package/src/client/v2/algod/setSyncRound.ts +21 -11
- package/src/client/v2/algod/simulateTransaction.ts +22 -23
- package/src/client/v2/algod/stateproof.ts +15 -8
- package/src/client/v2/algod/status.ts +10 -2
- package/src/client/v2/algod/statusAfterBlock.ts +15 -7
- package/src/client/v2/algod/suggestedParams.ts +40 -10
- package/src/client/v2/algod/supply.ts +10 -2
- package/src/client/v2/algod/unsetSyncRound.ts +16 -5
- package/src/client/v2/algod/versions.ts +10 -2
- package/src/client/v2/indexer/index.ts +3 -0
- package/src/client/v2/indexer/indexer.ts +51 -59
- package/src/client/v2/indexer/lookupAccountAppLocalStates.ts +16 -11
- package/src/client/v2/indexer/lookupAccountAssets.ts +16 -11
- package/src/client/v2/indexer/lookupAccountByID.ts +16 -11
- package/src/client/v2/indexer/lookupAccountCreatedApplications.ts +16 -11
- package/src/client/v2/indexer/lookupAccountCreatedAssets.ts +16 -11
- package/src/client/v2/indexer/lookupAccountTransactions.ts +26 -19
- package/src/client/v2/indexer/lookupApplicationBoxByIDandName.ts +10 -15
- package/src/client/v2/indexer/lookupApplicationLogs.ts +15 -7
- package/src/client/v2/indexer/lookupApplications.ts +15 -7
- package/src/client/v2/indexer/lookupAssetBalances.ts +15 -7
- package/src/client/v2/indexer/lookupAssetByID.ts +15 -7
- package/src/client/v2/indexer/lookupAssetTransactions.ts +27 -16
- package/src/client/v2/indexer/lookupBlock.ts +15 -7
- package/src/client/v2/indexer/lookupTransactionByID.ts +15 -7
- package/src/client/v2/indexer/makeHealthCheck.ts +10 -2
- package/src/client/v2/indexer/models/types.ts +4454 -1988
- package/src/client/v2/indexer/searchAccounts.ts +13 -4
- package/src/client/v2/indexer/searchForApplicationBoxes.ts +12 -13
- package/src/client/v2/indexer/searchForApplications.ts +13 -4
- package/src/client/v2/indexer/searchForAssets.ts +13 -4
- package/src/client/v2/indexer/searchForTransactions.ts +22 -11
- package/src/client/v2/jsonrequest.ts +39 -57
- package/src/client/v2/serviceClient.ts +9 -31
- package/src/client/v2/untypedmodel.ts +25 -0
- package/src/composer.ts +83 -60
- package/src/dryrun.ts +129 -306
- package/src/encoding/address.ts +134 -146
- package/src/encoding/bigint.ts +2 -4
- package/src/encoding/binarydata.ts +80 -0
- package/src/encoding/encoding.ts +558 -13
- package/src/encoding/schema/address.ts +53 -0
- package/src/encoding/schema/array.ts +66 -0
- package/src/encoding/schema/binarystring.ts +73 -0
- package/src/encoding/schema/blockhash.ts +84 -0
- package/src/encoding/schema/boolean.ts +54 -0
- package/src/encoding/schema/bytearray.ts +127 -0
- package/src/encoding/schema/index.ts +26 -0
- package/src/encoding/schema/map.ts +713 -0
- package/src/encoding/schema/optional.ts +72 -0
- package/src/encoding/schema/string.ts +55 -0
- package/src/encoding/schema/uint64.ts +46 -0
- package/src/encoding/schema/untyped.ts +47 -0
- package/src/encoding/uint64.ts +2 -1
- package/src/group.ts +27 -75
- package/src/index.ts +2 -2
- package/src/logic/sourcemap.ts +94 -29
- package/src/logicsig.ts +154 -202
- package/src/main.ts +91 -94
- package/src/makeTxn.ts +670 -1320
- package/src/mnemonic/mnemonic.ts +14 -14
- package/src/multisig.ts +89 -403
- package/src/multisigSigning.ts +359 -0
- package/src/nacl/naclWrappers.ts +1 -1
- package/src/signedTransaction.ts +163 -0
- package/src/signer.ts +10 -5
- package/src/signing.ts +95 -0
- package/src/stateproof.ts +595 -0
- package/src/transaction.ts +986 -1242
- package/src/types/account.ts +3 -1
- package/src/types/block.ts +1278 -0
- package/src/types/intDecoding.ts +1 -1
- package/src/types/statedelta.ts +1717 -0
- package/src/types/transactions/base.ts +230 -122
- package/src/types/transactions/encoded.ts +81 -371
- package/src/types/transactions/index.ts +2 -72
- package/src/types/utils.ts +3 -3
- package/src/utils/utils.ts +96 -25
- package/src/wait.ts +8 -7
- package/dist/cjs/bid.js +0 -83
- package/dist/cjs/bid.js.map +0 -1
- package/dist/cjs/client/v2/basemodel.js +0 -67
- package/dist/cjs/client/v2/basemodel.js.map +0 -1
- package/dist/cjs/types/address.js +0 -3
- package/dist/cjs/types/address.js.map +0 -1
- package/dist/cjs/types/blockHeader.js +0 -3
- package/dist/cjs/types/blockHeader.js.map +0 -1
- package/dist/cjs/types/index.js.map +0 -1
- package/dist/cjs/types/multisig.js +0 -3
- package/dist/cjs/types/multisig.js.map +0 -1
- package/dist/cjs/types/transactions/application.js +0 -3
- package/dist/cjs/types/transactions/application.js.map +0 -1
- package/dist/cjs/types/transactions/asset.js.map +0 -1
- package/dist/cjs/types/transactions/builder.js +0 -3
- package/dist/cjs/types/transactions/builder.js.map +0 -1
- package/dist/cjs/types/transactions/keyreg.js +0 -3
- package/dist/cjs/types/transactions/keyreg.js.map +0 -1
- package/dist/cjs/types/transactions/payment.js +0 -3
- package/dist/cjs/types/transactions/payment.js.map +0 -1
- package/dist/cjs/types/transactions/stateproof.js +0 -3
- package/dist/cjs/types/transactions/stateproof.js.map +0 -1
- package/dist/esm/bid.js +0 -57
- package/dist/esm/bid.js.map +0 -1
- package/dist/esm/client/v2/basemodel.js +0 -64
- package/dist/esm/client/v2/basemodel.js.map +0 -1
- package/dist/esm/types/address.js +0 -2
- package/dist/esm/types/address.js.map +0 -1
- package/dist/esm/types/blockHeader.js +0 -2
- package/dist/esm/types/blockHeader.js.map +0 -1
- package/dist/esm/types/index.js +0 -4
- package/dist/esm/types/index.js.map +0 -1
- package/dist/esm/types/multisig.js +0 -2
- package/dist/esm/types/multisig.js.map +0 -1
- package/dist/esm/types/transactions/application.js +0 -2
- package/dist/esm/types/transactions/application.js.map +0 -1
- package/dist/esm/types/transactions/asset.js +0 -2
- package/dist/esm/types/transactions/asset.js.map +0 -1
- package/dist/esm/types/transactions/builder.js +0 -2
- package/dist/esm/types/transactions/builder.js.map +0 -1
- package/dist/esm/types/transactions/keyreg.js +0 -2
- package/dist/esm/types/transactions/keyreg.js.map +0 -1
- package/dist/esm/types/transactions/payment.js +0 -2
- package/dist/esm/types/transactions/payment.js.map +0 -1
- package/dist/esm/types/transactions/stateproof.js +0 -2
- package/dist/esm/types/transactions/stateproof.js.map +0 -1
- package/dist/types/bid.d.ts +0 -38
- package/dist/types/client/v2/basemodel.d.ts +0 -11
- package/dist/types/types/address.d.ts +0 -7
- package/dist/types/types/blockHeader.d.ts +0 -67
- package/dist/types/types/index.d.ts +0 -3
- package/dist/types/types/multisig.d.ts +0 -20
- package/dist/types/types/transactions/application.d.ts +0 -22
- package/dist/types/types/transactions/asset.d.ts +0 -28
- package/dist/types/types/transactions/builder.d.ts +0 -36
- package/dist/types/types/transactions/keyreg.d.ts +0 -8
- package/dist/types/types/transactions/payment.d.ts +0 -8
- package/dist/types/types/transactions/stateproof.d.ts +0 -8
- package/src/bid.ts +0 -96
- package/src/client/v2/basemodel.ts +0 -81
- package/src/types/address.ts +0 -7
- package/src/types/blockHeader.ts +0 -81
- package/src/types/index.ts +0 -3
- package/src/types/multisig.ts +0 -22
- package/src/types/transactions/application.ts +0 -111
- package/src/types/transactions/asset.ts +0 -108
- package/src/types/transactions/builder.ts +0 -69
- package/src/types/transactions/keyreg.ts +0 -23
- package/src/types/transactions/payment.ts +0 -14
- package/src/types/transactions/stateproof.ts +0 -17
package/src/makeTxn.ts
CHANGED
|
@@ -1,1448 +1,798 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OnApplicationComplete } from './types/transactions/base';
|
|
1
|
+
import { Transaction } from './transaction.js';
|
|
3
2
|
import {
|
|
4
|
-
|
|
5
|
-
PaymentTxn,
|
|
6
|
-
KeyRegistrationTxn,
|
|
7
|
-
|
|
8
|
-
// Utilities
|
|
3
|
+
OnApplicationComplete,
|
|
9
4
|
TransactionType,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
SuggestedParams,
|
|
6
|
+
PaymentTransactionParams,
|
|
7
|
+
KeyRegistrationTransactionParams,
|
|
8
|
+
AssetConfigurationTransactionParams,
|
|
9
|
+
AssetTransferTransactionParams,
|
|
10
|
+
AssetFreezeTransactionParams,
|
|
11
|
+
ApplicationCallTransactionParams,
|
|
12
|
+
} from './types/transactions/base.js';
|
|
13
|
+
import { Address } from './encoding/address.js';
|
|
14
|
+
|
|
15
|
+
/** Contains parameters common to every transaction type */
|
|
16
|
+
export interface CommonTransactionParams {
|
|
17
|
+
/** Algorand address of sender */
|
|
18
|
+
sender: string | Address;
|
|
19
|
+
/** Suggested parameters relevant to the network that will accept this transaction */
|
|
20
|
+
suggestedParams: SuggestedParams;
|
|
21
|
+
/** Optional, arbitrary data to be stored in the transaction's note field */
|
|
22
|
+
note?: Uint8Array;
|
|
23
|
+
/**
|
|
24
|
+
* Optional, 32-byte lease to associate with this transaction.
|
|
25
|
+
*
|
|
26
|
+
* The sender cannot send another transaction with the same lease until the last round of original
|
|
27
|
+
* transaction has passed.
|
|
28
|
+
*/
|
|
29
|
+
lease?: Uint8Array;
|
|
30
|
+
/** The Algorand address that will be used to authorize all future transactions from the sender, if provided. */
|
|
31
|
+
rekeyTo?: string | Address;
|
|
32
|
+
}
|
|
25
33
|
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @param
|
|
30
|
-
* @param amount - integer amount to send, in microAlgos
|
|
31
|
-
* @param closeRemainderTo - optionally close out remaining account balance to this account, represented as string rep of Algorand address
|
|
32
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
33
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
34
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
35
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
36
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
37
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
38
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
39
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
40
|
-
* genesisID - string specifies genesis ID of network in use
|
|
41
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
35
|
+
* Create a new payment transaction
|
|
36
|
+
*
|
|
37
|
+
* @param options - Payment transaction parameters
|
|
42
38
|
*/
|
|
43
|
-
export function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
amount
|
|
47
|
-
closeRemainderTo
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
closeRemainderTo,
|
|
39
|
+
export function makePaymentTxnWithSuggestedParamsFromObject({
|
|
40
|
+
sender,
|
|
41
|
+
receiver,
|
|
42
|
+
amount,
|
|
43
|
+
closeRemainderTo,
|
|
44
|
+
suggestedParams,
|
|
45
|
+
note,
|
|
46
|
+
lease,
|
|
47
|
+
rekeyTo,
|
|
48
|
+
}: PaymentTransactionParams & CommonTransactionParams): Transaction {
|
|
49
|
+
return new Transaction({
|
|
50
|
+
type: TransactionType.pay,
|
|
51
|
+
sender,
|
|
57
52
|
note,
|
|
53
|
+
lease,
|
|
54
|
+
rekeyTo,
|
|
58
55
|
suggestedParams,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// helper for above makePaymentTxnWithSuggestedParams, instead accepting an arguments object
|
|
66
|
-
export function makePaymentTxnWithSuggestedParamsFromObject(
|
|
67
|
-
o: Expand<
|
|
68
|
-
Pick<
|
|
69
|
-
RenameProperty<MustHaveSuggestedParams<PaymentTxn>, 'reKeyTo', 'rekeyTo'>,
|
|
70
|
-
| 'from'
|
|
71
|
-
| 'to'
|
|
72
|
-
| 'amount'
|
|
73
|
-
| 'closeRemainderTo'
|
|
74
|
-
| 'note'
|
|
75
|
-
| 'suggestedParams'
|
|
76
|
-
| 'rekeyTo'
|
|
77
|
-
>
|
|
78
|
-
>
|
|
79
|
-
) {
|
|
80
|
-
return makePaymentTxnWithSuggestedParams(
|
|
81
|
-
o.from,
|
|
82
|
-
o.to,
|
|
83
|
-
o.amount,
|
|
84
|
-
o.closeRemainderTo,
|
|
85
|
-
o.note,
|
|
86
|
-
o.suggestedParams,
|
|
87
|
-
o.rekeyTo
|
|
88
|
-
);
|
|
56
|
+
paymentParams: {
|
|
57
|
+
receiver,
|
|
58
|
+
amount,
|
|
59
|
+
closeRemainderTo,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
89
62
|
}
|
|
90
63
|
|
|
91
64
|
/**
|
|
92
|
-
*
|
|
93
|
-
* that key registration operation
|
|
65
|
+
* Create a new key registration transaction
|
|
94
66
|
*
|
|
95
|
-
* @param
|
|
96
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
97
|
-
* @param voteKey - voting key. for key deregistration, leave undefined
|
|
98
|
-
* @param selectionKey - selection key. for key deregistration, leave undefined
|
|
99
|
-
* @param voteFirst - first round on which voteKey is valid
|
|
100
|
-
* @param voteLast - last round on which voteKey is valid
|
|
101
|
-
* @param voteKeyDilution - integer
|
|
102
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
103
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
104
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
105
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
106
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
107
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
108
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
109
|
-
* genesisID - string specifies genesis ID of network in use
|
|
110
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
111
|
-
* @param nonParticipation - configure whether the address wants to stop participating. If true,
|
|
112
|
-
* voteKey, selectionKey, voteFirst, voteLast, and voteKeyDilution must be undefined.
|
|
113
|
-
* @param stateProofKey - state proof key. for key deregistration, leave undefined
|
|
67
|
+
* @param options - Key registration transaction parameters
|
|
114
68
|
*/
|
|
115
|
-
export function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
voteFirst
|
|
121
|
-
voteLast
|
|
122
|
-
voteKeyDilution
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
selectionKey: undefined,
|
|
133
|
-
voteFirst: undefined,
|
|
134
|
-
voteLast: undefined,
|
|
135
|
-
voteKeyDilution: undefined,
|
|
136
|
-
suggestedParams: MustHaveSuggestedParams<KeyRegistrationTxn>['suggestedParams'],
|
|
137
|
-
rekeyTo?: KeyRegistrationTxn['reKeyTo'],
|
|
138
|
-
nonParticipation?: boolean,
|
|
139
|
-
stateProofKey?: undefined
|
|
140
|
-
): txnBuilder.Transaction;
|
|
141
|
-
export function makeKeyRegistrationTxnWithSuggestedParams(
|
|
142
|
-
from: any,
|
|
143
|
-
note: any,
|
|
144
|
-
voteKey: any,
|
|
145
|
-
selectionKey: any,
|
|
146
|
-
voteFirst: any,
|
|
147
|
-
voteLast: any,
|
|
148
|
-
voteKeyDilution: any,
|
|
149
|
-
suggestedParams: any,
|
|
150
|
-
rekeyTo?: any,
|
|
151
|
-
nonParticipation = false,
|
|
152
|
-
stateProofKey: any = undefined
|
|
153
|
-
) {
|
|
154
|
-
const o: KeyRegistrationTxn = {
|
|
155
|
-
from,
|
|
69
|
+
export function makeKeyRegistrationTxnWithSuggestedParamsFromObject({
|
|
70
|
+
sender,
|
|
71
|
+
voteKey,
|
|
72
|
+
selectionKey,
|
|
73
|
+
stateProofKey,
|
|
74
|
+
voteFirst,
|
|
75
|
+
voteLast,
|
|
76
|
+
voteKeyDilution,
|
|
77
|
+
nonParticipation,
|
|
78
|
+
suggestedParams,
|
|
79
|
+
note,
|
|
80
|
+
lease,
|
|
81
|
+
rekeyTo,
|
|
82
|
+
}: KeyRegistrationTransactionParams & CommonTransactionParams): Transaction {
|
|
83
|
+
return new Transaction({
|
|
84
|
+
type: TransactionType.keyreg,
|
|
85
|
+
sender,
|
|
156
86
|
note,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
voteFirst,
|
|
160
|
-
voteLast,
|
|
161
|
-
voteKeyDilution,
|
|
87
|
+
lease,
|
|
88
|
+
rekeyTo,
|
|
162
89
|
suggestedParams,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
90
|
+
keyregParams: {
|
|
91
|
+
voteKey,
|
|
92
|
+
selectionKey,
|
|
93
|
+
stateProofKey,
|
|
94
|
+
voteFirst,
|
|
95
|
+
voteLast,
|
|
96
|
+
voteKeyDilution,
|
|
97
|
+
nonParticipation,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
169
100
|
}
|
|
170
101
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
o: Expand<
|
|
174
|
-
Pick<
|
|
175
|
-
RenameProperty<
|
|
176
|
-
MustHaveSuggestedParams<KeyRegistrationTxn>,
|
|
177
|
-
'reKeyTo',
|
|
178
|
-
'rekeyTo'
|
|
179
|
-
>,
|
|
180
|
-
| 'from'
|
|
181
|
-
| 'note'
|
|
182
|
-
| 'voteKey'
|
|
183
|
-
| 'selectionKey'
|
|
184
|
-
| 'stateProofKey'
|
|
185
|
-
| 'voteFirst'
|
|
186
|
-
| 'voteLast'
|
|
187
|
-
| 'voteKeyDilution'
|
|
188
|
-
| 'suggestedParams'
|
|
189
|
-
| 'rekeyTo'
|
|
190
|
-
> & {
|
|
191
|
-
nonParticipation?: false;
|
|
192
|
-
}
|
|
193
|
-
>
|
|
194
|
-
): txnBuilder.Transaction;
|
|
195
|
-
export function makeKeyRegistrationTxnWithSuggestedParamsFromObject(
|
|
196
|
-
o: Expand<
|
|
197
|
-
Pick<
|
|
198
|
-
RenameProperty<
|
|
199
|
-
MustHaveSuggestedParams<KeyRegistrationTxn>,
|
|
200
|
-
'reKeyTo',
|
|
201
|
-
'rekeyTo'
|
|
202
|
-
>,
|
|
203
|
-
'from' | 'note' | 'suggestedParams' | 'rekeyTo' | 'nonParticipation'
|
|
204
|
-
>
|
|
205
|
-
>
|
|
206
|
-
): txnBuilder.Transaction;
|
|
207
|
-
export function makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: any) {
|
|
208
|
-
return makeKeyRegistrationTxnWithSuggestedParams(
|
|
209
|
-
o.from,
|
|
210
|
-
o.note,
|
|
211
|
-
o.voteKey,
|
|
212
|
-
o.selectionKey,
|
|
213
|
-
o.voteFirst,
|
|
214
|
-
o.voteLast,
|
|
215
|
-
o.voteKeyDilution,
|
|
216
|
-
o.suggestedParams,
|
|
217
|
-
o.rekeyTo,
|
|
218
|
-
o.nonParticipation,
|
|
219
|
-
o.stateProofKey
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/** makeAssetCreateTxnWithSuggestedParams takes asset creation arguments and returns a Transaction object
|
|
224
|
-
* for creating that asset
|
|
102
|
+
/**
|
|
103
|
+
* Base function for creating any type of asset config transaction.
|
|
225
104
|
*
|
|
226
|
-
* @param
|
|
227
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
228
|
-
* @param total - integer total supply of the asset
|
|
229
|
-
* @param decimals - integer number of decimals for asset unit calculation
|
|
230
|
-
* @param defaultFrozen - boolean whether asset accounts should default to being frozen
|
|
231
|
-
* @param manager - string representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc
|
|
232
|
-
* @param reserve - string representation of Algorand address representing asset reserve
|
|
233
|
-
* @param freeze - string representation of Algorand address with power to freeze/unfreeze asset holdings
|
|
234
|
-
* @param clawback - string representation of Algorand address with power to revoke asset holdings
|
|
235
|
-
* @param unitName - string units name for this asset
|
|
236
|
-
* @param assetName - string name for this asset
|
|
237
|
-
* @param assetURL - string URL relating to this asset
|
|
238
|
-
* @param assetMetadataHash - Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.
|
|
239
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
240
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
241
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
242
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
243
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
244
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
245
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
246
|
-
* genesisID - string specifies genesis ID of network in use
|
|
247
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
105
|
+
* @param options - Asset config transaction parameters
|
|
248
106
|
*/
|
|
249
|
-
export function
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
total
|
|
253
|
-
decimals
|
|
254
|
-
defaultFrozen
|
|
255
|
-
manager
|
|
256
|
-
reserve
|
|
257
|
-
freeze
|
|
258
|
-
clawback
|
|
259
|
-
unitName
|
|
260
|
-
assetName
|
|
261
|
-
assetURL
|
|
262
|
-
assetMetadataHash
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
107
|
+
export function makeBaseAssetConfigTxn({
|
|
108
|
+
sender,
|
|
109
|
+
assetIndex,
|
|
110
|
+
total,
|
|
111
|
+
decimals,
|
|
112
|
+
defaultFrozen,
|
|
113
|
+
manager,
|
|
114
|
+
reserve,
|
|
115
|
+
freeze,
|
|
116
|
+
clawback,
|
|
117
|
+
unitName,
|
|
118
|
+
assetName,
|
|
119
|
+
assetURL,
|
|
120
|
+
assetMetadataHash,
|
|
121
|
+
note,
|
|
122
|
+
lease,
|
|
123
|
+
rekeyTo,
|
|
124
|
+
suggestedParams,
|
|
125
|
+
}: AssetConfigurationTransactionParams & CommonTransactionParams): Transaction {
|
|
126
|
+
return new Transaction({
|
|
127
|
+
type: TransactionType.acfg,
|
|
128
|
+
sender,
|
|
268
129
|
note,
|
|
130
|
+
lease,
|
|
131
|
+
rekeyTo,
|
|
269
132
|
suggestedParams,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
133
|
+
assetConfigParams: {
|
|
134
|
+
assetIndex,
|
|
135
|
+
total,
|
|
136
|
+
decimals,
|
|
137
|
+
defaultFrozen,
|
|
138
|
+
manager,
|
|
139
|
+
reserve,
|
|
140
|
+
freeze,
|
|
141
|
+
clawback,
|
|
142
|
+
unitName,
|
|
143
|
+
assetName,
|
|
144
|
+
assetURL,
|
|
145
|
+
assetMetadataHash,
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Create a new asset creation transaction
|
|
152
|
+
*
|
|
153
|
+
* @param options - Asset creation transaction parameters
|
|
154
|
+
*/
|
|
155
|
+
export function makeAssetCreateTxnWithSuggestedParamsFromObject({
|
|
156
|
+
sender,
|
|
157
|
+
total,
|
|
158
|
+
decimals,
|
|
159
|
+
defaultFrozen,
|
|
160
|
+
manager,
|
|
161
|
+
reserve,
|
|
162
|
+
freeze,
|
|
163
|
+
clawback,
|
|
164
|
+
unitName,
|
|
165
|
+
assetName,
|
|
166
|
+
assetURL,
|
|
167
|
+
assetMetadataHash,
|
|
168
|
+
note,
|
|
169
|
+
lease,
|
|
170
|
+
rekeyTo,
|
|
171
|
+
suggestedParams,
|
|
172
|
+
}: Omit<AssetConfigurationTransactionParams, 'assetIndex'> &
|
|
173
|
+
CommonTransactionParams): Transaction {
|
|
174
|
+
return makeBaseAssetConfigTxn({
|
|
175
|
+
sender,
|
|
176
|
+
total,
|
|
177
|
+
decimals,
|
|
178
|
+
defaultFrozen,
|
|
179
|
+
manager,
|
|
180
|
+
reserve,
|
|
181
|
+
freeze,
|
|
182
|
+
clawback,
|
|
183
|
+
unitName,
|
|
274
184
|
assetName,
|
|
275
185
|
assetURL,
|
|
276
186
|
assetMetadataHash,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
reKeyTo: rekeyTo,
|
|
283
|
-
};
|
|
284
|
-
return new txnBuilder.Transaction(o);
|
|
187
|
+
note,
|
|
188
|
+
lease,
|
|
189
|
+
rekeyTo,
|
|
190
|
+
suggestedParams,
|
|
191
|
+
});
|
|
285
192
|
}
|
|
286
193
|
|
|
287
|
-
|
|
288
|
-
export
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
o.reserve,
|
|
331
|
-
o.freeze,
|
|
332
|
-
o.clawback,
|
|
333
|
-
o.unitName,
|
|
334
|
-
o.assetName,
|
|
335
|
-
o.assetURL,
|
|
336
|
-
o.assetMetadataHash,
|
|
337
|
-
o.suggestedParams,
|
|
338
|
-
o.rekeyTo
|
|
339
|
-
);
|
|
194
|
+
/** Contains asset modification transaction parameters */
|
|
195
|
+
export interface AssetModificationTransactionParams {
|
|
196
|
+
/**
|
|
197
|
+
* The unique ID of the asset to be modified
|
|
198
|
+
*/
|
|
199
|
+
assetIndex: number | bigint;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The Algorand address in charge of reserve, freeze, clawback, destruction, etc.
|
|
203
|
+
*
|
|
204
|
+
* If empty, this role will be irrevocably removed from this asset.
|
|
205
|
+
*/
|
|
206
|
+
manager?: string | Address;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The Algorand address representing asset reserve.
|
|
210
|
+
*
|
|
211
|
+
* If empty, this role will be irrevocably removed from this asset.
|
|
212
|
+
*/
|
|
213
|
+
reserve?: string | Address;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The Algorand address with power to freeze/unfreeze asset holdings.
|
|
217
|
+
*
|
|
218
|
+
* If empty, this role will be irrevocably removed from this asset.
|
|
219
|
+
*/
|
|
220
|
+
freeze?: string | Address;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The Algorand address with power to revoke asset holdings.
|
|
224
|
+
*
|
|
225
|
+
* If empty, this role will be irrevocably removed from this asset.
|
|
226
|
+
*/
|
|
227
|
+
clawback?: string | Address;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* This is a safety flag to prevent unintentionally removing a role from an asset. If undefined or
|
|
231
|
+
* true, an error will be thrown if any of assetManager, assetReserve, assetFreeze, or
|
|
232
|
+
* assetClawback are empty.
|
|
233
|
+
*
|
|
234
|
+
* Set this to false to allow removing roles by leaving the corresponding address empty.
|
|
235
|
+
*/
|
|
236
|
+
strictEmptyAddressChecking?: boolean;
|
|
340
237
|
}
|
|
341
238
|
|
|
342
|
-
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
239
|
+
/**
|
|
240
|
+
* Create a new asset config transaction. This transaction can be issued by the asset manager to
|
|
241
|
+
* change the manager, reserve, freeze, or clawback address.
|
|
345
242
|
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* @param
|
|
350
|
-
* @param reserve - string representation of new reserve Algorand address
|
|
351
|
-
* @param freeze - string representation of new freeze manager Algorand address
|
|
352
|
-
* @param clawback - string representation of new revocation manager Algorand address
|
|
353
|
-
* @param strictEmptyAddressChecking - boolean - throw an error if any of manager, reserve, freeze, or clawback are undefined. optional, defaults to true.
|
|
354
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
355
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
356
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
357
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
358
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
359
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
360
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
361
|
-
* genesisID - string specifies genesis ID of network in use
|
|
362
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
243
|
+
* You must respecify existing addresses to keep them the same; leaving a field blank is the same as
|
|
244
|
+
* turning that feature off for this asset.
|
|
245
|
+
*
|
|
246
|
+
* @param options - Asset modification transaction parameters
|
|
363
247
|
*/
|
|
364
|
-
export function
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
rekeyTo
|
|
375
|
-
|
|
248
|
+
export function makeAssetConfigTxnWithSuggestedParamsFromObject({
|
|
249
|
+
sender,
|
|
250
|
+
assetIndex,
|
|
251
|
+
manager,
|
|
252
|
+
reserve,
|
|
253
|
+
freeze,
|
|
254
|
+
clawback,
|
|
255
|
+
strictEmptyAddressChecking,
|
|
256
|
+
note,
|
|
257
|
+
lease,
|
|
258
|
+
rekeyTo,
|
|
259
|
+
suggestedParams,
|
|
260
|
+
}: AssetModificationTransactionParams & CommonTransactionParams): Transaction {
|
|
261
|
+
if (!assetIndex) {
|
|
262
|
+
throw Error('assetIndex must be provided');
|
|
263
|
+
}
|
|
264
|
+
const strictChecking = strictEmptyAddressChecking ?? true;
|
|
376
265
|
if (
|
|
377
|
-
|
|
378
|
-
(manager
|
|
379
|
-
reserve === undefined ||
|
|
380
|
-
freeze === undefined ||
|
|
381
|
-
clawback === undefined)
|
|
266
|
+
strictChecking &&
|
|
267
|
+
(manager == null || reserve == null || freeze == null || clawback == null)
|
|
382
268
|
) {
|
|
383
269
|
throw Error(
|
|
384
|
-
'
|
|
270
|
+
'strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.'
|
|
385
271
|
);
|
|
386
272
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
suggestedParams,
|
|
273
|
+
return makeBaseAssetConfigTxn({
|
|
274
|
+
sender,
|
|
390
275
|
assetIndex,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
type: TransactionType.acfg,
|
|
276
|
+
manager,
|
|
277
|
+
reserve,
|
|
278
|
+
freeze,
|
|
279
|
+
clawback,
|
|
396
280
|
note,
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// helper for above makeAssetConfigTxnWithSuggestedParams, instead accepting an arguments object
|
|
403
|
-
export function makeAssetConfigTxnWithSuggestedParamsFromObject(
|
|
404
|
-
o: Expand<
|
|
405
|
-
Pick<
|
|
406
|
-
RenameProperties<
|
|
407
|
-
MustHaveSuggestedParams<AssetConfigTxn>,
|
|
408
|
-
{
|
|
409
|
-
reKeyTo: 'rekeyTo';
|
|
410
|
-
assetManager: 'manager';
|
|
411
|
-
assetReserve: 'reserve';
|
|
412
|
-
assetFreeze: 'freeze';
|
|
413
|
-
assetClawback: 'clawback';
|
|
414
|
-
}
|
|
415
|
-
>,
|
|
416
|
-
| 'from'
|
|
417
|
-
| 'note'
|
|
418
|
-
| 'assetIndex'
|
|
419
|
-
| 'manager'
|
|
420
|
-
| 'reserve'
|
|
421
|
-
| 'freeze'
|
|
422
|
-
| 'clawback'
|
|
423
|
-
| 'suggestedParams'
|
|
424
|
-
| 'rekeyTo'
|
|
425
|
-
> & {
|
|
426
|
-
strictEmptyAddressChecking: boolean;
|
|
427
|
-
}
|
|
428
|
-
>
|
|
429
|
-
) {
|
|
430
|
-
return makeAssetConfigTxnWithSuggestedParams(
|
|
431
|
-
o.from,
|
|
432
|
-
o.note,
|
|
433
|
-
o.assetIndex,
|
|
434
|
-
o.manager,
|
|
435
|
-
o.reserve,
|
|
436
|
-
o.freeze,
|
|
437
|
-
o.clawback,
|
|
438
|
-
o.suggestedParams,
|
|
439
|
-
o.strictEmptyAddressChecking,
|
|
440
|
-
o.rekeyTo
|
|
441
|
-
);
|
|
281
|
+
lease,
|
|
282
|
+
rekeyTo,
|
|
283
|
+
suggestedParams,
|
|
284
|
+
});
|
|
442
285
|
}
|
|
443
286
|
|
|
444
|
-
/**
|
|
445
|
-
*
|
|
287
|
+
/**
|
|
288
|
+
* Create a new asset destroy transaction. This will allow the asset's manager to remove this asset
|
|
289
|
+
* from the ledger, provided all outstanding assets are held by the creator.
|
|
446
290
|
*
|
|
447
|
-
* @param
|
|
448
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
449
|
-
* @param assetIndex - int asset index uniquely specifying the asset
|
|
450
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
451
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
452
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
453
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
454
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
455
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
456
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
457
|
-
* genesisID - string specifies genesis ID of network in use
|
|
458
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
291
|
+
* @param options - Asset destroy transaction parameters
|
|
459
292
|
*/
|
|
460
|
-
export function
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
rekeyTo
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
293
|
+
export function makeAssetDestroyTxnWithSuggestedParamsFromObject({
|
|
294
|
+
sender,
|
|
295
|
+
assetIndex,
|
|
296
|
+
note,
|
|
297
|
+
lease,
|
|
298
|
+
rekeyTo,
|
|
299
|
+
suggestedParams,
|
|
300
|
+
}: Required<Pick<AssetConfigurationTransactionParams, 'assetIndex'>> &
|
|
301
|
+
CommonTransactionParams): Transaction {
|
|
302
|
+
if (!assetIndex) {
|
|
303
|
+
throw Error('assetIndex must be provided');
|
|
304
|
+
}
|
|
305
|
+
return makeBaseAssetConfigTxn({
|
|
306
|
+
sender,
|
|
470
307
|
assetIndex,
|
|
471
|
-
type: TransactionType.acfg,
|
|
472
308
|
note,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
// helper for above makeAssetDestroyTxnWithSuggestedParams, instead accepting an arguments object
|
|
479
|
-
export function makeAssetDestroyTxnWithSuggestedParamsFromObject(
|
|
480
|
-
o: Expand<
|
|
481
|
-
Pick<
|
|
482
|
-
RenameProperty<
|
|
483
|
-
MustHaveSuggestedParams<AssetDestroyTxn>,
|
|
484
|
-
'reKeyTo',
|
|
485
|
-
'rekeyTo'
|
|
486
|
-
>,
|
|
487
|
-
'from' | 'note' | 'assetIndex' | 'suggestedParams' | 'rekeyTo'
|
|
488
|
-
>
|
|
489
|
-
>
|
|
490
|
-
) {
|
|
491
|
-
return makeAssetDestroyTxnWithSuggestedParams(
|
|
492
|
-
o.from,
|
|
493
|
-
o.note,
|
|
494
|
-
o.assetIndex,
|
|
495
|
-
o.suggestedParams,
|
|
496
|
-
o.rekeyTo
|
|
497
|
-
);
|
|
309
|
+
lease,
|
|
310
|
+
rekeyTo,
|
|
311
|
+
suggestedParams,
|
|
312
|
+
});
|
|
498
313
|
}
|
|
499
314
|
|
|
500
|
-
/**
|
|
501
|
-
*
|
|
315
|
+
/**
|
|
316
|
+
* Create a new asset freeze transaction. This transaction allows the asset's freeze manager to
|
|
317
|
+
* freeze or un-freeze an account, blocking or allowing asset transfers to and from the targeted
|
|
318
|
+
* account.
|
|
502
319
|
*
|
|
503
|
-
* @param
|
|
504
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
505
|
-
* @param assetIndex - int asset index uniquely specifying the asset
|
|
506
|
-
* @param freezeTarget - string representation of Algorand address being frozen or unfrozen
|
|
507
|
-
* @param freezeState - true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact
|
|
508
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
509
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
510
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
511
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
512
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
513
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
514
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
515
|
-
* genesisID - string specifies genesis ID of network in use
|
|
516
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
320
|
+
* @param options - Asset freeze transaction parameters
|
|
517
321
|
*/
|
|
518
|
-
export function
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
322
|
+
export function makeAssetFreezeTxnWithSuggestedParamsFromObject({
|
|
323
|
+
sender,
|
|
324
|
+
assetIndex,
|
|
325
|
+
freezeTarget,
|
|
326
|
+
frozen,
|
|
327
|
+
suggestedParams,
|
|
328
|
+
note,
|
|
329
|
+
lease,
|
|
330
|
+
rekeyTo,
|
|
331
|
+
}: AssetFreezeTransactionParams & CommonTransactionParams): Transaction {
|
|
332
|
+
return new Transaction({
|
|
529
333
|
type: TransactionType.afrz,
|
|
530
|
-
|
|
531
|
-
assetIndex,
|
|
532
|
-
freezeState,
|
|
334
|
+
sender,
|
|
533
335
|
note,
|
|
336
|
+
lease,
|
|
337
|
+
rekeyTo,
|
|
534
338
|
suggestedParams,
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
export function makeAssetFreezeTxnWithSuggestedParamsFromObject(
|
|
542
|
-
o: Expand<
|
|
543
|
-
Pick<
|
|
544
|
-
RenameProperties<
|
|
545
|
-
MustHaveSuggestedParams<AssetFreezeTxn>,
|
|
546
|
-
{
|
|
547
|
-
freezeAccount: 'freezeTarget';
|
|
548
|
-
reKeyTo: 'rekeyTo';
|
|
549
|
-
}
|
|
550
|
-
>,
|
|
551
|
-
| 'from'
|
|
552
|
-
| 'note'
|
|
553
|
-
| 'assetIndex'
|
|
554
|
-
| 'freezeTarget'
|
|
555
|
-
| 'freezeState'
|
|
556
|
-
| 'suggestedParams'
|
|
557
|
-
| 'rekeyTo'
|
|
558
|
-
>
|
|
559
|
-
>
|
|
560
|
-
) {
|
|
561
|
-
return makeAssetFreezeTxnWithSuggestedParams(
|
|
562
|
-
o.from,
|
|
563
|
-
o.note,
|
|
564
|
-
o.assetIndex,
|
|
565
|
-
o.freezeTarget,
|
|
566
|
-
o.freezeState,
|
|
567
|
-
o.suggestedParams,
|
|
568
|
-
o.rekeyTo
|
|
569
|
-
);
|
|
339
|
+
assetFreezeParams: {
|
|
340
|
+
assetIndex,
|
|
341
|
+
freezeTarget,
|
|
342
|
+
frozen,
|
|
343
|
+
},
|
|
344
|
+
});
|
|
570
345
|
}
|
|
571
346
|
|
|
572
|
-
/**
|
|
573
|
-
*
|
|
347
|
+
/**
|
|
348
|
+
* Create a new asset transfer transaction.
|
|
574
349
|
*
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
* @param
|
|
578
|
-
* send all remaining assets after transfer to the "closeRemainderTo" address and close "from"'s asset holdings
|
|
579
|
-
* @param revocationTarget - optional - string representation of Algorand address - if provided,
|
|
580
|
-
* and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"
|
|
581
|
-
* @param amount - integer amount of assets to send
|
|
582
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
583
|
-
* @param assetIndex - int asset index uniquely specifying the asset
|
|
584
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
585
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
586
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
587
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
588
|
-
* * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
589
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
590
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
591
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
592
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
593
|
-
* genesisID - string specifies genesis ID of network in use
|
|
594
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
350
|
+
* Special case: to opt into an assets, set amount=0 and sender=receiver.
|
|
351
|
+
*
|
|
352
|
+
* @param options - Asset transfer transaction parameters
|
|
595
353
|
*/
|
|
596
|
-
export function
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
note
|
|
603
|
-
assetIndex
|
|
604
|
-
suggestedParams
|
|
605
|
-
rekeyTo
|
|
606
|
-
|
|
607
|
-
|
|
354
|
+
export function makeAssetTransferTxnWithSuggestedParamsFromObject({
|
|
355
|
+
sender,
|
|
356
|
+
receiver,
|
|
357
|
+
amount,
|
|
358
|
+
closeRemainderTo,
|
|
359
|
+
assetSender,
|
|
360
|
+
note,
|
|
361
|
+
assetIndex,
|
|
362
|
+
suggestedParams,
|
|
363
|
+
rekeyTo,
|
|
364
|
+
lease,
|
|
365
|
+
}: AssetTransferTransactionParams & CommonTransactionParams): Transaction {
|
|
366
|
+
if (!assetIndex) {
|
|
367
|
+
throw Error('assetIndex must be provided');
|
|
368
|
+
}
|
|
369
|
+
return new Transaction({
|
|
608
370
|
type: TransactionType.axfer,
|
|
609
|
-
|
|
610
|
-
to,
|
|
611
|
-
amount,
|
|
612
|
-
suggestedParams,
|
|
613
|
-
assetIndex,
|
|
371
|
+
sender,
|
|
614
372
|
note,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
373
|
+
lease,
|
|
374
|
+
rekeyTo,
|
|
375
|
+
suggestedParams,
|
|
376
|
+
assetTransferParams: {
|
|
377
|
+
assetIndex,
|
|
378
|
+
receiver,
|
|
379
|
+
amount,
|
|
380
|
+
assetSender,
|
|
381
|
+
closeRemainderTo,
|
|
382
|
+
},
|
|
383
|
+
});
|
|
620
384
|
}
|
|
621
385
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
386
|
+
/**
|
|
387
|
+
* Base function for creating any application call transaction.
|
|
388
|
+
*
|
|
389
|
+
* @param options - Application call transaction parameters
|
|
390
|
+
*/
|
|
391
|
+
export function makeApplicationCallTxnFromObject({
|
|
392
|
+
sender,
|
|
393
|
+
appIndex,
|
|
394
|
+
onComplete,
|
|
395
|
+
appArgs,
|
|
396
|
+
accounts,
|
|
397
|
+
foreignApps,
|
|
398
|
+
foreignAssets,
|
|
399
|
+
boxes,
|
|
400
|
+
approvalProgram,
|
|
401
|
+
clearProgram,
|
|
402
|
+
numLocalInts,
|
|
403
|
+
numLocalByteSlices,
|
|
404
|
+
numGlobalInts,
|
|
405
|
+
numGlobalByteSlices,
|
|
406
|
+
extraPages,
|
|
407
|
+
note,
|
|
408
|
+
lease,
|
|
409
|
+
rekeyTo,
|
|
410
|
+
suggestedParams,
|
|
411
|
+
}: ApplicationCallTransactionParams & CommonTransactionParams): Transaction {
|
|
412
|
+
if (onComplete == null) {
|
|
413
|
+
throw Error('onComplete must be provided');
|
|
414
|
+
}
|
|
415
|
+
return new Transaction({
|
|
416
|
+
type: TransactionType.appl,
|
|
417
|
+
sender,
|
|
418
|
+
note,
|
|
419
|
+
lease,
|
|
420
|
+
rekeyTo,
|
|
421
|
+
suggestedParams,
|
|
422
|
+
appCallParams: {
|
|
423
|
+
appIndex,
|
|
424
|
+
onComplete,
|
|
425
|
+
appArgs,
|
|
426
|
+
accounts,
|
|
427
|
+
foreignAssets,
|
|
428
|
+
foreignApps,
|
|
429
|
+
boxes,
|
|
430
|
+
approvalProgram,
|
|
431
|
+
clearProgram,
|
|
432
|
+
numLocalInts,
|
|
433
|
+
numLocalByteSlices,
|
|
434
|
+
numGlobalInts,
|
|
435
|
+
numGlobalByteSlices,
|
|
436
|
+
extraPages,
|
|
437
|
+
},
|
|
438
|
+
});
|
|
656
439
|
}
|
|
657
440
|
|
|
658
441
|
/**
|
|
659
442
|
* Make a transaction that will create an application.
|
|
660
|
-
*
|
|
661
|
-
* @param
|
|
662
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
663
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
664
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
665
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
666
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
667
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
668
|
-
* genesisID - string specifies genesis ID of network in use
|
|
669
|
-
* @param onComplete - algosdk.OnApplicationComplete, what application should do once the program is done being run
|
|
670
|
-
* @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
|
|
671
|
-
* @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
|
|
672
|
-
* @param numLocalInts - restricts number of ints in per-user local state
|
|
673
|
-
* @param numLocalByteSlices - restricts number of byte slices in per-user local state
|
|
674
|
-
* @param numGlobalInts - restricts number of ints in global state
|
|
675
|
-
* @param numGlobalByteSlices - restricts number of byte slices in global state
|
|
676
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
677
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
678
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
679
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
680
|
-
* @param note - Arbitrary data for sender to store
|
|
681
|
-
* @param lease - Lease a transaction
|
|
682
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
683
|
-
* @param extraPages - integer extra pages of memory to rent on creation of application
|
|
684
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
443
|
+
*
|
|
444
|
+
* @param options - Application creation transaction parameters
|
|
685
445
|
*/
|
|
686
|
-
export function
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
446
|
+
export function makeApplicationCreateTxnFromObject({
|
|
447
|
+
sender,
|
|
448
|
+
onComplete,
|
|
449
|
+
appArgs,
|
|
450
|
+
accounts,
|
|
451
|
+
foreignApps,
|
|
452
|
+
foreignAssets,
|
|
453
|
+
boxes,
|
|
454
|
+
approvalProgram,
|
|
455
|
+
clearProgram,
|
|
456
|
+
numLocalInts,
|
|
457
|
+
numLocalByteSlices,
|
|
458
|
+
numGlobalInts,
|
|
459
|
+
numGlobalByteSlices,
|
|
460
|
+
extraPages,
|
|
461
|
+
note,
|
|
462
|
+
lease,
|
|
463
|
+
rekeyTo,
|
|
464
|
+
suggestedParams,
|
|
465
|
+
}: Omit<
|
|
466
|
+
ApplicationCallTransactionParams,
|
|
467
|
+
'appIndex' | 'approvalProgram' | 'clearProgram'
|
|
468
|
+
> &
|
|
469
|
+
Required<
|
|
470
|
+
Pick<ApplicationCallTransactionParams, 'approvalProgram' | 'clearProgram'>
|
|
471
|
+
> &
|
|
472
|
+
CommonTransactionParams): Transaction {
|
|
473
|
+
if (!approvalProgram || !clearProgram) {
|
|
474
|
+
throw Error('approvalProgram and clearProgram must be provided');
|
|
475
|
+
}
|
|
476
|
+
if (onComplete == null) {
|
|
477
|
+
throw Error('onComplete must be provided');
|
|
478
|
+
}
|
|
479
|
+
return makeApplicationCallTxnFromObject({
|
|
480
|
+
sender,
|
|
710
481
|
appIndex: 0,
|
|
711
|
-
|
|
712
|
-
appLocalInts: numLocalInts,
|
|
713
|
-
appLocalByteSlices: numLocalByteSlices,
|
|
714
|
-
appGlobalInts: numGlobalInts,
|
|
715
|
-
appGlobalByteSlices: numGlobalByteSlices,
|
|
716
|
-
appApprovalProgram: approvalProgram,
|
|
717
|
-
appClearProgram: clearProgram,
|
|
482
|
+
onComplete,
|
|
718
483
|
appArgs,
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
484
|
+
accounts,
|
|
485
|
+
foreignApps,
|
|
486
|
+
foreignAssets,
|
|
722
487
|
boxes,
|
|
488
|
+
approvalProgram,
|
|
489
|
+
clearProgram,
|
|
490
|
+
numLocalInts,
|
|
491
|
+
numLocalByteSlices,
|
|
492
|
+
numGlobalInts,
|
|
493
|
+
numGlobalByteSlices,
|
|
494
|
+
extraPages,
|
|
723
495
|
note,
|
|
724
496
|
lease,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
};
|
|
728
|
-
return new txnBuilder.Transaction(o);
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
// helper for above makeApplicationCreateTxn, instead accepting an arguments object
|
|
732
|
-
export function makeApplicationCreateTxnFromObject(
|
|
733
|
-
o: Expand<
|
|
734
|
-
Pick<
|
|
735
|
-
RenameProperties<
|
|
736
|
-
MustHaveSuggestedParams<AppCreateTxn>,
|
|
737
|
-
{
|
|
738
|
-
appOnComplete: 'onComplete';
|
|
739
|
-
appApprovalProgram: 'approvalProgram';
|
|
740
|
-
appClearProgram: 'clearProgram';
|
|
741
|
-
appLocalInts: 'numLocalInts';
|
|
742
|
-
appLocalByteSlices: 'numLocalByteSlices';
|
|
743
|
-
appGlobalInts: 'numGlobalInts';
|
|
744
|
-
appGlobalByteSlices: 'numGlobalByteSlices';
|
|
745
|
-
appAccounts: 'accounts';
|
|
746
|
-
appForeignApps: 'foreignApps';
|
|
747
|
-
appForeignAssets: 'foreignAssets';
|
|
748
|
-
reKeyTo: 'rekeyTo';
|
|
749
|
-
}
|
|
750
|
-
>,
|
|
751
|
-
| 'from'
|
|
752
|
-
| 'suggestedParams'
|
|
753
|
-
| 'onComplete'
|
|
754
|
-
| 'approvalProgram'
|
|
755
|
-
| 'clearProgram'
|
|
756
|
-
| 'numLocalInts'
|
|
757
|
-
| 'numLocalByteSlices'
|
|
758
|
-
| 'numGlobalInts'
|
|
759
|
-
| 'numGlobalByteSlices'
|
|
760
|
-
| 'appArgs'
|
|
761
|
-
| 'accounts'
|
|
762
|
-
| 'foreignApps'
|
|
763
|
-
| 'foreignAssets'
|
|
764
|
-
| 'boxes'
|
|
765
|
-
| 'note'
|
|
766
|
-
| 'lease'
|
|
767
|
-
| 'rekeyTo'
|
|
768
|
-
| 'extraPages'
|
|
769
|
-
>
|
|
770
|
-
>
|
|
771
|
-
) {
|
|
772
|
-
return makeApplicationCreateTxn(
|
|
773
|
-
o.from,
|
|
774
|
-
o.suggestedParams,
|
|
775
|
-
o.onComplete,
|
|
776
|
-
o.approvalProgram,
|
|
777
|
-
o.clearProgram,
|
|
778
|
-
o.numLocalInts,
|
|
779
|
-
o.numLocalByteSlices,
|
|
780
|
-
o.numGlobalInts,
|
|
781
|
-
o.numGlobalByteSlices,
|
|
782
|
-
o.appArgs,
|
|
783
|
-
o.accounts,
|
|
784
|
-
o.foreignApps,
|
|
785
|
-
o.foreignAssets,
|
|
786
|
-
o.note,
|
|
787
|
-
o.lease,
|
|
788
|
-
o.rekeyTo,
|
|
789
|
-
o.extraPages,
|
|
790
|
-
o.boxes
|
|
791
|
-
);
|
|
497
|
+
rekeyTo,
|
|
498
|
+
suggestedParams,
|
|
499
|
+
});
|
|
792
500
|
}
|
|
793
501
|
|
|
794
502
|
/**
|
|
795
503
|
* Make a transaction that changes an application's approval and clear programs
|
|
796
|
-
*
|
|
797
|
-
* @param
|
|
798
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
799
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
800
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
801
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
802
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
803
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
804
|
-
* genesisID - string specifies genesis ID of network in use
|
|
805
|
-
* @param appIndex - the ID of the app to be updated
|
|
806
|
-
* @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
|
|
807
|
-
* @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
|
|
808
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
809
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
810
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
811
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
812
|
-
* @param note - Arbitrary data for sender to store
|
|
813
|
-
* @param lease - Lease a transaction
|
|
814
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
815
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
504
|
+
*
|
|
505
|
+
* @param options - Application update transaction parameters
|
|
816
506
|
*/
|
|
817
|
-
export function
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
note
|
|
828
|
-
lease
|
|
829
|
-
rekeyTo
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
507
|
+
export function makeApplicationUpdateTxnFromObject({
|
|
508
|
+
sender,
|
|
509
|
+
appIndex,
|
|
510
|
+
appArgs,
|
|
511
|
+
accounts,
|
|
512
|
+
foreignApps,
|
|
513
|
+
foreignAssets,
|
|
514
|
+
boxes,
|
|
515
|
+
approvalProgram,
|
|
516
|
+
clearProgram,
|
|
517
|
+
note,
|
|
518
|
+
lease,
|
|
519
|
+
rekeyTo,
|
|
520
|
+
suggestedParams,
|
|
521
|
+
}: Omit<
|
|
522
|
+
ApplicationCallTransactionParams,
|
|
523
|
+
| 'onComplete'
|
|
524
|
+
| 'numLocalInts'
|
|
525
|
+
| 'numLocalByteSlices'
|
|
526
|
+
| 'numGlobalInts'
|
|
527
|
+
| 'numGlobalByteSlices'
|
|
528
|
+
| 'extraPages'
|
|
529
|
+
| 'approvalProgram'
|
|
530
|
+
| 'clearProgram'
|
|
531
|
+
> &
|
|
532
|
+
Required<
|
|
533
|
+
Pick<ApplicationCallTransactionParams, 'approvalProgram' | 'clearProgram'>
|
|
534
|
+
> &
|
|
535
|
+
CommonTransactionParams): Transaction {
|
|
536
|
+
if (!appIndex) {
|
|
537
|
+
throw Error('appIndex must be provided');
|
|
538
|
+
}
|
|
539
|
+
if (!approvalProgram || !clearProgram) {
|
|
540
|
+
throw Error('approvalProgram and clearProgram must be provided');
|
|
541
|
+
}
|
|
542
|
+
return makeApplicationCallTxnFromObject({
|
|
543
|
+
sender,
|
|
836
544
|
appIndex,
|
|
837
|
-
|
|
838
|
-
appOnComplete: OnApplicationComplete.UpdateApplicationOC,
|
|
839
|
-
appClearProgram: clearProgram,
|
|
545
|
+
onComplete: OnApplicationComplete.UpdateApplicationOC,
|
|
840
546
|
appArgs,
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
547
|
+
accounts,
|
|
548
|
+
foreignApps,
|
|
549
|
+
foreignAssets,
|
|
844
550
|
boxes,
|
|
551
|
+
approvalProgram,
|
|
552
|
+
clearProgram,
|
|
845
553
|
note,
|
|
846
554
|
lease,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
// helper for above makeApplicationUpdateTxn, instead accepting an arguments object
|
|
853
|
-
export function makeApplicationUpdateTxnFromObject(
|
|
854
|
-
o: Expand<
|
|
855
|
-
Pick<
|
|
856
|
-
RenameProperties<
|
|
857
|
-
MustHaveSuggestedParams<AppUpdateTxn>,
|
|
858
|
-
{
|
|
859
|
-
appApprovalProgram: 'approvalProgram';
|
|
860
|
-
appClearProgram: 'clearProgram';
|
|
861
|
-
appAccounts: 'accounts';
|
|
862
|
-
appForeignApps: 'foreignApps';
|
|
863
|
-
appForeignAssets: 'foreignAssets';
|
|
864
|
-
reKeyTo: 'rekeyTo';
|
|
865
|
-
}
|
|
866
|
-
>,
|
|
867
|
-
| 'from'
|
|
868
|
-
| 'suggestedParams'
|
|
869
|
-
| 'appIndex'
|
|
870
|
-
| 'approvalProgram'
|
|
871
|
-
| 'clearProgram'
|
|
872
|
-
| 'appArgs'
|
|
873
|
-
| 'accounts'
|
|
874
|
-
| 'foreignApps'
|
|
875
|
-
| 'foreignAssets'
|
|
876
|
-
| 'boxes'
|
|
877
|
-
| 'note'
|
|
878
|
-
| 'lease'
|
|
879
|
-
| 'rekeyTo'
|
|
880
|
-
>
|
|
881
|
-
>
|
|
882
|
-
) {
|
|
883
|
-
return makeApplicationUpdateTxn(
|
|
884
|
-
o.from,
|
|
885
|
-
o.suggestedParams,
|
|
886
|
-
o.appIndex,
|
|
887
|
-
o.approvalProgram,
|
|
888
|
-
o.clearProgram,
|
|
889
|
-
o.appArgs,
|
|
890
|
-
o.accounts,
|
|
891
|
-
o.foreignApps,
|
|
892
|
-
o.foreignAssets,
|
|
893
|
-
o.note,
|
|
894
|
-
o.lease,
|
|
895
|
-
o.rekeyTo,
|
|
896
|
-
o.boxes
|
|
897
|
-
);
|
|
555
|
+
rekeyTo,
|
|
556
|
+
suggestedParams,
|
|
557
|
+
});
|
|
898
558
|
}
|
|
899
559
|
|
|
900
560
|
/**
|
|
901
561
|
* Make a transaction that deletes an application
|
|
902
|
-
*
|
|
903
|
-
* @param
|
|
904
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
905
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
906
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
907
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
908
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
909
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
910
|
-
* genesisID - string specifies genesis ID of network in use
|
|
911
|
-
* @param appIndex - the ID of the app to be deleted
|
|
912
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
913
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
914
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
915
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
916
|
-
* @param note - Arbitrary data for sender to store
|
|
917
|
-
* @param lease - Lease a transaction
|
|
918
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
919
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
562
|
+
*
|
|
563
|
+
* @param options - Application deletion transaction parameters
|
|
920
564
|
*/
|
|
921
|
-
export function
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
note
|
|
930
|
-
lease
|
|
931
|
-
rekeyTo
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
565
|
+
export function makeApplicationDeleteTxnFromObject({
|
|
566
|
+
sender,
|
|
567
|
+
appIndex,
|
|
568
|
+
appArgs,
|
|
569
|
+
accounts,
|
|
570
|
+
foreignApps,
|
|
571
|
+
foreignAssets,
|
|
572
|
+
boxes,
|
|
573
|
+
note,
|
|
574
|
+
lease,
|
|
575
|
+
rekeyTo,
|
|
576
|
+
suggestedParams,
|
|
577
|
+
}: Omit<
|
|
578
|
+
ApplicationCallTransactionParams,
|
|
579
|
+
| 'onComplete'
|
|
580
|
+
| 'numLocalInts'
|
|
581
|
+
| 'numLocalByteSlices'
|
|
582
|
+
| 'numGlobalInts'
|
|
583
|
+
| 'numGlobalByteSlices'
|
|
584
|
+
| 'extraPages'
|
|
585
|
+
| 'approvalProgram'
|
|
586
|
+
| 'clearProgram'
|
|
587
|
+
> &
|
|
588
|
+
CommonTransactionParams): Transaction {
|
|
589
|
+
if (!appIndex) {
|
|
590
|
+
throw Error('appIndex must be provided');
|
|
591
|
+
}
|
|
592
|
+
return makeApplicationCallTxnFromObject({
|
|
593
|
+
sender,
|
|
938
594
|
appIndex,
|
|
939
|
-
|
|
595
|
+
onComplete: OnApplicationComplete.DeleteApplicationOC,
|
|
940
596
|
appArgs,
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
597
|
+
accounts,
|
|
598
|
+
foreignApps,
|
|
599
|
+
foreignAssets,
|
|
944
600
|
boxes,
|
|
945
601
|
note,
|
|
946
602
|
lease,
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
// helper for above makeApplicationDeleteTxn, instead accepting an arguments object
|
|
953
|
-
export function makeApplicationDeleteTxnFromObject(
|
|
954
|
-
o: Expand<
|
|
955
|
-
Pick<
|
|
956
|
-
RenameProperties<
|
|
957
|
-
MustHaveSuggestedParams<AppDeleteTxn>,
|
|
958
|
-
{
|
|
959
|
-
appAccounts: 'accounts';
|
|
960
|
-
appForeignApps: 'foreignApps';
|
|
961
|
-
appForeignAssets: 'foreignAssets';
|
|
962
|
-
reKeyTo: 'rekeyTo';
|
|
963
|
-
}
|
|
964
|
-
>,
|
|
965
|
-
| 'from'
|
|
966
|
-
| 'suggestedParams'
|
|
967
|
-
| 'appIndex'
|
|
968
|
-
| 'appArgs'
|
|
969
|
-
| 'accounts'
|
|
970
|
-
| 'foreignApps'
|
|
971
|
-
| 'foreignAssets'
|
|
972
|
-
| 'boxes'
|
|
973
|
-
| 'note'
|
|
974
|
-
| 'lease'
|
|
975
|
-
| 'rekeyTo'
|
|
976
|
-
>
|
|
977
|
-
>
|
|
978
|
-
) {
|
|
979
|
-
return makeApplicationDeleteTxn(
|
|
980
|
-
o.from,
|
|
981
|
-
o.suggestedParams,
|
|
982
|
-
o.appIndex,
|
|
983
|
-
o.appArgs,
|
|
984
|
-
o.accounts,
|
|
985
|
-
o.foreignApps,
|
|
986
|
-
o.foreignAssets,
|
|
987
|
-
o.note,
|
|
988
|
-
o.lease,
|
|
989
|
-
o.rekeyTo,
|
|
990
|
-
o.boxes
|
|
991
|
-
);
|
|
603
|
+
rekeyTo,
|
|
604
|
+
suggestedParams,
|
|
605
|
+
});
|
|
992
606
|
}
|
|
993
607
|
|
|
994
608
|
/**
|
|
995
609
|
* Make a transaction that opts in to use an application
|
|
996
|
-
*
|
|
997
|
-
* @param
|
|
998
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
999
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
1000
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
1001
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
1002
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
1003
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
1004
|
-
* genesisID - string specifies genesis ID of network in use
|
|
1005
|
-
* @param appIndex - the ID of the app to join
|
|
1006
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
1007
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
1008
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
1009
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
1010
|
-
* @param note - Arbitrary data for sender to store
|
|
1011
|
-
* @param lease - Lease a transaction
|
|
1012
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
1013
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
610
|
+
*
|
|
611
|
+
* @param options - Application opt-in transaction parameters
|
|
1014
612
|
*/
|
|
1015
|
-
export function
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
note
|
|
1024
|
-
lease
|
|
1025
|
-
rekeyTo
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
613
|
+
export function makeApplicationOptInTxnFromObject({
|
|
614
|
+
sender,
|
|
615
|
+
appIndex,
|
|
616
|
+
appArgs,
|
|
617
|
+
accounts,
|
|
618
|
+
foreignApps,
|
|
619
|
+
foreignAssets,
|
|
620
|
+
boxes,
|
|
621
|
+
note,
|
|
622
|
+
lease,
|
|
623
|
+
rekeyTo,
|
|
624
|
+
suggestedParams,
|
|
625
|
+
}: Omit<
|
|
626
|
+
ApplicationCallTransactionParams,
|
|
627
|
+
| 'onComplete'
|
|
628
|
+
| 'numLocalInts'
|
|
629
|
+
| 'numLocalByteSlices'
|
|
630
|
+
| 'numGlobalInts'
|
|
631
|
+
| 'numGlobalByteSlices'
|
|
632
|
+
| 'extraPages'
|
|
633
|
+
| 'approvalProgram'
|
|
634
|
+
| 'clearProgram'
|
|
635
|
+
> &
|
|
636
|
+
CommonTransactionParams): Transaction {
|
|
637
|
+
if (!appIndex) {
|
|
638
|
+
throw Error('appIndex must be provided');
|
|
639
|
+
}
|
|
640
|
+
return makeApplicationCallTxnFromObject({
|
|
641
|
+
sender,
|
|
1032
642
|
appIndex,
|
|
1033
|
-
|
|
643
|
+
onComplete: OnApplicationComplete.OptInOC,
|
|
1034
644
|
appArgs,
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
645
|
+
accounts,
|
|
646
|
+
foreignApps,
|
|
647
|
+
foreignAssets,
|
|
1038
648
|
boxes,
|
|
1039
649
|
note,
|
|
1040
650
|
lease,
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
// helper for above makeApplicationOptInTxn, instead accepting an argument object
|
|
1047
|
-
export function makeApplicationOptInTxnFromObject(
|
|
1048
|
-
o: Expand<
|
|
1049
|
-
Pick<
|
|
1050
|
-
RenameProperties<
|
|
1051
|
-
MustHaveSuggestedParams<AppOptInTxn>,
|
|
1052
|
-
{
|
|
1053
|
-
appAccounts: 'accounts';
|
|
1054
|
-
appForeignApps: 'foreignApps';
|
|
1055
|
-
appForeignAssets: 'foreignAssets';
|
|
1056
|
-
reKeyTo: 'rekeyTo';
|
|
1057
|
-
}
|
|
1058
|
-
>,
|
|
1059
|
-
| 'from'
|
|
1060
|
-
| 'suggestedParams'
|
|
1061
|
-
| 'appIndex'
|
|
1062
|
-
| 'appArgs'
|
|
1063
|
-
| 'accounts'
|
|
1064
|
-
| 'foreignApps'
|
|
1065
|
-
| 'foreignAssets'
|
|
1066
|
-
| 'boxes'
|
|
1067
|
-
| 'note'
|
|
1068
|
-
| 'lease'
|
|
1069
|
-
| 'rekeyTo'
|
|
1070
|
-
>
|
|
1071
|
-
>
|
|
1072
|
-
) {
|
|
1073
|
-
return makeApplicationOptInTxn(
|
|
1074
|
-
o.from,
|
|
1075
|
-
o.suggestedParams,
|
|
1076
|
-
o.appIndex,
|
|
1077
|
-
o.appArgs,
|
|
1078
|
-
o.accounts,
|
|
1079
|
-
o.foreignApps,
|
|
1080
|
-
o.foreignAssets,
|
|
1081
|
-
o.note,
|
|
1082
|
-
o.lease,
|
|
1083
|
-
o.rekeyTo,
|
|
1084
|
-
o.boxes
|
|
1085
|
-
);
|
|
651
|
+
rekeyTo,
|
|
652
|
+
suggestedParams,
|
|
653
|
+
});
|
|
1086
654
|
}
|
|
1087
655
|
|
|
1088
656
|
/**
|
|
1089
657
|
* Make a transaction that closes out a user's state in an application
|
|
1090
|
-
*
|
|
1091
|
-
* @param
|
|
1092
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
1093
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
1094
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
1095
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
1096
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
1097
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
1098
|
-
* genesisID - string specifies genesis ID of network in use
|
|
1099
|
-
* @param appIndex - the ID of the app to use
|
|
1100
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
1101
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
1102
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
1103
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
1104
|
-
* @param note - Arbitrary data for sender to store
|
|
1105
|
-
* @param lease - Lease a transaction
|
|
1106
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
1107
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
658
|
+
*
|
|
659
|
+
* @param options - Application close-out transaction parameters
|
|
1108
660
|
*/
|
|
1109
|
-
export function
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
note
|
|
1118
|
-
lease
|
|
1119
|
-
rekeyTo
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
661
|
+
export function makeApplicationCloseOutTxnFromObject({
|
|
662
|
+
sender,
|
|
663
|
+
appIndex,
|
|
664
|
+
appArgs,
|
|
665
|
+
accounts,
|
|
666
|
+
foreignApps,
|
|
667
|
+
foreignAssets,
|
|
668
|
+
boxes,
|
|
669
|
+
note,
|
|
670
|
+
lease,
|
|
671
|
+
rekeyTo,
|
|
672
|
+
suggestedParams,
|
|
673
|
+
}: Omit<
|
|
674
|
+
ApplicationCallTransactionParams,
|
|
675
|
+
| 'onComplete'
|
|
676
|
+
| 'numLocalInts'
|
|
677
|
+
| 'numLocalByteSlices'
|
|
678
|
+
| 'numGlobalInts'
|
|
679
|
+
| 'numGlobalByteSlices'
|
|
680
|
+
| 'extraPages'
|
|
681
|
+
| 'approvalProgram'
|
|
682
|
+
| 'clearProgram'
|
|
683
|
+
> &
|
|
684
|
+
CommonTransactionParams): Transaction {
|
|
685
|
+
if (!appIndex) {
|
|
686
|
+
throw Error('appIndex must be provided');
|
|
687
|
+
}
|
|
688
|
+
return makeApplicationCallTxnFromObject({
|
|
689
|
+
sender,
|
|
1126
690
|
appIndex,
|
|
1127
|
-
|
|
691
|
+
onComplete: OnApplicationComplete.CloseOutOC,
|
|
1128
692
|
appArgs,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
693
|
+
accounts,
|
|
694
|
+
foreignApps,
|
|
695
|
+
foreignAssets,
|
|
1132
696
|
boxes,
|
|
1133
697
|
note,
|
|
1134
698
|
lease,
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
// helper for above makeApplicationCloseOutTxn, instead accepting an argument object
|
|
1141
|
-
export function makeApplicationCloseOutTxnFromObject(
|
|
1142
|
-
o: Expand<
|
|
1143
|
-
Pick<
|
|
1144
|
-
RenameProperties<
|
|
1145
|
-
MustHaveSuggestedParams<AppOptInTxn>,
|
|
1146
|
-
{
|
|
1147
|
-
appAccounts: 'accounts';
|
|
1148
|
-
appForeignApps: 'foreignApps';
|
|
1149
|
-
appForeignAssets: 'foreignAssets';
|
|
1150
|
-
reKeyTo: 'rekeyTo';
|
|
1151
|
-
}
|
|
1152
|
-
>,
|
|
1153
|
-
| 'from'
|
|
1154
|
-
| 'suggestedParams'
|
|
1155
|
-
| 'appIndex'
|
|
1156
|
-
| 'appArgs'
|
|
1157
|
-
| 'accounts'
|
|
1158
|
-
| 'foreignApps'
|
|
1159
|
-
| 'foreignAssets'
|
|
1160
|
-
| 'boxes'
|
|
1161
|
-
| 'note'
|
|
1162
|
-
| 'lease'
|
|
1163
|
-
| 'rekeyTo'
|
|
1164
|
-
>
|
|
1165
|
-
>
|
|
1166
|
-
) {
|
|
1167
|
-
return makeApplicationCloseOutTxn(
|
|
1168
|
-
o.from,
|
|
1169
|
-
o.suggestedParams,
|
|
1170
|
-
o.appIndex,
|
|
1171
|
-
o.appArgs,
|
|
1172
|
-
o.accounts,
|
|
1173
|
-
o.foreignApps,
|
|
1174
|
-
o.foreignAssets,
|
|
1175
|
-
o.note,
|
|
1176
|
-
o.lease,
|
|
1177
|
-
o.rekeyTo,
|
|
1178
|
-
o.boxes
|
|
1179
|
-
);
|
|
699
|
+
rekeyTo,
|
|
700
|
+
suggestedParams,
|
|
701
|
+
});
|
|
1180
702
|
}
|
|
1181
703
|
|
|
1182
704
|
/**
|
|
1183
705
|
* Make a transaction that clears a user's state in an application
|
|
1184
|
-
*
|
|
1185
|
-
* @param
|
|
1186
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
1187
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
1188
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
1189
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
1190
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
1191
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
1192
|
-
* genesisID - string specifies genesis ID of network in use
|
|
1193
|
-
* @param appIndex - the ID of the app to use
|
|
1194
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
1195
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
1196
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
1197
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
1198
|
-
* @param note - Arbitrary data for sender to store
|
|
1199
|
-
* @param lease - Lease a transaction
|
|
1200
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
1201
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
706
|
+
*
|
|
707
|
+
* @param options - Application clear state transaction parameters
|
|
1202
708
|
*/
|
|
1203
|
-
export function
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
note
|
|
1212
|
-
lease
|
|
1213
|
-
rekeyTo
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
709
|
+
export function makeApplicationClearStateTxnFromObject({
|
|
710
|
+
sender,
|
|
711
|
+
appIndex,
|
|
712
|
+
appArgs,
|
|
713
|
+
accounts,
|
|
714
|
+
foreignApps,
|
|
715
|
+
foreignAssets,
|
|
716
|
+
boxes,
|
|
717
|
+
note,
|
|
718
|
+
lease,
|
|
719
|
+
rekeyTo,
|
|
720
|
+
suggestedParams,
|
|
721
|
+
}: Omit<
|
|
722
|
+
ApplicationCallTransactionParams,
|
|
723
|
+
| 'onComplete'
|
|
724
|
+
| 'numLocalInts'
|
|
725
|
+
| 'numLocalByteSlices'
|
|
726
|
+
| 'numGlobalInts'
|
|
727
|
+
| 'numGlobalByteSlices'
|
|
728
|
+
| 'extraPages'
|
|
729
|
+
| 'approvalProgram'
|
|
730
|
+
| 'clearProgram'
|
|
731
|
+
> &
|
|
732
|
+
CommonTransactionParams): Transaction {
|
|
733
|
+
if (!appIndex) {
|
|
734
|
+
throw Error('appIndex must be provided');
|
|
735
|
+
}
|
|
736
|
+
return makeApplicationCallTxnFromObject({
|
|
737
|
+
sender,
|
|
1220
738
|
appIndex,
|
|
1221
|
-
|
|
739
|
+
onComplete: OnApplicationComplete.ClearStateOC,
|
|
1222
740
|
appArgs,
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
741
|
+
accounts,
|
|
742
|
+
foreignApps,
|
|
743
|
+
foreignAssets,
|
|
1226
744
|
boxes,
|
|
1227
745
|
note,
|
|
1228
746
|
lease,
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
// helper for above makeApplicationClearStateTxn, instead accepting an argument object
|
|
1235
|
-
export function makeApplicationClearStateTxnFromObject(
|
|
1236
|
-
o: Expand<
|
|
1237
|
-
Pick<
|
|
1238
|
-
RenameProperties<
|
|
1239
|
-
MustHaveSuggestedParams<AppOptInTxn>,
|
|
1240
|
-
{
|
|
1241
|
-
appAccounts: 'accounts';
|
|
1242
|
-
appForeignApps: 'foreignApps';
|
|
1243
|
-
appForeignAssets: 'foreignAssets';
|
|
1244
|
-
reKeyTo: 'rekeyTo';
|
|
1245
|
-
}
|
|
1246
|
-
>,
|
|
1247
|
-
| 'from'
|
|
1248
|
-
| 'suggestedParams'
|
|
1249
|
-
| 'appIndex'
|
|
1250
|
-
| 'appArgs'
|
|
1251
|
-
| 'accounts'
|
|
1252
|
-
| 'foreignApps'
|
|
1253
|
-
| 'foreignAssets'
|
|
1254
|
-
| 'boxes'
|
|
1255
|
-
| 'note'
|
|
1256
|
-
| 'lease'
|
|
1257
|
-
| 'rekeyTo'
|
|
1258
|
-
>
|
|
1259
|
-
>
|
|
1260
|
-
) {
|
|
1261
|
-
return makeApplicationClearStateTxn(
|
|
1262
|
-
o.from,
|
|
1263
|
-
o.suggestedParams,
|
|
1264
|
-
o.appIndex,
|
|
1265
|
-
o.appArgs,
|
|
1266
|
-
o.accounts,
|
|
1267
|
-
o.foreignApps,
|
|
1268
|
-
o.foreignAssets,
|
|
1269
|
-
o.note,
|
|
1270
|
-
o.lease,
|
|
1271
|
-
o.rekeyTo,
|
|
1272
|
-
o.boxes
|
|
1273
|
-
);
|
|
747
|
+
rekeyTo,
|
|
748
|
+
suggestedParams,
|
|
749
|
+
});
|
|
1274
750
|
}
|
|
1275
751
|
|
|
1276
752
|
/**
|
|
1277
753
|
* Make a transaction that just calls an application, doing nothing on completion
|
|
1278
|
-
*
|
|
1279
|
-
* @param
|
|
1280
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
1281
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
1282
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
1283
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
1284
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
1285
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
1286
|
-
* genesisID - string specifies genesis ID of network in use
|
|
1287
|
-
* @param appIndex - the ID of the app to use
|
|
1288
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
1289
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
1290
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
1291
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
1292
|
-
* @param note - Arbitrary data for sender to store
|
|
1293
|
-
* @param lease - Lease a transaction
|
|
1294
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
1295
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
754
|
+
*
|
|
755
|
+
* @param options - Application no-op transaction parameters
|
|
1296
756
|
*/
|
|
1297
|
-
export function
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
note
|
|
1306
|
-
lease
|
|
1307
|
-
rekeyTo
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
757
|
+
export function makeApplicationNoOpTxnFromObject({
|
|
758
|
+
sender,
|
|
759
|
+
appIndex,
|
|
760
|
+
appArgs,
|
|
761
|
+
accounts,
|
|
762
|
+
foreignApps,
|
|
763
|
+
foreignAssets,
|
|
764
|
+
boxes,
|
|
765
|
+
note,
|
|
766
|
+
lease,
|
|
767
|
+
rekeyTo,
|
|
768
|
+
suggestedParams,
|
|
769
|
+
}: Omit<
|
|
770
|
+
ApplicationCallTransactionParams,
|
|
771
|
+
| 'onComplete'
|
|
772
|
+
| 'numLocalInts'
|
|
773
|
+
| 'numLocalByteSlices'
|
|
774
|
+
| 'numGlobalInts'
|
|
775
|
+
| 'numGlobalByteSlices'
|
|
776
|
+
| 'extraPages'
|
|
777
|
+
| 'approvalProgram'
|
|
778
|
+
| 'clearProgram'
|
|
779
|
+
> &
|
|
780
|
+
CommonTransactionParams): Transaction {
|
|
781
|
+
if (!appIndex) {
|
|
782
|
+
throw Error('appIndex must be provided');
|
|
783
|
+
}
|
|
784
|
+
return makeApplicationCallTxnFromObject({
|
|
785
|
+
sender,
|
|
1314
786
|
appIndex,
|
|
1315
|
-
|
|
787
|
+
onComplete: OnApplicationComplete.NoOpOC,
|
|
1316
788
|
appArgs,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
789
|
+
accounts,
|
|
790
|
+
foreignApps,
|
|
791
|
+
foreignAssets,
|
|
1320
792
|
boxes,
|
|
1321
793
|
note,
|
|
1322
794
|
lease,
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
// helper for above makeApplicationNoOpTxn, instead accepting an argument object
|
|
1329
|
-
export function makeApplicationNoOpTxnFromObject(
|
|
1330
|
-
o: Expand<
|
|
1331
|
-
Pick<
|
|
1332
|
-
RenameProperties<
|
|
1333
|
-
MustHaveSuggestedParams<AppOptInTxn>,
|
|
1334
|
-
{
|
|
1335
|
-
appAccounts: 'accounts';
|
|
1336
|
-
appForeignApps: 'foreignApps';
|
|
1337
|
-
appForeignAssets: 'foreignAssets';
|
|
1338
|
-
reKeyTo: 'rekeyTo';
|
|
1339
|
-
}
|
|
1340
|
-
>,
|
|
1341
|
-
| 'from'
|
|
1342
|
-
| 'suggestedParams'
|
|
1343
|
-
| 'appIndex'
|
|
1344
|
-
| 'appArgs'
|
|
1345
|
-
| 'accounts'
|
|
1346
|
-
| 'foreignApps'
|
|
1347
|
-
| 'foreignAssets'
|
|
1348
|
-
| 'boxes'
|
|
1349
|
-
| 'note'
|
|
1350
|
-
| 'lease'
|
|
1351
|
-
| 'rekeyTo'
|
|
1352
|
-
>
|
|
1353
|
-
>
|
|
1354
|
-
) {
|
|
1355
|
-
return makeApplicationNoOpTxn(
|
|
1356
|
-
o.from,
|
|
1357
|
-
o.suggestedParams,
|
|
1358
|
-
o.appIndex,
|
|
1359
|
-
o.appArgs,
|
|
1360
|
-
o.accounts,
|
|
1361
|
-
o.foreignApps,
|
|
1362
|
-
o.foreignAssets,
|
|
1363
|
-
o.note,
|
|
1364
|
-
o.lease,
|
|
1365
|
-
o.rekeyTo,
|
|
1366
|
-
o.boxes
|
|
1367
|
-
);
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
export { OnApplicationComplete } from './types/transactions/base';
|
|
1371
|
-
|
|
1372
|
-
/**
|
|
1373
|
-
* Generic function for creating any application call transaction.
|
|
1374
|
-
*/
|
|
1375
|
-
export function makeApplicationCallTxnFromObject(
|
|
1376
|
-
options: Expand<
|
|
1377
|
-
Pick<
|
|
1378
|
-
RenameProperties<
|
|
1379
|
-
MustHaveSuggestedParams<AppCreateTxn>,
|
|
1380
|
-
{
|
|
1381
|
-
appOnComplete: 'onComplete';
|
|
1382
|
-
appAccounts: 'accounts';
|
|
1383
|
-
appForeignApps: 'foreignApps';
|
|
1384
|
-
appForeignAssets: 'foreignAssets';
|
|
1385
|
-
reKeyTo: 'rekeyTo';
|
|
1386
|
-
}
|
|
1387
|
-
>,
|
|
1388
|
-
| 'from'
|
|
1389
|
-
| 'suggestedParams'
|
|
1390
|
-
| 'appIndex'
|
|
1391
|
-
| 'onComplete'
|
|
1392
|
-
| 'appArgs'
|
|
1393
|
-
| 'accounts'
|
|
1394
|
-
| 'foreignApps'
|
|
1395
|
-
| 'foreignAssets'
|
|
1396
|
-
| 'boxes'
|
|
1397
|
-
| 'note'
|
|
1398
|
-
| 'lease'
|
|
1399
|
-
| 'rekeyTo'
|
|
1400
|
-
| 'extraPages'
|
|
1401
|
-
> &
|
|
1402
|
-
Partial<
|
|
1403
|
-
Pick<
|
|
1404
|
-
RenameProperties<
|
|
1405
|
-
MustHaveSuggestedParams<AppCreateTxn>,
|
|
1406
|
-
{
|
|
1407
|
-
appApprovalProgram: 'approvalProgram';
|
|
1408
|
-
appClearProgram: 'clearProgram';
|
|
1409
|
-
appLocalInts: 'numLocalInts';
|
|
1410
|
-
appLocalByteSlices: 'numLocalByteSlices';
|
|
1411
|
-
appGlobalInts: 'numGlobalInts';
|
|
1412
|
-
appGlobalByteSlices: 'numGlobalByteSlices';
|
|
1413
|
-
}
|
|
1414
|
-
>,
|
|
1415
|
-
| 'approvalProgram'
|
|
1416
|
-
| 'clearProgram'
|
|
1417
|
-
| 'numLocalInts'
|
|
1418
|
-
| 'numLocalByteSlices'
|
|
1419
|
-
| 'numGlobalInts'
|
|
1420
|
-
| 'numGlobalByteSlices'
|
|
1421
|
-
>
|
|
1422
|
-
>
|
|
1423
|
-
>
|
|
1424
|
-
) {
|
|
1425
|
-
const o: AppCreateTxn = {
|
|
1426
|
-
type: TransactionType.appl,
|
|
1427
|
-
from: options.from,
|
|
1428
|
-
suggestedParams: options.suggestedParams,
|
|
1429
|
-
appIndex: options.appIndex,
|
|
1430
|
-
appOnComplete: options.onComplete,
|
|
1431
|
-
appLocalInts: options.numLocalInts,
|
|
1432
|
-
appLocalByteSlices: options.numLocalByteSlices,
|
|
1433
|
-
appGlobalInts: options.numGlobalInts,
|
|
1434
|
-
appGlobalByteSlices: options.numGlobalByteSlices,
|
|
1435
|
-
appApprovalProgram: options.approvalProgram,
|
|
1436
|
-
appClearProgram: options.clearProgram,
|
|
1437
|
-
appArgs: options.appArgs,
|
|
1438
|
-
appAccounts: options.accounts,
|
|
1439
|
-
appForeignApps: options.foreignApps,
|
|
1440
|
-
appForeignAssets: options.foreignAssets,
|
|
1441
|
-
boxes: options.boxes,
|
|
1442
|
-
note: options.note,
|
|
1443
|
-
lease: options.lease,
|
|
1444
|
-
reKeyTo: options.rekeyTo,
|
|
1445
|
-
extraPages: options.extraPages,
|
|
1446
|
-
};
|
|
1447
|
-
return new txnBuilder.Transaction(o);
|
|
795
|
+
rekeyTo,
|
|
796
|
+
suggestedParams,
|
|
797
|
+
});
|
|
1448
798
|
}
|