-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App client deprecation #311
Conversation
BREAKING CHANGE: `ExecuteParams` has been moved from `types/composer` to `types/transaction`
5a789eb
to
ebbf51a
Compare
…create and deploy apps and create app clients test: Added test coverage of AppClient and AppFactory BREAKING CHANGE: `persistSourceMaps` takes `appManager` rather than `client` now
f5ff4ce
to
c3683e0
Compare
I find the deprecations a bit confusing in this PR. First, I'd propose we come up with a better naming differentiator than I also don't think it makes sense to deprecate individual Use appClient.appId and appClient.appAddress from an AppClient instance instead. Was rather confusing to me because it wasn't immediately obvious If someone is using a deprecated class, all of the class/instance methods are defacto deprecated so I think individual depcreation messages just make things more confusing. |
feat: Added appClient.params.fundAppAccount and appClient.transactions.fundAppAccount fix: Allow extraProgramPages to be passed into create and deploy call as override
c3683e0
to
c8daa04
Compare
It's rare that people will even need to interact with the class name itself since it's all exposed via The old classes and methods will be deleted after the next major version bump after this one so it's a temporary problem there are two classes with similar names and I was mostly thinking about what the end state of this will look like (also why it's in the same file rather than a different one because the end state that makes sense is to use that export path). I agree it's unusual that there are per-method deprecations for a deprecated class, but they are purely there to provide migration hints for end users. Neil has been migrating Lora to AlgorandClient and commented that the deprecation notes had been extremely helpful with the migration process so I was trying to replicate that experience. |
(Noting I only added method deprecations to ApplicationClient where there are big differences from old to new) |
Marking a class as deprecated only tells the user that they need to switch to something else, it doesn't give enough granular detail about how they should do that and maintain the existing behaviour. Having methods marked as deprecated allows us to inform the user how to transition to the new code in a way that maintains the previous semantics and behaviour. |
feat: Added a number of methods and types to ARC-56 to make interacting with it easier
ad50d43
to
b95895f
Compare
@robdmoore minor comment but worth removing the zenhub workflows from gh workflows folder too as they aren't needed. |
@robdmoore ci runs using node v18, but getting rollup errors on v22 when running locally:
Could be addressed as a minor enhancement outside of pr scope though but just wanted to note |
Thanks @aorumbayev! Looks like the assert error is coming from within the rollup typescript plugin. wessberg/rollup-plugin-ts#228 In the meantime, this library won't be able to be built on node.js 22 |
…or ABI calls" This reverts commit 252d67b.
BREAKING CHANGE: microAlgo/s property in AlgoAmount now returns a bigint
AlgorandClient
deprecation pass of app-client, transaction and debugging modules (last ones left!) and associated documentation changes. Also added a v7 migration guide.Breaking changes:
ExecuteParams
type from/types/composer
to/types/transaction
executeParams
inparams
input toappDeployer.deploy
collapsed into the params object itself (not a breaking change from v6 since this is a new feature from last pull request)persistSourceMaps
now takesappManager
rather thanclient
microAlgos
property inAlgoAmount
instances now returns abigint
rather than anumber
Deprecations
getAppClient
->algorand.client.getAppClientById
,algorand.client.getAppClientByCreatorAndName
oralgorand.client.getAppFactory
(for create or deploy)getAppClientById
->algorand.client.getAppClientById
oralgorand.client.getAppFactory
(for create or deploy)getAppClientByCreatorAndName
->algorand.client.getAppClientByCreatorAndName
oralgorand.client.getAppFactory
(for create or deploy)encodeTransactionNote
->AlgoKitComposer.arc2Note
for ARC-2 and let devs convert tostring
orUint8Array
themselves otherwisegetSenderAddress
-> Usealgorand.client
to interact with accounts, and use.addr
to get the address and/or move from usingSendTransactionFrom
toTransactionSignerAccount
and use.addr
instead.getTransactionWithSigner
-> UseAlgorandClient
/AlgoKitComposer
to construct transactions instead or construct analgosdk.TransactionWithSigner
manually instead.getSenderTransactionSigner
-> UseTransactionSignerAccount
instead ofSendTransactionFrom
or usealgosdk.makeBasicAccountTransactionSigner
/algosdk.makeLogicSigAccountTransactionSigner
.signTransaction
-> UseAlgorandClient
/AlgoKitComposer
to sign transactions or use the relevant underlyingaccount.signTxn
/algosdk.signLogicSigTransactionObject
/multiSigAccount.sign
/TransactionSigner
methods directly.sendTransaction
-> UseAlgorandClient
/AlgoKitComposer
to send transactions.sendParams
property in the input tosendAtomicTransactionComposer
-> newexecuteParams
propertyperformAtomicTransactionComposerDryrun
(deprecated Algorand feature)sendGroupOfTransactions
-> UseAlgoKitComposer
(algorand.newGroup()
) orAtomicTransactionComposer
to construct and send group transactions instead.capTransactionFee
-> UseAlgoKitComposer
and themaxFee
field in the transaction params instead.controlFees
-> UseAlgoKitComposer
and themaxFee
andstaticFee
fields in the transaction params instead.getTransactionParams
-> UsesuggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()
instead (AlgoKitComposer
takes care of this for you so not likely to be needed anymore)getAtomicTransactionComposerTransactions
-> Useatc.clone().buildGroup()
instead.ApplicationClient
->AppClient
andAppFactory
algorand.client.getAppClientByCreatorAndName
returns anAppClient
rather than anApplicationClient
algorand.client.getAppClientById
returns anAppClient
rather than anApplicationClient
New features
appManager.getGlobalState
AlgorandClientInterface
type to decouple taking a dependency onAlgorandClient
with creation of a circular dependency loop/types/app-arc56
with the root type beingArc56Contract
getABIEncodedValue
,getABIDecodedValue
, andgetTupleType
methods to/types/app-arc56
that allow you to encode and decode ABI values that use ARC-56 type strings (may reference structs, which can be nested)AppFactory
andAppClient
classes and addedalgorand.client.getAppFactory
andalgorand.client.getAppClientByNetwork
methods (and changedalgorand.client.getAppId
andalgorand.client.getAppClientByCreatorAndName
now returnAppClient
)arc32ToArc56
method to/types/app-spec
to allow conversion from ARC-32 to ARC-56 for backwards compatibilityaddTransaction
toAlgoKitComposer
so you can add a transaction (with optional signer) to the transaction groupsimulate
toAlgoKitComposer
so you can simulate a transaction groupAlgoKitComposer.arc2Note
method to get an ARC-2 transaction note