algosdk 2.8.0 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.LICENSE.txt +0 -9
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/abi/abi_type.js +34 -27
- package/dist/cjs/abi/abi_type.js.map +1 -1
- package/dist/cjs/abi/contract.js +5 -3
- package/dist/cjs/abi/contract.js.map +1 -1
- package/dist/cjs/{types/transactions/asset.js → abi/event.js} +1 -1
- package/dist/cjs/abi/event.js.map +1 -0
- package/dist/cjs/abi/index.js +6 -6
- package/dist/cjs/abi/index.js.map +1 -1
- package/dist/cjs/abi/interface.js +3 -3
- package/dist/cjs/abi/interface.js.map +1 -1
- package/dist/cjs/abi/method.js +14 -10
- package/dist/cjs/abi/method.js.map +1 -1
- package/dist/cjs/abi/reference.js +1 -1
- package/dist/cjs/abi/reference.js.map +1 -1
- package/dist/cjs/abi/transaction.js +2 -2
- package/dist/cjs/abi/transaction.js.map +1 -1
- package/dist/cjs/account.js +4 -4
- package/dist/cjs/account.js.map +1 -1
- package/dist/cjs/boxStorage.js +17 -17
- package/dist/cjs/boxStorage.js.map +1 -1
- package/dist/cjs/client/client.js +77 -41
- package/dist/cjs/client/client.js.map +1 -1
- package/dist/cjs/client/index.js +29 -0
- package/dist/cjs/client/index.js.map +1 -0
- package/dist/cjs/client/kmd.js +69 -86
- package/dist/cjs/client/kmd.js.map +1 -1
- package/dist/cjs/client/urlTokenBaseHTTPClient.js +16 -11
- package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountApplicationInformation.js +11 -7
- package/dist/cjs/client/v2/algod/accountApplicationInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountAssetInformation.js +11 -7
- package/dist/cjs/client/v2/algod/accountAssetInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountInformation.js +11 -6
- package/dist/cjs/client/v2/algod/accountInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +85 -83
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/block.js +6 -33
- package/dist/cjs/client/v2/algod/block.js.map +1 -1
- package/dist/cjs/client/v2/algod/compile.js +17 -11
- package/dist/cjs/client/v2/algod/compile.js.map +1 -1
- package/dist/cjs/client/v2/algod/disassemble.js +17 -11
- package/dist/cjs/client/v2/algod/disassemble.js.map +1 -1
- package/dist/cjs/client/v2/algod/dryrun.js +18 -37
- package/dist/cjs/client/v2/algod/dryrun.js.map +1 -1
- package/dist/cjs/client/v2/algod/genesis.js +6 -2
- package/dist/cjs/client/v2/algod/genesis.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +10 -10
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js +8 -8
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationByID.js +10 -5
- package/dist/cjs/client/v2/algod/getApplicationByID.js.map +1 -1
- package/dist/cjs/client/v2/algod/getAssetByID.js +10 -5
- package/dist/cjs/client/v2/algod/getAssetByID.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockHash.js +10 -6
- package/dist/cjs/client/v2/algod/getBlockHash.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +6 -5
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockTxids.js +10 -4
- package/dist/cjs/client/v2/algod/getBlockTxids.js.map +1 -1
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +11 -6
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -1
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +11 -6
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
- package/dist/cjs/client/v2/algod/getSyncRound.js +6 -5
- package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +9 -9
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/getTransactionProof.js +10 -6
- package/dist/cjs/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/cjs/client/v2/algod/healthCheck.js +4 -9
- package/dist/cjs/client/v2/algod/healthCheck.js.map +1 -1
- package/dist/cjs/{types → client/v2/algod}/index.js +5 -3
- package/dist/cjs/client/v2/algod/index.js.map +1 -0
- package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js +10 -5
- package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +3712 -1824
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactionInformation.js +6 -32
- package/dist/cjs/client/v2/algod/pendingTransactionInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactions.js +6 -31
- package/dist/cjs/client/v2/algod/pendingTransactions.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js +7 -33
- package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
- package/dist/cjs/client/v2/algod/ready.js +4 -2
- package/dist/cjs/client/v2/algod/ready.js.map +1 -1
- package/dist/cjs/client/v2/algod/sendRawTransaction.js +17 -8
- package/dist/cjs/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +13 -8
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
- package/dist/cjs/client/v2/algod/setSyncRound.js +13 -8
- package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/simulateTransaction.js +15 -35
- package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/cjs/client/v2/algod/stateproof.js +10 -5
- package/dist/cjs/client/v2/algod/stateproof.js.map +1 -1
- package/dist/cjs/client/v2/algod/status.js +8 -2
- package/dist/cjs/client/v2/algod/status.js.map +1 -1
- package/dist/cjs/client/v2/algod/statusAfterBlock.js +10 -5
- package/dist/cjs/client/v2/algod/statusAfterBlock.js.map +1 -1
- package/dist/cjs/client/v2/algod/suggestedParams.js +13 -9
- package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/cjs/client/v2/algod/supply.js +8 -2
- package/dist/cjs/client/v2/algod/supply.js.map +1 -1
- package/dist/cjs/client/v2/algod/unsetSyncRound.js +11 -5
- package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/versions.js +8 -2
- package/dist/cjs/client/v2/algod/versions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/index.js +22 -0
- package/dist/cjs/client/v2/indexer/index.js.map +1 -0
- package/dist/cjs/client/v2/indexer/indexer.js +44 -43
- package/dist/cjs/client/v2/indexer/indexer.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountAssets.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountByID.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +19 -12
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js +10 -10
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplications.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetByID.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +19 -12
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupBlock.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupBlock.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupTransactionByID.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupTransactionByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/makeHealthCheck.js +8 -2
- package/dist/cjs/client/v2/indexer/makeHealthCheck.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +3591 -1651
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchAccounts.js +9 -3
- package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js +8 -8
- package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForApplications.js +9 -3
- package/dist/cjs/client/v2/indexer/searchForApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForAssets.js +9 -3
- package/dist/cjs/client/v2/indexer/searchForAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForTransactions.js +17 -9
- package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/cjs/client/v2/jsonrequest.js +22 -54
- package/dist/cjs/client/v2/jsonrequest.js.map +1 -1
- package/dist/cjs/client/v2/serviceClient.js +5 -25
- package/dist/cjs/client/v2/serviceClient.js.map +1 -1
- package/dist/cjs/client/v2/untypedmodel.js +22 -0
- package/dist/cjs/client/v2/untypedmodel.js.map +1 -0
- package/dist/cjs/composer.js +64 -58
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/convert.js.map +1 -1
- package/dist/cjs/dryrun.js +107 -203
- package/dist/cjs/dryrun.js.map +1 -1
- package/dist/cjs/encoding/address.js +88 -104
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/encoding/bigint.js +2 -3
- package/dist/cjs/encoding/bigint.js.map +1 -1
- package/dist/cjs/encoding/binarydata.js +82 -0
- package/dist/cjs/encoding/binarydata.js.map +1 -0
- package/dist/cjs/encoding/encoding.js +353 -38
- package/dist/cjs/encoding/encoding.js.map +1 -1
- package/dist/cjs/encoding/schema/address.js +41 -0
- package/dist/cjs/encoding/schema/address.js.map +1 -0
- package/dist/cjs/encoding/schema/array.js +43 -0
- package/dist/cjs/encoding/schema/array.js.map +1 -0
- package/dist/cjs/encoding/schema/binarystring.js +55 -0
- package/dist/cjs/encoding/schema/binarystring.js.map +1 -0
- package/dist/cjs/encoding/schema/blockhash.js +67 -0
- package/dist/cjs/encoding/schema/blockhash.js.map +1 -0
- package/dist/cjs/encoding/schema/boolean.js +42 -0
- package/dist/cjs/encoding/schema/boolean.js.map +1 -0
- package/dist/cjs/encoding/schema/bytearray.js +98 -0
- package/dist/cjs/encoding/schema/bytearray.js.map +1 -0
- package/dist/cjs/encoding/schema/index.js +34 -0
- package/dist/cjs/encoding/schema/index.js.map +1 -0
- package/dist/cjs/encoding/schema/map.js +528 -0
- package/dist/cjs/encoding/schema/map.js.map +1 -0
- package/dist/cjs/encoding/schema/optional.js +58 -0
- package/dist/cjs/encoding/schema/optional.js.map +1 -0
- package/dist/cjs/encoding/schema/string.js +43 -0
- package/dist/cjs/encoding/schema/string.js.map +1 -0
- package/dist/cjs/encoding/schema/uint64.js +36 -0
- package/dist/cjs/encoding/schema/uint64.js.map +1 -0
- package/dist/cjs/encoding/schema/untyped.js +33 -0
- package/dist/cjs/encoding/schema/untyped.js.map +1 -0
- package/dist/cjs/encoding/uint64.js +2 -2
- package/dist/cjs/encoding/uint64.js.map +1 -1
- package/dist/cjs/group.js +23 -60
- package/dist/cjs/group.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logic/sourcemap.js +56 -25
- package/dist/cjs/logic/sourcemap.js.map +1 -1
- package/dist/cjs/logicsig.js +113 -146
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/main.js +113 -122
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/makeTxn.js +320 -554
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/mnemonic/mnemonic.js +8 -8
- package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
- package/dist/cjs/multisig.js +60 -312
- package/dist/cjs/multisig.js.map +1 -1
- package/dist/cjs/multisigSigning.js +285 -0
- package/dist/cjs/multisigSigning.js.map +1 -0
- package/dist/cjs/nacl/naclWrappers.js +2 -2
- package/dist/cjs/nacl/naclWrappers.js.map +1 -1
- package/dist/cjs/signedTransaction.js +106 -0
- package/dist/cjs/signedTransaction.js.map +1 -0
- package/dist/cjs/signer.js +7 -7
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/signing.js +105 -0
- package/dist/cjs/signing.js.map +1 -0
- package/dist/cjs/stateproof.js +421 -0
- package/dist/cjs/stateproof.js.map +1 -0
- package/dist/cjs/transaction.js +724 -1009
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/block.js +813 -0
- package/dist/cjs/types/block.js.map +1 -0
- package/dist/cjs/types/intDecoding.js +1 -1
- package/dist/cjs/types/intDecoding.js.map +1 -1
- package/dist/cjs/types/statedelta.js +1155 -0
- package/dist/cjs/types/statedelta.js.map +1 -0
- package/dist/cjs/types/transactions/base.js +22 -5
- package/dist/cjs/types/transactions/base.js.map +1 -1
- package/dist/cjs/types/transactions/encoded.js +67 -0
- package/dist/cjs/types/transactions/encoded.js.map +1 -1
- package/dist/cjs/types/transactions/index.js +2 -5
- package/dist/cjs/types/transactions/index.js.map +1 -1
- package/dist/cjs/utils/utils.js +86 -22
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/cjs/wait.js +4 -4
- package/dist/cjs/wait.js.map +1 -1
- package/dist/esm/abi/abi_type.js +22 -15
- package/dist/esm/abi/abi_type.js.map +1 -1
- package/dist/esm/abi/contract.js +3 -1
- package/dist/esm/abi/contract.js.map +1 -1
- package/dist/esm/abi/event.js +2 -0
- package/dist/esm/abi/event.js.map +1 -0
- package/dist/esm/abi/index.js +6 -6
- package/dist/esm/abi/index.js.map +1 -1
- package/dist/esm/abi/interface.js +1 -1
- package/dist/esm/abi/interface.js.map +1 -1
- package/dist/esm/abi/method.js +8 -4
- package/dist/esm/abi/method.js.map +1 -1
- package/dist/esm/abi/transaction.js +1 -1
- package/dist/esm/abi/transaction.js.map +1 -1
- package/dist/esm/account.js +4 -4
- package/dist/esm/account.js.map +1 -1
- package/dist/esm/boxStorage.js +15 -15
- package/dist/esm/boxStorage.js.map +1 -1
- package/dist/esm/client/client.js +74 -40
- package/dist/esm/client/client.js.map +1 -1
- package/dist/esm/client/index.js +7 -0
- package/dist/esm/client/index.js.map +1 -0
- package/dist/esm/client/kmd.js +67 -62
- package/dist/esm/client/kmd.js.map +1 -1
- package/dist/esm/client/urlTokenBaseHTTPClient.js +16 -11
- package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/esm/client/v2/algod/accountApplicationInformation.js +10 -6
- package/dist/esm/client/v2/algod/accountApplicationInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/accountAssetInformation.js +10 -6
- package/dist/esm/client/v2/algod/accountAssetInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/accountInformation.js +10 -5
- package/dist/esm/client/v2/algod/accountInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +71 -70
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/block.js +5 -9
- package/dist/esm/client/v2/algod/block.js.map +1 -1
- package/dist/esm/client/v2/algod/compile.js +16 -10
- package/dist/esm/client/v2/algod/compile.js.map +1 -1
- package/dist/esm/client/v2/algod/disassemble.js +16 -10
- package/dist/esm/client/v2/algod/disassemble.js.map +1 -1
- package/dist/esm/client/v2/algod/dryrun.js +16 -12
- package/dist/esm/client/v2/algod/dryrun.js.map +1 -1
- package/dist/esm/client/v2/algod/genesis.js +5 -1
- package/dist/esm/client/v2/algod/genesis.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js +9 -9
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxes.js +7 -7
- package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationByID.js +9 -4
- package/dist/esm/client/v2/algod/getApplicationByID.js.map +1 -1
- package/dist/esm/client/v2/algod/getAssetByID.js +9 -4
- package/dist/esm/client/v2/algod/getAssetByID.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockHash.js +9 -5
- package/dist/esm/client/v2/algod/getBlockHash.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +5 -4
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockTxids.js +9 -3
- package/dist/esm/client/v2/algod/getBlockTxids.js.map +1 -1
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js +10 -5
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -1
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +10 -5
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
- package/dist/esm/client/v2/algod/getSyncRound.js +5 -4
- package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +8 -8
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
- package/dist/esm/client/v2/algod/getTransactionProof.js +9 -5
- package/dist/esm/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/esm/client/v2/algod/healthCheck.js +3 -8
- package/dist/esm/client/v2/algod/healthCheck.js.map +1 -1
- package/dist/esm/client/v2/algod/index.js +4 -0
- package/dist/esm/client/v2/algod/index.js.map +1 -0
- package/dist/esm/client/v2/algod/lightBlockHeaderProof.js +9 -4
- package/dist/esm/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +3712 -1821
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactionInformation.js +5 -8
- package/dist/esm/client/v2/algod/pendingTransactionInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactions.js +5 -7
- package/dist/esm/client/v2/algod/pendingTransactions.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js +6 -9
- package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
- package/dist/esm/client/v2/algod/ready.js +3 -1
- package/dist/esm/client/v2/algod/ready.js.map +1 -1
- package/dist/esm/client/v2/algod/sendRawTransaction.js +15 -6
- package/dist/esm/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +12 -7
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
- package/dist/esm/client/v2/algod/setSyncRound.js +12 -7
- package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/simulateTransaction.js +14 -11
- package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/esm/client/v2/algod/stateproof.js +9 -4
- package/dist/esm/client/v2/algod/stateproof.js.map +1 -1
- package/dist/esm/client/v2/algod/status.js +7 -1
- package/dist/esm/client/v2/algod/status.js.map +1 -1
- package/dist/esm/client/v2/algod/statusAfterBlock.js +9 -4
- package/dist/esm/client/v2/algod/statusAfterBlock.js.map +1 -1
- package/dist/esm/client/v2/algod/suggestedParams.js +12 -8
- package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/esm/client/v2/algod/supply.js +7 -1
- package/dist/esm/client/v2/algod/supply.js.map +1 -1
- package/dist/esm/client/v2/algod/unsetSyncRound.js +10 -4
- package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/versions.js +7 -1
- package/dist/esm/client/v2/algod/versions.js.map +1 -1
- package/dist/esm/client/v2/indexer/index.js +4 -0
- package/dist/esm/client/v2/indexer/index.js.map +1 -0
- package/dist/esm/client/v2/indexer/indexer.js +42 -42
- package/dist/esm/client/v2/indexer/indexer.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountAssets.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountByID.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +18 -11
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js +9 -9
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplicationLogs.js +9 -4
- package/dist/esm/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplications.js +9 -4
- package/dist/esm/client/v2/indexer/lookupApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js +9 -4
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetByID.js +9 -4
- package/dist/esm/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +17 -10
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupBlock.js +9 -4
- package/dist/esm/client/v2/indexer/lookupBlock.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupTransactionByID.js +9 -4
- package/dist/esm/client/v2/indexer/lookupTransactionByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/makeHealthCheck.js +7 -1
- package/dist/esm/client/v2/indexer/makeHealthCheck.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +3591 -1648
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchAccounts.js +8 -2
- package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js +7 -7
- package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForApplications.js +8 -2
- package/dist/esm/client/v2/indexer/searchForApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForAssets.js +8 -2
- package/dist/esm/client/v2/indexer/searchForAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForTransactions.js +15 -7
- package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/esm/client/v2/jsonrequest.js +22 -51
- package/dist/esm/client/v2/jsonrequest.js.map +1 -1
- package/dist/esm/client/v2/serviceClient.js +3 -20
- package/dist/esm/client/v2/serviceClient.js.map +1 -1
- package/dist/esm/client/v2/untypedmodel.js +18 -0
- package/dist/esm/client/v2/untypedmodel.js.map +1 -0
- package/dist/esm/composer.js +43 -37
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/convert.js.map +1 -1
- package/dist/esm/dryrun.js +98 -195
- package/dist/esm/dryrun.js.map +1 -1
- package/dist/esm/encoding/address.js +85 -100
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/encoding/bigint.js +2 -3
- package/dist/esm/encoding/bigint.js.map +1 -1
- package/dist/esm/encoding/binarydata.js +73 -0
- package/dist/esm/encoding/binarydata.js.map +1 -0
- package/dist/esm/encoding/encoding.js +337 -12
- package/dist/esm/encoding/encoding.js.map +1 -1
- package/dist/esm/encoding/schema/address.js +37 -0
- package/dist/esm/encoding/schema/address.js.map +1 -0
- package/dist/esm/encoding/schema/array.js +39 -0
- package/dist/esm/encoding/schema/array.js.map +1 -0
- package/dist/esm/encoding/schema/binarystring.js +51 -0
- package/dist/esm/encoding/schema/binarystring.js.map +1 -0
- package/dist/esm/encoding/schema/blockhash.js +60 -0
- package/dist/esm/encoding/schema/blockhash.js.map +1 -0
- package/dist/esm/encoding/schema/boolean.js +38 -0
- package/dist/esm/encoding/schema/boolean.js.map +1 -0
- package/dist/esm/encoding/schema/bytearray.js +93 -0
- package/dist/esm/encoding/schema/bytearray.js.map +1 -0
- package/dist/esm/encoding/schema/index.js +12 -0
- package/dist/esm/encoding/schema/index.js.map +1 -0
- package/dist/esm/encoding/schema/map.js +517 -0
- package/dist/esm/encoding/schema/map.js.map +1 -0
- package/dist/esm/encoding/schema/optional.js +54 -0
- package/dist/esm/encoding/schema/optional.js.map +1 -0
- package/dist/esm/encoding/schema/string.js +39 -0
- package/dist/esm/encoding/schema/string.js.map +1 -0
- package/dist/esm/encoding/schema/uint64.js +32 -0
- package/dist/esm/encoding/schema/uint64.js.map +1 -0
- package/dist/esm/encoding/schema/untyped.js +29 -0
- package/dist/esm/encoding/schema/untyped.js.map +1 -0
- package/dist/esm/encoding/uint64.js +1 -1
- package/dist/esm/encoding/uint64.js.map +1 -1
- package/dist/esm/group.js +22 -58
- package/dist/esm/group.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logic/sourcemap.js +54 -23
- package/dist/esm/logic/sourcemap.js.map +1 -1
- package/dist/esm/logicsig.js +110 -141
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/main.js +47 -76
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/makeTxn.js +314 -513
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/mnemonic/mnemonic.js +5 -5
- package/dist/esm/mnemonic/mnemonic.js.map +1 -1
- package/dist/esm/multisig.js +56 -305
- package/dist/esm/multisig.js.map +1 -1
- package/dist/esm/multisigSigning.js +254 -0
- package/dist/esm/multisigSigning.js.map +1 -0
- package/dist/esm/nacl/naclWrappers.js +1 -1
- package/dist/esm/nacl/naclWrappers.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/dist/esm/signedTransaction.js +100 -0
- package/dist/esm/signedTransaction.js.map +1 -0
- package/dist/esm/signer.js +3 -3
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/signing.js +77 -0
- package/dist/esm/signing.js.map +1 -0
- package/dist/esm/stateproof.js +408 -0
- package/dist/esm/stateproof.js.map +1 -0
- package/dist/esm/transaction.js +723 -1005
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/block.js +797 -0
- package/dist/esm/types/block.js.map +1 -0
- package/dist/esm/types/intDecoding.js +1 -1
- package/dist/esm/types/intDecoding.js.map +1 -1
- package/dist/esm/types/statedelta.js +1129 -0
- package/dist/esm/types/statedelta.js.map +1 -0
- package/dist/esm/types/transactions/base.js +18 -2
- package/dist/esm/types/transactions/base.js.map +1 -1
- package/dist/esm/types/transactions/encoded.js +62 -1
- package/dist/esm/types/transactions/encoded.js.map +1 -1
- package/dist/esm/types/transactions/index.js +2 -3
- package/dist/esm/types/transactions/index.js.map +1 -1
- package/dist/esm/utils/utils.js +80 -21
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/esm/wait.js +4 -4
- package/dist/esm/wait.js.map +1 -1
- package/dist/types/abi/abi_type.d.ts +1 -1
- package/dist/types/abi/contract.d.ts +5 -1
- package/dist/types/abi/event.d.ts +16 -0
- package/dist/types/abi/index.d.ts +6 -6
- package/dist/types/abi/interface.d.ts +1 -1
- package/dist/types/abi/method.d.ts +12 -5
- package/dist/types/abi/transaction.d.ts +1 -1
- package/dist/types/account.d.ts +1 -1
- package/dist/types/boxStorage.d.ts +4 -5
- package/dist/types/client/baseHTTPClient.d.ts +9 -6
- package/dist/types/client/client.d.ts +59 -18
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/kmd.d.ts +12 -10
- package/dist/types/client/urlTokenBaseHTTPClient.d.ts +8 -5
- package/dist/types/client/v2/algod/accountApplicationInformation.d.ts +8 -6
- package/dist/types/client/v2/algod/accountAssetInformation.d.ts +8 -6
- package/dist/types/client/v2/algod/accountInformation.d.ts +7 -5
- package/dist/types/client/v2/algod/algod.d.ts +53 -52
- package/dist/types/client/v2/algod/block.d.ts +5 -4
- package/dist/types/client/v2/algod/compile.d.ts +7 -9
- package/dist/types/client/v2/algod/disassemble.d.ts +7 -9
- package/dist/types/client/v2/algod/dryrun.d.ts +7 -9
- package/dist/types/client/v2/algod/genesis.d.ts +4 -2
- package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +6 -7
- package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +6 -7
- package/dist/types/client/v2/algod/getApplicationByID.d.ts +6 -5
- package/dist/types/client/v2/algod/getAssetByID.d.ts +6 -5
- package/dist/types/client/v2/algod/getBlockHash.d.ts +7 -6
- package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +5 -4
- package/dist/types/client/v2/algod/getBlockTxids.d.ts +6 -5
- package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +6 -5
- package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +6 -5
- package/dist/types/client/v2/algod/getSyncRound.d.ts +5 -4
- package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +6 -7
- package/dist/types/client/v2/algod/getTransactionProof.d.ts +6 -5
- package/dist/types/client/v2/algod/healthCheck.d.ts +4 -3
- package/dist/types/client/v2/algod/index.d.ts +2 -0
- package/dist/types/client/v2/algod/lightBlockHeaderProof.d.ts +6 -5
- package/dist/types/client/v2/algod/models/types.d.ts +629 -318
- package/dist/types/client/v2/algod/pendingTransactionInformation.d.ts +5 -4
- package/dist/types/client/v2/algod/pendingTransactions.d.ts +5 -4
- package/dist/types/client/v2/algod/pendingTransactionsByAddress.d.ts +7 -5
- package/dist/types/client/v2/algod/ready.d.ts +4 -2
- package/dist/types/client/v2/algod/sendRawTransaction.d.ts +7 -5
- package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +6 -6
- package/dist/types/client/v2/algod/setSyncRound.d.ts +6 -6
- package/dist/types/client/v2/algod/simulateTransaction.d.ts +7 -7
- package/dist/types/client/v2/algod/stateproof.d.ts +6 -5
- package/dist/types/client/v2/algod/status.d.ts +5 -2
- package/dist/types/client/v2/algod/statusAfterBlock.d.ts +6 -5
- package/dist/types/client/v2/algod/suggestedParams.d.ts +25 -4
- package/dist/types/client/v2/algod/supply.d.ts +5 -2
- package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -3
- package/dist/types/client/v2/algod/versions.d.ts +5 -2
- package/dist/types/client/v2/indexer/index.d.ts +2 -0
- package/dist/types/client/v2/indexer/indexer.d.ts +31 -30
- package/dist/types/client/v2/indexer/lookupAccountAppLocalStates.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountAssets.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountByID.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountCreatedApplications.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountCreatedAssets.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +11 -9
- package/dist/types/client/v2/indexer/lookupApplicationBoxByIDandName.d.ts +6 -7
- package/dist/types/client/v2/indexer/lookupApplicationLogs.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupApplications.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetBalances.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetByID.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +12 -10
- package/dist/types/client/v2/indexer/lookupBlock.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupTransactionByID.d.ts +6 -5
- package/dist/types/client/v2/indexer/makeHealthCheck.d.ts +5 -2
- package/dist/types/client/v2/indexer/models/types.d.ts +513 -267
- package/dist/types/client/v2/indexer/searchAccounts.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForApplicationBoxes.d.ts +6 -7
- package/dist/types/client/v2/indexer/searchForApplications.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForAssets.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForTransactions.d.ts +11 -7
- package/dist/types/client/v2/jsonrequest.d.ts +20 -33
- package/dist/types/client/v2/serviceClient.d.ts +4 -18
- package/dist/types/client/v2/untypedmodel.d.ts +10 -0
- package/dist/types/composer.d.ts +18 -17
- package/dist/types/dryrun.d.ts +8 -80
- package/dist/types/encoding/address.d.ts +40 -31
- package/dist/types/encoding/binarydata.d.ts +30 -0
- package/dist/types/encoding/encoding.d.ts +219 -7
- package/dist/types/encoding/schema/address.d.ts +10 -0
- package/dist/types/encoding/schema/array.d.ts +11 -0
- package/dist/types/encoding/schema/binarystring.d.ts +18 -0
- package/dist/types/encoding/schema/blockhash.d.ts +16 -0
- package/dist/types/encoding/schema/boolean.d.ts +10 -0
- package/dist/types/encoding/schema/bytearray.d.ts +19 -0
- package/dist/types/encoding/schema/index.d.ts +11 -0
- package/dist/types/encoding/schema/map.d.ts +125 -0
- package/dist/types/encoding/schema/optional.d.ts +24 -0
- package/dist/types/encoding/schema/string.d.ts +9 -0
- package/dist/types/encoding/schema/uint64.d.ts +9 -0
- package/dist/types/encoding/schema/untyped.d.ts +9 -0
- package/dist/types/encoding/uint64.d.ts +1 -0
- package/dist/types/group.d.ts +6 -25
- package/dist/types/index.d.ts +2 -2
- package/dist/types/logic/sourcemap.d.ts +39 -13
- package/dist/types/logicsig.d.ts +27 -57
- package/dist/types/main.d.ts +43 -54
- package/dist/types/makeTxn.d.ts +129 -388
- package/dist/types/mnemonic/mnemonic.d.ts +1 -1
- package/dist/types/multisig.d.ts +28 -99
- package/dist/types/multisigSigning.d.ts +72 -0
- package/dist/types/signedTransaction.d.ts +55 -0
- package/dist/types/signer.d.ts +5 -5
- package/dist/types/signing.d.ts +29 -0
- package/dist/types/stateproof.d.ts +194 -0
- package/dist/types/transaction.d.ts +103 -182
- package/dist/types/types/account.d.ts +2 -1
- package/dist/types/types/block.d.ts +407 -0
- package/dist/types/types/intDecoding.d.ts +1 -1
- package/dist/types/types/statedelta.d.ts +575 -0
- package/dist/types/types/transactions/base.d.ts +206 -118
- package/dist/types/types/transactions/encoded.d.ts +7 -301
- package/dist/types/types/transactions/index.d.ts +2 -15
- package/dist/types/types/utils.d.ts +7 -7
- package/dist/types/utils/utils.d.ts +21 -16
- package/dist/types/wait.d.ts +3 -2
- package/package.json +48 -20
- package/src/abi/abi_type.ts +28 -18
- package/src/abi/contract.ts +7 -1
- package/src/abi/event.ts +16 -0
- package/src/abi/index.ts +6 -6
- package/src/abi/interface.ts +1 -1
- package/src/abi/method.ts +22 -8
- package/src/abi/transaction.ts +2 -2
- package/src/account.ts +5 -5
- package/src/boxStorage.ts +25 -23
- package/src/client/baseHTTPClient.ts +12 -6
- package/src/client/client.ts +147 -75
- package/src/client/index.ts +6 -0
- package/src/client/kmd.ts +79 -72
- package/src/client/urlTokenBaseHTTPClient.ts +25 -14
- package/src/client/v2/algod/accountApplicationInformation.ts +16 -9
- package/src/client/v2/algod/accountAssetInformation.ts +16 -9
- package/src/client/v2/algod/accountInformation.ts +16 -11
- package/src/client/v2/algod/algod.ts +83 -105
- package/src/client/v2/algod/block.ts +7 -11
- package/src/client/v2/algod/compile.ts +27 -19
- package/src/client/v2/algod/disassemble.ts +27 -19
- package/src/client/v2/algod/dryrun.ts +23 -19
- package/src/client/v2/algod/genesis.ts +8 -2
- package/src/client/v2/algod/getApplicationBoxByName.ts +10 -15
- package/src/client/v2/algod/getApplicationBoxes.ts +12 -13
- package/src/client/v2/algod/getApplicationByID.ts +15 -7
- package/src/client/v2/algod/getAssetByID.ts +15 -7
- package/src/client/v2/algod/getBlockHash.ts +13 -9
- package/src/client/v2/algod/getBlockOffsetTimestamp.ts +7 -8
- package/src/client/v2/algod/getBlockTxids.ts +12 -6
- package/src/client/v2/algod/getLedgerStateDelta.ts +16 -8
- package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -8
- package/src/client/v2/algod/getSyncRound.ts +7 -8
- package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +15 -15
- package/src/client/v2/algod/getTransactionProof.ts +11 -9
- package/src/client/v2/algod/healthCheck.ts +5 -9
- package/src/client/v2/algod/index.ts +3 -0
- package/src/client/v2/algod/lightBlockHeaderProof.ts +15 -8
- package/src/client/v2/algod/models/types.ts +4729 -2254
- package/src/client/v2/algod/pendingTransactionInformation.ts +11 -11
- package/src/client/v2/algod/pendingTransactions.ts +7 -9
- package/src/client/v2/algod/pendingTransactionsByAddress.ts +12 -11
- package/src/client/v2/algod/ready.ts +6 -2
- package/src/client/v2/algod/sendRawTransaction.ts +24 -13
- package/src/client/v2/algod/setBlockOffsetTimestamp.ts +21 -11
- package/src/client/v2/algod/setSyncRound.ts +21 -11
- package/src/client/v2/algod/simulateTransaction.ts +22 -23
- package/src/client/v2/algod/stateproof.ts +15 -8
- package/src/client/v2/algod/status.ts +10 -2
- package/src/client/v2/algod/statusAfterBlock.ts +15 -7
- package/src/client/v2/algod/suggestedParams.ts +40 -10
- package/src/client/v2/algod/supply.ts +10 -2
- package/src/client/v2/algod/unsetSyncRound.ts +16 -5
- package/src/client/v2/algod/versions.ts +10 -2
- package/src/client/v2/indexer/index.ts +3 -0
- package/src/client/v2/indexer/indexer.ts +51 -59
- package/src/client/v2/indexer/lookupAccountAppLocalStates.ts +16 -11
- package/src/client/v2/indexer/lookupAccountAssets.ts +16 -11
- package/src/client/v2/indexer/lookupAccountByID.ts +16 -11
- package/src/client/v2/indexer/lookupAccountCreatedApplications.ts +16 -11
- package/src/client/v2/indexer/lookupAccountCreatedAssets.ts +16 -11
- package/src/client/v2/indexer/lookupAccountTransactions.ts +26 -19
- package/src/client/v2/indexer/lookupApplicationBoxByIDandName.ts +10 -15
- package/src/client/v2/indexer/lookupApplicationLogs.ts +15 -7
- package/src/client/v2/indexer/lookupApplications.ts +15 -7
- package/src/client/v2/indexer/lookupAssetBalances.ts +15 -7
- package/src/client/v2/indexer/lookupAssetByID.ts +15 -7
- package/src/client/v2/indexer/lookupAssetTransactions.ts +27 -16
- package/src/client/v2/indexer/lookupBlock.ts +15 -7
- package/src/client/v2/indexer/lookupTransactionByID.ts +15 -7
- package/src/client/v2/indexer/makeHealthCheck.ts +10 -2
- package/src/client/v2/indexer/models/types.ts +4454 -1988
- package/src/client/v2/indexer/searchAccounts.ts +13 -4
- package/src/client/v2/indexer/searchForApplicationBoxes.ts +12 -13
- package/src/client/v2/indexer/searchForApplications.ts +13 -4
- package/src/client/v2/indexer/searchForAssets.ts +13 -4
- package/src/client/v2/indexer/searchForTransactions.ts +22 -11
- package/src/client/v2/jsonrequest.ts +39 -57
- package/src/client/v2/serviceClient.ts +9 -31
- package/src/client/v2/untypedmodel.ts +25 -0
- package/src/composer.ts +83 -60
- package/src/dryrun.ts +129 -306
- package/src/encoding/address.ts +134 -146
- package/src/encoding/bigint.ts +2 -4
- package/src/encoding/binarydata.ts +80 -0
- package/src/encoding/encoding.ts +558 -13
- package/src/encoding/schema/address.ts +53 -0
- package/src/encoding/schema/array.ts +66 -0
- package/src/encoding/schema/binarystring.ts +73 -0
- package/src/encoding/schema/blockhash.ts +84 -0
- package/src/encoding/schema/boolean.ts +54 -0
- package/src/encoding/schema/bytearray.ts +127 -0
- package/src/encoding/schema/index.ts +26 -0
- package/src/encoding/schema/map.ts +713 -0
- package/src/encoding/schema/optional.ts +72 -0
- package/src/encoding/schema/string.ts +55 -0
- package/src/encoding/schema/uint64.ts +46 -0
- package/src/encoding/schema/untyped.ts +47 -0
- package/src/encoding/uint64.ts +2 -1
- package/src/group.ts +27 -75
- package/src/index.ts +2 -2
- package/src/logic/sourcemap.ts +94 -29
- package/src/logicsig.ts +154 -202
- package/src/main.ts +91 -94
- package/src/makeTxn.ts +670 -1320
- package/src/mnemonic/mnemonic.ts +14 -14
- package/src/multisig.ts +89 -403
- package/src/multisigSigning.ts +359 -0
- package/src/nacl/naclWrappers.ts +1 -1
- package/src/signedTransaction.ts +163 -0
- package/src/signer.ts +10 -5
- package/src/signing.ts +95 -0
- package/src/stateproof.ts +595 -0
- package/src/transaction.ts +986 -1242
- package/src/types/account.ts +3 -1
- package/src/types/block.ts +1278 -0
- package/src/types/intDecoding.ts +1 -1
- package/src/types/statedelta.ts +1717 -0
- package/src/types/transactions/base.ts +230 -122
- package/src/types/transactions/encoded.ts +81 -371
- package/src/types/transactions/index.ts +2 -72
- package/src/types/utils.ts +3 -3
- package/src/utils/utils.ts +96 -25
- package/src/wait.ts +8 -7
- package/dist/cjs/bid.js +0 -83
- package/dist/cjs/bid.js.map +0 -1
- package/dist/cjs/client/v2/basemodel.js +0 -67
- package/dist/cjs/client/v2/basemodel.js.map +0 -1
- package/dist/cjs/types/address.js +0 -3
- package/dist/cjs/types/address.js.map +0 -1
- package/dist/cjs/types/blockHeader.js +0 -3
- package/dist/cjs/types/blockHeader.js.map +0 -1
- package/dist/cjs/types/index.js.map +0 -1
- package/dist/cjs/types/multisig.js +0 -3
- package/dist/cjs/types/multisig.js.map +0 -1
- package/dist/cjs/types/transactions/application.js +0 -3
- package/dist/cjs/types/transactions/application.js.map +0 -1
- package/dist/cjs/types/transactions/asset.js.map +0 -1
- package/dist/cjs/types/transactions/builder.js +0 -3
- package/dist/cjs/types/transactions/builder.js.map +0 -1
- package/dist/cjs/types/transactions/keyreg.js +0 -3
- package/dist/cjs/types/transactions/keyreg.js.map +0 -1
- package/dist/cjs/types/transactions/payment.js +0 -3
- package/dist/cjs/types/transactions/payment.js.map +0 -1
- package/dist/cjs/types/transactions/stateproof.js +0 -3
- package/dist/cjs/types/transactions/stateproof.js.map +0 -1
- package/dist/esm/bid.js +0 -57
- package/dist/esm/bid.js.map +0 -1
- package/dist/esm/client/v2/basemodel.js +0 -64
- package/dist/esm/client/v2/basemodel.js.map +0 -1
- package/dist/esm/types/address.js +0 -2
- package/dist/esm/types/address.js.map +0 -1
- package/dist/esm/types/blockHeader.js +0 -2
- package/dist/esm/types/blockHeader.js.map +0 -1
- package/dist/esm/types/index.js +0 -4
- package/dist/esm/types/index.js.map +0 -1
- package/dist/esm/types/multisig.js +0 -2
- package/dist/esm/types/multisig.js.map +0 -1
- package/dist/esm/types/transactions/application.js +0 -2
- package/dist/esm/types/transactions/application.js.map +0 -1
- package/dist/esm/types/transactions/asset.js +0 -2
- package/dist/esm/types/transactions/asset.js.map +0 -1
- package/dist/esm/types/transactions/builder.js +0 -2
- package/dist/esm/types/transactions/builder.js.map +0 -1
- package/dist/esm/types/transactions/keyreg.js +0 -2
- package/dist/esm/types/transactions/keyreg.js.map +0 -1
- package/dist/esm/types/transactions/payment.js +0 -2
- package/dist/esm/types/transactions/payment.js.map +0 -1
- package/dist/esm/types/transactions/stateproof.js +0 -2
- package/dist/esm/types/transactions/stateproof.js.map +0 -1
- package/dist/types/bid.d.ts +0 -38
- package/dist/types/client/v2/basemodel.d.ts +0 -11
- package/dist/types/types/address.d.ts +0 -7
- package/dist/types/types/blockHeader.d.ts +0 -67
- package/dist/types/types/index.d.ts +0 -3
- package/dist/types/types/multisig.d.ts +0 -20
- package/dist/types/types/transactions/application.d.ts +0 -22
- package/dist/types/types/transactions/asset.d.ts +0 -28
- package/dist/types/types/transactions/builder.d.ts +0 -36
- package/dist/types/types/transactions/keyreg.d.ts +0 -8
- package/dist/types/types/transactions/payment.d.ts +0 -8
- package/dist/types/types/transactions/stateproof.d.ts +0 -8
- package/src/bid.ts +0 -96
- package/src/client/v2/basemodel.ts +0 -81
- package/src/types/address.ts +0 -7
- package/src/types/blockHeader.ts +0 -81
- package/src/types/index.ts +0 -3
- package/src/types/multisig.ts +0 -22
- package/src/types/transactions/application.ts +0 -111
- package/src/types/transactions/asset.ts +0 -108
- package/src/types/transactions/builder.ts +0 -69
- package/src/types/transactions/keyreg.ts +0 -23
- package/src/types/transactions/payment.ts +0 -14
- package/src/types/transactions/stateproof.ts +0 -17
package/dist/esm/makeTxn.js
CHANGED
|
@@ -1,616 +1,417 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OnApplicationComplete } from './types/transactions/base';
|
|
3
|
-
import {
|
|
4
|
-
// Utilities
|
|
5
|
-
TransactionType, } from './types/transactions';
|
|
1
|
+
import { Transaction } from './transaction.js';
|
|
2
|
+
import { OnApplicationComplete, TransactionType, } from './types/transactions/base.js';
|
|
6
3
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @param
|
|
10
|
-
* @param amount - integer amount to send, in microAlgos
|
|
11
|
-
* @param closeRemainderTo - optionally close out remaining account balance to this account, represented as string rep of Algorand address
|
|
12
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
13
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
14
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
15
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
16
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
17
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
18
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
19
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
20
|
-
* genesisID - string specifies genesis ID of network in use
|
|
21
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
4
|
+
* Create a new payment transaction
|
|
5
|
+
*
|
|
6
|
+
* @param options - Payment transaction parameters
|
|
22
7
|
*/
|
|
23
|
-
export function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
amount,
|
|
28
|
-
closeRemainderTo,
|
|
8
|
+
export function makePaymentTxnWithSuggestedParamsFromObject({ sender, receiver, amount, closeRemainderTo, suggestedParams, note, lease, rekeyTo, }) {
|
|
9
|
+
return new Transaction({
|
|
10
|
+
type: TransactionType.pay,
|
|
11
|
+
sender,
|
|
29
12
|
note,
|
|
13
|
+
lease,
|
|
14
|
+
rekeyTo,
|
|
30
15
|
suggestedParams,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
paymentParams: {
|
|
17
|
+
receiver,
|
|
18
|
+
amount,
|
|
19
|
+
closeRemainderTo,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
35
22
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Create a new key registration transaction
|
|
25
|
+
*
|
|
26
|
+
* @param options - Key registration transaction parameters
|
|
27
|
+
*/
|
|
28
|
+
export function makeKeyRegistrationTxnWithSuggestedParamsFromObject({ sender, voteKey, selectionKey, stateProofKey, voteFirst, voteLast, voteKeyDilution, nonParticipation, suggestedParams, note, lease, rekeyTo, }) {
|
|
29
|
+
return new Transaction({
|
|
30
|
+
type: TransactionType.keyreg,
|
|
31
|
+
sender,
|
|
43
32
|
note,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
voteFirst,
|
|
47
|
-
voteLast,
|
|
48
|
-
voteKeyDilution,
|
|
33
|
+
lease,
|
|
34
|
+
rekeyTo,
|
|
49
35
|
suggestedParams,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
keyregParams: {
|
|
37
|
+
voteKey,
|
|
38
|
+
selectionKey,
|
|
39
|
+
stateProofKey,
|
|
40
|
+
voteFirst,
|
|
41
|
+
voteLast,
|
|
42
|
+
voteKeyDilution,
|
|
43
|
+
nonParticipation,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
56
46
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
/** makeAssetCreateTxnWithSuggestedParams takes asset creation arguments and returns a Transaction object
|
|
61
|
-
* for creating that asset
|
|
47
|
+
/**
|
|
48
|
+
* Base function for creating any type of asset config transaction.
|
|
62
49
|
*
|
|
63
|
-
* @param
|
|
64
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
65
|
-
* @param total - integer total supply of the asset
|
|
66
|
-
* @param decimals - integer number of decimals for asset unit calculation
|
|
67
|
-
* @param defaultFrozen - boolean whether asset accounts should default to being frozen
|
|
68
|
-
* @param manager - string representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc
|
|
69
|
-
* @param reserve - string representation of Algorand address representing asset reserve
|
|
70
|
-
* @param freeze - string representation of Algorand address with power to freeze/unfreeze asset holdings
|
|
71
|
-
* @param clawback - string representation of Algorand address with power to revoke asset holdings
|
|
72
|
-
* @param unitName - string units name for this asset
|
|
73
|
-
* @param assetName - string name for this asset
|
|
74
|
-
* @param assetURL - string URL relating to this asset
|
|
75
|
-
* @param assetMetadataHash - Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.
|
|
76
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
77
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
78
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
79
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
80
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
81
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
82
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
83
|
-
* genesisID - string specifies genesis ID of network in use
|
|
84
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
50
|
+
* @param options - Asset config transaction parameters
|
|
85
51
|
*/
|
|
86
|
-
export function
|
|
87
|
-
|
|
88
|
-
|
|
52
|
+
export function makeBaseAssetConfigTxn({ sender, assetIndex, total, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, assetMetadataHash, note, lease, rekeyTo, suggestedParams, }) {
|
|
53
|
+
return new Transaction({
|
|
54
|
+
type: TransactionType.acfg,
|
|
55
|
+
sender,
|
|
89
56
|
note,
|
|
57
|
+
lease,
|
|
58
|
+
rekeyTo,
|
|
90
59
|
suggestedParams,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
60
|
+
assetConfigParams: {
|
|
61
|
+
assetIndex,
|
|
62
|
+
total,
|
|
63
|
+
decimals,
|
|
64
|
+
defaultFrozen,
|
|
65
|
+
manager,
|
|
66
|
+
reserve,
|
|
67
|
+
freeze,
|
|
68
|
+
clawback,
|
|
69
|
+
unitName,
|
|
70
|
+
assetName,
|
|
71
|
+
assetURL,
|
|
72
|
+
assetMetadataHash,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create a new asset creation transaction
|
|
78
|
+
*
|
|
79
|
+
* @param options - Asset creation transaction parameters
|
|
80
|
+
*/
|
|
81
|
+
export function makeAssetCreateTxnWithSuggestedParamsFromObject({ sender, total, decimals, defaultFrozen, manager, reserve, freeze, clawback, unitName, assetName, assetURL, assetMetadataHash, note, lease, rekeyTo, suggestedParams, }) {
|
|
82
|
+
return makeBaseAssetConfigTxn({
|
|
83
|
+
sender,
|
|
84
|
+
total,
|
|
85
|
+
decimals,
|
|
86
|
+
defaultFrozen,
|
|
87
|
+
manager,
|
|
88
|
+
reserve,
|
|
89
|
+
freeze,
|
|
90
|
+
clawback,
|
|
91
|
+
unitName,
|
|
95
92
|
assetName,
|
|
96
93
|
assetURL,
|
|
97
94
|
assetMetadataHash,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
reKeyTo: rekeyTo,
|
|
104
|
-
};
|
|
105
|
-
return new txnBuilder.Transaction(o);
|
|
106
|
-
}
|
|
107
|
-
// helper for above makeAssetCreateTxnWithSuggestedParams, instead accepting an arguments object
|
|
108
|
-
export function makeAssetCreateTxnWithSuggestedParamsFromObject(o) {
|
|
109
|
-
return makeAssetCreateTxnWithSuggestedParams(o.from, o.note, o.total, o.decimals, o.defaultFrozen, o.manager, o.reserve, o.freeze, o.clawback, o.unitName, o.assetName, o.assetURL, o.assetMetadataHash, o.suggestedParams, o.rekeyTo);
|
|
95
|
+
note,
|
|
96
|
+
lease,
|
|
97
|
+
rekeyTo,
|
|
98
|
+
suggestedParams,
|
|
99
|
+
});
|
|
110
100
|
}
|
|
111
|
-
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
101
|
+
/**
|
|
102
|
+
* Create a new asset config transaction. This transaction can be issued by the asset manager to
|
|
103
|
+
* change the manager, reserve, freeze, or clawback address.
|
|
104
|
+
*
|
|
105
|
+
* You must respecify existing addresses to keep them the same; leaving a field blank is the same as
|
|
106
|
+
* turning that feature off for this asset.
|
|
114
107
|
*
|
|
115
|
-
* @param
|
|
116
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
117
|
-
* @param assetIndex - int asset index uniquely specifying the asset
|
|
118
|
-
* @param manager - string representation of new asset manager Algorand address
|
|
119
|
-
* @param reserve - string representation of new reserve Algorand address
|
|
120
|
-
* @param freeze - string representation of new freeze manager Algorand address
|
|
121
|
-
* @param clawback - string representation of new revocation manager Algorand address
|
|
122
|
-
* @param strictEmptyAddressChecking - boolean - throw an error if any of manager, reserve, freeze, or clawback are undefined. optional, defaults to true.
|
|
123
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
124
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
125
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
126
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
127
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
128
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
129
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
130
|
-
* genesisID - string specifies genesis ID of network in use
|
|
131
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
108
|
+
* @param options - Asset modification transaction parameters
|
|
132
109
|
*/
|
|
133
|
-
export function
|
|
134
|
-
if (
|
|
135
|
-
(
|
|
136
|
-
reserve === undefined ||
|
|
137
|
-
freeze === undefined ||
|
|
138
|
-
clawback === undefined)) {
|
|
139
|
-
throw Error('strict empty address checking was turned on, but at least one empty address was provided');
|
|
110
|
+
export function makeAssetConfigTxnWithSuggestedParamsFromObject({ sender, assetIndex, manager, reserve, freeze, clawback, strictEmptyAddressChecking, note, lease, rekeyTo, suggestedParams, }) {
|
|
111
|
+
if (!assetIndex) {
|
|
112
|
+
throw Error('assetIndex must be provided');
|
|
140
113
|
}
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
114
|
+
const strictChecking = strictEmptyAddressChecking ?? true;
|
|
115
|
+
if (strictChecking &&
|
|
116
|
+
(manager == null || reserve == null || freeze == null || clawback == null)) {
|
|
117
|
+
throw Error('strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.');
|
|
118
|
+
}
|
|
119
|
+
return makeBaseAssetConfigTxn({
|
|
120
|
+
sender,
|
|
144
121
|
assetIndex,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
type: TransactionType.acfg,
|
|
122
|
+
manager,
|
|
123
|
+
reserve,
|
|
124
|
+
freeze,
|
|
125
|
+
clawback,
|
|
150
126
|
note,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
// helper for above makeAssetConfigTxnWithSuggestedParams, instead accepting an arguments object
|
|
156
|
-
export function makeAssetConfigTxnWithSuggestedParamsFromObject(o) {
|
|
157
|
-
return makeAssetConfigTxnWithSuggestedParams(o.from, o.note, o.assetIndex, o.manager, o.reserve, o.freeze, o.clawback, o.suggestedParams, o.strictEmptyAddressChecking, o.rekeyTo);
|
|
127
|
+
lease,
|
|
128
|
+
rekeyTo,
|
|
129
|
+
suggestedParams,
|
|
130
|
+
});
|
|
158
131
|
}
|
|
159
|
-
/**
|
|
160
|
-
*
|
|
132
|
+
/**
|
|
133
|
+
* Create a new asset destroy transaction. This will allow the asset's manager to remove this asset
|
|
134
|
+
* from the ledger, provided all outstanding assets are held by the creator.
|
|
161
135
|
*
|
|
162
|
-
* @param
|
|
163
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
164
|
-
* @param assetIndex - int asset index uniquely specifying the asset
|
|
165
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
166
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
167
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
168
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
169
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
170
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
171
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
172
|
-
* genesisID - string specifies genesis ID of network in use
|
|
173
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
136
|
+
* @param options - Asset destroy transaction parameters
|
|
174
137
|
*/
|
|
175
|
-
export function
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
138
|
+
export function makeAssetDestroyTxnWithSuggestedParamsFromObject({ sender, assetIndex, note, lease, rekeyTo, suggestedParams, }) {
|
|
139
|
+
if (!assetIndex) {
|
|
140
|
+
throw Error('assetIndex must be provided');
|
|
141
|
+
}
|
|
142
|
+
return makeBaseAssetConfigTxn({
|
|
143
|
+
sender,
|
|
179
144
|
assetIndex,
|
|
180
|
-
type: TransactionType.acfg,
|
|
181
145
|
note,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
// helper for above makeAssetDestroyTxnWithSuggestedParams, instead accepting an arguments object
|
|
187
|
-
export function makeAssetDestroyTxnWithSuggestedParamsFromObject(o) {
|
|
188
|
-
return makeAssetDestroyTxnWithSuggestedParams(o.from, o.note, o.assetIndex, o.suggestedParams, o.rekeyTo);
|
|
146
|
+
lease,
|
|
147
|
+
rekeyTo,
|
|
148
|
+
suggestedParams,
|
|
149
|
+
});
|
|
189
150
|
}
|
|
190
|
-
/**
|
|
191
|
-
*
|
|
151
|
+
/**
|
|
152
|
+
* Create a new asset freeze transaction. This transaction allows the asset's freeze manager to
|
|
153
|
+
* freeze or un-freeze an account, blocking or allowing asset transfers to and from the targeted
|
|
154
|
+
* account.
|
|
192
155
|
*
|
|
193
|
-
* @param
|
|
194
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
195
|
-
* @param assetIndex - int asset index uniquely specifying the asset
|
|
196
|
-
* @param freezeTarget - string representation of Algorand address being frozen or unfrozen
|
|
197
|
-
* @param freezeState - true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact
|
|
198
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
199
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
200
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
201
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
202
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
203
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
204
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
205
|
-
* genesisID - string specifies genesis ID of network in use
|
|
206
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
156
|
+
* @param options - Asset freeze transaction parameters
|
|
207
157
|
*/
|
|
208
|
-
export function
|
|
209
|
-
|
|
210
|
-
from,
|
|
158
|
+
export function makeAssetFreezeTxnWithSuggestedParamsFromObject({ sender, assetIndex, freezeTarget, frozen, suggestedParams, note, lease, rekeyTo, }) {
|
|
159
|
+
return new Transaction({
|
|
211
160
|
type: TransactionType.afrz,
|
|
212
|
-
|
|
213
|
-
assetIndex,
|
|
214
|
-
freezeState,
|
|
161
|
+
sender,
|
|
215
162
|
note,
|
|
163
|
+
lease,
|
|
164
|
+
rekeyTo,
|
|
216
165
|
suggestedParams,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return makeAssetFreezeTxnWithSuggestedParams(o.from, o.note, o.assetIndex, o.freezeTarget, o.freezeState, o.suggestedParams, o.rekeyTo);
|
|
166
|
+
assetFreezeParams: {
|
|
167
|
+
assetIndex,
|
|
168
|
+
freezeTarget,
|
|
169
|
+
frozen,
|
|
170
|
+
},
|
|
171
|
+
});
|
|
224
172
|
}
|
|
225
|
-
/**
|
|
226
|
-
*
|
|
173
|
+
/**
|
|
174
|
+
* Create a new asset transfer transaction.
|
|
175
|
+
*
|
|
176
|
+
* Special case: to opt into an assets, set amount=0 and sender=receiver.
|
|
227
177
|
*
|
|
228
|
-
* @param
|
|
229
|
-
* @param to - string representation of Algorand address of asset recipient
|
|
230
|
-
* @param closeRemainderTo - optional - string representation of Algorand address - if provided,
|
|
231
|
-
* send all remaining assets after transfer to the "closeRemainderTo" address and close "from"'s asset holdings
|
|
232
|
-
* @param revocationTarget - optional - string representation of Algorand address - if provided,
|
|
233
|
-
* and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"
|
|
234
|
-
* @param amount - integer amount of assets to send
|
|
235
|
-
* @param note - uint8array of arbitrary data for sender to store
|
|
236
|
-
* @param assetIndex - int asset index uniquely specifying the asset
|
|
237
|
-
* @param suggestedParams - a dict holding common-to-all-txns args:
|
|
238
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
239
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
240
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
241
|
-
* * flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
242
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
243
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
244
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
245
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
246
|
-
* genesisID - string specifies genesis ID of network in use
|
|
247
|
-
* @param rekeyTo - rekeyTo address, optional
|
|
178
|
+
* @param options - Asset transfer transaction parameters
|
|
248
179
|
*/
|
|
249
|
-
export function
|
|
250
|
-
|
|
180
|
+
export function makeAssetTransferTxnWithSuggestedParamsFromObject({ sender, receiver, amount, closeRemainderTo, assetSender, note, assetIndex, suggestedParams, rekeyTo, lease, }) {
|
|
181
|
+
if (!assetIndex) {
|
|
182
|
+
throw Error('assetIndex must be provided');
|
|
183
|
+
}
|
|
184
|
+
return new Transaction({
|
|
251
185
|
type: TransactionType.axfer,
|
|
252
|
-
|
|
253
|
-
to,
|
|
254
|
-
amount,
|
|
255
|
-
suggestedParams,
|
|
256
|
-
assetIndex,
|
|
186
|
+
sender,
|
|
257
187
|
note,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
188
|
+
lease,
|
|
189
|
+
rekeyTo,
|
|
190
|
+
suggestedParams,
|
|
191
|
+
assetTransferParams: {
|
|
192
|
+
assetIndex,
|
|
193
|
+
receiver,
|
|
194
|
+
amount,
|
|
195
|
+
assetSender,
|
|
196
|
+
closeRemainderTo,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
267
199
|
}
|
|
268
200
|
/**
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
* @param
|
|
272
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
273
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
274
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
275
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
276
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
277
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
278
|
-
* genesisID - string specifies genesis ID of network in use
|
|
279
|
-
* @param onComplete - algosdk.OnApplicationComplete, what application should do once the program is done being run
|
|
280
|
-
* @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
|
|
281
|
-
* @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
|
|
282
|
-
* @param numLocalInts - restricts number of ints in per-user local state
|
|
283
|
-
* @param numLocalByteSlices - restricts number of byte slices in per-user local state
|
|
284
|
-
* @param numGlobalInts - restricts number of ints in global state
|
|
285
|
-
* @param numGlobalByteSlices - restricts number of byte slices in global state
|
|
286
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
287
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
288
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
289
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
290
|
-
* @param note - Arbitrary data for sender to store
|
|
291
|
-
* @param lease - Lease a transaction
|
|
292
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
293
|
-
* @param extraPages - integer extra pages of memory to rent on creation of application
|
|
294
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
201
|
+
* Base function for creating any application call transaction.
|
|
202
|
+
*
|
|
203
|
+
* @param options - Application call transaction parameters
|
|
295
204
|
*/
|
|
296
|
-
export function
|
|
297
|
-
|
|
205
|
+
export function makeApplicationCallTxnFromObject({ sender, appIndex, onComplete, appArgs, accounts, foreignApps, foreignAssets, boxes, approvalProgram, clearProgram, numLocalInts, numLocalByteSlices, numGlobalInts, numGlobalByteSlices, extraPages, note, lease, rekeyTo, suggestedParams, }) {
|
|
206
|
+
if (onComplete == null) {
|
|
207
|
+
throw Error('onComplete must be provided');
|
|
208
|
+
}
|
|
209
|
+
return new Transaction({
|
|
298
210
|
type: TransactionType.appl,
|
|
299
|
-
|
|
211
|
+
sender,
|
|
212
|
+
note,
|
|
213
|
+
lease,
|
|
214
|
+
rekeyTo,
|
|
300
215
|
suggestedParams,
|
|
216
|
+
appCallParams: {
|
|
217
|
+
appIndex,
|
|
218
|
+
onComplete,
|
|
219
|
+
appArgs,
|
|
220
|
+
accounts,
|
|
221
|
+
foreignAssets,
|
|
222
|
+
foreignApps,
|
|
223
|
+
boxes,
|
|
224
|
+
approvalProgram,
|
|
225
|
+
clearProgram,
|
|
226
|
+
numLocalInts,
|
|
227
|
+
numLocalByteSlices,
|
|
228
|
+
numGlobalInts,
|
|
229
|
+
numGlobalByteSlices,
|
|
230
|
+
extraPages,
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Make a transaction that will create an application.
|
|
236
|
+
*
|
|
237
|
+
* @param options - Application creation transaction parameters
|
|
238
|
+
*/
|
|
239
|
+
export function makeApplicationCreateTxnFromObject({ sender, onComplete, appArgs, accounts, foreignApps, foreignAssets, boxes, approvalProgram, clearProgram, numLocalInts, numLocalByteSlices, numGlobalInts, numGlobalByteSlices, extraPages, note, lease, rekeyTo, suggestedParams, }) {
|
|
240
|
+
if (!approvalProgram || !clearProgram) {
|
|
241
|
+
throw Error('approvalProgram and clearProgram must be provided');
|
|
242
|
+
}
|
|
243
|
+
if (onComplete == null) {
|
|
244
|
+
throw Error('onComplete must be provided');
|
|
245
|
+
}
|
|
246
|
+
return makeApplicationCallTxnFromObject({
|
|
247
|
+
sender,
|
|
301
248
|
appIndex: 0,
|
|
302
|
-
|
|
303
|
-
appLocalInts: numLocalInts,
|
|
304
|
-
appLocalByteSlices: numLocalByteSlices,
|
|
305
|
-
appGlobalInts: numGlobalInts,
|
|
306
|
-
appGlobalByteSlices: numGlobalByteSlices,
|
|
307
|
-
appApprovalProgram: approvalProgram,
|
|
308
|
-
appClearProgram: clearProgram,
|
|
249
|
+
onComplete,
|
|
309
250
|
appArgs,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
251
|
+
accounts,
|
|
252
|
+
foreignApps,
|
|
253
|
+
foreignAssets,
|
|
313
254
|
boxes,
|
|
255
|
+
approvalProgram,
|
|
256
|
+
clearProgram,
|
|
257
|
+
numLocalInts,
|
|
258
|
+
numLocalByteSlices,
|
|
259
|
+
numGlobalInts,
|
|
260
|
+
numGlobalByteSlices,
|
|
261
|
+
extraPages,
|
|
314
262
|
note,
|
|
315
263
|
lease,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
};
|
|
319
|
-
return new txnBuilder.Transaction(o);
|
|
320
|
-
}
|
|
321
|
-
// helper for above makeApplicationCreateTxn, instead accepting an arguments object
|
|
322
|
-
export function makeApplicationCreateTxnFromObject(o) {
|
|
323
|
-
return makeApplicationCreateTxn(o.from, o.suggestedParams, o.onComplete, o.approvalProgram, o.clearProgram, o.numLocalInts, o.numLocalByteSlices, o.numGlobalInts, o.numGlobalByteSlices, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.extraPages, o.boxes);
|
|
264
|
+
rekeyTo,
|
|
265
|
+
suggestedParams,
|
|
266
|
+
});
|
|
324
267
|
}
|
|
325
268
|
/**
|
|
326
269
|
* Make a transaction that changes an application's approval and clear programs
|
|
327
|
-
*
|
|
328
|
-
* @param
|
|
329
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
330
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
331
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
332
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
333
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
334
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
335
|
-
* genesisID - string specifies genesis ID of network in use
|
|
336
|
-
* @param appIndex - the ID of the app to be updated
|
|
337
|
-
* @param approvalProgram - Uint8Array, the compiled TEAL that approves a transaction
|
|
338
|
-
* @param clearProgram - Uint8Array, the compiled TEAL that runs when clearing state
|
|
339
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
340
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
341
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
342
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
343
|
-
* @param note - Arbitrary data for sender to store
|
|
344
|
-
* @param lease - Lease a transaction
|
|
345
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
346
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
270
|
+
*
|
|
271
|
+
* @param options - Application update transaction parameters
|
|
347
272
|
*/
|
|
348
|
-
export function
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
273
|
+
export function makeApplicationUpdateTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, approvalProgram, clearProgram, note, lease, rekeyTo, suggestedParams, }) {
|
|
274
|
+
if (!appIndex) {
|
|
275
|
+
throw Error('appIndex must be provided');
|
|
276
|
+
}
|
|
277
|
+
if (!approvalProgram || !clearProgram) {
|
|
278
|
+
throw Error('approvalProgram and clearProgram must be provided');
|
|
279
|
+
}
|
|
280
|
+
return makeApplicationCallTxnFromObject({
|
|
281
|
+
sender,
|
|
353
282
|
appIndex,
|
|
354
|
-
|
|
355
|
-
appOnComplete: OnApplicationComplete.UpdateApplicationOC,
|
|
356
|
-
appClearProgram: clearProgram,
|
|
283
|
+
onComplete: OnApplicationComplete.UpdateApplicationOC,
|
|
357
284
|
appArgs,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
285
|
+
accounts,
|
|
286
|
+
foreignApps,
|
|
287
|
+
foreignAssets,
|
|
361
288
|
boxes,
|
|
289
|
+
approvalProgram,
|
|
290
|
+
clearProgram,
|
|
362
291
|
note,
|
|
363
292
|
lease,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
// helper for above makeApplicationUpdateTxn, instead accepting an arguments object
|
|
369
|
-
export function makeApplicationUpdateTxnFromObject(o) {
|
|
370
|
-
return makeApplicationUpdateTxn(o.from, o.suggestedParams, o.appIndex, o.approvalProgram, o.clearProgram, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
|
|
293
|
+
rekeyTo,
|
|
294
|
+
suggestedParams,
|
|
295
|
+
});
|
|
371
296
|
}
|
|
372
297
|
/**
|
|
373
298
|
* Make a transaction that deletes an application
|
|
374
|
-
*
|
|
375
|
-
* @param
|
|
376
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
377
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
378
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
379
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
380
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
381
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
382
|
-
* genesisID - string specifies genesis ID of network in use
|
|
383
|
-
* @param appIndex - the ID of the app to be deleted
|
|
384
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
385
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
386
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
387
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
388
|
-
* @param note - Arbitrary data for sender to store
|
|
389
|
-
* @param lease - Lease a transaction
|
|
390
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
391
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
299
|
+
*
|
|
300
|
+
* @param options - Application deletion transaction parameters
|
|
392
301
|
*/
|
|
393
|
-
export function
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
302
|
+
export function makeApplicationDeleteTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
|
|
303
|
+
if (!appIndex) {
|
|
304
|
+
throw Error('appIndex must be provided');
|
|
305
|
+
}
|
|
306
|
+
return makeApplicationCallTxnFromObject({
|
|
307
|
+
sender,
|
|
398
308
|
appIndex,
|
|
399
|
-
|
|
309
|
+
onComplete: OnApplicationComplete.DeleteApplicationOC,
|
|
400
310
|
appArgs,
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
311
|
+
accounts,
|
|
312
|
+
foreignApps,
|
|
313
|
+
foreignAssets,
|
|
404
314
|
boxes,
|
|
405
315
|
note,
|
|
406
316
|
lease,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
// helper for above makeApplicationDeleteTxn, instead accepting an arguments object
|
|
412
|
-
export function makeApplicationDeleteTxnFromObject(o) {
|
|
413
|
-
return makeApplicationDeleteTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
|
|
317
|
+
rekeyTo,
|
|
318
|
+
suggestedParams,
|
|
319
|
+
});
|
|
414
320
|
}
|
|
415
321
|
/**
|
|
416
322
|
* Make a transaction that opts in to use an application
|
|
417
|
-
*
|
|
418
|
-
* @param
|
|
419
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
420
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
421
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
422
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
423
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
424
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
425
|
-
* genesisID - string specifies genesis ID of network in use
|
|
426
|
-
* @param appIndex - the ID of the app to join
|
|
427
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
428
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
429
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
430
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
431
|
-
* @param note - Arbitrary data for sender to store
|
|
432
|
-
* @param lease - Lease a transaction
|
|
433
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
434
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
323
|
+
*
|
|
324
|
+
* @param options - Application opt-in transaction parameters
|
|
435
325
|
*/
|
|
436
|
-
export function
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
326
|
+
export function makeApplicationOptInTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
|
|
327
|
+
if (!appIndex) {
|
|
328
|
+
throw Error('appIndex must be provided');
|
|
329
|
+
}
|
|
330
|
+
return makeApplicationCallTxnFromObject({
|
|
331
|
+
sender,
|
|
441
332
|
appIndex,
|
|
442
|
-
|
|
333
|
+
onComplete: OnApplicationComplete.OptInOC,
|
|
443
334
|
appArgs,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
335
|
+
accounts,
|
|
336
|
+
foreignApps,
|
|
337
|
+
foreignAssets,
|
|
447
338
|
boxes,
|
|
448
339
|
note,
|
|
449
340
|
lease,
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
// helper for above makeApplicationOptInTxn, instead accepting an argument object
|
|
455
|
-
export function makeApplicationOptInTxnFromObject(o) {
|
|
456
|
-
return makeApplicationOptInTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
|
|
341
|
+
rekeyTo,
|
|
342
|
+
suggestedParams,
|
|
343
|
+
});
|
|
457
344
|
}
|
|
458
345
|
/**
|
|
459
346
|
* Make a transaction that closes out a user's state in an application
|
|
460
|
-
*
|
|
461
|
-
* @param
|
|
462
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
463
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
464
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
465
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
466
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
467
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
468
|
-
* genesisID - string specifies genesis ID of network in use
|
|
469
|
-
* @param appIndex - the ID of the app to use
|
|
470
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
471
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
472
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
473
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
474
|
-
* @param note - Arbitrary data for sender to store
|
|
475
|
-
* @param lease - Lease a transaction
|
|
476
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
477
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
347
|
+
*
|
|
348
|
+
* @param options - Application close-out transaction parameters
|
|
478
349
|
*/
|
|
479
|
-
export function
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
350
|
+
export function makeApplicationCloseOutTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
|
|
351
|
+
if (!appIndex) {
|
|
352
|
+
throw Error('appIndex must be provided');
|
|
353
|
+
}
|
|
354
|
+
return makeApplicationCallTxnFromObject({
|
|
355
|
+
sender,
|
|
484
356
|
appIndex,
|
|
485
|
-
|
|
357
|
+
onComplete: OnApplicationComplete.CloseOutOC,
|
|
486
358
|
appArgs,
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
359
|
+
accounts,
|
|
360
|
+
foreignApps,
|
|
361
|
+
foreignAssets,
|
|
490
362
|
boxes,
|
|
491
363
|
note,
|
|
492
364
|
lease,
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
// helper for above makeApplicationCloseOutTxn, instead accepting an argument object
|
|
498
|
-
export function makeApplicationCloseOutTxnFromObject(o) {
|
|
499
|
-
return makeApplicationCloseOutTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
|
|
365
|
+
rekeyTo,
|
|
366
|
+
suggestedParams,
|
|
367
|
+
});
|
|
500
368
|
}
|
|
501
369
|
/**
|
|
502
370
|
* Make a transaction that clears a user's state in an application
|
|
503
|
-
*
|
|
504
|
-
* @param
|
|
505
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
506
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
507
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
508
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
509
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
510
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
511
|
-
* genesisID - string specifies genesis ID of network in use
|
|
512
|
-
* @param appIndex - the ID of the app to use
|
|
513
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
514
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
515
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
516
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
517
|
-
* @param note - Arbitrary data for sender to store
|
|
518
|
-
* @param lease - Lease a transaction
|
|
519
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
520
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
371
|
+
*
|
|
372
|
+
* @param options - Application clear state transaction parameters
|
|
521
373
|
*/
|
|
522
|
-
export function
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
374
|
+
export function makeApplicationClearStateTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
|
|
375
|
+
if (!appIndex) {
|
|
376
|
+
throw Error('appIndex must be provided');
|
|
377
|
+
}
|
|
378
|
+
return makeApplicationCallTxnFromObject({
|
|
379
|
+
sender,
|
|
527
380
|
appIndex,
|
|
528
|
-
|
|
381
|
+
onComplete: OnApplicationComplete.ClearStateOC,
|
|
529
382
|
appArgs,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
383
|
+
accounts,
|
|
384
|
+
foreignApps,
|
|
385
|
+
foreignAssets,
|
|
533
386
|
boxes,
|
|
534
387
|
note,
|
|
535
388
|
lease,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
// helper for above makeApplicationClearStateTxn, instead accepting an argument object
|
|
541
|
-
export function makeApplicationClearStateTxnFromObject(o) {
|
|
542
|
-
return makeApplicationClearStateTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
|
|
389
|
+
rekeyTo,
|
|
390
|
+
suggestedParams,
|
|
391
|
+
});
|
|
543
392
|
}
|
|
544
393
|
/**
|
|
545
394
|
* Make a transaction that just calls an application, doing nothing on completion
|
|
546
|
-
*
|
|
547
|
-
* @param
|
|
548
|
-
* fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true
|
|
549
|
-
* flatFee - bool optionally set this to true to specify fee as microalgos-per-txn
|
|
550
|
-
* If true, txn fee may fall below the ALGORAND_MIN_TX_FEE
|
|
551
|
-
* firstRound - integer first protocol round on which this txn is valid
|
|
552
|
-
* lastRound - integer last protocol round on which this txn is valid
|
|
553
|
-
* genesisHash - string specifies hash genesis block of network in use
|
|
554
|
-
* genesisID - string specifies genesis ID of network in use
|
|
555
|
-
* @param appIndex - the ID of the app to use
|
|
556
|
-
* @param appArgs - Array of Uint8Array, any additional arguments to the application
|
|
557
|
-
* @param accounts - Array of Address strings, any additional accounts to supply to the application
|
|
558
|
-
* @param foreignApps - Array of int, any other apps used by the application, identified by index
|
|
559
|
-
* @param foreignAssets - Array of int, any assets used by the application, identified by index
|
|
560
|
-
* @param note - Arbitrary data for sender to store
|
|
561
|
-
* @param lease - Lease a transaction
|
|
562
|
-
* @param rekeyTo - String representation of the Algorand address that will be used to authorize all future transactions
|
|
563
|
-
* @param boxes - Array of BoxReference, app ID and name of box to be accessed
|
|
395
|
+
*
|
|
396
|
+
* @param options - Application no-op transaction parameters
|
|
564
397
|
*/
|
|
565
|
-
export function
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
398
|
+
export function makeApplicationNoOpTxnFromObject({ sender, appIndex, appArgs, accounts, foreignApps, foreignAssets, boxes, note, lease, rekeyTo, suggestedParams, }) {
|
|
399
|
+
if (!appIndex) {
|
|
400
|
+
throw Error('appIndex must be provided');
|
|
401
|
+
}
|
|
402
|
+
return makeApplicationCallTxnFromObject({
|
|
403
|
+
sender,
|
|
570
404
|
appIndex,
|
|
571
|
-
|
|
405
|
+
onComplete: OnApplicationComplete.NoOpOC,
|
|
572
406
|
appArgs,
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
407
|
+
accounts,
|
|
408
|
+
foreignApps,
|
|
409
|
+
foreignAssets,
|
|
576
410
|
boxes,
|
|
577
411
|
note,
|
|
578
412
|
lease,
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
// helper for above makeApplicationNoOpTxn, instead accepting an argument object
|
|
584
|
-
export function makeApplicationNoOpTxnFromObject(o) {
|
|
585
|
-
return makeApplicationNoOpTxn(o.from, o.suggestedParams, o.appIndex, o.appArgs, o.accounts, o.foreignApps, o.foreignAssets, o.note, o.lease, o.rekeyTo, o.boxes);
|
|
586
|
-
}
|
|
587
|
-
export { OnApplicationComplete } from './types/transactions/base';
|
|
588
|
-
/**
|
|
589
|
-
* Generic function for creating any application call transaction.
|
|
590
|
-
*/
|
|
591
|
-
export function makeApplicationCallTxnFromObject(options) {
|
|
592
|
-
const o = {
|
|
593
|
-
type: TransactionType.appl,
|
|
594
|
-
from: options.from,
|
|
595
|
-
suggestedParams: options.suggestedParams,
|
|
596
|
-
appIndex: options.appIndex,
|
|
597
|
-
appOnComplete: options.onComplete,
|
|
598
|
-
appLocalInts: options.numLocalInts,
|
|
599
|
-
appLocalByteSlices: options.numLocalByteSlices,
|
|
600
|
-
appGlobalInts: options.numGlobalInts,
|
|
601
|
-
appGlobalByteSlices: options.numGlobalByteSlices,
|
|
602
|
-
appApprovalProgram: options.approvalProgram,
|
|
603
|
-
appClearProgram: options.clearProgram,
|
|
604
|
-
appArgs: options.appArgs,
|
|
605
|
-
appAccounts: options.accounts,
|
|
606
|
-
appForeignApps: options.foreignApps,
|
|
607
|
-
appForeignAssets: options.foreignAssets,
|
|
608
|
-
boxes: options.boxes,
|
|
609
|
-
note: options.note,
|
|
610
|
-
lease: options.lease,
|
|
611
|
-
reKeyTo: options.rekeyTo,
|
|
612
|
-
extraPages: options.extraPages,
|
|
613
|
-
};
|
|
614
|
-
return new txnBuilder.Transaction(o);
|
|
413
|
+
rekeyTo,
|
|
414
|
+
suggestedParams,
|
|
415
|
+
});
|
|
615
416
|
}
|
|
616
417
|
//# sourceMappingURL=makeTxn.js.map
|