├── .all-contributorsrc
├── .editorconfig
├── .github
├── CODE_OF_CONDUCT.md
├── CODE_STANDARDS.md
├── CONTRIBUTING.md
├── FUNDING.yml
├── IMAGES
│ └── share-image.png
├── ISSUE_TEMPLATE
│ ├── 1_bug_report.md
│ ├── 2_feature_request.md
│ └── 3_general.md
├── SECURITY.md
├── dependabot.yml
├── labels.yml
├── mergify.yml
└── workflows
│ ├── codeql-analysis.yml
│ ├── release.yml
│ └── sync-labels.yml
├── .gitignore
├── .goreleaser.yml
├── .make
└── common.mk
├── .npmignore
├── LICENSE
├── Makefile
├── README.md
├── api-extractor.json
├── babel.config.js
├── jest.config.ts
├── jsdoc.json
├── package.json
├── rollup.config.js
├── setup-jest.js
├── src
├── index.ts
├── interface.ts
├── protobuf.ts
└── subscription.ts
├── tsconfig.json
└── yarn.lock
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "projectName": "js-junglebus",
3 | "projectOwner": "GorillaPool",
4 | "repoType": "github",
5 | "repoHost": "https://github.com",
6 | "files": [
7 | "README.md"
8 | ],
9 | "imageSize": 100,
10 | "commit": false,
11 | "commitConvention": "none",
12 | "contributorsPerLine": 7,
13 | "contributorsSortAlphabetically": false,
14 | "contributors": [
15 | {
16 | "login": "icellan",
17 | "name": "Siggi",
18 | "avatar_url": "https://avatars.githubusercontent.com/u/4411176?v=4",
19 | "profile": "https://github.com/icellan",
20 | "contributions": [
21 | "infra",
22 | "code",
23 | "security"
24 | ]
25 | },
26 | {
27 | "login": "mrz1836",
28 | "name": "Mr. Z",
29 | "avatar_url": "https://avatars.githubusercontent.com/u/3743002?v=4",
30 | "profile": "https://mrz1818.com",
31 | "contributions": [
32 | "infra",
33 | "code",
34 | "maintenance",
35 | "business"
36 | ]
37 | }
38 | ]
39 | }
40 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Merit
2 |
3 | 1. The project creators, lead developers, core team, constitute
4 | the managing members of the project and have final say in every decision
5 | of the project, technical or otherwise, including overruling previous decisions.
6 | There are no limitations to this decisional power.
7 |
8 | 2. Contributions are an expected result of your membership on the project.
9 | Don't expect others to do your work or help you with your work forever.
10 |
11 | 3. All members have the same opportunities to seek any challenge they want
12 | within the project.
13 |
14 | 4. Authority or position in the project will be proportional
15 | to the accrued contribution. Seniority must be earned.
16 |
17 | 5. Software is evolutive: the better implementations must supersede lesser
18 | implementations. Technical advantage is the primary evaluation metric.
19 |
20 | 6. This is a space for technical prowess; topics outside of the project
21 | will not be tolerated.
22 |
23 | 7. Non technical conflicts will be discussed in a separate space. Disruption
24 | of the project will not be allowed.
25 |
26 | 8. Individual characteristics, including but not limited to,
27 | body, sex, sexual preference, race, language, religion, nationality,
28 | or political preferences are irrelevant in the scope of the project and
29 | will not be taken into account concerning your value or that of your contribution
30 | to the project.
31 |
32 | 9. Discuss or debate the idea, not the person.
33 |
34 | 10. There is no room for ambiguity: Ambiguity will be met with questioning;
35 | further ambiguity will be met with silence. It is the responsibility
36 | of the originator to provide requested context.
37 |
38 | 11. If something is illegal outside the scope of the project, it is illegal
39 | in the scope of the project. This Code of Merit does not take precedence over
40 | governing law.
41 |
42 | 12. This Code of Merit governs the technical procedures of the project not the
43 | activities outside of it.
44 |
45 | 13. Participation on the project equates to agreement of this Code of Merit.
46 |
47 | 14. No objectives beyond the stated objectives of this project are relevant
48 | to the project. Any intent to deviate the project from its original purpose
49 | of existence will constitute grounds for remedial action which may include
50 | expulsion from the project.
51 |
--------------------------------------------------------------------------------
/.github/CODE_STANDARDS.md:
--------------------------------------------------------------------------------
1 | # Code Standards
2 | This project uses the following code standards and specifications from:
3 | - [docsify](https://docsify.js.org) - documentation
4 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to BUX
2 |
3 | See [README](../README.md) for more details
4 |
5 | Getting Started:
6 |
7 | * Visit the official site at [GetBux.io](https://GetBux.io) where you can read all the documentation.
8 | * For our license see the [LICENSE](../LICENSE) file.
9 | * How we work: _coming soon_ ;-)
10 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: GorillaPool
4 | custom: https://getbux.io/?utm_source=github&utm_medium=sponsor-link&utm_campaign=bux-website&utm_term=bux-website&utm_content=bux-website
5 |
--------------------------------------------------------------------------------
/.github/IMAGES/share-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gorillapool/js-junglebus/df5a65b1e25445fe5fe8ec699aee4696a455b190/.github/IMAGES/share-image.png
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/1_bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Report a Bug
3 | about: Create a bug report to help us improve our project
4 | title: ''
5 | labels: bug-P3
6 | assignees: mrz1836
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Recordings**
27 | These help immensely! Use https://recordit.co
28 |
29 | **Desktop or Mobile Browser (please complete the following information):**
30 | - OS: [e.g. iOS]
31 | - Browser [e.g. chrome, safari]
32 | - Version [e.g. 22]
33 |
34 | **Additional context**
35 | Add any other context about the problem here.
36 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2_feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an idea or feature for this project
4 | title: ''
5 | labels: idea
6 | assignees: mrz1836
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Any supplemental graphics or designs***
20 | If you have any sketches, designs, graphics, please attach them here.
21 |
22 | **Additional context**
23 | Add any other context or screenshots about the feature request here.
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/3_general.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Miscellaneous
3 | about: For all other miscellaneous issues
4 | title: ''
5 | labels: question
6 | assignees: mrz1836
7 |
8 | ---
9 |
10 | **Please describe your request/issue**
11 | A clear and concise description of what the issue is.
12 |
--------------------------------------------------------------------------------
/.github/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported & Maintained Versions
4 |
5 | | Version | Supported |
6 | |---------|--------------------|
7 | | 0.x.x | :white_check_mark: |
8 |
9 | ## Reporting a Vulnerability
10 |
11 | Individuals or organizations that are experiencing a product security issue are strongly encouraged to contact the [project maintainers](mailto:security@getbux.io).
12 | We welcome reports from independent researchers, industry organizations, vendors, customers, and other sources concerned with our project security.
13 | The minimal data needed for reporting a security issue is a description of the potential vulnerability.
14 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Basic dependabot.yml to update npm and Github Actions
2 |
3 | version: 2
4 | updates:
5 | - package-ecosystem: 'npm'
6 | target-branch: 'master'
7 | directory: '/'
8 | schedule:
9 | interval: 'daily'
10 | # Check for npm updates at 10am UTC (5am EST)
11 | time: '10:00'
12 | ignore:
13 | - dependency-name: "@types/bsv"
14 | - dependency-name: "bsv"
15 | reviewers:
16 | - 'mrz1836'
17 | assignees:
18 | - 'mrz1836'
19 | # Labels must be created first
20 | labels:
21 | - 'chore'
22 |
23 | # Maintain dependencies for GitHub Actions
24 | - package-ecosystem: "github-actions"
25 | target-branch: "master"
26 | directory: "/"
27 | schedule:
28 | interval: "weekly"
29 | day: "monday"
30 | reviewers:
31 | - "mrz1836"
32 | assignees:
33 | - "mrz1836"
34 | labels:
35 | - "chore"
36 | open-pull-requests-limit: 10
37 |
--------------------------------------------------------------------------------
/.github/labels.yml:
--------------------------------------------------------------------------------
1 | - color: 0075ca
2 | description: "Improvements or additions to documentation"
3 | name: "documentation"
4 | - color: b23128
5 | description: "Highest rated bug or issue, affects all"
6 | name: "bug-P1"
7 | - color: de3d32
8 | description: "Medium rated bug, affects a few"
9 | name: "bug-P2"
10 | - color: f44336
11 | description: "Lowest rated bug, affects nearly none or low-impact"
12 | name: "bug-P3"
13 | - color: 0e8a16
14 | description: "Any new significant addition"
15 | name: "feature"
16 | - color: b60205
17 | description: "Urgent or important fix/patch"
18 | name: "hot-fix"
19 | - color: cccccc
20 | description: "Any idea, suggestion or opinion"
21 | name: "idea"
22 | - color: d4c5f9
23 | description: "Experimental - can break!"
24 | name: "prototype"
25 | - color: cc317c
26 | description: "Any question or concern"
27 | name: "question"
28 | - color: c2e0c6
29 | description: "Unit tests, mocking, integration tests"
30 | name: "test"
31 | - color: fbca04
32 | description: "Anything GUI related"
33 | name: "ui-ux"
34 | - color: 006b75
35 | description: "Simple dependency updates or version bumps"
36 | name: "chore"
37 | - color: 006b75
38 | description: "General updates"
39 | name: "update"
40 | - color: FFA500
41 | description: "Any significant refactoring"
42 | name: "refactor"
43 | - color: FEF2C0
44 | description: "Used for automatic merging"
45 | name: "automerge"
46 | - color: FBCA04
47 | description: "Used for denoting a WIP, stops auto-merge"
48 | name: "work-in-progress"
49 | - color: c2e0c6
50 | description: "Old, unused, stale"
51 | name: "stale"
52 |
--------------------------------------------------------------------------------
/.github/mergify.yml:
--------------------------------------------------------------------------------
1 | pull_request_rules:
2 |
3 | # ===============================================================================
4 | # DEPENDABOT
5 | # ===============================================================================
6 |
7 | - name: Automatic Merge for Dependabot Minor Version Pull Requests
8 | conditions:
9 | - -draft
10 | - author~=^dependabot(|-preview)\[bot\]$
11 | - check-success='Analyze (javascript)'
12 | - title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
13 | actions:
14 | review:
15 | type: APPROVE
16 | message: Automatically approving dependabot pull request
17 | merge:
18 | method: merge
19 | - name: Alert on major version detection
20 | conditions:
21 | - author~=^dependabot(|-preview)\[bot\]$
22 | - check-success='Analyze (javascript)'
23 | - -title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
24 | actions:
25 | comment:
26 | message: "⚠️ @mrz1836: this is a major version bump and requires your attention"
27 |
28 | # ===============================================================================
29 | # AUTOMATIC MERGE (APPROVALS)
30 | # ===============================================================================
31 |
32 | - name: Automatic Merge ⬇️ on Approval ✔
33 | conditions:
34 | - "#approved-reviews-by>=1"
35 | - "#review-requested=0"
36 | - "#changes-requested-reviews-by=0"
37 | - check-success='Analyze (javascript)'
38 | - -title~=(?i)wip
39 | - label!=work-in-progress
40 | - -draft
41 | actions:
42 | merge:
43 | method: merge
44 |
45 | # ===============================================================================
46 | # AUTHOR
47 | # ===============================================================================
48 |
49 | - name: Auto-Assign Author
50 | conditions:
51 | - "#assignee=0"
52 | actions:
53 | assign:
54 | users: [ "mrz1836" ]
55 |
56 | # ===============================================================================
57 | # ALERTS
58 | # ===============================================================================
59 |
60 | - name: Notify on merge
61 | conditions:
62 | - merged
63 | - label=automerge
64 | actions:
65 | comment:
66 | message: "✅ @{{author}}: **{{title}}** has been merged successfully."
67 | - name: Alert on merge conflict
68 | conditions:
69 | - conflict
70 | - label=automerge
71 | actions:
72 | comment:
73 | message: "🆘 @{{author}}: `{{head}}` has conflicts with `{{base}}` that must be resolved."
74 | - name: Alert on tests failure for automerge
75 | conditions:
76 | - label=automerge
77 | - status-failure=commit
78 | actions:
79 | comment:
80 | message: "🆘 @{{author}}: unable to merge due to CI failure."
81 |
82 | # ===============================================================================
83 | # LABELS
84 | # ===============================================================================
85 | # Automatically add labels when PRs match certain patterns
86 | #
87 | # NOTE:
88 | # - single quotes for regex to avoid accidental escapes
89 | # - Mergify leverages Python regular expressions to match rules.
90 | #
91 | # Semantic commit messages
92 | # - chore: updating grunt tasks etc.; no production code change
93 | # - docs: changes to the documentation
94 | # - feat: feature or story
95 | # - feature: new feature or story
96 | # - fix: bug fix for the user, not a fix to a build script
97 | # - idea: general idea or suggestion
98 | # - question: question regarding code
99 | # - test: test related changes
100 | # - wip: work in progress PR
101 | # ===============================================================================
102 |
103 | - name: Work in Progress
104 | conditions:
105 | - "head~=(?i)^wip" # if the PR branch starts with wip/
106 | actions:
107 | label:
108 | add: ["work-in-progress"]
109 | - name: Hotfix label
110 | conditions:
111 | - "head~=(?i)^hotfix" # if the PR branch starts with hotfix/
112 | actions:
113 | label:
114 | add: ["hot-fix"]
115 | - name: Bug / Fix label
116 | conditions:
117 | - "head~=(?i)^(bug)?fix" # if the PR branch starts with (bug)?fix/
118 | actions:
119 | label:
120 | add: ["bug-P3"]
121 | - name: Documentation label
122 | conditions:
123 | - "head~=(?i)^docs" # if the PR branch starts with docs/
124 | actions:
125 | label:
126 | add: ["documentation"]
127 | - name: Feature label
128 | conditions:
129 | - "head~=(?i)^feat(ure)?" # if the PR branch starts with feat(ure)?/
130 | actions:
131 | label:
132 | add: ["feature"]
133 | - name: Chore label
134 | conditions:
135 | - "head~=(?i)^chore" # if the PR branch starts with chore/
136 | actions:
137 | label:
138 | add: ["update"]
139 | - name: Question label
140 | conditions:
141 | - "head~=(?i)^question" # if the PR branch starts with question/
142 | actions:
143 | label:
144 | add: ["question"]
145 | - name: Test label
146 | conditions:
147 | - "head~=(?i)^test" # if the PR branch starts with test/
148 | actions:
149 | label:
150 | add: ["test"]
151 | - name: Idea label
152 | conditions:
153 | - "head~=(?i)^idea" # if the PR branch starts with idea/
154 | actions:
155 | label:
156 | add: ["idea"]
157 |
158 | # ===============================================================================
159 | # CONTRIBUTORS
160 | # ===============================================================================
161 |
162 | - name: Welcome New Contributors
163 | conditions:
164 | - and:
165 | - author!=dependabot[bot]
166 | - author!=mergify[bot]
167 | - author!=icellan
168 | - author!=mrz1836
169 | actions:
170 | comment:
171 | message: "Welcome to our open-source project @{{author}}! 💘"
172 |
173 | # ===============================================================================
174 | # STALE BRANCHES
175 | # ===============================================================================
176 |
177 | - name: Close stale pull request
178 | conditions:
179 | - base=master
180 | - -closed
181 | - updated-at<21 days ago
182 | actions:
183 | close:
184 | message: |
185 | This pull request looks stale. Feel free to reopen it if you think it's a mistake.
186 | label:
187 | add: [ "stale" ]
188 |
189 | # ===============================================================================
190 | # BRANCHES
191 | # ===============================================================================
192 |
193 | - name: Delete head branch after merge
194 | conditions:
195 | - merged
196 | actions:
197 | delete_head_branch:
198 |
199 | # ===============================================================================
200 | # CONVENTION
201 | # ===============================================================================
202 | # https://www.conventionalcommits.org/en/v1.0.0/
203 | # Premium feature only
204 |
205 | #- name: Conventional Commit
206 | # conditions:
207 | # - "title~=^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?:"
208 | # actions:
209 | # post_check:
210 | # title: |
211 | # {% if check_succeed %}
212 | # Title follows Conventional Commit
213 | # {% else %}
214 | # Title does not follow Conventional Commit
215 | # {% endif %}
216 | # summary: |
217 | # {% if not check_succeed %}
218 | # Your pull request title must follow [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/).
219 | # {% endif %}
220 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ master ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ master ]
20 |
21 | jobs:
22 | analyze:
23 | name: Analyze
24 | runs-on: ubuntu-latest
25 | permissions:
26 | actions: read
27 | contents: read
28 | security-events: write
29 |
30 | strategy:
31 | fail-fast: false
32 | matrix:
33 | language: [ 'javascript' ]
34 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
35 | # Learn more:
36 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
37 |
38 | steps:
39 | - name: Checkout repository
40 | uses: actions/checkout@v3
41 |
42 | # Initializes the CodeQL tools for scanning.
43 | - name: Initialize CodeQL
44 | uses: github/codeql-action/init@v2
45 | with:
46 | languages: ${{ matrix.language }}
47 | # If you wish to specify custom queries, you can do so here or in a config file.
48 | # By default, queries listed here will override any specified in a config file.
49 | # Prefix the list here with "+" to use these queries and those in the config file.
50 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
51 |
52 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53 | # If this step fails, then you should remove it and run the build manually (see below)
54 | - name: Autobuild
55 | uses: github/codeql-action/autobuild@v2
56 |
57 | # ℹ️ Command-line programs to run using the OS shell.
58 | # 📚 https://git.io/JvXDl
59 |
60 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
61 | # and modify them (or add more) to build your code if your project
62 | # uses a compiled language
63 |
64 | #- run: |
65 | # make bootstrap
66 | # make release
67 |
68 | - name: Perform CodeQL Analysis
69 | uses: github/codeql-action/analyze@v2
70 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | # From: https://goreleaser.com/ci/actions/#usage
2 | name: release
3 |
4 | on:
5 | push:
6 | tags:
7 | - '*'
8 |
9 | permissions:
10 | contents: write
11 |
12 | jobs:
13 | goreleaser:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Checkout
17 | uses: actions/checkout@v3
18 | with:
19 | fetch-depth: 0
20 | - name: Set up Go
21 | uses: actions/setup-go@v3
22 | with:
23 | go-version: 1.17
24 | - name: Setup Node
25 | uses: actions/setup-node@v3
26 | with:
27 | node-version: 16
28 | registry-url: https://registry.npmjs.org/
29 | - name: Install all deps
30 | run: make install
31 | - name: Publish to NPM
32 | run: make publish
33 | env:
34 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
35 | - name: Run GoReleaser
36 | uses: goreleaser/goreleaser-action@v4.2.0
37 | with:
38 | distribution: goreleaser
39 | version: latest
40 | args: release --rm-dist --debug
41 | env:
42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 |
--------------------------------------------------------------------------------
/.github/workflows/sync-labels.yml:
--------------------------------------------------------------------------------
1 | # Workflow: https://github.com/micnncim/action-label-syncer
2 | # Export your labels: https://github.com/micnncim/label-exporter
3 | name: sync-labels
4 | on:
5 | push:
6 | branches:
7 | - master
8 | paths:
9 | - .github/labels.yml
10 | jobs:
11 | sync-labels:
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v3
15 | - uses: micnncim/action-label-syncer@v1.3.0
16 | env:
17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 | with:
19 | manifest: .github/labels.yml
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | firebase-debug.log*
8 |
9 | # Firebase cache
10 | .firebase
11 | .firebase/
12 | .firebaserc
13 | firebase.json
14 |
15 | # Firebase config
16 |
17 | # Uncomment this if you'd like others to create their own Firebase project.
18 | # For a team working on the same Firebase project(s), it is recommended to leave
19 | # it commented so all members can deploy to the same project(s) in .firebaserc.
20 | # .firebaserc
21 |
22 | # Runtime data
23 | pids
24 | *.pid
25 | *.seed
26 | *.pid.lock
27 |
28 | # Directory for instrumented libs generated by jscoverage/JSCover
29 | lib-cov
30 |
31 | # node-waf configuration
32 | .lock-wscript
33 |
34 | # Compiled binary addons (http://nodejs.org/api/addons.html)
35 | build/Release
36 |
37 | # Dependency directories
38 | node_modules/
39 |
40 | # Optional npm cache directory
41 | .npm
42 |
43 | # Optional eslint cache
44 | .eslintcache
45 |
46 | # Optional REPL history
47 | .node_repl_history
48 |
49 | # Output of 'npm pack'
50 | *.tgz
51 |
52 | # Yarn Integrity file
53 | .yarn-integrity
54 |
55 | # dotenv environment variables file
56 | .env
57 |
58 | # WebStorm
59 | .idea
60 | .DS_Store
61 | todo.md
62 |
63 | # Deployment
64 | dist
65 | coverage
66 | module
67 | docs
68 |
--------------------------------------------------------------------------------
/.goreleaser.yml:
--------------------------------------------------------------------------------
1 | # Make sure to check the documentation at http://goreleaser.com
2 | # ---------------------------
3 | # General
4 | # ---------------------------
5 | before:
6 | hooks:
7 | - make test
8 | snapshot:
9 | name_template: "{{ .Tag }}"
10 | changelog:
11 | sort: asc
12 | filters:
13 | exclude:
14 | - '^.github:'
15 | - '^test:'
16 |
17 | # ---------------------------
18 | # Builder
19 | # ---------------------------
20 | build:
21 | skip: true
22 |
23 | # ---------------------------
24 | # Publishers
25 | # ---------------------------
26 | # publishers:
27 | # - name: npm
28 | # cmd: make publish
29 | # dir: "."
30 |
31 | # ---------------------------
32 | # Github Release
33 | # ---------------------------
34 | release:
35 | prerelease: true
36 | name_template: "Release v{{.Version}}"
37 |
38 | # ---------------------------
39 | # Announce
40 | # ---------------------------
41 | announce:
42 |
43 | # See more at: https://goreleaser.com/customization/announce/#slack
44 | slack:
45 | enabled: false
46 | message_template: '{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/GorillaPool/{{ .ProjectName }}/releases/tag/{{ .Tag }}'
47 | channel: '#releases'
48 | # username: ''
49 | # icon_emoji: ''
50 | # icon_url: ''
51 |
52 | # See more at: https://goreleaser.com/customization/announce/#twitter
53 | twitter:
54 | enabled: false
55 | message_template: '{{ .ProjectName }} {{ .Tag }} is out!'
56 |
57 | # See more at: https://goreleaser.com/customization/announce/#discord
58 | discord:
59 | enabled: false
60 | message_template: '{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/GorillaPool/{{ .ProjectName }}/releases/tag/{{ .Tag }}'
61 | author: 'TonicBot'
62 | #color: '80200120' #50C878
63 | #icon_url: 'https://tonicpow.com/images/apple-touch-icon.png'
64 |
65 | # See more at: https://goreleaser.com/customization/announce/#reddit
66 | reddit:
67 | enabled: false
68 | # Application ID for Reddit Application
69 | application_id: ""
70 | # Username for your Reddit account
71 | username: ""
72 | # Defaults to `{{ .GitURL }}/releases/tag/{{ .Tag }}`
73 | # url_template: 'https://github.com/GorillaPool/{{ .ProjectName }}/releases/tag/{{ .Tag }}'
74 | # Defaults to `{{ .ProjectName }} {{ .Tag }} is out!`
75 | title_template: '{{ .ProjectName }} {{ .Tag }} is out!'
76 |
--------------------------------------------------------------------------------
/.make/common.mk:
--------------------------------------------------------------------------------
1 | ## Default repository domain name
2 | ifndef GIT_DOMAIN
3 | override GIT_DOMAIN=github.com
4 | endif
5 |
6 | ## Set if defined (alias variable for ease of use)
7 | ifdef branch
8 | override REPO_BRANCH=$(branch)
9 | export REPO_BRANCH
10 | endif
11 |
12 | ## Do we have git available?
13 | HAS_GIT := $(shell command -v git 2> /dev/null)
14 |
15 | ifdef HAS_GIT
16 | ## Do we have a repo?
17 | HAS_REPO := $(shell git rev-parse --is-inside-work-tree 2> /dev/null)
18 | ifdef HAS_REPO
19 | ## Automatically detect the repo owner and repo name (for local use with Git)
20 | REPO_NAME=$(shell basename "$(shell git rev-parse --show-toplevel 2> /dev/null)")
21 | REPO_OWNER=$(shell git config --get remote.origin.url | sed 's/git@$(GIT_DOMAIN)://g' | sed 's/\/$(REPO_NAME).git//g')
22 | VERSION_SHORT=$(shell git describe --tags --always --abbrev=0)
23 | export REPO_NAME, REPO_OWNER, VERSION_SHORT
24 | endif
25 | endif
26 |
27 | ## Set the distribution folder
28 | ifndef DISTRIBUTIONS_DIR
29 | override DISTRIBUTIONS_DIR=./dist
30 | endif
31 | export DISTRIBUTIONS_DIR
32 |
33 | help: ## Show this help message
34 | @egrep -h '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
35 |
36 | release:: ## Full production release (creates release in Github)
37 | @test $(github_token)
38 | @export GITHUB_TOKEN=$(github_token) && goreleaser --rm-dist
39 |
40 | release-test: ## Full production test release (everything except deploy)
41 | @goreleaser --skip-publish --rm-dist
42 |
43 | release-snap: ## Test the full release (build binaries)
44 | @goreleaser --snapshot --skip-publish --rm-dist
45 |
46 | replace-version: ## Replaces the version in HTML/JS (pre-deploy)
47 | @test $(version)
48 | @test "$(path)"
49 | @find $(path) -name "*.html" -type f -exec sed -i '' -e "s/{{version}}/$(version)/g" {} \;
50 | @find $(path) -name "*.js" -type f -exec sed -i '' -e "s/{{version}}/$(version)/g" {} \;
51 |
52 | tag: ## Generate a new tag and push (tag version=0.0.0)
53 | @test $(version)
54 | @git tag -a v$(version) -m "Pending full release..."
55 | @git push origin v$(version)
56 | @git fetch --tags -f
57 |
58 | tag-remove: ## Remove a tag if found (tag-remove version=0.0.0)
59 | @test $(version)
60 | @git tag -d v$(version)
61 | @git push --delete origin v$(version)
62 | @git fetch --tags
63 |
64 | tag-update: ## Update an existing tag to current commit (tag-update version=0.0.0)
65 | @test $(version)
66 | @git push --force origin HEAD:refs/tags/v$(version)
67 | @git fetch --tags -f
68 |
69 | update-releaser: ## Update the goreleaser application
70 | @brew update
71 | @brew upgrade goreleaser
72 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | bower_components
2 | node_modules
3 | test
4 | *.log
5 | .DS_Store
6 | .idea
7 | examples/
8 | .github
9 | .firebase
10 | .firebase/
11 | .firebaserc
12 | firebase.json
13 | todo.md
14 | .goreleaser.yml
15 | Makefile
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Open BSV License
2 | Copyright (c) 2022 GorillaPool
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | 1 - The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 | 2 - The Software, and any software that is derived from the Software or parts thereof,
14 | can only be used on the Bitcoin SV blockchains. The Bitcoin SV blockchains are defined,
15 | for purposes of this license, as the Bitcoin blockchain containing block height #556767
16 | with the hash "000000000000000001d956714215d96ffc00e0afda4cd0a96c96f8d802b1662b" and
17 | the test blockchains that are supported by the un-modified Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | THE SOFTWARE.
26 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Common makefile commands & variables between projects
2 | include .make/common.mk
3 |
4 | ## Not defined? Use default repo name which is the application
5 | ifeq ($(REPO_NAME),)
6 | REPO_NAME="js-junglebus"
7 | endif
8 |
9 | ## Not defined? Use default repo owner
10 | ifeq ($(REPO_OWNER),)
11 | REPO_OWNER="GorillaPool"
12 | endif
13 |
14 | .PHONY: clean publish release test
15 |
16 | audit: ## Checks for vulnerabilities in dependencies
17 | @yarn audit
18 |
19 | clean: ## Remove previous builds and any test cache data
20 | @if [ -d $(DISTRIBUTIONS_DIR) ]; then rm -r $(DISTRIBUTIONS_DIR); fi
21 | @if [ -d node_modules ]; then rm -r node_modules; fi
22 |
23 | install: ## Installs the dependencies for the package
24 | @yarn install
25 |
26 | install-all-contributors: ## Installs all contributors locally
27 | @echo "installing all-contributors cli tool..."
28 | @yarn global add all-contributors-cli
29 |
30 | outdated: ## Checks for outdated packages via npm
31 | @yarn outdated
32 |
33 | publish: ## Will publish the version to npm
34 | @npm run deploy
35 |
36 | release:: ## Run after releasing - deploy to npm
37 | @$(MAKE) publish
38 |
39 | test: ## Will run unit tests
40 | @yarn run test
41 |
42 | update-contributors: ## Regenerates the contributors html/list
43 | @echo "generating contributor html..."
44 | @all-contributors generate
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [Gorilla Pool JungleBus: JS Client](https://www.npmjs.com/package/@GorillaPool/js-junglebus)
2 |
3 | [](https://github.com/GorillaPool/js-junglebus/commits/master)
4 | [](https://github.com/GorillaPool/js-junglebus/releases)
5 | [](https://www.npmjs.com/package/@GorillaPool/js-junglebus)
6 | [](/LICENSE)
7 | [](https://mergify.io)
8 | [](https://github.com/sponsors/GorillaPool)
9 |
10 | ## Table of Contents
11 | - [Gorilla Pool JungleBus: JS Client](#gorilla-pool-junglebus-js-client)
12 | - [Table of Contents](#table-of-contents)
13 | - [What is JungleBus?](#what-is-junglebus)
14 | - [Installation](#installation)
15 | - [Usage](#usage)
16 | - [Lite Mode](#lite-mode)
17 | - [Documentation](#documentation)
18 | - [Code Standards](#code-standards)
19 | - [Contributing](#contributing)
20 | - [How can I help?](#how-can-i-help)
21 | - [Contributors ✨](#contributors-)
22 | - [License](#license)
23 |
24 |
25 |
26 | ## What is JungleBus?
27 | [Read more about JungleBus](https://junglebus.gorillapool.io)
28 |
29 |
30 |
31 | ## Installation
32 |
33 | Install the JungleBus library into your project:
34 | ```bash
35 | $ npm install @gorillapool/js-junglebus
36 | ```
37 |
38 | or, with yarn
39 | ```bash
40 | $ yarn add @gorillapool/js-junglebus
41 | ```
42 |
43 | ## Usage
44 | Here's the getting started with JungleBus
45 |
46 | ```javascript
47 | import { JungleBusClient } from '@gorillapool/js-junglebus';
48 |
49 | const server = "junglebus.gorillapool.io";
50 | const jungleBusClient = new JungleBusClient(server, {
51 | onConnected(ctx) {
52 | // add your own code here
53 | console.log(ctx);
54 | },
55 | onConnecting(ctx) {
56 | // add your own code here
57 | console.log(ctx);
58 | },
59 | onDisconnected(ctx) {
60 | // add your own code here
61 | console.log(ctx);
62 | },
63 | onError(ctx) {
64 | // add your own code here
65 | console.error(ctx);
66 | }
67 | });
68 |
69 | // create subscriptions in the dashboard of the JungleBus website
70 | const subId = "....";
71 | const fromBlock = 750000;
72 | const subscription = jungleBusClient.Subscribe(
73 | subId,
74 | fromBlock,
75 | onPublish(tx) => {
76 | // add your own code here
77 | console.log(tx);
78 |
79 | },
80 | onStatus(ctx) => {
81 | // add your own code here
82 | console.log(ctx);
83 | },
84 | onError(ctx) => {
85 | // add your own code here
86 | console.log(ctx);
87 | },
88 | onMempool(tx) => {
89 | // add your own code here
90 | console.log(tx);
91 | });
92 | ```
93 |
94 |
95 |
96 | ## Lite Mode
97 | JungleBus also supports a lite mode, which delivers only the transaction hash and block height. This is useful for applications that only need to know when a transaction is included in a block.
98 |
99 | To use lite mode, just pass true as a final argument to the Subscribe method.
100 |
101 | ```javascript
102 | await client.Subscribe("a5e2fa655c41753331539a2a86546bf9335ff6d9b7a512dc9acddb00ab9985c0", 1550000, onPublish, onStatus, onError, onMempool, true);
103 | ```
104 |
105 | ## Documentation
106 | View more [JungleBus documentation](https://junglebus.gorillapool.io/docs).
107 |
108 | ## Code Standards
109 | Please read our [code standards document](.github/CODE_STANDARDS.md)
110 |
111 | ## Contributing
112 | View the [contributing guidelines](.github/CONTRIBUTING.md) and follow the [code of conduct](.github/CODE_OF_CONDUCT.md).
113 |
114 | ### How can I help?
115 | All kinds of contributions are welcome :raised_hands:!
116 | The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:.
117 | You can also support this project by [becoming a sponsor on GitHub](https://github.com/sponsors/GorillaPool) :clap:
118 |
119 | [](https://github.com/GorillaPool/js-junglebus/stargazers)
120 |
121 |
122 |
123 | ### Contributors ✨
124 | Thank you to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
125 |
126 |
127 |
128 |
129 |
Siggi 🚇 💻 🛡️ |
132 |