New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@polywrap/datetime-plugin-js

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polywrap/datetime-plugin-js

Polywrap Datetime Plugin

  • 0.10.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
122
increased by197.56%
Maintainers
2
Weekly downloads
 
Created
Source

@polywrap/datetime-plugin-js

The Datetime plugin implements the datetime-interface @ ens/wraps.eth:datetime@1.0.0 (see ./src/schema.graphql). It provides access to the current unix timestamp of the host operating system.

Usage

1. Configure Client

When creating your Polywrap JS client, add the datetime plugin:

import { ClientConfigBuilder } from "@polywrap/client-config-builder-js";
import { PolywrapClient } from "@polywrap/client-js";
import { datetimePlugin } from "@polywrap/datetime-plugin-js";

const config = new ClientConfigBuilder()
  // 1. Add the plugin package @ an arbitrary URI
  .addPackage(
    "plugin/datetime",
    datetimePlugin({ })
  )
  // 2. Register this plugin as an implementation of the interface
  .addInterfaceImplementation(
    "ens/wraps.eth:datetime@1.0.0",
    "plugin/datetime"
  )
  // 3. Redirect invocations @ the interface to the plugin (default impl)
  .addRedirect(
    "ens/wraps.eth:datetime@1.0.0",
    "plugin/datetime"
  )
  .build();

const client = new PolywrapClient(config);

2. Invoke the Datetime Plugin

Invocations to the datetime plugin can be made via the interface URI (which will get redirected), or the plugin's URI directly:

await client.invoke({
  uri: "ens/wraps.eth:datetime@1.0.0" | "plugin/datetime",
  method: "currentTimestamp"
});

FAQs

Package last updated on 17 Jun 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc