starknet 0.1.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/.babelrc +6 -0
  2. package/.commitlintrc +12 -0
  3. package/.eslintignore +2 -0
  4. package/.eslintrc +20 -0
  5. package/.github/workflows/pr.yml +23 -0
  6. package/.github/workflows/release.yml +40 -0
  7. package/.husky/commit-msg +4 -0
  8. package/.husky/pre-commit +4 -0
  9. package/{.prettierrc.json → .prettierrc} +0 -1
  10. package/.releaserc +28 -0
  11. package/CHANGELOG.md +49 -0
  12. package/CONTRIBUTING.md +52 -0
  13. package/README.md +39 -11
  14. package/__mocks__/ArgentAccount.json +92620 -0
  15. package/__tests__/__snapshots__/utils.browser.test.ts.snap +5 -0
  16. package/__tests__/__snapshots__/utils.test.ts.snap +5 -0
  17. package/__tests__/index.test.ts +49 -4
  18. package/__tests__/utils.browser.test.ts +30 -0
  19. package/__tests__/utils.test.ts +35 -0
  20. package/constants.d.ts +3 -0
  21. package/constants.js +9 -0
  22. package/dist/constants.d.ts +3 -0
  23. package/dist/constants.js +6 -0
  24. package/dist/index.d.ts +23 -9
  25. package/dist/index.js +51 -5
  26. package/dist/types.d.ts +89 -0
  27. package/dist/types.js +2 -0
  28. package/dist/utils.d.ts +21 -0
  29. package/dist/utils.js +44 -0
  30. package/docs/README.md +235 -0
  31. package/index.d.ts +115 -0
  32. package/index.js +261 -0
  33. package/package.json +29 -5
  34. package/src/constants.ts +3 -0
  35. package/src/index.ts +67 -21
  36. package/src/types.ts +95 -0
  37. package/src/utils.ts +44 -0
  38. package/tsconfig.eslint.json +4 -0
  39. package/tsconfig.json +15 -13
  40. package/types.d.ts +94 -0
  41. package/types.js +2 -0
  42. package/utils.d.ts +29 -0
  43. package/utils.js +62 -0
  44. package/.eslintrc.json +0 -26
  45. package/babel.config.js +0 -3
  46. package/dist/__tests__/index.test.d.ts +0 -1
  47. package/dist/__tests__/index.test.js +0 -49
  48. package/docs/Home.md +0 -220
  49. package/docs/_Sidebar.md +0 -3
package/.babelrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "presets": [
3
+ ["@babel/preset-env", { "targets": { "node": "current" } }],
4
+ "@babel/preset-typescript"
5
+ ]
6
+ }
package/.commitlintrc ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": [
3
+ "@commitlint/config-conventional"
4
+ ],
5
+ "rules": {
6
+ "body-max-line-length": [
7
+ 0,
8
+ "always",
9
+ 100
10
+ ]
11
+ }
12
+ }
package/.eslintignore ADDED
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ dist/
package/.eslintrc ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true,
5
+ "node": true,
6
+ "jest": true
7
+ },
8
+ "extends": ["airbnb-base", "airbnb-typescript/base", "prettier", "plugin:prettier/recommended", ],
9
+ "globals": {
10
+ "Atomics": "readonly",
11
+ "SharedArrayBuffer": "readonly"
12
+ },
13
+ "parser": "@typescript-eslint/parser",
14
+ "parserOptions": {
15
+ "ecmaVersion": 12,
16
+ "sourceType": "module",
17
+ "project": "./tsconfig.eslint.json"
18
+ },
19
+ "plugins": ["@typescript-eslint"]
20
+ }
@@ -0,0 +1,23 @@
1
+ name: PR check
2
+ on:
3
+ pull_request:
4
+ branches:
5
+ - main
6
+ - develop
7
+
8
+ jobs:
9
+ build-and-test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ node-version:
14
+ - 14.x
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Use Node.js ${{ matrix.node-version }}
18
+ uses: actions/setup-node@v2
19
+ with:
20
+ node-version: ${{ matrix.node-version }}
21
+ - run: npm ci
22
+ - run: npm run build --if-present
23
+ - run: npm test
@@ -0,0 +1,40 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ - develop
7
+ jobs:
8
+ build-and-test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - name: Use Node.js 14
13
+ uses: actions/setup-node@v2
14
+ with:
15
+ node-version: lts/*
16
+ - run: npm ci
17
+ - run: npm run build --if-present
18
+ - run: npm test
19
+ - uses: actions/upload-artifact@v2
20
+ with:
21
+ name: build
22
+ path: dist
23
+ release:
24
+ name: Release
25
+ runs-on: ubuntu-latest
26
+ needs: [build-and-test]
27
+ steps:
28
+ - uses: actions/checkout@v2
29
+ - uses: actions/setup-node@v2
30
+ with:
31
+ node-version: lts/*
32
+ - run: npm ci
33
+ - run: npm run docs
34
+ - uses: actions/download-artifact@v2
35
+ with:
36
+ name: build
37
+ - env:
38
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40
+ run: npx semantic-release
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx --no-install commitlint --edit "$1"
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -2,6 +2,5 @@
2
2
  "printWidth": 100,
3
3
  "tabWidth": 2,
4
4
  "singleQuote": true,
5
- "jsxBracketSameLine": true,
6
5
  "trailingComma": "es5"
7
6
  }
package/.releaserc ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "branches": [
3
+ "main",
4
+ {
5
+ "name": "develop",
6
+ "channel": "next"
7
+ }
8
+ ],
9
+ "plugins": [
10
+ "@semantic-release/commit-analyzer",
11
+ "@semantic-release/release-notes-generator",
12
+ "@semantic-release/changelog",
13
+ "@semantic-release/npm",
14
+ [
15
+ "@semantic-release/git",
16
+ {
17
+ "assets": [
18
+ "docs/README.md",
19
+ "package.json",
20
+ "CHANGELOG.md"
21
+ ],
22
+ "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
23
+ }
24
+ ],
25
+ "@semantic-release/github"
26
+ ],
27
+ "repositoryUrl": "https://github.com/seanjameshan/starknet.js"
28
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ ## [1.1.1](https://github.com/seanjameshan/starknet.js/compare/v1.1.0...v1.1.1) (2021-10-24)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **.gitignore:** remove docs from gitignore ([a4c19ad](https://github.com/seanjameshan/starknet.js/commit/a4c19ad9f9f2c30fc6c7a931645a19610ee15b5d))
6
+ - **gh-action:** add token in actions/checkout ([730f605](https://github.com/seanjameshan/starknet.js/commit/730f605a96d87bbe6606aff958d88151ad8b98db))
7
+ - **gh-action:** add token to bypass protected branch ([8b026ab](https://github.com/seanjameshan/starknet.js/commit/8b026abefdfb7ecdad92ce975dc777761d0bd9ce))
8
+ - **gh-action:** fix action syntax ([f88a476](https://github.com/seanjameshan/starknet.js/commit/f88a47652732d0d1cb5b47f8531fefe7ba5b646b))
9
+ - **gh-action:** fix commit message to lowercase ([82177e6](https://github.com/seanjameshan/starknet.js/commit/82177e6dc32f02e836a19f2c7f5585eefd1fec9e))
10
+ - **gh-action:** fix untracked files ([aba492e](https://github.com/seanjameshan/starknet.js/commit/aba492efbaae51a8d9f5f52474c75f0d346a91a2))
11
+ - **gh-action:** force add readme ([3175e08](https://github.com/seanjameshan/starknet.js/commit/3175e08ca2f30f23ecb763eee9a2f2353061ecca))
12
+ - **typedoc:** github action to push typedoc to github ([4573d19](https://github.com/seanjameshan/starknet.js/commit/4573d19fe55e1245f66ed5c501154151592e8951))
13
+
14
+ # [1.1.0](https://github.com/seanjameshan/starknet.js/compare/v1.0.0...v1.1.0) (2021-10-24)
15
+
16
+ ### Bug Fixes
17
+
18
+ - btoa isomorphic ([f3eb0f5](https://github.com/seanjameshan/starknet.js/commit/f3eb0f5aa01647c0994935b72b723bd13f940faa))
19
+ - json formatting and deploy ([0fe7e3d](https://github.com/seanjameshan/starknet.js/commit/0fe7e3d50c4ebcbc64f30611b1888c966452c910))
20
+ - pr review ([457a852](https://github.com/seanjameshan/starknet.js/commit/457a85266de6cd548a15af1dc866671f3664f418))
21
+ - test ([c307390](https://github.com/seanjameshan/starknet.js/commit/c3073902e838bd9e07f783c13e546e298356e16b))
22
+ - test browser and node ([4c23de0](https://github.com/seanjameshan/starknet.js/commit/4c23de0ef510724fa33e1c3cbb00bc638acb54c2))
23
+ - test structure ([b686f04](https://github.com/seanjameshan/starknet.js/commit/b686f04dc5f74e6042cbd30ec56eeb4ef6b9c45b))
24
+ - tests regarding compressing ([21a83f2](https://github.com/seanjameshan/starknet.js/commit/21a83f25bbb88875854ad3d0cb5f7c7fa1ebacd4))
25
+ - update package-lock ([cd373cb](https://github.com/seanjameshan/starknet.js/commit/cd373cbd8df98f3d973e4076f15681927325c9e2))
26
+
27
+ ### Features
28
+
29
+ - add deploy ([509fa84](https://github.com/seanjameshan/starknet.js/commit/509fa84532ab5a1a46863edbe63d7538ddacfbc8))
30
+
31
+ # 1.0.0 (2021-10-21)
32
+
33
+ ### Bug Fixes
34
+
35
+ - badge ([6a0a989](https://github.com/seanjameshan/starknet.js/commit/6a0a9893c1298a815aec21abda20f78ac697a4bf))
36
+ - ci git push ([571b1d5](https://github.com/seanjameshan/starknet.js/commit/571b1d5092ee18b9ed0828f1cbc834f4aece3363))
37
+ - ci job ([31d1b8d](https://github.com/seanjameshan/starknet.js/commit/31d1b8d7717145a5dd7beef606a9c253d1ceb62d))
38
+ - naming pipeline ([f16427f](https://github.com/seanjameshan/starknet.js/commit/f16427f8a33b46a51d37ad7fbe8a3f34edcf344e))
39
+ - pipeline ([f9186de](https://github.com/seanjameshan/starknet.js/commit/f9186de8f72d80d212317d8c823b981b7df31920))
40
+ - pipeline ([c7d56d0](https://github.com/seanjameshan/starknet.js/commit/c7d56d06644108d71e1bea3e73554b5c4178b82e))
41
+ - pipeline ([d46d175](https://github.com/seanjameshan/starknet.js/commit/d46d175aa9d51f283e2dd9aeeac41ab50fa3ac2e))
42
+ - split pipelines ([e862cfb](https://github.com/seanjameshan/starknet.js/commit/e862cfbf13d9e6d3509b609a31f8ebad1a31569a))
43
+ - tests ([6a242ce](https://github.com/seanjameshan/starknet.js/commit/6a242cedc0a261c55a433ee5a82f0acf28cfcdc2))
44
+
45
+ ### Features
46
+
47
+ - change src code ([5fe4630](https://github.com/seanjameshan/starknet.js/commit/5fe4630a53a75c0387854b1cd53e5aa2c6b259eb))
48
+ - project tooling ([eee89aa](https://github.com/seanjameshan/starknet.js/commit/eee89aa92cab7b7df3a9a7ae439c4df7d1e893b0))
49
+ - start adding types ([3760687](https://github.com/seanjameshan/starknet.js/commit/3760687a0c72da7ac8c0fd2427d471fe4bdf7202))
@@ -0,0 +1,52 @@
1
+ # How to contribute
2
+
3
+ We love pull requests. And following this guidelines will make your pull request easier to merge.
4
+
5
+ If you want to contribute but don’t know what to do, take a look at these two labels: [help wanted](https://github.com/seanjameshan/starknet/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [good first issue](https://github.com/seanjameshan/starknet/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
6
+
7
+ _[Use GitHub interface](https://blog.sapegin.me/all/open-source-for-everyone/) for simple documentation changes, otherwise follow the steps below._
8
+
9
+ ## Prerequisites
10
+
11
+ - If it’s your first pull request, watch [this amazing course](http://makeapullrequest.com/) by [Kent C. Dodds](https://twitter.com/kentcdodds).
12
+ - Fork the repository and clone your fork.
13
+ - Install dependencies: `npm install`.
14
+
15
+ ## Development workflow
16
+
17
+ ALways start from `develop` branch and merge back to `develop` branch.
18
+
19
+ To build you changes run:
20
+
21
+ ```bash
22
+ npm build
23
+ ```
24
+
25
+ Run linters and tests:
26
+
27
+ ```bash
28
+ npm test
29
+ ```
30
+
31
+ Or run tests in watch mode:
32
+
33
+ ```bash
34
+ npm run test --watch
35
+ ```
36
+
37
+ **Don’t forget to add tests and update documentation for your changes.**
38
+ Documentation can be archived by using JSDoc.
39
+
40
+ **Please update npm lock file (`package-lock.json`) if you add or update dependencies.**
41
+
42
+ ## Other notes
43
+
44
+ - If you have commit access to repository and want to make big change or not sure about something, make a new branch and open pull request.
45
+ - We’re using [Prettier](https://github.com/prettier/prettier) to format code, so don’t worry much about code formatting.
46
+ - Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), like so: `feat(scope): topic`
47
+ - Don’t commit generated files, like minified JavaScript.
48
+ - Don’t change version number and changelog.
49
+
50
+ ## Need help?
51
+
52
+ If you want to contribute but have any questions, concerns or doubts, feel free to ping maintainers. Ideally create a pull request with `WIP` (Work in progress) in its title and ask questions in the pull request description.
package/README.md CHANGED
@@ -8,21 +8,42 @@
8
8
 
9
9
  <!-- primary badges -->
10
10
  <p align="center">
11
- <img src='https://img.shields.io/github/package-json/v/seanjameshan/starknet.js?label=npm' />
12
- <img src='https://img.shields.io/bundlephobia/minzip/starknet?color=success&label=size' />
13
- <!-- <img src='https://img.shields.io/npm/dt/starknet?color=blueviolet' /> -->
14
- <img src="https://img.shields.io/badge/license-MIT-black">
15
- <img src='https://img.shields.io/github/stars/seanjameshan/starknet.js?color=yellow' />
16
- <img src='https://img.shields.io/github/followers/seanjameshan?color=red' />
17
- <img src="https://img.shields.io/badge/powered_by-StarkWare-navy">
11
+ <a href="https://github.com/seanjameshan/starknet.js/actions">
12
+ <img src="https://img.shields.io/github/workflow/status/seanjameshan/starknet.js/Release">
13
+ </a>
14
+ <a href="https://www.npmjs.com/package/starknet">
15
+ <img src='https://img.shields.io/npm/v/starknet' />
16
+ </a>
17
+ <a href="https://www.npmjs.com/package/starknet">
18
+ <img src='https://img.shields.io/npm/v/starknet/next' />
19
+ </a>
20
+ <a href="https://bundlephobia.com/package/starknet">
21
+ <img src='https://img.shields.io/bundlephobia/minzip/starknet?color=success&label=size' />
22
+ </a>
23
+ <a href="https://www.npmjs.com/package/starknet">
24
+ <img src='https://img.shields.io/npm/dt/starknet?color=blueviolet' />
25
+ </a>
26
+ <a href="https://github.com/seanjameshan/starknet.js/blob/main/LICENSE/">
27
+ <img src="https://img.shields.io/badge/license-MIT-black">
28
+ </a>
29
+ <a href="https://github.com/seanjameshan/starknet.js/stargazers">
30
+ <img src='https://img.shields.io/github/stars/seanjameshan/starknet.js?color=yellow' />
31
+ </a>
32
+ <a href="https://starkware.co/">
33
+ <img src="https://img.shields.io/badge/powered_by-StarkWare-navy">
34
+ </a>
18
35
  </p>
19
36
 
20
37
  ## 🕹️ Usage
21
- Install the starknet with `npm`
38
+
39
+ Install starknet with `npm`
40
+
22
41
  ```bash
23
42
  $ npm install starknet
24
43
  ```
25
- Import `starknet` and use the [API](https://github.com/seanjameshan/starknet.js/blob/main/docs)
44
+
45
+ Import `starknet` and use the [API](docs)
46
+
26
47
  ```javascript
27
48
  import starknet from 'starknet';
28
49
 
@@ -32,8 +53,15 @@ starknet.getContractAddresses().then((data) => {
32
53
  ```
33
54
 
34
55
  ## 🌐 API
35
- [Click Here](https://github.com/seanjameshan/starknet.js/blob/main/docs/Home.md)
56
+
57
+ [Click Here](docs)
58
+
59
+ ## Contributing
60
+
61
+ If you consider to contribute to this project please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
36
62
 
37
63
  ## License
64
+
38
65
  Copyright (c) 2021 Sean James Han
39
- Licensed under the MIT license.
66
+
67
+ Licensed under the [MIT license](LICENSE).