@unlink-xyz/multisig 0.1.3-canary.01ac52d → 0.1.3-canary.05ae89f

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.
@@ -23744,8 +23744,8 @@ var ContractUnknownEventPayload = class extends EventPayload {
23744
23744
  /**
23745
23745
  * @_event:
23746
23746
  */
23747
- constructor(contract, listener, filter, log) {
23748
- super(contract, listener, filter);
23747
+ constructor(contract2, listener, filter, log) {
23748
+ super(contract2, listener, filter);
23749
23749
  defineProperties(this, { log });
23750
23750
  }
23751
23751
  /**
@@ -23771,9 +23771,9 @@ var ContractEventPayload = class extends ContractUnknownEventPayload {
23771
23771
  /**
23772
23772
  * @_ignore:
23773
23773
  */
23774
- constructor(contract, listener, filter, fragment, _log) {
23775
- super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));
23776
- const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);
23774
+ constructor(contract2, listener, filter, fragment, _log) {
23775
+ super(contract2, listener, filter, new EventLog(_log, contract2.interface, fragment));
23776
+ const args = contract2.interface.decodeEventLog(fragment, this.log.data, this.log.topics);
23777
23777
  defineProperties(this, { args, fragment });
23778
23778
  }
23779
23779
  /**
@@ -23816,12 +23816,12 @@ function getResolver(value) {
23816
23816
  var PreparedTopicFilter = class {
23817
23817
  #filter;
23818
23818
  fragment;
23819
- constructor(contract, fragment, args) {
23819
+ constructor(contract2, fragment, args) {
23820
23820
  defineProperties(this, { fragment });
23821
23821
  if (fragment.inputs.length < args.length) {
23822
23822
  throw new Error("too many arguments");
23823
23823
  }
23824
- const runner = getRunner(contract.runner, "resolveName");
23824
+ const runner = getRunner(contract2.runner, "resolveName");
23825
23825
  const resolver = canResolve(runner) ? runner : null;
23826
23826
  this.#filter = (async function() {
23827
23827
  const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {
@@ -23839,7 +23839,7 @@ var PreparedTopicFilter = class {
23839
23839
  return value;
23840
23840
  });
23841
23841
  }));
23842
- return contract.interface.encodeFilterTopics(fragment, resolvedArgs);
23842
+ return contract2.interface.encodeFilterTopics(fragment, resolvedArgs);
23843
23843
  })();
23844
23844
  }
23845
23845
  getTopicFilter() {
@@ -23888,14 +23888,14 @@ async function resolveArgs(_runner, inputs, args) {
23888
23888
  });
23889
23889
  }));
23890
23890
  }
23891
- function buildWrappedFallback(contract) {
23891
+ function buildWrappedFallback(contract2) {
23892
23892
  const populateTransaction = async function(overrides) {
23893
23893
  const tx2 = await copyOverrides(overrides, ["data"]);
23894
- tx2.to = await contract.getAddress();
23894
+ tx2.to = await contract2.getAddress();
23895
23895
  if (tx2.from) {
23896
- tx2.from = await resolveAddress(tx2.from, getResolver(contract.runner));
23896
+ tx2.from = await resolveAddress(tx2.from, getResolver(contract2.runner));
23897
23897
  }
23898
- const iface = contract.interface;
23898
+ const iface = contract2.interface;
23899
23899
  const noValue = getBigInt(tx2.value || BN_09, "overrides.value") === BN_09;
23900
23900
  const noData = (tx2.data || "0x") === "0x";
23901
23901
  if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) {
@@ -23908,27 +23908,27 @@ function buildWrappedFallback(contract) {
23908
23908
  return tx2;
23909
23909
  };
23910
23910
  const staticCall = async function(overrides) {
23911
- const runner = getRunner(contract.runner, "call");
23911
+ const runner = getRunner(contract2.runner, "call");
23912
23912
  assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
23913
23913
  const tx2 = await populateTransaction(overrides);
23914
23914
  try {
23915
23915
  return await runner.call(tx2);
23916
23916
  } catch (error) {
23917
23917
  if (isCallException(error) && error.data) {
23918
- throw contract.interface.makeError(error.data, tx2);
23918
+ throw contract2.interface.makeError(error.data, tx2);
23919
23919
  }
23920
23920
  throw error;
23921
23921
  }
23922
23922
  };
23923
23923
  const send = async function(overrides) {
23924
- const runner = contract.runner;
23924
+ const runner = contract2.runner;
23925
23925
  assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
23926
23926
  const tx2 = await runner.sendTransaction(await populateTransaction(overrides));
23927
- const provider = getProvider(contract.runner);
23928
- return new ContractTransactionResponse(contract.interface, provider, tx2);
23927
+ const provider = getProvider(contract2.runner);
23928
+ return new ContractTransactionResponse(contract2.interface, provider, tx2);
23929
23929
  };
23930
23930
  const estimateGas = async function(overrides) {
23931
- const runner = getRunner(contract.runner, "estimateGas");
23931
+ const runner = getRunner(contract2.runner, "estimateGas");
23932
23932
  assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
23933
23933
  return await runner.estimateGas(await populateTransaction(overrides));
23934
23934
  };
@@ -23936,7 +23936,7 @@ function buildWrappedFallback(contract) {
23936
23936
  return await send(overrides);
23937
23937
  };
23938
23938
  defineProperties(method, {
23939
- _contract: contract,
23939
+ _contract: contract2,
23940
23940
  estimateGas,
23941
23941
  populateTransaction,
23942
23942
  send,
@@ -23944,9 +23944,9 @@ function buildWrappedFallback(contract) {
23944
23944
  });
23945
23945
  return method;
23946
23946
  }
23947
- function buildWrappedMethod(contract, key) {
23947
+ function buildWrappedMethod(contract2, key) {
23948
23948
  const getFragment = function(...args) {
23949
- const fragment = contract.interface.getFunction(key, args);
23949
+ const fragment = contract2.interface.getFunction(key, args);
23950
23950
  assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
23951
23951
  operation: "fragment",
23952
23952
  info: { key, args }
@@ -23959,16 +23959,16 @@ function buildWrappedMethod(contract, key) {
23959
23959
  if (fragment.inputs.length + 1 === args.length) {
23960
23960
  overrides = await copyOverrides(args.pop());
23961
23961
  if (overrides.from) {
23962
- overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner));
23962
+ overrides.from = await resolveAddress(overrides.from, getResolver(contract2.runner));
23963
23963
  }
23964
23964
  }
23965
23965
  if (fragment.inputs.length !== args.length) {
23966
23966
  throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");
23967
23967
  }
23968
- const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);
23968
+ const resolvedArgs = await resolveArgs(contract2.runner, fragment.inputs, args);
23969
23969
  return Object.assign({}, overrides, await resolveProperties({
23970
- to: contract.getAddress(),
23971
- data: contract.interface.encodeFunctionData(fragment, resolvedArgs)
23970
+ to: contract2.getAddress(),
23971
+ data: contract2.interface.encodeFunctionData(fragment, resolvedArgs)
23972
23972
  }));
23973
23973
  };
23974
23974
  const staticCall = async function(...args) {
@@ -23979,19 +23979,19 @@ function buildWrappedMethod(contract, key) {
23979
23979
  return result;
23980
23980
  };
23981
23981
  const send = async function(...args) {
23982
- const runner = contract.runner;
23982
+ const runner = contract2.runner;
23983
23983
  assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
23984
23984
  const tx2 = await runner.sendTransaction(await populateTransaction(...args));
23985
- const provider = getProvider(contract.runner);
23986
- return new ContractTransactionResponse(contract.interface, provider, tx2);
23985
+ const provider = getProvider(contract2.runner);
23986
+ return new ContractTransactionResponse(contract2.interface, provider, tx2);
23987
23987
  };
23988
23988
  const estimateGas = async function(...args) {
23989
- const runner = getRunner(contract.runner, "estimateGas");
23989
+ const runner = getRunner(contract2.runner, "estimateGas");
23990
23990
  assert(canEstimate(runner), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" });
23991
23991
  return await runner.estimateGas(await populateTransaction(...args));
23992
23992
  };
23993
23993
  const staticCallResult = async function(...args) {
23994
- const runner = getRunner(contract.runner, "call");
23994
+ const runner = getRunner(contract2.runner, "call");
23995
23995
  assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
23996
23996
  const tx2 = await populateTransaction(...args);
23997
23997
  let result = "0x";
@@ -23999,12 +23999,12 @@ function buildWrappedMethod(contract, key) {
23999
23999
  result = await runner.call(tx2);
24000
24000
  } catch (error) {
24001
24001
  if (isCallException(error) && error.data) {
24002
- throw contract.interface.makeError(error.data, tx2);
24002
+ throw contract2.interface.makeError(error.data, tx2);
24003
24003
  }
24004
24004
  throw error;
24005
24005
  }
24006
24006
  const fragment = getFragment(...args);
24007
- return contract.interface.decodeFunctionResult(fragment, result);
24007
+ return contract2.interface.decodeFunctionResult(fragment, result);
24008
24008
  };
24009
24009
  const method = async (...args) => {
24010
24010
  const fragment = getFragment(...args);
@@ -24014,8 +24014,8 @@ function buildWrappedMethod(contract, key) {
24014
24014
  return await send(...args);
24015
24015
  };
24016
24016
  defineProperties(method, {
24017
- name: contract.interface.getFunctionName(key),
24018
- _contract: contract,
24017
+ name: contract2.interface.getFunctionName(key),
24018
+ _contract: contract2,
24019
24019
  _key: key,
24020
24020
  getFragment,
24021
24021
  estimateGas,
@@ -24028,7 +24028,7 @@ function buildWrappedMethod(contract, key) {
24028
24028
  configurable: false,
24029
24029
  enumerable: true,
24030
24030
  get: () => {
24031
- const fragment = contract.interface.getFunction(key);
24031
+ const fragment = contract2.interface.getFunction(key);
24032
24032
  assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
24033
24033
  operation: "fragment",
24034
24034
  info: { key }
@@ -24038,9 +24038,9 @@ function buildWrappedMethod(contract, key) {
24038
24038
  });
24039
24039
  return method;
24040
24040
  }
24041
- function buildWrappedEvent(contract, key) {
24041
+ function buildWrappedEvent(contract2, key) {
24042
24042
  const getFragment = function(...args) {
24043
- const fragment = contract.interface.getEvent(key, args);
24043
+ const fragment = contract2.interface.getEvent(key, args);
24044
24044
  assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
24045
24045
  operation: "fragment",
24046
24046
  info: { key, args }
@@ -24048,11 +24048,11 @@ function buildWrappedEvent(contract, key) {
24048
24048
  return fragment;
24049
24049
  };
24050
24050
  const method = function(...args) {
24051
- return new PreparedTopicFilter(contract, getFragment(...args), args);
24051
+ return new PreparedTopicFilter(contract2, getFragment(...args), args);
24052
24052
  };
24053
24053
  defineProperties(method, {
24054
- name: contract.interface.getEventName(key),
24055
- _contract: contract,
24054
+ name: contract2.interface.getEventName(key),
24055
+ _contract: contract2,
24056
24056
  _key: key,
24057
24057
  getFragment
24058
24058
  });
@@ -24060,7 +24060,7 @@ function buildWrappedEvent(contract, key) {
24060
24060
  configurable: false,
24061
24061
  enumerable: true,
24062
24062
  get: () => {
24063
- const fragment = contract.interface.getEvent(key);
24063
+ const fragment = contract2.interface.getEvent(key);
24064
24064
  assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", {
24065
24065
  operation: "fragment",
24066
24066
  info: { key }
@@ -24072,16 +24072,16 @@ function buildWrappedEvent(contract, key) {
24072
24072
  }
24073
24073
  var internal2 = /* @__PURE__ */ Symbol.for("_ethersInternal_contract");
24074
24074
  var internalValues = /* @__PURE__ */ new WeakMap();
24075
- function setInternal(contract, values) {
24076
- internalValues.set(contract[internal2], values);
24075
+ function setInternal(contract2, values) {
24076
+ internalValues.set(contract2[internal2], values);
24077
24077
  }
24078
- function getInternal(contract) {
24079
- return internalValues.get(contract[internal2]);
24078
+ function getInternal(contract2) {
24079
+ return internalValues.get(contract2[internal2]);
24080
24080
  }
24081
24081
  function isDeferred(value) {
24082
24082
  return value && typeof value === "object" && "getTopicFilter" in value && typeof value.getTopicFilter === "function" && value.fragment;
24083
24083
  }
24084
- async function getSubInfo(contract, event) {
24084
+ async function getSubInfo(contract2, event) {
24085
24085
  let topics;
24086
24086
  let fragment = null;
24087
24087
  if (Array.isArray(event)) {
@@ -24089,7 +24089,7 @@ async function getSubInfo(contract, event) {
24089
24089
  if (isHexString(name, 32)) {
24090
24090
  return name;
24091
24091
  }
24092
- const fragment2 = contract.interface.getEvent(name);
24092
+ const fragment2 = contract2.interface.getEvent(name);
24093
24093
  assertArgument(fragment2, "unknown fragment", "name", name);
24094
24094
  return fragment2.topicHash;
24095
24095
  };
@@ -24108,7 +24108,7 @@ async function getSubInfo(contract, event) {
24108
24108
  if (isHexString(event, 32)) {
24109
24109
  topics = [event];
24110
24110
  } else {
24111
- fragment = contract.interface.getEvent(event);
24111
+ fragment = contract2.interface.getEvent(event);
24112
24112
  assertArgument(fragment, "unknown fragment", "event", event);
24113
24113
  topics = [fragment.topicHash];
24114
24114
  }
@@ -24145,36 +24145,36 @@ async function getSubInfo(contract, event) {
24145
24145
  }).join("&");
24146
24146
  return { fragment, tag, topics };
24147
24147
  }
24148
- async function hasSub(contract, event) {
24149
- const { subs } = getInternal(contract);
24150
- return subs.get((await getSubInfo(contract, event)).tag) || null;
24148
+ async function hasSub(contract2, event) {
24149
+ const { subs } = getInternal(contract2);
24150
+ return subs.get((await getSubInfo(contract2, event)).tag) || null;
24151
24151
  }
24152
- async function getSub(contract, operation, event) {
24153
- const provider = getProvider(contract.runner);
24152
+ async function getSub(contract2, operation, event) {
24153
+ const provider = getProvider(contract2.runner);
24154
24154
  assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation });
24155
- const { fragment, tag, topics } = await getSubInfo(contract, event);
24156
- const { addr, subs } = getInternal(contract);
24155
+ const { fragment, tag, topics } = await getSubInfo(contract2, event);
24156
+ const { addr, subs } = getInternal(contract2);
24157
24157
  let sub2 = subs.get(tag);
24158
24158
  if (!sub2) {
24159
- const address = addr ? addr : contract;
24159
+ const address = addr ? addr : contract2;
24160
24160
  const filter = { address, topics };
24161
24161
  const listener = (log) => {
24162
24162
  let foundFragment = fragment;
24163
24163
  if (foundFragment == null) {
24164
24164
  try {
24165
- foundFragment = contract.interface.getEvent(log.topics[0]);
24165
+ foundFragment = contract2.interface.getEvent(log.topics[0]);
24166
24166
  } catch (error) {
24167
24167
  }
24168
24168
  }
24169
24169
  if (foundFragment) {
24170
24170
  const _foundFragment = foundFragment;
24171
- const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : [];
24172
- emit22(contract, event, args, (listener2) => {
24173
- return new ContractEventPayload(contract, listener2, event, _foundFragment, log);
24171
+ const args = fragment ? contract2.interface.decodeEventLog(fragment, log.data, log.topics) : [];
24172
+ emit22(contract2, event, args, (listener2) => {
24173
+ return new ContractEventPayload(contract2, listener2, event, _foundFragment, log);
24174
24174
  });
24175
24175
  } else {
24176
- emit22(contract, event, [], (listener2) => {
24177
- return new ContractUnknownEventPayload(contract, listener2, event, log);
24176
+ emit22(contract2, event, [], (listener2) => {
24177
+ return new ContractUnknownEventPayload(contract2, listener2, event, log);
24178
24178
  });
24179
24179
  }
24180
24180
  };
@@ -24200,9 +24200,9 @@ async function getSub(contract, operation, event) {
24200
24200
  return sub2;
24201
24201
  }
24202
24202
  var lastEmit = Promise.resolve();
24203
- async function _emit(contract, event, args, payloadFunc) {
24203
+ async function _emit(contract2, event, args, payloadFunc) {
24204
24204
  await lastEmit;
24205
- const sub2 = await hasSub(contract, event);
24205
+ const sub2 = await hasSub(contract2, event);
24206
24206
  if (!sub2) {
24207
24207
  return false;
24208
24208
  }
@@ -24213,23 +24213,23 @@ async function _emit(contract, event, args, payloadFunc) {
24213
24213
  passArgs.push(payloadFunc(once22 ? null : listener));
24214
24214
  }
24215
24215
  try {
24216
- listener.call(contract, ...passArgs);
24216
+ listener.call(contract2, ...passArgs);
24217
24217
  } catch (error) {
24218
24218
  }
24219
24219
  return !once22;
24220
24220
  });
24221
24221
  if (sub2.listeners.length === 0) {
24222
24222
  sub2.stop();
24223
- getInternal(contract).subs.delete(sub2.tag);
24223
+ getInternal(contract2).subs.delete(sub2.tag);
24224
24224
  }
24225
24225
  return count > 0;
24226
24226
  }
24227
- async function emit22(contract, event, args, payloadFunc) {
24227
+ async function emit22(contract2, event, args, payloadFunc) {
24228
24228
  try {
24229
24229
  await lastEmit;
24230
24230
  } catch (error) {
24231
24231
  }
24232
- const resultPromise = _emit(contract, event, args, payloadFunc);
24232
+ const resultPromise = _emit(contract2, event, args, payloadFunc);
24233
24233
  lastEmit = resultPromise;
24234
24234
  return await resultPromise;
24235
24235
  }
@@ -24655,8 +24655,8 @@ var BaseContract = class _BaseContract {
24655
24655
  if (runner == null) {
24656
24656
  runner = null;
24657
24657
  }
24658
- const contract = new this(target, abi, runner);
24659
- return contract;
24658
+ const contract2 = new this(target, abi, runner);
24659
+ return contract2;
24660
24660
  }
24661
24661
  };
24662
24662
  function _ContractBase() {
@@ -27982,6 +27982,114 @@ var circuits_default = {
27982
27982
  template: "JoinSplit",
27983
27983
  pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
27984
27984
  params: [5, 2, 16]
27985
+ },
27986
+ joinsplit_1x3_16: {
27987
+ file: "joinsplit",
27988
+ template: "JoinSplit",
27989
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
27990
+ params: [1, 3, 16]
27991
+ },
27992
+ joinsplit_4x3_16: {
27993
+ file: "joinsplit",
27994
+ template: "JoinSplit",
27995
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
27996
+ params: [4, 3, 16]
27997
+ },
27998
+ joinsplit_5x3_16: {
27999
+ file: "joinsplit",
28000
+ template: "JoinSplit",
28001
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28002
+ params: [5, 3, 16]
28003
+ },
28004
+ joinsplit_6x1_16: {
28005
+ file: "joinsplit",
28006
+ template: "JoinSplit",
28007
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28008
+ params: [6, 1, 16]
28009
+ },
28010
+ joinsplit_6x2_16: {
28011
+ file: "joinsplit",
28012
+ template: "JoinSplit",
28013
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28014
+ params: [6, 2, 16]
28015
+ },
28016
+ joinsplit_6x3_16: {
28017
+ file: "joinsplit",
28018
+ template: "JoinSplit",
28019
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28020
+ params: [6, 3, 16]
28021
+ },
28022
+ joinsplit_7x1_16: {
28023
+ file: "joinsplit",
28024
+ template: "JoinSplit",
28025
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28026
+ params: [7, 1, 16]
28027
+ },
28028
+ joinsplit_7x2_16: {
28029
+ file: "joinsplit",
28030
+ template: "JoinSplit",
28031
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28032
+ params: [7, 2, 16]
28033
+ },
28034
+ joinsplit_7x3_16: {
28035
+ file: "joinsplit",
28036
+ template: "JoinSplit",
28037
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28038
+ params: [7, 3, 16]
28039
+ },
28040
+ joinsplit_8x1_16: {
28041
+ file: "joinsplit",
28042
+ template: "JoinSplit",
28043
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28044
+ params: [8, 1, 16]
28045
+ },
28046
+ joinsplit_8x2_16: {
28047
+ file: "joinsplit",
28048
+ template: "JoinSplit",
28049
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28050
+ params: [8, 2, 16]
28051
+ },
28052
+ joinsplit_8x3_16: {
28053
+ file: "joinsplit",
28054
+ template: "JoinSplit",
28055
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28056
+ params: [8, 3, 16]
28057
+ },
28058
+ joinsplit_9x1_16: {
28059
+ file: "joinsplit",
28060
+ template: "JoinSplit",
28061
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28062
+ params: [9, 1, 16]
28063
+ },
28064
+ joinsplit_9x2_16: {
28065
+ file: "joinsplit",
28066
+ template: "JoinSplit",
28067
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28068
+ params: [9, 2, 16]
28069
+ },
28070
+ joinsplit_9x3_16: {
28071
+ file: "joinsplit",
28072
+ template: "JoinSplit",
28073
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28074
+ params: [9, 3, 16]
28075
+ },
28076
+ joinsplit_10x1_16: {
28077
+ file: "joinsplit",
28078
+ template: "JoinSplit",
28079
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28080
+ params: [10, 1, 16]
28081
+ },
28082
+ joinsplit_10x2_16: {
28083
+ file: "joinsplit",
28084
+ template: "JoinSplit",
28085
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28086
+ params: [10, 2, 16]
28087
+ },
28088
+ joinsplit_10x3_16: {
28089
+ file: "joinsplit",
28090
+ template: "JoinSplit",
28091
+ pubs: ["merkleRoot", "boundParamsHash", "nullifiers", "commitmentsOut"],
28092
+ params: [10, 3, 16]
27985
28093
  }
27986
28094
  };
27987
28095
  var registry = {};
@@ -28667,14 +28775,18 @@ var FrostCoordinator = class {
28667
28775
  baseUrl;
28668
28776
  pollIntervalMs;
28669
28777
  timeoutMs;
28778
+ maxRetries;
28779
+ retryDelayMs;
28670
28780
  constructor(config3) {
28671
28781
  this.baseUrl = config3.baseUrl.replace(/\/$/, "");
28672
- this.pollIntervalMs = config3.pollIntervalMs ?? 1e3;
28782
+ this.pollIntervalMs = config3.pollIntervalMs ?? 3e3;
28673
28783
  this.timeoutMs = config3.timeoutMs ?? 12e4;
28784
+ this.maxRetries = config3.maxRetries ?? 3;
28785
+ this.retryDelayMs = config3.retryDelayMs ?? 500;
28674
28786
  }
28675
28787
  // === DKG ===
28676
28788
  async createDkgSession(threshold, totalParticipants) {
28677
- const resp = await fetch(`${this.baseUrl}/dkg/groups`, {
28789
+ const resp = await this.fetchWithRetry(`${this.baseUrl}/dkg/groups`, {
28678
28790
  method: "POST",
28679
28791
  headers: { "Content-Type": "application/json" },
28680
28792
  body: JSON.stringify({
@@ -28687,9 +28799,10 @@ var FrostCoordinator = class {
28687
28799
  return { code: body.code };
28688
28800
  }
28689
28801
  async joinDkgSession(code) {
28690
- const resp = await fetch(`${this.baseUrl}/dkg/groups/${code}/join`, {
28691
- method: "POST"
28692
- });
28802
+ const resp = await this.fetchWithRetry(
28803
+ `${this.baseUrl}/dkg/groups/${code}/join`,
28804
+ { method: "POST" }
28805
+ );
28693
28806
  if (!resp.ok) throw await this.toError(resp);
28694
28807
  const body = await resp.json();
28695
28808
  return {
@@ -28699,14 +28812,17 @@ var FrostCoordinator = class {
28699
28812
  };
28700
28813
  }
28701
28814
  async submitRound1(code, pkg) {
28702
- const resp = await fetch(`${this.baseUrl}/dkg/groups/${code}/round1`, {
28703
- method: "POST",
28704
- headers: { "Content-Type": "application/json" },
28705
- body: JSON.stringify({
28706
- participant_index: pkg.participantIndex,
28707
- data: serializeDkgRound1Package(pkg)
28708
- })
28709
- });
28815
+ const resp = await this.fetchWithRetry(
28816
+ `${this.baseUrl}/dkg/groups/${code}/round1`,
28817
+ {
28818
+ method: "POST",
28819
+ headers: { "Content-Type": "application/json" },
28820
+ body: JSON.stringify({
28821
+ participant_index: pkg.participantIndex,
28822
+ data: serializeDkgRound1Package(pkg)
28823
+ })
28824
+ }
28825
+ );
28710
28826
  if (!resp.ok) throw await this.toError(resp);
28711
28827
  }
28712
28828
  async waitForRound1(code) {
@@ -28716,14 +28832,17 @@ var FrostCoordinator = class {
28716
28832
  );
28717
28833
  }
28718
28834
  async submitRound2(code, pkg) {
28719
- const resp = await fetch(`${this.baseUrl}/dkg/groups/${code}/round2`, {
28720
- method: "POST",
28721
- headers: { "Content-Type": "application/json" },
28722
- body: JSON.stringify({
28723
- participant_index: pkg.participantIndex,
28724
- data: serializeDkgRound2Package(pkg)
28725
- })
28726
- });
28835
+ const resp = await this.fetchWithRetry(
28836
+ `${this.baseUrl}/dkg/groups/${code}/round2`,
28837
+ {
28838
+ method: "POST",
28839
+ headers: { "Content-Type": "application/json" },
28840
+ body: JSON.stringify({
28841
+ participant_index: pkg.participantIndex,
28842
+ data: serializeDkgRound2Package(pkg)
28843
+ })
28844
+ }
28845
+ );
28727
28846
  if (!resp.ok) throw await this.toError(resp);
28728
28847
  }
28729
28848
  async waitForRound2(code) {
@@ -28744,7 +28863,7 @@ var FrostCoordinator = class {
28744
28863
  if (metadata !== void 0) {
28745
28864
  body.metadata = metadata;
28746
28865
  }
28747
- const resp = await fetch(`${this.baseUrl}/sign/sessions`, {
28866
+ const resp = await this.fetchWithRetry(`${this.baseUrl}/sign/sessions`, {
28748
28867
  method: "POST",
28749
28868
  headers: { "Content-Type": "application/json" },
28750
28869
  body: JSON.stringify(body)
@@ -28754,7 +28873,7 @@ var FrostCoordinator = class {
28754
28873
  return { code: result.code };
28755
28874
  }
28756
28875
  async submitCommitment(code, c) {
28757
- const resp = await fetch(
28876
+ const resp = await this.fetchWithRetry(
28758
28877
  `${this.baseUrl}/sign/sessions/${code}/commitments`,
28759
28878
  {
28760
28879
  method: "POST",
@@ -28774,14 +28893,17 @@ var FrostCoordinator = class {
28774
28893
  );
28775
28894
  }
28776
28895
  async submitShare(code, share) {
28777
- const resp = await fetch(`${this.baseUrl}/sign/sessions/${code}/shares`, {
28778
- method: "POST",
28779
- headers: { "Content-Type": "application/json" },
28780
- body: JSON.stringify({
28781
- participant_index: share.participantIndex,
28782
- data: serializeSignatureShare(share)
28783
- })
28784
- });
28896
+ const resp = await this.fetchWithRetry(
28897
+ `${this.baseUrl}/sign/sessions/${code}/shares`,
28898
+ {
28899
+ method: "POST",
28900
+ headers: { "Content-Type": "application/json" },
28901
+ body: JSON.stringify({
28902
+ participant_index: share.participantIndex,
28903
+ data: serializeSignatureShare(share)
28904
+ })
28905
+ }
28906
+ );
28785
28907
  if (!resp.ok) throw await this.toError(resp);
28786
28908
  }
28787
28909
  async waitForShares(code) {
@@ -28791,19 +28913,23 @@ var FrostCoordinator = class {
28791
28913
  );
28792
28914
  }
28793
28915
  async getSigningSessionStatus(code) {
28794
- const resp = await fetch(`${this.baseUrl}/sign/sessions/${code}/status`);
28916
+ const resp = await this.fetchWithRetry(
28917
+ `${this.baseUrl}/sign/sessions/${code}/status`
28918
+ );
28795
28919
  if (!resp.ok) throw await this.toError(resp);
28796
28920
  const body = await resp.json();
28797
28921
  return { ...body, message: deserializeBigint(body.message) };
28798
28922
  }
28799
28923
  async getSigningSession(code) {
28800
- const resp = await fetch(`${this.baseUrl}/sign/sessions/${code}`);
28924
+ const resp = await this.fetchWithRetry(
28925
+ `${this.baseUrl}/sign/sessions/${code}`
28926
+ );
28801
28927
  if (!resp.ok) throw await this.toError(resp);
28802
28928
  const body = await resp.json();
28803
28929
  return deserializeSessionInfo(body);
28804
28930
  }
28805
28931
  async listSigningSessions(groupId) {
28806
- const resp = await fetch(
28932
+ const resp = await this.fetchWithRetry(
28807
28933
  `${this.baseUrl}/sign/sessions?group_id=${encodeURIComponent(groupId)}`
28808
28934
  );
28809
28935
  if (!resp.ok) throw await this.toError(resp);
@@ -28820,30 +28946,36 @@ var FrostCoordinator = class {
28820
28946
  if (sessions.length > 0) {
28821
28947
  return sessions[0];
28822
28948
  }
28823
- await sleep(this.pollIntervalMs);
28949
+ await sleep(this.pollIntervalMs * (0.8 + Math.random() * 0.4));
28824
28950
  }
28825
28951
  throw new Error("Coordinator polling timeout");
28826
28952
  }
28827
28953
  // === Internal ===
28828
28954
  async pollRound1(code) {
28829
- const resp = await fetch(`${this.baseUrl}/dkg/groups/${code}/round1`);
28955
+ const resp = await this.fetchWithRetry(
28956
+ `${this.baseUrl}/dkg/groups/${code}/round1`
28957
+ );
28830
28958
  if (!resp.ok) throw await this.toError(resp);
28831
28959
  return await resp.json();
28832
28960
  }
28833
28961
  async pollRound2(code) {
28834
- const resp = await fetch(`${this.baseUrl}/dkg/groups/${code}/round2`);
28962
+ const resp = await this.fetchWithRetry(
28963
+ `${this.baseUrl}/dkg/groups/${code}/round2`
28964
+ );
28835
28965
  if (!resp.ok) throw await this.toError(resp);
28836
28966
  return await resp.json();
28837
28967
  }
28838
28968
  async pollCommitments(code) {
28839
- const resp = await fetch(
28969
+ const resp = await this.fetchWithRetry(
28840
28970
  `${this.baseUrl}/sign/sessions/${code}/commitments`
28841
28971
  );
28842
28972
  if (!resp.ok) throw await this.toError(resp);
28843
28973
  return await resp.json();
28844
28974
  }
28845
28975
  async pollShares(code) {
28846
- const resp = await fetch(`${this.baseUrl}/sign/sessions/${code}/shares`);
28976
+ const resp = await this.fetchWithRetry(
28977
+ `${this.baseUrl}/sign/sessions/${code}/shares`
28978
+ );
28847
28979
  if (!resp.ok) throw await this.toError(resp);
28848
28980
  return await resp.json();
28849
28981
  }
@@ -28854,12 +28986,32 @@ var FrostCoordinator = class {
28854
28986
  if (result.complete) {
28855
28987
  return result.packages.map((p) => deserializeFn(p));
28856
28988
  }
28857
- await sleep(this.pollIntervalMs);
28989
+ await sleep(this.pollIntervalMs * (0.8 + Math.random() * 0.4));
28858
28990
  }
28859
28991
  throw new Error("Coordinator polling timeout");
28860
28992
  }
28993
+ async fetchWithRetry(url, init4) {
28994
+ let lastError;
28995
+ for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
28996
+ if (attempt > 0) {
28997
+ await sleep(this.retryDelayMs * 2 ** (attempt - 1));
28998
+ }
28999
+ const resp = await fetch(url, init4);
29000
+ if (resp.ok || !isTransientError(resp.status)) {
29001
+ return resp;
29002
+ }
29003
+ lastError = await this.toError(resp);
29004
+ }
29005
+ throw lastError;
29006
+ }
28861
29007
  async toError(resp) {
28862
29008
  const body = await resp.text();
29009
+ const isHtml = body.trimStart().startsWith("<") || resp.headers.get("content-type")?.includes("text/html");
29010
+ if (isHtml) {
29011
+ return new Error(
29012
+ `Coordinator unavailable (HTTP ${resp.status}). The service may be temporarily overloaded \u2014 try again shortly.`
29013
+ );
29014
+ }
28863
29015
  return new Error(`Coordinator error ${resp.status}: ${body}`);
28864
29016
  }
28865
29017
  };
@@ -28873,13 +29025,16 @@ function deserializeSessionInfo(raw) {
28873
29025
  metadata: raw.metadata
28874
29026
  };
28875
29027
  }
29028
+ function isTransientError(status) {
29029
+ return status === 502 || status === 503 || status === 504;
29030
+ }
28876
29031
  function sleep(ms) {
28877
29032
  return new Promise((resolve) => setTimeout(resolve, ms));
28878
29033
  }
28879
29034
 
28880
29035
  // src/frost/account.ts
28881
- function frostUrl(gatewayUrl) {
28882
- return `${gatewayUrl.replace(/\/$/, "")}/frost`;
29036
+ function resolveFrostUrl(gatewayUrl, explicitFrostUrl) {
29037
+ return explicitFrostUrl ?? `${gatewayUrl.replace(/\/$/, "")}/frost`;
28883
29038
  }
28884
29039
  function deriveVerificationShare(participantIndex, coefficientCommitments) {
28885
29040
  const idx = BigInt(participantIndex);
@@ -28893,7 +29048,7 @@ function deriveVerificationShare(participantIndex, coefficientCommitments) {
28893
29048
  }
28894
29049
  return result;
28895
29050
  }
28896
- function buildMultisigAccount(result, viewingKeyPair, groupId, config3, participantIndex, gatewayUrl) {
29051
+ function buildMultisigAccount(result, viewingKeyPair, groupId, config3, participantIndex, gatewayUrl, frostUrl) {
28897
29052
  const nullifyingKey = computeNullifyingKey(viewingKeyPair.privateKey);
28898
29053
  const masterPublicKey = computeMasterPublicKey(
28899
29054
  result.groupPublicKey,
@@ -28914,6 +29069,7 @@ function buildMultisigAccount(result, viewingKeyPair, groupId, config3, particip
28914
29069
  nullifyingKey,
28915
29070
  masterPublicKey,
28916
29071
  gatewayUrl,
29072
+ ...frostUrl !== void 0 ? { frostUrl } : {},
28917
29073
  address
28918
29074
  };
28919
29075
  }
@@ -28934,7 +29090,7 @@ async function createMultisig(params) {
28934
29090
  totalShares: params.totalShares
28935
29091
  };
28936
29092
  const coordinator = new FrostCoordinator({
28937
- baseUrl: frostUrl(params.gatewayUrl)
29093
+ baseUrl: resolveFrostUrl(params.gatewayUrl, params.frostUrl)
28938
29094
  });
28939
29095
  const { code } = await coordinator.createDkgSession(
28940
29096
  config3.threshold,
@@ -28968,14 +29124,15 @@ async function createMultisig(params) {
28968
29124
  code,
28969
29125
  config3,
28970
29126
  1,
28971
- params.gatewayUrl
29127
+ params.gatewayUrl,
29128
+ params.frostUrl
28972
29129
  );
28973
29130
  }
28974
29131
  };
28975
29132
  }
28976
29133
  async function joinMultisig(params) {
28977
29134
  const coordinator = new FrostCoordinator({
28978
- baseUrl: frostUrl(params.gatewayUrl)
29135
+ baseUrl: resolveFrostUrl(params.gatewayUrl, params.frostUrl)
28979
29136
  });
28980
29137
  const { participantIndex, threshold, totalParticipants } = await coordinator.joinDkgSession(params.code);
28981
29138
  const config3 = { threshold, totalShares: totalParticipants };
@@ -29004,12 +29161,16 @@ async function joinMultisig(params) {
29004
29161
  params.code,
29005
29162
  config3,
29006
29163
  participantIndex,
29007
- params.gatewayUrl
29164
+ params.gatewayUrl,
29165
+ params.frostUrl
29008
29166
  );
29009
29167
  }
29010
29168
  async function signMultisig(params) {
29011
29169
  const coordinator = new FrostCoordinator({
29012
- baseUrl: frostUrl(params.account.gatewayUrl)
29170
+ baseUrl: resolveFrostUrl(
29171
+ params.account.gatewayUrl,
29172
+ params.account.frostUrl
29173
+ )
29013
29174
  });
29014
29175
  const { nonces, commitment } = generateCommitment(
29015
29176
  params.account.participantIndex
@@ -29047,7 +29208,10 @@ function createFrostSigner(params) {
29047
29208
  publicKey: params.account.groupPublicKey,
29048
29209
  sign: async (message) => {
29049
29210
  const coordinator = new FrostCoordinator({
29050
- baseUrl: frostUrl(params.account.gatewayUrl)
29211
+ baseUrl: resolveFrostUrl(
29212
+ params.account.gatewayUrl,
29213
+ params.account.frostUrl
29214
+ )
29051
29215
  });
29052
29216
  const { code } = await coordinator.createSigningSession(
29053
29217
  params.participants,
@@ -29070,7 +29234,7 @@ async function runSigningListener(params) {
29070
29234
  const { account, signal, onSession, approve, onError } = params;
29071
29235
  const pollIntervalMs = params.pollIntervalMs ?? 1e3;
29072
29236
  const coordinator = new FrostCoordinator({
29073
- baseUrl: `${account.gatewayUrl.replace(/\/$/, "")}/frost`,
29237
+ baseUrl: account.frostUrl ?? `${account.gatewayUrl.replace(/\/$/, "")}/frost`,
29074
29238
  pollIntervalMs
29075
29239
  });
29076
29240
  const seen = /* @__PURE__ */ new Set();
@@ -29121,13 +29285,14 @@ async function runSigningListener(params) {
29121
29285
 
29122
29286
  // src/wallet/wallet.ts
29123
29287
  function createMultisigWallet(config3) {
29124
- const { gatewayUrl } = config3;
29288
+ const { gatewayUrl, frostUrl } = config3;
29125
29289
  return {
29126
29290
  create(params) {
29127
29291
  return createMultisig({
29128
29292
  threshold: params.threshold,
29129
29293
  totalShares: params.totalShares,
29130
29294
  gatewayUrl,
29295
+ frostUrl,
29131
29296
  viewingKeyPair: params.viewingKeyPair
29132
29297
  });
29133
29298
  },
@@ -29135,6 +29300,7 @@ function createMultisigWallet(config3) {
29135
29300
  return joinMultisig({
29136
29301
  code: params.code,
29137
29302
  gatewayUrl,
29303
+ frostUrl,
29138
29304
  viewingKeyPair: params.viewingKeyPair
29139
29305
  });
29140
29306
  },
@@ -29156,7 +29322,7 @@ function createMultisigWallet(config3) {
29156
29322
  },
29157
29323
  async createSigningSession(params) {
29158
29324
  const coordinator = new FrostCoordinator({
29159
- baseUrl: `${gatewayUrl.replace(/\/$/, "")}/frost`
29325
+ baseUrl: frostUrl ?? `${gatewayUrl.replace(/\/$/, "")}/frost`
29160
29326
  });
29161
29327
  return coordinator.createSigningSession(
29162
29328
  params.participants,