Releases: onflow/flow-cadut
@onflow/[email protected]
Major Changes
-
@onflow/flow-cadut
has been converted to a monorepo and partitioned into the following packages:@onflow/flow-cadut
@onflow/flow-cadut-generator
(previously@onflow/flow-cadut/generator
)@onflow/flow-cadut-plugin-find
(previously@onflow/flow-cadut/plugins/find
)@onflow/flow-cadut-plugin-flowns
(previously@onflow/flow-cadut/plugins/flowns
)@onflow/flow-cadut-views
(previously@onflow/flow-cadut/views
)
For prior changelogs regarding this package, please see the README of
@onflow/flow-cadut
.
Minor Changes
Patch Changes
@onflow/[email protected]
Major Changes
-
#102
477d3df
Thanks @jribbink! - BREAKING Bumped @onflow/fcl to 1.1.1-alpha.1Developers should note that
[U]Int*
andWord*
types are now decoded into strings by @onflow/fcl and no longer implicitly decoded into numbers. This means that these types will need to be explicitly converted to JavaScript Number types if required.This potentially affects the following flow-cadut features:
sendTransaction
(where event data is[U]Int*
orWord*
)executeScript
(where return value is[U]Int*
orWord*
)- any generated script templates with
[U]Int*
orWord*
return values - any generated transaction templates which emit
[U]Int*
orWord*
event data
Additionally, passing in Number as value for Int is deprecated and will cease to work in future releases of @onflow/types. Going forward, use String as value for Int.
This could potentially affect the following functions in the future:
sendTransaction
(where integer arguments are passed)executeScript
(where integer arguments are passed)- any generated script templates with integer arguments passed
- any generated transaction templates with integer arguments passed
You can learn more (including a guide on common transition paths) here.
-
#104
c5d3a23
Thanks @jribbink! - BREAKING@onflow/flow-cadut
has been converted to a monorepo and partitioned into the following packages:@onflow/flow-cadut
@onflow/flow-cadut-generator
(previously@onflow/flow-cadut/generator
)@onflow/flow-cadut-plugin-find
(previously@onflow/flow-cadut/plugins/find
)@onflow/flow-cadut-plugin-flowns
(previously@onflow/flow-cadut/plugins/flowns
)@onflow/flow-cadut-views
(previously@onflow/flow-cadut/views
)
Note - The
@onflow/flow-cadut
generator CLI has also been moved to@onflow/flow-cadut-generator
.In order to use the
flow-generate
command, you must install the generator package via:npm install -D @onflow/flow-cadut-generator
The generator command may now be used via
npx flow-generate
on the command line. See complete installation instructions here.
Patch Changes
-
#97
7a09ae7
Thanks @MaxStalker! - Fix contract parser to properly process contracts, which implements some interface -
#107
663f0fc
Thanks @jribbink! - Verify that provided domain is valid for provided argument type when mapping path arguments -
#113
8315ee1
Thanks @jribbink! - Adds support for optional complex types
v0.2.0-alpha.7
v0.2.0-alpha.6
Minor Changes
- #66
c901f5a
Thanks @hotrungnhan! - Add support for PublicPath/StoragePath/PrivatePath/CapabilityPath arguments
v0.1.16-alpha.5
Patch Changes
- 7c5ee7d: Strip strings from templates in parser to prevent bugs related to cadence keywords existing in strings
Custom Signers and Events Handling
⭐ Custom Signers
mutate
and sendTransaction
methods now can accept object for signers. This will allow you to use private keys directly and not through FCL popup. We will provide updated documentation to showcase how it can be used.
⭐ Basic Event Handler Implemented
We've added multiple methods, so it will be easier to look for specific event on chain.
Stay tuned for documentation on this feature.
📔 Goated Goats View
Goated Goats view was added allowing to easily fetch list of goats and traits for a specific address.
📔 Updated Tests for Flowns
One of the tests for Flowns resolver was outdated - it was fixed.
Path Arguments
Path arguments are now supported by argument resolver.
Flowns Support
⭐ Native Flowns Support
Flowns decentralized domain service is now supported via respective plugin.
Below you can find an example how you can use it with flow-cadut
:
import { setEnvironment, registerPlugin, executeScript } from "flow-cadut";
import { FLOWNS } from "flow-cadut/plugins/FLOWNS";
const resolveAddress = (name) => {
const code = `
pub fun main(address: Address): Address{
return address
}
`;
const args = [name];
return executeScript({ code, args });
};
(async () => {
await setEnvironment("testnet");
await registerPlugin(FLOWNS);
const [singular] = await resolveAddress("flowns.fn");
const [plural] = await resolveAddress("flowns.fns");
console.log({ singular, plural });
})();
You can run this example on [CodeSandbox](https://codesandbox.io/s/cadut-plugins-flowns-tzm7g?file=/src/index.js:0-705)
Plugin System is here!
⭐ Plugin System
This release introduces Plugin System, which would ease integration with third-party libraries for additional functionality.
If you are developer, please refer to README file in plugins
folder.
⭐ FIND Resolver
We have bundled FIND address resolver plugin into the package.
In order to use it you need to import plugin and register it with flow-cadut
Example
import { executeScript, setEnvironment, registerPlugin } from "flow-cadut";
import { FIND } from "flow-cadut/plugins/FIND";
(async () => {
await setEnvironment("testnet");
await registerPlugin(FIND);
// Let's create some basic Cadence script, which will accept Address argument and return it's value
const code = `
pub fun main(addressBook: [Address]): [Address]{
return address
}
`;
const args = [
// FIND address can be in prefixed "find:name"
"find:bjarte",
// or suffixed "name.find" form
"bjarte.find",
];
const [bjarte, err] = await executeScript({ code, args });
if (!err) {
console.log({ bjarte });
}
})();
You can run aforementioned example in this CodeSandbox
Updated Build Process
Updated Build Process
With new build process it should be possible to properly import flow-cadut
for node and web environment.
Generator related files were moved into inner private package, so it shall not interfere with bundling anymore.