├── .eslintignore
├── .eslintrc.js
├── .github
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── config.yml
│ └── feature_request.md
├── SECURITY.md
├── SUPPORT.md
├── codeql
│ └── codeql-config.yml
├── dependabot.yml
├── pull_request_template.md
└── workflows
│ ├── build.yml
│ └── codeql-analysis.yml
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── docs
├── .nojekyll
├── api.md
├── classes
│ └── TrytesHelper.md
└── interfaces
│ ├── IMamChannelState.md
│ ├── IMamFetchedMessage.md
│ └── IMamMessage.md
├── esm-modules.js
├── examples
├── README.md
├── api
│ ├── .eslintignore
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── README.md
│ ├── now.json
│ ├── package-lock.json
│ ├── package.json
│ ├── spec
│ │ ├── _changelog.md
│ │ ├── _example.md
│ │ ├── api.json
│ │ └── logo.png
│ ├── src
│ │ ├── api
│ │ │ └── handler.ts
│ │ ├── auth.ts
│ │ ├── data
│ │ │ └── config.template.json
│ │ ├── docs
│ │ │ └── index.html
│ │ ├── errors
│ │ │ ├── httpError.ts
│ │ │ └── httpStatusCodes.ts
│ │ ├── factories
│ │ │ └── serviceFactory.ts
│ │ ├── index.ts
│ │ ├── initServices.ts
│ │ ├── models
│ │ │ ├── api
│ │ │ │ ├── IDataResponse.ts
│ │ │ │ ├── IResponse.ts
│ │ │ │ └── v0
│ │ │ │ │ ├── IFetchRequest.ts
│ │ │ │ │ ├── IFetchResponse.ts
│ │ │ │ │ ├── IPublishRequest.ts
│ │ │ │ │ └── IPublishResponse.ts
│ │ │ ├── app
│ │ │ │ ├── IHttpRequest.ts
│ │ │ │ ├── IHttpResponse.ts
│ │ │ │ └── IRoute.ts
│ │ │ └── configuration
│ │ │ │ └── IConfiguration.ts
│ │ ├── routes.ts
│ │ ├── routes
│ │ │ └── v0
│ │ │ │ ├── fetch.ts
│ │ │ │ └── publish.ts
│ │ └── utils
│ │ │ ├── apiHelper.ts
│ │ │ └── validationHelper.ts
│ ├── test
│ │ ├── docs.http
│ │ ├── example.js
│ │ ├── fetch.http
│ │ ├── publish.http
│ │ └── version.http
│ └── tsconfig.json
├── browser
│ └── index.html
├── listen
│ ├── index.js
│ ├── package-lock.json
│ └── package.json
├── simple-json
│ ├── index.js
│ ├── package-lock.json
│ └── package.json
└── simple
│ ├── index.js
│ ├── package-lock.json
│ └── package.json
├── jest.config.js
├── package-lock.json
├── package.json
├── rollup.config.js
├── src
├── index-browser.ts
├── index-node.ts
├── index.ts
├── mam
│ ├── channel.ts
│ ├── client.ts
│ └── parser.ts
├── merkle
│ ├── merkleHashGenerator.ts
│ ├── merkleNode.ts
│ └── merkleTree.ts
├── models
│ ├── IMamChannelState.ts
│ ├── IMamFetchedMessage.ts
│ ├── IMamMessage.ts
│ └── mamMode.ts
├── pearlDiver
│ ├── hammingDiver.ts
│ └── pearlDiverSearchStates.ts
├── signing
│ └── iss-p27.ts
└── utils
│ ├── arrayHelper.ts
│ ├── guards.ts
│ ├── mask.ts
│ ├── pascal.ts
│ ├── textHelper.ts
│ └── trytesHelper.ts
├── test
├── mam
│ ├── channel.spec.ts
│ ├── createAndParse.spec.ts
│ └── parser.spec.ts
├── pearlDiver
│ └── hammingDiver.spec.ts
├── signing
│ └── iss-p27.spec.ts
└── utils
│ ├── mask.spec.ts
│ ├── pascal.spec.ts
│ ├── textHelper.spec.ts
│ └── trytesHelper.spec.ts
├── tsconfig.eslint.json
└── tsconfig.json
/.eslintignore:
--------------------------------------------------------------------------------
1 | .eslintrc.js
2 | rollup.config.js
3 | examples
4 | dist
5 |
6 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Community Code of Conduct
2 |
3 | In the IOTA community, participants from all over the world come together to create. This is made possible by the support, hard work and enthusiasm of thousands of people, including those who create and use the IOTA technology.
4 |
5 | This document offers some guidance to ensure IOTA participants can cooperate effectively in a positive and inspiring atmosphere, and to explain how together we can strengthen and support each other.
6 |
7 | This Code of Conduct is shared by all contributors and users who engage with the IOTA Foundation team and its community services.
8 |
9 | ## Overview
10 |
11 | This Code of Conduct presents a summary of the shared values and “common sense” thinking in our community. The basic social ingredients that hold our project together include:
12 |
13 | - Being considerate
14 | - Being respectful
15 | - Being collaborative
16 | - Being pragmatic
17 | - Supporting others in the community
18 | - Getting support from others in the community
19 |
20 | This Code of Conduct reflects the agreed standards of behavior for members of the IOTA community, in any social media platform, forum, mailing list, wiki, web site, discord channel, public meeting or private correspondence within the context of the IOTA Foundation team and the IOTA Tangle technology. The community acts according to the standards written down in this Code of Conduct and will defend these standards for the benefit of the community. Leaders of any group, such as moderators of social media groups, mailing lists, discord channels, forums, etc., will exercise the right to suspend access to any person who persistently breaks our shared Code of Conduct.
21 |
22 | ## Be considerate
23 |
24 | Your actions and work will affect and be used by other people and you, in turn, will depend on the work and actions of others. Any decision you take will affect other community members, and we expect you to take those consequences into account when making decisions.
25 |
26 | As a user, remember that community members work hard on their part of IOTA and take great pride in it.
27 |
28 | ## Be respectful
29 |
30 | In order for the IOTA community to stay healthy, its members must feel comfortable and accepted. Treating one another with respect is absolutely necessary for this. In a disagreement, in the first instance, assume that people mean well.
31 |
32 | We do not tolerate personal attacks, racism, sexism or any other form of discrimination. Disagreement is inevitable, from time to time, but respect for the views of others will go a long way to winning respect for your own view. Respecting other people, their work, their contributions and assuming well-meaning motivation will make community members feel comfortable and safe and will result in motivation and productivity.
33 |
34 | We expect members of our community to be respectful when dealing with other contributors, users, and communities. Remember that IOTA is an international project and that you may be unaware of important aspects of other cultures.
35 |
36 | ## Be collaborative
37 |
38 | Your feedback is important, as is its form. Poorly thought out comments can cause pain and the demotivation of other community members, but considerate discussion of problems can bring positive results. An encouraging word works wonders.
39 |
40 | ## Be pragmatic
41 |
42 | The IOTA community is pragmatic and fair. We value tangible results over having the last word in a discussion. We defend our core values like freedom and respectful collaboration, but we don’t let arguments about minor issues get in the way of achieving more important results. We are open to suggestions and welcome solutions regardless of their origin. When in doubt support a solution which helps to get things done over one which has theoretical merits, but isn’t being worked on. Use the tools and methods which help to get the job done. Let decisions be taken by those who do the work.
43 |
44 | ## Support others in the community
45 |
46 | The IOTA community is made strong by mutual respect, collaboration and pragmatic, responsible behavior. Sometimes there are situations where this has to be defended and other community members need help.
47 |
48 | If you witness others being attacked, think first about how you can offer them personal support. If you feel that the situation is beyond your ability to help individually, go privately to the victim and ask if some form of official intervention is needed.
49 |
50 | When problems do arise, consider respectfully reminding those involved of our shared Code of Conduct as a first action. Leaders are defined by their actions and can help set a good example by working to resolve issues in the spirit of this Code of Conduct before they escalate.
51 |
52 | ## Get support from others in the community
53 |
54 | Disagreements, both political and technical, happen all the time. Our community is no exception to the rule. The goal is not to avoid disagreements or differing views but to resolve them constructively. You should turn to the community to seek advice and to resolve disagreements and where possible consult the team most directly involved.
55 |
56 | Think deeply before turning a disagreement into a public dispute. If necessary, request mediation, and try to resolve differences in a less emotional medium. If you do feel that you or your work is being attacked, take your time to think things through before writing heated replies. Consider a 24-hour moratorium if emotional language is being used – a cooling-off period is sometimes all that is needed. If you really want to go a different way, then we encourage you to publish your ideas and your work, so that it can be tried and tested.
57 |
58 | This work, "IOTA Community Guidelines", is a derivative of the [Community code of conduct by ownCloud](https://owncloud.org/community/code-of-conduct/), used under [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/). "IOTA Community Guidelines" is licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) by IOTA Foundation.
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contribute to the JavaScript MAM library
2 |
3 | This document describes how to contribute to the JavaScript MAM library.
4 |
5 | We encourage everyone with knowledge of IOTA technology to contribute.
6 |
7 | Thanks! :heart:
8 |
9 |
10 | Do you have a question :question:
11 |
12 |
13 | If you have a general or technical question, you can use one of the following resources instead of submitting an issue:
14 |
15 | - [**Developer documentation:**](https://docs.iota.org/) For official information about developing with IOTA technology
16 | - [**Discord:**](https://discord.iota.org/) For real-time chats with the developers and community members
17 | - [**IOTA cafe:**](https://iota.cafe/) For technical discussions with the Research and Development Department at the IOTA Foundation
18 | - [**StackExchange:**](https://iota.stackexchange.com/) For technical and troubleshooting questions
19 |
20 |
21 |
22 |
23 |
24 | Ways to contribute :mag:
25 |
26 |
27 | To contribute to the JavaScript MAM library on GitHub, you can:
28 |
29 | - Report a bug
30 | - Suggest a new feature
31 | - Build a new feature
32 | - Contribute to the documentation
33 |
34 |
35 |
36 |
37 |
38 | Report a bug :bug:
39 |
40 |
41 | This section guides you through reporting a bug. Following these guidelines helps maintainers and the community understand the bug, reproduce the behavior, and find related bugs.
42 |
43 | ### Before reporting a bug
44 |
45 | Please check the following list:
46 |
47 | - **Do not open a GitHub issue for [security vulnerabilities](SECURITY.MD)**, instead, please contact us at [security@iota.org](mailto:security@iota.org).
48 |
49 | - **Ensure the bug was not already reported** by searching on GitHub under [**Issues**](https://github.com/iotaledger/mam.js/issues). If the bug has already been reported **and the issue is still open**, add a comment to the existing issue instead of opening a new one. You can also find related issues by their [label](https://github.com/iotaledger/mam.js/labels?page=1&sort=name-asc).
50 |
51 | **Note:** If you find a **Closed** issue that seems similar to what you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
52 |
53 | ### Submitting A Bug Report
54 |
55 | To report a bug, [open a new issue](https://github.com/iotaledger/mam.js/issues/new), and be sure to include as many details as possible, using the template.
56 |
57 | **Note:** Minor changes such as fixing a typo can but do not need an open issue.
58 |
59 | If you also want to fix the bug, submit a [pull request](#pull-requests) and reference the issue.
60 |
61 |
62 |
63 |
64 |
65 | Suggest a new feature :bulb:
66 |
67 |
68 | This section guides you through suggesting a new feature. Following these guidelines helps maintainers and the community collaborate to find the best possible way forward with your suggestion.
69 |
70 | ### Before suggesting a new feature
71 |
72 | **Ensure the feature has not already been suggested** by searching on GitHub under [**Issues**](https://github.com/iotaledger/mam.js/issues).
73 |
74 | ### Suggesting a new feature
75 |
76 | To suggest a new feature, talk to the IOTA community and IOTA Foundation members on [Discord](https://discord.iota.org/).
77 |
78 | If the team members approves your feature, they will create an issue for it.
79 |
80 |
81 |
82 |
83 |
84 | Build a new feature :hammer:
85 |
86 |
87 | This section guides you through building a new feature. Following these guidelines helps give your feature the best chance of being approved and merged.
88 |
89 | ### Before building a new feature
90 |
91 | Make sure to discuss the feature with the developers on [Discord](https://discord.iota.org/).
92 |
93 | Otherwise, your feature may not be approved at all.
94 |
95 | ### Building a new feature
96 |
97 | To build a new feature, check out a new branch based on the `next` branch, and be sure to consider the following:
98 |
99 | - If the feature has a public facing API, make sure to document it, using [JSDoc](https://jsdoc.app/) code comments
100 |
101 |
102 |
103 |
104 |
105 |
106 | Contribute to the documentation :black_nib:
107 |
108 |
109 | The JavaScript MAM library documentation is hosted on https://docs.iota.org, which is built from content in the [documentation](https://github.com/iotaledger/documentation) repository.
110 |
111 | Please see the [guidelines](https://github.com/iotaledger/documentation/CONTRIBUTING.md) on the documentation repository for information on how to contribute to the documentation.
112 |
113 |
114 |
115 |
116 |
117 | Pull requests :mega:
118 |
119 |
120 | This section guides you through submitting a pull request (PR). Following these guidelines helps give your PR the best chance of being approved and merged.
121 |
122 | ### Before submitting a pull request
123 |
124 | When creating a pull request, please follow these steps to have your contribution considered by the maintainers:
125 |
126 | - A pull request should have only one concern (for example one feature or one bug). If a PR addresses more than one concern, it should be split into two or more PRs.
127 |
128 | - A pull request can be merged only if it references an open issue
129 |
130 | **Note:** Minor changes such as fixing a typo can but do not need an open issue.
131 |
132 | - All code should be well tested
133 |
134 | ### Submitting a pull request
135 |
136 | The following is a typical workflow for submitting a new pull request:
137 |
138 | 1. Fork this repository
139 | 2. Create a new branch based on your fork
140 | 3. Commit changes and push them to your fork
141 | 4. Create a pull request against the `next` branch
142 |
143 | If all [status checks](https://help.github.com/articles/about-status-checks/) pass, and the maintainer approves the PR, it will be merged.
144 |
145 | **Note:** Reviewers may ask you to complete additional work, tests, or other changes before your pull request can be approved and merged.
146 |
147 |
148 |
149 |
150 |
151 | Code of Conduct :clipboard:
152 |
153 |
154 | This project and everyone participating in it is governed by the [IOTA Code of Conduct](CODE_OF_CONDUCT.md).
155 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Report a bug in the JavaScript MAM library
3 | about: Report a bug
4 | labels: T - Bug
5 | ---
6 |
7 | ## Bug description
8 |
9 | Briefly describe the bug.
10 |
11 | ## Version
12 |
13 | Which version of the library are you running?
14 |
15 | - Version:
16 |
17 | ## IOTA network
18 |
19 | Which node are you connected to and which IOTA network is it in?
20 |
21 | - Node URL:
22 | - Network:
23 |
24 | ## Hardware specification
25 |
26 | What hardware are you using?
27 |
28 | - Operating system:
29 | - RAM:
30 | - Number of cores:
31 | - Device type:
32 |
33 | ## Steps To reproduce the bug
34 |
35 | Explain how the maintainer can reproduce the bug.
36 |
37 | 1.
38 | 2.
39 | 3.
40 |
41 | ## Expected behaviour
42 |
43 | Describe what you expect to happen.
44 |
45 | ## Actual behaviour
46 |
47 | Describe what actually happens.
48 |
49 | ## Errors
50 |
51 | Paste any errors that you see.
52 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Discord
4 | url: https://discord.iota.org/
5 | about: Please ask and answer questions here.
6 | - name: Security vulnerabilities
7 | url: security@iota.org
8 | about: Please report security vulnerabilities here.
9 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Request a feature for the JavaScript MAM library
3 | about: Request a feature
4 | ---
5 |
6 | ## Description
7 |
8 | Briefly describe the feature that you are requesting.
9 |
10 | ## Motivation
11 |
12 | Explain why this feature is needed.
13 |
14 | ## Requirements
15 |
16 | Write a list of what you want this feature to do.
17 |
18 | 1.
19 | 2.
20 | 3.
21 |
22 | ## Open questions (optional)
23 |
24 | Use this section to ask any questions that are related to the feature.
25 |
26 | ## Are you planning to do it yourself in a pull request?
27 |
28 | Yes/No.
29 |
--------------------------------------------------------------------------------
/.github/SECURITY.md:
--------------------------------------------------------------------------------
1 | Responsible disclosure policy
2 |
3 | At the IOTA Foundation, we consider the security of our systems a top priority. But no matter how much effort we put into system security, there can still be vulnerabilities present. If you've discovered a vulnerability, please follow the guidelines below to report it to our security team:
4 |
5 | - E-mail your findings to security@iota.org. If the report contains highly sensitive information, please consider encrypting your findings using our contact@iota.org (466385BD0B40D9550F93C04746A440CCE5664A64) PGP key.
6 |
7 | Please follow these rules when testing/reporting vulnerabilities:
8 |
9 | - Do not take advantage of the vulnerability you have discovered, for example by downloading more data than is necessary to demonstrate the vulnerability.
10 | - Do not read, modify or delete data that isn't your own.
11 | - We ask that you do not to disclosure the problem to third parties until it has been resolved.
12 | - The scope of the program is limited to technical vulnerabilities in IOTA Foundations's web applications and open source software packages distributed through GitHub, please do not try to test physical security or attempt phishing attacks against our employees, and so on.
13 | - Out of concern for the availability of our services to all users, please do not attempt to carry out DoS attacks, leverage black hat SEO techniques, spam people, and do other similarly questionable things. We also discourage the use of any vulnerability testing tools that automatically generate significant volumes of traffic.
14 |
15 | What we promise:
16 |
17 | - We will respond to your report within 3 business days with our evaluation of the report and an expected resolution date.
18 | - If you have followed the instructions above, we will not take any legal action against you in regard to the report.
19 | - We will keep you informed during all stages of resolving the problem.
20 | - To show our appreciation for your effort and cooperation during the report, we will list your name and a link to a personal website/social network profile on the page below so that the public can know you've helped keep the IOTA Foundation secure.
21 |
22 | We sincerely appreciate the efforts of security researchers in keeping our community safe.
23 |
24 |
--------------------------------------------------------------------------------
/.github/SUPPORT.md:
--------------------------------------------------------------------------------
1 | # Community resources
2 |
3 | If you have a general or technical question, you can use one of the following resources instead of submitting an issue:
4 |
5 | - [**Developer documentation:**](https://docs.iota.org/) For official information about developing with IOTA technology
6 | - [**Discord:**](https://discord.iota.org/) For real-time chats with the developers and community members
7 | - [**IOTA cafe:**](https://iota.cafe/) For technical discussions with the Research and Development Department at the IOTA Foundation
8 | - [**StackExchange:**](https://iota.stackexchange.com/) For technical and troubleshooting questions
--------------------------------------------------------------------------------
/.github/codeql/codeql-config.yml:
--------------------------------------------------------------------------------
1 | name: "CodeQL Config"
2 |
3 | queries:
4 | - uses: security-and-quality
5 | paths:
6 | - src
7 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: npm
4 | directory: "/"
5 | schedule:
6 | interval: weekly
7 | day: wednesday
8 | time: "06:00"
9 | timezone: Europe/Berlin
10 | labels:
11 | - dependencies
12 | versioning-strategy: increase
13 | ignore:
14 | - dependency-name: "node-fetch"
15 | versions: ["3.x", "4.x"]
16 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | # Description of change
2 |
3 | Please write a summary of your changes and why you made them. Be sure to reference any related issues by adding `fixes # (issue)`.
4 |
5 | ## Type of change
6 |
7 | Choose a type of change, and delete any options that are not relevant.
8 |
9 | - Bug fix (a non-breaking change which fixes an issue)
10 | - Enhancement (a non-breaking change which adds functionality)
11 | - Breaking change (fix or feature that would cause existing functionality to not work as expected)
12 | - Documentation Fix
13 |
14 | ## How the change has been tested
15 |
16 | Describe the tests that you ran to verify your changes.
17 |
18 | Make sure to provide instructions for the maintainer as well as any relevant configurations.
19 |
20 | ## Change checklist
21 |
22 | Add an `x` to the boxes that are relevant to your changes, and delete any items that are not.
23 |
24 | - [] My code follows the contribution guidelines for this project
25 | - [] I have performed a self-review of my own code
26 | - [] I have commented my code, particularly in hard-to-understand areas
27 | - [] I have made corresponding changes to the documentation
28 | - [] I have added tests that prove my fix is effective or that my feature works
29 | - [] New and existing unit tests pass locally with my changes
30 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Library Build Main/Develop
2 |
3 | on:
4 | push:
5 | branches: [main, dev]
6 | paths:
7 | - "src/**"
8 | - ".github/workflows/build.yml"
9 | pull_request:
10 | branches: [dev]
11 | paths:
12 | - "src/**"
13 | - ".github/workflows/build.yml"
14 |
15 |
16 | jobs:
17 | build:
18 | runs-on: ubuntu-latest
19 |
20 | steps:
21 | - uses: actions/checkout@v2
22 | - name: Use Node.js 12.x
23 | uses: actions/setup-node@v1
24 | with:
25 | node-version: "12"
26 | - name: Client Build
27 | run: |
28 | npm install
29 | npm run dist
30 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | name: "CodeQL"
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | - dev
8 | paths:
9 | - 'src/**'
10 | - '.github/codeql/**'
11 | - '.github/workflows/codeql-analysis.yml'
12 | pull_request:
13 | paths:
14 | - 'src/**'
15 | - '.github/codeql/**'
16 | - '.github/workflows/codeql-analysis.yml'
17 | schedule:
18 | - cron: '0 0 * * *'
19 |
20 | jobs:
21 | CodeQL-Build:
22 | runs-on: ubuntu-latest
23 |
24 | steps:
25 | - name: Checkout repository
26 | uses: actions/checkout@v2
27 | with:
28 | fetch-depth: 2
29 |
30 | - run: git checkout HEAD^2
31 | if: ${{ github.event_name == 'pull_request' }}
32 |
33 | - name: Initialize CodeQL
34 | uses: github/codeql-action/init@v1
35 | with:
36 | languages: javascript
37 | config-file: ./.github/codeql/codeql-config.yml
38 |
39 | - name: Perform CodeQL Analysis
40 | uses: github/codeql-action/analyze@v1
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .history
2 | node_modules
3 | coverage
4 | channelState.json
5 | dist
6 | es
7 | typings
8 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## v1.6.3
4 |
5 | * Fix mjs exports for browser
6 |
7 | ## v1.6.2
8 |
9 | * Update iota.js dependencies to use new individual packages for some classes
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2020 IOTA Stiftung
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # mam.js
2 |
3 | > We strongly advise that you update your apps to use [IOTA Streams](https://github.com/iotaledger/streams) - this package is unlikely to be maintained.
4 |
5 | Implementation of Masked Authentication Messaging v0 for IOTA in JavaScript, for use with IOTA network.
6 |
7 | ## Installing
8 |
9 | Install this package using the following commands:
10 |
11 | ```shell
12 | npm install @iota/mam.js
13 | ```
14 |
15 | If you want to use this module in a browser `
11 |
12 |
13 |
119 |