Releases: ecadlabs/taquito
Taquito v12.0.0-beta
Please note the presence of two breaking changes in this release. Refer to the following link for a guide to upgrade from version 11 to 12: https://tezostaquito.io/docs/upgrading_guide
Summary
Ithaca support
- @taquito/local-forging - Support forging and parsing of endorsement operation #1288
- @taquito/local-forging - Support for the new
SUB_MUTEZ
instruction #1292 - @taquito/rpc - Updated the
RpcClient
types based on the changes to the balance updates and the new type of operations #1255 - @taquito/rpc - Updated signature of the
getEndorsingRights
andgetBakingRights
methods #1256 - @taquito/michel-codec - Support for the
SUB_MUTEZ
instruction and theMap
instruction applied to an optional type #1291 - Updated Taquito website live code examples to use ithacanet #1441
New feature
- @taquito/taquito - Introduction of a "Read" interface #1389
Improvements
- @taquito/signer, @taquito/remote-signer and @taquito/ledger-signer - Replacement of libsodium with stablelib #991
- @taquito/taquito - Use the RPC
run_view
to execute lambda views #1298 - @taquito/taquito - Replacement of some RPC methods for performance purposes #1348
- @taquito/taquito - Use the
LocalForger
by default instead of theRpcForger
#1401 - @taquito/http-utils - Replaced the use of
xhr2-cookies
withaxios
#1113 - Integration tests - Rewrote the contract-permit test (TZIP-17) #1095: https://github.com/ecadlabs/taquito/blob/master/integration-tests/contract-permits.spec.ts
Bug Fixes
- @taquito/taquito - Fixed the
ContractAbstraction
instantiated by thecontract
method of theOriginationWalletOperation
class #1379 - @taquito/taquito - Allow estimating operations using a wallet #1387
Documentation
- Examples of using the BeaconWallet instance as a singleton #1045: https://tezostaquito.io/docs/beaconwallet-singleton
- Fixed link to Tezos faucet #1383
- Updated all website examples to show contract and wallet API example variants #493
- Algolia improvements - Fixed search bar returning dead links and duplicates #1411
@taquito/local-forging - Support forging and parsing of endorsement operations
The layout of the endorsement operations has changed in the Ithaca protocol. We added support for the new schema in the LocalForger
class.
Example of an endorsement for Ithaca:
{
kind: "endorsement",
slot: 0,
level: 66299,
round: 0,
block_payload_hash: "vh3FEkypvxUYLwjGYd2Sme7aWyfX8npDsqxcL6imVpBWnAZeNn2n"
}
Example of an endorsement before Ithaca:
{
kind: "endorsement",
level: 314813
}
@taquito/local-forging - Support for the new instruction SUB_MUTEZ
We added support to forge and parse operations containing the new SUB_MUTEZ
instruction in the Localforger
class.
[SUB_MUTEZ] is similar to the mutez case of the SUB instruction but its return type is option mutez instead of mutez. This allows subtracting mutez values without failing in case of underflow.
source: https://tezos.gitlab.io/protocols/012ithaca.html#michelson
@taquito/rpc - Updated the RpcClient
types based on the changes to the balance updates and the new type of operations
Support has been added to represent the new operations Preendorsement
, Double_preendorsement_evidence
, Set_deposits_limit
, and the new properties in operations result for Endorsement
operations.
We also support balance updates' new "kinds" and "type".
The new balance update kinds are accumulator
, minted
, burned
, and commitment
.
The new categories of balance updates are legacy_rewards
, block fees
, legacy_deposits
, nonce revelation rewards
, double signing evidence rewards
, endorsing rewards
,
baking rewards
, baking bonuses
, legacy_fees
, storage fees
, punishments
, lost endorsing rewards
, subsidy
, burned
, commitment
, bootstrap
, invoice
and minted
. They are represented by an enum called METADATA_BALANCE_UPDATES_CATEGORY
in Taquito.
The new origin for balance update is simulation
.
For more information on the balance update changes, refer to http://tezos.gitlab.io/protocols/tenderbake.html#metadata
@taquito/rpc - Updated signature of the getEndorsingRights
and getBakingRights
methods
getEndorsingRights
Parameter: The property cycle
is now an optional number instead of an optional list of numbers.
Response: An array of objects having the properties level
, delegates
, and an optional estimated_time
at which the rights can be exercised. The delegates
property is an array of objects with the delegate’s public key hash, the delegate’s first slot, and the delegate’s endorsing power.
Response example for ithacanet:
[
{
"level": 182721,
"delegates": [
{
"delegate": "tz1WhVphATKAtZmDswYGTPWRjPEGvgNT8CFW",
"first_slot": 2694,
"endorsing_power": 2
},
...
]
}
]
Response example for hangzhounet:
[
{
"level": 619478,
"delegate": "tz3c6J47hHmwuasew7Y3HMZzmy7ymDgd6cfy",
"slots": [
5,
79
],
"estimated_time": "2022-03-05T00:33:02Z"
},
...
]
getBakingRights
Parameter: The property cycle
is now an optional number instead of an optional list of numbers. The property max_priority
has been renamed to max_round
.
Response: The property priority
has been renamed to round
.
Response example for ithacanet:
[
{
level: 182704,
delegate: 'tz1MeT8NACB8Q4uV9dPQ3YxXBmYgapbxQxQ5',
round: 0,
estimated_time: '2022-03-05T00:28:55Z'
}...
]
Response example for hangzhounet:
[
{
level: 619462,
delegate: 'tz1PirbogVqfmBT9XCuYJ1KnDx4bnMSYfGru',
priority: 0,
estimated_time: '2022-03-05T00:28:45Z'
}...
]
@taquito/michel-codec - Support for the SUB_MUTEZ
instruction and the MAP
instruction applied to an optional type
@taquitp/michel-codec
is responsible, among others, to validate Michelson code to ensure its correctness. The package now supports the new SUB_MUTEZ
instruction and the MAP
instruction applied to values of optional type.
@taquito/taquito - Introduction of a "Read" interface
When using Taquito, all data retrieved from the blockchain are obtained using an RPC by default. For example, all required data for preparing an operation are fetched by doing different queries to a configured RPC node. Those data could be obtained using another medium (i.e., an Indexer), which would reduce the load on the nodes. With this in mind, we defined a new interface in Taquito named TzReadProvider
and a new provider on the TezosToolkit
named readProvider
. The readProvider
defaults to the RPC as before. The goal would be to have the different indexers implement the TzReadProvider
interface allowing users to configure their TezosToolkit
to fetch data from indexers instead of from the RPC.
Another change has been made regarding the confirmation method of the operations. The confirmation is now done using the SubscribeProvider
set on the TezosToolkit
. By default, the SubscribeProvider
is set to an instance of PollingSubscribeProvider
, which polls on the RPC for the head blocks as before. This change is intended to make it easier to use a different strategy for operation confirmation (for example, it could use streaming based on an indexer instead of polling on the RPC head block).
The change to the confirmation
methods includes a breaking change. The polling interval for the confirmation and the streamer configuration has been moved from the TezosToolkit
to the PollingSubscribeProvider
class, where they belong logically.
BREAKING CHANGE:
The confirmationPollingIntervalSecond
and the ConfigStreamer
are removed from the
TezosToolkit
. Configuration for the PollingSubscribeProvider needs to be specified in its constructor:
Before:
Tezos.setProvider({ config: { confirmationPollingIntervalSecond: 5 }});
Now:
Tezos.setStreamProvider(Tezos.getFactory(PollingSubscribeProvider)({ pollingIntervalMilliseconds:5000 }));
These changes consist of preliminary work to better support indexers in Taquito; there will be more to come on this in the near future.
@taquito/signer, @taquito/remote-signer and @taquito/ledger-signer - Replacement of libsodium with stablelib
Libsodium has been replaced with much smaller minified libraries from Stablelib. Thanks to Geo25rey, who suggested this alternative library.
Reduction of the bundle size:
Package | signer | remote-signer | ledger-signer |
---|---|---|---|
Libsodium | 795kB | 813.3kB | 790.6kB |
Stablelib | 254.9kB | 254.1kB | 232.2kB |
@taquito/taquito - Use the RPC run_view
to execute lambda views
Before version 12, we used a constantly failing lambda contract to execute the tzip4 (lambda) views. The result of the view was retrieved in the returned error. This implementation was a workaround, and since the Hangzhou protocol, the RPC exposes an endpoint (helpers/scripts/run_view
) allowing us to execute that kind of view.
We implemented a method called runView
in the @taquito/rpc
package, and we now use this method to execute the tzip4 views.
Before version 12, the lambda view was only enabled on the "contract" and not the "wallet" API as it relied on getting the result from an error. The feature is now enabled on the "wallet" API too.
Breaking change (primarily for sandbox users):...
Taquito v11.2.0-beta
Summary
New features
- @taquito/utils - Implemented additional hash checksum validation functions in Taquito #95
Improvements
- Upgrade to ES6 #1020
- @taquito/signer - Removed dependency on bip39, which has unneeded translation files #1110
- @taquito/michelson-encoder - Deprecated the
ExtractSchema
method in favor ofgenerateSchema
#1252, #1303, #1304 - Added validation to different hashes being passed in the Taquito codebase #1311
- @taquito/taquito & @taquito/tzip16 - Better error abstraction on view calls #641 & #1297
Bug Fixes
- @taquito/tzip12 -
TokenIdNotFound
error was incorrectly thrown on metadata view failure #1210 Schema
deserializedmap nat-nat
asMichelsonMap<string, BigNumber>
instead ofMichelsonMap<BigNumber, BigNumber>
#1140- Custom errors extend
Error
instead of implementing it #973 - @taquito/beacon-wallet - Fixed error
Cannot read property 'DAppClient' of undefined
#787 - Removed CommonJS module loading that was causing rollup.js to break #1098
Documentation
- Added a search bar to the Taquito website
- Allow website users to view Taquito docs based on specific versions #1208
- @taquito/ledger-signer - Replacement of the deprecated transport
@ledgerhq/hw-transport-node-hid
by@ledgerhq/hw-transport-u2f
: https://tezostaquito.io/docs/ledger_signer - Improved documentation showing the difference between
setDelegate
andRegisterDelegate
methods: https://tezostaquito.io/docs/set_delegate - Improvements of the README files
@taquito/utils - Implemented additional hash checksum validation functions in Taquito
Added utility functions to validate operation, block, and protocol hash.
Example of use:
import { validateBlock, validateOperation, validateProtocol } from '@taquito/utils';
const block ='BLJjnzaPtSsxykZ9pLTFLSfsKuiN3z7SjSPDPWwbE4Q68u5EpBw';
const validation = validateBlock(block);
const operation ='ood2Y1FLHH9izvYghVcDGGAkvJFo1CgSEjPfWvGsaz3qypCmeUj';
const validation = validateOperation(operation);
const protocol ='PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx';
const validation = validateProtocol(protocol);
@taquito/signer - Removed dependency on bip39
The dependency on bip39, which has unneeded translation files, has been removed. This change decreases the bundle size from 1 MB to 795kB.
@taquito/michelson-encoder - Deprecated the ExtractSchema
method in favor of generateSchema
Based on a Michelson type, ExtractSchema
returns the schema as expected by Taquito for the storage or entry point of a contract.
Users can use this method to discover how to write the storage property when deploying a contract or the parameter when calling a smart contract entry point using the methodsObject
property.
However, the ExtractSchema
method is missing important detail for some types and is not uniform across all tokens (i.e., there was no distinction between or
and pair
types, option
was not represented). Improvements to the generated schema have been implemented in a new method called generateSchema
.
ExtractSchema
has been deprecated to give time to migrate from the ExtractSchema
to the generateSchema
method as it includes breaking changes.
For each token, generateSchema
returns an object of type TokenSchema
. TokenSchema has a property __michelsonType
, a string, and a property schema
that contains information on the schema of the subtoken when applicable.
Examples:
The michelson type: { prim: 'option', args: [{ prim: 'int' }], annots: [] }
will be represented as follows by the generateSchema method:
{
__michelsonType: 'option',
schema: {
__michelsonType: 'int',
schema: 'int'
}
}
The michelson type: { prim: 'pair', args: [{ prim: 'int', annots: ['test'] }, { prim: 'string', annots: ['test2'] }], }
will be represented as follows by the generateSchema method:
// Nested pair will be brought to the same level (as it is the case with the ExtractSchema)
{
__michelsonType: 'pair',
schema: {
test: {
__michelsonType: 'int',
schema: 'int'
},
test2: {
__michelsonType: 'string',
schema: 'string'
}
}
}
The michelson type: { prim: 'map', args: [{ prim: 'string' }, { prim: 'int' }], annots: [] }
will be represented as follows by the generateSchema method:
// schema of a map has `key` and `value` properties
{
__michelsonType: 'map',
schema: {
key: {
__michelsonType: 'string',
schema: 'string'
},
value: {
__michelsonType: 'int',
schema: 'int'
}
}
}
Added validation to different hashes being passed in the Taquito codebase
Instead of leaving them to the node, hash validations have been implemented locally in Taquito. We included checksum validation for parameters of regular operations (i.e.: transfer/delegation/origination addresses).
@taquito/taquito & @taquito/tzip16 - Better error abstraction on view calls
A ViewSimulationError
is returned when a view simulation fails, which now contains an optional failWith
property, making it easier to access the FAILWITH
messages.
@taquito/tzip12 - TokenIdNotFound
was incorrectly trown on metadata view failure
The getTokenMetadata
method of the Tzip12ContractAbstraction
class was throwing a TokenIdNotFound
error when the execution of a token metadata view failed. However, failures can be related to other reasons related to the Tezos node, which does not mean that the token metadata does not exist. The error handling has been improved at the @taquito/tzip16
package level; if a view simulation reaches a FAILWITH
instruction, a ViewSimulationError
is returned. Otherwise, the original HttpResponseError
is thrown.
Custom errors should extend Error
The custom errors were implementing the Error class instead of extending it. Thus, errorFromTaquito instanceof Error
was returning false
. This issue has been fixed.
@taquito/beacon-wallet - Fixed error Cannot read property 'DAppClient' of undefined
The error Cannot read property 'DAppClient' of undefined
was thrown when using the @taquito/beacon-wallet
package without npm. This has been fixed by replacing the global name from beaconSdk
to beacon
in the taquito-beacon-wallet.umd.js compiled file.
Taquito v11.1.0-beta
Summary
New features
- @taquito/taquito - Support for simulating contract views #1117
- @taquito/michel-codec - Option added to the Parser to expand global constants in script #1219
- @taquito/taquito - Support contract origination using the storage property when there are global constants in the storage part of the contract code #1220
Bug Fixes
- @taquito/michelson-encoder - Fixed the Timestamp token to support decoding UNIX string format #1109
@taquito/taquito - Support for simulating contract views
Taquito provides an abstraction on the ContractAbstraction
class, allowing to simulate the execution of the on-chain views.
When an instance of ContractAbstraction
is created using the at
method of the Contract or Wallet API, the contractViews
member of the ContractAbstraction
instance is dynamically populated with methods that match the on-chain view names.
The contractViews
member is an object where the key is the view name, and the value is a function that takes the view arguments as a parameter and returns an instance of OnChainView
class.
When a view argument is of a complex type (i.e., a pair
), the view parameter is expected in an object format and not as "flattened arguments".
The "object format" refers to the same format used when deploying a contract using the storage
property. The "flattened arguments" is the format used when calling a contract entry point using the methods
member. We plan to move away from the "flattened arguments" format in favor of the object one.
As an example, if the Michelson view argument type is { prim: 'pair', args: [{ prim: 'nat' }, { prim: 'address' }] }
, the parameter expected by Taquito will have the following format {0: 'nat', 1: 'address'}
instead of nat, address
.
A method named getSignature
on the OnChainView
class allows inspecting the parameter and the returned type of the view.
The executeView
method of the OnChainView
class allows simulating the view. It takes a viewCaller
as a parameter representing the contract address which is the caller of the view, and an optional source
which is the public key hash of the account that initialized this view execution.
Here is an example where a contract contains a view named myView
, it can be simulated as follow:
const contract = Tezos.contract.at('KT1...');
const res = contract.contractViews.myView(param).executeView({
viewCaller: 'KT1...'
});
Here is the link to the documentation page: https://tezostaquito.io/docs/on_chain_views
@taquito/michel-codec - Option added to the Parser to expand global constants in a script
An optional expandGlobalConstant
property has been added to the ParserOptions
allowing to expand the global constants in a script using the Parser
class. The hashes and corresponding registered expressions need to be provided as follow:
const parserOptions: ParserOptions = {
expandGlobalConstant: {
constantHash: registeredExprJSON,
...
},
};
const p = new Parser(parserOptions);
@taquito/taquito - Support contract origination using the storage property when there are global constants in the storage part of the contract code
In the release note v11.0.0-beta, there was a note about the following limitation:
Only the 'init' property can be used if you want to originate a contract having a global constant in the storage section of its code. Do not use the
storage
property, which depends on theMichelson-Encoder
.Here is an example:
const op = await Tezos.contract.originate({ code: [ { prim: 'parameter', args: [ ...] }, { prim: 'storage', args: [{ prim: 'constant', args: [{ string: 'expr...' }] }] }, { prim: 'code', args: [ ... ] } ], init: // The storage property can't be used. Please use the `init` property instead. });
It is now possible to deploy a contract having a global constant in the storage part of its contract code using the storage property. Internally, Taquito uses the michel-codec Parser
and its expandGlobalConstant
option to feed the MichelsonEncoder, which is responsible for transforming the storage
property into Michelson, with a script that doesn't contain global constant.
A global constants provider has been added to the TezosToolkit
class. Currently, Taquito provides a DefaultGlobalConstantsProvider
, which can be injected in the TezosToolkit and where the user needs to specify the hashes and corresponding expressions used in its contracts.
Here is a example:
import { TezosToolkit, DefaultGlobalConstantsProvider } from '@taquito/taquito';
// create an instance of the `DefaultGlobalConstantsProvider`, load the global constants used in the contract, inject the instance on the TezosToolkit
const expression = { "prim": "int" }
const constantHash = 'expruu5BTdW7ajqJ9XPTF3kgcV78pRiaBW3Gq31mgp3WSYjjUBYxre';
const Tezos = new TezosToolkit('rpc_url');
const globalConstantProvider = new DefaultGlobalConstantsProvider();
globalConstantProvider.loadGlobalConstant({
[constantHash]: expression
})
Tezos.setGlobalConstantsProvider(globalConstantProvider);
We plan to support other global constant providers in the future that will depend on indexers or the RPC.
Here is a link to the documentation: https://tezostaquito.io/docs/global_constant#how-to-deploy-a-contract-using-the-storage-property-if-i-use-global-constant-in-the-storage-part-of-the-code
@taquito/michelson-encoder - Fixed the Timestamp token to support decoding UNIX string format
The Michelson-Encoder did not correctly support the UNIX string format. Therefore, Michelson data having the format "string":"1613034908" could not be decoded and generated the following error:
RangeError: Invalid time value
at Date.toISOString
at TimestampToken.Execute
This format is now supported in the Timestamp token of the Michelson-encoder.
Taquito v11.0.2-beta
@taquito/beacon-wallet
- The beacon-sdk is updated to version 2.3.8@taquito/utils
- Utility function to get Tezos Address (PKH) from a public key #643
Taquito v11.0.1 with Hangzhou support
Summary
This release of Taquito supports the upcoming Hangzhou protocol. As usual, this version supports the current protocol, Granada, and the next protocol Hangzhou.
We encourage all developers to update their projects to use version Taquito v11 as soon as is practical and absolutely before the Tezos mainnet transition from Granada to Hangzhou.
New features - Hangzhou protocol
@taquito/taquito
- Support for the new operation kindregister_global_constant
on the contract, batch and estimate APIs #1075- ``@taquito/local-forging`
@taquito/michelson-encoder
- Support new types related to operations-on-timelock #1071@taquito/michel-codec
New features - General
@taquito/utils
- Provide utility to verify signatures #611@taquito/rpc
- Support for the RPC endpointcontext/contracts/{contract}/script/normalized
. #1114
Documentation
- Add documentation on how to sign Michelson data #588: https://tezostaquito.io/docs/signing#signing-michelson-data
- Add a "dApp pre-launch checklist" to website documentation #1135: https://tezostaquito.io/docs/dapp_prelaunch
- Add a documentation page about wallets #1123: https://tezostaquito.io/docs/wallets
Others
- Preliminary support for Idiazabalnet protocol
@taquito/beacon-wallet
- The beacon-sdk is updated to version 2.3.7: https://github.com/airgap-it/beacon-sdk/releases/tag/v2.3.7- Migrate supported companion DApps to Hangzhou: Beacon Test DApp, Taquito React, and Metadata explorer #1065
Important note:
Please note that the Michelson-Encoder
does not support the global constant in this current release (11.0.0-beta). The expanded contract scripts need to be used with the Michelson-Encoder
until further support. This brings the following limitation: only the 'init' property can be used if you want to originate a contract having a global constant in the storage section of its code. Do not use the storage
property, which depends on the Michelson-Encoder
.
Here an example:
const op = await Tezos.contract.originate({
code: [
{ prim: 'parameter', args: [ ...] },
{ prim: 'storage', args: [{ prim: 'constant', args: [{ string: 'expr...' }] }] },
{ prim: 'code', args: [ ... ] } ],
init: // The storage property can't be used until global constants are supported in by the Michelson-Encoder. Please use the `init` property instead.
});
@taquito/taquito
- Support the new operation kind register_global_constant
on the contract, batch and estimate APIs
The new manager operation register_global_constant
has been added to the contract, batch, and estimate APIs. This new operation allows users to register Micheline expressions in a global table of constants.
A registerGlobalConstant
method is available on the ContractProvider
class. A value
representing the Micheline expression to register in its JSON format is required as a parameter. The registerGlobalConstant
method returns an instance of RegisterGlobalConstantOperation
containing a globalConstantHash
member that corresponds to the index(hash) of the newly registered constant.
const op = await Tezos.contract.registerGlobalConstant({
value: { "prim": "or",
"args":
[ { "prim": "int", "annots": [ "%decrement" ] },
{ "prim": "int", "annots": [ "%increment" ] } ] }
});
await op.confirmation();
const hash = op.globalConstantHash; // expr...
After registering an expression as a global constant, the occurrences of this expression in a smart contract code can be replaced by its corresponding hash, allowing users to originate larger contracts. More details about the new global constant
feature and examples using the batch API are available on the following documentation page: https://tezostaquito.io/docs/global_constant
@taquito/michelson-encoder
- Support new types related to operations-on-timelock
New tokens (ChestToken and ChestKeyToken) have been implemented in the Michelson-encoder package to support the new types chest
and chest_key
and allow data conversion between Michelson and js.
@taquito/utils
- Provide utility to verify signatures
Taquito provides a function named verifySignature
that allows verifying signatures of payloads. The function takes a message, a public key, and a signature as parameters and returns a boolean indicating if the signature matches.
The crypto library stablelib is used instead of libsodium in order not to drastically increase the bundle size of the @taquito/utils
package.
Here is an example of use:
import { verifySignature } from '@taquito/remote-signer';
const message = '03d0c10e3ed11d7c6e3357f6ef335bab9e8f2bd54d0ce20c482e241191a6e4b8ce6c01be917311d9ac46959750e405d57e268e2ed9e174a80794fbd504e12a4a000141eb3781afed2f69679ff2bbe1c5375950b0e40d00ff000000005e05050505050507070100000024747a32526773486e74516b72794670707352466261313652546656503539684b72654a4d07070100000024747a315a6672455263414c42776d4171776f6e525859565142445439426a4e6a42484a750001';
const pk = 'sppk7c7hkPj47yjYFEHX85q46sFJGw6RBrqoVSHwAJAT4e14KJwzoey';
const sig = 'spsig1cdLkp1RLgUHAp13aRFkZ6MQDPp7xCnjAExGL3MBSdMDmT6JgQSX8cufyDgJRM3sinFtiCzLbsyP6d365EHoNevxhT47nx'
await verifySignature(message, pk, sig);
@taquito/rpc
- Support for the RPC endpointcontext/contracts/{contract}/script/normalized
A new method on the RpcClient named getNormalizedScript
is available. If global constants are present in the code of a smart contract, getNormalizedScript
returns the expanded script. In contrast, the global constants are not expanded in the response provided by the getScript
method.
Internally in Taquito, the usage of getScript
has been replaced by getNormalizedScript
to ensure that all script passed to the Michelson-Encoder won't contain global constant because the Michelson-Encoder
does not support the global constant in this current release (11.0.0-beta).
Preliminary support for Idiazabalnet protocol
This release includes preliminary support for the Idiazabal protocol to allow early testing.
Please note the following:
- The protocol constant
cost_per_byte
is mistakenly set to1000
instead of250
. Meaning that storage costs are higher than on the precedent testnet until this is fixed in the next I network. - The
Endorsement
operation has new required propertiesslot
,round
andblock_payload_hash
that are not yet supported in the@taquito/local-forging
package. - The RPC
context/delegates/${address}
has new properties that are not yet supported in the@taquito/rpc
package.
What's coming next for Taquito?
We plan to provide abstractions for some of the new Hangzhou features. For example, an addition to the ContractAbstration will allow running on-chain views and an abstraction that will make using the new timelock feature easier.
If you have feature or issue requests, please create an issue on http://github.com/ecadlabs/taquito/issues or join us on the Taquito community support channel on Telegram https://t.me/tezostaquito
Taquito v11.0.0-beta
Summary
This release of Taquito supports the upcoming Hangzhou protocol. As usual, this version supports the current protocol, Granada, and the next protocol Hangzhou.
We encourage all developers to update their projects to use version Taquito v11 as soon as is practical and absolutely before the Tezos mainnet transition from Granada to Hangzhou.
New features - Hangzhou protocol
@taquito/taquito
- Support for the new operation kindregister_global_constant
on the contract, batch and estimate APIs #1075- ``@taquito/local-forging`
@taquito/michelson-encoder
- Support new types related to operations-on-timelock #1071@taquito/michel-codec
New features - General
@taquito/utils
- Provide utility to verify signatures #611@taquito/rpc
- Support for the RPC endpointcontext/contracts/{contract}/script/normalized
. #1114
Documentation
- Add documentation on how to sign Michelson data #588: https://tezostaquito.io/docs/signing#signing-michelson-data
- Add a "dApp pre-launch checklist" to website documentation #1135: https://tezostaquito.io/docs/dapp_prelaunch
- Add a documentation page about wallets #1123: https://tezostaquito.io/docs/wallets
Others
- Preliminary support for Idiazabalnet protocol
@taquito/beacon-wallet
- The beacon-sdk is updated to version 2.3.7: https://github.com/airgap-it/beacon-sdk/releases/tag/v2.3.7- Migrate supported companion DApps to Hangzhou: Beacon Test DApp, Taquito React, and Metadata explorer #1065
Important note:
Please note that the Michelson-Encoder
does not support the global constant in this current release (11.0.0-beta). The expanded contract scripts need to be used with the Michelson-Encoder
until further support. This brings the following limitation: only the 'init' property can be used if you want to originate a contract having a global constant in the storage section of its code. Do not use the storage
property, which depends on the Michelson-Encoder
.
Here an example:
const op = await Tezos.contract.originate({
code: [
{ prim: 'parameter', args: [ ...] },
{ prim: 'storage', args: [{ prim: 'constant', args: [{ string: 'expr...' }] }] },
{ prim: 'code', args: [ ... ] } ],
init: // The storage property can't be used until global constants are supported in by the Michelson-Encoder. Please use the `init` property instead.
});
@taquito/taquito
- Support the new operation kind register_global_constant
on the contract, batch and estimate APIs
The new manager operation register_global_constant
has been added to the contract, batch, and estimate APIs. This new operation allows users to register Micheline expressions in a global table of constants.
A registerGlobalConstant
method is available on the ContractProvider
class. A value
representing the Micheline expression to register in its JSON format is required as a parameter. The registerGlobalConstant
method returns an instance of RegisterGlobalConstantOperation
containing a globalConstantHash
member that corresponds to the index(hash) of the newly registered constant.
const op = await Tezos.contract.registerGlobalConstant({
value: { "prim": "or",
"args":
[ { "prim": "int", "annots": [ "%decrement" ] },
{ "prim": "int", "annots": [ "%increment" ] } ] }
});
await op.confirmation();
const hash = op.globalConstantHash; // expr...
After registering an expression as a global constant, the occurrences of this expression in a smart contract code can be replaced by its corresponding hash, allowing users to originate larger contracts. More details about the new global constant
feature and examples using the batch API are available on the following documentation page: https://tezostaquito.io/docs/global_constant
@taquito/michelson-encoder
- Support new types related to operations-on-timelock
New tokens (ChestToken and ChestKeyToken) have been implemented in the Michelson-encoder package to support the new types chest
and chest_key
and allow data conversion between Michelson and js.
@taquito/utils
- Provide utility to verify signatures
Taquito provides a function named verifySignature
that allows verifying signatures of payloads. The function takes a message, a public key, and a signature as parameters and returns a boolean indicating if the signature matches.
The crypto library stablelib is used instead of libsodium in order not to drastically increase the bundle size of the @taquito/utils
package.
Here is an example of use:
import { verifySignature } from '@taquito/remote-signer';
const message = '03d0c10e3ed11d7c6e3357f6ef335bab9e8f2bd54d0ce20c482e241191a6e4b8ce6c01be917311d9ac46959750e405d57e268e2ed9e174a80794fbd504e12a4a000141eb3781afed2f69679ff2bbe1c5375950b0e40d00ff000000005e05050505050507070100000024747a32526773486e74516b72794670707352466261313652546656503539684b72654a4d07070100000024747a315a6672455263414c42776d4171776f6e525859565142445439426a4e6a42484a750001';
const pk = 'sppk7c7hkPj47yjYFEHX85q46sFJGw6RBrqoVSHwAJAT4e14KJwzoey';
const sig = 'spsig1cdLkp1RLgUHAp13aRFkZ6MQDPp7xCnjAExGL3MBSdMDmT6JgQSX8cufyDgJRM3sinFtiCzLbsyP6d365EHoNevxhT47nx'
await verifySignature(message, pk, sig);
@taquito/rpc
- Support for the RPC endpointcontext/contracts/{contract}/script/normalized
A new method on the RpcClient named getNormalizedScript
is available. If global constants are present in the code of a smart contract, getNormalizedScript
returns the expanded script. In contrast, the global constants are not expanded in the response provided by the getScript
method.
Internally in Taquito, the usage of getScript
has been replaced by getNormalizedScript
to ensure that all script passed to the Michelson-Encoder won't contain global constant because the Michelson-Encoder
does not support the global constant in this current release (11.0.0-beta).
Preliminary support for Idiazabalnet protocol
This release includes preliminary support for the Idiazabal protocol to allow early testing.
Please note the following:
- The protocol constant
cost_per_byte
is mistakenly set to1000
instead of250
. Meaning that storage costs are higher than on the precedent testnet until this is fixed in the next I network. - The
Endorsement
operation has new required propertiesslot
,round
andblock_payload_hash
that are not yet supported in the@taquito/local-forging
package. - The RPC
context/delegates/${address}
has new properties that are not yet supported in the@taquito/rpc
package.
What's coming next for Taquito?
We plan to provide abstractions for some of the new Hangzhou features. For example, an addition to the ContractAbstration will allow running on-chain views and an abstraction that will make using the new timelock feature easier.
If you have feature or issue requests, please create an issue on http://github.com/ecadlabs/taquito/issues or join us on the Taquito community support channel on Telegram https://t.me/tezostaquito
Taquito v11.0.0-beta-RC.1
@taquito/utils - Provide utility to verify signatures
The function named verifySignature
introduced in pre-release v11.0.0-beta-RC.1 in the @taquito/remote-signer
package has been moved to the @taquito/utils
package. Use of crypto library libsodium has been replace by stablelib in order not to drastically increase the bundle size of @taquito/utils
package.
verifySignature
allows verifying signatures of payloads. The function takes a message, a public key, and a signature as parameters and returns a boolean indicating if the signature matches.
Here is an example of use:
import { verifySignature } from '@taquito/utils';
const message = '03d0c10e3ed11d7c6e3357f6ef335bab9e8f2bd54d0ce20c482e241191a6e4b8ce6c01be917311d9ac46959750e405d57e268e2ed9e174a80794fbd504e12a4a000141eb3781afed2f69679ff2bbe1c5375950b0e40d00ff000000005e05050505050507070100000024747a32526773486e74516b72794670707352466261313652546656503539684b72654a4d07070100000024747a315a6672455263414c42776d4171776f6e525859565142445439426a4e6a42484a750001';
const pk = 'sppk7c7hkPj47yjYFEHX85q46sFJGw6RBrqoVSHwAJAT4e14KJwzoey';
const sig = 'spsig1cdLkp1RLgUHAp13aRFkZ6MQDPp7xCnjAExGL3MBSdMDmT6JgQSX8cufyDgJRM3sinFtiCzLbsyP6d365EHoNevxhT47nx'
await verifySignature(message, pk, sig);
@taquito/beacon-wallet - The beacon-sdk has been updated to version 2.3.7
Here is a link to the release notes: https://github.com/airgap-it/beacon-sdk/releases/tag/v2.3.7
Taquito v11.0.0-beta-RC.0
Summary
New features - Related to the Hangzhou protocol
- @taquito/taquito - Support the new operation kind
register_global_constant
on the contract, batch and estimate APIs #1075 - @taquito/local-forging
- @taquito/michelson-encoder - Support new types related to operations-on-timelock #1071
- @taquito/michel-codec
New features - General
- @taquito/remote-signer - Provide utility to verify signatures #611
- @taquito/rpc - Support for the RPC endpoint
context/contracts/{contract}/script/normalized
. #1114
Documentation
- Add documentation on how to sign Michelson data #588: https://tezostaquito.io/docs/signing#signing-michelson-data
- Add a "dApp pre-launch checklist" to website documentation #1135: https://tezostaquito.io/docs/dapp_prelaunch
- Add a documentation page about wallets #1123: https://tezostaquito.io/docs/wallets
Others
- Migrate supported companion DApps to Hangzhou: Beacon Test DApp, Taquito React, and Metadata explorer #1065
Important note:
Please note that the Michelson-Encoder
does not support the global constant in this current pre-release (11.0.0-beta-RC.0). The expanded contract scripts need to be used with the Michelson-Encoder
until further support. This brings the following limitation: if you want to originate a contract having a global constant in the storage section of its code, only the init
property can be used. Do not use the storage
property, which depends on the Michelson-Encoder
.
Here an example:
const op = await Tezos.contract.originate({
code: [
{ prim: 'parameter', args: [ ...] },
{ prim: 'storage', args: [{ prim: 'constant', args: [{ string: 'expr...' }] }] },
{ prim: 'code', args: [ ... ] } ],
init: // The storage property can't be used until global constants are supported in by the Michelson-Encoder. Please use the `init` property instead.
});
@taquito/taquito - Support the new operation kind register_global_constant
on the contract, batch and estimate APIs
The new manager operation register_global_constant
has been added to the contract, batch, and estimate APIs. This new operation allows users to register Micheline expressions in a global table of constants.
A registerGlobalConstant
method is available on the ContractProvider
class. A value
representing the Micheline expression to register in its JSON format is required as a parameter. The registerGlobalConstant
method returns an instance of RegisterGlobalConstantOperation
containing a globalConstantHash
member that corresponds to the index(hash) of the newly registered constant.
const op = await Tezos.contract.registerGlobalConstant({
value: { "prim": "or",
"args":
[ { "prim": "int", "annots": [ "%decrement" ] },
{ "prim": "int", "annots": [ "%increment" ] } ] }
});
await op.confirmation();
const hash = op.globalConstantHash; // expr...
After registering an expression as a global constant, the occurrences of this expression in a smart contract code can be replaced by its corresponding hash, allowing users to originate larger contracts. More details about the new global constant
feature and examples using the batch API are available on the following documentation page: https://tezostaquito.io/docs/global_constant
@taquito/michelson-encoder - Support new types related to operations-on-timelock
New tokens (ChestToken and ChestKeyToken) have been implemented in the Michelson-encoder package to support the new types chest
and chest_key
and allow data conversion between Michelson and js.
@taquito/remote-signer - Provide utility to verify signatures
Taquito provides a function named verifySignature
that allows verifying signatures of payloads. The function takes a message, a public key, and a signature as parameters and returns a boolean indicating if the signature matches.
Here is an example of use:
import { verifySignature } from '@taquito/remote-signer';
const message = '03d0c10e3ed11d7c6e3357f6ef335bab9e8f2bd54d0ce20c482e241191a6e4b8ce6c01be917311d9ac46959750e405d57e268e2ed9e174a80794fbd504e12a4a000141eb3781afed2f69679ff2bbe1c5375950b0e40d00ff000000005e05050505050507070100000024747a32526773486e74516b72794670707352466261313652546656503539684b72654a4d07070100000024747a315a6672455263414c42776d4171776f6e525859565142445439426a4e6a42484a750001';
const pk = 'sppk7c7hkPj47yjYFEHX85q46sFJGw6RBrqoVSHwAJAT4e14KJwzoey';
const sig = 'spsig1cdLkp1RLgUHAp13aRFkZ6MQDPp7xCnjAExGL3MBSdMDmT6JgQSX8cufyDgJRM3sinFtiCzLbsyP6d365EHoNevxhT47nx'
await verifySignature(message, pk, sig);
@taquito/rpc - Support for the RPC endpointcontext/contracts/{contract}/script/normalized
A new method on the RpcClient named getNormalizedScript
is available. If global constants are present in the code of a smart contract, getNormalizedScript
returns the expanded script. In contrast, the global constants are not expanded in the response provided by the getScript
method.
Internally in Taquito, the usage of getScript
has been replaced by getNormalizedScript
to ensure that all script passed to the Michelson-Encoder won't contain global constant because the Michelson-Encoder
does not support the global constant in this current pre-release (11.0.0-beta.0).
What's coming next for Taquito?
We plan to provide abstractions for some of the new Hangzhou features. For example, an addition to the ContractAbstration will allow running on-chain views and an abstraction that will make using the new timelock feature easier.
If you have feature or issue requests, please create an issue on http://github.com/ecadlabs/taquito/issues or join us on the Taquito community support channel on Telegram https://t.me/tezostaquito
Taquito v10.2.1-beta
- Updated beacon-sdk to version 2.3.5: https://github.com/airgap-it/beacon-sdk/releases/tag/v2.3.5
- RpcClientCache - Store the Promises instead of the resolved values in the cache:
When requests were done in parallel to the same RPC endpoint, they were not hitting the cache. This is solved by storing the promise in the cache as soon as the first request is made. If another request tries to reach the same URL, during the configured TTL, the cached promise is returned.
More details can be found here: #916
Taquito v10.2.0-beta
Summary
New features
- @taquito/contract-library - [Performance] Embed popular contracts into your application using the new ContractAbstraction instantiation #1049
- @taquito/rpc - [Performance] Enable RPC caching in your application using the RpcClient cache implementation #924
- @taquito/taquito - [DevExp] Taquito Entrypoint methods now accept javascript object format for contract method calls (parametric calls are unchanged!) #915
Enhancements
- Compatibility support for Hangzhounet
- Allow to set HttpBackend on IpfsHttpHandler #1092
@taquito/contract-library - Ability to bundle smart-contract scripts and entrypoints for ContractAbstration instantiation
A new package named @taquito/contract-library
has been added to the Taquito library.
To improve (d)App performance, we aim to provide ways to reduce the number of calls made by Taquito to the RPC. The @taquito/contracts-library
package allows developers to embed the smart-contract scripts into the application, preventing Taquito from loading this data from the RPC for every user.
The ContractsLibrary class is populated by at project compile time, using contract addresses and their corresponding script and entry points. The ContractsLibrary
is then injected into a TezosToolkit
as an extension using the toolkits addExtension
method.
When creating a ContractAbstraction instance using the at
method of the Contract or the Wallet API, if a ContractsLibrary
is present on the TezosToolkit instance, the script and entry points of matching contracts will be loaded from the ContractsLibrary. Otherwise, the values will be fetched from the RPC as usual.
Example of use:
import { ContractsLibrary } from '@taquito/contracts-library';
import { TezosToolkit } from '@taquito/taquito';
const contractsLibrary = new ContractsLibrary();
const Tezos = new TezosToolkit('rpc');
contractsLibrary.addContract({
'contractAddress1': {
script: script1, // script should be obtained from Tezos.rpc.getScript('contractAddress1')
entrypoints: entrypoints1 // entrypoints should be obtained from Tezos.rpc.getEntrypoints('contractAddress1')
},
'contractAddress2': {
script: script2,
entrypoints: entrypoints2
},
//...
})
Tezos.addExtension(contractsLibrary);
// The script and entrypoints are loaded from the contractsLibrary instead of the RPC
const contract = await Tezos.contract.at('contractAddress1');
@taquito/RPC - New RpcClient implementation that caches RPC data
Similar to the new ContractsLibrary
feature, Taquito provides an additional way to increase dApp performance by caching some RPC data. To do so, we offer a new RpcClient
implementation named RpcClientCache
The constructor of the RpcClientCache
class takes an RpcClient
instance as a parameter and an optional TTL (time to live). By default, the TTL is of 1000 milliseconds. The RpcClientCache
acts as a decorator over the RpcClient
instance. The RpcClient
responses are cached for the period defined by the TTL.
Example of use:
import { TezosToolkit } from '@taquito/taquito';
import { RpcClient, RpcClientCache } from '@taquito/rpc';
const rpcClient = new RpcClient('replace_with_RPC_URL');
const tezos = new TezosToolkit(new RpcClientCache(rpcClient));
@taquito/taquito - New Taquito Entrypoint methods accept javascript object format for contract method calls
The ContractAbstraction class has a new member called methodsObject
, which serves the same purpose as the methods
member. The format expected by the smart contract method differs: methods
expects flattened arguments while methodsObject
expects an object.
It is to the user's discretion to use their preferred representation. We wanted to provide Taquito users with a way to pass an object when calling a contract entry point using a format similar to the storage parameter used when deploying a contract.
A comparison between both methods is available here: https://tezostaquito.io/docs/smartcontracts#choosing-between-the-methods-or-methodsobject-members-to-interact-with-smart-contracts
Compatibility support for Hangzhounet
This version ships with basic compatibility support for the new Hangzhou protocol. New features, such as support for new Michelson instructions, types and constants, will follow in future Taquito releases.
What's coming next for Taquito?
We started preliminary work on integrating Hangzhounet, the next Tezos protocol update proposal. We plan to deliver a final version of Taquito v11 early, giving teams a longer runway to upgrade their projects before protocol transition.
If you have feature or issue requests, please create an issue on http://github.com/ecadlabs/taquito/issues or join us on the Taquito community support channel on Telegram https://t.me/tezostaquito