Skip to content

Commit

Permalink
Merge pull request #61 from buidler-labs/develop
Browse files Browse the repository at this point in the history
0.7.4
  • Loading branch information
victorholo authored Apr 13, 2022
2 parents 1282c27 + fcf9d01 commit d33bb66
Show file tree
Hide file tree
Showing 257 changed files with 80,304 additions and 67,580 deletions.
14 changes: 14 additions & 0 deletions .cspell/custom-dictionary-workspace.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
_valueInTinybar
# Custom Dictionary Words
arrayify
Buidler
cmfcmf
considerArrayifying
easy-peasy
estree
polies
resolutedAbi
resolutedInfo
Tinybar
TransactionedReceipt
tweetnacl
6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ HEDERAS_OPERATOR_KEY=
# If missing, it's assumed to be in the "contracts" subfolder
HEDERAS_CONTRACTS_RELATIVE_PATH=

# (OPTIONAL) A fine cost-control config option which, when set to true (default), returns only the receipt of the contract-transaction call (for live-contracts)
# Set this to false if you want to also do a record-query and get the transaction contract-function-result
# Note: this only impacts the calling of mutating/transactions contract functions. Queries (non-mutating) requests are not affected by it and will always
# return the function result.
HEDERAS_DEFAULT_CONTRACT_REQUESTS_RETURN_ONLY_RECEIPTS=

# (OPTIONAL) A list of coma-separated paths (relative or absolute) that are tried out in the following format
# current working directory > relative path > included prefix > requested file import (when non-absolute) and
# included prefix > requested file import (when absolute)
Expand Down
9 changes: 4 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ module.exports = {
],
root: true,
rules: {
"@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
"@typescript-eslint/no-explicit-any": "off",
"comma-dangle": ["warn", "always-multiline"],
"eol-last": ["warn", "always"],
"indent": [ "warn", 2, { "FunctionExpression": {"body": 1, "parameters": 2}, "ImportDeclaration": 1, "MemberExpression": 1, "SwitchCase": 1 } ],
"no-multiple-empty-lines": ["warn", { "max": 1, "maxEOF": 1 }],
"sort-imports": ["warn", {
"allowSeparatedGroups": true
}],
"sort-keys": ["warn", "asc", { "caseSensitive": true, "minKeys": 2, "natural": false }]
}
"sort-imports": ["warn", { "allowSeparatedGroups": true }],
"sort-keys": ["warn", "asc", { "caseSensitive": true, "minKeys": 2, "natural": false }],
},
};
1 change: 1 addition & 0 deletions .github/workflows/test-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
HEDERAS_NETWORK: ${{ secrets.HEDERAS_NETWORK }}
HEDERAS_OPERATOR_ID: ${{ secrets.HEDERAS_OPERATOR_ID }}
HEDERAS_OPERATOR_KEY: ${{ secrets.HEDERAS_OPERATOR_KEY }}
HEDERAS_DEFAULT_CONTRACT_REQUESTS_RETURN_ONLY_RECEIPTS: ${{ secrets.HEDERAS_DEFAULT_CONTRACT_REQUESTS_RETURN_ONLY_RECEIPTS }}
run: npm run ${{ matrix.npm_test_script }}

- name: Upload coverage to Codecov
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
HEDERAS_NETWORK: ${{ secrets.HEDERAS_NETWORK }}
HEDERAS_OPERATOR_ID: ${{ secrets.HEDERAS_OPERATOR_ID }}
HEDERAS_OPERATOR_KEY: ${{ secrets.HEDERAS_OPERATOR_KEY }}
HEDERAS_DEFAULT_CONTRACT_REQUESTS_RETURN_ONLY_RECEIPTS: ${{ secrets.HEDERAS_DEFAULT_CONTRACT_REQUESTS_RETURN_ONLY_RECEIPTS }}
run: npm run ${{ matrix.npm_test_script }}

- name: Upload coverage to Codecov
Expand Down
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"Orta.vscode-jest",
"streetsidesoftware.code-spell-checker"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--runInBand",
"--config=./jest.node.config.cjs",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
}
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"jest.autoRun": "off",
"jest.jestCommandLine": "node_modules/.bin/jest --config=./jest.node.config.cjs",
"cSpell.customDictionaries": {
"custom-dictionary-workspace": {
"name": "custom-dictionary-workspace",
"path": "${workspaceFolder:hedera-strato-js}/.cspell/custom-dictionary-workspace.txt",
"addWords": true,
"scope": "workspace"
}
},
}
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 BuiDler Labs
Copyright (c) 2022 BuiDler Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
62 changes: 32 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,55 @@

![NodeJS/JsDOM/Browser tests](https://img.shields.io/github/workflow/status/buidler-labs/hedera-strato-js/test-nodejs-jsdom-browser?style=flat-square&label=tests&color=yellowgreen)
[![codecov](https://img.shields.io/codecov/c/github/buidler-labs/hedera-strato-js?style=flat-square)](https://codecov.io/gh/buidler-labs/hedera-strato-js)
![node version](https://img.shields.io/badge/Node.js-%3E%3D14.8.0-orange.svg?style=flat-square)

[![Discord support channel](https://img.shields.io/discord/949250301792239686?style=flat-square)](https://discord.com/invite/4mYCre869F)
![contributions](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)
![license](https://img.shields.io/github/license/buidler-labs/hedera-strato-js.svg?colorB=ff0000&style=flat-square)

![node version](https://img.shields.io/badge/Node.js-%3E%3D14.8.0-orange.svg?style=flat-square)
![npm version](https://img.shields.io/npm/v/@buidlerlabs/hedera-strato-js.svg?style=flat-square)

[![NPM](https://nodei.co/npm/@buidlerlabs/hedera-strato-js.png?mini=true)](https://nodei.co/npm/@buidlerlabs/hedera-strato-js/)

Write Web3 [Hedera](https://hedera.com/) smart-contract dApps frictionless and with ease, without having to deal with the hustle and bustle of [Hedera's verbose, underlying services](https://docs.hedera.com/guides/docs/sdks).

> **Disclaimer:** This project is not an official Hedera project and, as such, it is not affiliated with it in any way, shape or form. It is an independent, community driven, effort to bring clarity and *joy* to developing descentralized apps (dApps) on the Hedera network-chain ecosystem.
> **Disclaimer:** This project is not an official Hedera project and, as such, it is not affiliated with it in any way, shape or form. It is an independent, community driven, effort to bring clarity and *joy* to developing decentralized apps (dApps) on the Hedera network-chain ecosystem.
> **Note:** Currently, the library is mostly available for NodeJS runtime environments since there is where most of the bulk development effort occurs. Efforts are underway to have it deployable and working in web browsers as well.
>
>These docs are using such an ad-hoc bundled to power the live-coding widgets. If you eager to see how this can be done, have a look over our browser smoke-test rollup config for inspiration.
> **Note #2:** Please keep in mind that, although core features are extensively tested and appear to be working, this is still currently under _heavy-active_ development and, as such, we don't recommend this just yet for production use. The API is also very likely to change before we reach there!
> **Note:** Please keep in mind that, although core features are extensively tested and appear to be working, this is still currently under _heavy-active_ development and, as such, we don't recommend this just yet for production use. The API is also very likely to change before we reach there!
>
>Having said that, we will continue to use it "as is" in production even at this initial stage just because we can and are quick to solve any issues that we might encounter.
## Features
Strato already supports a lot of stuff:
* [x] Compile a Solidity contract to obtain its Hedera accepted ABI directly from the library
* [x] Deploy a contract to the network
* [x] Use intuitive API mechanics for interacting with a deployed, live contract
* [x] Pubsub for contract emitted events
* [x] Pubsub for transaction receipts
* [x] Using Hedera File Storage as a place to store a generic JSON
* [x] Create token via the Hedera Token Service (HTS)
* [x] Create a Hedera account
* [x] Ready to be plugged into a web3 wallet (_when such will exist_)
* [x] End to end tested sourcing multiple contracts for the test-base from places such as [solidity-by-example](https://solidity-by-example.org/) and the [hedera-sdk-js repo](https://github.com/hashgraph/hedera-sdk-js/tree/main/examples)
#### ... with more planned for development:
* [ ] Be able to _seamlessly_ run it in browser (even the contract compilation part if required)
* [ ] Update/delete/_other_ token operations
* [ ] Hedera Consensus Service support
* [ ] Other account operations
* [ ] Better error reporting
* [ ] Increase logging support
* [ ] Better integration of _entities_ across the code-base
#### ... and more.
Strato already is packed with a lot of stuff:
✔️ Compile a Solidity contract to obtain its Hedera accepted ABI directly from within the library (no external compiler required)
✔️ Deploy a contract to the network
✔️ Use a fluent API to interact with deployed, _live entities_ such as contracts
✔️ Pubsub for contract emitted events
✔️ Pubsub for transaction receipts
✔️ Fine grained cost-control
✔️ Browser bundle-able via a custom made Rollup plugin ([webpack pending](https://github.com/buidler-labs/hedera-strato-js/issues/26))
✔️ Using Hedera File Storage as a place to store generic files and JSONs
✔️ Create token via the Hedera Token Service (HTS)
✔️ Create a Hedera account
✔️ Ready to be plugged into a web3 wallet (aka [HIP-338](https://hips.hedera.com/hip/hip-338) [supported](./guides//wallet.md))
✔️ End to end tested, high coverage (targeting a minimum of 85%) sourcing multiple contracts for the test-base from places such as [solidity-by-example](https://solidity-by-example.org/) and the [hedera-sdk-js repo](https://github.com/hashgraph/hedera-sdk-js/tree/main/examples)

#### ... with more planned for development:
🔲 Better integration of _entities_ across the code-base
🔲 Pubsub mechanics for Hedera's Consensus Service
🔲 Other account operations
🔲 Better error reporting
🔲 Increase logging support
#### ... and even more to follow.

## The drive
As any good-striving, long-lasting, endevour, we are using Strato to hopefully fuel everything that we, here at BuiDler Labs, build on Hedera. Our Hedera porfolio currently consists of:
As any good-striving, long-lasting, endeavour, we are using Strato to hopefully fuel everything that we, here at BuiDler Labs, build on Hedera. Our Hedera portfolio currently consists of:
* [FileCoin-Hedera Grant](https://github.com/taskbar-team/hedera-filecoin-devgrant) - a development grant used to put the foundations of [MyTaskbar](https://mytaskbar.io/) v2, the more decentralized version
* [HeadStarter](headstarter.org) - the first Hedera IDO platform

We're basically eating our own dog food. That way, we can hopefully prove that it's something delicious or, if not, we have a good incentive to make it so. This also makes it a good reason to not have it as a "shot and forget" kind of effort.

We will support this for as long as we're going to build on Hedera and, if there's comunity interest, even beyond that.
We will support this for as long as we're going to build on Hedera and, if there's community interest, even beyond that.

## Documentation
You can find the [API docs here](https://hsj-docs.buidlerlabs.com/).
Expand Down Expand Up @@ -97,9 +97,11 @@ $ npm test
> **Note:** If you're targeting an official network such as a `testnet` or a `previewnet`, there will be a cost involved in running the library tests that has to do with API usage regarding contract deployments and execution (among other things). There's also the option of a `customnet` targeting a self-hosted `hedera-service` deployment. If you want to go down that path (recommended especially if you are planning to contribute), please [follow these instructions](https://github.com/buidler-labs/dockerized-hedera-services).
## Contributions
Do you think we missed anything? Want some feature urgented? Do you have an idea of something that we might improve? Head over to [our issues page](https://github.com/buidler-labs/hedera-strato-js/issues) and let us know! We want Strato to be a community-lead initiative. This means that any opinion or critic is encouraged (and even welcomed)!
Do you think we missed anything? Want some feature badly? Do you have an idea of something that we might improve? Head over to [our issues page](https://github.com/buidler-labs/hedera-strato-js/issues) and let us know! We want Strato to be a community-lead initiative. This means that any opinion or critic is encouraged (and even welcomed)!

Of course, if you're eager to write it yourself, that's also fine and dandy! Just fork us, add your changes and open a pull request. We'll take it from there ...

Oh! And if you ever feel like talking to us, you can [reach us on discord](https://discord.gg/4mYCre869F). We're über friendly! 👨‍👩‍👧‍👦

## License
This work has been published under the MIT License.
Loading

0 comments on commit d33bb66

Please sign in to comment.