Skip to content

Plugin System is here!

Compare
Choose a tag to compare
@MaxStalker MaxStalker released this 19 Nov 13:27
7f5b31c

⭐ 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