Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
teelkey
Advanced tools
Readme
Install with npm install --save teelkey
inside your project. Then just
const teelkey = require('teelkey')
If you are working in the browser and want to load teelkey from a CDN:
<script src="https://unpkg.com/teelkey/bin/teelkey.min.js"></script>
By default, teelkey hits on the main teelkey testnet (https://testnet.teelkey.com). You can eventually make teelkey hit on your local node or any teelkey node like so:
teelkey.init({api: 'http://localhost:3001'})
teelkey.getAccount('alice', (err, account) => {
console.log(err, account)
})
Just pass an array of usernames instead
teelkey.getAccounts(['alice', 'bob'], (err, accounts) => {
console.log(err, accounts)
})
For the history, you also need to specify a block number. The api will return all blocks lower than the specified block where the user was involved in a transaction
teelkey.getAccountHistory('alice', 0, (err, blocks) => {
console.log(err, blocks)
})
teelkey.getContent('alice', 'pocNl2YhZdM', (err, content) => {
console.log(err, content)
})
teelkey.getFollowers('alice', (err, followers) => {
console.log(err, followers)
})
teelkey.getFollowers('alice', (err, followers) => {
console.log(err, followers)
})
You can pass a username and permlink (identifying a content) in the 2nd and 3rd argument to 'get more'.
teelkey.getDiscussionsByAuthor('alice', null, null, (err, contents) => {
console.log(err, contents)
})
You can pass a username and a permlink to 'get more'.
teelkey.getNewDiscussions('alice', null, null, (err, contents) => {
console.log(err, contents)
})
You can pass a username and a permlink to 'get more'.
teelkey.getHotDiscussions(null, null, (err, contents) => {
console.log(err, contents)
})
This lists the contents posted by the following of the passed username.
You can pass a username and a permlink in the 2nd and 3rd argument to 'get more'.
teelkey.getFeedDiscussions('alice', null, null, (err, contents) => {
console.log(err, contents)
})
teelkey.getNotifications('alice', (err, contents) => {
console.log(err, contents)
})
To send a transaction to the network, you will need multiple steps. First you need to define your transaction and sign it.
var newTx = {
type: teelkey.TransactionType.FOLLOW,
data: {
target: 'bob'
}
}
newTx = teelkey.sign(alice_key, 'alice', newTx)
After this step, the transaction is forged with a timestamp, hash, and signature. This transaction needs to be sent in the next 60 secs or will be forever invalid.
You can send it like so
teelkey.sendTransaction(newTx, function(err, res) {
cb(err, res)
})
The callback will return once your transaction has been included in a new block.
Alternatively, you can just want the callback as soon as the receiving node has it, you can do:
teelkey.sendRawTransaction(newTx, function(err, res) {
cb(err, res)
})
console.log(teelkey.keypair())
Voting Power and Bandwidth are growing in time but the API will only return the latest update in the vt
and bw
fields of the accounts. To get the actual value, use votingPower() and bandwidth()
teelkey.getAccount('alice', (err, account) => {
console.log(teelkey.votingPower(account))
console.log(teelkey.bandwidth(account))
})
We would like to give all the credits to the people making available these resources.
FAQs
javascript api for the teelkey blockchain
The npm package teelkey receives a total of 3 weekly downloads. As such, teelkey popularity was classified as not popular.
We found that teelkey 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.