@toon-protocol/client-mcp 0.20.4 → 0.20.5

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.
@@ -36,7 +36,7 @@ import {
36
36
  resolveClientNetwork,
37
37
  schnorr,
38
38
  secp256k1
39
- } from "./chunk-IYPIOSEF.js";
39
+ } from "./chunk-7ZUHCA5C.js";
40
40
  import {
41
41
  hmac
42
42
  } from "./chunk-T3WCTWRP.js";
@@ -9824,7 +9824,9 @@ var OnChainChannelClient = class {
9824
9824
  return this.depositSolana(channelId, amount, opts.currentDeposit);
9825
9825
  }
9826
9826
  if (chainPrefix === "mina") {
9827
- throw new Error("Deposit on mina is not yet supported (EVM + Solana today; Mina follow-up).");
9827
+ throw new Error(
9828
+ "Deposit on mina is not yet supported (EVM + Solana today; Mina follow-up)."
9829
+ );
9828
9830
  }
9829
9831
  return this.depositEvm(channelId, amount, opts.currentDeposit, ctx);
9830
9832
  }
@@ -9840,7 +9842,9 @@ var OnChainChannelClient = class {
9840
9842
  }
9841
9843
  const cfg = this.solanaConfig;
9842
9844
  const payerSeed = cfg.keypair.slice(0, 32);
9843
- const payerPubkey = base58Encode(new Uint8Array(ed25519.getPublicKey(payerSeed)));
9845
+ const payerPubkey = base58Encode(
9846
+ new Uint8Array(ed25519.getPublicKey(payerSeed))
9847
+ );
9844
9848
  let payerTokenAccount = cfg.deposit?.payerTokenAccount;
9845
9849
  if (!payerTokenAccount) {
9846
9850
  if (!cfg.tokenMint) {
@@ -9848,7 +9852,10 @@ var OnChainChannelClient = class {
9848
9852
  "Solana deposit requires solanaConfig.deposit.payerTokenAccount or solanaConfig.tokenMint to derive the payer ATA."
9849
9853
  );
9850
9854
  }
9851
- payerTokenAccount = deriveAssociatedTokenAccount(payerPubkey, cfg.tokenMint);
9855
+ payerTokenAccount = deriveAssociatedTokenAccount(
9856
+ payerPubkey,
9857
+ cfg.tokenMint
9858
+ );
9852
9859
  }
9853
9860
  const { depositTxSignature } = await depositSolanaChannel({
9854
9861
  rpcUrl: cfg.rpcUrl,
@@ -9859,7 +9866,10 @@ var OnChainChannelClient = class {
9859
9866
  payerTokenAccount,
9860
9867
  amount
9861
9868
  });
9862
- return { txHash: depositTxSignature, depositTotal: currentDeposit + amount };
9869
+ return {
9870
+ txHash: depositTxSignature,
9871
+ depositTotal: currentDeposit + amount
9872
+ };
9863
9873
  }
9864
9874
  /**
9865
9875
  * EVM deposit: approve the token-network for the delta if the allowance is
@@ -9928,7 +9938,11 @@ var OnChainChannelClient = class {
9928
9938
  args: [channelId]
9929
9939
  });
9930
9940
  await publicClient.waitForTransactionReceipt({ hash: closeHash });
9931
- const info = await this.readEvmChannel(publicClient, tokenNetworkAddr, channelId);
9941
+ const info = await this.readEvmChannel(
9942
+ publicClient,
9943
+ tokenNetworkAddr,
9944
+ channelId
9945
+ );
9932
9946
  return {
9933
9947
  txHash: closeHash,
9934
9948
  closedAt: info.closedAt,
@@ -9972,13 +9986,20 @@ var OnChainChannelClient = class {
9972
9986
  */
9973
9987
  async getChannelCloseInfo(channelId) {
9974
9988
  const ctx = this.channelContext.get(channelId);
9975
- if (!ctx) throw new Error(`No on-chain context for channel "${channelId}".`);
9989
+ if (!ctx)
9990
+ throw new Error(`No on-chain context for channel "${channelId}".`);
9976
9991
  const chainPrefix = ctx.chain.split(":")[0];
9977
9992
  if (chainPrefix === "solana" || chainPrefix === "mina") {
9978
- throw new Error(`getChannelCloseInfo on ${chainPrefix} is not supported.`);
9993
+ throw new Error(
9994
+ `getChannelCloseInfo on ${chainPrefix} is not supported.`
9995
+ );
9979
9996
  }
9980
9997
  const { publicClient } = this.createClients(ctx.chain);
9981
- const info = await this.readEvmChannel(publicClient, ctx.tokenNetworkAddress, channelId);
9998
+ const info = await this.readEvmChannel(
9999
+ publicClient,
10000
+ ctx.tokenNetworkAddress,
10001
+ channelId
10002
+ );
9982
10003
  return {
9983
10004
  status: STATE_MAP2[info.state] ?? "open",
9984
10005
  closedAt: info.closedAt,
@@ -9994,7 +10015,11 @@ var OnChainChannelClient = class {
9994
10015
  functionName: "channels",
9995
10016
  args: [channelId]
9996
10017
  });
9997
- return { settlementTimeout: res[0], state: Number(res[1]), closedAt: res[2] };
10018
+ return {
10019
+ settlementTimeout: res[0],
10020
+ state: Number(res[1]),
10021
+ closedAt: res[2]
10022
+ };
9998
10023
  }
9999
10024
  /**
10000
10025
  * Read a participant's on-chain channel state — `deposit` (locked collateral),
@@ -10116,13 +10141,14 @@ var OnChainChannelClient = class {
10116
10141
  }
10117
10142
  let zkAppAddress = this.minaConfig.zkAppAddress;
10118
10143
  if (this.minaConfig.autoDeploy) {
10119
- const { ensureOwnedMinaZkApp: ensureOwnedMinaZkApp2 } = await import("./mina-channel-deploy-CO2LMPPB-H2N5FX4G.js");
10144
+ const { ensureOwnedMinaZkApp: ensureOwnedMinaZkApp2 } = await import("./mina-channel-deploy-5GPMFBGR-AFX3VUXM.js");
10120
10145
  const ensured = await ensureOwnedMinaZkApp2({
10121
10146
  graphqlUrl: this.minaConfig.graphqlUrl,
10122
10147
  payerPrivateKey: this.minaConfig.privateKey,
10123
10148
  peerPublicKey: params.peerAddress,
10124
10149
  ...this.minaConfig.autoDeploy.deployed ? { deployed: this.minaConfig.autoDeploy.deployed } : {},
10125
10150
  ...zkAppAddress ? { candidateZkAppAddress: zkAppAddress } : {},
10151
+ ...this.minaConfig.autoDeploy.onDeploying ? { onDeploying: this.minaConfig.autoDeploy.onDeploying } : {},
10126
10152
  ...this.minaConfig.autoDeploy.onDeployed ? { onDeployed: this.minaConfig.autoDeploy.onDeployed } : {},
10127
10153
  ...this.minaConfig.autoDeploy.onProgress ? { onProgress: this.minaConfig.autoDeploy.onProgress } : {}
10128
10154
  });
@@ -14531,4 +14557,4 @@ export {
14531
14557
  @scure/bip32/lib/esm/index.js:
14532
14558
  (*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
14533
14559
  */
14534
- //# sourceMappingURL=chunk-JFDVE4IA.js.map
14560
+ //# sourceMappingURL=chunk-5EUJWW4T.js.map