Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/Savjee/SavjeeCoin
/ functions
Functions
19 in github.com/Savjee/SavjeeCoin
⨍
Functions
19
◇
Types & classes
6
↓ 23 callers
Function
createSignedTx
(amount = 10)
tests/helpers.js:6
↓ 20 callers
Method
addTransaction
* Add a new transaction to the list of pending transactions (to be added * next time the mining process starts). This verifies that the given *
src/blockchain.js:201
↓ 12 callers
Method
minePendingTransactions
* Takes all the pending transactions, puts them in a Block and starts the * mining process. It also adds a transaction to send the mining reward to
src/blockchain.js:173
↓ 10 callers
Method
getBalanceOfAddress
* Returns the balance of a given wallet address. * * @param {string} address * @returns {number} The balance of the wallet
src/blockchain.js:252
↓ 8 callers
Method
calculateHash
* Returns the SHA256 of this block (by processing all the data stored * inside this block) * * @returns {string}
src/blockchain.js:95
↓ 7 callers
Function
createBlockchainWithTx
()
tests/helpers.js:21
↓ 7 callers
Method
isValid
* Checks if the signature is valid (transaction has not been tampered with). * It uses the fromAddress as the public key. * * @returns {boole
src/blockchain.js:60
↓ 6 callers
Method
isChainValid
* Loops over all the blocks in the chain and verify if they are properly * linked together and nobody has tampered with the hashes. By checking
src/blockchain.js:300
↓ 6 callers
Method
sign
* Signs a transaction with the given signingKey (which is an Elliptic keypair * object that contains a private key). The signature is then stored i
src/blockchain.js:39
↓ 3 callers
Function
createBCWithMined
()
tests/helpers.js:14
↓ 3 callers
Method
createGenesisBlock
* @returns {Block}
src/blockchain.js:152
↓ 3 callers
Method
getAllTransactionsForWallet
* Returns a list of all transactions that happened * to and from the given wallet address. * * @param {string} address * @return {Transac
src/blockchain.js:278
↓ 3 callers
Method
hasValidTransactions
* Validates all the transactions inside this block (signature + hash) and * returns true if everything checks out. False if the block is invalid.
src/blockchain.js:130
↓ 2 callers
Method
calculateHash
* Creates a SHA256 hash of the transaction * * @returns {string}
src/blockchain.js:25
↓ 2 callers
Method
mineBlock
* Starts the mining process on the block. It changes the 'nonce' until the hash * of the block starts with enough zeros (= difficulty) * * @p
src/blockchain.js:113
↓ 1 callers
Method
getLatestBlock
* Returns the latest block on our chain. Useful when you want to create a * new Block and you need the hash of the previous Block. * * @retur
src/blockchain.js:162
Method
constructor
* @param {string} fromAddress * @param {string} toAddress * @param {number} amount
src/blockchain.js:13
Method
constructor
* @param {number} timestamp * @param {Transaction[]} transactions * @param {string} previousHash
src/blockchain.js:81
Method
constructor
()
src/blockchain.js:142