Algo Builder v3.0.0
This is our next major release which is focused on AVM v1.0 (TEALv5) full support and many improvements requested by the community.
Improvements
- TEALv5 support in
@algo-builder/runtime
AVM 1.0:- Cover, Uncover opcodes
- Loads, Stores opcodes
- Extract, Extract3 opcodes
- ExtractUint16, ExtractUint32, ExtractUint64 opcodes
- Txn, Global fields
- Added application account (a smart contract now has an escrow account). Updated checkpoint structure to store
applicationAccount
while runningalgob
scripts. - Support Inner Transactions:
Payment
,AssetTransfer
,AssetFreeze
,AssetRevoke
,AssetDeploy
,AssetModify
,AssetDelete
. - Support Pooled opcode budget
- Txnas, Gtxnas, Gtxnsas, Args, Log (logs are stored in txReceipt)
- Update all transaction functions (eg.
executeTx
,addAsset
,addApp
..etc) to return a transaction receipt. Addruntime.getTxReceipt
in@algo-builder/runtime
to query transaction info.
-
Add Asset Name to
assetDefinition
in@algo-builder/runtime
. -
Updated App, Asset counters in runtime from 0, to 8. This means that the newly created App/Asset Index will be 9 (instead of 1).
-
Added
runtime.loadLogic(..)
function (similar todeployer.loadLogic
API) which simplifies the testing and script flow (we can use the same code in tests and scripts). User should do the following migration:// from const daoFundLsigProg = getProgram("dao-fund-lsig.py", scInitParam); daoFundLsig = runtime.createLsigAccount(daoFundLsigProg, []); // to (mute logs) daoFundLsig = runtime.loadLogic("dao-fund-lsig.py", scInitParam, false);
For information about loading checkpoint(s) data using
@algo-builder/web
in a webapp, read here. -
Added
WallectConnectSession
class to create & manage wallect connect session. User can usesession.executeTransaction()
to execute algob transactions using wallet connect. -
Updated
getProgram
,loadLogic
to pass an optional argument:logs (true/false)
. By default logs will be displayed on console during compilation.// logs == false const daoFundLsigProg = getProgram("dao-fund-lsig.py", {}, false);
-
Updated
deployer.deployApp(...)
&deployer.updateApp(...)
to take one more optional parameter:appName
. This will also save in a checkpoint the compiled app by name. -
deployer.updateApp()
andruntime.updateApp
take one more optional argument:scTmplParams: SCParams
to be compatible withdeployApp
and be able to use template parameters. -
Added new function
getAppByName(name: string)
to query checkpoint information by app name. -
Added
deployer.loadLogicFromCache
to load a logic signature from already compiled TEAL codes (stored inartifacts/cache
, for eg duringdeployer.fundLsig
). This avoid re-compilation (and passingscTmplParams
) each time(s) user wants to load an lsig. -
Updated
TealDbg
method to load already compiled TEAL code fromartifacts/cache
. Compilation is forced only when a) TEAL is not cached OR b)scInitParam
(template parameters) are passed withtealFile
. -
Adding
@algo-builder/web.status.getAssetHolding
function which queries account asset holding.
Infrastructure
- Updated private-net setup, sandbox & indexer scripts to run in
dev
mode.
Breaking changes
@algo-builder/runtime
:
-
Renamed
Runtime.getLogicSig
toRuntime.createLsigAccount
#506. -
runtime.addAsset(..)
,runtime.addApp(..)
return a tx receipt object, which contains the newly created appID/assetID.- Migration: Example code:
// from const appID = runtime.addApp(flags, {}, approvalProgram, clearProgram); // to const receipt = runtime.addApp(flags, {}, approvalProgram, clearProgram); const appID = receipt.appID;
-
getProgram
is moved to@algo-builder/runtime
from@algo-builder/algob
. -
runtime.addAsset
,runtime.addAssetDef
andruntime.addApp
are deprecated.
Please useruntime.deployASA
,runtime.deployASADef
andruntime.deployAdd
instead of the above functions. -
Update
runtime.deloyApp
to be compatible withdeployer.deployApp
. -
balanceOf
in@algo-builder/algob
package now return amount (number) of asset account holding and won't print them. If the account does not hold an asset it will return 0. To query asset holding, please use a new@algo-builder/web.status.getAssetHolding
function. -
Updated
deployer.deployApp
to passscTmplParams
(smart contract template parameters).