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