Skip to content

Instantly share code, notes, and snippets.

@bluepnume
Last active May 17, 2021 04:27
Show Gist options
  • Save bluepnume/36b7ce0f2a3a38201273f2553d5dd958 to your computer and use it in GitHub Desktop.
Save bluepnume/36b7ce0f2a3a38201273f2553d5dd958 to your computer and use it in GitHub Desktop.
export type BlockChainType = {|
addBlock : (hashedBlock : string) => Promise<void>,
createBlock : (publicKey : string, transactions : Array<string>) => Promise<?string>,
getBalances : () => Promise<Counter>
|};
export function BlockChain() : BlockChainType {
const createBlock = async (publicKey, transactions) : Promise<?string> => {
};
const addBlock = async (block : BlockType) => {
};
const getBalances = async () : Promise<Counter> => {
};
return {
addBlock,
createBlock,
getBalances
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment