Skip to content

Contract Init Arguments

Compare
Choose a tag to compare
@MaxStalker MaxStalker released this 22 Sep 22:56
44b9432

Parser now support extraction of arguments for contract initializer:

  const code = `
      pub contract Hello{
          init(a: String, b: Int) {
              log(a)
              log(b)
          }
      }
   `
  const params = await extractContractParameters(code);
  
  /* params now contains object
      {
          contractName: "Hello",
          args: "a: String, b: Int"
      }
  */