Skip to content

Conversation

JustinFeng
Copy link
Contributor

@JustinFeng JustinFeng commented Sep 9, 2024

Changes include

  • extract interface of ITokenScriptEngine, ITokenScript
  • make the references in tokenscript sub modules depending on the interface (most of the changes is related to this, as the type is now set to the interface rather than the implementation)
  • implemented LiteTokenScriptEngine and LiteTokenScript with dependencies trimmed for headless usage in token-kit and other non-ui scenarios

examples

// create tokenscript object
const tokenscript: LiteTokenScript = await liteTsEngine.getTokenScriptFromUrl(scriptURI);
tokenscript.setCurrentTokenContext(
    Object.keys(tokenscript.getOrigins())[context.originIndex],
    null,
    context.tokenId,
);

// read info from the tokenscript object
await tokenscript.getSecurityInfo().getInfo()

@JustinFeng JustinFeng changed the base branch from master to staging September 9, 2024 07:42
@JustinFeng JustinFeng changed the title Export a lite headless tokenscript engine Export a lightweight headless tokenscript engine Sep 9, 2024
@JustinFeng
Copy link
Contributor Author

just cc @futantan for visibility

@micwallace micwallace merged commit 5327151 into staging Sep 10, 2024
2 checks passed
@micwallace micwallace deleted the jf/headless branch September 10, 2024 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants