New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tokenscript/engine-js

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tokenscript/engine-js

A Typescript implementation of the TokenScript runtime

latest
Source
npmnpm
Version
1.6.1
Version published
Weekly downloads
9
350%
Maintainers
0
Weekly downloads
 
Created
Source

TokenScript Engine

engine-js is a Typescript implementation of the TokenScript runtime. It provides core functionality for resolving, parsing & running TokenScript applications and is the reference implementation used to develop new features for the standard.

The engine is designed as a headless runtime that relies on user-agent interfaces for features such as wallet access and TokenScript card presentations.

In this way the engine is suitable to be used in the browser and server, and can also be integrated as a webview component into native applications.

To demonstrate how to integrate the engine, we provide our reference frontend TokenScript Viewer

Installation

npm i @tokenscript/engine-js

User Agent Interfaces

The engine provides a number of interfaces that can be implemented to provide functionality to the engine.

Engine level interfaces

  • IWalletAdapter - provides ethereum wallet access through a set of standard interfaces. EthersAdapter is also included as a ready-to-use option when using an ethers.js signer.
  • ITokenDiscoveryAdapter- this and it's associated token data interfaces provide token discovery and metadata access. Alternatively, the user-agent can push token details to the engine.
  • IAttestationStorageAdapter provides an interface to manage storage of attestation tokens.
  • ILocalStorageAdapter - Since cards are run in a sandboxed iframe from content extracted from the TSML/XML file, they have no access to localStorage. This adapter allows cards to use a localStorage through a proxy provided by the engine and a storage implementation provided by the user-agent.

Instance level interfaces

  • IViewBinding - Possibly the most important interface for user interaction, it provides the glue between the UI and engine and is used to display TokenScript action cards.

Card SDK

The Card SDK is built as a separate module and bundled with the engine

FAQs

Package last updated on 24 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts