@nexusmutual/sdk 0.0.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 (44) hide show
  1. package/.github/workflows/merge-master.yml +124 -0
  2. package/.github/workflows/pull_request.yml +62 -0
  3. package/README.md +32 -0
  4. package/dist/contracts/abis/Assessment.json +700 -0
  5. package/dist/contracts/abis/Cover.json +1258 -0
  6. package/dist/contracts/abis/CoverMigrator.json +189 -0
  7. package/dist/contracts/abis/CoverNFT.json +498 -0
  8. package/dist/contracts/abis/CoverNFTDescriptor.json +200 -0
  9. package/dist/contracts/abis/CoverViewer.json +124 -0
  10. package/dist/contracts/abis/EACAggregatorProxy.json +58 -0
  11. package/dist/contracts/abis/ERC20.json +364 -0
  12. package/dist/contracts/abis/Governance.json +975 -0
  13. package/dist/contracts/abis/IndividualClaims.json +528 -0
  14. package/dist/contracts/abis/LegacyClaimProofs.json +64 -0
  15. package/dist/contracts/abis/LegacyClaimsData.json +1912 -0
  16. package/dist/contracts/abis/LegacyClaimsReward.json +179 -0
  17. package/dist/contracts/abis/LegacyGateway.json +542 -0
  18. package/dist/contracts/abis/LegacyPooledStaking.json +1320 -0
  19. package/dist/contracts/abis/LegacyQuotationData.json +1121 -0
  20. package/dist/contracts/abis/MCR.json +326 -0
  21. package/dist/contracts/abis/MemberRoles.json +681 -0
  22. package/dist/contracts/abis/NXMToken.json +498 -0
  23. package/dist/contracts/abis/NXMaster.json +501 -0
  24. package/dist/contracts/abis/Pool.json +928 -0
  25. package/dist/contracts/abis/PriceFeedOracle.json +122 -0
  26. package/dist/contracts/abis/ProductsV1.json +21 -0
  27. package/dist/contracts/abis/ProposalCategory.json +550 -0
  28. package/dist/contracts/abis/StakingNFT.json +569 -0
  29. package/dist/contracts/abis/StakingNFTDescriptor.json +222 -0
  30. package/dist/contracts/abis/StakingPool.json +1433 -0
  31. package/dist/contracts/abis/StakingPoolFactory.json +108 -0
  32. package/dist/contracts/abis/StakingProducts.json +885 -0
  33. package/dist/contracts/abis/StakingViewer.json +777 -0
  34. package/dist/contracts/abis/SwapOperator.json +754 -0
  35. package/dist/contracts/abis/TokenController.json +1024 -0
  36. package/dist/contracts/abis/YieldTokenIncidents.json +438 -0
  37. package/dist/contracts/abis/index.js +69 -0
  38. package/dist/contracts/addresses.json +35 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.js +13 -0
  41. package/dist/products/product-logos.json +103 -0
  42. package/dist/products/product-types.json +58 -0
  43. package/dist/products/products.json +1414 -0
  44. package/package.json +50 -0
@@ -0,0 +1,124 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ env:
9
+ NODE_VERSION: '18'
10
+ CACHE_KEY: ${{ secrets.CACHE_KEY }} # Change to bust caches
11
+
12
+ jobs:
13
+ version:
14
+ runs-on: ubuntu-22.04
15
+ outputs:
16
+ local_version: ${{ steps.local_version.outputs.value }}
17
+ registry_version: ${{ steps.registry_version.outputs.value }}
18
+ steps:
19
+ - name: GitHub context
20
+ env:
21
+ GITHUB_CONTEXT: ${{ toJson(github) }}
22
+ run: echo "$GITHUB_CONTEXT"
23
+
24
+ - uses: actions/checkout@v3
25
+
26
+ - uses: actions/setup-node@v3
27
+ with:
28
+ node-version: ${{ env.NODE_VERSION }}
29
+
30
+ - name: Get local version
31
+ id: local_version
32
+ run: |
33
+ version=$(cat ./package.json | jq --raw-output .version)
34
+ echo $version
35
+ echo "value=$version" >> $GITHUB_OUTPUT
36
+
37
+ - name: Get registry version
38
+ id: registry_version
39
+ env:
40
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
41
+ run: |
42
+ package_name="$(cat ./package.json | jq --raw-output .name)"
43
+ echo $package_name
44
+ version=$(npm view $package_name version || echo "0.0.0")
45
+ echo $version
46
+ echo "value=$version" >> $GITHUB_OUTPUT
47
+
48
+ - name: Validate version
49
+ uses: actions/github-script@v6
50
+ with:
51
+ result-encoding: string
52
+ script: |
53
+ const local_version = '${{ steps.local_version.outputs.value }}';
54
+ const registry_version = '${{ steps.registry_version.outputs.value }}';
55
+ core.info(`Repository version: ${local_version}`);
56
+ core.info(`Registry version: ${registry_version}`);
57
+ if (registry_version === local_version) {
58
+ core.setFailed('Please bump version before merging');
59
+ }
60
+
61
+ build:
62
+ runs-on: ubuntu-22.04
63
+ needs: version
64
+ steps:
65
+ - uses: actions/checkout@v3
66
+
67
+ - uses: actions/setup-node@v3
68
+ with:
69
+ node-version: ${{ env.NODE_VERSION }}
70
+
71
+ - uses: actions/cache@v3
72
+ id: cache
73
+ with:
74
+ path: node_modules
75
+ key: ${{ runner.os }}-${{ env.CACHE_KEY }}-${{ hashFiles('package-lock.json') }}
76
+
77
+ - name: Install dependencies
78
+ if: steps.cache.outputs.cache-hit != 'true'
79
+ run: npm i
80
+
81
+ - run: npm run build
82
+
83
+ - uses: actions/upload-artifact@v3
84
+ with:
85
+ name: logos-${{ needs.version.outputs.local_version }}
86
+ path: dist
87
+
88
+ publish:
89
+ runs-on: ubuntu-22.04
90
+ needs: [version, build]
91
+ steps:
92
+ - uses: actions/checkout@v3
93
+
94
+ - uses: actions/setup-node@v3
95
+ with:
96
+ node-version: ${{ env.NODE_VERSION }}
97
+ registry-url: 'https://registry.npmjs.org'
98
+
99
+ - uses: actions/download-artifact@v3
100
+ with:
101
+ name: logos-${{ needs.version.outputs.local_version }}
102
+ path: dist
103
+
104
+ - name: Publish
105
+ env:
106
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
107
+ run: npm publish --access public
108
+
109
+ - name: Create release
110
+ uses: actions/github-script@v6
111
+ with:
112
+ github-token: '${{ github.token }}'
113
+ script: |
114
+ try {
115
+ const response = await github.rest.repos.createRelease({
116
+ name: "${{ needs.version.outputs.local_version }}",
117
+ owner: context.repo.owner,
118
+ repo: context.repo.repo,
119
+ tag_name: "${{ needs.version.outputs.local_version }}",
120
+ generate_release_notes: true,
121
+ });
122
+ } catch (error) {
123
+ core.setFailed(error.message);
124
+ }
@@ -0,0 +1,62 @@
1
+ name: pull-request
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize]
5
+
6
+ concurrency:
7
+ group: ${{ github.workflow }}-${{ github.ref }}
8
+ cancel-in-progress: true
9
+
10
+ env:
11
+ NODE_VERSION: "18"
12
+ CACHE_KEY: ${{ secrets.CACHE_KEY }} # Change to bust caches
13
+
14
+ jobs:
15
+ version:
16
+ runs-on: ubuntu-22.04
17
+ if: github.base_ref == 'master'
18
+ outputs:
19
+ local_version: ${{ steps.local_version.outputs.value }}
20
+ registry_version: ${{ steps.registry_version.outputs.value }}
21
+ steps:
22
+ - name: GitHub context
23
+ env:
24
+ GITHUB_CONTEXT: ${{ toJson(github) }}
25
+ run: echo "$GITHUB_CONTEXT"
26
+
27
+ - uses: actions/checkout@v3
28
+
29
+ - uses: actions/setup-node@v3
30
+ with:
31
+ node-version: ${{ env.NODE_VERSION }}
32
+
33
+ - name: Get local version
34
+ id: local_version
35
+ run: |
36
+ version=$(cat ./package.json | jq --raw-output .version)
37
+ echo $version
38
+ echo "value=$version" >> $GITHUB_OUTPUT
39
+
40
+ - name: Get registry version
41
+ id: registry_version
42
+ env:
43
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
44
+ run: |
45
+ package_name="$(cat ./package.json | jq --raw-output .name)"
46
+ echo $package_name
47
+ version=$(npm view $package_name version)
48
+ echo $version
49
+ echo "value=$version" >> $GITHUB_OUTPUT
50
+
51
+ - name: Validate version
52
+ uses: actions/github-script@v6
53
+ with:
54
+ result-encoding: string
55
+ script: |
56
+ const local_version = '${{ steps.local_version.outputs.value }}';
57
+ const registry_version = '${{ steps.registry_version.outputs.value }}';
58
+ core.info(`Repository version: ${local_version}`);
59
+ core.info(`Registry version: ${registry_version}`);
60
+ if (registry_version === local_version) {
61
+ core.setFailed('Please bump version before merging');
62
+ }
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Nexus Mutual SDK
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ npm install @nexusmutual/sdk
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ This package only exports CommonJS modules. You can import it like this:
12
+
13
+ ```js
14
+ // Usage with ES6 modules
15
+ import products from '@nexusmutual/sdk/products'
16
+ import productTypes from '@nexusmutual/sdk/product-types'
17
+ // logos?
18
+ ```
19
+
20
+ ## Nexus Mutual contract addresses and abis
21
+
22
+ Source of truth for the latest mainnet addresses. Feeds into https://api.nexusmutual.io/sdk/.
23
+
24
+ ## Listed products and product types metadata
25
+
26
+ The `products` folder contains all protocols listed on Nexus Mutual.
27
+
28
+ If you're a protocol owner and want to update any details (i.e. logo, website, etc), please submit a PR.
29
+ Logos should meet the following criteria:
30
+ - svg format, with 1:1 ratio
31
+ - no fixed width or height
32
+ - the image should reach the edge of the viewbox