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

@portkey/contracts

Package Overview
Dependencies
Maintainers
0
Versions
358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@portkey/contracts

![ES Version](https://img.shields.io/badge/ES-2020-yellow) ![Node Version](https://img.shields.io/badge/node-14.x-green) [![NPM Package Version][npm-image-version]][npm-url]

  • 2.19.0-alpha.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-19.96%
Maintainers
0
Weekly downloads
 
Created
Source

@portkey/contracts

ES Version Node Version NPM Package Version

Installation

Using NPM

npm install @portkey/contracts

Using Yarn

yarn add @portkey/contracts

Prerequisites

  • :gear: NodeJS (LTS/Fermium)
  • :toolbox: Yarn/Lerna

Package.json Scripts

ScriptDescription
cleanUses rm to remove dist/
buildUses tsc to build package and dependent packages
lintUses eslint to lint package
lint:fixUses eslint to check and fix any warnings
formatUses prettier to format the code

Basic Usage

import { getContractBasic } from '@portkey/contracts'

// use ca contract 
const contract = await getContractBasic({
  chainType: 'aelf',
  account: 'your account',
  contractAddress: 'contractAddress',
  caContractAddress: 'caContractAddress',
  callType: 'ca',
  caHash: 'caHash',
  rpcUrl: 'rpcUrl',
});

// use base contract 
const contract = await getContractBasic({
  account: 'your account',
  contractAddress: 'contractAddress',
  chainType: 'aelf',
  rpcUrl: 'rpcUrl',
})

// use portkey provider
import detectProvider from '@portkey/detect-provider';
// detect provider
const provider = await detectProvider();
// get chain provider
const chainProvider = await provider.getChain('AELF');

const contract = await getContractBasic({
  chainProvider,
  contractAddress: 'contractAddress',
});

// call view
contract.callViewMethod('your method', paramsOption);
// call send
contract.callSendMethod('your method', 'your address', paramsOption);

standard types

contract types

FAQs

Package last updated on 15 Jan 2025

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