@nexusmutual/sdk 0.7.0 → 0.7.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.
- package/README.md +37 -3
- package/dist/data/products.json +12 -12
- package/dist/index.d.mts +373 -358
- package/dist/index.d.ts +373 -358
- package/dist/index.js +5335 -5323
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5335 -5323
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -83,12 +83,12 @@ Use the `getQuoteAndBuyCoverInputs` function from `src/cover/getQuoteAndBuyCover
|
|
|
83
83
|
```typescript
|
|
84
84
|
import { CoverAsset, getQuoteAndBuyCoverInputs } from '@nexusmutual/sdk';
|
|
85
85
|
|
|
86
|
-
const productId =
|
|
86
|
+
const productId = 247; // Elite Cover Product - Nexus Mutual Cover Product Type
|
|
87
87
|
const coverAmount = '100';
|
|
88
88
|
const coverPeriod = 30;
|
|
89
89
|
const coverAsset = CoverAsset.ETH;
|
|
90
90
|
const buyerAddress = '0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5';
|
|
91
|
-
const ipfsCid = '
|
|
91
|
+
const ipfsCid = 'QmXUzXDMbeKSCewUie34vPD7mCAGnshi4ULRy4h7DLmoRS';
|
|
92
92
|
|
|
93
93
|
const quoteAndBuyCoverInputs = await getQuoteAndBuyCoverInputs(
|
|
94
94
|
productId,
|
|
@@ -108,7 +108,7 @@ console.log(quoteAndBuyCoverInputs);
|
|
|
108
108
|
```typescript
|
|
109
109
|
import { CoverAsset, getQuoteAndBuyCoverInputs, IPFSContentTypes } from '@nexusmutual/sdk';
|
|
110
110
|
|
|
111
|
-
const productId = 247;
|
|
111
|
+
const productId = 247; // Elite Cover Product - Nexus Mutual Cover Product Type
|
|
112
112
|
const coverAmount = '100';
|
|
113
113
|
const coverPeriod = 30;
|
|
114
114
|
const coverAsset = CoverAsset.ETH;
|
|
@@ -124,6 +124,7 @@ const quoteAndBuyCoverInputs = await getQuoteAndBuyCoverInputs(
|
|
|
124
124
|
coverPeriod,
|
|
125
125
|
coverAsset,
|
|
126
126
|
buyerAddress,
|
|
127
|
+
undefined,
|
|
127
128
|
ipfsContent,
|
|
128
129
|
);
|
|
129
130
|
|
|
@@ -134,3 +135,36 @@ If the productId's type needs an IPFS upload, you can pass the `ipfsContent` par
|
|
|
134
135
|
|
|
135
136
|
The `ipfsCid` param must be a valid IPFS Cid.
|
|
136
137
|
The `ipfsContent` param must be a valid `IPFSContentTypes` - the allowed types can be found in `src/types/ipfs.ts`.
|
|
138
|
+
|
|
139
|
+
### Product Types and IPFS Content Mapping
|
|
140
|
+
|
|
141
|
+
The following table shows the mapping between product types and their required IPFS content types:
|
|
142
|
+
|
|
143
|
+
| Product Type | Content Type | Content Structure | Description |
|
|
144
|
+
|-------------|--------------|-------------------|-------------|
|
|
145
|
+
| ethSlashing | coverValidators | <pre>{ version: '1.0', validators: string[] }</pre> | Array of validator addresses |
|
|
146
|
+
| liquidCollectiveEthStaking | coverValidators | <pre>{ version: '1.0', validators: string[] }</pre> | Array of validator addresses |
|
|
147
|
+
| stakewiseEthStaking | coverValidators | <pre>{ version: '1.0', validators: string[] }</pre> | Array of validator addresses |
|
|
148
|
+
| sherlockQuotaShare | coverQuotaShare | <pre>{ version: '1.0', quotaShare: number }</pre> | Percentage value, 0 to 100 |
|
|
149
|
+
| unoReQuotaShare | coverQuotaShare | <pre>{ version: '1.0', quotaShare: number }</pre> | Percentage value, 0 to 100 |
|
|
150
|
+
| deFiPass | coverWalletAddress | <pre>{ version: '1.0', walletAddress: string }</pre> | Single wallet address |
|
|
151
|
+
| nexusMutual | coverWalletAddresses | <pre>{ version: '1.0', walletAddresses: string }</pre> | Single wallet address |
|
|
152
|
+
| nexusMutual | coverWalletAddresses | <pre>{ version: '2.0', walletAddresses: string[] }</pre> | Array of wallet addresses |
|
|
153
|
+
| followOn | coverFreeText | <pre>{ version: '1.0', freeText: string }</pre> | Free text description |
|
|
154
|
+
| fundPortfolio | coverAumCoverAmountPercentage | <pre>{ version: '1.0', aumCoverAmountPercentage: number }</pre> | Percentage value, 0 to 100 |
|
|
155
|
+
| generalisedFundPortfolio | coverAumCoverAmountPercentage | <pre>{ version: '1.0', aumCoverAmountPercentage: number }</pre> | Percentage value, 0 to 100 |
|
|
156
|
+
|
|
157
|
+
Note: The following product types do not require IPFS content:
|
|
158
|
+
- protocol
|
|
159
|
+
- custody
|
|
160
|
+
- yieldToken
|
|
161
|
+
- sherlockExcess
|
|
162
|
+
- nativeProtocol
|
|
163
|
+
- theRetailMutual
|
|
164
|
+
- bundledProtocol
|
|
165
|
+
- ethSlashingUmbrella
|
|
166
|
+
- openCoverTransaction
|
|
167
|
+
- sherlockBugBounty
|
|
168
|
+
- immunefiBugBounty
|
|
169
|
+
|
|
170
|
+
For a complete list of products and product types, see [products.json](https://sdk.nexusmutual.io/data/products.json) and [product-types.json](https://sdk.nexusmutual.io/data/product-types.json).
|
package/dist/data/products.json
CHANGED
|
@@ -3344,7 +3344,7 @@
|
|
|
3344
3344
|
"cbBTC"
|
|
3345
3345
|
],
|
|
3346
3346
|
"isPrivate": false,
|
|
3347
|
-
"timestamp":
|
|
3347
|
+
"timestamp": 1734557999,
|
|
3348
3348
|
"minPrice": 100
|
|
3349
3349
|
},
|
|
3350
3350
|
{
|
|
@@ -3862,7 +3862,7 @@
|
|
|
3862
3862
|
"ETH"
|
|
3863
3863
|
],
|
|
3864
3864
|
"isPrivate": false,
|
|
3865
|
-
"timestamp":
|
|
3865
|
+
"timestamp": 1734557999,
|
|
3866
3866
|
"minPrice": 100
|
|
3867
3867
|
},
|
|
3868
3868
|
{
|
|
@@ -4049,7 +4049,7 @@
|
|
|
4049
4049
|
"USDC"
|
|
4050
4050
|
],
|
|
4051
4051
|
"isPrivate": false,
|
|
4052
|
-
"timestamp":
|
|
4052
|
+
"timestamp": 1723127459,
|
|
4053
4053
|
"minPrice": 100
|
|
4054
4054
|
},
|
|
4055
4055
|
{
|
|
@@ -4104,7 +4104,7 @@
|
|
|
4104
4104
|
"cbBTC"
|
|
4105
4105
|
],
|
|
4106
4106
|
"isPrivate": false,
|
|
4107
|
-
"timestamp":
|
|
4107
|
+
"timestamp": 1724341943,
|
|
4108
4108
|
"minPrice": 100
|
|
4109
4109
|
},
|
|
4110
4110
|
{
|
|
@@ -4143,7 +4143,7 @@
|
|
|
4143
4143
|
"cbBTC"
|
|
4144
4144
|
],
|
|
4145
4145
|
"isPrivate": false,
|
|
4146
|
-
"timestamp":
|
|
4146
|
+
"timestamp": 1726227311,
|
|
4147
4147
|
"minPrice": 100
|
|
4148
4148
|
},
|
|
4149
4149
|
{
|
|
@@ -4181,7 +4181,7 @@
|
|
|
4181
4181
|
"cbBTC"
|
|
4182
4182
|
],
|
|
4183
4183
|
"isPrivate": false,
|
|
4184
|
-
"timestamp":
|
|
4184
|
+
"timestamp": 1734557999,
|
|
4185
4185
|
"minPrice": 100
|
|
4186
4186
|
},
|
|
4187
4187
|
{
|
|
@@ -4201,7 +4201,7 @@
|
|
|
4201
4201
|
"cbBTC"
|
|
4202
4202
|
],
|
|
4203
4203
|
"isPrivate": true,
|
|
4204
|
-
"timestamp":
|
|
4204
|
+
"timestamp": 1725264851,
|
|
4205
4205
|
"minPrice": 100
|
|
4206
4206
|
},
|
|
4207
4207
|
{
|
|
@@ -4220,7 +4220,7 @@
|
|
|
4220
4220
|
"cbBTC"
|
|
4221
4221
|
],
|
|
4222
4222
|
"isPrivate": false,
|
|
4223
|
-
"timestamp":
|
|
4223
|
+
"timestamp": 1728564167,
|
|
4224
4224
|
"minPrice": 100
|
|
4225
4225
|
},
|
|
4226
4226
|
{
|
|
@@ -4239,7 +4239,7 @@
|
|
|
4239
4239
|
"cbBTC"
|
|
4240
4240
|
],
|
|
4241
4241
|
"isPrivate": false,
|
|
4242
|
-
"timestamp":
|
|
4242
|
+
"timestamp": 1736430671,
|
|
4243
4243
|
"minPrice": 100
|
|
4244
4244
|
},
|
|
4245
4245
|
{
|
|
@@ -4368,7 +4368,7 @@
|
|
|
4368
4368
|
"USDC"
|
|
4369
4369
|
],
|
|
4370
4370
|
"isPrivate": false,
|
|
4371
|
-
"timestamp":
|
|
4371
|
+
"timestamp": 1734557999,
|
|
4372
4372
|
"minPrice": 100
|
|
4373
4373
|
},
|
|
4374
4374
|
{
|
|
@@ -4467,7 +4467,7 @@
|
|
|
4467
4467
|
"cbBTC"
|
|
4468
4468
|
],
|
|
4469
4469
|
"isPrivate": false,
|
|
4470
|
-
"timestamp":
|
|
4470
|
+
"timestamp": 1734557999,
|
|
4471
4471
|
"minPrice": 100
|
|
4472
4472
|
},
|
|
4473
4473
|
{
|
|
@@ -4535,7 +4535,7 @@
|
|
|
4535
4535
|
"USDC"
|
|
4536
4536
|
],
|
|
4537
4537
|
"isPrivate": true,
|
|
4538
|
-
"timestamp":
|
|
4538
|
+
"timestamp": 1733753135,
|
|
4539
4539
|
"minPrice": 100
|
|
4540
4540
|
},
|
|
4541
4541
|
{
|