1.3.2 • Published 2 years ago

hackerpunk-api v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

hackerpunk-api

A Node.js package for hackerpunk project

Installation

npm i --save hackerpunk-api

Usage

Javascript

const hackerpunk = require("hackerpunk-api");

/// setProvider
const provider = hackperpunk.setProvider(
  "ropsten",
  "alchemy",
  "[your api key]"
);

// or
const provider = hackperpunk.setProvider("https://127.0.0.1:8545");

/// donate
const wallet = hackerpunk.setWallet("[donator privaeKey]");
const signer = hackerpunk.setSigner(wallet, provider);
const hp = new hackerpunk.HP(signer, "[contractAddress]", "[abi]");
const hptl = new hackerpunk.HPTimeLock(
  "[signer of masterAccount]",
  "[contractAddress]",
  "[abi]"
);

hptl
  .donate(hp, "[articleId]", "[donatorAddress]", "[writerAddress]", "[amount]")
  .then();

/// register External Account
// grant minter role to EHP Account
hp.grantMinterRole("[ExternalHP Contract Address]"); // executed by master account
hp.registerExternal("[serverAccount]", "[fee]"); // can be executed by user
1.3.2

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago