Overview of jstz URLPattern implementation
jstz implementation of URLPattern is based on the WHATWG URL Pattern specification and utilizes rust-urlpattern. Note that this implementation is not fully spec-compliant.website·Indexed 39 days ago
https://jstz.tezos.comA runtime layer on top of the Tezos blockchain that allows developers to write and deploy smart functions using TypeScript. Jstz provides a serverless-like environment with a CLI, a local sandbox for testing, and a client SDK for web applications. It includes implementations of Web standard APIs such as Fetch (Request, Response, Headers), URL, URLPattern, and TextDecoder, as well as a key-value database for persistent data storage.
jstz implementation of URLPattern is based on the WHATWG URL Pattern specification and utilizes rust-urlpattern. Note that this implementation is not fully spec-compliant.URLSearchParams API in jstz provides utility methods for working with the query string of a URL according to the URL specification. It is used for building and manipulating search parameters.// Parse query string from URL
let url = new URL("https://example.com?foo=1&bar=2");
let params = new URLSearchParams(url.search);
// Add a new parameter
params.append("baz", 3);
// Remove parameter
params.delete("bar");The Jstz CLI is used to interact with the Jstz environment, manage accounts, start the sandbox, and deploy/interact with smart functions.
Key global commands include:
jstz help: Displays help information.jstz --version (-V): Displays the current version.jstz whoami: Prints the current active account.jstz login <ALIAS>: Sets the active account used to send requests.jstz logout: Deselects the current active account.Many commands require the -n or --network flag to specify the environment (e.g., -n dev for the local sandbox).
Jstz allows developers to deploy JavaScript/TypeScript applications as 'smart functions'. These function similarly to serverless applications but operate on distributed Jstz Smart Rollup nodes, providing the following Web3 advantages:
Jstz processes calls to smart functions as an atomic unit. If any smart function in a chain of calls throws an uncaught error, the entire transaction is reverted. This rollback includes:
# Browse all examples on GitHub
https://github.com/jstz-dev/jstz/tree/main/examplesjstz library provides an implementation of the Web standard encoding API for handling text in various character encodings. Note that the jstz implementation is not fully spec compliant. Available interfaces include TextEncoder, TextDecoder, atob, and btoa.DOM) are not available. Note that jstz APIs are currently unstable and may not be fully compliant with official specifications.Jstz smart functions are JavaScript/TypeScript applications that behave like serverless functions running on the Tezos blockchain via Smart Rollup technology.
Key characteristics:
Kv) for persistent data. Only the function itself can write to its storage, though data is publicly visible via the client API.handler function as the sole entrypoint. This handler receives a Request object (containing the caller's address in the Referer header) and must return a Response object or a promise of one.KT1 address and are accessible via a URL: jstz://<ADDRESS>/.Jstz utilizes two distinct types of accounts:
tz1. These are used to store tez (XTZ).KT1. These store tez and the immutable code of the smart function.