
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
cryptocurve-sdk
Advanced tools
CryptoCurve SDK provides a single, simple API for cross-chain (ETH, WAN) functionality
A single, simple API for cross-chain (ETH, WAN) functionality.
Download and include the script from our release page (or your local dist folder after building) in your HTML file and instantiate an instance as follows:
<script src="cryptocurve-sdk.min.js"></script>
npm install cryptocurve-sdk
bin: the compiled node.js applicationdist: the browserfied script for web clientsexamples: sample code to demonstrate usagesrc: all source codenpm run build runs tsc to compile from typescript into the bin/ folder, then browserify to compile into the dist/ folder, then uglify to minify the result.
After creating an instance of the SDK.Client class (see below for details), the following methods will be available:
sdk.setBlockchainNetwork(network);
sdk.setProvider(host, timeout, username, password);
sdk.sendTransaction(transaction, privateKey);
NOTE: either setBlockchainNetwork must be called or the transaction object must contain the network identifier, eg.
transaction.network = 'eth';
which can be eth for ethereum or wan for wanchain. If not supplied, the sending protocol will default to the ethereum network.
Additionally, web3.js objects and methods can be accessed via sdk.web3 or directly on the sdk object itself, eg.
sdk.eth.getCoinbase()
Utility methods are available from the SDK.utils library.
See examples folder, in particular samples.js which can be run from both browser (dynamic.html) and node.js (node dynamic). Please note that the samples required test accounts to be configured in the testAccounts.js file.
Edit the accounts values at the top of the testAccounts.js file in the examples folder,
you can create an Etheruem wallet here and a Wanchain wallet here.
To create a coinbase account, enter the console and run
// miner.setEtherbase(address) eg.
miner.setEtherbase("0x77f92a6b4b61319e538a6bc5345ad5eaab8d8654")
Include the script from our release page (or your local dist folder after building) in your HTML file and instantiate an instance as follows:
<script src="cryptocurve-sdk.js"></script>
<script type="text/javascript">
// if hostname is null, defaults to http://localhost:8545
var sdk = new window.cryptocurve.sdk.Client(hostname);
sdk.setProvider(hostname);
sdk.eth.getCoinbase()...
sdk.web3.eth.getCoinbase()...
var sdkUtils = window.cryptocurve.sdk.utils;
</script>
var CryptoCurveSDK = require('cryptocurve-sdk');
var sdk = new CryptoCurveSDK.Client();
var sdkUtils = new CryptoCurveSDK.utils;
sdk.eth.net.getId()...
CryptoCurveSDK.Client.createTransaction returns a promise that resolves with the prepared transaction object:
sdk.createTransaction({...})
.then(function(transaction){
// ...
});
NOTE: the SDK client must be connected as the transaction instance will update itself from the blockchain node.
The following methods are available on the Transaction instance:
setNetwork(network) network in ['eth', 'wan']setChainId(id) / setNetworkId(id) a null id will retrieve the chain id from the client nodesetReceiverAddress(to)setSenderAddress(from)setNonce(nonce) [null will retrieve the nonce from the client node]setValue(value, denomination) denomination must be in selected blockchain's unit, eg. if network is 'wan' then denomination must be in wanchain unitssetData(data)setGasPrice(gasPrice) a null gasPrice will retrieve the price from the client nodesetGasLimit(gasLimit) a null gasLimit will estimate the gas limit from the client nodevalidate() returns a promise that resolves if the transaction is ready and validsignTransaction(privateKey) returns the transaction signed with the supplied private keyAn SDK transaction instance can be identified by its generator property, which will always be 'cryptocurve-sdk':
if (transaction.generator === 'cryptocurve-sdk') {
// ...
}
(to be completed)
(to be completed)
Please let us know by opening issues or contributing!
FAQs
CryptoCurve SDK provides a single, simple API for cross-chain (ETH, WAN) functionality
The npm package cryptocurve-sdk receives a total of 4 weekly downloads. As such, cryptocurve-sdk popularity was classified as not popular.
We found that cryptocurve-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.