timelock-sdk 0.0.103 → 0.0.105

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/dist/client.cjs CHANGED
@@ -807,7 +807,7 @@ var PerpsOperator = class {
807
807
  constructor(baseUrl) {
808
808
  this.#baseUrl = baseUrl;
809
809
  }
810
- async #request(path, body) {
810
+ #request = async (path, body) => {
811
811
  const url = new URL(path, this.#baseUrl);
812
812
  const res = await fetch(url, {
813
813
  method: body ? "POST" : "GET",
@@ -829,16 +829,16 @@ var PerpsOperator = class {
829
829
  } catch (error) {
830
830
  throw new Error(`${res.status} ${res.statusText}: ${resText}`);
831
831
  }
832
- }
833
- async getOperatorAddr() {
832
+ };
833
+ getOperatorAddr = async () => {
834
834
  const { address } = await this.#request("api/operator/address");
835
835
  return address;
836
- }
837
- async genAuthMessage(userAddr) {
836
+ };
837
+ genAuthMessage = async (userAddr) => {
838
838
  const { message } = await this.#request("api/auth/gen", { userAddr });
839
839
  return message;
840
- }
841
- async validateAuthMessage(authMessage, signature) {
840
+ };
841
+ validateAuthMessage = async (authMessage, signature) => {
842
842
  const { address, createdAt, validUntil } = await this.#request("api/auth/validate", {
843
843
  authMessage,
844
844
  signature
@@ -848,14 +848,14 @@ var PerpsOperator = class {
848
848
  createdAt,
849
849
  validUntil
850
850
  };
851
- }
852
- setAuth(authMessage, signature) {
851
+ };
852
+ setAuth = (authMessage, signature) => {
853
853
  this.auth = {
854
854
  authMessage,
855
855
  signature
856
856
  };
857
- }
858
- async getUserPerps(userAddr, marketAddr, type, offset = 0, limit = 1e3) {
857
+ };
858
+ getUserPerps = async (userAddr, marketAddr, type, offset = 0, limit = 1e3) => {
859
859
  const params = new URLSearchParams({
860
860
  offset: offset.toString(),
861
861
  limit: limit.toString()
@@ -867,8 +867,8 @@ var PerpsOperator = class {
867
867
  ...p,
868
868
  optionId: BigInt(p.optionId)
869
869
  }));
870
- }
871
- async mintPerp(body) {
870
+ };
871
+ mintPerp = async (body) => {
872
872
  if (!this.auth) throw new Error("Authentication required. Call setAuth() with authMessage and signature before exercising perps.");
873
873
  const { txHash, optionId } = await this.#request("api/positions/mint", {
874
874
  ...body,
@@ -879,8 +879,8 @@ var PerpsOperator = class {
879
879
  txHash,
880
880
  optionId: BigInt(optionId)
881
881
  };
882
- }
883
- async exercisePerp(body) {
882
+ };
883
+ exercisePerp = async (body) => {
884
884
  if (!this.auth) throw new Error("Authentication required. Call setAuth() with authMessage and signature before exercising perps.");
885
885
  const { txHash, optionId } = await this.#request("api/positions/exercise", {
886
886
  ...body,
@@ -892,7 +892,7 @@ var PerpsOperator = class {
892
892
  txHash,
893
893
  optionId: BigInt(optionId)
894
894
  };
895
- }
895
+ };
896
896
  };
897
897
 
898
898
  //#endregion
@@ -1076,7 +1076,6 @@ const useMintPerp = (marketAddr) => {
1076
1076
  await askForApproval(payoutAsset, marketAddr, (premium + protocolFee) * 11n / 10n);
1077
1077
  await operator.mintPerp({
1078
1078
  marketAddr,
1079
- userAddr: address,
1080
1079
  amount,
1081
1080
  optionType,
1082
1081
  duration,