@dynamic-labs-wallet/core 0.0.21 → 0.0.23

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/index.cjs.js CHANGED
@@ -157,11 +157,11 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
157
157
  switch(true){
158
158
  // 2-of-2 -> 2-of-2:
159
159
  // -- server shares: 1 existing, 0 new
160
- // -- client shares: 1 existing, 1 new
160
+ // -- client shares: 1 existing, 0 new
161
161
  case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
162
162
  return {
163
163
  existingClientShareCount: 1,
164
- newClientShareCount: 1,
164
+ newClientShareCount: 0,
165
165
  existingServerShareCount: 1,
166
166
  newServerShareCount: 0
167
167
  };
@@ -215,6 +215,26 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
215
215
  existingServerShareCount: 1,
216
216
  newServerShareCount: 1
217
217
  };
218
+ // 2-of-3 -> 2-of-2:
219
+ // -- server shares: 1 existing, 0 new
220
+ // -- client shares: 1 existing, 0 new
221
+ case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
222
+ return {
223
+ existingClientShareCount: 1,
224
+ newClientShareCount: 0,
225
+ existingServerShareCount: 1,
226
+ newServerShareCount: 0
227
+ };
228
+ // 3-of-5 -> 2-of-3:
229
+ // -- server shares: 1 existing, 0 new
230
+ // -- client shares: 2 existing, 0 new
231
+ case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
232
+ return {
233
+ existingClientShareCount: 2,
234
+ newClientShareCount: 0,
235
+ existingServerShareCount: 1,
236
+ newServerShareCount: 0
237
+ };
218
238
  default:
219
239
  throw new Error(`Unsupported reshare from ${oldThresholdSignatureScheme} to ${newThresholdSignatureScheme}`);
220
240
  }
package/index.esm.js CHANGED
@@ -155,11 +155,11 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
155
155
  switch(true){
156
156
  // 2-of-2 -> 2-of-2:
157
157
  // -- server shares: 1 existing, 0 new
158
- // -- client shares: 1 existing, 1 new
158
+ // -- client shares: 1 existing, 0 new
159
159
  case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
160
160
  return {
161
161
  existingClientShareCount: 1,
162
- newClientShareCount: 1,
162
+ newClientShareCount: 0,
163
163
  existingServerShareCount: 1,
164
164
  newServerShareCount: 0
165
165
  };
@@ -213,6 +213,26 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
213
213
  existingServerShareCount: 1,
214
214
  newServerShareCount: 1
215
215
  };
216
+ // 2-of-3 -> 2-of-2:
217
+ // -- server shares: 1 existing, 0 new
218
+ // -- client shares: 1 existing, 0 new
219
+ case oldThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_TWO:
220
+ return {
221
+ existingClientShareCount: 1,
222
+ newClientShareCount: 0,
223
+ existingServerShareCount: 1,
224
+ newServerShareCount: 0
225
+ };
226
+ // 3-of-5 -> 2-of-3:
227
+ // -- server shares: 1 existing, 0 new
228
+ // -- client shares: 2 existing, 0 new
229
+ case oldThresholdSignatureScheme === ThresholdSignatureScheme.THREE_OF_FIVE && newThresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE:
230
+ return {
231
+ existingClientShareCount: 2,
232
+ newClientShareCount: 0,
233
+ existingServerShareCount: 1,
234
+ newServerShareCount: 0
235
+ };
216
236
  default:
217
237
  throw new Error(`Unsupported reshare from ${oldThresholdSignatureScheme} to ${newThresholdSignatureScheme}`);
218
238
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/core",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "dependencies": {
5
5
  "axios": "1.7.9"
6
6
  },
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/mpc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,iBAAiB,cAAe,MAAM;;;CAMlD,CAAC;AAEF,eAAO,MAAM,YAAY,6BACG,wBAAwB;;;CAInD,CAAC;AAEF,eAAO,MAAM,kBAAkB,6BACH,wBAAwB,WAGnD,CAAC;AAEF,eAAO,MAAM,yBAAyB,6BACV,wBAAwB,WAGnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,kEAG1B;IACD,2BAA2B,EAAE,wBAAwB,CAAC;IACtD,2BAA2B,EAAE,wBAAwB,CAAC;CACvD,KAAG;IACF,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAgF7B,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/mpc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,iBAAiB,cAAe,MAAM;;;CAMlD,CAAC;AAEF,eAAO,MAAM,YAAY,6BACG,wBAAwB;;;CAInD,CAAC;AAEF,eAAO,MAAM,kBAAkB,6BACH,wBAAwB,WAGnD,CAAC;AAEF,eAAO,MAAM,yBAAyB,6BACV,wBAAwB,WAGnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,kEAG1B;IACD,2BAA2B,EAAE,wBAAwB,CAAC;IACtD,2BAA2B,EAAE,wBAAwB,CAAC;CACvD,KAAG;IACF,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAwG7B,CAAC"}