1.3.2 • Published 4 years ago
hackerpunk-api v1.3.2
hackerpunk-api
A Node.js package for hackerpunk project
Installation
npm i --save hackerpunk-apiUsage
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 user1.3.2
4 years ago
1.3.0
4 years ago
1.2.9
4 years ago
1.2.8
4 years ago
1.2.7
4 years ago
1.2.6
4 years ago
1.2.5
4 years ago
1.2.4
4 years ago
1.2.3
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago