Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@saturn-chain/dlt-functions

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saturn-chain/dlt-functions

Implements the functions needed to interface the smart contract functions and events with the dlt services exposed via API. It communicates to the dlt services via the `@saturn-chain/dlt-rest-api` library and expect transactions to be signed by the `@satu

  • 1.0.8
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

dlt-function: implementation of EthProviderInterface

Implements the functions needed to interface the smart contract functions and events with the dlt services exposed via API. It communicates to the dlt services via the @saturn-chain/dlt-rest-api library and expect transactions to be signed by the @saturn-chain/wallet-custody-rest-api.

Usage:

npm i --save @saturn-chain/dlt-function

Includes typescript types declaration

Documentation

import { DLTNodeApi } from "@saturn-chain/dlt-rest-api";
import { CustodyAuthenticatorFunction, WalletCustodyApiImpl } from "@saturn-chain/wallet-custody-rest-api";
import { DLTInterface } from ".";

const node = new DLTNodeApi("http://localhost:8080", "eth" as any);
const custody = new WalletCustodyApiImpl("http://localhost:8081", "eth" as any);
const walletAddress = "0x123...999";

// this function allow to asynchronously authenticate the wallet from the password to the token
const auth: CustodyAuthenticatorFunction = async (address, api) => {
  const token = await api.authenticate(address, "wallet password");
  return token;
}
const signer = custody.getSigner(walletAddress, auth);

// create a wallet that uses the wallet custody service
const wallet = node.getWallet(walletAddress, signer);
const intf = new DLTInterface(node, wallet);

FAQs

Package last updated on 25 May 2022

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